granclaw 0.0.1-beta.95 → 0.0.1-beta.96

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.
@@ -0,0 +1,158 @@
1
+ var bE=Object.defineProperty;var _E=(e,t,n)=>t in e?bE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var U=(e,t,n)=>_E(e,typeof t!="symbol"?t+"":t,n);function wE(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var Hc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var E_={exports:{}},Vu={},N_={exports:{}},me={};/**
2
+ * @license React
3
+ * react.production.min.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var fl=Symbol.for("react.element"),kE=Symbol.for("react.portal"),SE=Symbol.for("react.fragment"),CE=Symbol.for("react.strict_mode"),EE=Symbol.for("react.profiler"),NE=Symbol.for("react.provider"),PE=Symbol.for("react.context"),jE=Symbol.for("react.forward_ref"),TE=Symbol.for("react.suspense"),ME=Symbol.for("react.memo"),RE=Symbol.for("react.lazy"),ax=Symbol.iterator;function DE(e){return e===null||typeof e!="object"?null:(e=ax&&e[ax]||e["@@iterator"],typeof e=="function"?e:null)}var P_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j_=Object.assign,T_={};function fo(e,t,n){this.props=e,this.context=t,this.refs=T_,this.updater=n||P_}fo.prototype.isReactComponent={};fo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};fo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function M_(){}M_.prototype=fo.prototype;function fg(e,t,n){this.props=e,this.context=t,this.refs=T_,this.updater=n||P_}var pg=fg.prototype=new M_;pg.constructor=fg;j_(pg,fo.prototype);pg.isPureReactComponent=!0;var lx=Array.isArray,R_=Object.prototype.hasOwnProperty,gg={current:null},D_={key:!0,ref:!0,__self:!0,__source:!0};function A_(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)R_.call(t,r)&&!D_.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];i.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:fl,type:e,key:s,ref:o,props:i,_owner:gg.current}}function AE(e,t){return{$$typeof:fl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function mg(e){return typeof e=="object"&&e!==null&&e.$$typeof===fl}function IE(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var cx=/\/+/g;function Pd(e,t){return typeof e=="object"&&e!==null&&e.key!=null?IE(""+e.key):t.toString(36)}function pc(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case fl:case kE:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+Pd(o,0):r,lx(i)?(n="",e!=null&&(n=e.replace(cx,"$&/")+"/"),pc(i,t,n,"",function(c){return c})):i!=null&&(mg(i)&&(i=AE(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(cx,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",lx(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+Pd(s,a);o+=pc(s,t,n,l,i)}else if(l=DE(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+Pd(s,a++),o+=pc(s,t,n,l,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function kl(e,t,n){if(e==null)return e;var r=[],i=0;return pc(e,r,"","",function(s){return t.call(n,s,i++)}),r}function LE(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Bt={current:null},gc={transition:null},OE={ReactCurrentDispatcher:Bt,ReactCurrentBatchConfig:gc,ReactCurrentOwner:gg};function I_(){throw Error("act(...) is not supported in production builds of React.")}me.Children={map:kl,forEach:function(e,t,n){kl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return kl(e,function(){t++}),t},toArray:function(e){return kl(e,function(t){return t})||[]},only:function(e){if(!mg(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};me.Component=fo;me.Fragment=SE;me.Profiler=EE;me.PureComponent=fg;me.StrictMode=CE;me.Suspense=TE;me.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=OE;me.act=I_;me.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=j_({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=gg.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)R_.call(t,l)&&!D_.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:fl,type:e.type,key:i,ref:s,props:r,_owner:o}};me.createContext=function(e){return e={$$typeof:PE,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:NE,_context:e},e.Consumer=e};me.createElement=A_;me.createFactory=function(e){var t=A_.bind(null,e);return t.type=e,t};me.createRef=function(){return{current:null}};me.forwardRef=function(e){return{$$typeof:jE,render:e}};me.isValidElement=mg;me.lazy=function(e){return{$$typeof:RE,_payload:{_status:-1,_result:e},_init:LE}};me.memo=function(e,t){return{$$typeof:ME,type:e,compare:t===void 0?null:t}};me.startTransition=function(e){var t=gc.transition;gc.transition={};try{e()}finally{gc.transition=t}};me.unstable_act=I_;me.useCallback=function(e,t){return Bt.current.useCallback(e,t)};me.useContext=function(e){return Bt.current.useContext(e)};me.useDebugValue=function(){};me.useDeferredValue=function(e){return Bt.current.useDeferredValue(e)};me.useEffect=function(e,t){return Bt.current.useEffect(e,t)};me.useId=function(){return Bt.current.useId()};me.useImperativeHandle=function(e,t,n){return Bt.current.useImperativeHandle(e,t,n)};me.useInsertionEffect=function(e,t){return Bt.current.useInsertionEffect(e,t)};me.useLayoutEffect=function(e,t){return Bt.current.useLayoutEffect(e,t)};me.useMemo=function(e,t){return Bt.current.useMemo(e,t)};me.useReducer=function(e,t,n){return Bt.current.useReducer(e,t,n)};me.useRef=function(e){return Bt.current.useRef(e)};me.useState=function(e){return Bt.current.useState(e)};me.useSyncExternalStore=function(e,t,n){return Bt.current.useSyncExternalStore(e,t,n)};me.useTransition=function(){return Bt.current.useTransition()};me.version="18.3.1";N_.exports=me;var E=N_.exports;const xg=hg(E),FE=wE({__proto__:null,default:xg},[E]);/**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var $E=E,zE=Symbol.for("react.element"),BE=Symbol.for("react.fragment"),WE=Object.prototype.hasOwnProperty,HE=$E.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,VE={key:!0,ref:!0,__self:!0,__source:!0};function L_(e,t,n){var r,i={},s=null,o=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)WE.call(t,r)&&!VE.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:zE,type:e,key:s,ref:o,props:i,_owner:HE.current}}Vu.Fragment=BE;Vu.jsx=L_;Vu.jsxs=L_;E_.exports=Vu;var h=E_.exports,sf={},O_={exports:{}},pn={},F_={exports:{}},$_={};/**
18
+ * @license React
19
+ * scheduler.production.min.js
20
+ *
21
+ * Copyright (c) Facebook, Inc. and its affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */(function(e){function t(L,B){var N=L.length;L.push(B);e:for(;0<N;){var Q=N-1>>>1,te=L[Q];if(0<i(te,B))L[Q]=B,L[N]=te,N=Q;else break e}}function n(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var B=L[0],N=L.pop();if(N!==B){L[0]=N;e:for(var Q=0,te=L.length,T=te>>>1;Q<T;){var re=2*(Q+1)-1,le=L[re],ae=re+1,R=L[ae];if(0>i(le,N))ae<te&&0>i(R,le)?(L[Q]=R,L[ae]=N,Q=ae):(L[Q]=le,L[re]=N,Q=re);else if(ae<te&&0>i(R,N))L[Q]=R,L[ae]=N,Q=ae;else break e}}return B}function i(L,B){var N=L.sortIndex-B.sortIndex;return N!==0?N:L.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,d=null,f=3,p=!1,g=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(L){for(var B=n(c);B!==null;){if(B.callback===null)r(c);else if(B.startTime<=L)r(c),B.sortIndex=B.expirationTime,t(l,B);else break;B=n(c)}}function S(L){if(m=!1,b(L),!g)if(n(l)!==null)g=!0,H(k);else{var B=n(c);B!==null&&X(S,B.startTime-L)}}function k(L,B){g=!1,m&&(m=!1,x(P),P=-1),p=!0;var N=f;try{for(b(B),d=n(l);d!==null&&(!(d.expirationTime>B)||L&&!M());){var Q=d.callback;if(typeof Q=="function"){d.callback=null,f=d.priorityLevel;var te=Q(d.expirationTime<=B);B=e.unstable_now(),typeof te=="function"?d.callback=te:d===n(l)&&r(l),b(B)}else r(l);d=n(l)}if(d!==null)var T=!0;else{var re=n(c);re!==null&&X(S,re.startTime-B),T=!1}return T}finally{d=null,f=N,p=!1}}var _=!1,C=null,P=-1,j=5,w=-1;function M(){return!(e.unstable_now()-w<j)}function D(){if(C!==null){var L=e.unstable_now();w=L;var B=!0;try{B=C(!0,L)}finally{B?F():(_=!1,C=null)}}else _=!1}var F;if(typeof v=="function")F=function(){v(D)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,I=$.port2;$.port1.onmessage=D,F=function(){I.postMessage(null)}}else F=function(){y(D,0)};function H(L){C=L,_||(_=!0,F())}function X(L,B){P=y(function(){L(e.unstable_now())},B)}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(L){L.callback=null},e.unstable_continueExecution=function(){g||p||(g=!0,H(k))},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(L){switch(f){case 1:case 2:case 3:var B=3;break;default:B=f}var N=f;f=B;try{return L()}finally{f=N}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(L,B){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var N=f;f=L;try{return B()}finally{f=N}},e.unstable_scheduleCallback=function(L,B,N){var Q=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?Q+N:Q):N=Q,L){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=N+te,L={id:u++,callback:B,priorityLevel:L,startTime:N,expirationTime:te,sortIndex:-1},N>Q?(L.sortIndex=N,t(c,L),n(l)===null&&L===n(c)&&(m?(x(P),P=-1):m=!0,X(S,N-Q))):(L.sortIndex=te,t(l,L),g||p||(g=!0,H(k))),L},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(L){var B=f;return function(){var N=f;f=B;try{return L.apply(this,arguments)}finally{f=N}}}})($_);F_.exports=$_;var UE=F_.exports;/**
26
+ * @license React
27
+ * react-dom.production.min.js
28
+ *
29
+ * Copyright (c) Facebook, Inc. and its affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var qE=E,fn=UE;function z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var z_=new Set,Ra={};function rs(e,t){Xs(e,t),Xs(e+"Capture",t)}function Xs(e,t){for(Ra[e]=t,e=0;e<t.length;e++)z_.add(t[e])}var Cr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),of=Object.prototype.hasOwnProperty,GE=/^[: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]*$/,ux={},dx={};function KE(e){return of.call(dx,e)?!0:of.call(ux,e)?!1:GE.test(e)?dx[e]=!0:(ux[e]=!0,!1)}function YE(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function XE(e,t,n,r){if(t===null||typeof t>"u"||YE(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Wt(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var wt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){wt[e]=new Wt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];wt[t]=new Wt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){wt[e]=new Wt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){wt[e]=new Wt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){wt[e]=new Wt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){wt[e]=new Wt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){wt[e]=new Wt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){wt[e]=new Wt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){wt[e]=new Wt(e,5,!1,e.toLowerCase(),null,!1,!1)});var vg=/[\-:]([a-z])/g;function yg(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(vg,yg);wt[t]=new Wt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(vg,yg);wt[t]=new Wt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(vg,yg);wt[t]=new Wt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){wt[e]=new Wt(e,1,!1,e.toLowerCase(),null,!1,!1)});wt.xlinkHref=new Wt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){wt[e]=new Wt(e,1,!1,e.toLowerCase(),null,!0,!0)});function bg(e,t,n,r){var i=wt.hasOwnProperty(t)?wt[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(XE(t,n,i,r)&&(n=null),r||i===null?KE(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var jr=qE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Sl=Symbol.for("react.element"),Ss=Symbol.for("react.portal"),Cs=Symbol.for("react.fragment"),_g=Symbol.for("react.strict_mode"),af=Symbol.for("react.profiler"),B_=Symbol.for("react.provider"),W_=Symbol.for("react.context"),wg=Symbol.for("react.forward_ref"),lf=Symbol.for("react.suspense"),cf=Symbol.for("react.suspense_list"),kg=Symbol.for("react.memo"),Br=Symbol.for("react.lazy"),H_=Symbol.for("react.offscreen"),hx=Symbol.iterator;function ko(e){return e===null||typeof e!="object"?null:(e=hx&&e[hx]||e["@@iterator"],typeof e=="function"?e:null)}var Ye=Object.assign,jd;function Go(e){if(jd===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);jd=t&&t[1]||""}return`
34
+ `+jd+e}var Td=!1;function Md(e,t){if(!e||Td)return"";Td=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
35
+ `),s=r.stack.split(`
36
+ `),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var l=`
37
+ `+i[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{Td=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Go(e):""}function JE(e){switch(e.tag){case 5:return Go(e.type);case 16:return Go("Lazy");case 13:return Go("Suspense");case 19:return Go("SuspenseList");case 0:case 2:case 15:return e=Md(e.type,!1),e;case 11:return e=Md(e.type.render,!1),e;case 1:return e=Md(e.type,!0),e;default:return""}}function uf(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Cs:return"Fragment";case Ss:return"Portal";case af:return"Profiler";case _g:return"StrictMode";case lf:return"Suspense";case cf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case W_:return(e.displayName||"Context")+".Consumer";case B_:return(e._context.displayName||"Context")+".Provider";case wg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case kg:return t=e.displayName||null,t!==null?t:uf(e.type)||"Memo";case Br:t=e._payload,e=e._init;try{return uf(e(t))}catch{}}return null}function QE(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return uf(t);case 8:return t===_g?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function hi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function V_(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ZE(e){var t=V_(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Cl(e){e._valueTracker||(e._valueTracker=ZE(e))}function U_(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=V_(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function df(e,t){var n=t.checked;return Ye({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fx(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=hi(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function q_(e,t){t=t.checked,t!=null&&bg(e,"checked",t,!1)}function hf(e,t){q_(e,t);var n=hi(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ff(e,t.type,n):t.hasOwnProperty("defaultValue")&&ff(e,t.type,hi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function px(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function ff(e,t,n){(t!=="number"||Vc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ko=Array.isArray;function $s(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+hi(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function pf(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(z(91));return Ye({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function gx(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(z(92));if(Ko(n)){if(1<n.length)throw Error(z(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:hi(n)}}function G_(e,t){var n=hi(t.value),r=hi(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function mx(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function K_(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function gf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?K_(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var El,Y_=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(El=El||document.createElement("div"),El.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=El.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Da(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ca={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},eN=["Webkit","ms","Moz","O"];Object.keys(ca).forEach(function(e){eN.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ca[t]=ca[e]})});function X_(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ca.hasOwnProperty(e)&&ca[e]?(""+t).trim():t+"px"}function J_(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=X_(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var tN=Ye({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function mf(e,t){if(t){if(tN[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function xf(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 vf=null;function Sg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yf=null,zs=null,Bs=null;function xx(e){if(e=ml(e)){if(typeof yf!="function")throw Error(z(280));var t=e.stateNode;t&&(t=Yu(t),yf(e.stateNode,e.type,t))}}function Q_(e){zs?Bs?Bs.push(e):Bs=[e]:zs=e}function Z_(){if(zs){var e=zs,t=Bs;if(Bs=zs=null,xx(e),t)for(e=0;e<t.length;e++)xx(t[e])}}function ew(e,t){return e(t)}function tw(){}var Rd=!1;function nw(e,t,n){if(Rd)return e(t,n);Rd=!0;try{return ew(e,t,n)}finally{Rd=!1,(zs!==null||Bs!==null)&&(tw(),Z_())}}function Aa(e,t){var n=e.stateNode;if(n===null)return null;var r=Yu(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(z(231,t,typeof n));return n}var bf=!1;if(Cr)try{var So={};Object.defineProperty(So,"passive",{get:function(){bf=!0}}),window.addEventListener("test",So,So),window.removeEventListener("test",So,So)}catch{bf=!1}function nN(e,t,n,r,i,s,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var ua=!1,Uc=null,qc=!1,_f=null,rN={onError:function(e){ua=!0,Uc=e}};function iN(e,t,n,r,i,s,o,a,l){ua=!1,Uc=null,nN.apply(rN,arguments)}function sN(e,t,n,r,i,s,o,a,l){if(iN.apply(this,arguments),ua){if(ua){var c=Uc;ua=!1,Uc=null}else throw Error(z(198));qc||(qc=!0,_f=c)}}function is(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function rw(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function vx(e){if(is(e)!==e)throw Error(z(188))}function oN(e){var t=e.alternate;if(!t){if(t=is(e),t===null)throw Error(z(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return vx(i),e;if(s===r)return vx(i),t;s=s.sibling}throw Error(z(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(z(189))}}if(n.alternate!==r)throw Error(z(190))}if(n.tag!==3)throw Error(z(188));return n.stateNode.current===n?e:t}function iw(e){return e=oN(e),e!==null?sw(e):null}function sw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=sw(e);if(t!==null)return t;e=e.sibling}return null}var ow=fn.unstable_scheduleCallback,yx=fn.unstable_cancelCallback,aN=fn.unstable_shouldYield,lN=fn.unstable_requestPaint,tt=fn.unstable_now,cN=fn.unstable_getCurrentPriorityLevel,Cg=fn.unstable_ImmediatePriority,aw=fn.unstable_UserBlockingPriority,Gc=fn.unstable_NormalPriority,uN=fn.unstable_LowPriority,lw=fn.unstable_IdlePriority,Uu=null,nr=null;function dN(e){if(nr&&typeof nr.onCommitFiberRoot=="function")try{nr.onCommitFiberRoot(Uu,e,void 0,(e.current.flags&128)===128)}catch{}}var Fn=Math.clz32?Math.clz32:pN,hN=Math.log,fN=Math.LN2;function pN(e){return e>>>=0,e===0?32:31-(hN(e)/fN|0)|0}var Nl=64,Pl=4194304;function Yo(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Kc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=Yo(a):(s&=o,s!==0&&(r=Yo(s)))}else o=n&~i,o!==0?r=Yo(o):s!==0&&(r=Yo(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Fn(t),i=1<<n,r|=e[n],t&=~i;return r}function gN(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function mN(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-Fn(s),a=1<<o,l=i[o];l===-1?(!(a&n)||a&r)&&(i[o]=gN(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function wf(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function cw(){var e=Nl;return Nl<<=1,!(Nl&4194240)&&(Nl=64),e}function Dd(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Fn(t),e[t]=n}function xN(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-Fn(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function Eg(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Fn(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Te=0;function uw(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var dw,Ng,hw,fw,pw,kf=!1,jl=[],ti=null,ni=null,ri=null,Ia=new Map,La=new Map,Hr=[],vN="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function bx(e,t){switch(e){case"focusin":case"focusout":ti=null;break;case"dragenter":case"dragleave":ni=null;break;case"mouseover":case"mouseout":ri=null;break;case"pointerover":case"pointerout":Ia.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":La.delete(t.pointerId)}}function Co(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=ml(t),t!==null&&Ng(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function yN(e,t,n,r,i){switch(t){case"focusin":return ti=Co(ti,e,t,n,r,i),!0;case"dragenter":return ni=Co(ni,e,t,n,r,i),!0;case"mouseover":return ri=Co(ri,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return Ia.set(s,Co(Ia.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,La.set(s,Co(La.get(s)||null,e,t,n,r,i)),!0}return!1}function gw(e){var t=Fi(e.target);if(t!==null){var n=is(t);if(n!==null){if(t=n.tag,t===13){if(t=rw(n),t!==null){e.blockedOn=t,pw(e.priority,function(){hw(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function mc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);vf=r,n.target.dispatchEvent(r),vf=null}else return t=ml(n),t!==null&&Ng(t),e.blockedOn=n,!1;t.shift()}return!0}function _x(e,t,n){mc(e)&&n.delete(t)}function bN(){kf=!1,ti!==null&&mc(ti)&&(ti=null),ni!==null&&mc(ni)&&(ni=null),ri!==null&&mc(ri)&&(ri=null),Ia.forEach(_x),La.forEach(_x)}function Eo(e,t){e.blockedOn===t&&(e.blockedOn=null,kf||(kf=!0,fn.unstable_scheduleCallback(fn.unstable_NormalPriority,bN)))}function Oa(e){function t(i){return Eo(i,e)}if(0<jl.length){Eo(jl[0],e);for(var n=1;n<jl.length;n++){var r=jl[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ti!==null&&Eo(ti,e),ni!==null&&Eo(ni,e),ri!==null&&Eo(ri,e),Ia.forEach(t),La.forEach(t),n=0;n<Hr.length;n++)r=Hr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Hr.length&&(n=Hr[0],n.blockedOn===null);)gw(n),n.blockedOn===null&&Hr.shift()}var Ws=jr.ReactCurrentBatchConfig,Yc=!0;function _N(e,t,n,r){var i=Te,s=Ws.transition;Ws.transition=null;try{Te=1,Pg(e,t,n,r)}finally{Te=i,Ws.transition=s}}function wN(e,t,n,r){var i=Te,s=Ws.transition;Ws.transition=null;try{Te=4,Pg(e,t,n,r)}finally{Te=i,Ws.transition=s}}function Pg(e,t,n,r){if(Yc){var i=Sf(e,t,n,r);if(i===null)Hd(e,t,r,Xc,n),bx(e,r);else if(yN(i,e,t,n,r))r.stopPropagation();else if(bx(e,r),t&4&&-1<vN.indexOf(e)){for(;i!==null;){var s=ml(i);if(s!==null&&dw(s),s=Sf(e,t,n,r),s===null&&Hd(e,t,r,Xc,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else Hd(e,t,r,null,n)}}var Xc=null;function Sf(e,t,n,r){if(Xc=null,e=Sg(r),e=Fi(e),e!==null)if(t=is(e),t===null)e=null;else if(n=t.tag,n===13){if(e=rw(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Xc=e,null}function mw(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(cN()){case Cg:return 1;case aw:return 4;case Gc:case uN:return 16;case lw:return 536870912;default:return 16}default:return 16}}var Gr=null,jg=null,xc=null;function xw(){if(xc)return xc;var e,t=jg,n=t.length,r,i="value"in Gr?Gr.value:Gr.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return xc=i.slice(e,1<r?1-r:void 0)}function vc(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Tl(){return!0}function wx(){return!1}function gn(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Tl:wx,this.isPropagationStopped=wx,this}return Ye(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Tl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Tl)},persist:function(){},isPersistent:Tl}),t}var po={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tg=gn(po),gl=Ye({},po,{view:0,detail:0}),kN=gn(gl),Ad,Id,No,qu=Ye({},gl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mg,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==No&&(No&&e.type==="mousemove"?(Ad=e.screenX-No.screenX,Id=e.screenY-No.screenY):Id=Ad=0,No=e),Ad)},movementY:function(e){return"movementY"in e?e.movementY:Id}}),kx=gn(qu),SN=Ye({},qu,{dataTransfer:0}),CN=gn(SN),EN=Ye({},gl,{relatedTarget:0}),Ld=gn(EN),NN=Ye({},po,{animationName:0,elapsedTime:0,pseudoElement:0}),PN=gn(NN),jN=Ye({},po,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),TN=gn(jN),MN=Ye({},po,{data:0}),Sx=gn(MN),RN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},DN={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"},AN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function IN(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=AN[e])?!!t[e]:!1}function Mg(){return IN}var LN=Ye({},gl,{key:function(e){if(e.key){var t=RN[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=vc(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?DN[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mg,charCode:function(e){return e.type==="keypress"?vc(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?vc(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ON=gn(LN),FN=Ye({},qu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Cx=gn(FN),$N=Ye({},gl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mg}),zN=gn($N),BN=Ye({},po,{propertyName:0,elapsedTime:0,pseudoElement:0}),WN=gn(BN),HN=Ye({},qu,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),VN=gn(HN),UN=[9,13,27,32],Rg=Cr&&"CompositionEvent"in window,da=null;Cr&&"documentMode"in document&&(da=document.documentMode);var qN=Cr&&"TextEvent"in window&&!da,vw=Cr&&(!Rg||da&&8<da&&11>=da),Ex=" ",Nx=!1;function yw(e,t){switch(e){case"keyup":return UN.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Es=!1;function GN(e,t){switch(e){case"compositionend":return bw(t);case"keypress":return t.which!==32?null:(Nx=!0,Ex);case"textInput":return e=t.data,e===Ex&&Nx?null:e;default:return null}}function KN(e,t){if(Es)return e==="compositionend"||!Rg&&yw(e,t)?(e=xw(),xc=jg=Gr=null,Es=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return vw&&t.locale!=="ko"?null:t.data;default:return null}}var YN={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 Px(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!YN[e.type]:t==="textarea"}function _w(e,t,n,r){Q_(r),t=Jc(t,"onChange"),0<t.length&&(n=new Tg("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ha=null,Fa=null;function XN(e){Rw(e,0)}function Gu(e){var t=js(e);if(U_(t))return e}function JN(e,t){if(e==="change")return t}var ww=!1;if(Cr){var Od;if(Cr){var Fd="oninput"in document;if(!Fd){var jx=document.createElement("div");jx.setAttribute("oninput","return;"),Fd=typeof jx.oninput=="function"}Od=Fd}else Od=!1;ww=Od&&(!document.documentMode||9<document.documentMode)}function Tx(){ha&&(ha.detachEvent("onpropertychange",kw),Fa=ha=null)}function kw(e){if(e.propertyName==="value"&&Gu(Fa)){var t=[];_w(t,Fa,e,Sg(e)),nw(XN,t)}}function QN(e,t,n){e==="focusin"?(Tx(),ha=t,Fa=n,ha.attachEvent("onpropertychange",kw)):e==="focusout"&&Tx()}function ZN(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Gu(Fa)}function eP(e,t){if(e==="click")return Gu(t)}function tP(e,t){if(e==="input"||e==="change")return Gu(t)}function nP(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Wn=typeof Object.is=="function"?Object.is:nP;function $a(e,t){if(Wn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!of.call(t,i)||!Wn(e[i],t[i]))return!1}return!0}function Mx(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Rx(e,t){var n=Mx(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Mx(n)}}function Sw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cw(){for(var e=window,t=Vc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vc(e.document)}return t}function Dg(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function rP(e){var t=Cw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Sw(n.ownerDocument.documentElement,n)){if(r!==null&&Dg(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=Rx(n,s);var o=Rx(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var iP=Cr&&"documentMode"in document&&11>=document.documentMode,Ns=null,Cf=null,fa=null,Ef=!1;function Dx(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ef||Ns==null||Ns!==Vc(r)||(r=Ns,"selectionStart"in r&&Dg(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),fa&&$a(fa,r)||(fa=r,r=Jc(Cf,"onSelect"),0<r.length&&(t=new Tg("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ns)))}function Ml(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ps={animationend:Ml("Animation","AnimationEnd"),animationiteration:Ml("Animation","AnimationIteration"),animationstart:Ml("Animation","AnimationStart"),transitionend:Ml("Transition","TransitionEnd")},$d={},Ew={};Cr&&(Ew=document.createElement("div").style,"AnimationEvent"in window||(delete Ps.animationend.animation,delete Ps.animationiteration.animation,delete Ps.animationstart.animation),"TransitionEvent"in window||delete Ps.transitionend.transition);function Ku(e){if($d[e])return $d[e];if(!Ps[e])return e;var t=Ps[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Ew)return $d[e]=t[n];return e}var Nw=Ku("animationend"),Pw=Ku("animationiteration"),jw=Ku("animationstart"),Tw=Ku("transitionend"),Mw=new Map,Ax="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function mi(e,t){Mw.set(e,t),rs(t,[e])}for(var zd=0;zd<Ax.length;zd++){var Bd=Ax[zd],sP=Bd.toLowerCase(),oP=Bd[0].toUpperCase()+Bd.slice(1);mi(sP,"on"+oP)}mi(Nw,"onAnimationEnd");mi(Pw,"onAnimationIteration");mi(jw,"onAnimationStart");mi("dblclick","onDoubleClick");mi("focusin","onFocus");mi("focusout","onBlur");mi(Tw,"onTransitionEnd");Xs("onMouseEnter",["mouseout","mouseover"]);Xs("onMouseLeave",["mouseout","mouseover"]);Xs("onPointerEnter",["pointerout","pointerover"]);Xs("onPointerLeave",["pointerout","pointerover"]);rs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));rs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));rs("onBeforeInput",["compositionend","keypress","textInput","paste"]);rs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));rs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));rs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xo="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(" "),aP=new Set("cancel close invalid load scroll toggle".split(" ").concat(Xo));function Ix(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,sN(r,t,void 0,e),e.currentTarget=null}function Rw(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&i.isPropagationStopped())break e;Ix(i,a,c),s=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&i.isPropagationStopped())break e;Ix(i,a,c),s=l}}}if(qc)throw e=_f,qc=!1,_f=null,e}function Fe(e,t){var n=t[Mf];n===void 0&&(n=t[Mf]=new Set);var r=e+"__bubble";n.has(r)||(Dw(t,e,2,!1),n.add(r))}function Wd(e,t,n){var r=0;t&&(r|=4),Dw(n,e,r,t)}var Rl="_reactListening"+Math.random().toString(36).slice(2);function za(e){if(!e[Rl]){e[Rl]=!0,z_.forEach(function(n){n!=="selectionchange"&&(aP.has(n)||Wd(n,!1,e),Wd(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Rl]||(t[Rl]=!0,Wd("selectionchange",!1,t))}}function Dw(e,t,n,r){switch(mw(t)){case 1:var i=_N;break;case 4:i=wN;break;default:i=Pg}n=i.bind(null,t,n,e),i=void 0,!bf||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Hd(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;o=o.return}for(;a!==null;){if(o=Fi(a),o===null)return;if(l=o.tag,l===5||l===6){r=s=o;continue e}a=a.parentNode}}r=r.return}nw(function(){var c=s,u=Sg(n),d=[];e:{var f=Mw.get(e);if(f!==void 0){var p=Tg,g=e;switch(e){case"keypress":if(vc(n)===0)break e;case"keydown":case"keyup":p=ON;break;case"focusin":g="focus",p=Ld;break;case"focusout":g="blur",p=Ld;break;case"beforeblur":case"afterblur":p=Ld;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=kx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=CN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=zN;break;case Nw:case Pw:case jw:p=PN;break;case Tw:p=WN;break;case"scroll":p=kN;break;case"wheel":p=VN;break;case"copy":case"cut":case"paste":p=TN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Cx}var m=(t&4)!==0,y=!m&&e==="scroll",x=m?f!==null?f+"Capture":null:f;m=[];for(var v=c,b;v!==null;){b=v;var S=b.stateNode;if(b.tag===5&&S!==null&&(b=S,x!==null&&(S=Aa(v,x),S!=null&&m.push(Ba(v,S,b)))),y)break;v=v.return}0<m.length&&(f=new p(f,g,null,n,u),d.push({event:f,listeners:m}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",f&&n!==vf&&(g=n.relatedTarget||n.fromElement)&&(Fi(g)||g[Er]))break e;if((p||f)&&(f=u.window===u?u:(f=u.ownerDocument)?f.defaultView||f.parentWindow:window,p?(g=n.relatedTarget||n.toElement,p=c,g=g?Fi(g):null,g!==null&&(y=is(g),g!==y||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=c),p!==g)){if(m=kx,S="onMouseLeave",x="onMouseEnter",v="mouse",(e==="pointerout"||e==="pointerover")&&(m=Cx,S="onPointerLeave",x="onPointerEnter",v="pointer"),y=p==null?f:js(p),b=g==null?f:js(g),f=new m(S,v+"leave",p,n,u),f.target=y,f.relatedTarget=b,S=null,Fi(u)===c&&(m=new m(x,v+"enter",g,n,u),m.target=b,m.relatedTarget=y,S=m),y=S,p&&g)t:{for(m=p,x=g,v=0,b=m;b;b=us(b))v++;for(b=0,S=x;S;S=us(S))b++;for(;0<v-b;)m=us(m),v--;for(;0<b-v;)x=us(x),b--;for(;v--;){if(m===x||x!==null&&m===x.alternate)break t;m=us(m),x=us(x)}m=null}else m=null;p!==null&&Lx(d,f,p,m,!1),g!==null&&y!==null&&Lx(d,y,g,m,!0)}}e:{if(f=c?js(c):window,p=f.nodeName&&f.nodeName.toLowerCase(),p==="select"||p==="input"&&f.type==="file")var k=JN;else if(Px(f))if(ww)k=tP;else{k=ZN;var _=QN}else(p=f.nodeName)&&p.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(k=eP);if(k&&(k=k(e,c))){_w(d,k,n,u);break e}_&&_(e,f,c),e==="focusout"&&(_=f._wrapperState)&&_.controlled&&f.type==="number"&&ff(f,"number",f.value)}switch(_=c?js(c):window,e){case"focusin":(Px(_)||_.contentEditable==="true")&&(Ns=_,Cf=c,fa=null);break;case"focusout":fa=Cf=Ns=null;break;case"mousedown":Ef=!0;break;case"contextmenu":case"mouseup":case"dragend":Ef=!1,Dx(d,n,u);break;case"selectionchange":if(iP)break;case"keydown":case"keyup":Dx(d,n,u)}var C;if(Rg)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Es?yw(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(vw&&n.locale!=="ko"&&(Es||P!=="onCompositionStart"?P==="onCompositionEnd"&&Es&&(C=xw()):(Gr=u,jg="value"in Gr?Gr.value:Gr.textContent,Es=!0)),_=Jc(c,P),0<_.length&&(P=new Sx(P,e,null,n,u),d.push({event:P,listeners:_}),C?P.data=C:(C=bw(n),C!==null&&(P.data=C)))),(C=qN?GN(e,n):KN(e,n))&&(c=Jc(c,"onBeforeInput"),0<c.length&&(u=new Sx("onBeforeInput","beforeinput",null,n,u),d.push({event:u,listeners:c}),u.data=C))}Rw(d,t)})}function Ba(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jc(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=Aa(e,n),s!=null&&r.unshift(Ba(e,s,i)),s=Aa(e,t),s!=null&&r.push(Ba(e,s,i))),e=e.return}return r}function us(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Lx(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=Aa(n,s),l!=null&&o.unshift(Ba(n,l,a))):i||(l=Aa(n,s),l!=null&&o.push(Ba(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var lP=/\r\n?/g,cP=/\u0000|\uFFFD/g;function Ox(e){return(typeof e=="string"?e:""+e).replace(lP,`
38
+ `).replace(cP,"")}function Dl(e,t,n){if(t=Ox(t),Ox(e)!==t&&n)throw Error(z(425))}function Qc(){}var Nf=null,Pf=null;function jf(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Tf=typeof setTimeout=="function"?setTimeout:void 0,uP=typeof clearTimeout=="function"?clearTimeout:void 0,Fx=typeof Promise=="function"?Promise:void 0,dP=typeof queueMicrotask=="function"?queueMicrotask:typeof Fx<"u"?function(e){return Fx.resolve(null).then(e).catch(hP)}:Tf;function hP(e){setTimeout(function(){throw e})}function Vd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),Oa(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Oa(t)}function ii(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function $x(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var go=Math.random().toString(36).slice(2),Qn="__reactFiber$"+go,Wa="__reactProps$"+go,Er="__reactContainer$"+go,Mf="__reactEvents$"+go,fP="__reactListeners$"+go,pP="__reactHandles$"+go;function Fi(e){var t=e[Qn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Er]||n[Qn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$x(e);e!==null;){if(n=e[Qn])return n;e=$x(e)}return t}e=n,n=e.parentNode}return null}function ml(e){return e=e[Qn]||e[Er],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function js(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(z(33))}function Yu(e){return e[Wa]||null}var Rf=[],Ts=-1;function xi(e){return{current:e}}function Be(e){0>Ts||(e.current=Rf[Ts],Rf[Ts]=null,Ts--)}function Oe(e,t){Ts++,Rf[Ts]=e.current,e.current=t}var fi={},Mt=xi(fi),Xt=xi(!1),Ki=fi;function Js(e,t){var n=e.type.contextTypes;if(!n)return fi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Jt(e){return e=e.childContextTypes,e!=null}function Zc(){Be(Xt),Be(Mt)}function zx(e,t,n){if(Mt.current!==fi)throw Error(z(168));Oe(Mt,t),Oe(Xt,n)}function Aw(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(z(108,QE(e)||"Unknown",i));return Ye({},n,r)}function eu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||fi,Ki=Mt.current,Oe(Mt,e),Oe(Xt,Xt.current),!0}function Bx(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=Aw(e,t,Ki),r.__reactInternalMemoizedMergedChildContext=e,Be(Xt),Be(Mt),Oe(Mt,e)):Be(Xt),Oe(Xt,n)}var gr=null,Xu=!1,Ud=!1;function Iw(e){gr===null?gr=[e]:gr.push(e)}function gP(e){Xu=!0,Iw(e)}function vi(){if(!Ud&&gr!==null){Ud=!0;var e=0,t=Te;try{var n=gr;for(Te=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}gr=null,Xu=!1}catch(i){throw gr!==null&&(gr=gr.slice(e+1)),ow(Cg,vi),i}finally{Te=t,Ud=!1}}return null}var Ms=[],Rs=0,tu=null,nu=0,bn=[],_n=0,Yi=null,vr=1,yr="";function Mi(e,t){Ms[Rs++]=nu,Ms[Rs++]=tu,tu=e,nu=t}function Lw(e,t,n){bn[_n++]=vr,bn[_n++]=yr,bn[_n++]=Yi,Yi=e;var r=vr;e=yr;var i=32-Fn(r)-1;r&=~(1<<i),n+=1;var s=32-Fn(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,vr=1<<32-Fn(t)+i|n<<i|r,yr=s+e}else vr=1<<s|n<<i|r,yr=e}function Ag(e){e.return!==null&&(Mi(e,1),Lw(e,1,0))}function Ig(e){for(;e===tu;)tu=Ms[--Rs],Ms[Rs]=null,nu=Ms[--Rs],Ms[Rs]=null;for(;e===Yi;)Yi=bn[--_n],bn[_n]=null,yr=bn[--_n],bn[_n]=null,vr=bn[--_n],bn[_n]=null}var un=null,ln=null,He=!1,Ln=null;function Ow(e,t){var n=Sn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Wx(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,un=e,ln=ii(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,un=e,ln=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Yi!==null?{id:vr,overflow:yr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Sn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,un=e,ln=null,!0):!1;default:return!1}}function Df(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Af(e){if(He){var t=ln;if(t){var n=t;if(!Wx(e,t)){if(Df(e))throw Error(z(418));t=ii(n.nextSibling);var r=un;t&&Wx(e,t)?Ow(r,n):(e.flags=e.flags&-4097|2,He=!1,un=e)}}else{if(Df(e))throw Error(z(418));e.flags=e.flags&-4097|2,He=!1,un=e}}}function Hx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;un=e}function Al(e){if(e!==un)return!1;if(!He)return Hx(e),He=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!jf(e.type,e.memoizedProps)),t&&(t=ln)){if(Df(e))throw Fw(),Error(z(418));for(;t;)Ow(e,t),t=ii(t.nextSibling)}if(Hx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(z(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ln=ii(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ln=null}}else ln=un?ii(e.stateNode.nextSibling):null;return!0}function Fw(){for(var e=ln;e;)e=ii(e.nextSibling)}function Qs(){ln=un=null,He=!1}function Lg(e){Ln===null?Ln=[e]:Ln.push(e)}var mP=jr.ReactCurrentBatchConfig;function Po(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(z(309));var r=n.stateNode}if(!r)throw Error(z(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(z(284));if(!n._owner)throw Error(z(290,e))}return e}function Il(e,t){throw e=Object.prototype.toString.call(t),Error(z(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Vx(e){var t=e._init;return t(e._payload)}function $w(e){function t(x,v){if(e){var b=x.deletions;b===null?(x.deletions=[v],x.flags|=16):b.push(v)}}function n(x,v){if(!e)return null;for(;v!==null;)t(x,v),v=v.sibling;return null}function r(x,v){for(x=new Map;v!==null;)v.key!==null?x.set(v.key,v):x.set(v.index,v),v=v.sibling;return x}function i(x,v){return x=li(x,v),x.index=0,x.sibling=null,x}function s(x,v,b){return x.index=b,e?(b=x.alternate,b!==null?(b=b.index,b<v?(x.flags|=2,v):b):(x.flags|=2,v)):(x.flags|=1048576,v)}function o(x){return e&&x.alternate===null&&(x.flags|=2),x}function a(x,v,b,S){return v===null||v.tag!==6?(v=Qd(b,x.mode,S),v.return=x,v):(v=i(v,b),v.return=x,v)}function l(x,v,b,S){var k=b.type;return k===Cs?u(x,v,b.props.children,S,b.key):v!==null&&(v.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Br&&Vx(k)===v.type)?(S=i(v,b.props),S.ref=Po(x,v,b),S.return=x,S):(S=Cc(b.type,b.key,b.props,null,x.mode,S),S.ref=Po(x,v,b),S.return=x,S)}function c(x,v,b,S){return v===null||v.tag!==4||v.stateNode.containerInfo!==b.containerInfo||v.stateNode.implementation!==b.implementation?(v=Zd(b,x.mode,S),v.return=x,v):(v=i(v,b.children||[]),v.return=x,v)}function u(x,v,b,S,k){return v===null||v.tag!==7?(v=Hi(b,x.mode,S,k),v.return=x,v):(v=i(v,b),v.return=x,v)}function d(x,v,b){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Qd(""+v,x.mode,b),v.return=x,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Sl:return b=Cc(v.type,v.key,v.props,null,x.mode,b),b.ref=Po(x,null,v),b.return=x,b;case Ss:return v=Zd(v,x.mode,b),v.return=x,v;case Br:var S=v._init;return d(x,S(v._payload),b)}if(Ko(v)||ko(v))return v=Hi(v,x.mode,b,null),v.return=x,v;Il(x,v)}return null}function f(x,v,b,S){var k=v!==null?v.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return k!==null?null:a(x,v,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Sl:return b.key===k?l(x,v,b,S):null;case Ss:return b.key===k?c(x,v,b,S):null;case Br:return k=b._init,f(x,v,k(b._payload),S)}if(Ko(b)||ko(b))return k!==null?null:u(x,v,b,S,null);Il(x,b)}return null}function p(x,v,b,S,k){if(typeof S=="string"&&S!==""||typeof S=="number")return x=x.get(b)||null,a(v,x,""+S,k);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Sl:return x=x.get(S.key===null?b:S.key)||null,l(v,x,S,k);case Ss:return x=x.get(S.key===null?b:S.key)||null,c(v,x,S,k);case Br:var _=S._init;return p(x,v,b,_(S._payload),k)}if(Ko(S)||ko(S))return x=x.get(b)||null,u(v,x,S,k,null);Il(v,S)}return null}function g(x,v,b,S){for(var k=null,_=null,C=v,P=v=0,j=null;C!==null&&P<b.length;P++){C.index>P?(j=C,C=null):j=C.sibling;var w=f(x,C,b[P],S);if(w===null){C===null&&(C=j);break}e&&C&&w.alternate===null&&t(x,C),v=s(w,v,P),_===null?k=w:_.sibling=w,_=w,C=j}if(P===b.length)return n(x,C),He&&Mi(x,P),k;if(C===null){for(;P<b.length;P++)C=d(x,b[P],S),C!==null&&(v=s(C,v,P),_===null?k=C:_.sibling=C,_=C);return He&&Mi(x,P),k}for(C=r(x,C);P<b.length;P++)j=p(C,x,P,b[P],S),j!==null&&(e&&j.alternate!==null&&C.delete(j.key===null?P:j.key),v=s(j,v,P),_===null?k=j:_.sibling=j,_=j);return e&&C.forEach(function(M){return t(x,M)}),He&&Mi(x,P),k}function m(x,v,b,S){var k=ko(b);if(typeof k!="function")throw Error(z(150));if(b=k.call(b),b==null)throw Error(z(151));for(var _=k=null,C=v,P=v=0,j=null,w=b.next();C!==null&&!w.done;P++,w=b.next()){C.index>P?(j=C,C=null):j=C.sibling;var M=f(x,C,w.value,S);if(M===null){C===null&&(C=j);break}e&&C&&M.alternate===null&&t(x,C),v=s(M,v,P),_===null?k=M:_.sibling=M,_=M,C=j}if(w.done)return n(x,C),He&&Mi(x,P),k;if(C===null){for(;!w.done;P++,w=b.next())w=d(x,w.value,S),w!==null&&(v=s(w,v,P),_===null?k=w:_.sibling=w,_=w);return He&&Mi(x,P),k}for(C=r(x,C);!w.done;P++,w=b.next())w=p(C,x,P,w.value,S),w!==null&&(e&&w.alternate!==null&&C.delete(w.key===null?P:w.key),v=s(w,v,P),_===null?k=w:_.sibling=w,_=w);return e&&C.forEach(function(D){return t(x,D)}),He&&Mi(x,P),k}function y(x,v,b,S){if(typeof b=="object"&&b!==null&&b.type===Cs&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Sl:e:{for(var k=b.key,_=v;_!==null;){if(_.key===k){if(k=b.type,k===Cs){if(_.tag===7){n(x,_.sibling),v=i(_,b.props.children),v.return=x,x=v;break e}}else if(_.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Br&&Vx(k)===_.type){n(x,_.sibling),v=i(_,b.props),v.ref=Po(x,_,b),v.return=x,x=v;break e}n(x,_);break}else t(x,_);_=_.sibling}b.type===Cs?(v=Hi(b.props.children,x.mode,S,b.key),v.return=x,x=v):(S=Cc(b.type,b.key,b.props,null,x.mode,S),S.ref=Po(x,v,b),S.return=x,x=S)}return o(x);case Ss:e:{for(_=b.key;v!==null;){if(v.key===_)if(v.tag===4&&v.stateNode.containerInfo===b.containerInfo&&v.stateNode.implementation===b.implementation){n(x,v.sibling),v=i(v,b.children||[]),v.return=x,x=v;break e}else{n(x,v);break}else t(x,v);v=v.sibling}v=Zd(b,x.mode,S),v.return=x,x=v}return o(x);case Br:return _=b._init,y(x,v,_(b._payload),S)}if(Ko(b))return g(x,v,b,S);if(ko(b))return m(x,v,b,S);Il(x,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,v!==null&&v.tag===6?(n(x,v.sibling),v=i(v,b),v.return=x,x=v):(n(x,v),v=Qd(b,x.mode,S),v.return=x,x=v),o(x)):n(x,v)}return y}var Zs=$w(!0),zw=$w(!1),ru=xi(null),iu=null,Ds=null,Og=null;function Fg(){Og=Ds=iu=null}function $g(e){var t=ru.current;Be(ru),e._currentValue=t}function If(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Hs(e,t){iu=e,Og=Ds=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Kt=!0),e.firstContext=null)}function Nn(e){var t=e._currentValue;if(Og!==e)if(e={context:e,memoizedValue:t,next:null},Ds===null){if(iu===null)throw Error(z(308));Ds=e,iu.dependencies={lanes:0,firstContext:e}}else Ds=Ds.next=e;return t}var $i=null;function zg(e){$i===null?$i=[e]:$i.push(e)}function Bw(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,zg(t)):(n.next=i.next,i.next=n),t.interleaved=n,Nr(e,r)}function Nr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Wr=!1;function Bg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ww(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Sr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function si(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ee&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Nr(e,n)}return i=r.interleaved,i===null?(t.next=t,zg(r)):(t.next=i.next,i.next=t),r.interleaved=t,Nr(e,n)}function yc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Eg(e,n)}}function Ux(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function su(e,t,n,r){var i=e.updateQueue;Wr=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?s=c:o.next=c,o=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==o&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(s!==null){var d=i.baseState;o=0,u=c=l=null,a=s;do{var f=a.lane,p=a.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=e,m=a;switch(f=t,p=n,m.tag){case 1:if(g=m.payload,typeof g=="function"){d=g.call(p,d,f);break e}d=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=m.payload,f=typeof g=="function"?g.call(p,d,f):g,f==null)break e;d=Ye({},d,f);break e;case 2:Wr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=p,l=d):u=u.next=p,o|=f;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;f=a,a=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(u===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Ji|=o,e.lanes=o,e.memoizedState=d}}function qx(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(z(191,i));i.call(r)}}}var xl={},rr=xi(xl),Ha=xi(xl),Va=xi(xl);function zi(e){if(e===xl)throw Error(z(174));return e}function Wg(e,t){switch(Oe(Va,t),Oe(Ha,e),Oe(rr,xl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:gf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=gf(t,e)}Be(rr),Oe(rr,t)}function eo(){Be(rr),Be(Ha),Be(Va)}function Hw(e){zi(Va.current);var t=zi(rr.current),n=gf(t,e.type);t!==n&&(Oe(Ha,e),Oe(rr,n))}function Hg(e){Ha.current===e&&(Be(rr),Be(Ha))}var qe=xi(0);function ou(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var qd=[];function Vg(){for(var e=0;e<qd.length;e++)qd[e]._workInProgressVersionPrimary=null;qd.length=0}var bc=jr.ReactCurrentDispatcher,Gd=jr.ReactCurrentBatchConfig,Xi=0,Ke=null,ut=null,pt=null,au=!1,pa=!1,Ua=0,xP=0;function kt(){throw Error(z(321))}function Ug(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Wn(e[n],t[n]))return!1;return!0}function qg(e,t,n,r,i,s){if(Xi=s,Ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,bc.current=e===null||e.memoizedState===null?_P:wP,e=n(r,i),pa){s=0;do{if(pa=!1,Ua=0,25<=s)throw Error(z(301));s+=1,pt=ut=null,t.updateQueue=null,bc.current=kP,e=n(r,i)}while(pa)}if(bc.current=lu,t=ut!==null&&ut.next!==null,Xi=0,pt=ut=Ke=null,au=!1,t)throw Error(z(300));return e}function Gg(){var e=Ua!==0;return Ua=0,e}function Gn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pt===null?Ke.memoizedState=pt=e:pt=pt.next=e,pt}function Pn(){if(ut===null){var e=Ke.alternate;e=e!==null?e.memoizedState:null}else e=ut.next;var t=pt===null?Ke.memoizedState:pt.next;if(t!==null)pt=t,ut=e;else{if(e===null)throw Error(z(310));ut=e,e={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},pt===null?Ke.memoizedState=pt=e:pt=pt.next=e}return pt}function qa(e,t){return typeof t=="function"?t(e):t}function Kd(e){var t=Pn(),n=t.queue;if(n===null)throw Error(z(311));n.lastRenderedReducer=e;var r=ut,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,l=null,c=s;do{var u=c.lane;if((Xi&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,o=r):l=l.next=d,Ke.lanes|=u,Ji|=u}c=c.next}while(c!==null&&c!==s);l===null?o=r:l.next=a,Wn(r,t.memoizedState)||(Kt=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,Ke.lanes|=s,Ji|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Yd(e){var t=Pn(),n=t.queue;if(n===null)throw Error(z(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);Wn(s,t.memoizedState)||(Kt=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function Vw(){}function Uw(e,t){var n=Ke,r=Pn(),i=t(),s=!Wn(r.memoizedState,i);if(s&&(r.memoizedState=i,Kt=!0),r=r.queue,Kg(Kw.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||pt!==null&&pt.memoizedState.tag&1){if(n.flags|=2048,Ga(9,Gw.bind(null,n,r,i,t),void 0,null),mt===null)throw Error(z(349));Xi&30||qw(n,t,i)}return i}function qw(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ke.updateQueue,t===null?(t={lastEffect:null,stores:null},Ke.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Gw(e,t,n,r){t.value=n,t.getSnapshot=r,Yw(t)&&Xw(e)}function Kw(e,t,n){return n(function(){Yw(t)&&Xw(e)})}function Yw(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wn(e,n)}catch{return!0}}function Xw(e){var t=Nr(e,1);t!==null&&$n(t,e,1,-1)}function Gx(e){var t=Gn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:e},t.queue=e,e=e.dispatch=bP.bind(null,Ke,e),[t.memoizedState,e]}function Ga(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ke.updateQueue,t===null?(t={lastEffect:null,stores:null},Ke.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Jw(){return Pn().memoizedState}function _c(e,t,n,r){var i=Gn();Ke.flags|=e,i.memoizedState=Ga(1|t,n,void 0,r===void 0?null:r)}function Ju(e,t,n,r){var i=Pn();r=r===void 0?null:r;var s=void 0;if(ut!==null){var o=ut.memoizedState;if(s=o.destroy,r!==null&&Ug(r,o.deps)){i.memoizedState=Ga(t,n,s,r);return}}Ke.flags|=e,i.memoizedState=Ga(1|t,n,s,r)}function Kx(e,t){return _c(8390656,8,e,t)}function Kg(e,t){return Ju(2048,8,e,t)}function Qw(e,t){return Ju(4,2,e,t)}function Zw(e,t){return Ju(4,4,e,t)}function e1(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function t1(e,t,n){return n=n!=null?n.concat([e]):null,Ju(4,4,e1.bind(null,t,e),n)}function Yg(){}function n1(e,t){var n=Pn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ug(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function r1(e,t){var n=Pn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Ug(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function i1(e,t,n){return Xi&21?(Wn(n,t)||(n=cw(),Ke.lanes|=n,Ji|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Kt=!0),e.memoizedState=n)}function vP(e,t){var n=Te;Te=n!==0&&4>n?n:4,e(!0);var r=Gd.transition;Gd.transition={};try{e(!1),t()}finally{Te=n,Gd.transition=r}}function s1(){return Pn().memoizedState}function yP(e,t,n){var r=ai(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},o1(e))a1(t,n);else if(n=Bw(e,t,n,r),n!==null){var i=zt();$n(n,e,r,i),l1(n,t,r)}}function bP(e,t,n){var r=ai(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(o1(e))a1(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,Wn(a,o)){var l=t.interleaved;l===null?(i.next=i,zg(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=Bw(e,t,i,r),n!==null&&(i=zt(),$n(n,e,r,i),l1(n,t,r))}}function o1(e){var t=e.alternate;return e===Ke||t!==null&&t===Ke}function a1(e,t){pa=au=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function l1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Eg(e,n)}}var lu={readContext:Nn,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useInsertionEffect:kt,useLayoutEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useMutableSource:kt,useSyncExternalStore:kt,useId:kt,unstable_isNewReconciler:!1},_P={readContext:Nn,useCallback:function(e,t){return Gn().memoizedState=[e,t===void 0?null:t],e},useContext:Nn,useEffect:Kx,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,_c(4194308,4,e1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _c(4194308,4,e,t)},useInsertionEffect:function(e,t){return _c(4,2,e,t)},useMemo:function(e,t){var n=Gn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Gn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=yP.bind(null,Ke,e),[r.memoizedState,e]},useRef:function(e){var t=Gn();return e={current:e},t.memoizedState=e},useState:Gx,useDebugValue:Yg,useDeferredValue:function(e){return Gn().memoizedState=e},useTransition:function(){var e=Gx(!1),t=e[0];return e=vP.bind(null,e[1]),Gn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ke,i=Gn();if(He){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),mt===null)throw Error(z(349));Xi&30||qw(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Kx(Kw.bind(null,r,s,e),[e]),r.flags|=2048,Ga(9,Gw.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Gn(),t=mt.identifierPrefix;if(He){var n=yr,r=vr;n=(r&~(1<<32-Fn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ua++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=xP++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},wP={readContext:Nn,useCallback:n1,useContext:Nn,useEffect:Kg,useImperativeHandle:t1,useInsertionEffect:Qw,useLayoutEffect:Zw,useMemo:r1,useReducer:Kd,useRef:Jw,useState:function(){return Kd(qa)},useDebugValue:Yg,useDeferredValue:function(e){var t=Pn();return i1(t,ut.memoizedState,e)},useTransition:function(){var e=Kd(qa)[0],t=Pn().memoizedState;return[e,t]},useMutableSource:Vw,useSyncExternalStore:Uw,useId:s1,unstable_isNewReconciler:!1},kP={readContext:Nn,useCallback:n1,useContext:Nn,useEffect:Kg,useImperativeHandle:t1,useInsertionEffect:Qw,useLayoutEffect:Zw,useMemo:r1,useReducer:Yd,useRef:Jw,useState:function(){return Yd(qa)},useDebugValue:Yg,useDeferredValue:function(e){var t=Pn();return ut===null?t.memoizedState=e:i1(t,ut.memoizedState,e)},useTransition:function(){var e=Yd(qa)[0],t=Pn().memoizedState;return[e,t]},useMutableSource:Vw,useSyncExternalStore:Uw,useId:s1,unstable_isNewReconciler:!1};function Rn(e,t){if(e&&e.defaultProps){t=Ye({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Lf(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ye({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Qu={isMounted:function(e){return(e=e._reactInternals)?is(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=zt(),i=ai(e),s=Sr(r,i);s.payload=t,n!=null&&(s.callback=n),t=si(e,s,i),t!==null&&($n(t,e,i,r),yc(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=zt(),i=ai(e),s=Sr(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=si(e,s,i),t!==null&&($n(t,e,i,r),yc(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=zt(),r=ai(e),i=Sr(n,r);i.tag=2,t!=null&&(i.callback=t),t=si(e,i,r),t!==null&&($n(t,e,r,n),yc(t,e,r))}};function Yx(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!$a(n,r)||!$a(i,s):!0}function c1(e,t,n){var r=!1,i=fi,s=t.contextType;return typeof s=="object"&&s!==null?s=Nn(s):(i=Jt(t)?Ki:Mt.current,r=t.contextTypes,s=(r=r!=null)?Js(e,i):fi),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Qu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function Xx(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Qu.enqueueReplaceState(t,t.state,null)}function Of(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},Bg(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Nn(s):(s=Jt(t)?Ki:Mt.current,i.context=Js(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Lf(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Qu.enqueueReplaceState(i,i.state,null),su(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function to(e,t){try{var n="",r=t;do n+=JE(r),r=r.return;while(r);var i=n}catch(s){i=`
39
+ Error generating stack: `+s.message+`
40
+ `+s.stack}return{value:e,source:t,stack:i,digest:null}}function Xd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ff(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var SP=typeof WeakMap=="function"?WeakMap:Map;function u1(e,t,n){n=Sr(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){uu||(uu=!0,Kf=r),Ff(e,t)},n}function d1(e,t,n){n=Sr(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Ff(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Ff(e,t),typeof r!="function"&&(oi===null?oi=new Set([this]):oi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Jx(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new SP;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=FP.bind(null,e,t,n),t.then(e,e))}function Qx(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Zx(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Sr(-1,1),t.tag=2,si(n,t,1))),n.lanes|=1),e)}var CP=jr.ReactCurrentOwner,Kt=!1;function Ot(e,t,n,r){t.child=e===null?zw(t,null,n,r):Zs(t,e.child,n,r)}function ev(e,t,n,r,i){n=n.render;var s=t.ref;return Hs(t,i),r=qg(e,t,n,r,s,i),n=Gg(),e!==null&&!Kt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Pr(e,t,i)):(He&&n&&Ag(t),t.flags|=1,Ot(e,t,r,i),t.child)}function tv(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!rm(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,h1(e,t,s,r,i)):(e=Cc(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:$a,n(o,r)&&e.ref===t.ref)return Pr(e,t,i)}return t.flags|=1,e=li(s,r),e.ref=t.ref,e.return=t,t.child=e}function h1(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if($a(s,r)&&e.ref===t.ref)if(Kt=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Kt=!0);else return t.lanes=e.lanes,Pr(e,t,i)}return $f(e,t,n,r,i)}function f1(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Oe(Is,on),on|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Oe(Is,on),on|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,Oe(Is,on),on|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,Oe(Is,on),on|=r;return Ot(e,t,i,n),t.child}function p1(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function $f(e,t,n,r,i){var s=Jt(n)?Ki:Mt.current;return s=Js(t,s),Hs(t,i),n=qg(e,t,n,r,s,i),r=Gg(),e!==null&&!Kt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Pr(e,t,i)):(He&&r&&Ag(t),t.flags|=1,Ot(e,t,n,i),t.child)}function nv(e,t,n,r,i){if(Jt(n)){var s=!0;eu(t)}else s=!1;if(Hs(t,i),t.stateNode===null)wc(e,t),c1(t,n,r),Of(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=Nn(c):(c=Jt(n)?Ki:Mt.current,c=Js(t,c));var u=n.getDerivedStateFromProps,d=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&Xx(t,o,r,c),Wr=!1;var f=t.memoizedState;o.state=f,su(t,r,o,i),l=t.memoizedState,a!==r||f!==l||Xt.current||Wr?(typeof u=="function"&&(Lf(t,n,u,r),l=t.memoizedState),(a=Wr||Yx(t,n,a,r,f,l,c))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,Ww(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Rn(t.type,a),o.props=c,d=t.pendingProps,f=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=Nn(l):(l=Jt(n)?Ki:Mt.current,l=Js(t,l));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==d||f!==l)&&Xx(t,o,r,l),Wr=!1,f=t.memoizedState,o.state=f,su(t,r,o,i);var g=t.memoizedState;a!==d||f!==g||Xt.current||Wr?(typeof p=="function"&&(Lf(t,n,p,r),g=t.memoizedState),(c=Wr||Yx(t,n,c,r,f,g,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,g,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,g,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),o.props=r,o.state=g,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return zf(e,t,n,r,s,i)}function zf(e,t,n,r,i,s){p1(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&Bx(t,n,!1),Pr(e,t,s);r=t.stateNode,CP.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Zs(t,e.child,null,s),t.child=Zs(t,null,a,s)):Ot(e,t,a,s),t.memoizedState=r.state,i&&Bx(t,n,!0),t.child}function g1(e){var t=e.stateNode;t.pendingContext?zx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&zx(e,t.context,!1),Wg(e,t.containerInfo)}function rv(e,t,n,r,i){return Qs(),Lg(i),t.flags|=256,Ot(e,t,n,r),t.child}var Bf={dehydrated:null,treeContext:null,retryLane:0};function Wf(e){return{baseLanes:e,cachePool:null,transitions:null}}function m1(e,t,n){var r=t.pendingProps,i=qe.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Oe(qe,i&1),e===null)return Af(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=td(o,r,0,null),e=Hi(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Wf(n),t.memoizedState=Bf,e):Xg(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return EP(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=li(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=li(a,s):(s=Hi(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?Wf(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=Bf,r}return s=e.child,e=s.sibling,r=li(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Xg(e,t){return t=td({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ll(e,t,n,r){return r!==null&&Lg(r),Zs(t,e.child,null,n),e=Xg(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function EP(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=Xd(Error(z(422))),Ll(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=td({mode:"visible",children:r.children},i,0,null),s=Hi(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Zs(t,e.child,null,o),t.child.memoizedState=Wf(o),t.memoizedState=Bf,s);if(!(t.mode&1))return Ll(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(z(419)),r=Xd(s,r,void 0),Ll(e,t,o,r)}if(a=(o&e.childLanes)!==0,Kt||a){if(r=mt,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,Nr(e,i),$n(r,e,i,-1))}return nm(),r=Xd(Error(z(421))),Ll(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=$P.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,ln=ii(i.nextSibling),un=t,He=!0,Ln=null,e!==null&&(bn[_n++]=vr,bn[_n++]=yr,bn[_n++]=Yi,vr=e.id,yr=e.overflow,Yi=t),t=Xg(t,r.children),t.flags|=4096,t)}function iv(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),If(e.return,t,n)}function Jd(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function x1(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Ot(e,t,r.children,n),r=qe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&iv(e,n,t);else if(e.tag===19)iv(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Oe(qe,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ou(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Jd(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ou(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Jd(t,!0,n,null,s);break;case"together":Jd(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function wc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Pr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ji|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(z(153));if(t.child!==null){for(e=t.child,n=li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function NP(e,t,n){switch(t.tag){case 3:g1(t),Qs();break;case 5:Hw(t);break;case 1:Jt(t.type)&&eu(t);break;case 4:Wg(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;Oe(ru,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Oe(qe,qe.current&1),t.flags|=128,null):n&t.child.childLanes?m1(e,t,n):(Oe(qe,qe.current&1),e=Pr(e,t,n),e!==null?e.sibling:null);Oe(qe,qe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return x1(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Oe(qe,qe.current),r)break;return null;case 22:case 23:return t.lanes=0,f1(e,t,n)}return Pr(e,t,n)}var v1,Hf,y1,b1;v1=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Hf=function(){};y1=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,zi(rr.current);var s=null;switch(n){case"input":i=df(e,i),r=df(e,r),s=[];break;case"select":i=Ye({},i,{value:void 0}),r=Ye({},r,{value:void 0}),s=[];break;case"textarea":i=pf(e,i),r=pf(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Qc)}mf(n,r);var o;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Ra.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=i!=null?i[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Ra.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Fe("scroll",e),s||a===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};b1=function(e,t,n,r){n!==r&&(t.flags|=4)};function jo(e,t){if(!He)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function St(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function PP(e,t,n){var r=t.pendingProps;switch(Ig(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(t),null;case 1:return Jt(t.type)&&Zc(),St(t),null;case 3:return r=t.stateNode,eo(),Be(Xt),Be(Mt),Vg(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Al(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ln!==null&&(Jf(Ln),Ln=null))),Hf(e,t),St(t),null;case 5:Hg(t);var i=zi(Va.current);if(n=t.type,e!==null&&t.stateNode!=null)y1(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(z(166));return St(t),null}if(e=zi(rr.current),Al(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Qn]=t,r[Wa]=s,e=(t.mode&1)!==0,n){case"dialog":Fe("cancel",r),Fe("close",r);break;case"iframe":case"object":case"embed":Fe("load",r);break;case"video":case"audio":for(i=0;i<Xo.length;i++)Fe(Xo[i],r);break;case"source":Fe("error",r);break;case"img":case"image":case"link":Fe("error",r),Fe("load",r);break;case"details":Fe("toggle",r);break;case"input":fx(r,s),Fe("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Fe("invalid",r);break;case"textarea":gx(r,s),Fe("invalid",r)}mf(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&Dl(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&Dl(r.textContent,a,e),i=["children",""+a]):Ra.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Fe("scroll",r)}switch(n){case"input":Cl(r),px(r,s,!0);break;case"textarea":Cl(r),mx(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Qc)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=K_(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Qn]=t,e[Wa]=r,v1(e,t,!1,!1),t.stateNode=e;e:{switch(o=xf(n,r),n){case"dialog":Fe("cancel",e),Fe("close",e),i=r;break;case"iframe":case"object":case"embed":Fe("load",e),i=r;break;case"video":case"audio":for(i=0;i<Xo.length;i++)Fe(Xo[i],e);i=r;break;case"source":Fe("error",e),i=r;break;case"img":case"image":case"link":Fe("error",e),Fe("load",e),i=r;break;case"details":Fe("toggle",e),i=r;break;case"input":fx(e,r),i=df(e,r),Fe("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Ye({},r,{value:void 0}),Fe("invalid",e);break;case"textarea":gx(e,r),i=pf(e,r),Fe("invalid",e);break;default:i=r}mf(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?J_(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Y_(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Da(e,l):typeof l=="number"&&Da(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Ra.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Fe("scroll",e):l!=null&&bg(e,s,l,o))}switch(n){case"input":Cl(e),px(e,r,!1);break;case"textarea":Cl(e),mx(e);break;case"option":r.value!=null&&e.setAttribute("value",""+hi(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?$s(e,!!r.multiple,s,!1):r.defaultValue!=null&&$s(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Qc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return St(t),null;case 6:if(e&&t.stateNode!=null)b1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(z(166));if(n=zi(Va.current),zi(rr.current),Al(t)){if(r=t.stateNode,n=t.memoizedProps,r[Qn]=t,(s=r.nodeValue!==n)&&(e=un,e!==null))switch(e.tag){case 3:Dl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Dl(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Qn]=t,t.stateNode=r}return St(t),null;case 13:if(Be(qe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(He&&ln!==null&&t.mode&1&&!(t.flags&128))Fw(),Qs(),t.flags|=98560,s=!1;else if(s=Al(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(z(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(z(317));s[Qn]=t}else Qs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;St(t),s=!1}else Ln!==null&&(Jf(Ln),Ln=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||qe.current&1?dt===0&&(dt=3):nm())),t.updateQueue!==null&&(t.flags|=4),St(t),null);case 4:return eo(),Hf(e,t),e===null&&za(t.stateNode.containerInfo),St(t),null;case 10:return $g(t.type._context),St(t),null;case 17:return Jt(t.type)&&Zc(),St(t),null;case 19:if(Be(qe),s=t.memoizedState,s===null)return St(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)jo(s,!1);else{if(dt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ou(e),o!==null){for(t.flags|=128,jo(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Oe(qe,qe.current&1|2),t.child}e=e.sibling}s.tail!==null&&tt()>no&&(t.flags|=128,r=!0,jo(s,!1),t.lanes=4194304)}else{if(!r)if(e=ou(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),jo(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!He)return St(t),null}else 2*tt()-s.renderingStartTime>no&&n!==1073741824&&(t.flags|=128,r=!0,jo(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=tt(),t.sibling=null,n=qe.current,Oe(qe,r?n&1|2:n&1),t):(St(t),null);case 22:case 23:return tm(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?on&1073741824&&(St(t),t.subtreeFlags&6&&(t.flags|=8192)):St(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function jP(e,t){switch(Ig(t),t.tag){case 1:return Jt(t.type)&&Zc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return eo(),Be(Xt),Be(Mt),Vg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Hg(t),null;case 13:if(Be(qe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));Qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Be(qe),null;case 4:return eo(),null;case 10:return $g(t.type._context),null;case 22:case 23:return tm(),null;case 24:return null;default:return null}}var Ol=!1,Pt=!1,TP=typeof WeakSet=="function"?WeakSet:Set,Z=null;function As(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Je(e,t,r)}else n.current=null}function Vf(e,t,n){try{n()}catch(r){Je(e,t,r)}}var sv=!1;function MP(e,t){if(Nf=Yc,e=Cw(),Dg(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,u=0,d=e,f=null;t:for(;;){for(var p;d!==n||i!==0&&d.nodeType!==3||(a=o+i),d!==s||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===n&&++c===i&&(a=o),f===s&&++u===r&&(l=o),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Pf={focusedElem:e,selectionRange:n},Yc=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var m=g.memoizedProps,y=g.memoizedState,x=t.stateNode,v=x.getSnapshotBeforeUpdate(t.elementType===t.type?m:Rn(t.type,m),y);x.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(S){Je(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return g=sv,sv=!1,g}function ga(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Vf(t,n,s)}i=i.next}while(i!==r)}}function Zu(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Uf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function _1(e){var t=e.alternate;t!==null&&(e.alternate=null,_1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Qn],delete t[Wa],delete t[Mf],delete t[fP],delete t[pP])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function w1(e){return e.tag===5||e.tag===3||e.tag===4}function ov(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||w1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function qf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qc));else if(r!==4&&(e=e.child,e!==null))for(qf(e,t,n),e=e.sibling;e!==null;)qf(e,t,n),e=e.sibling}function Gf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Gf(e,t,n),e=e.sibling;e!==null;)Gf(e,t,n),e=e.sibling}var vt=null,Dn=!1;function Ar(e,t,n){for(n=n.child;n!==null;)k1(e,t,n),n=n.sibling}function k1(e,t,n){if(nr&&typeof nr.onCommitFiberUnmount=="function")try{nr.onCommitFiberUnmount(Uu,n)}catch{}switch(n.tag){case 5:Pt||As(n,t);case 6:var r=vt,i=Dn;vt=null,Ar(e,t,n),vt=r,Dn=i,vt!==null&&(Dn?(e=vt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):vt.removeChild(n.stateNode));break;case 18:vt!==null&&(Dn?(e=vt,n=n.stateNode,e.nodeType===8?Vd(e.parentNode,n):e.nodeType===1&&Vd(e,n),Oa(e)):Vd(vt,n.stateNode));break;case 4:r=vt,i=Dn,vt=n.stateNode.containerInfo,Dn=!0,Ar(e,t,n),vt=r,Dn=i;break;case 0:case 11:case 14:case 15:if(!Pt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Vf(n,t,o),i=i.next}while(i!==r)}Ar(e,t,n);break;case 1:if(!Pt&&(As(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Je(n,t,a)}Ar(e,t,n);break;case 21:Ar(e,t,n);break;case 22:n.mode&1?(Pt=(r=Pt)||n.memoizedState!==null,Ar(e,t,n),Pt=r):Ar(e,t,n);break;default:Ar(e,t,n)}}function av(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new TP),t.forEach(function(r){var i=zP.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function Tn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:vt=a.stateNode,Dn=!1;break e;case 3:vt=a.stateNode.containerInfo,Dn=!0;break e;case 4:vt=a.stateNode.containerInfo,Dn=!0;break e}a=a.return}if(vt===null)throw Error(z(160));k1(s,o,i),vt=null,Dn=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Je(i,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)S1(t,e),t=t.sibling}function S1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Tn(t,e),Un(e),r&4){try{ga(3,e,e.return),Zu(3,e)}catch(m){Je(e,e.return,m)}try{ga(5,e,e.return)}catch(m){Je(e,e.return,m)}}break;case 1:Tn(t,e),Un(e),r&512&&n!==null&&As(n,n.return);break;case 5:if(Tn(t,e),Un(e),r&512&&n!==null&&As(n,n.return),e.flags&32){var i=e.stateNode;try{Da(i,"")}catch(m){Je(e,e.return,m)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&q_(i,s),xf(a,o);var c=xf(a,s);for(o=0;o<l.length;o+=2){var u=l[o],d=l[o+1];u==="style"?J_(i,d):u==="dangerouslySetInnerHTML"?Y_(i,d):u==="children"?Da(i,d):bg(i,u,d,c)}switch(a){case"input":hf(i,s);break;case"textarea":G_(i,s);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?$s(i,!!s.multiple,p,!1):f!==!!s.multiple&&(s.defaultValue!=null?$s(i,!!s.multiple,s.defaultValue,!0):$s(i,!!s.multiple,s.multiple?[]:"",!1))}i[Wa]=s}catch(m){Je(e,e.return,m)}}break;case 6:if(Tn(t,e),Un(e),r&4){if(e.stateNode===null)throw Error(z(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(m){Je(e,e.return,m)}}break;case 3:if(Tn(t,e),Un(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Oa(t.containerInfo)}catch(m){Je(e,e.return,m)}break;case 4:Tn(t,e),Un(e);break;case 13:Tn(t,e),Un(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(Zg=tt())),r&4&&av(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(Pt=(c=Pt)||u,Tn(t,e),Pt=c):Tn(t,e),Un(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(Z=e,u=e.child;u!==null;){for(d=Z=u;Z!==null;){switch(f=Z,p=f.child,f.tag){case 0:case 11:case 14:case 15:ga(4,f,f.return);break;case 1:As(f,f.return);var g=f.stateNode;if(typeof g.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(m){Je(r,n,m)}}break;case 5:As(f,f.return);break;case 22:if(f.memoizedState!==null){cv(d);continue}}p!==null?(p.return=f,Z=p):cv(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{i=d.stateNode,c?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=d.stateNode,l=d.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=X_("display",o))}catch(m){Je(e,e.return,m)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(m){Je(e,e.return,m)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Tn(t,e),Un(e),r&4&&av(e);break;case 21:break;default:Tn(t,e),Un(e)}}function Un(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(w1(n)){var r=n;break e}n=n.return}throw Error(z(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Da(i,""),r.flags&=-33);var s=ov(e);Gf(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=ov(e);qf(e,a,o);break;default:throw Error(z(161))}}catch(l){Je(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function RP(e,t,n){Z=e,C1(e)}function C1(e,t,n){for(var r=(e.mode&1)!==0;Z!==null;){var i=Z,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||Ol;if(!o){var a=i.alternate,l=a!==null&&a.memoizedState!==null||Pt;a=Ol;var c=Pt;if(Ol=o,(Pt=l)&&!c)for(Z=i;Z!==null;)o=Z,l=o.child,o.tag===22&&o.memoizedState!==null?uv(i):l!==null?(l.return=o,Z=l):uv(i);for(;s!==null;)Z=s,C1(s),s=s.sibling;Z=i,Ol=a,Pt=c}lv(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,Z=s):lv(e)}}function lv(e){for(;Z!==null;){var t=Z;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Pt||Zu(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Pt)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:Rn(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&qx(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}qx(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&Oa(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(z(163))}Pt||t.flags&512&&Uf(t)}catch(f){Je(t,t.return,f)}}if(t===e){Z=null;break}if(n=t.sibling,n!==null){n.return=t.return,Z=n;break}Z=t.return}}function cv(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Z=n;break}Z=t.return}}function uv(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Zu(4,t)}catch(l){Je(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(l){Je(t,i,l)}}var s=t.return;try{Uf(t)}catch(l){Je(t,s,l)}break;case 5:var o=t.return;try{Uf(t)}catch(l){Je(t,o,l)}}}catch(l){Je(t,t.return,l)}if(t===e){Z=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Z=a;break}Z=t.return}}var DP=Math.ceil,cu=jr.ReactCurrentDispatcher,Jg=jr.ReactCurrentOwner,Cn=jr.ReactCurrentBatchConfig,Ee=0,mt=null,lt=null,_t=0,on=0,Is=xi(0),dt=0,Ka=null,Ji=0,ed=0,Qg=0,ma=null,qt=null,Zg=0,no=1/0,pr=null,uu=!1,Kf=null,oi=null,Fl=!1,Kr=null,du=0,xa=0,Yf=null,kc=-1,Sc=0;function zt(){return Ee&6?tt():kc!==-1?kc:kc=tt()}function ai(e){return e.mode&1?Ee&2&&_t!==0?_t&-_t:mP.transition!==null?(Sc===0&&(Sc=cw()),Sc):(e=Te,e!==0||(e=window.event,e=e===void 0?16:mw(e.type)),e):1}function $n(e,t,n,r){if(50<xa)throw xa=0,Yf=null,Error(z(185));pl(e,n,r),(!(Ee&2)||e!==mt)&&(e===mt&&(!(Ee&2)&&(ed|=n),dt===4&&Vr(e,_t)),Qt(e,r),n===1&&Ee===0&&!(t.mode&1)&&(no=tt()+500,Xu&&vi()))}function Qt(e,t){var n=e.callbackNode;mN(e,t);var r=Kc(e,e===mt?_t:0);if(r===0)n!==null&&yx(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&yx(n),t===1)e.tag===0?gP(dv.bind(null,e)):Iw(dv.bind(null,e)),dP(function(){!(Ee&6)&&vi()}),n=null;else{switch(uw(r)){case 1:n=Cg;break;case 4:n=aw;break;case 16:n=Gc;break;case 536870912:n=lw;break;default:n=Gc}n=D1(n,E1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function E1(e,t){if(kc=-1,Sc=0,Ee&6)throw Error(z(327));var n=e.callbackNode;if(Vs()&&e.callbackNode!==n)return null;var r=Kc(e,e===mt?_t:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=hu(e,r);else{t=r;var i=Ee;Ee|=2;var s=P1();(mt!==e||_t!==t)&&(pr=null,no=tt()+500,Wi(e,t));do try{LP();break}catch(a){N1(e,a)}while(!0);Fg(),cu.current=s,Ee=i,lt!==null?t=0:(mt=null,_t=0,t=dt)}if(t!==0){if(t===2&&(i=wf(e),i!==0&&(r=i,t=Xf(e,i))),t===1)throw n=Ka,Wi(e,0),Vr(e,r),Qt(e,tt()),n;if(t===6)Vr(e,r);else{if(i=e.current.alternate,!(r&30)&&!AP(i)&&(t=hu(e,r),t===2&&(s=wf(e),s!==0&&(r=s,t=Xf(e,s))),t===1))throw n=Ka,Wi(e,0),Vr(e,r),Qt(e,tt()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(z(345));case 2:Ri(e,qt,pr);break;case 3:if(Vr(e,r),(r&130023424)===r&&(t=Zg+500-tt(),10<t)){if(Kc(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){zt(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Tf(Ri.bind(null,e,qt,pr),t);break}Ri(e,qt,pr);break;case 4:if(Vr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-Fn(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=tt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*DP(r/1960))-r,10<r){e.timeoutHandle=Tf(Ri.bind(null,e,qt,pr),r);break}Ri(e,qt,pr);break;case 5:Ri(e,qt,pr);break;default:throw Error(z(329))}}}return Qt(e,tt()),e.callbackNode===n?E1.bind(null,e):null}function Xf(e,t){var n=ma;return e.current.memoizedState.isDehydrated&&(Wi(e,t).flags|=256),e=hu(e,t),e!==2&&(t=qt,qt=n,t!==null&&Jf(t)),e}function Jf(e){qt===null?qt=e:qt.push.apply(qt,e)}function AP(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!Wn(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Vr(e,t){for(t&=~Qg,t&=~ed,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Fn(t),r=1<<n;e[n]=-1,t&=~r}}function dv(e){if(Ee&6)throw Error(z(327));Vs();var t=Kc(e,0);if(!(t&1))return Qt(e,tt()),null;var n=hu(e,t);if(e.tag!==0&&n===2){var r=wf(e);r!==0&&(t=r,n=Xf(e,r))}if(n===1)throw n=Ka,Wi(e,0),Vr(e,t),Qt(e,tt()),n;if(n===6)throw Error(z(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ri(e,qt,pr),Qt(e,tt()),null}function em(e,t){var n=Ee;Ee|=1;try{return e(t)}finally{Ee=n,Ee===0&&(no=tt()+500,Xu&&vi())}}function Qi(e){Kr!==null&&Kr.tag===0&&!(Ee&6)&&Vs();var t=Ee;Ee|=1;var n=Cn.transition,r=Te;try{if(Cn.transition=null,Te=1,e)return e()}finally{Te=r,Cn.transition=n,Ee=t,!(Ee&6)&&vi()}}function tm(){on=Is.current,Be(Is)}function Wi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,uP(n)),lt!==null)for(n=lt.return;n!==null;){var r=n;switch(Ig(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Zc();break;case 3:eo(),Be(Xt),Be(Mt),Vg();break;case 5:Hg(r);break;case 4:eo();break;case 13:Be(qe);break;case 19:Be(qe);break;case 10:$g(r.type._context);break;case 22:case 23:tm()}n=n.return}if(mt=e,lt=e=li(e.current,null),_t=on=t,dt=0,Ka=null,Qg=ed=Ji=0,qt=ma=null,$i!==null){for(t=0;t<$i.length;t++)if(n=$i[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}$i=null}return e}function N1(e,t){do{var n=lt;try{if(Fg(),bc.current=lu,au){for(var r=Ke.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}au=!1}if(Xi=0,pt=ut=Ke=null,pa=!1,Ua=0,Jg.current=null,n===null||n.return===null){dt=1,Ka=t,lt=null;break}e:{var s=e,o=n.return,a=n,l=t;if(t=_t,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var f=u.alternate;f?(u.updateQueue=f.updateQueue,u.memoizedState=f.memoizedState,u.lanes=f.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=Qx(o);if(p!==null){p.flags&=-257,Zx(p,o,a,s,t),p.mode&1&&Jx(s,c,t),t=p,l=c;var g=t.updateQueue;if(g===null){var m=new Set;m.add(l),t.updateQueue=m}else g.add(l);break e}else{if(!(t&1)){Jx(s,c,t),nm();break e}l=Error(z(426))}}else if(He&&a.mode&1){var y=Qx(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),Zx(y,o,a,s,t),Lg(to(l,a));break e}}s=l=to(l,a),dt!==4&&(dt=2),ma===null?ma=[s]:ma.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var x=u1(s,l,t);Ux(s,x);break e;case 1:a=l;var v=s.type,b=s.stateNode;if(!(s.flags&128)&&(typeof v.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(oi===null||!oi.has(b)))){s.flags|=65536,t&=-t,s.lanes|=t;var S=d1(s,a,t);Ux(s,S);break e}}s=s.return}while(s!==null)}T1(n)}catch(k){t=k,lt===n&&n!==null&&(lt=n=n.return);continue}break}while(!0)}function P1(){var e=cu.current;return cu.current=lu,e===null?lu:e}function nm(){(dt===0||dt===3||dt===2)&&(dt=4),mt===null||!(Ji&268435455)&&!(ed&268435455)||Vr(mt,_t)}function hu(e,t){var n=Ee;Ee|=2;var r=P1();(mt!==e||_t!==t)&&(pr=null,Wi(e,t));do try{IP();break}catch(i){N1(e,i)}while(!0);if(Fg(),Ee=n,cu.current=r,lt!==null)throw Error(z(261));return mt=null,_t=0,dt}function IP(){for(;lt!==null;)j1(lt)}function LP(){for(;lt!==null&&!aN();)j1(lt)}function j1(e){var t=R1(e.alternate,e,on);e.memoizedProps=e.pendingProps,t===null?T1(e):lt=t,Jg.current=null}function T1(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=jP(n,t),n!==null){n.flags&=32767,lt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{dt=6,lt=null;return}}else if(n=PP(n,t,on),n!==null){lt=n;return}if(t=t.sibling,t!==null){lt=t;return}lt=t=e}while(t!==null);dt===0&&(dt=5)}function Ri(e,t,n){var r=Te,i=Cn.transition;try{Cn.transition=null,Te=1,OP(e,t,n,r)}finally{Cn.transition=i,Te=r}return null}function OP(e,t,n,r){do Vs();while(Kr!==null);if(Ee&6)throw Error(z(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(z(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(xN(e,s),e===mt&&(lt=mt=null,_t=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Fl||(Fl=!0,D1(Gc,function(){return Vs(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Cn.transition,Cn.transition=null;var o=Te;Te=1;var a=Ee;Ee|=4,Jg.current=null,MP(e,n),S1(n,e),rP(Pf),Yc=!!Nf,Pf=Nf=null,e.current=n,RP(n),lN(),Ee=a,Te=o,Cn.transition=s}else e.current=n;if(Fl&&(Fl=!1,Kr=e,du=i),s=e.pendingLanes,s===0&&(oi=null),dN(n.stateNode),Qt(e,tt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(uu)throw uu=!1,e=Kf,Kf=null,e;return du&1&&e.tag!==0&&Vs(),s=e.pendingLanes,s&1?e===Yf?xa++:(xa=0,Yf=e):xa=0,vi(),null}function Vs(){if(Kr!==null){var e=uw(du),t=Cn.transition,n=Te;try{if(Cn.transition=null,Te=16>e?16:e,Kr===null)var r=!1;else{if(e=Kr,Kr=null,du=0,Ee&6)throw Error(z(331));var i=Ee;for(Ee|=4,Z=e.current;Z!==null;){var s=Z,o=s.child;if(Z.flags&16){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(Z=c;Z!==null;){var u=Z;switch(u.tag){case 0:case 11:case 15:ga(8,u,s)}var d=u.child;if(d!==null)d.return=u,Z=d;else for(;Z!==null;){u=Z;var f=u.sibling,p=u.return;if(_1(u),u===c){Z=null;break}if(f!==null){f.return=p,Z=f;break}Z=p}}}var g=s.alternate;if(g!==null){var m=g.child;if(m!==null){g.child=null;do{var y=m.sibling;m.sibling=null,m=y}while(m!==null)}}Z=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,Z=o;else e:for(;Z!==null;){if(s=Z,s.flags&2048)switch(s.tag){case 0:case 11:case 15:ga(9,s,s.return)}var x=s.sibling;if(x!==null){x.return=s.return,Z=x;break e}Z=s.return}}var v=e.current;for(Z=v;Z!==null;){o=Z;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,Z=b;else e:for(o=v;Z!==null;){if(a=Z,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Zu(9,a)}}catch(k){Je(a,a.return,k)}if(a===o){Z=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,Z=S;break e}Z=a.return}}if(Ee=i,vi(),nr&&typeof nr.onPostCommitFiberRoot=="function")try{nr.onPostCommitFiberRoot(Uu,e)}catch{}r=!0}return r}finally{Te=n,Cn.transition=t}}return!1}function hv(e,t,n){t=to(n,t),t=u1(e,t,1),e=si(e,t,1),t=zt(),e!==null&&(pl(e,1,t),Qt(e,t))}function Je(e,t,n){if(e.tag===3)hv(e,e,n);else for(;t!==null;){if(t.tag===3){hv(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(oi===null||!oi.has(r))){e=to(n,e),e=d1(t,e,1),t=si(t,e,1),e=zt(),t!==null&&(pl(t,1,e),Qt(t,e));break}}t=t.return}}function FP(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=zt(),e.pingedLanes|=e.suspendedLanes&n,mt===e&&(_t&n)===n&&(dt===4||dt===3&&(_t&130023424)===_t&&500>tt()-Zg?Wi(e,0):Qg|=n),Qt(e,t)}function M1(e,t){t===0&&(e.mode&1?(t=Pl,Pl<<=1,!(Pl&130023424)&&(Pl=4194304)):t=1);var n=zt();e=Nr(e,t),e!==null&&(pl(e,t,n),Qt(e,n))}function $P(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),M1(e,n)}function zP(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),M1(e,n)}var R1;R1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Xt.current)Kt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Kt=!1,NP(e,t,n);Kt=!!(e.flags&131072)}else Kt=!1,He&&t.flags&1048576&&Lw(t,nu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;wc(e,t),e=t.pendingProps;var i=Js(t,Mt.current);Hs(t,n),i=qg(null,t,r,e,i,n);var s=Gg();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Jt(r)?(s=!0,eu(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Bg(t),i.updater=Qu,t.stateNode=i,i._reactInternals=t,Of(t,r,e,n),t=zf(null,t,r,!0,s,n)):(t.tag=0,He&&s&&Ag(t),Ot(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(wc(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=WP(r),e=Rn(r,e),i){case 0:t=$f(null,t,r,e,n);break e;case 1:t=nv(null,t,r,e,n);break e;case 11:t=ev(null,t,r,e,n);break e;case 14:t=tv(null,t,r,Rn(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Rn(r,i),$f(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Rn(r,i),nv(e,t,r,i,n);case 3:e:{if(g1(t),e===null)throw Error(z(387));r=t.pendingProps,s=t.memoizedState,i=s.element,Ww(e,t),su(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=to(Error(z(423)),t),t=rv(e,t,r,n,i);break e}else if(r!==i){i=to(Error(z(424)),t),t=rv(e,t,r,n,i);break e}else for(ln=ii(t.stateNode.containerInfo.firstChild),un=t,He=!0,Ln=null,n=zw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qs(),r===i){t=Pr(e,t,n);break e}Ot(e,t,r,n)}t=t.child}return t;case 5:return Hw(t),e===null&&Af(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,jf(r,i)?o=null:s!==null&&jf(r,s)&&(t.flags|=32),p1(e,t),Ot(e,t,o,n),t.child;case 6:return e===null&&Af(t),null;case 13:return m1(e,t,n);case 4:return Wg(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Zs(t,null,r,n):Ot(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Rn(r,i),ev(e,t,r,i,n);case 7:return Ot(e,t,t.pendingProps,n),t.child;case 8:return Ot(e,t,t.pendingProps.children,n),t.child;case 12:return Ot(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,Oe(ru,r._currentValue),r._currentValue=o,s!==null)if(Wn(s.value,o)){if(s.children===i.children&&!Xt.current){t=Pr(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Sr(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),If(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(z(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),If(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ot(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Hs(t,n),i=Nn(i),r=r(i),t.flags|=1,Ot(e,t,r,n),t.child;case 14:return r=t.type,i=Rn(r,t.pendingProps),i=Rn(r.type,i),tv(e,t,r,i,n);case 15:return h1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Rn(r,i),wc(e,t),t.tag=1,Jt(r)?(e=!0,eu(t)):e=!1,Hs(t,n),c1(t,r,i),Of(t,r,i,n),zf(null,t,r,!0,e,n);case 19:return x1(e,t,n);case 22:return f1(e,t,n)}throw Error(z(156,t.tag))};function D1(e,t){return ow(e,t)}function BP(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sn(e,t,n,r){return new BP(e,t,n,r)}function rm(e){return e=e.prototype,!(!e||!e.isReactComponent)}function WP(e){if(typeof e=="function")return rm(e)?1:0;if(e!=null){if(e=e.$$typeof,e===wg)return 11;if(e===kg)return 14}return 2}function li(e,t){var n=e.alternate;return n===null?(n=Sn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Cc(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")rm(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Cs:return Hi(n.children,i,s,t);case _g:o=8,i|=8;break;case af:return e=Sn(12,n,t,i|2),e.elementType=af,e.lanes=s,e;case lf:return e=Sn(13,n,t,i),e.elementType=lf,e.lanes=s,e;case cf:return e=Sn(19,n,t,i),e.elementType=cf,e.lanes=s,e;case H_:return td(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case B_:o=10;break e;case W_:o=9;break e;case wg:o=11;break e;case kg:o=14;break e;case Br:o=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=Sn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Hi(e,t,n,r){return e=Sn(7,e,r,t),e.lanes=n,e}function td(e,t,n,r){return e=Sn(22,e,r,t),e.elementType=H_,e.lanes=n,e.stateNode={isHidden:!1},e}function Qd(e,t,n){return e=Sn(6,e,null,t),e.lanes=n,e}function Zd(e,t,n){return t=Sn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function HP(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Dd(0),this.expirationTimes=Dd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dd(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function im(e,t,n,r,i,s,o,a,l){return e=new HP(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Sn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bg(s),e}function VP(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ss,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function A1(e){if(!e)return fi;e=e._reactInternals;e:{if(is(e)!==e||e.tag!==1)throw Error(z(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Jt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(z(171))}if(e.tag===1){var n=e.type;if(Jt(n))return Aw(e,n,t)}return t}function I1(e,t,n,r,i,s,o,a,l){return e=im(n,r,!0,e,i,s,o,a,l),e.context=A1(null),n=e.current,r=zt(),i=ai(n),s=Sr(r,i),s.callback=t??null,si(n,s,i),e.current.lanes=i,pl(e,i,r),Qt(e,r),e}function nd(e,t,n,r){var i=t.current,s=zt(),o=ai(i);return n=A1(n),t.context===null?t.context=n:t.pendingContext=n,t=Sr(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=si(i,t,o),e!==null&&($n(e,i,o,s),yc(e,i,o)),o}function fu(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function fv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function sm(e,t){fv(e,t),(e=e.alternate)&&fv(e,t)}function UP(){return null}var L1=typeof reportError=="function"?reportError:function(e){console.error(e)};function om(e){this._internalRoot=e}rd.prototype.render=om.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(z(409));nd(e,t,null,null)};rd.prototype.unmount=om.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Qi(function(){nd(null,e,null,null)}),t[Er]=null}};function rd(e){this._internalRoot=e}rd.prototype.unstable_scheduleHydration=function(e){if(e){var t=fw();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Hr.length&&t!==0&&t<Hr[n].priority;n++);Hr.splice(n,0,e),n===0&&gw(e)}};function am(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function id(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function pv(){}function qP(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var c=fu(o);s.call(c)}}var o=I1(t,r,e,0,null,!1,!1,"",pv);return e._reactRootContainer=o,e[Er]=o.current,za(e.nodeType===8?e.parentNode:e),Qi(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=fu(l);a.call(c)}}var l=im(e,0,!1,null,null,!1,!1,"",pv);return e._reactRootContainer=l,e[Er]=l.current,za(e.nodeType===8?e.parentNode:e),Qi(function(){nd(t,l,n,r)}),l}function sd(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var l=fu(o);a.call(l)}}nd(t,o,e,i)}else o=qP(n,t,e,i,r);return fu(o)}dw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Yo(t.pendingLanes);n!==0&&(Eg(t,n|1),Qt(t,tt()),!(Ee&6)&&(no=tt()+500,vi()))}break;case 13:Qi(function(){var r=Nr(e,1);if(r!==null){var i=zt();$n(r,e,1,i)}}),sm(e,1)}};Ng=function(e){if(e.tag===13){var t=Nr(e,134217728);if(t!==null){var n=zt();$n(t,e,134217728,n)}sm(e,134217728)}};hw=function(e){if(e.tag===13){var t=ai(e),n=Nr(e,t);if(n!==null){var r=zt();$n(n,e,t,r)}sm(e,t)}};fw=function(){return Te};pw=function(e,t){var n=Te;try{return Te=e,t()}finally{Te=n}};yf=function(e,t,n){switch(t){case"input":if(hf(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=Yu(r);if(!i)throw Error(z(90));U_(r),hf(r,i)}}}break;case"textarea":G_(e,n);break;case"select":t=n.value,t!=null&&$s(e,!!n.multiple,t,!1)}};ew=em;tw=Qi;var GP={usingClientEntryPoint:!1,Events:[ml,js,Yu,Q_,Z_,em]},To={findFiberByHostInstance:Fi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},KP={bundleType:To.bundleType,version:To.version,rendererPackageName:To.rendererPackageName,rendererConfig:To.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:jr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=iw(e),e===null?null:e.stateNode},findFiberByHostInstance:To.findFiberByHostInstance||UP,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var $l=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$l.isDisabled&&$l.supportsFiber)try{Uu=$l.inject(KP),nr=$l}catch{}}pn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=GP;pn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!am(t))throw Error(z(200));return VP(e,t,null,n)};pn.createRoot=function(e,t){if(!am(e))throw Error(z(299));var n=!1,r="",i=L1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=im(e,1,!1,null,null,n,!1,r,i),e[Er]=t.current,za(e.nodeType===8?e.parentNode:e),new om(t)};pn.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(z(188)):(e=Object.keys(e).join(","),Error(z(268,e)));return e=iw(t),e=e===null?null:e.stateNode,e};pn.flushSync=function(e){return Qi(e)};pn.hydrate=function(e,t,n){if(!id(t))throw Error(z(200));return sd(null,e,t,!0,n)};pn.hydrateRoot=function(e,t,n){if(!am(e))throw Error(z(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=L1;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=I1(t,null,e,1,n??null,i,!1,s,o),e[Er]=t.current,za(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new rd(t)};pn.render=function(e,t,n){if(!id(t))throw Error(z(200));return sd(null,e,t,!1,n)};pn.unmountComponentAtNode=function(e){if(!id(e))throw Error(z(40));return e._reactRootContainer?(Qi(function(){sd(null,null,e,!1,function(){e._reactRootContainer=null,e[Er]=null})}),!0):!1};pn.unstable_batchedUpdates=em;pn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!id(n))throw Error(z(200));if(e==null||e._reactInternals===void 0)throw Error(z(38));return sd(e,t,n,!1,r)};pn.version="18.3.1-next-f1338f8080-20240426";function O1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(O1)}catch(e){console.error(e)}}O1(),O_.exports=pn;var YP=O_.exports,gv=YP;sf.createRoot=gv.createRoot,sf.hydrateRoot=gv.hydrateRoot;/**
41
+ * @remix-run/router v1.23.2
42
+ *
43
+ * Copyright (c) Remix Software Inc.
44
+ *
45
+ * This source code is licensed under the MIT license found in the
46
+ * LICENSE.md file in the root directory of this source tree.
47
+ *
48
+ * @license MIT
49
+ */function Ya(){return Ya=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ya.apply(this,arguments)}var Yr;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Yr||(Yr={}));const mv="popstate";function XP(e){e===void 0&&(e={});function t(r,i){let{pathname:s,search:o,hash:a}=r.location;return Qf("",{pathname:s,search:o,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:pu(i)}return QP(t,n,null,e)}function rt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function lm(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function JP(){return Math.random().toString(36).substr(2,8)}function xv(e,t){return{usr:e.state,key:e.key,idx:t}}function Qf(e,t,n,r){return n===void 0&&(n=null),Ya({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?mo(t):t,{state:n,key:t&&t.key||r||JP()})}function pu(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function mo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function QP(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=Yr.Pop,l=null,c=u();c==null&&(c=0,o.replaceState(Ya({},o.state,{idx:c}),""));function u(){return(o.state||{idx:null}).idx}function d(){a=Yr.Pop;let y=u(),x=y==null?null:y-c;c=y,l&&l({action:a,location:m.location,delta:x})}function f(y,x){a=Yr.Push;let v=Qf(m.location,y,x);c=u()+1;let b=xv(v,c),S=m.createHref(v);try{o.pushState(b,"",S)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;i.location.assign(S)}s&&l&&l({action:a,location:m.location,delta:1})}function p(y,x){a=Yr.Replace;let v=Qf(m.location,y,x);c=u();let b=xv(v,c),S=m.createHref(v);o.replaceState(b,"",S),s&&l&&l({action:a,location:m.location,delta:0})}function g(y){let x=i.location.origin!=="null"?i.location.origin:i.location.href,v=typeof y=="string"?y:pu(y);return v=v.replace(/ $/,"%20"),rt(x,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,x)}let m={get action(){return a},get location(){return e(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(mv,d),l=y,()=>{i.removeEventListener(mv,d),l=null}},createHref(y){return t(i,y)},createURL:g,encodeLocation(y){let x=g(y);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:f,replace:p,go(y){return o.go(y)}};return m}var vv;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(vv||(vv={}));function ZP(e,t,n){return n===void 0&&(n="/"),ej(e,t,n)}function ej(e,t,n,r){let i=typeof t=="string"?mo(t):t,s=cm(i.pathname||"/",n);if(s==null)return null;let o=F1(e);tj(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=fj(s);a=uj(o[l],c)}return a}function F1(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(rt(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=ci([r,l.relativePath]),u=n.concat(l);s.children&&s.children.length>0&&(rt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),F1(s.children,t,u,c)),!(s.path==null&&!s.index)&&t.push({path:c,score:lj(c,s.index),routesMeta:u})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of $1(s.path))i(s,o,l)}),t}function $1(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=$1(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function tj(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:cj(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const nj=/^:[\w-]+$/,rj=3,ij=2,sj=1,oj=10,aj=-2,yv=e=>e==="*";function lj(e,t){let n=e.split("/"),r=n.length;return n.some(yv)&&(r+=aj),t&&(r+=ij),n.filter(i=>!yv(i)).reduce((i,s)=>i+(nj.test(s)?rj:s===""?sj:oj),r)}function cj(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function uj(e,t,n){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,u=s==="/"?t:t.slice(s.length)||"/",d=dj({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),f=l.route;if(!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:ci([s,d.pathname]),pathnameBase:vj(ci([s,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(s=ci([s,d.pathnameBase]))}return o}function dj(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=hj(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((c,u,d)=>{let{paramName:f,isOptional:p}=u;if(f==="*"){let m=a[d]||"";o=s.slice(0,s.length-m.length).replace(/(.)\/+$/,"$1")}const g=a[d];return p&&!g?c[f]=void 0:c[f]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:s,pathnameBase:o,pattern:e}}function hj(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),lm(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=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function fj(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return lm(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function cm(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)||"/"}const pj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gj=e=>pj.test(e);function mj(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?mo(e):e,s;if(n)if(gj(n))s=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),lm(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?s=bv(n.substring(1),"/"):s=bv(n,t)}else s=t;return{pathname:s,search:yj(r),hash:bj(i)}}function bv(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function eh(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 xj(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function um(e,t){let n=xj(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function dm(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=mo(e):(i=Ya({},e),rt(!i.pathname||!i.pathname.includes("?"),eh("?","pathname","search",i)),rt(!i.pathname||!i.pathname.includes("#"),eh("#","pathname","hash",i)),rt(!i.search||!i.search.includes("#"),eh("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let d=t.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}a=d>=0?t[d]:"/"}let l=mj(i,a),c=o&&o!=="/"&&o.endsWith("/"),u=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const ci=e=>e.join("/").replace(/\/\/+/g,"/"),vj=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),yj=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,bj=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function _j(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const z1=["post","put","patch","delete"];new Set(z1);const wj=["get",...z1];new Set(wj);/**
50
+ * React Router v6.30.3
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */function Xa(){return Xa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xa.apply(this,arguments)}const hm=E.createContext(null),kj=E.createContext(null),yi=E.createContext(null),od=E.createContext(null),sr=E.createContext({outlet:null,matches:[],isDataRoute:!1}),B1=E.createContext(null);function Sj(e,t){let{relative:n}=t===void 0?{}:t;xo()||rt(!1);let{basename:r,navigator:i}=E.useContext(yi),{hash:s,pathname:o,search:a}=H1(e,{relative:n}),l=o;return r!=="/"&&(l=o==="/"?r:ci([r,o])),i.createHref({pathname:l,search:a,hash:s})}function xo(){return E.useContext(od)!=null}function ss(){return xo()||rt(!1),E.useContext(od).location}function W1(e){E.useContext(yi).static||E.useLayoutEffect(e)}function os(){let{isDataRoute:e}=E.useContext(sr);return e?$j():Cj()}function Cj(){xo()||rt(!1);let e=E.useContext(hm),{basename:t,future:n,navigator:r}=E.useContext(yi),{matches:i}=E.useContext(sr),{pathname:s}=ss(),o=JSON.stringify(um(i,n.v7_relativeSplatPath)),a=E.useRef(!1);return W1(()=>{a.current=!0}),E.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let d=dm(c,JSON.parse(o),s,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:ci([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,o,s,e])}const Ej=E.createContext(null);function Nj(e){let t=E.useContext(sr).outlet;return t&&E.createElement(Ej.Provider,{value:e},t)}function Zf(){let{matches:e}=E.useContext(sr),t=e[e.length-1];return t?t.params:{}}function H1(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=E.useContext(yi),{matches:i}=E.useContext(sr),{pathname:s}=ss(),o=JSON.stringify(um(i,r.v7_relativeSplatPath));return E.useMemo(()=>dm(e,JSON.parse(o),s,n==="path"),[e,o,s,n])}function Pj(e,t){return jj(e,t)}function jj(e,t,n,r){xo()||rt(!1);let{navigator:i}=E.useContext(yi),{matches:s}=E.useContext(sr),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=ss(),u;if(t){var d;let y=typeof t=="string"?mo(t):t;l==="/"||(d=y.pathname)!=null&&d.startsWith(l)||rt(!1),u=y}else u=c;let f=u.pathname||"/",p=f;if(l!=="/"){let y=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(y.length).join("/")}let g=ZP(e,{pathname:p}),m=Aj(g&&g.map(y=>Object.assign({},y,{params:Object.assign({},a,y.params),pathname:ci([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:ci([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),s,n,r);return t&&m?E.createElement(od.Provider,{value:{location:Xa({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Yr.Pop}},m):m}function Tj(){let e=Fj(),t=_j(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},t),n?E.createElement("pre",{style:i},n):null,null)}const Mj=E.createElement(Tj,null);class Rj extends E.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?E.createElement(sr.Provider,{value:this.props.routeContext},E.createElement(B1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Dj(e){let{routeContext:t,match:n,children:r}=e,i=E.useContext(hm);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),E.createElement(sr.Provider,{value:t},r)}function Aj(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(i=n)==null?void 0:i.errors;if(a!=null){let u=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);u>=0||rt(!1),o=o.slice(0,Math.min(o.length,u+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let u=0;u<o.length;u++){let d=o[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:f,errors:p}=n,g=d.route.loader&&f[d.route.id]===void 0&&(!p||p[d.route.id]===void 0);if(d.route.lazy||g){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((u,d,f)=>{let p,g=!1,m=null,y=null;n&&(p=a&&d.route.id?a[d.route.id]:void 0,m=d.route.errorElement||Mj,l&&(c<0&&f===0?(zj("route-fallback"),g=!0,y=null):c===f&&(g=!0,y=d.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,f+1)),v=()=>{let b;return p?b=m:g?b=y:d.route.Component?b=E.createElement(d.route.Component,null):d.route.element?b=d.route.element:b=u,E.createElement(Dj,{match:d,routeContext:{outlet:u,matches:x,isDataRoute:n!=null},children:b})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?E.createElement(Rj,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:v(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):v()},null)}var V1=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(V1||{}),U1=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(U1||{});function Ij(e){let t=E.useContext(hm);return t||rt(!1),t}function Lj(e){let t=E.useContext(kj);return t||rt(!1),t}function Oj(e){let t=E.useContext(sr);return t||rt(!1),t}function q1(e){let t=Oj(),n=t.matches[t.matches.length-1];return n.route.id||rt(!1),n.route.id}function Fj(){var e;let t=E.useContext(B1),n=Lj(),r=q1();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function $j(){let{router:e}=Ij(V1.UseNavigateStable),t=q1(U1.UseNavigateStable),n=E.useRef(!1);return W1(()=>{n.current=!0}),E.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Xa({fromRouteId:t},s)))},[e,t])}const _v={};function zj(e,t,n){_v[e]||(_v[e]=!0)}function Bj(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function wv(e){let{to:t,replace:n,state:r,relative:i}=e;xo()||rt(!1);let{future:s,static:o}=E.useContext(yi),{matches:a}=E.useContext(sr),{pathname:l}=ss(),c=os(),u=dm(t,um(a,s.v7_relativeSplatPath),l,i==="path"),d=JSON.stringify(u);return E.useEffect(()=>c(JSON.parse(d),{replace:n,state:r,relative:i}),[c,d,i,n,r]),null}function Wj(e){return Nj(e.context)}function zr(e){rt(!1)}function Hj(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Yr.Pop,navigator:s,static:o=!1,future:a}=e;xo()&&rt(!1);let l=t.replace(/^\/*/,"/"),c=E.useMemo(()=>({basename:l,navigator:s,static:o,future:Xa({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=mo(r));let{pathname:u="/",search:d="",hash:f="",state:p=null,key:g="default"}=r,m=E.useMemo(()=>{let y=cm(u,l);return y==null?null:{location:{pathname:y,search:d,hash:f,state:p,key:g},navigationType:i}},[l,u,d,f,p,g,i]);return m==null?null:E.createElement(yi.Provider,{value:c},E.createElement(od.Provider,{children:n,value:m}))}function Vj(e){let{children:t,location:n}=e;return Pj(ep(t),n)}new Promise(()=>{});function ep(e,t){t===void 0&&(t=[]);let n=[];return E.Children.forEach(e,(r,i)=>{if(!E.isValidElement(r))return;let s=[...t,i];if(r.type===E.Fragment){n.push.apply(n,ep(r.props.children,s));return}r.type!==zr&&rt(!1),!r.props.index||!r.props.children||rt(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=ep(r.props.children,s)),n.push(o)}),n}/**
59
+ * React Router DOM v6.30.3
60
+ *
61
+ * Copyright (c) Remix Software Inc.
62
+ *
63
+ * This source code is licensed under the MIT license found in the
64
+ * LICENSE.md file in the root directory of this source tree.
65
+ *
66
+ * @license MIT
67
+ */function tp(){return tp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tp.apply(this,arguments)}function Uj(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function qj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Gj(e,t){return e.button===0&&(!t||t==="_self")&&!qj(e)}const Kj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Yj="6";try{window.__reactRouterVersion=Yj}catch{}const Xj="startTransition",kv=FE[Xj];function Jj(e){let{basename:t,children:n,future:r,window:i}=e,s=E.useRef();s.current==null&&(s.current=XP({window:i,v5Compat:!0}));let o=s.current,[a,l]=E.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},u=E.useCallback(d=>{c&&kv?kv(()=>l(d)):l(d)},[l,c]);return E.useLayoutEffect(()=>o.listen(u),[o,u]),E.useEffect(()=>Bj(r),[r]),E.createElement(Hj,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const Qj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Zj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Sv=E.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:s,replace:o,state:a,target:l,to:c,preventScrollReset:u,viewTransition:d}=t,f=Uj(t,Kj),{basename:p}=E.useContext(yi),g,m=!1;if(typeof c=="string"&&Zj.test(c)&&(g=c,Qj))try{let b=new URL(window.location.href),S=c.startsWith("//")?new URL(b.protocol+c):new URL(c),k=cm(S.pathname,p);S.origin===b.origin&&k!=null?c=k+S.search+S.hash:m=!0}catch{}let y=Sj(c,{relative:i}),x=e2(c,{replace:o,state:a,target:l,preventScrollReset:u,relative:i,viewTransition:d});function v(b){r&&r(b),b.defaultPrevented||x(b)}return E.createElement("a",tp({},f,{href:g||y,onClick:m||s?r:v,ref:n,target:l}))});var Cv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Cv||(Cv={}));var Ev;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ev||(Ev={}));function e2(e,t){let{target:n,replace:r,state:i,preventScrollReset:s,relative:o,viewTransition:a}=t===void 0?{}:t,l=os(),c=ss(),u=H1(e,{relative:o});return E.useCallback(d=>{if(Gj(d,n)){d.preventDefault();let f=r!==void 0?r:pu(c)===pu(u);l(e,{replace:f,state:i,preventScrollReset:s,relative:o,viewTransition:a})}},[c,l,u,r,i,n,e,s,o,a])}var A=typeof window<"u"?window:void 0,ht=typeof globalThis<"u"?globalThis:A;typeof self>"u"&&(ht.self=ht),typeof File>"u"&&(ht.File=function(){});var cn=ht==null?void 0:ht.navigator,K=ht==null?void 0:ht.document,yt=ht==null?void 0:ht.location,np=ht==null?void 0:ht.fetch,rp=ht!=null&&ht.XMLHttpRequest&&"withCredentials"in new ht.XMLHttpRequest?ht.XMLHttpRequest:void 0,Nv=ht==null?void 0:ht.AbortController,t2=ht==null?void 0:ht.CompressionStream,Ut=cn==null?void 0:cn.userAgent,ne=A??{},Pv="1.368.2",Lt={DEBUG:!1,LIB_VERSION:Pv,LIB_NAME:"web",JS_SDK_VERSION:Pv};function jv(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(r,i)}function An(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){jv(s,r,i,o,a,"next",l)}function a(l){jv(s,r,i,o,a,"throw",l)}o(void 0)})}}function V(){return V=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},V.apply(null,arguments)}function G1(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function K1(){return(K1=An(function*(e,t,n){t===void 0&&(t=!0);try{var r=new Blob([e],{type:"text/plain"}).stream().pipeThrough(new CompressionStream("gzip"));return yield new Response(r).blob()}catch(i){if(n!=null&&n.rethrow)throw i;return t&&console.error("Failed to gzip compress data",i),null}})).apply(this,arguments)}var n2=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],r2=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Tv=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return r2.concat(t).some(r=>{var i=r.toLowerCase();return n.indexOf(i)!==-1})};function fe(e,t){return e.indexOf(t)!==-1}var ad=function(e){return e.trim()},ip=function(e){return e.replace(/^\$/,"")},Y1=Object.prototype,X1=Y1.hasOwnProperty,ld=Y1.toString,Ce=Array.isArray||function(e){return ld.call(e)==="[object Array]"},mr=e=>typeof e=="function",ct=e=>e===Object(e)&&!Ce(e),Ls=e=>{if(ct(e)){for(var t in e)if(X1.call(e,t))return!1;return!0}return!1},J=e=>e===void 0,at=e=>ld.call(e)=="[object String]",Ec=e=>at(e)&&e.trim().length===0,Tr=e=>e===null,xe=e=>J(e)||Tr(e),Hn=e=>ld.call(e)=="[object Number]"&&e==e,ys=e=>Hn(e)&&e>0,er=e=>ld.call(e)==="[object Boolean]",i2=e=>e instanceof FormData,s2=e=>fe(n2,e);function J1(e){return e===null||typeof e!="object"}function gu(e,t){return{}.toString.call(e)==="[object "+t+"]"}function fm(e){return typeof Event<"u"&&function(t,n){try{return t instanceof n}catch{return!1}}(e,Event)}var o2=[!0,"true",1,"1","yes"],th=e=>fe(o2,e),a2=[!1,"false",0,"0","no"];function tr(e,t,n,r,i){return t>n&&(r.warn("min cannot be greater than max."),t=n),Hn(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),tr(i||n,t,n,r))}class l2{constructor(t){this.Pt={},this.Dt=t.Dt,this.jt=tr(t.bucketSize,0,100,t.qt),this.$t=tr(t.refillRate,0,this.jt,t.qt),this.Vt=tr(t.refillInterval,0,864e5,t.qt)}Ht(t,n){var r=Math.floor((n-t.lastAccess)/this.Vt);r>0&&(t.tokens=Math.min(t.tokens+r*this.$t,this.jt),t.lastAccess=t.lastAccess+r*this.Vt)}consumeRateLimit(t){var n,r=Date.now(),i=String(t),s=this.Pt[i];return s?this.Ht(s,r):this.Pt[i]=s={tokens:this.jt,lastAccess:r},s.tokens===0||(s.tokens--,s.tokens===0&&((n=this.Dt)==null||n.call(this,t)),s.tokens===0)}stop(){this.Pt={}}}var zl,Mv,nh,dn="Mobile",mu="iOS",br="Android",ro="Tablet",Q1=br+" "+ro,Z1="iPad",ek="Apple",tk=ek+" Watch",va="Safari",io="BlackBerry",nk="Samsung",rk=nk+"Browser",ik=nk+" Internet",Vi="Chrome",c2=Vi+" OS",sk=Vi+" "+mu,pm="Internet Explorer",ok=pm+" "+dn,gm="Opera",u2=gm+" Mini",mm="Edge",ak="Microsoft "+mm,Us="Firefox",lk=Us+" "+mu,Ja="Nintendo",Qa="PlayStation",qs="Xbox",ck=br+" "+dn,uk=dn+" "+va,Jo="Windows",sp=Jo+" Phone",Rv="Nokia",op="Ouya",dk="Generic",d2=dk+" "+dn.toLowerCase(),hk=dk+" "+ro.toLowerCase(),ap="Konqueror",It="(\\d+(\\.\\d+)?)",rh=new RegExp("Version/"+It),h2=new RegExp(qs,"i"),f2=new RegExp(Qa+" \\w+","i"),p2=new RegExp(Ja+" \\w+","i"),xm=new RegExp(io+"|PlayBook|BB10","i"),g2={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},fk=function(e,t){return t=t||"",fe(e," OPR/")&&fe(e,"Mini")?u2:fe(e," OPR/")?gm:xm.test(e)?io:fe(e,"IE"+dn)||fe(e,"WPDesktop")?ok:fe(e,rk)?ik:fe(e,mm)||fe(e,"Edg/")?ak:fe(e,"FBIOS")?"Facebook "+dn:fe(e,"UCWEB")||fe(e,"UCBrowser")?"UC Browser":fe(e,"CriOS")?sk:fe(e,"CrMo")||fe(e,Vi)?Vi:fe(e,br)&&fe(e,va)?ck:fe(e,"FxiOS")?lk:fe(e.toLowerCase(),ap.toLowerCase())?ap:((n,r)=>r&&fe(r,ek)||function(i){return fe(i,va)&&!fe(i,Vi)&&!fe(i,br)}(n))(e,t)?fe(e,dn)?uk:va:fe(e,Us)?Us:fe(e,"MSIE")||fe(e,"Trident/")?pm:fe(e,"Gecko")?Us:""},m2={[ok]:[new RegExp("rv:"+It)],[ak]:[new RegExp(mm+"?\\/"+It)],[Vi]:[new RegExp("("+Vi+"|CrMo)\\/"+It)],[sk]:[new RegExp("CriOS\\/"+It)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+It)],[va]:[rh],[uk]:[rh],[gm]:[new RegExp("(Opera|OPR)\\/"+It)],[Us]:[new RegExp(Us+"\\/"+It)],[lk]:[new RegExp("FxiOS\\/"+It)],[ap]:[new RegExp("Konqueror[:/]?"+It,"i")],[io]:[new RegExp(io+" "+It),rh],[ck]:[new RegExp("android\\s"+It,"i")],[ik]:[new RegExp(rk+"\\/"+It)],[pm]:[new RegExp("(rv:|MSIE )"+It)],Mozilla:[new RegExp("rv:"+It)]},x2=function(e,t){var n=fk(e,t),r=m2[n];if(J(r))return null;for(var i=0;r.length>i;i++){var s=e.match(r[i]);if(s)return parseFloat(s[s.length-2])}return null},Dv=[[new RegExp(qs+"; "+qs+" (.*?)[);]","i"),e=>[qs,e&&e[1]||""]],[new RegExp(Ja,"i"),[Ja,""]],[new RegExp(Qa,"i"),[Qa,""]],[xm,[io,""]],[new RegExp(Jo,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[sp,""];if(new RegExp(dn).test(t)&&!/IEMobile\b/.test(t))return[Jo+" "+dn,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=g2[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[Jo,r]}return[Jo,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[mu,[e[3],e[4],e[5]||"0"].join(".")]:[mu,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=J(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+br+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+br+")","i"),e=>e&&e[2]?[br,[e[2],e[3],e[4]||"0"].join(".")]:[br,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[c2,""]],[/Linux|debian/i,["Linux",""]]],Av=function(e){return p2.test(e)?Ja:f2.test(e)?Qa:h2.test(e)?qs:new RegExp(op,"i").test(e)?op:new RegExp("("+sp+"|WPDesktop)","i").test(e)?sp:/iPad/.test(e)?Z1:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?tk:xm.test(e)?io:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Rv,"i").test(e)?Rv:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(dn).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?br:Q1:new RegExp("(pda|"+dn+")","i").test(e)?d2:new RegExp(ro,"i").test(e)&&!new RegExp(ro+" pc","i").test(e)?hk:""},v2=e=>e instanceof Error;function y2(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return nh&&n.length===Mv||(Mv=n.length,nh=n.reduce((r,i)=>{zl||(zl={});var s=zl[i];if(s)r[s[0]]=s[1];else for(var o=e(i),a=o.length-1;a>=0;a--){var l=o[a],c=l==null?void 0:l.filename,u=t[i];if(c&&u){r[c]=u,zl[i]=[c,u];break}}return r},{})),nh}}class b2{constructor(t,n,r){r===void 0&&(r=[]),this.coercers=t,this.stackParser=n,this.modifiers=r}buildFromUnknown(t,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,n,0).apply(t),s=this.buildParsingContext(n),o=this.parseStacktrace(i,s);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var n=this;return An(function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&Ce(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return t})()}coerceFallback(t){var n;return{type:"Error",value:"Unknown error",stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(t,n){var r,i;return t.cause!=null&&(r=this.parseStacktrace(t.cause,n)),t.stack!=""&&t.stack!=null&&(i=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?n.skipFirstLines:0),n.chunkIdMap)),V({},t,{cause:r,stack:i})}applyChunkIds(t,n){return t.map(r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r))}applyCoercers(t,n){for(var r of this.coercers)if(r.match(t))return r.coerce(t,n);return this.coerceFallback(n)}applyModifiers(t){var n=this;return An(function*(){var r=t;for(var i of n.modifiers)r=yield i(r);return r})()}convertToExceptionList(t,n){var r,i,s,o={type:t.type,value:t.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(i=n.handled)===null||i===void 0||i,synthetic:(s=t.synthetic)!==null&&s!==void 0&&s}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var a=[o];return t.cause!=null&&a.push(...this.convertToExceptionList(t.cause,V({},n,{handled:!0}))),a}buildParsingContext(t){var n;return{chunkIdMap:y2(this.stackParser),skipFirstLines:(n=t.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(t,n,r){r===void 0&&(r=0);var i=(s,o)=>{if(4>=o){var a=this.buildCoercingContext(t,n,o);return this.applyCoercers(s,a)}};return V({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:t,apply:s=>i(s,r),next:s=>i(s,r+1)})}}var so="?";function lp(e,t,n,r,i){var s={platform:e,filename:t,function:n==="<anonymous>"?so:n,in_app:!0};return J(r)||(s.lineno=r),J(i)||(s.colno=i),s}var pk=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:so,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},_2=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,w2=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,k2=/\((\S*)(?::(\d+))(?::(\d+))\)/,S2=(e,t)=>{var n=_2.exec(e);if(n){var[,r,i,s]=n;return lp(t,r,so,+i,+s)}var o=w2.exec(e);if(o){if(o[2]&&o[2].indexOf("eval")===0){var a=k2.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,c]=pk(o[1]||so,o[2]);return lp(t,c,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},C2=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,E2=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,N2=(e,t)=>{var n=C2.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=E2.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var i=n[3],s=n[1]||so;return[s,i]=pk(s,i),lp(t,i,s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Iv=/\(error: (.*)\)/;class P2{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,n){var r=at(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var n=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?n+": "+t.message:n}isDOMException(t){return gu(t,"DOMException")}isDOMError(t){return gu(t,"DOMError")}}class j2{match(t){return(n=>n instanceof Error)(t)}coerce(t,n){return{type:this.getType(t),value:this.getMessage(t,n),stack:this.getStack(t),cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,n){var r=t.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(t){return t.stacktrace||t.stack||void 0}}class T2{constructor(){}match(t){return gu(t,"ErrorEvent")&&t.error!=null}coerce(t,n){var r;return n.apply(t.error)||{type:"ErrorEvent",value:t.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var M2=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class R2{match(t){return typeof t=="string"}coerce(t,n){var r,[i,s]=this.getInfos(t);return{type:i??"Error",value:s??t,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(t){var n="Error",r=t,i=t.match(M2);return i&&(n=i[1],r=i[2]),[n,r]}}var D2=["fatal","error","warning","log","info","debug"];function gk(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(t>=i.length)return r===n.length?i:i.length>t?i.slice(0,t)+"...":i}return""}class A2{match(t){return typeof t=="object"&&t!==null}coerce(t,n){var r,i=this.getErrorPropertyFromObject(t);return i?n.apply(i):{type:this.getType(t),value:this.getValue(t),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return fm(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){var n="'"+t.name+"' captured as exception";return"message"in t&&typeof t.message=="string"&&(n+=" with message: '"+t.message+"'"),n}if("message"in t&&typeof t.message=="string")return t.message;var r=this.getObjectClassName(t);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+gk(t)}isSeverityLevel(t){return at(t)&&!Ec(t)&&D2.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var n in t)if({}.hasOwnProperty.call(t,n)){var r=t[n];if(v2(r))return r}}getObjectClassName(t){try{var n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch{return}}}class I2{match(t){return fm(t)}coerce(t,n){var r,i=t.constructor.name;return{type:i,value:i+" captured as exception with keys: "+gk(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class L2{match(t){return J1(t)}coerce(t,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class O2{match(t){return gu(t,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(t)}isCustomEventWrappingRejection(t){if(!fm(t))return!1;try{var n=t.detail;return n!=null&&typeof n=="object"&&"reason"in n}catch{return!1}}coerce(t,n){var r,i=this.getUnhandledRejectionReason(t);return J1(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(i)}getUnhandledRejectionReason(t){try{if("reason"in t)return t.reason;if("detail"in t&&t.detail!=null&&typeof t.detail=="object"&&"reason"in t.detail)return t.detail.reason}catch{}return t}}var mk=function(e,t){var{debugEnabled:n}=t===void 0?{}:t,r={C(i){if(A&&(Lt.DEBUG||ne.POSTHOG_DEBUG||n)&&!J(A.console)&&A.console){for(var s=("__rrweb_original__"in A.console[i])?A.console[i].__rrweb_original__:A.console[i],o=arguments.length,a=new Array(o>1?o-1:0),l=1;o>l;l++)a[l-1]=arguments[l];s(e,...a)}},info(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];r.C("log",...s)},warn(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];r.C("warn",...s)},error(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];r.C("error",...s)},critical(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];console.error(e,...s)},uninitializedWarning(i){r.error("You must initialize PostHog before calling "+i)},createLogger:(i,s)=>mk(e+" "+i,s)};return r},Y=mk("[PostHog.js]"),Xe=Y.createLogger,F2=Xe("[ExternalScriptsLoader]"),Bl=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return F2.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=K==null?void 0:K.querySelectorAll("script");if(r){for(var i,s=function(){if(r[o].src===t){var l=r[o];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",c=>{l.__posthog_loading_callback_fired=!0,n(void 0,c)}),l.onerror=c=>n(c),{v:void 0})}},o=0;r.length>o;o++)if(i=s())return i.v}var a=()=>{if(!K)return n("document not found");var l=K.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=t,l.onload=d=>{l.__posthog_loading_callback_fired=!0,n(void 0,d)},l.onerror=d=>n(d),e.config.prepare_external_dependency_script&&(l=e.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")K.head.appendChild(l);else{var c,u=K.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):K.body.appendChild(l)}};K!=null&&K.body?a():K==null||K.addEventListener("DOMContentLoaded",a)};ne.__PosthogExtensions__=ne.__PosthogExtensions__||{},ne.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{if(t!=="remote-config")if(e._resolvedSdkVersion){var r=e.requestRouter.endpointFor("assets","/static/"+e._resolvedSdkVersion+"/"+t+".js");Bl(e,r,n)}else{var i="/static/"+t+".js?v="+e.version;if(t==="toolbar"){var s=3e5;i=i+"&t="+Math.floor(Date.now()/s)*s}var o=e.requestRouter.endpointFor("assets",i);Bl(e,o,n)}else{var a=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");Bl(e,a,n)}},ne.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);Bl(e,r,n)};var xk="$people_distinct_id",xu="$device_id",Qo="__alias",Zo="__timers",Lv="$autocapture_disabled_server_side",cp="$heatmaps_enabled_server_side",Ov="$exception_capture_enabled_server_side",up="$error_tracking_suppression_rules",Fv="$error_tracking_capture_extension_exceptions",$v="$web_vitals_enabled_server_side",vk="$dead_clicks_enabled_server_side",zv="$product_tours_enabled_server_side",Bv="$web_vitals_allowed_metrics",Wl="$session_recording_remote_config",vu="$sesid",yk="$session_is_sampled",Os="$enabled_feature_flags",ea="$early_access_features",dp="$feature_flag_details",ta="$stored_person_properties",Di="$stored_group_properties",hp="$surveys",ya="$flag_call_reported",fp="$flag_call_reported_session_id",pp="$feature_flag_errors",yu="$feature_flag_evaluated_at",Mn="$user_state",gp="$client_session_props",mp="$capture_rate_limit",xp="$initial_campaign_params",vp="$initial_referrer_info",bu="$initial_person_info",_u="$epp",bk="__POSTHOG_TOOLBAR__",Hl="$posthog_cookieless",$2=[xk,Qo,"__cmpns",Zo,"$session_recording_enabled_server_side",cp,vu,Os,up,Mn,ea,dp,Di,ta,hp,ya,fp,pp,yu,gp,mp,xp,vp,_u,bu],vm="PostHog loadExternalDependency extension not found.",dr="on_reject",In="always",ds="anonymous",hs="identified",yp="identified_only",wu="visibilitychange",ku="beforeunload",bs="$pageview",ih="$pageleave",sh="$identify",Wv="$groupidentify";function Vl(e,t){Ce(e)&&e.forEach(t)}function $e(e,t){if(!xe(e))if(Ce(e))e.forEach(t);else if(i2(e))e.forEach((r,i)=>t(r,i));else for(var n in e)X1.call(e,n)&&t(e[n],n)}var et=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];for(var i of n)for(var s in i)i[s]!==void 0&&(e[s]=i[s]);return e};function Nc(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 Hv=function(e){try{return e()}catch{return}},z2=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;t>r;r++)n[r]=arguments[r];return e.apply(this,n)}catch(i){Y.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Y.critical(i)}}},ym=function(e){var t={};return $e(e,function(n,r){(at(n)&&n.length>0||Hn(n))&&(t[r]=n)}),t},B2=["herokuapp.com","vercel.app","netlify.app"];function W2(e){var t=e==null?void 0:e.hostname;if(!at(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of B2)if(n===r)return!1;return!0}function ot(e,t,n,r){var{capture:i=!1,passive:s=!0}=r??{};e==null||e.addEventListener(t,n,{capture:i,passive:s})}function _k(e){return e.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Hn(e)&&isFinite(e)&&Math.floor(e)===e});class Su{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||0>t||0>n||0>r||0>i||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new Su(s)}toString(){for(var t="",n=0;this.bytes.length>n;n++)t=t+(this.bytes[n]>>>4).toString(16)+(15&this.bytes[n]).toString(16),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Su(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;16>n;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class H2{constructor(){this.I=0,this.S=0,this.k=new V2}generate(){var t=this.generateOrAbort();if(J(t)){this.I=0;var n=this.generateOrAbort();if(J(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.I)this.I=t,this.A();else{if(this.I>=t+1e4)return;this.S++,this.S>4398046511103&&(this.I++,this.A())}return Su.fromFieldsV7(this.I,Math.trunc(this.S/Math.pow(2,30)),this.S&Math.pow(2,30)-1,this.k.nextUint32())}A(){this.S=1024*this.k.nextUint32()+(1023&this.k.nextUint32())}}var Vv,wk=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};A&&!J(A.crypto)&&crypto.getRandomValues&&(wk=e=>crypto.getRandomValues(e));class V2{constructor(){this.T=new Uint32Array(8),this.N=1/0}nextUint32(){return this.T.length>this.N||(wk(this.T),this.N=0),this.T[this.N++]}}var Ur=()=>U2().toString(),U2=()=>(Vv||(Vv=new H2)).generate(),Mo="",q2=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Zn={Ut:()=>!!K,Yt(e){Y.error("cookieStore error: "+e)},Wt(e){if(K){try{for(var t=e+"=",n=K.cookie.split(";").filter(s=>s.length),r=0;n.length>r;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}}catch{}return null}},Gt(e){var t;try{t=JSON.parse(Zn.Wt(e))||{}}catch{}return t},Xt(e,t,n,r,i){if(K)try{var s="",o="",a=function(u,d){if(d){var f=function(g,m){if(m===void 0&&(m=K),Mo)return Mo;if(!m||["localhost","127.0.0.1"].includes(g))return"";for(var y=g.split("."),x=Math.min(y.length,8),v="dmn_chk_"+Ur();!Mo&&x--;){var b=y.slice(x).join("."),S=v+"=1;domain=."+b+";path=/";m.cookie=S+";max-age=3",m.cookie.includes(v)&&(m.cookie=S+";max-age=0",Mo=b)}return Mo}(u);if(!f){var p=(g=>{var m=g.match(q2);return m?m[0]:""})(u);p!==f&&Y.info("Warning: cookie subdomain discovery mismatch",p,f),f=p}return f?"; domain=."+f:""}return""}(K.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+864e5*n),s="; expires="+l.toUTCString()}i&&(o="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return c.length>3686.4&&Y.warn("cookieStore warning: large cookie, len="+c.length),K.cookie=c,c}catch{return}},Jt(e,t){if(K!=null&&K.cookie)try{Zn.Xt(e,"",-1,t)}catch{return}}},oh=null,Ge={Ut(){if(!Tr(oh))return oh;var e=!0;if(J(A))e=!1;else try{var t="__mplssupport__";Ge.Xt(t,"xyz"),Ge.Wt(t)!=='"xyz"'&&(e=!1),Ge.Jt(t)}catch{e=!1}return e||Y.error("localStorage unsupported; falling back to cookie store"),oh=e,e},Yt(e){Y.error("localStorage error: "+e)},Wt(e){try{return A==null?void 0:A.localStorage.getItem(e)}catch(t){Ge.Yt(t)}return null},Gt(e){try{return JSON.parse(Ge.Wt(e))||{}}catch{}return null},Xt(e,t){try{A==null||A.localStorage.setItem(e,JSON.stringify(t))}catch(n){Ge.Yt(n)}},Jt(e){try{A==null||A.localStorage.removeItem(e)}catch(t){Ge.Yt(t)}}},G2=[xu,"distinct_id",vu,yk,_u,bu,Mn],Ul={},K2={Ut:()=>!0,Yt(e){Y.error("memoryStorage error: "+e)},Wt:e=>Ul[e]||null,Gt:e=>Ul[e]||null,Xt(e,t){Ul[e]=t},Jt(e){delete Ul[e]}},ki=null,bt={Ut(){if(!Tr(ki))return ki;if(ki=!0,J(A))ki=!1;else try{var e="__support__";bt.Xt(e,"xyz"),bt.Wt(e)!=='"xyz"'&&(ki=!1),bt.Jt(e)}catch{ki=!1}return ki},Yt(e){Y.error("sessionStorage error: ",e)},Wt(e){try{return A==null?void 0:A.sessionStorage.getItem(e)}catch(t){bt.Yt(t)}return null},Gt(e){try{return JSON.parse(bt.Wt(e))||null}catch{}return null},Xt(e,t){try{A==null||A.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){bt.Yt(n)}},Jt(e){try{A==null||A.sessionStorage.removeItem(e)}catch(t){bt.Yt(t)}}};class Y2{constructor(t){this._instance=t}get Rt(){return this._instance.config}get consent(){return this.Kt()?0:this.Qt}isOptedOut(){return this.Rt.cookieless_mode===In||this.consent===0||this.consent===-1&&(this.Rt.opt_out_capturing_by_default||this.Rt.cookieless_mode===dr)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}optInOut(t){this.ti.Xt(this.ei,t?1:0,this.Rt.cookie_expiration,this.Rt.cross_subdomain_cookie,this.Rt.secure_cookie)}reset(){this.ti.Jt(this.ei,this.Rt.cross_subdomain_cookie)}get ei(){var{token:t,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+t:"__ph_opt_in_out_"+t)}get Qt(){var t=this.ti.Wt(this.ei);return th(t)?1:fe(a2,t)?0:-1}get ti(){var t=this.Rt.opt_out_capturing_persistence_type,n=t==="localStorage"?Ge:Zn;if(!this.ii||this.ii!==n){this.ii=n;var r=t==="localStorage"?Zn:Ge;r.Wt(this.ei)&&(this.ii.Wt(this.ei)||this.optInOut(th(r.Wt(this.ei))),r.Jt(this.ei,this.Rt.cross_subdomain_cookie))}return this.ii}Kt(){return!!this.Rt.respect_dnt&&[cn==null?void 0:cn.doNotTrack,cn==null?void 0:cn.msDoNotTrack,ne.doNotTrack].some(t=>th(t))}}var ql=Xe("[Dead Clicks]"),X2=()=>!0,J2=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(vk)),r=e.instance.config.capture_dead_clicks;return er(r)?r:!!ct(r)||n};class Uv{get lazyLoadedDeadClicksAutocapture(){return this.ri}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[vk]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.ni(()=>{this.si()}):this.stop()}ni(t){var n,r;(n=ne.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&t(),(r=ne.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",i=>{i?ql.error("failed to load script",i):t()})}si(){var t;if(K){if(!this.ri&&(t=ne.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var n=ct(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.ri=ne.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.ri.start(K),ql.info("starting...")}}else ql.error("`document` not found. Cannot start.")}stop(){this.ri&&(this.ri.stop(),this.ri=void 0,ql.info("stopping..."))}}var ah=Xe("[SegmentIntegration]"),kk="posthog-js";function Sk(e,t){var{organization:n,projectId:r,prefix:i,severityAllowList:s=["error"],sendExceptionsToPostHog:o=!0}=t===void 0?{}:t;return a=>{var l,c,u,d,f;if(s!=="*"&&!s.includes(a.level)||!e.__loaded)return a;a.tags||(a.tags={});var p=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());a.tags["PostHog Person URL"]=p,e.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var g,m=((l=a.exception)==null?void 0:l.values)||[],y=m.map(v=>V({},v,{stacktrace:v.stacktrace?V({},v.stacktrace,{type:"raw",frames:(v.stacktrace.frames||[]).map(b=>V({},b,{platform:"web:javascript"}))}):void 0})),x={$exception_message:((c=m[0])==null?void 0:c.value)||a.message,$exception_type:(u=m[0])==null?void 0:u.type,$exception_level:a.level,$exception_list:y,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((d=m[0])==null?void 0:d.value)||a.message,$sentry_exception_type:(f=m[0])==null?void 0:f.type,$sentry_tags:a.tags};return n&&r&&(x.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+a.event_id),o&&((g=e.exceptions)==null||g.sendExceptionEvent(x)),a}}class Q2{constructor(t,n,r,i,s,o){this.name=kk,this.setupOnce=function(a){a(Sk(t,{organization:n,projectId:r,prefix:i,severityAllowList:s,sendExceptionsToPostHog:o==null||o}))}}}class qv{constructor(t){this.oi=(n,r,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength)&&(Y.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:i}),this.ai=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.li()}li(){var t;this.ui=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(this.oi)}destroy(){var t;(t=this.ui)==null||t.call(this),this.ui=void 0}doPageView(t,n){var r,i=this.hi(t,n);return this.ai={pathname:(r=A==null?void 0:A.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var n;return this.hi(t,(n=this.ai)==null?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.ai)==null?void 0:t.pageViewId}}hi(t,n){var r=this.ai;if(!r)return{$pageview_id:n};var i={$pageview_id:n,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:a,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:d}=s;if(!(J(o)||J(a)||J(l)||J(c)||J(u)||J(d))){o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d);var f=o>1?tr(a/o,0,1,Y):1,p=o>1?tr(l/o,0,1,Y):1,g=c>1?tr(u/c,0,1,Y):1,m=c>1?tr(d/c,0,1,Y):1;i=et(i,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:g,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:m})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}var Cu=e=>{var t=K==null?void 0:K.createElement("a");return J(t)?null:(t.href=e,t)},Eu=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;r.length>i;i++){var s=r[i].split("=");if(s[0]===t){n=s;break}}if(!Ce(n)||2>n.length)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{Y.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Za=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),i=r[1],s=(r[0]||"").split("?"),o=s[1],a=s[0],l=(o||"").split("&"),c=[],u=0;l.length>u;u++){var d=l[u].split("=");Ce(d)&&(t.includes(d[0])?c.push(d[0]+"="+n):c.push(l[u]))}var f=a;return o!=null&&(f+="?"+c.join("&")),i!=null&&(f+="#"+i),f},Nu=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Gl="https?://(.*)",oo=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Z2=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...oo],el="<masked>",eT=["li_fat_id"];function Ck(e,t,n){if(!K)return{};var r,i=t?[...oo,...n||[]]:[],s=Ek(Za(K.URL,i,el),e),o=(r={},$e(eT,function(a){var l=Zn.Wt(a);r[a]=l||null}),r);return et(o,s)}function Ek(e,t){var n=Z2.concat(t||[]),r={};return $e(n,function(i){var s=Eu(e,i);r[i]=s||null}),r}function Nk(e){var t=function(s){return s?s.search(Gl+"google.([^/?]*)")===0?"google":s.search(Gl+"bing.com")===0?"bing":s.search(Gl+"yahoo.com")===0?"yahoo":s.search(Gl+"duckduckgo.com")===0?"duckduckgo":null:null}(e),n=t!="yahoo"?"q":"p",r={};if(!Tr(t)){r.$search_engine=t;var i=K?Eu(K.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function Gv(){return navigator.language||navigator.userLanguage}var Pu="$direct";function Pk(){return(K==null?void 0:K.referrer)||Pu}function jk(e,t){var n=e?[...oo,...t||[]]:[],r=yt==null?void 0:yt.href.substring(0,1e3);return{r:Pk().substring(0,1e3),u:r?Za(r,n,el):void 0}}function Tk(e){var t,{r:n,u:r}=e,i={$referrer:n,$referring_domain:n==null?void 0:n==Pu?Pu:(t=Cu(n))==null?void 0:t.host};if(r){i.$current_url=r;var s=Cu(r);i.$host=s==null?void 0:s.host,i.$pathname=s==null?void 0:s.pathname;var o=Ek(r);et(i,o)}if(n){var a=Nk(n);et(i,a)}return i}function Mk(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function tT(){try{return new Date().getTimezoneOffset()}catch{return}}var nT=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class lh{constructor(t,n){this.Rt=t,this.props={},this.ci=!1,this.di=(r=>{var i="";return r.token&&(i=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+i+"_posthog"})(t),this.ti=this.vi(t),this.load(),t.debug&&Y.info("Persistence loaded",t.persistence,V({},this.props)),this.update_config(t,t,n),this.save()}isDisabled(){return!!this.fi}vi(t){nT.indexOf(t.persistence.toLowerCase())===-1&&(Y.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=function(i){i===void 0&&(i=[]);var s=[...G2,...i];return V({},Ge,{Gt(o){try{var a={};try{a=Zn.Gt(o)||{}}catch{}var l=et(a,JSON.parse(Ge.Wt(o)||"{}"));return Ge.Xt(o,l),l}catch{}return null},Xt(o,a,l,c,u,d){try{Ge.Xt(o,a,void 0,void 0,d);var f={};s.forEach(p=>{a[p]&&(f[p]=a[p])}),Object.keys(f).length&&Zn.Xt(o,f,l,c,u,d)}catch(p){Ge.Yt(p)}},Jt(o,a){try{A==null||A.localStorage.removeItem(o),Zn.Jt(o,a)}catch(l){Ge.Yt(l)}}})}(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return r==="localstorage"&&Ge.Ut()?Ge:r==="localstorage+cookie"&&n.Ut()?n:r==="sessionstorage"&&bt.Ut()?bt:r==="memory"?K2:r==="cookie"?Zn:n.Ut()?n:Zn}pi(t){var n=t??this.Rt.feature_flag_cache_ttl_ms;if(!n||0>=n)return!1;var r=this.props[yu];return!r||typeof r!="number"||Date.now()-r>n}properties(){var t={};return $e(this.props,(n,r)=>{if(r===Os&&ct(n)){if(!this.pi())for(var i=Object.keys(n),s=0;i.length>s;s++)t["$feature/"+i[s]]=n[i[s]]}else $2.indexOf(r)===-1&&(t[r]=n)}),t}load(){if(!this.fi){var t=this.ti.Gt(this.di);t&&(this.props=et({},t))}}save(){this.fi||this.ti.Xt(this.di,this.props,this.gi,this.mi,this.yi,this.Rt.debug)}remove(){this.ti.Jt(this.di,!1),this.ti.Jt(this.di,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(ct(t)){J(n)&&(n="None"),this.gi=J(r)?this.bi:r;var i=!1;if($e(t,(s,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.props[o]=s,i=!0)}),i)return this.save(),!0}return!1}register(t,n){if(ct(t)){this.gi=J(n)?this.bi:n;var r=!1;if($e(t,(i,s)=>{t.hasOwnProperty(s)&&this.props[s]!==i&&(this.props[s]=i,r=!0)}),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.ci){var t=Ck(this.Rt.custom_campaign_params,this.Rt.mask_personal_data_properties,this.Rt.custom_personal_data_properties);Ls(ym(t))||this.register(t),this.ci=!0}}update_search_keyword(){var t;this.register((t=K==null?void 0:K.referrer)?Nk(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Pk(),$referring_domain:K!=null&&K.referrer&&((t=Cu(K.referrer))==null?void 0:t.host)||Pu},void 0)}set_initial_person_info(){this.props[xp]||this.props[vp]||this.register_once({[bu]:jk(this.Rt.mask_personal_data_properties,this.Rt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};$e([vp,xp],o=>{var a=this.props[o];a&&$e(a,function(l,c){t["$initial_"+ip(c)]=l})});var n,r,i=this.props[bu];if(i){var s=(n=Tk(i),r={},$e(n,function(o,a){r["$initial_"+ip(a)]=o}),r);et(t,s)}return t}safe_merge(t){return $e(this.props,function(n,r){r in t||(t[r]=n)}),t}update_config(t,n,r){if(this.bi=this.gi=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence||!((o,a)=>{if(o.length!==a.length)return!1;var l=[...o].sort(),c=[...a].sort();return l.every((u,d)=>u===c[d])})(t.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var i=this.vi(t),s=this.props;this.clear(),this.ti=i,this.props=s,this.save()}}set_disabled(t){this.fi=t,this.fi?this.remove():this.save()}set_cross_subdomain(t){t!==this.mi&&(this.mi=t,this.remove(),this.save())}set_secure(t){t!==this.yi&&(this.yi=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[Zo]||{};r[t]=n,this.props[Zo]=r,this.save()}remove_event_timer(t){var n=(this.props[Zo]||{})[t];return J(n)||(delete this.props[Zo][t],this.save()),n}get_property(t){return this.props[t]}set_property(t,n){this.props[t]=n,this.save()}}var Ro={Activation:"events",Cancellation:"cancelEvents"},ch={Popover:"popover",API:"api",Widget:"widget"},na={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},uh={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},bp={Popover:"popover",Inline:"inline"},rT={SHOWN:"product tour shown"},Kv={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},Yv=Xe("[RateLimiter]");class iT{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach(i=>{Yv.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4})}catch(i){return void Yv.warn('could not rate limit - continuing. Error: "'+(i==null?void 0:i.message)+'"',{text:r})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)==null?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)==null?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var n,r,i;t===void 0&&(t=!1);var{captureEventsBurstLimit:s,captureEventsPerSecond:o}=this,a=new Date().getTime(),l=(n=(r=this.instance.persistence)==null?void 0:r.get_property(mp))!==null&&n!==void 0?n:{tokens:s,last:a};l.tokens+=(a-l.last)/1e3*o,l.last=a,l.tokens>s&&(l.tokens=s);var c=1>l.tokens;return c||t||(l.tokens=Math.max(0,l.tokens-1)),!c||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+o+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=c,(i=this.instance.persistence)==null||i.set_property(mp,l),{isRateLimited:c,remainingTokens:l.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Do=Xe("[RemoteConfig]");class Rk{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=ne._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}wi(t){var n,r;(n=ne.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=ne.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",()=>t(this.remoteConfig)):t()}Ii(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(n){t(n.json)}})}load(){try{if(this.remoteConfig)return Do.info("Using preloaded remote config",this.remoteConfig),this.Ci(this.remoteConfig),void this.Si();if(this._instance.ki())return void Do.warn("Remote config is disabled. Falling back to local config.");this.wi(t=>{if(!t)return Do.info("No config found after loading remote JS config. Falling back to JSON."),void this.Ii(n=>{this.Ci(n),this.Si()});this.Ci(t),this.Si()})}catch(t){Do.error("Error loading remote config",t)}}stop(){this.xi&&(clearInterval(this.xi),this.xi=void 0)}refresh(){this._instance.ki()||(K==null?void 0:K.visibilityState)==="hidden"||this._instance.reloadFeatureFlags()}Si(){var t;if(!this.xi){var n=(t=this._instance.config.remote_config_refresh_interval_ms)!==null&&t!==void 0?t:3e5;n!==0&&(this.xi=setInterval(()=>{this.refresh()},n))}}Ci(t){var n;t||Do.error("Failed to fetch remote config from PostHog."),this._instance.Ci(t??{}),(t==null?void 0:t.hasFeatureFlags)!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(n=this._instance.featureFlags)==null||n.ensureFlagsLoaded())}}var Xn={GZipJS:"gzip-js",Base64:"base64"},En=Uint8Array,Yt=Uint16Array,ao=Uint32Array,bm=new En([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]),_m=new En([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]),Xv=new En([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Dk=function(e,t){for(var n=new Yt(31),r=0;31>r;++r)n[r]=t+=1<<e[r-1];var i=new ao(n[30]);for(r=1;30>r;++r)for(var s=n[r];n[r+1]>s;++s)i[s]=s-n[r]<<5|r;return[n,i]},Ak=Dk(bm,2),_p=Ak[1];Ak[0][28]=258,_p[258]=28;for(var Jv=Dk(_m,0)[1],Ik=new Yt(32768),ze=0;32768>ze;++ze){var fs=(43690&ze)>>>1|(21845&ze)<<1;Ik[ze]=((65280&(fs=(61680&(fs=(52428&fs)>>>2|(13107&fs)<<2))>>>4|(3855&fs)<<4))>>>8|(255&fs)<<8)>>>1}var ba=function(e,t,n){for(var r=e.length,i=0,s=new Yt(t);r>i;++i)++s[e[i]-1];var o,a=new Yt(t);for(i=0;t>i;++i)a[i]=a[i-1]+s[i-1]<<1;for(o=new Yt(r),i=0;r>i;++i)o[i]=Ik[a[e[i]-1]++]>>>15-e[i];return o},Zi=new En(288);for(ze=0;144>ze;++ze)Zi[ze]=8;for(ze=144;256>ze;++ze)Zi[ze]=9;for(ze=256;280>ze;++ze)Zi[ze]=7;for(ze=280;288>ze;++ze)Zi[ze]=8;var ju=new En(32);for(ze=0;32>ze;++ze)ju[ze]=5;var sT=ba(Zi,9),oT=ba(ju,5),Lk=function(e){return(e/8>>0)+(7&e&&1)},Ok=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof Yt?Yt:e instanceof ao?ao:En)(n-t);return r.set(e.subarray(t,n)),r},cr=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8},Ao=function(e,t,n){var r=t/8>>0;e[r]|=n<<=7&t,e[r+1]|=n>>>8,e[r+2]|=n>>>16},dh=function(e,t){for(var n=[],r=0;e.length>r;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return[new En(0),0];if(i==1){var o=new En(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort(function(k,_){return k.f-_.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=n[n[d].f>n[c].f?c++:d++],l=n[c!=u&&n[d].f>n[c].f?c++:d++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};var f=s[0].s;for(r=1;i>r;++r)s[r].s>f&&(f=s[r].s);var p=new Yt(f+1),g=wp(n[u-1],p,0);if(g>t){r=0;var m=0,y=g-t,x=1<<y;for(s.sort(function(k,_){return p[_.s]-p[k.s]||k.f-_.f});i>r;++r){var v=s[r].s;if(t>=p[v])break;m+=x-(1<<g-p[v]),p[v]=t}for(m>>>=y;m>0;){var b=s[r].s;t>p[b]?m-=1<<t-p[b]++-1:++r}for(;r>=0&&m;--r){var S=s[r].s;p[S]==t&&(--p[S],++m)}g=t}return[new En(p),g]},wp=function(e,t,n){return e.s==-1?Math.max(wp(e.l,t,n+1),wp(e.r,t,n+1)):t[e.s]=n},Qv=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new Yt(++t),r=0,i=e[0],s=1,o=function(l){n[r++]=l},a=1;t>=a;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return[n.subarray(0,r),t]},Io=function(e,t){for(var n=0,r=0;t.length>r;++r)n+=e[r]*t[r];return n},kp=function(e,t,n){var r=n.length,i=Lk(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;r>s;++s)e[i+s+4]=n[s];return 8*(i+4+r)},Zv=function(e,t,n,r,i,s,o,a,l,c,u){cr(t,u++,n),++i[256];for(var d=dh(i,15),f=d[0],p=d[1],g=dh(s,15),m=g[0],y=g[1],x=Qv(f),v=x[0],b=x[1],S=Qv(m),k=S[0],_=S[1],C=new Yt(19),P=0;v.length>P;++P)C[31&v[P]]++;for(P=0;k.length>P;++P)C[31&k[P]]++;for(var j=dh(C,7),w=j[0],M=j[1],D=19;D>4&&!w[Xv[D-1]];--D);var F,$,I,H,X=c+5<<3,L=Io(i,Zi)+Io(s,ju)+o,B=Io(i,f)+Io(s,m)+o+14+3*D+Io(C,w)+(2*C[16]+3*C[17]+7*C[18]);if(L>=X&&B>=X)return kp(t,u,e.subarray(l,l+c));if(cr(t,u,1+(L>B)),u+=2,L>B){F=ba(f,p),$=f,I=ba(m,y),H=m;var N=ba(w,M);for(cr(t,u,b-257),cr(t,u+5,_-1),cr(t,u+10,D-4),u+=14,P=0;D>P;++P)cr(t,u+3*P,w[Xv[P]]);u+=3*D;for(var Q=[v,k],te=0;2>te;++te){var T=Q[te];for(P=0;T.length>P;++P)cr(t,u,N[re=31&T[P]]),u+=w[re],re>15&&(cr(t,u,T[P]>>>5&127),u+=T[P]>>>12)}}else F=sT,$=Zi,I=oT,H=ju;for(P=0;a>P;++P)if(r[P]>255){var re;Ao(t,u,F[257+(re=r[P]>>>18&31)]),u+=$[re+257],re>7&&(cr(t,u,r[P]>>>23&31),u+=bm[re]);var le=31&r[P];Ao(t,u,I[le]),u+=H[le],le>3&&(Ao(t,u,r[P]>>>5&8191),u+=_m[le])}else Ao(t,u,F[r[P]]),u+=$[r[P]];return Ao(t,u,F[256]),u+$[256]},aT=new ao([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),lT=function(){for(var e=new ao(256),t=0;256>t;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),hh=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function cT(e,t){t===void 0&&(t={});var n=function(){var d=4294967295;return{p(f){for(var p=d,g=0;f.length>g;++g)p=lT[255&p^f[g]]^p>>>8;d=p},d(){return 4294967295^d}}}(),r=e.length;n.p(e);var i,s,o,a,l,c=(a=10+((i=t).filename&&i.filename.length+1||0),l=8,function(d,f,p,g,m,y){var x=d.length,v=new En(g+x+5*(1+Math.floor(x/7e3))+m),b=v.subarray(g,v.length-m),S=0;if(!f||8>x)for(var k=0;x>=k;k+=65535){var _=k+65535;x>_?S=kp(b,S,d.subarray(k,_)):(b[k]=!0,S=kp(b,S,d.subarray(k,x)))}else{for(var C=aT[f-1],P=C>>>13,j=8191&C,w=(1<<p)-1,M=new Yt(32768),D=new Yt(w+1),F=Math.ceil(p/3),$=2*F,I=function(mn){return(d[mn]^d[mn+1]<<F^d[mn+2]<<$)&w},H=new ao(25e3),X=new Yt(288),L=new Yt(32),B=0,N=0,Q=(k=0,0),te=0,T=0;x>k;++k){var re=I(k),le=32767&k,ae=D[re];if(M[le]=ae,D[re]=le,k>=te){var R=x-k;if((B>7e3||Q>24576)&&R>423){S=Zv(d,b,0,H,X,L,N,Q,T,k-T,S),Q=B=N=0,T=k;for(var ie=0;286>ie;++ie)X[ie]=0;for(ie=0;30>ie;++ie)L[ie]=0}var ee=2,Pe=0,Ze=j,xt=le-ae&32767;if(R>2&&re==I(k-xt))for(var q=Math.min(P,R)-1,de=Math.min(32767,k),ke=Math.min(258,R);de>=xt&&--Ze&&le!=ae;){if(d[k+ee]==d[k+ee-xt]){for(var be=0;ke>be&&d[k+be]==d[k+be-xt];++be);if(be>ee){if(ee=be,Pe=xt,be>q)break;var Vn=Math.min(xt,be-2),Dr=0;for(ie=0;Vn>ie;++ie){var Me=k-xt+ie+32768&32767,it=Me-M[Me]+32768&32767;it>Dr&&(Dr=it,ae=Me)}}}xt+=(le=ae)-(ae=M[le])+32768&32767}if(Pe){H[Q++]=268435456|_p[ee]<<18|Jv[Pe];var Se=31&_p[ee],en=31&Jv[Pe];N+=bm[Se]+_m[en],++X[257+Se],++L[en],te=k+ee,++B}else H[Q++]=d[k],++X[d[k]]}}S=Zv(d,b,!0,H,X,L,N,Q,T,k-T,S)}return Ok(v,0,g+Lk(S)+m)}(s=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+o.mem,a,l)),u=c.length;return function(d,f){var p=f.filename;if(d[0]=31,d[1]=139,d[2]=8,d[8]=2>f.level?4:f.level==9?2:0,d[9]=3,f.mtime!=0&&hh(d,4,Math.floor(new Date(f.mtime||Date.now())/1e3)),p){d[3]=8;for(var g=0;p.length>=g;++g)d[g+10]=p.charCodeAt(g)}}(c,t),hh(c,u-8,n.d()),hh(c,u-4,r),c}var uT=!!rp||!!np,Fk="text/plain",ey=!1,cd=function(e,t,n){var r;n===void 0&&(n=!0);var[i,s]=e.split("?"),o=V({},t),a=(r=s==null?void 0:s.split("&").map(c=>{var u,[d,f]=c.split("="),p=n&&(u=o[d])!==null&&u!==void 0?u:f;return delete o[d],d+"="+p}))!==null&&r!==void 0?r:[],l=function(c,u){var d,f;u===void 0&&(u="&");var p=[];return $e(c,function(g,m){J(g)||J(m)||m==="undefined"||(d=encodeURIComponent((y=>y instanceof File)(g)?g.name:g.toString()),f=encodeURIComponent(m),p[p.length]=f+"="+d)}),p.join(u)}(o);return l&&a.push(l),i+"?"+a.join("&")},Fs=(e,t)=>JSON.stringify(e,(n,r)=>typeof r=="bigint"?r.toString():r,t),fh=e=>{if(e.zt)return e.zt;var{data:t,compression:n}=e;if(t){if(n===Xn.GZipJS){var r=cT(function(a,l){var c=a.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(a);for(var u=new En(a.length+(a.length>>>1)),d=0,f=function(y){u[d++]=y},p=0;c>p;++p){if(d+5>u.length){var g=new En(d+8+(c-p<<1));g.set(u),u=g}var m=a.charCodeAt(p);128>m?f(m):2048>m?(f(192|m>>>6),f(128|63&m)):m>55295&&57344>m?(f(240|(m=65536+(1047552&m)|1023&a.charCodeAt(++p))>>>18),f(128|m>>>12&63),f(128|m>>>6&63),f(128|63&m)):(f(224|m>>>12),f(128|m>>>6&63),f(128|63&m))}return Ok(u,0,d)}(Fs(t)),{mtime:0});return{contentType:Fk,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===Xn.Base64){var i=function(a){return a&&btoa(encodeURIComponent(a).replace(/%([0-9A-F]{2})/g,(l,c)=>String.fromCharCode(parseInt(c,16))))}(Fs(t)),s=(a=>"data="+encodeURIComponent(typeof a=="string"?a:Fs(a)))(i);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var o=Fs(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},dT=function(){var e=An(function*(t){var n=Fs(t.data),r=yield function(s,o,a){return K1.apply(this,arguments)}(n,Lt.DEBUG,{rethrow:!0});if(!r)return t;var i=yield r.arrayBuffer();return V({},t,{zt:{contentType:Fk,body:i,estimatedSize:i.byteLength}})});return function(t){return e.apply(this,arguments)}}(),ty=(e,t)=>cd(e,{_:new Date().getTime().toString(),ver:Lt.JS_SDK_VERSION,compression:t}),Pc=[];np&&Pc.push({transport:"fetch",method(e){var t,n,{contentType:r,body:i,estimatedSize:s}=(t=fh(e))!==null&&t!==void 0?t:{},o=new Headers;$e(e.headers,function(u,d){o.append(d,u)}),r&&o.append("Content-Type",r);var a=e.url,l=null;if(Nv){var c=new Nv;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),e.timeout)}}np(a,V({method:(e==null?void 0:e.method)||"GET",headers:o,keepalive:e.method==="POST"&&52428.8>(s||0),body:i,signal:(n=l)==null?void 0:n.signal},e.fetchOptions)).then(u=>u.text().then(d=>{var f={statusCode:u.status,text:d};if(u.status===200)try{f.json=JSON.parse(d)}catch(p){Y.error(p)}e.callback==null||e.callback(f)})).catch(u=>{Y.error(u),e.callback==null||e.callback({statusCode:0,error:u})}).finally(()=>l?clearTimeout(l.timeout):null)}}),rp&&Pc.push({transport:"XHR",method(e){var t,n=new rp;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:i}=(t=fh(e))!==null&&t!==void 0?t:{};$e(e.headers,function(s,o){n.setRequestHeader(o,s)}),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),e.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var s={statusCode:n.status,text:n.responseText};if(n.status===200)try{s.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(s)}},n.send(i)}}),cn!=null&&cn.sendBeacon&&Pc.push({transport:"sendBeacon",method(e){var t=cd(e.url,{beacon:"1"});try{var n,{contentType:r,body:i}=(n=fh(e))!==null&&n!==void 0?n:{};if(!i)return;var s=i instanceof Blob?i:new Blob([i],{type:r});cn.sendBeacon(t,s)}catch{}}});var Sp=3e3;class hT{constructor(t,n){this.Ti=!0,this.Ai=[],this.Ei=tr((n==null?void 0:n.flush_interval_ms)||Sp,250,5e3,Y.createLogger("flush interval"),Sp),this.Ri=t}enqueue(t){this.Ai.push(t),this.Ni||this.Mi()}unload(){this.Fi();var t=this.Ai.length>0?this.Oi():{},n=Object.values(t);[...n.filter(r=>r.url.indexOf("/e")===0),...n.filter(r=>r.url.indexOf("/e")!==0)].map(r=>{this.Ri(V({},r,{transport:"sendBeacon"}))})}enable(){this.Ti=!1,this.Mi()}Mi(){var t=this;this.Ti||(this.Ni=setTimeout(()=>{if(this.Fi(),this.Ai.length>0){var n=this.Oi(),r=function(){var s=n[i],o=new Date().getTime();s.data&&Ce(s.data)&&$e(s.data,a=>{a.offset=Math.abs(a.timestamp-o),delete a.timestamp}),t.Ri(s)};for(var i in n)r()}},this.Ei))}Fi(){clearTimeout(this.Ni),this.Ni=void 0}Oi(){var t={};return $e(this.Ai,n=>{var r,i=n,s=(i?i.batchKey:null)||i.url;J(t[s])&&(t[s]=V({},i,{data:[]})),(r=t[s].data)==null||r.push(i.data)}),this.Ai=[],t}}var fT=["retriesPerformedSoFar"];class pT{constructor(t){this.Pi=!1,this.Li=3e3,this.Ai=[],this._instance=t,this.Ai=[],this.Di=!0,!J(A)&&"onLine"in A.navigator&&(this.Di=A.navigator.onLine,this.Bi=()=>{this.Di=!0,this.ji()},this.qi=()=>{this.Di=!1},ot(A,"online",this.Bi),ot(A,"offline",this.qi))}get length(){return this.Ai.length}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=G1(t,fT);ys(n)&&(r.url=cd(r.url,{retry_count:n})),this._instance._send_request(V({},r,{callback:i=>{i.statusCode===200||i.statusCode>=400&&500>i.statusCode||(n??0)>=10?r.callback==null||r.callback(i):this.Zi(V({retriesPerformedSoFar:n},r))}}))}Zi(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=function(o){var a=3e3*Math.pow(2,o),l=a/2,c=Math.min(18e5,a),u=Math.random()-.5;return Math.ceil(c+u*(c-l))}(n),i=Date.now()+r;this.Ai.push({retryAt:i,requestOptions:t});var s="Enqueued failed request for retry in "+r;navigator.onLine||(s+=" (Browser is offline)"),Y.warn(s),this.Pi||(this.Pi=!0,this.$i())}$i(){if(this.Vi&&clearTimeout(this.Vi),this.Ai.length===0)return this.Pi=!1,void(this.Vi=void 0);this.Vi=setTimeout(()=>{this.Di&&this.Ai.length>0&&this.ji(),this.$i()},this.Li)}ji(){var t=Date.now(),n=[],r=this.Ai.filter(s=>t>s.retryAt||(n.push(s),!1));if(this.Ai=n,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.Vi&&(clearTimeout(this.Vi),this.Vi=void 0),this.Pi=!1,J(A)||(this.Bi&&(A.removeEventListener("online",this.Bi),this.Bi=void 0),this.qi&&(A.removeEventListener("offline",this.qi),this.qi=void 0)),this.Ai))try{this._instance._send_request(V({},t,{transport:"sendBeacon"}))}catch(n){Y.error(n)}this.Ai=[]}}class gT{constructor(t){this.Hi=()=>{var n,r,i,s;this.zi||(this.zi={});var o=this.scrollElement(),a=this.scrollY(),l=o?Math.max(0,o.scrollHeight-o.clientHeight):0,c=a+((o==null?void 0:o.clientHeight)||0),u=(o==null?void 0:o.scrollHeight)||0;this.zi.lastScrollY=Math.ceil(a),this.zi.maxScrollY=Math.max(a,(n=this.zi.maxScrollY)!==null&&n!==void 0?n:0),this.zi.maxScrollHeight=Math.max(l,(r=this.zi.maxScrollHeight)!==null&&r!==void 0?r:0),this.zi.lastContentY=c,this.zi.maxContentY=Math.max(c,(i=this.zi.maxContentY)!==null&&i!==void 0?i:0),this.zi.maxContentHeight=Math.max(u,(s=this.zi.maxContentHeight)!==null&&s!==void 0?s:0)},this._instance=t}get Ui(){return this._instance.config.scroll_root_selector}getContext(){return this.zi}resetContext(){var t=this.zi;return setTimeout(this.Hi,0),t}startMeasuringScrollPosition(){ot(A,"scroll",this.Hi,{capture:!0}),ot(A,"scrollend",this.Hi,{capture:!0}),ot(A,"resize",this.Hi)}scrollElement(){if(!this.Ui)return A==null?void 0:A.document.documentElement;var t=Ce(this.Ui)?this.Ui:[this.Ui];for(var n of t){var r=A==null?void 0:A.document.querySelector(n);if(r)return r}}scrollY(){if(this.Ui){var t=this.scrollElement();return t&&t.scrollTop||0}return A&&(A.scrollY||A.pageYOffset||A.document.documentElement.scrollTop)||0}scrollX(){if(this.Ui){var t=this.scrollElement();return t&&t.scrollLeft||0}return A&&(A.scrollX||A.pageXOffset||A.document.documentElement.scrollLeft)||0}}var mT=e=>jk(e==null?void 0:e.config.mask_personal_data_properties,e==null?void 0:e.config.custom_personal_data_properties);class ny{constructor(t,n,r,i){this.Yi=s=>{var o=this.Wi();if(!o||o.sessionId!==s){var a={sessionId:s,props:this.Gi(this._instance)};this.Xi.register({[gp]:a})}},this._instance=t,this.Ji=n,this.Xi=r,this.Gi=i||mT,this.Ji.onSessionId(this.Yi)}Wi(){return this.Xi.props[gp]}getSetOnceProps(){var t,n=(t=this.Wi())==null?void 0:t.props;return n?"r"in n?Tk(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return $e(ym(this.getSetOnceProps()),(n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+ip(r)]=n}),t}}class wm{constructor(){this.Ki={}}on(t,n){return this.Ki[t]||(this.Ki[t]=[]),this.Ki[t].push(n),()=>{this.Ki[t]=this.Ki[t].filter(r=>r!==n)}}emit(t,n){for(var r of this.Ki[t]||[])r(n);for(var i of this.Ki["*"]||[])i(t,n)}}var ph=Xe("[SessionId]");class ry{on(t,n){return this.Qi.on(t,n)}constructor(t,n,r){var i;if(this.tr=[],this.er=void 0,this.Qi=new wm,this.ir=(c,u)=>!(!ys(c)||!ys(u))&&Math.abs(c-u)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===In)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Rt=t.config,this.Xi=t.persistence,this.rr=void 0,this.nr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.sr=n||Ur,this.ar=r||Ur;var s=this.Rt.persistence_name||this.Rt.token;if(this._sessionTimeoutMs=1e3*tr(this.Rt.session_idle_timeout_seconds||1800,60,36e3,ph.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.lr(),this.ur="ph_"+s+"_window_id",this.hr="ph_"+s+"_primary_window_exists",this.cr()){var o=bt.Gt(this.ur),a=bt.Gt(this.hr);o&&!a?this.rr=o:bt.Jt(this.ur),bt.Xt(this.hr,!0)}if((i=this.Rt.bootstrap)!=null&&i.sessionID)try{var l=(c=>{var u=this.Rt.bootstrap.sessionID.replace(/-/g,"");if(u.length!==32)throw new Error("Not a valid UUID");if(u[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(u.substring(0,12),16)})();this.dr(this.Rt.bootstrap.sessionID,new Date().getTime(),l)}catch(c){ph.error("Invalid sessionID in bootstrap",c)}this.vr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return J(this.tr)&&(this.tr=[]),this.tr.push(t),this.nr&&t(this.nr,this.rr),()=>{this.tr=this.tr.filter(n=>n!==t)}}cr(){return this.Rt.persistence!=="memory"&&!this.Xi.fi&&bt.Ut()}pr(t){t!==this.rr&&(this.rr=t,this.cr()&&bt.Xt(this.ur,t))}gr(){return this.rr?this.rr:this.cr()?bt.Gt(this.ur):null}dr(t,n,r){t===this.nr&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.nr=t,this.Xi.register({[vu]:[n,t,r]}))}mr(){var t=this.Xi.props[vu];return Ce(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.dr(null,null,null)}destroy(){clearTimeout(this.yr),this.yr=void 0,this.er&&A&&(A.removeEventListener(ku,this.er,{capture:!1}),this.er=void 0),this.tr=[]}vr(){this.er=()=>{this.cr()&&bt.Jt(this.hr)},ot(A,ku,this.er,{capture:!1})}checkAndGetSessionAndWindowId(t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),this.Rt.cookieless_mode===In)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[i,s,o]=this.mr(),a=this.gr(),l=ys(o)&&Math.abs(r-o)>864e5,c=!1,u=!s,d=!u&&!t&&this.ir(r,i);u||d||l?(s=this.sr(),a=this.ar(),ph.info("new session ID generated",{sessionId:s,windowId:a,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}}),o=r,c=!0):a||(a=this.ar(),c=!0);var f=ys(i)&&t&&!l?i:r,p=ys(o)?o:new Date().getTime();return this.pr(a),this.dr(s,f,p),t||this.lr(),c&&this.tr.forEach(g=>g(s,a,c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0)),{sessionId:s,windowId:a,sessionStartTimestamp:p,changeReason:c?{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:i}}lr(){clearTimeout(this.yr),this.yr=setTimeout(()=>{var[t]=this.mr();if(this.ir(new Date().getTime(),t)){var n=this.nr;this.resetSessionId(),this.Qi.emit("forcedIdleReset",{idleSessionId:n})}},1.1*this.sessionTimeoutMs)}}var $k=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&Tv(n,t))return!0;try{var r=e==null?void 0:e.userAgentData;if(r!=null&&r.brands&&r.brands.some(i=>Tv(i==null?void 0:i.brand,t)))return!0}catch{}return!!e.webdriver},Tu=function(e,t){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function iy(e,t,n){return Fs({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var zk={exact:(e,t)=>t.some(n=>e.some(r=>n===r)),is_not:(e,t)=>t.every(n=>e.every(r=>n!==r)),regex:(e,t)=>t.some(n=>e.some(r=>Tu(n,r))),not_regex:(e,t)=>t.every(n=>e.every(r=>!Tu(n,r))),icontains:(e,t)=>t.map(Kl).some(n=>e.map(Kl).some(r=>n.includes(r))),not_icontains:(e,t)=>t.map(Kl).every(n=>e.map(Kl).every(r=>!n.includes(r))),gt:(e,t)=>t.some(n=>{var r=parseFloat(n);return!isNaN(r)&&e.some(i=>r>parseFloat(i))}),lt:(e,t)=>t.some(n=>{var r=parseFloat(n);return!isNaN(r)&&e.some(i=>r<parseFloat(i))})},Kl=e=>e.toLowerCase();function Bk(e,t){return!e||Object.entries(e).every(n=>{var[r,i]=n,s=t==null?void 0:t[r];if(J(s)||Tr(s))return!1;var o=[String(s)],a=zk[i.operator];return!!a&&a(i.values,o)})}var Cp="custom",sy="i.posthog.com";class xT{constructor(t){this.br={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+sy,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.br[this.apiHost]||(this.br[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Cp),this.br[this.apiHost]}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.uiHost+n;if(t==="flags")return this.flagsApiHost+n;if(this.region===Cp)return this.apiHost+n;var r=sy+n;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var De=Xe("[Surveys]"),Ep="seenSurvey_",vT=(e,t)=>{var n="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(n="$survey_"+t+"/"+e.id+"/"+e.current_iteration),n},oy=e=>((t,n)=>{var r=""+Ep+n.id;return n.current_iteration&&n.current_iteration>0&&(r=""+Ep+n.id+"_"+n.current_iteration),r})(0,e),yT=[ch.Popover,ch.Widget,ch.API],bT={ignoreConditions:!1,ignoreDelay:!1,displayType:bp.Popover},_T=Xe("[PostHog ExternalIntegrations]"),wT={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class kT{constructor(t){this._instance=t}ni(t,n){var r;(r=ne.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,i=>{if(i)return _T.error("failed to load script",i);n()})}startIfEnabledOrStop(){var t=this,n=function(o){var a,l,c;!i||(a=ne.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[o]||t.ni(wT[o],()=>{var u;(u=ne.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[o])==null||u.start(t._instance)}),!i&&(l=ne.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[o]&&((c=ne.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[o])==null||c.stop())};for(var[r,i]of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;n(r)}}}var ps,_a={},gh=0,Np=()=>{},ay='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Lo="Surveys module not available",ly="sanitize_properties is deprecated. Use before_send instead",Wk="Invalid value for property_denylist config: ",ST=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,_s="posthog",Hk=!uT&&(Ut==null?void 0:Ut.indexOf("MSIE"))===-1&&(Ut==null?void 0:Ut.indexOf("Mozilla"))===-1,cy=e=>{var t;return V({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:W2(K==null?void 0:K.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Np,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,debug:yt&&at(yt==null?void 0:yt.search)&&yt.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(A==null||(t=A.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(n){Y.error("Bad HTTP status: "+n.statusCode+" "+n.text)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:yp,before_send:void 0,request_queue_config:{flush_interval_ms:Sp},error_tracking:{},_onCapture:Np,__preview_eager_load_replay:!1},(n=>({rageclick:!n||"2025-11-30">n||{content_ignorelist:!0},capture_pageview:!n||"2025-05-24">n||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},CT=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],uy=e=>{var t={};for(var[n,r]of CT)J(e[n])||(t[r]=e[n]);var i=et({},t,e);return Ce(e.property_blacklist)&&(J(e.property_denylist)?i.property_denylist=e.property_blacklist:Ce(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:Y.error(Wk+e.property_denylist)),i};class ET{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(t){Y.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class wn{_r(t,n){if(t){var r=this.Ir.indexOf(t);r!==-1&&this.Ir.splice(r,1)}return this.Ir.push(n),n.initialize==null||n.initialize(),n}get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.webPerformance=new ET,this.Cr=!1,this.version=Lt.LIB_VERSION,this.Sr=new wm,this.Ir=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=cy(),this.SentryIntegration=Q2,this.sentryIntegration=r=>function(i,s){var o=Sk(i,s);return{name:kk,processEvent:a=>o(a)}}(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.kr=!1,this.Tr=null,this.Ar=null,this.Er=null,this.scrollManager=new gT(this),this.pageViewManager=new qv(this),this.rateLimiter=new iT(this),this.requestRouter=new xT(this),this.consent=new Y2(this),this.externalIntegrations=new kT(this);var n=(t=wn.__defaultExtensionClasses)!==null&&t!==void 0?t:{};this.featureFlags=n.featureFlags&&new n.featureFlags(this),this.toolbar=n.toolbar&&new n.toolbar(this),this.surveys=n.surveys&&new n.surveys(this),this.conversations=n.conversations&&new n.conversations(this),this.logs=n.logs&&new n.logs(this),this.experiments=n.experiments&&new n.experiments(this),this.exceptions=n.exceptions&&new n.exceptions(this),this.people={set:(r,i,s)=>{var o=at(r)?{[r]:i}:r;this.setPersonProperties(o),s==null||s({})},set_once:(r,i,s)=>{var o=at(r)?{[r]:i}:r;this.setPersonProperties(void 0,o),s==null||s({})}},this.on("eventCaptured",r=>Y.info('send "'+(r==null?void 0:r.event)+'"',r))}init(t,n,r){if(r&&r!==_s){var i,s=(i=_a[r])!==null&&i!==void 0?i:new wn;return s._init(t,n,r),_a[r]=s,_a[_s][r]=s,s}return this._init(t,n,r)}_init(t,n,r){var i,s,o,a;if(n===void 0&&(n={}),J(t)||Ec(t))return Y.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Rr(n.debug),this.Nr=n,this.Mr=[],n.person_profiles?this.Ar=n.person_profiles:n.process_person&&(this.Ar=n.process_person),this.set_config(et({},cy(n.defaults),uy(n),{name:r,token:t})),this.config.on_xhr_error&&Y.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:Xn.GZipJS;var l=this.Fr();this.persistence=new lh(this.config,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new lh(V({},this.config,{persistence:"sessionStorage"}),l);var c=V({},this.persistence.props),u=V({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Or=new hT(S=>this.Pr(S),this.config.request_queue_config),this.Lr=new pT(this),this.__request_queue=[];var d=this.config.cookieless_mode===In||this.config.cookieless_mode===dr&&this.consent.isExplicitlyOptedOut();d||(this.sessionManager=new ry(this),this.sessionPropsManager=new ny(this,this.sessionManager,this.persistence));var f=(i=ne._POSTHOG_REMOTE_CONFIG)==null||(i=i[this.config.token])==null?void 0:i.config,p=f==null||(s=f.sdkVersion)==null?void 0:s.resolved;if(p&&(ST.test(p)?this._resolvedSdkVersion=p:Y.warn("Ignoring invalid preloaded sdkVersion.resolved from remote config: "+p)),this.config.__preview_deferred_init_extensions?(Y.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Dr(d)},0)):(Y.info("Initializing extensions synchronously"),this.Dr(d)),Lt.DEBUG=Lt.DEBUG||this.config.debug,Lt.DEBUG&&Y.info("Starting in debug mode",{this:this,config:n,thisC:V({},this.config),p:c,s:u}),!this.config.identity_distinct_id||(o=n.bootstrap)!=null&&o.distinctID||(n.bootstrap=V({},n.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((a=n.bootstrap)==null?void 0:a.distinctID)!==void 0){var g=n.bootstrap.distinctID,m=this.get_distinct_id(),y=this.persistence.get_property(Mn);if(n.bootstrap.isIdentifiedID&&m!=null&&m!==g&&y===ds)this.identify(g);else if(n.bootstrap.isIdentifiedID&&m!=null&&m!==g&&y===hs)Y.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var x=this.config.get_device_id(Ur()),v=n.bootstrap.isIdentifiedID?x:g;this.persistence.set_property(Mn,n.bootstrap.isIdentifiedID?hs:ds),this.register({distinct_id:g,$device_id:v})}}if(d)this.register_once({distinct_id:Hl,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(Ur());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(Mn,ds)}return ot(A,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),n.segment?function(S,k){var _=S.config.segment;if(!_)return k();(function(C,P){var j=C.config.segment;if(!j)return P();var w=D=>{var F=()=>D.anonymousId()||Ur();C.config.get_device_id=F,D.id()&&(C.register({distinct_id:D.id(),$device_id:F()}),C.persistence.set_property(Mn,hs)),P()},M=j.user();"then"in M&&mr(M.then)?M.then(w):w(M)})(S,()=>{_.register((C=>{Promise&&Promise.resolve||ah.warn("This browser does not have Promise support, and can not use the segment integration");var P=(j,w)=>{if(!w)return j;j.event.userId||j.event.anonymousId===C.get_distinct_id()||(ah.info("No userId set, resetting PostHog"),C.reset()),j.event.userId&&j.event.userId!==C.get_distinct_id()&&(ah.info("UserId set, identifying with PostHog"),C.identify(j.event.userId));var M=C.calculateEventProperties(w,j.event.properties);return j.event.properties=Object.assign({},M,j.event.properties),j};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:j=>P(j,j.event.event),page:j=>P(j,bs),identify:j=>P(j,sh),screen:j=>P(j,"$screen")}})(S)).then(()=>{k()})})}(this,()=>this.Br()):this.Br(),mr(this.config._onCapture)&&this.config._onCapture!==Np&&(Y.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",S=>this.config._onCapture(S.event,S))),this.config.ip&&Y.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Dr(t){var n,r,i,s,o,a,l,c=performance.now(),u=V({},wn.__defaultExtensionClasses,this.config.__extensionClasses),d=[];u.featureFlags&&this.Ir.push(this.featureFlags=(n=this.featureFlags)!==null&&n!==void 0?n:new u.featureFlags(this)),u.exceptions&&this.Ir.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new u.exceptions(this)),u.historyAutocapture&&this.Ir.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.Ir.push(new u.tracingHeaders(this)),u.siteApps&&this.Ir.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!t&&this.Ir.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||d.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.Ir.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.Ir.push(this.surveys=(i=this.surveys)!==null&&i!==void 0?i:new u.surveys(this)),u.logs&&this.Ir.push(this.logs=(s=this.logs)!==null&&s!==void 0?s:new u.logs(this)),u.conversations&&this.Ir.push(this.conversations=(o=this.conversations)!==null&&o!==void 0?o:new u.conversations(this)),u.productTours&&this.Ir.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.Ir.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.Ir.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.Ir.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.Ir.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,J2)),u.toolbar&&this.Ir.push(this.toolbar=(a=this.toolbar)!==null&&a!==void 0?a:new u.toolbar(this)),u.experiments&&this.Ir.push(this.experiments=(l=this.experiments)!==null&&l!==void 0?l:new u.experiments(this)),this.Ir.forEach(f=>{f.initialize&&d.push(()=>{f.initialize==null||f.initialize()})}),d.push(()=>{if(this.jr){var f=this.jr;this.jr=void 0,this.Ci(f)}}),this.qr(d,c)}qr(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void setTimeout(()=>{this.qr(t,n)},0);var r=t.shift();if(r)try{r()}catch(s){Y.error("Error initializing extension:",s)}}var i=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&Y.info("PostHog extensions initialized ("+i+"ms)")}Ci(t){var n;if(!K||!K.body)return Y.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ci(t)},500);this.config.__preview_deferred_init_extensions&&(this.jr=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=fe(t.supportedCompression,Xn.GZipJS)?Xn.GZipJS:fe(t.supportedCompression,Xn.Base64)?Xn.Base64:void 0),(n=t.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ar?this.Ar:yp}),this.Ir.forEach(r=>r.onRemoteConfig==null?void 0:r.onRemoteConfig(t))}Br(){try{this.config.loaded(this)}catch(r){Y.critical("`loaded` function failed",r)}if(this.Zr(),this.config.internal_or_test_user_hostname&&yt!=null&&yt.hostname){var t=yt.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.config.cookieless_mode===In)&&this.$r()},1),this.Vr=new Rk(this),this.Vr.load()}Zr(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Or)==null||t.enable())}_dom_loaded(){this.is_capturing()&&Vl(this.__request_queue,t=>this.Pr(t)),this.__request_queue=[],this.Zr()}_handle_unload(){var t,n,r,i;(t=this.surveys)==null||t.handlePageUnload(),this.config.request_batching?(this.Hr()&&this.capture(ih),(n=this.logs)==null||n.flushLogs("sendBeacon"),(r=this.Or)==null||r.unload(),(i=this.Lr)==null||i.unload()):this.Hr()&&this.capture(ih,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(Hk?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=cd(t.url,{ip:this.config.ip?1:0}),t.headers=V({},this.config.request_headers,t.headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,i,s,o=V({},n);o.timeout=o.timeout||6e4,o.url=ty(o.url,o.compression);var a=(r=o.transport)!==null&&r!==void 0?r:"fetch",l=Pc.filter(u=>!o.disableTransport||!u.transport||!o.disableTransport.includes(u.transport)),c=(i=(s=function(u,d){for(var f=0;u.length>f;f++)if(u[f].transport===a)return u[f]}(l))==null?void 0:s.method)!==null&&i!==void 0?i:l[0].method;if(!c)throw new Error("No available transport method");a!=="sendBeacon"&&o.data&&o.compression===Xn.GZipJS&&t2&&!ey?dT(o).then(u=>{c(u)}).catch(u=>{if((d=>!(!d||typeof d!="object")&&("name"in d?String(d.name):"")==="NotReadableError")(u))return ey=!0,void c(V({},o,{compression:void 0,url:ty(n.url,void 0)}));c(o)}):c(o)})(V({},t,{callback:n=>{var r,i;this.rateLimiter.checkForLimiting(n),400>n.statusCode||(r=(i=this.config).on_request_error)==null||r.call(i,n),t.callback==null||t.callback(n)}}))))}Pr(t){this.Lr?this.Lr.retriableRequest(t):this._send_request(t)}_execute_array(t){gh++;try{var n,r=[],i=[],s=[];Vl(t,a=>{a&&(Ce(n=a[0])?s.push(a):mr(a)?a.call(this):Ce(a)&&n==="alias"?r.push(a):Ce(a)&&n.indexOf("capture")!==-1&&mr(this[n])?s.push(a):i.push(a))});var o=function(a,l){Vl(a,function(c){if(Ce(c[0])){var u=l;$e(c,function(d){u=u[d[0]].apply(u,d.slice(1))})}else l[c[0]].apply(l,c.slice(1))})};o(r,this),o(i,this),o(s,this)}finally{gh--}}push(t){if(gh>0&&Ce(t)&&at(t[0])){var n=wn.prototype[t[0]];mr(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,n,r){var i,s,o,a,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Or){if(this.is_capturing())if(!J(t)&&at(t)){var c=!this.config.opt_out_useragent_filter&&this._is_bot();if(!c||this.config.__preview_capture_bot_pageviews){var u=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(u==null||!u.isRateLimited){n!=null&&n.$current_url&&!at(n==null?void 0:n.$current_url)&&(Y.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r.zr||Y.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var d=new Date,f=(r==null?void 0:r.timestamp)||d,p=Ur(),g={uuid:p,event:t,properties:this.calculateEventProperties(t,n||{},f,p)};t===bs&&this.config.__preview_capture_bot_pageviews&&c&&(g.event="$bot_pageview",g.properties.$browser_type="bot"),u&&(g.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens),r!=null&&r.$set&&(g.$set=r==null?void 0:r.$set);var m,y=this.Ur(r==null?void 0:r.$set_once,t!==Wv,t===sh);if(y&&(g.$set_once=y),r!=null&&r._noTruncate||(s=this.config.properties_string_max_length,o=g,a=C=>at(C)?C.slice(0,s):C,l=new Set,g=function C(P,j){return P!==Object(P)?a?a(P):P:l.has(P)?void 0:(l.add(P),Ce(P)?(w=[],Vl(P,M=>{w.push(C(M))})):(w={},$e(P,(M,D)=>{l.has(M)||(w[D]=C(M))})),w);var w}(o)),g.timestamp=f,J(r==null?void 0:r.timestamp)||(g.properties.$event_time_override_provided=!0,g.properties.$event_time_override_system_time=d),t===na.DISMISSED||t===na.SENT){var x=n==null?void 0:n[uh.SURVEY_ID],v=n==null?void 0:n[uh.SURVEY_ITERATION];m={id:x,current_iteration:v},localStorage.getItem(oy(m))||localStorage.setItem(oy(m),"true"),g.$set=V({},g.$set,{[vT({id:x,current_iteration:v},t===na.SENT?"responded":"dismissed")]:!0})}else t===na.SHOWN&&(g.$set=V({},g.$set,{[uh.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===rT.SHOWN){var b=n==null?void 0:n[Kv.TOUR_TYPE];b&&(g.$set=V({},g.$set,{[Kv.TOUR_LAST_SEEN_DATE+"/"+b]:new Date().toISOString()}))}var S=V({},g.properties.$set,g.$set);if(Ls(S)||this.setPersonPropertiesForFlags(S),!xe(this.config.before_send)){var k=this.Yr(g);if(!k)return;g=k}this.Sr.emit("eventCaptured",g);var _={method:"POST",url:(i=r==null?void 0:r._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:g,compression:"best-available",batchKey:r==null?void 0:r._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Pr(_):this.Or.enqueue(_),g}Y.critical("This capture call is ignored due to client rate limiting.")}}else Y.error("No event name provided to posthog.capture")}else Y.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",n=>t(n.event,n))}calculateEventProperties(t,n,r,i,s){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var o=s?void 0:this.persistence.remove_event_timer(t),a=V({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode==In||this.config.cookieless_mode==dr&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),t==="$snapshot"){var l=V({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!at(a.distinct_id)&&!Hn(a.distinct_id)||Ec(a.distinct_id))&&Y.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var c,u=function(x,v){var b,S,k,_;if(!Ut)return{};var C,P,j,w,M,D,F,$,I=x?[...oo,...v||[]]:[],[H,X]=function(L){for(var B=0;Dv.length>B;B++){var[N,Q]=Dv[B],te=N.exec(L),T=te&&(mr(Q)?Q(te,L):Q);if(T)return T}return["",""]}(Ut);return et(ym({$os:H,$os_version:X,$browser:fk(Ut,navigator.vendor),$device:Av(Ut),$device_type:(P=Ut,j={userAgentDataPlatform:(b=navigator)==null||(b=b.userAgentData)==null?void 0:b.platform,maxTouchPoints:(S=navigator)==null?void 0:S.maxTouchPoints,screenWidth:A==null||(k=A.screen)==null?void 0:k.width,screenHeight:A==null||(_=A.screen)==null?void 0:_.height,devicePixelRatio:A==null?void 0:A.devicePixelRatio},$=Av(P),$===Z1||$===Q1||$==="Kobo"||$==="Kindle Fire"||$===hk?ro:$===Ja||$===qs||$===Qa||$===op?"Console":$===tk?"Wearable":$?dn:(j==null?void 0:j.userAgentDataPlatform)==="Android"&&((w=j==null?void 0:j.maxTouchPoints)!==null&&w!==void 0?w:0)>0?600>Math.min((M=j==null?void 0:j.screenWidth)!==null&&M!==void 0?M:0,(D=j==null?void 0:j.screenHeight)!==null&&D!==void 0?D:0)/((F=j==null?void 0:j.devicePixelRatio)!==null&&F!==void 0?F:1)?dn:ro:"Desktop"),$timezone:Mk(),$timezone_offset:tT()}),{$current_url:Za(yt==null?void 0:yt.href,I,el),$host:yt==null?void 0:yt.host,$pathname:yt==null?void 0:yt.pathname,$raw_user_agent:Ut.length>1e3?Ut.substring(0,997)+"...":Ut,$browser_version:x2(Ut,navigator.vendor),$browser_language:Gv(),$browser_language_prefix:(C=Gv(),typeof C=="string"?C.split("-")[0]:void 0),$screen_height:A==null?void 0:A.screen.height,$screen_width:A==null?void 0:A.screen.width,$viewport_height:A==null?void 0:A.innerHeight,$viewport_width:A==null?void 0:A.innerWidth,$lib:Lt.LIB_NAME,$lib_version:Lt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(s,r.getTime());a.$session_id=d,a.$window_id=f}this.sessionPropsManager&&et(a,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&et(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(p=this.Lr)==null?void 0:p.length}catch(x){a.$sdk_debug_error_capturing_properties=String(x)}if(this.requestRouter.region===Cp&&(a.$lib_custom_api_host=this.config.api_host),c=t!==bs||s?t!==ih||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,i),a=et(a,c),t===bs&&K&&(a.title=K.title),!J(o)){var g=r.getTime()-o;a.$duration=parseFloat((g/1e3).toFixed(3))}Ut&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=et({},u,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),Ce(this.config.property_denylist)?$e(this.config.property_denylist,function(x){delete a[x]}):Y.error(Wk+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(Y.error(ly),a=m(a,t));var y=this.Wr();return a.$process_person_profile=y,y&&!s&&this.Gr("_calculate_event_properties"),a}Ur(t,n,r){var i;if(n===void 0&&(n=!0),r===void 0&&(r=!1),!this.persistence||!this.Wr()||this.Cr&&!r)return t;var s=this.persistence.get_initial_props(),o=(i=this.sessionPropsManager)==null?void 0:i.getSetOnceProps(),a=et({},s,o||{},t||{}),l=this.config.sanitize_properties;return l&&(Y.error(ly),a=l(a,"$set_once")),n&&(this.Cr=!0),Ls(a)?void 0:a}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var i;(i=this.persistence)==null||i.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)==null||n.register(t)}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t)}Xr(t,n){this.register({[t]:n})}getFeatureFlag(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(t,n)}isFeatureEnabled(t,n){var r;return(r=this.featureFlags)==null?void 0:r.isFeatureEnabled(t,n)}reloadFeatureFlags(){var t;(t=this.featureFlags)==null||t.reloadFeatureFlags()}updateFlags(t,n,r){var i;(i=this.featureFlags)==null||i.updateFlags(t,n,r)}updateEarlyAccessFeatureEnrollment(t,n,r){var i;(i=this.featureFlags)==null||i.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){var i;return n===void 0&&(n=!1),(i=this.featureFlags)==null?void 0:i.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.Sr.on(t,n)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Lo}),()=>{})}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getSurveys(t,n):t([],{isLoaded:!1,error:Lo})}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,n):t([],{isLoaded:!1,error:Lo})}renderSurvey(t,n){var r;(r=this.surveys)==null||r.renderSurvey(t,n)}displaySurvey(t,n){var r;n===void 0&&(n=bT),(r=this.surveys)==null||r.displaySurvey(t,n)}cancelPendingSurvey(t){var n;(n=this.surveys)==null||n.cancelPendingSurvey(t)}canRenderSurvey(t){var n,r;return(n=(r=this.surveys)==null?void 0:r.canRenderSurvey(t))!==null&&n!==void 0?n:{visible:!1,disabledReason:Lo}}canRenderSurveyAsync(t,n){var r,i;return n===void 0&&(n=!1),(r=(i=this.surveys)==null?void 0:i.canRenderSurveyAsync(t,n))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:Lo})}Jr(t){return!t||Ec(t)?(Y.critical("Unique user id has not been set in posthog.identify"),!1):t===Hl?(Y.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(Y.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,n,r){if(!this.__loaded||!this.persistence)return Y.uninitializedWarning("posthog.identify");if(Hn(t)&&(t=t.toString(),Y.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Jr(t)&&this.Gr("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:t}),this.get_property(xu)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),t!==i&&t!==this.get_property(Qo)&&(this.unregister(Qo),this.register({distinct_id:t}));var s,o=(this.persistence.get_property(Mn)||ds)===ds;t!==i&&o?(this.persistence.set_property(Mn,hs),this.setPersonPropertiesForFlags({$set:n||{},$set_once:r||{}},!1),this.capture(sh,{distinct_id:t,$anon_distinct_id:i},{$set:n||{},$set_once:r||{}}),this.Er=iy(t,n,r),(s=this.featureFlags)==null||s.setAnonymousDistinctId(i)):(n||r)&&this.setPersonProperties(n,r),t!==i&&(this.reloadFeatureFlags(),this.unregister(ya))}}setPersonProperties(t,n){if((t||n)&&this.Gr("posthog.setPersonProperties")){var r=iy(this.get_distinct_id(),t,n);this.Er!==r?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:n||{}},!0),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.Er=r):Y.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){var i=this.getGroups(),s=i[t]!==n;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:V({},i,{[t]:n})}),s||r){var o={$group_type:t,$group_key:n};r&&(o.$group_set=r),this.capture(Wv,o)}r&&this.setGroupPropertiesForFlags({[t]:r}),s&&!r&&this.reloadFeatureFlags()}else Y.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){var t;(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,n){var r;n===void 0&&(n=!0),this.Gr("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(t,n))}resetGroupPropertiesForFlags(t){var n;(n=this.featureFlags)==null||n.resetGroupPropertiesForFlags(t)}reset(t){var n,r,i,s,o,a,l,c;if(Y.info("reset"),!this.__loaded)return Y.uninitializedWarning("posthog.reset");var u=this.get_property(xu);if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),(i=this.surveys)==null||i.reset(),(s=this.Vr)==null||s.stop(),(o=this.featureFlags)==null||o.reset(),(a=this.conversations)==null||a.reset(),(l=this.persistence)==null||l.set_property(Mn,ds),(c=this.sessionManager)==null||c.resetSessionId(),this.Er=null,this.config.cookieless_mode===In)this.register_once({distinct_id:Hl,$device_id:null},"");else{var d=this.config.get_device_id(Ur());this.register_once({distinct_id:d,$device_id:t?d:u},"")}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(t,n){var r;this.config.identity_distinct_id=t,this.config.identity_hash=n,this.alias(t),(r=this.conversations)==null||r.Kr()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,(t=this.conversations)==null||t.Qr()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(t!=null&&t.withTimestamp&&r){var s,o=(s=t.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return i;i+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return i}alias(t,n){return t===this.get_property(xk)?(Y.critical("Attempting to create alias for existing People user - aborting."),-2):this.Gr("posthog.alias")?(J(n)&&(n=this.get_distinct_id()),t!==n?(this.Xr(Qo,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(Y.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=V({},this.config);if(ct(t)){var r,i,s,o,a,l,c,u,d;et(this.config,uy(t));var f=this.Fr();(r=this.persistence)==null||r.update_config(this.config,n,f),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new lh(V({},this.config,{persistence:"sessionStorage"}),f);var p=this.Rr(this.config.debug);er(p)&&(this.config.debug=p),er(this.config.debug)&&(this.config.debug?(Lt.DEBUG=!0,Ge.Ut()&&Ge.Xt("ph_debug",!0),Y.info("set_config",{config:t,oldConfig:n,newConfig:V({},this.config)})):(Lt.DEBUG=!1,Ge.Ut()&&Ge.Jt("ph_debug"))),(i=this.exceptionObserver)==null||i.onConfigChange(),(s=this.sessionRecording)==null||s.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),(c=this.deadClicksAutocapture)==null||c.startIfEnabledOrStop(),(u=this.surveys)==null||u.loadIfEnabled(),this.tn(),(d=this.externalIntegrations)==null||d.startIfEnabledOrStop()}}_overrideSDKInfo(t,n){Lt.LIB_NAME=t,Lt.LIB_VERSION=n}startSessionRecording(t){var n,r,i,s,o,a=t===!0,l={sampling:a||!(t==null||!t.sampling),linked_flag:a||!(t==null||!t.linked_flag),url_trigger:a||!(t==null||!t.url_trigger),event_trigger:a||!(t==null||!t.event_trigger)};Object.values(l).some(Boolean)&&((n=this.sessionManager)==null||n.checkAndGetSessionAndWindowId(),l.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),l.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),l.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),l.event_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,n){if(this.exceptions){var r=new Error("PostHog syntheticException"),i=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(V({},i,n))}}captureLog(t){var n;(n=this.logs)==null||n.captureLog(t)}get logger(){var t,n;return(t=(n=this.logs)==null?void 0:n.logger)!==null&&t!==void 0?t:wn.en}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var n,r;return(n=(r=this.toolbar)==null?void 0:r.loadToolbar(t))!==null&&n!==void 0&&n}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:_s;return n!==_s&&(n=_s+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(Mn))===hs||((n=this.sessionPersistence)==null?void 0:n.get_property(Mn))===hs}Wr(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles===yp&&!this._isIdentified()&&Ls(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[Qo])&&((n=this.persistence)==null||(n=n.props)==null||!n[_u]))}Hr(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Wr()||this.Gr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Gr("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Gr(t){return this.config.person_profiles==="never"?(Y.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Xr(_u,!0),!0)}Fr(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==dr)}tn(){var t,n,r,i,s=this.Fr();return((t=this.persistence)==null?void 0:t.fi)!==s&&((r=this.persistence)==null||r.set_disabled(s)),((n=this.sessionPersistence)==null?void 0:n.fi)!==s&&((i=this.sessionPersistence)==null||i.set_disabled(s)),s}opt_in_capturing(t){var n;if(this.config.cookieless_mode!==In){if(this.config.cookieless_mode===dr&&this.consent.isExplicitlyOptedOut()){var r,i,s,o,a;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new ry(this),this.pageViewManager=new qv(this),this.persistence&&(this.sessionPropsManager=new ny(this,this.sessionManager,this.persistence));var l=(s=(o=this.config.__extensionClasses)==null?void 0:o.sessionRecording)!==null&&s!==void 0?s:(a=wn.__defaultExtensionClasses)==null?void 0:a.sessionRecording;l&&(this.sessionRecording=this._r(this.sessionRecording,new l(this)))}var c,u;this.consent.optInOut(!0),this.tn(),this.Zr(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode==dr&&((c=this.surveys)==null||c.loadIfEnabled()),(J(t==null?void 0:t.captureEventName)||t!=null&&t.captureEventName)&&this.capture((u=t==null?void 0:t.captureEventName)!==null&&u!==void 0?u:"$opt_in",t==null?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.$r()}else Y.warn(ay)}opt_out_capturing(){var t,n,r;this.config.cookieless_mode!==In?(this.config.cookieless_mode===dr&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.tn(),this.config.cookieless_mode===dr&&(this.register({distinct_id:Hl,$device_id:null}),(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.$r())):Y.warn(ay)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===1?"granted":t===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===In||(this.config.cookieless_mode===dr?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.tn()}_is_bot(){return cn?$k(cn,this.config.custom_blocked_useragents):void 0}$r(){K&&(K.visibilityState==="visible"?this.kr||(this.kr=!0,this.capture(bs,{title:K.title},{send_instantly:!0}),this.Tr&&(K.removeEventListener(wu,this.Tr),this.Tr=null)):this.Tr||(this.Tr=this.$r.bind(this),ot(K,wu,this.Tr)))}debug(t){t===!1?(A==null||A.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(A==null||A.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}ki(){var t,n,r,i,s,o,a=this.Nr||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(Y.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",i=Y,s=(n="advanced_disable_flags")in(t=a)&&!xe(t[n]),o=r in t&&!xe(t[r]),s?t[n]:!!o&&(i&&i.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),t[r]))}Yr(t){if(xe(this.config.before_send))return t;var n=Ce(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of n){if(r=i(r),xe(r)){var s="Event '"+t.event+"' was rejected in beforeSend function";return s2(t.event)?Y.warn(s+". This can cause unexpected behavior."):Y.info(s),null}r.properties&&!Ls(r.properties)||Y.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return(t=this.pageViewManager.ai)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}Rr(t){var n=er(t)&&!t,r=Ge.Ut()&&Ge.Wt("ph_debug")==="true";return!n&&(!!r||t)}}function dy(e){return e instanceof Element&&(e.id===bk||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function ud(e){return!!e&&e.nodeType===1}function ui(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Vk(e){return!!e&&e.nodeType===3}function Uk(e){return!!e&&e.nodeType===11}function km(e){return e?ad(e).split(/\s+/):[]}function hy(e){var t=A==null?void 0:A.location.href;return!!(t&&e&&e.some(n=>t.match(n)))}function Mu(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return km(t)}function qk(e){return xe(e)?null:ad(e).split(/(\s+)/).filter(t=>wa(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function tl(e){var t="";return jp(e)&&!Kk(e)&&e.childNodes&&e.childNodes.length&&$e(e.childNodes,function(n){var r;Vk(n)&&n.textContent&&(t+=(r=qk(n.textContent))!==null&&r!==void 0?r:"")}),ad(t)}function fy(e){return J(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}wn.__defaultExtensionClasses={},wn.en={trace:ps=()=>{},debug:ps,info:ps,warn:ps,error:ps,fatal:ps},function(e,t){for(var n=0;t.length>n;n++)e.prototype[t[n]]=z2(e.prototype[t[n]])}(wn,["identify"]);var Sm=["a","button","form","input","select","textarea","label"];function py(e,t){if(J(t))return!0;var n,r=function(s){if(t.some(o=>s.matches(o)))return{v:!0}};for(var i of e)if(n=r(i))return n.v;return!1}function Gk(e){var t=e.parentNode;return!(!t||!ud(t))&&t}var NT=["next","previous","prev",">","<"],gy=[".ph-no-rageclick",".ph-no-capture"],Pp=e=>!e||ui(e,"html")||!ud(e),my=(e,t)=>{if(!A||Pp(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],i=e;i.parentNode&&!ui(i,"body");)if(Uk(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var s=Gk(i);if(!s)break;if(t||Sm.indexOf(s.tagName.toLowerCase())>-1)n=!0;else{var o=A.getComputedStyle(s);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(s),i=s}return{parentIsUsefulElement:n,targetElementList:r}};function jp(e){for(var t=e;t.parentNode&&!ui(t,"body");t=t.parentNode){var n=Mu(t);if(fe(n,"ph-sensitive")||fe(n,"ph-no-capture"))return!1}if(fe(Mu(e),"ph-include"))return!0;var r=e.type||"";if(at(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return!at(i)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,""))}function Kk(e){return!!(ui(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ui(e,"select")||ui(e,"textarea")||e.getAttribute("contenteditable")==="true")}var Yk="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",PT=new RegExp("^(?:"+Yk+")$"),jT=new RegExp(Yk),Xk="\\d{3}-?\\d{2}-?\\d{4}",TT=new RegExp("^("+Xk+")$"),MT=new RegExp("("+Xk+")");function wa(e,t){return t===void 0&&(t=!0),!(xe(e)||at(e)&&(e=ad(e),(t?PT:jT).test((e||"").replace(/[- ]/g,""))||(t?TT:MT).test(e)))}function xy(e){var t=tl(e);return wa(t=(t+" "+Jk(e)).trim())?t:""}function Jk(e){var t="";return e&&e.childNodes&&e.childNodes.length&&$e(e.childNodes,function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var i=tl(n);t=(t+" "+i).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+Jk(n)).trim())}catch(s){Y.error("[AutoCapture]",s)}}),t}function vy(e){return e.replace(/"|\\"/g,'\\"')}function RT(e){var t=e.attr__class;return t?Ce(t)?t:km(t):void 0}class yy{constructor(t){this.disabled=t===!1;var n=ct(t)?t:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(t,n,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(n-i.y)<this.thresholdPx&&this.timeoutMs>r-i.timestamp){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var mh="$copy_autocapture",by=Xe("[AutoCapture]");function xh(e,t){return t.length>e?t.slice(0,e)+"...":t}function DT(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!ud(t));return t}function AT(e,t){for(var n,r,{e:i,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,c=[e],u=e;u.parentNode&&!ui(u,"body");)Uk(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var d,f,p=[],g={},m=!1,y=!1;if($e(c,k=>{var _=jp(k);k.tagName.toLowerCase()==="a"&&(m=k.getAttribute("href"),m=_&&m&&wa(m)&&m),fe(Mu(k),"ph-no-capture")&&(y=!0),p.push(function(P,j,w,M){var D=P.tagName.toLowerCase(),F={tag_name:D};Sm.indexOf(D)>-1&&!w&&(F.$el_text=D.toLowerCase()==="a"||D.toLowerCase()==="button"?xh(1024,xy(P)):xh(1024,tl(P)));var $=Mu(P);$.length>0&&(F.classes=$.filter(function(L){return L!==""})),$e(P.attributes,function(L){var B;if((!Kk(P)||["name","id","class","aria-label"].indexOf(L.name)!==-1)&&(M==null||!M.includes(L.name))&&!j&&wa(L.value)&&(!at(B=L.name)||B.substring(0,10)!=="_ngcontent"&&B.substring(0,7)!=="_nghost")){var N=L.value;L.name==="class"&&(N=km(N).join(" ")),F["attr__"+L.name]=xh(1024,N)}});for(var I=1,H=1,X=P;X=DT(X);)I++,X.tagName===P.tagName&&H++;return F.nth_child=I,F.nth_of_type=H,F}(k,s,o,a));var C=function(P){if(!jp(P))return{};var j={};return $e(P.attributes,function(w){if(w.name&&w.name.indexOf("data-ph-capture-attribute")===0){var M=w.name.replace("data-ph-capture-attribute-",""),D=w.value;M&&D&&wa(D)&&(j[M]=D)}}),j}(k);et(g,C)}),y)return{props:{},explicitNoCapture:y};if(o||(p[0].$el_text=e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?xy(e):tl(e)),m){var x,v;p[0].attr__href=m;var b=(x=Cu(m))==null?void 0:x.host,S=A==null||(v=A.location)==null?void 0:v.host;b&&S&&b!==S&&(d=m)}return{props:et({$event_type:i.type,$ce_version:1},l?{}:{$elements:p},{$elements_chain:(f=p,function(k){return k.map(_=>{var C,P,j="";if(_.tag_name&&(j+=_.tag_name),_.attr_class)for(var w of(_.attr_class.sort(),_.attr_class))j+="."+w.replace(/"/g,"");var M=V({},_.text?{text:_.text}:{},{"nth-child":(C=_.nth_child)!==null&&C!==void 0?C:0,"nth-of-type":(P=_.nth_of_type)!==null&&P!==void 0?P:0},_.href?{href:_.href}:{},_.attr_id?{attr_id:_.attr_id}:{},_.attributes),D={};return Nc(M).sort((F,$)=>{var[I]=F,[H]=$;return I.localeCompare(H)}).forEach(F=>{var[$,I]=F;return D[vy($.toString())]=vy(I.toString())}),(j+=":")+Nc(D).map(F=>{var[$,I]=F;return $+'="'+I+'"'}).join("")}).join(";")}(function(k){return k.map(_=>{var C,P,j={text:(C=_.$el_text)==null?void 0:C.slice(0,400),tag_name:_.tag_name,href:(P=_.attr__href)==null?void 0:P.slice(0,2048),attr_class:RT(_),attr_id:_.attr__id,nth_child:_.nth_child,nth_of_type:_.nth_of_type,attributes:{}};return Nc(_).filter(w=>{var[M]=w;return M.indexOf("attr__")===0}).forEach(w=>{var[M,D]=w;return j.attributes[M]=D}),j})}(f)))},(n=p[0])!=null&&n.$el_text?{$el_text:(r=p[0])==null?void 0:r.$el_text}:{},d&&i.type==="click"?{$external_click_url:d}:{},g)}}var Oo=Xe("[ExceptionAutocapture]");function _y(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],i=n(r);return mr(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var IT=Xe("[TracingHeaders]"),Ir=Xe("[Web Vitals]"),wy=9e5,ky="disabled",Sy="lazy_loading",Fo="awaiting_config",Yl="missing_config";Xe("[SessionRecording]");var Tp="[SessionRecording]",Lr=Xe(Tp),LT=Xe("[Heatmaps]");function Cy(e){return ct(e)&&"clientX"in e&&"clientY"in e&&Hn(e.clientX)&&Hn(e.clientY)}var Ey=Xe("[Product Tours]"),vh="ph_product_tours",OT=["$set_once","$set"],Or=Xe("[SiteApps]"),Ny="Error while initializing PostHog app with config id ";function gs(e,t,n){if(xe(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}class FT{constructor(t){this.rn=new wm,this.nn=(n,r)=>this.sn(n,r)&&this.an(n,r)&&this.ln(n,r)&&this.un(n,r),this.sn=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=t,this.hn=new Set,this.cn=new Set}init(){var t,n;J((t=this._instance)==null?void 0:t._addCaptureHook)||(n=this._instance)==null||n._addCaptureHook((r,i)=>{this.on(r,i)})}register(t){var n,r;if(!J((n=this._instance)==null?void 0:n._addCaptureHook)&&(t.forEach(o=>{var a,l;(a=this.cn)==null||a.add(o),(l=o.steps)==null||l.forEach(c=>{var u;(u=this.hn)==null||u.add((c==null?void 0:c.event)||"")})}),(r=this._instance)!=null&&r.autocapture)){var i,s=new Set;t.forEach(o=>{var a;(a=o.steps)==null||a.forEach(l=>{l!=null&&l.selector&&s.add(l==null?void 0:l.selector)})}),(i=this._instance)==null||i.autocapture.setElementSelectors(s)}}on(t,n){var r;n!=null&&t.length!=0&&(this.hn.has(t)||this.hn.has(n==null?void 0:n.event))&&this.cn&&((r=this.cn)==null?void 0:r.size)>0&&this.cn.forEach(i=>{this.dn(n,i)&&this.rn.emit("actionCaptured",i.name)})}vn(t){this.onAction("actionCaptured",n=>t(n))}dn(t,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.nn(t,r))return!0;return!1}onAction(t,n){return this.rn.on(t,n)}an(t,n){if(n!=null&&n.url){var r,i=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!i||typeof i!="string"||!gs(i,n.url,n.url_matching||"contains"))return!1}return!0}ln(t,n){return!!this.fn(t,n)&&!!this.pn(t,n)&&!!this.gn(t,n)}fn(t,n){var r;if(n==null||!n.href)return!0;var i=this.mn(t);if(i.length>0)return i.some(a=>gs(a.href,n.href,n.href_matching||"exact"));var s,o=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!o&&gs((s=o.match(/(?::|")href="(.*?)"/))?s[1]:"",n.href,n.href_matching||"exact")}pn(t,n){var r;if(n==null||!n.text)return!0;var i=this.mn(t);if(i.length>0)return i.some(c=>gs(c.text,n.text,n.text_matching||"exact")||gs(c.$el_text,n.text,n.text_matching||"exact"));var s,o,a,l=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(s=function(c){for(var u,d=[],f=/(?::|")text="(.*?)"/g;!xe(u=f.exec(c));)d.includes(u[1])||d.push(u[1]);return d}(l),o=n.text,a=n.text_matching||"exact",s.some(c=>gs(c,o,a)))}gn(t,n){var r,i;if(n==null||!n.selector)return!0;var s=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(s!=null&&s.includes(n.selector))return!0;var o=(t==null||(i=t.properties)==null?void 0:i.$elements_chain)||"";if(n.selector_regex&&o)try{return new RegExp(n.selector_regex).test(o)}catch{return!1}return!1}mn(t){var n;return(t==null||(n=t.properties)==null?void 0:n.$elements)==null?[]:t==null?void 0:t.properties.$elements}un(t,n){return n==null||!n.properties||n.properties.length===0||Bk(n.properties.reduce((r,i)=>{var s=Ce(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return r[i.key]={values:s,operator:i.operator||"exact"},r},{}),t==null?void 0:t.properties)}}class $T{constructor(t){this._instance=t,this.yn=new Map,this.bn=new Map,this.wn=new Map}_n(t,n){return!!t&&Bk(t.propertyFilters,n==null?void 0:n.properties)}In(t,n){var r=new Map;return t.forEach(i=>{var s;(s=i.conditions)==null||(s=s[n])==null||(s=s.values)==null||s.forEach(o=>{if(o!=null&&o.name){var a=r.get(o.name)||[];a.push(i.id),r.set(o.name,a)}})}),r}Cn(t,n,r){var i=(r===Ro.Activation?this.yn:this.bn).get(t),s=[];return this.Sn(o=>{s=o.filter(a=>i==null?void 0:i.includes(a.id))}),s.filter(o=>{var a,l=(a=o.conditions)==null||(a=a[r])==null||(a=a.values)==null?void 0:a.find(c=>c.name===t);return this._n(l,n)})}register(t){var n;J((n=this._instance)==null?void 0:n._addCaptureHook)||(this.kn(t),this.xn(t))}xn(t){var n=t.filter(r=>{var i,s;return((i=r.conditions)==null?void 0:i.actions)&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0});n.length!==0&&(this.Tn==null&&(this.Tn=new FT(this._instance),this.Tn.init(),this.Tn.vn(r=>{this.onAction(r)})),n.forEach(r=>{var i,s,o,a,l;r.conditions&&(i=r.conditions)!=null&&i.actions&&(s=r.conditions)!=null&&(s=s.actions)!=null&&s.values&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0&&((a=this.Tn)==null||a.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(c=>{if(c&&c.name){var u=this.wn.get(c.name);u&&u.push(r.id),this.wn.set(c.name,u||[r.id])}}))}))}kn(t){var n,r=t.filter(s=>{var o,a;return((o=s.conditions)==null?void 0:o.events)&&((a=s.conditions)==null||(a=a.events)==null||(a=a.values)==null?void 0:a.length)>0}),i=t.filter(s=>{var o,a;return((o=s.conditions)==null?void 0:o.cancelEvents)&&((a=s.conditions)==null||(a=a.cancelEvents)==null||(a=a.values)==null?void 0:a.length)>0});r.length===0&&i.length===0||((n=this._instance)==null||n._addCaptureHook((s,o)=>{this.onEvent(s,o)}),this.yn=this.In(t,Ro.Activation),this.bn=this.In(t,Ro.Cancellation))}onEvent(t,n){var r,i=this.re(),s=this.An(),o=this.En(),a=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[s])||[];if(o===t&&n&&a.length>0){var l,c;i.info("event matched, removing item from activated items",{event:t,eventPayload:n,existingActivatedItems:a});var u=(n==null||(l=n.properties)==null?void 0:l.$survey_id)||(n==null||(c=n.properties)==null?void 0:c.$product_tour_id);if(u){var d=a.indexOf(u);0>d||(a.splice(d,1),this.Rn(a))}}else{if(this.bn.has(t)){var f=this.Cn(t,n,Ro.Cancellation);f.length>0&&(i.info("cancel event matched, cancelling items",{event:t,itemsToCancel:f.map(g=>g.id)}),f.forEach(g=>{var m=a.indexOf(g.id);0>m||a.splice(m,1),this.Nn(g.id)}),this.Rn(a))}if(this.yn.has(t)){i.info("event name matched",{event:t,eventPayload:n,items:this.yn.get(t)});var p=this.Cn(t,n,Ro.Activation);this.Rn(a.concat(p.map(g=>g.id)||[]))}}}onAction(t){var n,r=this.An(),i=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.wn.has(t)&&this.Rn(i.concat(this.wn.get(t)||[]))}Rn(t){var n,r=this.re(),i=this.An(),s=[...new Set(t)].filter(o=>!this.Mn(o));r.info("updating activated items",{activatedItems:s}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[i]:s})}getActivatedIds(){var t,n=this.An();return((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n])||[]}getEventToItemsMap(){return this.yn}Fn(){return this.Tn}}class zT extends $T{constructor(t){super(t)}An(){return"$surveys_activated"}En(){return na.SHOWN}Sn(t){var n;(n=this._instance)==null||n.getSurveys(t)}Nn(t){var n;(n=this._instance)==null||n.cancelPendingSurvey(t)}re(){return De}Mn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var yh="SDK is not enabled or survey functionality is not yet loaded",Py="Disabled. Not loading surveys.",BT=A!=null&&A.location?Nu(A.location.hash,"__posthog")||Nu(location.hash,"state"):null,jy="_postHogToolbarParams",Ty=Xe("[Toolbar]"),At=Xe("[FeatureFlags]"),Si=Xe("[FeatureFlags]",{debugEnabled:!0}),bh=`" failed. Feature flags didn't load in time.`,_h="$active_feature_flags",Fr="$override_feature_flags",My="$feature_flag_payloads",$o="$override_feature_flag_payloads",Ry="$feature_flag_request_id",Dy=e=>{for(var t={},n=0;e.length>n;n++)t[e[n]]=!0;return t},Ay=e=>{var t={};for(var[n,r]of Nc(e||{}))r&&(t[n]=r);return t},wh=Xe("[Error tracking]"),Iy="Refusing to render web experiment since the viewer is a likely bot",WT={icontains:(e,t)=>!!A&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!A&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!A&&Tu(t.href,e),not_regex:(e,t)=>!!A&&!Tu(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Ct{get Rt(){return this._instance.config}constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments(i=>{Ct.On("retrieved web experiments from the server"),n.Pn=new Map,i.forEach(s=>{if(s.feature_flag_key){var o;n.Pn&&(Ct.On("setting flag key ",s.feature_flag_key," to web experiment ",s),(o=n.Pn)==null||o.set(s.feature_flag_key,s));var a=n._instance.getFeatureFlag(s.feature_flag_key);at(a)&&s.variants[a]&&n.Ln(s.name,a,s.variants[a].transforms)}else if(s.variants)for(var l in s.variants){var c=s.variants[l];Ct.Dn(c)&&n.Ln(s.name,l,c.transforms)}})},r)},this._instance=t,this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}initialize(){}onFeatureFlags(t){if(this._is_bot())Ct.On(Iy);else if(!this.Rt.disable_web_experiments){if(xe(this.Pn))return this.Pn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Ct.On("applying feature flags",t),t.forEach(n=>{var r;if(this.Pn&&(r=this.Pn)!=null&&r.has(n)){var i,s=this._instance.getFeatureFlag(n),o=(i=this.Pn)==null?void 0:i.get(n);s&&o!=null&&o.variants[s]&&this.Ln(o.name,s,o.variants[s].transforms)}})}}previewWebExperiment(){var t=Ct.getWindowLocation();if(t!=null&&t.search){var n=Eu(t==null?void 0:t.search,"__experiment_id"),r=Eu(t==null?void 0:t.search,"__experiment_variant");n&&r&&(Ct.On("previewing web experiments "+n+" && "+r),this.getWebExperiments(i=>{this.Bn(parseInt(n),r,i)},!1,!0))}}loadIfEnabled(){this.Rt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this.Rt.disable_web_experiments&&!r)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!n)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Rt.token),method:"GET",callback:s=>t(s.statusCode===200&&s.json&&s.json.experiments||[])})}Bn(t,n,r){var i=r.filter(s=>s.id===t);i&&i.length>0&&(Ct.On("Previewing web experiment ["+i[0].name+"] with variant ["+n+"]"),this.Ln(i[0].name,n,i[0].variants[n].transforms))}static Dn(t){return!xe(t.conditions)&&Ct.jn(t)&&Ct.qn(t)}static jn(t){var n;if(xe(t.conditions)||xe((n=t.conditions)==null?void 0:n.url))return!0;var r,i,s,o=Ct.getWindowLocation();return!!o&&((r=t.conditions)==null||!r.url||WT[(i=(s=t.conditions)==null?void 0:s.urlMatchType)!==null&&i!==void 0?i:"icontains"](t.conditions.url,o))}static getWindowLocation(){return A==null?void 0:A.location}static qn(t){var n;if(xe(t.conditions)||xe((n=t.conditions)==null?void 0:n.utm))return!0;var r=Ck();if(r.utm_source){var i,s,o,a,l,c,u,d,f=(i=t.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((s=t.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==r.utm_campaign,p=(o=t.conditions)==null||(o=o.utm)==null||!o.utm_source||((a=t.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,g=(l=t.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=t.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==r.utm_medium,m=(u=t.conditions)==null||(u=u.utm)==null||!u.utm_term||((d=t.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==r.utm_term;return f&&g&&m&&p}return!1}static On(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;n>i;i++)r[i-1]=arguments[i];Y.info("[WebExperiments] "+t,r)}Ln(t,n,r){this._is_bot()?Ct.On(Iy):n!=="control"?r.forEach(i=>{if(i.selector){var s;Ct.On("applying transform of variant "+n+" for experiment "+t+" ",i);var o=(s=document)==null?void 0:s.querySelectorAll(i.selector);o==null||o.forEach(a=>{var l=a;i.html&&(l.innerHTML=i.html),i.css&&l.setAttribute("style",i.css)})}}):Ct.On("Control variants leave the page unmodified.")}_is_bot(){return cn&&this._instance?$k(cn,this.Rt.custom_blocked_useragents):void 0}}var xn=Xe("[Conversations]"),Ci="Conversations not available yet.",Qk={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},HT=Qk.info;function Zk(e){if(er(e))return{boolValue:e};if(Hn(e))return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(typeof e=="string")return{stringValue:e};if(Ce(e))return{arrayValue:{values:e.map(t=>Zk(t))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function Ly(e){var t=[];for(var n in e){var r=e[n];Tr(r)||J(r)||t.push({key:n,value:Zk(r)})}return t}var dd={featureFlags:class{constructor(e){this.Zn=!1,this.$n=!1,this.Vn=!1,this.Hn=!1,this.zn=!1,this.Un=!1,this.Yn=!1,this.Wn=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Rt(){return this._instance.config}get Xi(){return this._instance.persistence}Gn(e){return this._instance.get_property(e)}Xn(){var e,t;return(e=(t=this.Xi)==null?void 0:t.pi(this.Rt.feature_flag_cache_ttl_ms))!==null&&e!==void 0&&e}Jn(){return!!this.Xn()&&(this.Wn||this.Vn||(this.Wn=!0,At.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Kn(){var e,t=(e=this.Rt.evaluation_contexts)!==null&&e!==void 0?e:this.Rt.evaluation_environments;return!this.Rt.evaluation_environments||this.Rt.evaluation_contexts||this.Yn||(At.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Yn=!0),t!=null&&t.length?t.filter(n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||At.error("Invalid evaluation context found:",n,"Expected non-empty string"),r}):[]}Qn(){return this.Kn().length>0}initialize(){var e,t,{config:n}=this._instance,r=(e=(t=n.bootstrap)==null?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(r).length){var i,s,o=(i=(s=n.bootstrap)==null?void 0:s.featureFlagPayloads)!==null&&i!==void 0?i:{},a=Object.keys(r).filter(c=>!!r[c]).reduce((c,u)=>(c[u]=r[u]||!1,c),{}),l=Object.keys(o).filter(c=>a[c]).reduce((c,u)=>(o[u]&&(c[u]=o[u]),c),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,n){var r=n!=null&&n.merge?this.getFlagVariants():{},i=n!=null&&n.merge?this.getFlagPayloads():{},s=V({},r,e),o=V({},i,t),a={};for(var[l,c]of Object.entries(s)){var u=typeof c=="string";a[l]={key:l,enabled:!!u||!!c,variant:u?c:void 0,reason:void 0,metadata:J(o==null?void 0:o[l])?void 0:{id:0,version:void 0,description:void 0,payload:o[l]}}}this.receivedFeatureFlags({flags:a})}get hasLoadedFlags(){return this.$n}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.Gn(dp),t=this.Gn(Fr),n=this.Gn($o);if(!n&&!t)return e||{};var r=et({},e||{}),i=[...new Set([...Object.keys(n||{}),...Object.keys(t||{})])];for(var s of i){var o,a,l=r[s],c=t==null?void 0:t[s],u=J(c)?(o=l==null?void 0:l.enabled)!==null&&o!==void 0&&o:!!c,d=J(c)?l.variant:typeof c=="string"?c:void 0,f=n==null?void 0:n[s],p=V({},l,{enabled:u,variant:u?d??(l==null?void 0:l.variant):void 0});u!==(l==null?void 0:l.enabled)&&(p.original_enabled=l==null?void 0:l.enabled),d!==(l==null?void 0:l.variant)&&(p.original_variant=l==null?void 0:l.variant),f&&(p.metadata=V({},l==null?void 0:l.metadata,{payload:f,original_payload:l==null||(a=l.metadata)==null?void 0:a.payload})),r[s]=p}return this.Zn||(At.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:n,finalDetails:r}),this.Zn=!0),r}getFlagVariants(){var e=this.Gn(Os),t=this.Gn(Fr);if(!t)return e||{};for(var n=et({},e),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Zn||(At.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this.Zn=!0),n}getFlagPayloads(){var e=this.Gn(My),t=this.Gn($o);if(!t)return e||{};for(var n=et({},e||{}),r=Object.keys(t),i=0;r.length>i;i++)n[r[i]]=t[r[i]];return this.Zn||(At.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:n}),this.Zn=!0),n}reloadFeatureFlags(){this.Hn||this.Rt.advanced_disable_feature_flags||this.ts||(this._instance.Sr.emit("featureFlagsReloading",!0),this.ts=setTimeout(()=>{this.es()},5))}rs(){clearTimeout(this.ts),this.ts=void 0}ensureFlagsLoaded(){this.$n||this.Vn||this.ts||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Hn=e}es(e){var t;if(this.rs(),!this._instance.ki())if(this.Vn)this.zn=!0;else{var n=this.Rt.token,r=this.Gn(xu),i={token:n,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:V({},((t=this.Xi)==null?void 0:t.get_initial_props())||{},this.Gn(ta)||{}),group_properties:this.Gn(Di),timezone:Mk()};Tr(r)||J(r)||(i.$device_id=r),(e!=null&&e.disableFlags||this.Rt.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.Qn()&&(i.evaluation_contexts=this.Kn());var s=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Rt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Vn=!0,this._instance._send_request({method:"POST",url:s,data:i,compression:this.Rt.disable_compression?void 0:Xn.Base64,timeout:this.Rt.feature_flag_request_timeout_ms,callback:o=>{var a,l,c,u=!0;if(o.statusCode===200&&(this.zn||(this.$anon_distinct_id=void 0),u=!1),this.Vn=!1,!i.disable_flags||this.zn){this.Un=!u;var d=[];o.error?o.error instanceof Error?d.push(o.error.name==="AbortError"?"timeout":"connection_error"):d.push("unknown_error"):o.statusCode!==200&&d.push("api_error_"+o.statusCode),(a=o.json)!=null&&a.errorsWhileComputingFlags&&d.push("errors_while_computing_flags");var f,p=!((l=o.json)==null||(l=l.quotaLimited)==null||!l.includes("feature_flags"));p&&d.push("quota_limited"),(c=this.Xi)==null||c.register({[pp]:d}),p?At.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(i.disable_flags||this.receivedFeatureFlags((f=o.json)!==null&&f!==void 0?f:{},u,{partialResponse:!!this.Rt.advanced_only_evaluate_survey_feature_flags}),this.zn&&(this.zn=!1,this.es()))}}})}}getFeatureFlag(e,t){var n;if(t===void 0&&(t={}),!t.fresh||this.Un)if(this.$n||this.getFlags()&&this.getFlags().length>0){if(!this.Jn()){var r=this.getFeatureFlagResult(e,t);return(n=r==null?void 0:r.variant)!==null&&n!==void 0?n:r==null?void 0:r.enabled}}else At.warn('getFeatureFlag for key "'+e+bh)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return t==null?void 0:t.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.Un)if(this.$n||this.getFlags()&&this.getFlags().length>0){if(!this.Jn()){var n=this.getFlagVariants(),r=e in n,i=n[e],s=this.getFlagPayloads()[e],o=String(i),a=this.Gn(Ry)||void 0,l=this.Gn(yu)||void 0,c=this.Gn(ya)||{};if(this.Rt.advanced_feature_flags_dedup_per_session){var u,d=this._instance.get_session_id(),f=this.Gn(fp);d&&d!==f&&(c={},(u=this.Xi)==null||u.register({[ya]:c,[fp]:d}))}if((t.send_event||!("send_event"in t))&&(!(e in c)||!c[e].includes(o))){var p,g,m,y,x,v,b,S,k,_;Ce(c[e])?c[e].push(o):c[e]=[o],(p=this.Xi)==null||p.register({[ya]:c});var C=this.getFeatureFlagDetails(e),P=[...(g=this.Gn(pp))!==null&&g!==void 0?g:[]];J(i)&&P.push("flag_missing");var j={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:((m=this.Rt.bootstrap)==null||(m=m.featureFlags)==null?void 0:m[e])||null,$feature_flag_bootstrapped_payload:((y=this.Rt.bootstrap)==null||(y=y.featureFlagPayloads)==null?void 0:y[e])||null,$used_bootstrap_value:!this.Un};J(C==null||(x=C.metadata)==null?void 0:x.version)||(j.$feature_flag_version=C.metadata.version);var w,M=(v=C==null||(b=C.reason)==null?void 0:b.description)!==null&&v!==void 0?v:C==null||(S=C.reason)==null?void 0:S.code;M&&(j.$feature_flag_reason=M),C!=null&&(k=C.metadata)!=null&&k.id&&(j.$feature_flag_id=C.metadata.id),J(C==null?void 0:C.original_variant)&&J(C==null?void 0:C.original_enabled)||(j.$feature_flag_original_response=J(C.original_variant)?C.original_enabled:C.original_variant),C!=null&&(_=C.metadata)!=null&&_.original_payload&&(j.$feature_flag_original_payload=C==null||(w=C.metadata)==null?void 0:w.original_payload),P.length&&(j.$feature_flag_error=P.join(",")),this._instance.capture("$feature_flag_called",j)}if(r){var D=s;if(!J(s))try{D=JSON.parse(s)}catch{}return{key:e,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:D}}}}else At.warn('getFeatureFlagResult for key "'+e+bh)}getRemoteConfigPayload(e,t){var n=this.Rt.token,r={distinct_id:this._instance.get_distinct_id(),token:n};this.Qn()&&(r.evaluation_contexts=this.Kn()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Rt.disable_compression?void 0:Xn.Base64,timeout:this.Rt.feature_flag_request_timeout_ms,callback(i){var s,o=(s=i.json)==null?void 0:s.featureFlagPayloads;t((o==null?void 0:o[e])||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.Un){if(this.$n||this.getFlags()&&this.getFlags().length>0){var n=this.getFeatureFlag(e,t);return J(n)?void 0:!!n}At.warn('isFeatureEnabled for key "'+e+bh)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,n){if(this.Xi){this.$n=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),s=this.getFlagsWithDetails();(function(o,a,l,c,u,d){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var f=(P=>{var j=P.flags;return j?(P.featureFlags=Object.fromEntries(Object.keys(j).map(w=>{var M;return[w,(M=j[w].variant)!==null&&M!==void 0?M:j[w].enabled]})),P.featureFlagPayloads=Object.fromEntries(Object.keys(j).filter(w=>j[w].enabled).filter(w=>{var M;return(M=j[w].metadata)==null?void 0:M.payload}).map(w=>{var M;return[w,(M=j[w].metadata)==null?void 0:M.payload]}))):At.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),P})(o),p=f.flags,g=f.featureFlags,m=f.featureFlagPayloads;if(g){var y=o.requestId,x=o.evaluatedAt;if(Ce(g)){At.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(g)for(var b=0;g.length>b;b++)v[g[b]]=!0;a&&a.register({[_h]:g,[Os]:v})}else{var S=g,k=m,_=p;if(d!=null&&d.partialResponse)S=V({},l,S),k=V({},c,k),_=V({},u,_);else if(o.errorsWhileComputingFlags)if(p){var C=new Set(Object.keys(p).filter(P=>{var j;return!((j=p[P])!=null&&j.failed)}));S=V({},l,Object.fromEntries(Object.entries(S).filter(P=>{var[j]=P;return C.has(j)}))),k=V({},c,Object.fromEntries(Object.entries(k||{}).filter(P=>{var[j]=P;return C.has(j)}))),_=V({},u,Object.fromEntries(Object.entries(_||{}).filter(P=>{var[j]=P;return C.has(j)})))}else S=V({},l,S),k=V({},c,k),_=V({},u,_);a&&a.register(V({[_h]:Object.keys(Ay(S)),[Os]:S||{},[My]:k||{},[dp]:_||{}},y?{[Ry]:y}:{},x?{[yu]:x}:{}))}}})(e,this.Xi,r,i,s,n),t||(this.Wn=!1),this.ns(t)}}override(e,t){t===void 0&&(t=!1),At.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.Xi)return At.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this.Xi.unregister(Fr),this.Xi.unregister($o),this.ns(),Si.info("All overrides cleared");if(Ce(e)){var t=Dy(e);return this.Xi.register({[Fr]:t}),this.ns(),Si.info("Flag overrides set",{flags:e})}if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,r=e;if(this.Zn=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.Xi.unregister(Fr),Si.info("Flag overrides cleared");else if(r.flags){if(Ce(r.flags)){var i=Dy(r.flags);this.Xi.register({[Fr]:i})}else this.Xi.register({[Fr]:r.flags});Si.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this.Xi.unregister($o),Si.info("Payload overrides cleared")):r.payloads&&(this.Xi.register({[$o]:r.payloads}),Si.info("Payload overrides set",{payloads:r.payloads}))),void this.ns()}if(e&&typeof e=="object")return this.Xi.register({[Fr]:e}),this.ns(),Si.info("Flag overrides set",{flags:e});At.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.$n){var{flags:t,flagVariants:n}=this.ss();e(t,n)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,n){var r,i=(this.Gn(ea)||[]).find(l=>l.flagKey===e),s={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:s};i&&(o.$early_access_feature_name=i.name),n&&(o.$feature_enrollment_stage=n),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(s,!1);var a=V({},this.getFlagVariants(),{[e]:t});(r=this.Xi)==null||r.register({[_h]:Object.keys(Ay(a)),[Os]:a}),this.ns()}getEarlyAccessFeatures(e,t,n){t===void 0&&(t=!1);var r=this.Gn(ea),i=n?"&"+n.map(s=>"stage="+s).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Rt.token+i),method:"GET",callback:s=>{var o,a;if(s.json){var l=s.json.earlyAccessFeatures;return(o=this.Xi)==null||o.unregister(ea),(a=this.Xi)==null||a.register({[ea]:l}),e(l)}}})}ss(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(n=>t[n]),flagVariants:Object.keys(t).filter(n=>t[n]).reduce((n,r)=>(n[r]=t[r],n),{})}}ns(e){var{flags:t,flagVariants:n}=this.ss();this.featureFlagEventHandlers.forEach(r=>r(t,n,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.Gn(ta)||{},r=(e==null?void 0:e.$set)||(e!=null&&e.$set_once?{}:e),i=e==null?void 0:e.$set_once,s={};if(i)for(var o in i)({}).hasOwnProperty.call(i,o)&&(o in n||(s[o]=i[o]));this._instance.register({[ta]:V({},n,s,r)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(ta)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var n=this.Gn(Di)||{};Object.keys(n).length!==0&&Object.keys(n).forEach(r=>{n[r]=V({},n[r],e[r]),delete e[r]}),this._instance.register({[Di]:V({},n,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.Gn(Di)||{};this._instance.register({[Di]:V({},t,{[e]:{}})})}else this._instance.unregister(Di)}reset(){this.$n=!1,this.Vn=!1,this.Hn=!1,this.zn=!1,this.Un=!1,this.$anon_distinct_id=void 0,this.rs(),this.Zn=!1}}},VT={sessionRecording:class{get Rt(){return this._instance.config}get Xi(){return this._instance.persistence}get started(){var e;return!((e=this.os)==null||!e.isStarted)}get status(){var e,t;return this.ls===Fo||this.ls===Yl?this.ls:(e=(t=this.os)==null?void 0:t.status)!==null&&e!==void 0?e:this.ls}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.ls=ky,this.us=void 0,this._instance=e,!this._instance.sessionManager)throw Lr.error("started without valid sessionManager"),new Error(Tp+" started without valid sessionManager. This is a bug.");if(this.Rt.cookieless_mode===In)throw new Error(Tp+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get hs(){var e,t=!((e=this._instance.get_property(Wl))==null||!e.enabled),n=!this.Rt.disable_session_recording,r=this.Rt.disable_session_recording||this._instance.consent.isOptedOut();return A&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(!this.hs||(t=this.os)==null||!t.isStarted){var n=!J(Object.assign)&&!J(Array.from);this.hs&&n?(this.cs(e),Lr.info("starting")):(this.ls=ky,this.stopRecording())}}cs(e){var t,n,r;this.hs&&(this.ls!==Fo&&this.ls!==Yl&&(this.ls=Sy),ne!=null&&(t=ne.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=ne.__PosthogExtensions__)!=null&&n.initSessionRecording?this.ds(e):(r=ne.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.vs,i=>{if(i)return Lr.error("could not load recorder",i);this.ds(e)}))}stopRecording(){var e,t;(e=this.us)==null||e.call(this),this.us=void 0,(t=this.os)==null||t.stop()}fs(){var e,t;(e=this.us)==null||e.call(this),this.us=void 0,(t=this.os)==null||t.discard()}ps(){var e;(e=this.Xi)==null||e.unregister(yk)}gs(e,t){if(xe(e))return null;var n,r=Hn(e)?e:parseFloat(e);return typeof(n=r)!="number"||!Number.isFinite(n)||0>n||n>1?(Lr.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):r}ys(e){if(this.Xi){var t,n,r=this.Xi,i=()=>{var s,o=e.sessionRecording===!1?void 0:e.sessionRecording,a=this.gs((s=this.Rt.session_recording)==null?void 0:s.sampleRate,"session_recording.sampleRate"),l=this.gs(o==null?void 0:o.sampleRate,"remote config sampleRate"),c=a??l;xe(c)&&this.ps();var u=o==null?void 0:o.minimumDurationMilliseconds;r.register({[Wl]:V({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:V({capturePerformance:e.capturePerformance},o==null?void 0:o.networkPayloadCapture),canvasRecording:{enabled:o==null?void 0:o.recordCanvas,fps:o==null?void 0:o.canvasFps,quality:o==null?void 0:o.canvasQuality},sampleRate:c,minimumDurationMilliseconds:J(u)?null:u,endpoint:o==null?void 0:o.endpoint,triggerMatchType:o==null?void 0:o.triggerMatchType,masking:o==null?void 0:o.masking,urlTriggers:o==null?void 0:o.urlTriggers})})};i(),(t=this.us)==null||t.call(this),this.us=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(i)}}onRemoteConfig(e){return"sessionRecording"in e?e.sessionRecording===!1?(this.ys(e),void this.fs()):(this.ys(e),void this.startIfEnabledOrStop()):(this.ls===Fo&&(this.ls=Yl,Lr.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var n;t===void 0&&(t="log"),(n=this.os)!=null&&n.log?this.os.log(e,t):Lr.warn("log called before recorder was ready")}get vs(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(Wl);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}bs(){var e,t=this._instance.get_property(Wl);if(!t)return!1;var n=(e=(typeof t=="object"?t:JSON.parse(t)).cache_timestamp)!==null&&e!==void 0?e:Date.now();return 36e5>=Date.now()-n}ds(e){var t,n;if((t=ne.__PosthogExtensions__)==null||!t.initSessionRecording)return Lr.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0});if(this.os||(this.os=(n=ne.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.os._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.bs())return this.ls===Yl||this.ls===Fo?void 0:(this.ls=Fo,Lr.info("persisted remote config is stale, requesting fresh config before starting"),void new Rk(this._instance).load());this.ls=Sy,this.os.start(e)}onRRwebEmit(e){var t;(t=this.os)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.os||(t=this.Xi)==null||t.register({$replay_override_linked_flag:!0}),(e=this.os)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.os||(t=this.Xi)==null||t.register({$replay_override_sampling:!0}),(e=this.os)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.os||(n=this.Xi)==null||n.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.os)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.os)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.os)==null||!n.tryAddCustomEvent(e,t))}}},UT={autocapture:class{constructor(e){this.ws=!1,this._s=null,this.Is=!1,this.instance=e,this.rageclicks=new yy(e.config.rageclick),this.Cs=null}initialize(){this.startIfEnabled()}get Rt(){var e,t,n=ct(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map(r=>new RegExp(r)),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map(r=>new RegExp(r)),n}Ss(){if(this.isBrowserSupported()){if(A&&K){var e=n=>{n=n||(A==null?void 0:A.event);try{this.ks(n)}catch(r){by.error("Failed to capture event",r)}};if(ot(K,"submit",e,{capture:!0}),ot(K,"change",e,{capture:!0}),ot(K,"click",e,{capture:!0}),this.Rt.capture_copied_text){var t=n=>{this.ks(n=n||(A==null?void 0:A.event),mh)};ot(K,"copy",t,{capture:!0}),ot(K,"cut",t,{capture:!0})}}}else by.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.ws&&(this.Ss(),this.ws=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Is=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Lv]:!!e.autocapture_opt_out}),this._s=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Cs=e}getElementSelectors(e){var t,n=[];return(t=this.Cs)==null||t.forEach(r=>{var i=K==null?void 0:K.querySelectorAll(r);i==null||i.forEach(s=>{e===s&&n.push(r)})}),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[Lv];if(Tr(this._s)&&!er(n)&&!this.instance.ki())return!1;var r=(t=this._s)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!r}ks(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=fy(e);Vk(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&function(d,f){if(!A||Pp(d))return!1;var p,g,m;if(er(f)?(p=!!f&&gy,g=void 0):(p=(m=f==null?void 0:f.css_selector_ignorelist)!==null&&m!==void 0?m:gy,g=f==null?void 0:f.content_ignorelist),p===!1)return!1;var{targetElementList:y}=my(d,!1);return!function(x,v){if(x===!1||J(x))return!1;var b;if(x===!0)b=NT;else{if(!Ce(x))return!1;if(x.length>10)return Y.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;b=x.map(S=>S.toLowerCase())}return v.some(S=>{var{safeText:k,ariaLabel:_}=S;return b.some(C=>k.includes(C)||_.includes(C))})}(g,y.map(x=>{var v;return{safeText:tl(x).toLowerCase(),ariaLabel:((v=x.getAttribute("aria-label"))==null?void 0:v.toLowerCase().trim())||""}}))&&!py(y,p)}(r,this.instance.config.rageclick)&&this.ks(e,"$rageclick");var i=t===mh;if(r&&function(d,f,p,g,m){var y,x,v,b;if(p===void 0&&(p=void 0),!A||Pp(d)||(y=p)!=null&&y.url_allowlist&&!hy(p.url_allowlist)||(x=p)!=null&&x.url_ignorelist&&hy(p.url_ignorelist))return!1;if((v=p)!=null&&v.dom_event_allowlist){var S=p.dom_event_allowlist;if(S&&!S.some(j=>f.type===j))return!1}var{parentIsUsefulElement:k,targetElementList:_}=my(d,g);if(!function(j,w){var M=w==null?void 0:w.element_allowlist;if(J(M))return!0;var D,F=function(I){if(M.some(H=>I.tagName.toLowerCase()===H))return{v:!0}};for(var $ of j)if(D=F($))return D.v;return!1}(_,p)||!py(_,(b=p)==null?void 0:b.css_selector_allowlist))return!1;var C=A.getComputedStyle(d);if(C&&C.getPropertyValue("cursor")==="pointer"&&f.type==="click")return!0;var P=d.tagName.toLowerCase();switch(P){case"html":return!1;case"form":return(m||["submit"]).indexOf(f.type)>=0;case"input":case"select":case"textarea":return(m||["change","click"]).indexOf(f.type)>=0;default:return k?(m||["click"]).indexOf(f.type)>=0:(m||["click"]).indexOf(f.type)>=0&&(Sm.indexOf(P)>-1||d.getAttribute("contenteditable")==="true")}}(r,e,this.Rt,i,i?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=AT(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Rt.element_attribute_ignorelist,elementsChainAsString:this.Is});if(o)return!1;var a=this.getElementSelectors(r);if(a&&a.length>0&&(s.$element_selectors=a),t===mh){var l,c=qk(A==null||(l=A.getSelection())==null?void 0:l.toString()),u=e.type||"clipboard";if(!c)return!1;s.$selected_content=c,s.$copy_type=u}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return mr(K==null?void 0:K.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.xs=(A==null||(t=A.location)==null?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(Y.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ts&&this.Ts(),this.Ts=void 0,Y.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(A&&A.history){var n=this;(e=A.history.pushState)!=null&&e.__posthog_wrapped__||_y(A.history,"pushState",r=>function(i,s,o){r.call(this,i,s,o),n.As("pushState")}),(t=A.history.replaceState)!=null&&t.__posthog_wrapped__||_y(A.history,"replaceState",r=>function(i,s,o){r.call(this,i,s,o),n.As("replaceState")}),this.Es()}}As(e){try{var t,n=A==null||(t=A.location)==null?void 0:t.pathname;if(!n)return;n!==this.xs&&this.isEnabled&&this._instance.capture(bs,{navigation_type:e}),this.xs=n}catch(r){Y.error("Error capturing "+e+" pageview",r)}}Es(){if(!this.Ts){var e=()=>{this.As("popstate")};ot(A,"popstate",e),this.Ts=()=>{A&&A.removeEventListener("popstate",e)}}}},heatmaps:class{get Rt(){return this.instance.config}constructor(e){var t;this.Rs=!1,this.ws=!1,this.Ns=null,this.instance=e,this.Rs=!((t=this.instance.persistence)==null||!t.props[cp]),this.rageclicks=new yy(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return ct(this.Rt.capture_heatmaps)&&this.Rt.capture_heatmaps.flush_interval_milliseconds&&(e=this.Rt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return xe(this.Rt.capture_heatmaps)?xe(this.Rt.enable_heatmaps)?this.Rs:this.Rt.enable_heatmaps:this.Rt.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.ws)return;LT.info("starting..."),this.Ms(),this.Tt()}else{var e;clearInterval((e=this.Ns)!==null&&e!==void 0?e:void 0),this.Fs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[cp]:t}),this.Rs=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.T;return this.T=void 0,e}Os(e){this.wt(e.originalEvent,"deadclick")}Tt(){this.Ns&&clearInterval(this.Ns),this.Ns=(K==null?void 0:K.visibilityState)==="visible"?setInterval(this.ji.bind(this),this.flushIntervalMilliseconds):null}Ms(){A&&K&&(this.Ps=this.ji.bind(this),ot(A,ku,this.Ps),this.Ls=e=>this.wt(e||(A==null?void 0:A.event)),ot(K,"click",this.Ls,{capture:!0}),this.Ds=e=>this.Bs(e||(A==null?void 0:A.event)),ot(K,"mousemove",this.Ds,{capture:!0}),this.js=new Uv(this.instance,X2,this.Os.bind(this)),this.js.startIfEnabledOrStop(),this.qs=this.Tt.bind(this),ot(K,wu,this.qs),this.ws=!0)}Fs(){var e;A&&K&&(this.Ps&&A.removeEventListener(ku,this.Ps),this.Ls&&K.removeEventListener("click",this.Ls,{capture:!0}),this.Ds&&K.removeEventListener("mousemove",this.Ds,{capture:!0}),this.qs&&K.removeEventListener(wu,this.qs),clearTimeout(this.Zs),(e=this.js)==null||e.stop(),this.ws=!1)}$s(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),s=function(o,a,l){for(var c=o;c&&ud(c)&&!ui(c,"body");){if(c===l)return!1;if(fe(a,A==null?void 0:A.getComputedStyle(c).position))return!0;c=Gk(c)}return!1}(fy(e),["fixed","sticky"],i);return{x:e.clientX+(s?0:r),y:e.clientY+(s?0:n),target_fixed:s,type:t}}wt(e,t){var n;if(t===void 0&&(t="click"),!dy(e.target)&&Cy(e)){var r=this.$s(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Vs(V({},r,{type:"rageclick"})),this.Vs(r)}}Bs(e){!dy(e.target)&&Cy(e)&&(clearTimeout(this.Zs),this.Zs=setTimeout(()=>{this.Vs(this.$s(e,"mousemove"))},500))}Vs(e){if(A){var t=A.location.href,n=this.Rt.custom_personal_data_properties,r=this.Rt.mask_personal_data_properties?[...oo,...n||[]]:[],i=Za(t,r,el);this.T=this.T||{},this.T[i]||(this.T[i]=[]),this.T[i].push(e)}}ji(){this.T&&!Ls(this.T)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Uv,webVitalsAutocapture:class{constructor(e){var t;this.Rs=!1,this.ws=!1,this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Hs=()=>{clearTimeout(this.zs),this.T.metrics.length!==0&&(this._instance.capture("$web_vitals",this.T.metrics.reduce((n,r)=>V({},n,{["$web_vitals_"+r.name+"_event"]:V({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{})),this.T={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.nt=n=>{var r,i=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(J(i))Ir.error("Could not read session ID. Dropping metrics!");else{this.T=this.T||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.Us();J(s)||(xe(n==null?void 0:n.name)||xe(n==null?void 0:n.value)?Ir.error("Invalid metric received",n):!this.Ys||this.Ys>n.value?(this.T.url!==s&&(this.Hs(),this.zs=setTimeout(this.Hs,this.flushToCaptureTimeoutMs)),J(this.T.url)&&(this.T.url=s),this.T.firstMetricTimestamp=J(this.T.firstMetricTimestamp)?Date.now():this.T.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.T.metrics.push(V({},n,{$current_url:s,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.T.metrics.length===this.allowedMetrics.length&&this.Hs()):Ir.error("Ignoring metric with value >= "+this.Ys,n))}},this.Ws=()=>{if(!this.ws){var n,r,i,s,o=ne.__PosthogExtensions__;J(o)||J(o.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:i,onINP:s}=o.postHogWebVitalsCallbacks),n&&r&&i&&s?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.nt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.nt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.nt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.nt.bind(this)),this.ws=!0):Ir.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Rs=!((t=this._instance.persistence)==null||!t.props[$v]),this.startIfEnabled()}get Gs(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,n=ct(this.Gs)?(e=this.Gs)==null?void 0:e.web_vitals_allowed_metrics:void 0;return xe(n)?((t=this._instance.persistence)==null?void 0:t.props[Bv])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(ct(this.Gs)?this.Gs.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=ct(this.Gs)?this.Gs.web_vitals_attribution:void 0;return e!=null&&e}get Ys(){var e=ct(this.Gs)&&Hn(this.Gs.__web_vitals_max_value)?this.Gs.__web_vitals_max_value:wy;return e>0&&6e4>=e?wy:e}get isEnabled(){var e=yt==null?void 0:yt.protocol;if(e!=="http:"&&e!=="https:")return Ir.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=ct(this.Gs)?this.Gs.web_vitals:er(this.Gs)?this.Gs:void 0;return er(t)?t:this.Rs}startIfEnabled(){this.isEnabled&&!this.ws&&(Ir.info("enabled, starting..."),this.ni(this.Ws))}onRemoteConfig(e){if("capturePerformance"in e){var t=ct(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=ct(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[$v]:t}),this._instance.persistence.register({[Bv]:n})),this.Rs=t,this.startIfEnabled()}}ni(e){var t,n;(t=ne.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks?e():(n=ne.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",r=>{r?Ir.error("failed to load script",r):e()})}Us(){var e=A?A.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties,n=this._instance.config.mask_personal_data_properties?[...oo,...t||[]]:[];return Za(e,n,el)}Ir.error("Could not determine current URL")}}},qT={exceptionObserver:class{constructor(e){var t,n,r;this.Ws=()=>{var i;if(A&&this.isEnabled&&(i=ne.__PosthogExtensions__)!=null&&i.errorWrappingFunctions){var s=ne.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=ne.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,a=ne.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Xs&&this.Rt.capture_unhandled_errors&&(this.Xs=s(this.captureException.bind(this))),!this.Js&&this.Rt.capture_unhandled_rejections&&(this.Js=o(this.captureException.bind(this))),!this.Ks&&this.Rt.capture_console_errors&&(this.Ks=a(this.captureException.bind(this)))}catch(l){Oo.error("failed to start",l),this.Qs()}}},this._instance=e,this.eo=!((t=this._instance.persistence)==null||!t.props[Ov]),this.io=new l2({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,qt:Oo}),this.Rt=this.ro(),this.startIfEnabledOrStop()}ro(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ct(e)?t=V({},t,e):(J(e)?this.eo:e)&&(t=V({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Rt.capture_console_errors||this.Rt.capture_unhandled_errors||this.Rt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Oo.info("enabled"),this.Qs(),this.ni(this.Ws)):this.Qs()}ni(e){var t,n;(t=ne.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=ne.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",r=>{if(r)return Oo.error("failed to load script",r);e()})}Qs(){var e,t,n;(e=this.Xs)==null||e.call(this),this.Xs=void 0,(t=this.Js)==null||t.call(this),this.Js=void 0,(n=this.Ks)==null||n.call(this),this.Ks=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.eo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Ov]:this.eo}),this.Rt=this.ro(),this.startIfEnabledOrStop())}onConfigChange(){this.Rt=this.ro()}captureException(e){var t,n,r,i=(t=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&t!==void 0?t:"Exception";this.io.consumeRateLimit(i)?Oo.info("Skipping exception capture because of client rate limiting.",{exception:i}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,n;this.no=[],this.so=new b2([new P2,new O2,new T2,new j2,new I2,new A2,new R2,new L2],function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;i>o;o++)s[o-1]=arguments[o];return function(a,l){l===void 0&&(l=0);for(var c=[],u=a.split(`
68
+ `),d=l;u.length>d;d++){var f=u[d];if(1024>=f.length){var p=Iv.test(f)?f.replace(Iv,"$1"):f;if(!p.match(/\S*Error: /)){for(var g of s){var m=g(p,r);if(m){c.push(m);break}}if(c.length>=50)break}}}return function(y){if(!y.length)return[];var x=Array.from(y);return x.reverse(),x.slice(0,50).map(v=>{return V({},v,{filename:v.filename||(b=x,b[b.length-1]||{}).filename,function:v.function||so});var b})}(c)}}("web:javascript",S2,N2)),this._instance=e,this.no=(t=(n=this._instance.persistence)==null?void 0:n.get_property(up))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,n,r;if("errorTracking"in e){var i=(t=(n=e.errorTracking)==null?void 0:n.suppressionRules)!==null&&t!==void 0?t:[],s=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.no=i,this._instance.persistence&&this._instance.persistence.register({[up]:this.no,[Fv]:s})}}get oo(){var e,t=!!this._instance.get_property(Fv),n=this._instance.config.error_tracking.captureExtensionExceptions;return(e=n??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.so.buildFromUnknown(e,{syntheticException:t==null?void 0:t.syntheticException,mechanism:{handled:t==null?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.ao(t)){if(this.lo(t))return void wh.info("Skipping exception capture because a suppression rule matched");if(!this.oo&&this.uo(t))return void wh.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ho(t))return void wh.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",zr:!0})}lo(e){if(e.length===0)return!1;var t=e.reduce((n,r)=>{var{type:i,value:s}=r;return at(i)&&i.length>0&&n.$exception_types.push(i),at(s)&&s.length>0&&n.$exception_values.push(s),n},{$exception_types:[],$exception_values:[]});return this.no.some(n=>{var r=n.values.map(i=>{var s,o=zk[i.operator],a=Ce(i.value)?i.value:[i.value],l=(s=t[i.key])!==null&&s!==void 0?s:[];return a.length>0&&o(a,l)});return n.type==="OR"?r.some(Boolean):r.every(Boolean)})}uo(e){return e.flatMap(t=>{var n,r;return(n=(r=t.stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[]}).some(t=>t.filename&&t.filename.startsWith("chrome-extension://"))}ho(e){if(e.length>0){var t,n,r,i,s=(t=(n=e[0].stacktrace)==null?void 0:n.frames)!==null&&t!==void 0?t:[],o=s[s.length-1];return(r=o==null||(i=o.filename)==null?void 0:i.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}ao(e){return!xe(e)&&Ce(e)}}},GT=V({productTours:class{get Xi(){return this._instance.persistence}constructor(e){this.co=null,this.do=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this.Xi&&this.Xi.register({[zv]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.co||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(zv)||this.ni(()=>this.vo())}ni(e){var t,n;(t=ne.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=ne.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",r=>{r?Ey.error("Could not load product tours script",r):e()})}vo(){var e;!this.co&&(e=ne.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.co=ne.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!Ce(this.do)||t){var n=this.Xi;if(n){var r=n.props[vh];if(Ce(r)&&!t)return this.do=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:i=>{var s=i.statusCode;if(s!==200||!i.json){var o="Product Tours API could not be loaded, status: "+s;return Ey.error(o),void e([],{isLoaded:!1,error:o})}var a=Ce(i.json.product_tours)?i.json.product_tours:[];this.do=a,n&&n.register({[vh]:a}),e(a,{isLoaded:!0})}})}else e(this.do,{isLoaded:!0})}getActiveProductTours(e){xe(this.co)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.co.getActiveProductTours(e)}showProductTour(e){var t;(t=this.co)==null||t.showTourById(e)}previewTour(e){this.co?this.co.previewTour(e):this.ni(()=>{var t;this.vo(),(t=this.co)==null||t.previewTour(e)})}dismissProductTour(){var e;(e=this.co)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.co)==null||e.nextStep()}previousStep(){var e;(e=this.co)==null||e.previousStep()}clearCache(){var e;this.do=null,(e=this.Xi)==null||e.unregister(vh)}resetTour(e){var t;(t=this.co)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.co)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.co)==null||t.cancelPendingTour(e)}}},dd),KT={siteApps:class{constructor(e){this._instance=e,this.fo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}po(e,t){if(t){var n=this.globalsForEvent(t);this.fo.push(n),this.fo.length>1e3&&(this.fo=this.fo.slice(10))}}get siteAppLoaders(){var e;return(e=ne._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.po.bind(this));this.mo=()=>{e(),this.fo=[],this.mo=void 0}}}globalsForEvent(e){var t,n,r,i,s,o,a;if(!e)throw new Error("Event payload is required");var l={},c=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(var[d,f]of Object.entries(u))l[d]={id:c[d],type:d,properties:f};var{$set_once:p,$set:g}=e;return{event:V({},G1(e,OT),{properties:V({},e.properties,g?{$set:V({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},g)}:{},p?{$set_once:V({},(r=(i=e.properties)==null?void 0:i.$set_once)!==null&&r!==void 0?r:{},p)}:{}),elements_chain:(s=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(a=e.properties)==null?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var o;!t.errored&&this.fo.length&&(Or.info("Processing "+this.fo.length+" events for site app with id "+e.id),this.fo.forEach(a=>t.processEvent==null?void 0:t.processEvent(a)),t.processedBuffer=!0),Object.values(this.apps).every(a=>a.processedBuffer||a.errored)&&((o=this.mo)==null||o.call(this))},r=!1,i=o=>{t.errored=!o,t.loaded=!0,Or.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),r&&n()};try{var{processEvent:s}=e.init({posthog:this._instance,callback(o){i(o)}});s&&(t.processEvent=s),r=!0}catch(o){Or.error(Ny+e.id,o),i(!1)}if(r&&t.loaded)try{n()}catch(o){Or.error("Error while processing buffered events PostHog app with config id "+e.id,o),t.errored=!0}}yo(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}bo(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){Or.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,i=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.yo(),void this._instance.on("eventCaptured",l=>this.bo(l))):void Or.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.mo)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var s=function(l){var c;ne["__$$ph_site_app_"+l]=i._instance,(c=ne.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(i._instance,a,u=>{if(u)return Or.error(Ny+l,u)})};for(var{id:o,url:a}of e.siteApps)s(o)}else Or.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},YT={tracingHeaders:class{constructor(e){this.wo=void 0,this._o=void 0,this.Ws=()=>{var t,n;J(this.wo)&&((t=ne.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),J(this._o)&&((n=ne.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}ni(e){var t,n;(t=ne.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=ne.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",r=>{if(r)return IT.error("failed to load script",r);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.ni(this.Ws):((e=this.wo)==null||e.call(this),(t=this._o)==null||t.call(this),this.wo=void 0,this._o=void 0)}}},XT=V({surveys:class{get Rt(){return this._instance.config}constructor(e){this.Io=void 0,this._surveyManager=null,this.Co=!1,this.So=[],this.ko=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Rt.disable_surveys){var t=e.surveys;if(xe(t))return De.warn("Flags not loaded yet. Not loading surveys.");var n=Ce(t);this.Io=n?t.length>0:t,De.info("flags response received, isSurveysEnabled: "+this.Io),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);(n!=null&&n.startsWith(Ep)||n!=null&&n.startsWith("inProgressSurvey_"))&&e.push(n)}e.forEach(r=>localStorage.removeItem(r))}loadIfEnabled(){if(!this._surveyManager)if(this.Co)De.info("Already initializing surveys, skipping...");else if(this.Rt.disable_surveys)De.info(Py);else if(this.Rt.cookieless_mode&&this._instance.consent.isOptedOut())De.info("Not loading surveys in cookieless mode without consent.");else{var e=ne==null?void 0:ne.__PosthogExtensions__;if(e){if(!J(this.Io)||this.Rt.advanced_enable_surveys){var t=this.Io||this.Rt.advanced_enable_surveys;this.Co=!0;try{var n=e.generateSurveys;if(n)return void this.xo(n,t);var r=e.loadExternalDependency;if(!r)return void this.To(vm);r(this._instance,"surveys",i=>{i||!e.generateSurveys?this.To("Could not load surveys script",i):this.xo(e.generateSurveys,t)})}catch(i){throw this.To("Error initializing surveys",i),i}finally{this.Co=!1}}}else De.error("PostHog Extensions not found.")}}xo(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new zT(this._instance),De.info("Surveys loaded successfully"),this.Ao({isLoaded:!0})}To(e,t){De.error(e,t),this.Ao({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.So.push(e),this._surveyManager&&this.Ao({isLoaded:!0}),()=>{this.So=this.So.filter(t=>t!==e)}}getSurveys(e,t){if(t===void 0&&(t=!1),this.Rt.disable_surveys)return De.info(Py),e([]);var n,r=this._instance.get_property(hp);if(r&&!t)return e(r,{isLoaded:!0});typeof Promise<"u"&&this.ko?this.ko.then(i=>{var{surveys:s,context:o}=i;return e(s,o)}):(typeof Promise<"u"&&(this.ko=new Promise(i=>{n=i})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Rt.token),method:"GET",timeout:this.Rt.surveys_request_timeout_ms,callback:i=>{var s;this.ko=null;var o=i.statusCode;if(o!==200||!i.json){var a="Surveys API could not be loaded, status: "+o;De.error(a);var l={isLoaded:!1,error:a};return e([],l),void(n==null||n({surveys:[],context:l}))}var c,u=i.json.surveys||[],d=u.filter(p=>function(g){return!(!g.start_date||g.end_date)}(p)&&(function(g){var m;return!((m=g.conditions)==null||(m=m.events)==null||(m=m.values)==null||!m.length)}(p)||function(g){var m;return!((m=g.conditions)==null||(m=m.actions)==null||(m=m.values)==null||!m.length)}(p)));d.length>0&&((c=this._surveyEventReceiver)==null||c.register(d)),(s=this._instance.persistence)==null||s.register({[hp]:u});var f={isLoaded:!0};e(u,f),n==null||n({surveys:u,context:f})}}))}Ao(e){for(var t of this.So)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(n){De.error("Error in survey callback",n)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!xe(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);De.warn("init was not called")}Eo(e){var t=null;return this.getSurveys(n=>{var r;t=(r=n.find(i=>i.id===e))!==null&&r!==void 0?r:null}),t}Ro(e){if(xe(this._surveyManager))return{eligible:!1,reason:yh};var t=typeof e=="string"?this.Eo(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(xe(this._surveyManager))return De.warn("init was not called"),{visible:!1,disabledReason:yh};var t=this.Ro(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return xe(this._surveyManager)?(De.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:yh})):new Promise(n=>{this.getSurveys(r=>{var i,s=(i=r.find(a=>a.id===e))!==null&&i!==void 0?i:null;if(s){var o=this.Ro(s);n({visible:o.eligible,disabledReason:o.reason})}else n({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,n){var r;if(xe(this._surveyManager))De.warn("init was not called");else{var i=typeof e=="string"?this.Eo(e):e;if(i!=null&&i.id)if(yT.includes(i.type)){var s=K==null?void 0:K.querySelector(t);if(s)return(r=i.appearance)!=null&&r.surveyPopupDelaySeconds?(De.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var o,a;De.info("Rendering survey "+i.id+" with delay of "+((o=i.appearance)==null?void 0:o.surveyPopupDelaySeconds)+" seconds"),(a=this._surveyManager)==null||a.renderSurvey(i,s,n),De.info("Survey "+i.id+" rendered")},1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,s,n);De.warn("Survey element not found")}else De.warn("Surveys of type "+i.type+" cannot be rendered in the app");else De.warn("Survey not found")}}displaySurvey(e,t){var n;if(xe(this._surveyManager))De.warn("init was not called");else{var r=this.Eo(e);if(r){var i=r;if((n=r.appearance)!=null&&n.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=V({},r,{appearance:V({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==bp.Popover&&t.initialResponses&&De.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){var s=this.canRenderSurvey(r);if(!s.visible)return void De.warn("Survey is not eligible to be displayed: ",s.disabledReason)}t.displayType!==bp.Inline?this._surveyManager.handlePopoverSurvey(i,t):this.renderSurvey(i,t.selector,t.properties)}else De.warn("Survey not found")}}cancelPendingSurvey(e){xe(this._surveyManager)?De.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},dd),JT={toolbar:class{constructor(e){this.instance=e}No(e){ne.ph_toolbar_state=e}Mo(){var e;return(e=ne.ph_toolbar_state)!==null&&e!==void 0?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,n){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),_k(this.instance.config)||!A||!K)return!1;e=e??A.location,n=n??A.history;try{if(!t){try{A.localStorage.setItem("test","test"),A.localStorage.removeItem("test")}catch{return!1}t=A==null?void 0:A.localStorage}var r,i=BT||Nu(e.hash,"__posthog")||Nu(e.hash,"state"),s=i?Hv(()=>JSON.parse(atob(decodeURIComponent(i))))||Hv(()=>JSON.parse(decodeURIComponent(i))):null;return s&&s.action==="ph_authorize"?((r=s).source="url",r&&Object.keys(r).length>0&&(s.desiredHash?e.hash=s.desiredHash:n?n.replaceState(n.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(jy)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Fo(e){var t=ne.ph_load_toolbar||ne.ph_load_editor;!xe(t)&&mr(t)?t(e,this.instance):Ty.warn("No toolbar load function found")}loadToolbar(e){var t=!(K==null||!K.getElementById(bk));if(!A||t)return!1;var n=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=V({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(A.localStorage.setItem(jy,JSON.stringify(V({},r,{source:void 0}))),this.Mo()===2)this.Fo(r);else if(this.Mo()===0){var i;this.No(1),(i=ne.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"toolbar",s=>{if(s)return Ty.error("[Toolbar] Failed to load",s),void this.No(0);this.No(2),this.Fo(r)}),ot(A,"turbolinks:load",()=>{this.No(0),this.loadToolbar(r)})}return!0}Oo(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,n){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),n===void 0&&(n=void 0),this.maybeLoadToolbar(e,t,n)}}},QT=V({experiments:Ct},dd),ZT={conversations:class{constructor(e){this.Po=void 0,this._conversationsManager=null,this.Lo=!1,this.Do=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;xe(t)||(er(t)?this.Po=t:(this.Po=t.enabled,this.Do=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Po=void 0,this.Do=null}loadIfEnabled(){if(!(this._conversationsManager||this.Lo||this._instance.config.disable_conversations||_k(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=ne==null?void 0:ne.__PosthogExtensions__;if(e&&!J(this.Po)&&this.Po)if(this.Do&&this.Do.token){this.Lo=!0;try{var t=e.initConversations;if(t)return this.Bo(t),void(this.Lo=!1);var n=e.loadExternalDependency;if(!n)return void this.jo(vm);n(this._instance,"conversations",r=>{r||!e.initConversations?this.jo("Could not load conversations script",r):this.Bo(e.initConversations),this.Lo=!1})}catch(r){this.jo("Error initializing conversations",r),this.Lo=!1}}else xn.error("Conversations enabled but missing token in remote config.")}}Bo(e){if(this.Do)try{this._conversationsManager=e(this.Do,this._instance),xn.info("Conversations loaded successfully")}catch(t){this.jo("Error completing conversations initialization",t)}else xn.error("Cannot complete initialization: remote config is null")}jo(e,t){xn.error(e,t),this._conversationsManager=null,this.Lo=!1}show(){this._conversationsManager?this._conversationsManager.show():xn.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Po===!0&&!Tr(this._conversationsManager)}isVisible(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,n){var r=this;return An(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,n):(xn.warn(Ci),null)})()}getMessages(e,t){var n=this;return An(function*(){return n._conversationsManager?n._conversationsManager.getMessages(e,t):(xn.warn(Ci),null)})()}markAsRead(e){var t=this;return An(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(xn.warn(Ci),null)})()}getTickets(e){var t=this;return An(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(xn.warn(Ci),null)})()}requestRestoreLink(e){var t=this;return An(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(xn.warn(Ci),null)})()}restoreFromToken(e){var t=this;return An(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(xn.warn(Ci),null)})()}restoreFromUrlToken(){var e=this;return An(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(xn.warn(Ci),null)})()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}Kr(){var e;(e=this._conversationsManager)==null||e.setIdentity()}Qr(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},eM={logs:class{constructor(e){var t;this.qo=!1,this.Zo=!1,this.qt=Xe("[logs]"),this.$o=[],this.Vo=0,this.Ho=0,this.zo=!1,this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.qo=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,n=(t=e.logs)==null?void 0:t.captureConsoleLogs;!xe(n)&&n&&(this.qo=!0,this.loadIfEnabled())}reset(){this.$o=[],this.Ni&&(clearTimeout(this.Ni),this.Ni=void 0),this.Vo=0,this.Ho=0,this.zo=!1}loadIfEnabled(){if(this.qo&&!this.Zo){var e=ne==null?void 0:ne.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",n=>{var r;n||(r=e.logs)==null||!r.initializeLogs?this.qt.error("Could not load logs script",n):(e.logs.initializeLogs(this._instance),this.Zo=!0)}):this.qt.error(vm)}else this.qt.error("PostHog Extensions not found.")}}captureLog(e){var t,n,r,i,s,o;if(this._instance.is_capturing())if(e&&e.body){var a=(t=(n=this._instance.config.logs)==null?void 0:n.flushIntervalMs)!==null&&t!==void 0?t:3e3,l=(r=(i=this._instance.config.logs)==null?void 0:i.maxLogsPerInterval)!==null&&r!==void 0?r:1e3,c=Date.now();if(a>c-this.Ho||(this.Ho=c,this.Vo=0,this.zo=!1),l>this.Vo){this.Vo++;var u=function(d,f){var p=d.level||"info",{text:g,number:m}=Qk[p]||HT,y=String(Date.now())+"000000",x={};f.distinctId&&(x.posthogDistinctId=f.distinctId),f.sessionId&&(x.sessionId=f.sessionId),f.currentUrl&&(x["url.full"]=f.currentUrl),f.activeFeatureFlags&&f.activeFeatureFlags.length>0&&(x.feature_flags=f.activeFeatureFlags);var v=V({},x,d.attributes||{}),b={timeUnixNano:y,observedTimeUnixNano:y,severityNumber:m,severityText:g,body:{stringValue:d.body},attributes:Ly(v)};return d.trace_id&&(b.traceId=d.trace_id),d.span_id&&(b.spanId=d.span_id),J(d.trace_flags)||(b.flags=d.trace_flags),b}(e,this.Uo());this.$o.push({record:u}),((s=(o=this._instance.config.logs)==null?void 0:o.maxBufferSize)!==null&&s!==void 0?s:100)>this.$o.length?this.Yo():this.flushLogs()}else this.zo||(this.qt.warn("captureLog dropping logs: exceeded "+l+" logs per "+a+"ms"),this.zo=!0)}else this.qt.warn("captureLog requires a body")}get logger(){return this.Wo||(this.Wo={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Wo}flushLogs(e){if(this.Ni&&(clearTimeout(this.Ni),this.Ni=void 0),this.$o.length!==0){var t=this.$o;this.$o=[];var n=this._instance.config.logs,r=V({"service.name":(n==null?void 0:n.serviceName)||"unknown_service"},(n==null?void 0:n.environment)&&{"deployment.environment":n.environment},(n==null?void 0:n.serviceVersion)&&{"service.version":n.serviceVersion},n==null?void 0:n.resourceAttributes),i=function(o,a){return{resourceLogs:[{resource:{attributes:Ly(a)},scopeLogs:[{scope:{name:Lt.LIB_NAME},logRecords:o}]}]}}(t.map(o=>o.record),r),s=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.Pr({method:"POST",url:s,data:i,compression:"best-available",batchKey:"logs",transport:e})}}Yo(){var e,t;this.Ni||(this.Ni=setTimeout(()=>{this.Ni=void 0,this.flushLogs()},(e=(t=this._instance.config.logs)==null?void 0:t.flushIntervalMs)!==null&&e!==void 0?e:3e3))}Uo(){var e,t={lib:Lt.LIB_NAME};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=n}if(ne!=null&&(e=ne.location)!=null&&e.href&&(t.currentUrl=ne.location.href),this._instance.featureFlags){var r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}}},tM=V({},dd,VT,UT,qT,GT,KT,XT,YT,JT,QT,ZT,eM);wn.__defaultExtensionClasses=V({},tM);var Oy,eS=(Oy=_a[_s]=new wn,function(){function e(){e.done||(e.done=!0,Hk=!1,$e(_a,function(t){t._dom_loaded()}))}K!=null&&K.addEventListener?K.readyState==="complete"?e():ot(K,"DOMContentLoaded",e,{capture:!1}):A&&Y.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Oy);const nM="phc_wfkHziMastzp8Ca8aAN8am5P7Xp6iWf5oRyZzwrZiY4h";let tS=!1;function rM(){const e=nM;eS.init(e,{api_host:"https://us.i.posthog.com",capture_pageview:!1,persistence:"localStorage"}),tS=!0}function Mp(e,t){if(tS)try{eS.capture(e,t)}catch{}}const iM={cancel:"Cancel",save:"Save",saving:"Saving…",saved:"Saved",delete:"Delete",deleting:"deleting…",loading:"loading…",loadingEllipsis:"Loading…",back:"Back",close:"Close",add:"Add",adding:"Adding…",errorSave:"Error saving",errorCreate:"Error creating",errorReset:"Error resetting",errorGeneric:"Error",allFieldsRequired:"All fields are required",apiKeyRequired:"API key is required",tokenRequired:"Token is required",run:"Run",running:"Running…",replace:"Replace",noneYet:"None yet."},sM={systemPrefix:"system ",onlineSuffix:"online"},oM={loadingAgents:"loading agents…",getStartedWith:"Get started with",configureProviderBlurb:"Configure a provider and API key before creating agents.",configureProvider:"Configure provider",noProviderWarning:"No provider configured — agents can't run until you configure one.",configureArrow:"Configure →",title:"Agents",agentsCountOne:"{count} agent configured",agentsCountOther:"{count} agents configured",importing:"Importing…",import:"↥ Import",importTitle:"Import an agent from a granclaw export zip",importFailed:"Import failed",newAgent:"+ New Agent",cancel:"Cancel",createNewAgent:"Create new agent",agentIdPlaceholder:"agent-id (lowercase, no spaces)",displayNamePlaceholder:"Display name",workspacePlaceholder:"Workspace path (optional, default ./workspaces/{id})",workspacePlaceholderDefault:"agent-id",creating:"Creating…",create:"Create",noAgents:"No agents yet. Create one to get started.",delete:"Delete",deleteConfirm:`Delete agent "{name}" ({id})?
69
+
70
+ This will stop the agent and permanently delete its workspace, including all files, vault data, and conversation history.
71
+
72
+ This action cannot be undone.`},aM={backToAgent:"Back to agent",titleHighlight:"Provider",titleSuffix:"settings",blurb:"Configure AI providers. Each agent can use a different provider.",managedBlurb:"Preconfigured · includes free credits · read-only",noProvidersWarning:"No providers configured — agents won't respond until you add one.",removeConfirm:"Remove {name}? Agents using this provider will stop responding.",replaceKey:"Replace key",delete:"Remove",model:"Model",newApiKey:"New API key",pasteNewKey:"Paste new API key",addProvider:"Add provider",provider:"Provider",apiKey:"API key",pasteApiKey:"Paste your API key",added:"Added ✓",webSearch:"Web Search",braveBlurbPrefix:"Brave Search gives agents real web search capability.",configured:"Configured ✓",notConfigured:"Not configured — agents cannot search the web.",braveKeyLabel:"Brave Search API key",enterBraveKey:"Enter the Brave Search API key",braveManagedBlurb:"Web search is preconfigured for this workspace.",active:"Active ✓"},lM={loading:"loading…",emptyConversation:"Send a message to start the conversation…",roleUser:"you",roleAgentFallback:"agent",messagePlaceholder:"Message {name}…",stop:"Stop",send:"Send",live:"live",disconnected:"disconnected",executing:"Running {tool}…",toolCallsOne:"{count} tool call",toolCallsOther:"{count} tool calls",compactingContext:"Compacting context…",compactedContext:"Context compacted",pendingApproval:"⏳ Waiting for approval: {reason}",waitingApproval:"Waiting for approval",respondInGuardian:"Reply in the guardian panel →",wipeConfirm:`[DANGER] Wipe agent?
73
+
74
+ This will permanently delete:
75
+ • All chat history
76
+ • Claude session memory
77
+ • Workspace files
78
+
79
+ This action cannot be undone.`,guardian:"Guardian",comingSoon:"Coming soon",guardianBlurb1:"Configure a guardian agent to control what your main agent can do.",guardianBlurb2:"Define restrictions, block actions, and require approval before sensitive operations.",guardianChatBlurb:"Guardian chat.<br />Configure restrictions here.",guardianDisconnected:"○ disconnected",errorCreditLimit:"The API key has reached its spending limit. Top up credits or raise the key limit at your provider's dashboard.",errorRateLimit:"Rate limit exceeded. The provider is throttling requests — try again in a few seconds.",errorAuth:"Authentication failed. The API key may be invalid or expired — check Settings.",errorNoProvider:"No provider configured. Go to Settings to add a provider.",errorNoKey:"Provider API key missing. Go to Settings to reconfigure.",errorTimeout:"The agent took too long to respond. Try again or simplify your request.",errorGeneric:"Something went wrong: {message}"},cM={sessionExpiredLabel:"takeover",sessionExpired:"Session expired",sessionExpiredBlurb:"This takeover link has already been used or has expired.",completeLabel:"complete",controlReturned:"Control returned to agent",closeTab:"You can close this tab.",connecting:"connecting…",agentNeedsHelp:"The agent needs your help",liveLabel:"live",waitingStream:"waiting for browser stream…",browserStarting:"browser is starting — stream will begin once a page loads",browserNotReady:"browser is between pages — waiting for the next navigation",whatDidYouDo:"What did you do?",optional:"(optional)",describeActionPlaceholder:"Describe your action for the agent…",returning:"Returning…",completed:"Completed",urlBarPlaceholder:"Type a URL and press Enter to navigate…"},uM={title:"Skills",subtitle:"Skills your agent can invoke. User-invocable skills can be triggered from chat with /slash-commands.",empty:"No skills installed yet. Skills live in .pi/skills/ inside the agent workspace.",loading:"Loading skills…",selectSkill:"Select a skill on the left to see its full definition.",userInvocable:"user-invocable",allowedTools:"Allowed tools",loadError:"Could not load skill: {error}"},dM={columns:{backlog:"BACKLOG",inProgress:"IN PROGRESS",scheduled:"SCHEDULED",toReview:"TO REVIEW",done:"DONE",cancelled:"CANCELLED"},statusLabels:{backlog:"Backlog",inProgress:"In progress",scheduled:"Scheduled",toReview:"To review",done:"Done",cancelled:"Cancelled"},editedBy:"edited by {name}",relativeNow:"now",relativeMinutes:"{n}m ago",relativeHours:"{n}h ago",relativeDays:"{n}d ago",titlePlaceholder:"Task title…",descPlaceholder:"Description (markdown)…",add:"Add",cancel:"Cancel"},hM={saving:"saving…",close:"Close",status:"Status",sourceLabel:"source",editedByLabel:"edited by",created:"created",updated:"updated",description:"Description",descPlaceholder:"Add a description…",save:"Save",cancel:"Cancel",descEmpty:"No description — click to add",commentsLabel:"Comments ({count})",noComments:"No comments yet",addComment:"Add comment",commentPlaceholder:"Write a comment… (markdown supported)",publishComment:"Publish comment",publishing:"Publishing…",dangerZone:"Danger zone",deleteTask:"[DANGER] Delete task",deleting:"deleting…",deleteConfirm:'Delete task "{title}"? This action cannot be undone.'},fM={backToRuns:"← Back to runs",loading:"Loading…",waitingResponse:"Waiting for response…",triggering:"Starting…",runNow:"Run now",runHistory:"Run history",noRuns:"No runs yet.",loadingList:"Loading schedules…",emptyIcon:"⏰",emptyText:"No schedules yet. Ask the agent to set up recurring tasks.",title:"Schedules",activeCountOne:"{count} active",activeCountOther:"{count} active",next:"Next: {time}",last:"Last: {time}",pause:"Pause",resume:"Resume",delete:"Delete",deleteConfirm:'Delete schedule "{name}"?'},pM={title:"Workflows",emptyText:"No workflows yet. Ask the agent to create one via chat.",running:"Running…",run:"Run",createdOn:"{id} · Created {date}",back:"← Back to workflows",run_button:"Run",stepsTitle:"Steps ({count})",conditionsOne:"{count} condition",conditionsOther:"{count} conditions",stepType:"Type: {type}",stepTimeout:"Timeout: {seconds}s",stepId:"ID: {id}",runHistoryTitle:"Run history ({count})",noRuns:"No runs yet.",runStatus:{running:"running",completed:"completed",failed:"failed",cancelled:"cancelled"},newWorkflow:"New workflow",editWorkflow:"Edit workflow",edit:"Edit",delete:"Delete",cancel:"Cancel",save:"Save",saving:"Saving…",addStep:"Add step",addStepTitle:"Add step",editStepTitle:"Edit step",moveUp:"Move up",moveDown:"Move down",noSteps:'No steps yet. Click "Add step" to start building this workflow.',confirmDelete:'Delete workflow "{name}"? This cannot be undone.',confirmDeleteStep:'Delete step "{name}"?',formName:"Name",formNamePlaceholder:"Daily LinkedIn digest",formDescription:"Description",formDescriptionPlaceholder:"What does this workflow do?",formStatus:"Status",stepNameLabel:"Step name",stepNamePlaceholder:"Fetch latest posts",stepTypeLabel:"Type",stepScriptLabel:"Script",stepScriptPlaceholder:'echo "hello"',stepShellLabel:"Shell",stepTimeoutLabel:"Timeout (seconds)",stepPromptLabel:"Prompt",stepPromptPlaceholder:"Summarize the previous step output…",stepModelLabel:"Model (optional)",stepModelPlaceholder:"claude-sonnet-4-6"},gM={loading:"Loading run…",back:"← Back to workflow",runLabel:"Run —",errorPrefix:"Error:",input:"Input",output:"Output",activity:"Activity"},mM={loading:"Loading monitor…",title:"Monitor",idle:"idle",claudeSessionsOne:"{count} claude session",claudeSessionsOther:"{count} claude sessions",processes:"Processes",agentProcess:"Agent Process",guardianProcess:"Guardian (Big Brother)",browserDaemon:"Browser Daemon",activeClaudeSessions:"Active Claude Sessions — {count}",jobQueue:"Job queue — {processing} processing, {pending} pending",noActiveJobs:"No active jobs",processing:"processing",queued:"queued",terminate:"Terminate",cancel:"Cancel",runningWorkflows:"Running workflows",cpu:"CPU",mem:"MEM",rss:"RSS",uptime:"Uptime"},xM={title:"Integrations",blurb:"Connect external services. Each integration stores a token as a secret and activates automatically.",moreSoon:"More integrations coming soon. For other API keys and credentials, use the Secrets section in the sidebar.",connected:"Connected",disconnect:"Disconnect",connect:"Connect",saveAndConnect:"Save and connect",saving:"Saving…",cancel:"Cancel",newPrefix:"New {label}",pasteNewToken:"Paste the new token",updateToken:"Update token",rotateToken:"Rotate token",errorSave:"Error saving — check the console",disconnectConfirm:"Disconnect {name}? The agent will stop using it immediately.",telegramDescription:"Receive and reply to messages through a Telegram bot.",telegramHelp:"Create a bot via @BotFather on Telegram, then paste the token here.",telegramTokenLabel:"Bot token"},vM={loading:"Scanning sessions…",title:"Usage",totalTokens:"Total tokens",cachedSuffix:"{amount} cached",sessions:"Sessions",modelsCount:"{count} models",estCost:"Est. cost",periodDays:"{days} day period",avgDay:"Avg/Day",sessionsPerDay:"{count} sessions/day",dailyTokenUsage:"Daily token usage",noUsageData:"No usage data",dailyCost:"Daily estimated cost",noCostData:"No cost data",byModel:"By model",modelSessionsBlurb:"{sessions} sessions · {input} input · {output} output",tokenBreakdown:"Token breakdown",inputTokens:"Input tokens",outputTokens:"Output tokens",cacheRead:"Cache read",cacheWrite:"Cache write",toolInvocations:"Tool invocations",dailyBreakdown:"Daily breakdown",date:"Date",tableSessions:"Sessions",tableInput:"Input",tableOutput:"Output",tableCache:"Cache",tableCost:"Cost"},yM={searchPlaceholder:"Search logs…",apply:"Apply",live:"Live",loading:"loading…",noResults:'no results for "{query}"',noEntries:"no log entries",loadOlder:"Load {count} older entries…"},bM={views:{chat:"Chat",tasks:"Tasks",skills:"Skills",browser:"Browser",files:"Files",workflows:"Workflows",schedules:"Schedules",monitor:"Monitor",usage:"Usage",logs:"Logs",integrations:"Integrations",guardian:"Guardian"},comingSoon:"Soon",secrets:"Secrets",noSecrets:"No secrets configured",updating:"Updating {name}",newValue:"new value",save:"Save",secretNamePlaceholder:"NAME",secretValuePlaceholder:"value",guardrails:"Restrictions",guardrailsBlurb:"Configured via guardian chat",exportAgent:"📦 Export agent",exportTitle:"Download a full backup of the agent's workspace as a zip",wipeAgent:"🗑 Wipe agent",wiping:"wiping…"},_M={workspace:"workspace",savingLabel:"saving…",saveButton:"Save",emptyDir:"Empty directory"},wM={common:iM,shell:sM,dashboard:oM,settings:aM,chat:lM,takeover:cM,skillsView:uM,tasks:dM,taskDetail:hM,schedules:fM,workflows:pM,runDetail:gM,monitor:mM,integrations:xM,usage:vM,logs:yM,agentSettings:bM,files:_M},kM={cancel:"Cancelar",save:"Guardar",saving:"Guardando…",saved:"Guardado",delete:"Eliminar",deleting:"eliminando…",loading:"cargando…",loadingEllipsis:"Cargando…",back:"Volver",close:"Cerrar",add:"Agregar",adding:"Agregando…",errorSave:"Error al guardar",errorCreate:"Error al crear",errorReset:"Error al restablecer",errorGeneric:"Error",allFieldsRequired:"Todos los campos son requeridos",apiKeyRequired:"La clave API es requerida",tokenRequired:"El token es requerido",run:"Ejecutar",running:"Ejecutando…",replace:"Reemplazar",noneYet:"Sin entradas aún."},SM={systemPrefix:"sistema ",onlineSuffix:"en línea"},CM={loadingAgents:"cargando agentes…",getStartedWith:"Comenzar con",configureProviderBlurb:"Configura un proveedor y clave API antes de crear agentes.",configureProvider:"Configurar proveedor",noProviderWarning:"Sin proveedor configurado — los agentes no pueden ejecutarse hasta que configures uno.",configureArrow:"Configurar →",title:"Agentes",agentsCountOne:"{count} agente configurado",agentsCountOther:"{count} agentes configurados",importing:"Importando…",import:"↥ Importar",importTitle:"Importar un agente desde un zip exportado de granclaw",importFailed:"Importación fallida",newAgent:"+ Nuevo Agente",cancel:"Cancelar",createNewAgent:"Crear nuevo agente",agentIdPlaceholder:"id-agente (minúsculas, sin espacios)",displayNamePlaceholder:"Nombre de visualización",workspacePlaceholder:"Ruta del espacio de trabajo (opcional, por defecto ./workspaces/{id})",workspacePlaceholderDefault:"id-agente",creating:"Creando…",create:"Crear",noAgents:"Sin agentes aún. Crea uno para comenzar.",delete:"Eliminar",deleteConfirm:`¿Eliminar agente "{name}" ({id})?
80
+
81
+ Esto detendrá el agente y eliminará permanentemente su espacio de trabajo, incluyendo todos los archivos, datos del vault e historial de conversaciones.
82
+
83
+ Esta acción no se puede deshacer.`},EM={backToAgent:"Volver al agente",titleHighlight:"Configuración",titleSuffix:"de proveedor",blurb:"Configura proveedores de IA. Cada agente puede usar un proveedor diferente.",managedBlurb:"Preconfigurado · incluye créditos gratuitos · solo lectura",noProvidersWarning:"Sin proveedores configurados — los agentes no responderán hasta que agregues uno.",removeConfirm:"¿Eliminar {name}? Los agentes que usan este proveedor dejarán de responder.",replaceKey:"Reemplazar clave",delete:"Eliminar",model:"Modelo",newApiKey:"Nueva clave API",pasteNewKey:"Pega la nueva clave API",addProvider:"Agregar proveedor",provider:"Proveedor",apiKey:"Clave API",pasteApiKey:"Pega tu clave API",added:"Agregado ✓",webSearch:"Búsqueda Web",braveBlurbPrefix:"Brave Search otorga a los agentes capacidad de búsqueda web real.",configured:"Configurado ✓",notConfigured:"Sin configurar — los agentes no pueden buscar en la web.",braveKeyLabel:"Clave API de Brave Search",enterBraveKey:"Ingresa la clave API de Brave Search",braveManagedBlurb:"La búsqueda web está preconfigurada para este espacio de trabajo.",active:"Activo ✓"},NM={loading:"cargando…",emptyConversation:"Envía un mensaje para iniciar la conversación…",roleUser:"tú",roleAgentFallback:"agente",messagePlaceholder:"Mensaje a {name}…",stop:"Detener",send:"Enviar",live:"en vivo",disconnected:"desconectado",executing:"Ejecutando {tool}…",toolCallsOne:"{count} llamada a herramienta",toolCallsOther:"{count} llamadas a herramienta",compactingContext:"Compactando contexto…",compactedContext:"Contexto compactado",pendingApproval:"⏳ Esperando aprobación: {reason}",waitingApproval:"Esperando aprobación",respondInGuardian:"Responde en el panel guardián →",wipeConfirm:`[PELIGROSO] ¿Borrar agente?
84
+
85
+ Esto eliminará permanentemente:
86
+ • Todo el historial de chat
87
+ • Memoria de sesión de Claude
88
+ • Archivos del espacio de trabajo
89
+
90
+ Esta acción no se puede deshacer.`,guardian:"Guardián",comingSoon:"Próximamente",guardianBlurb1:"Configura un agente guardián para controlar lo que puede hacer tu agente principal.",guardianBlurb2:"Define restricciones, bloquea acciones y exige aprobación antes de operaciones sensibles.",guardianChatBlurb:"Chat del guardián.<br />Configura restricciones aquí.",guardianDisconnected:"○ desconectado",errorCreditLimit:"La clave API ha alcanzado su límite de gasto. Recarga créditos o aumenta el límite de la clave en el panel de tu proveedor.",errorRateLimit:"Límite de solicitudes excedido. El proveedor está limitando las peticiones — intenta de nuevo en unos segundos.",errorAuth:"Autenticación fallida. La clave API puede ser inválida o estar expirada — revisa Configuración.",errorNoProvider:"Sin proveedor configurado. Ve a Configuración para agregar uno.",errorNoKey:"Falta la clave API del proveedor. Ve a Configuración para reconfigurar.",errorTimeout:"El agente tardó demasiado en responder. Intenta de nuevo o simplifica tu solicitud.",errorGeneric:"Algo salió mal: {message}"},PM={sessionExpiredLabel:"toma de control",sessionExpired:"Sesión expirada",sessionExpiredBlurb:"Este enlace de toma de control ya fue usado o expiró.",completeLabel:"completo",controlReturned:"Control devuelto al agente",closeTab:"Puedes cerrar esta pestaña.",connecting:"conectando…",agentNeedsHelp:"El agente necesita tu ayuda",liveLabel:"en vivo",waitingStream:"esperando transmisión del navegador…",browserStarting:"iniciando el navegador — la transmisión comenzará cuando cargue una página",browserNotReady:"el navegador está entre páginas — esperando la próxima navegación",whatDidYouDo:"¿Qué hiciste?",optional:"(opcional)",describeActionPlaceholder:"Describe tu acción para el agente…",returning:"Devolviendo…",completed:"Completado",urlBarPlaceholder:"Escribe una URL y pulsa Intro para navegar…"},jM={title:"Habilidades",subtitle:"Habilidades que tu agente puede invocar. Las habilidades invocables por el usuario se pueden activar desde el chat con /barra-comando.",empty:"No hay habilidades instaladas todavía. Viven en .pi/skills/ dentro del workspace del agente.",loading:"Cargando habilidades…",selectSkill:"Selecciona una habilidad a la izquierda para ver su definición completa.",userInvocable:"invocable por usuario",allowedTools:"Herramientas permitidas",loadError:"No se pudo cargar la habilidad: {error}"},TM={columns:{backlog:"PENDIENTE",inProgress:"EN PROGRESO",scheduled:"PROGRAMADO",toReview:"EN REVISIÓN",done:"COMPLETADO",cancelled:"CANCELADO"},statusLabels:{backlog:"Pendiente",inProgress:"En progreso",scheduled:"Programado",toReview:"En revisión",done:"Completado",cancelled:"Cancelado"},editedBy:"editado por {name}",relativeNow:"ahora",relativeMinutes:"hace {n}m",relativeHours:"hace {n}h",relativeDays:"hace {n}d",titlePlaceholder:"Título de tarea…",descPlaceholder:"Descripción (markdown)…",add:"Agregar",cancel:"Cancelar"},MM={saving:"guardando…",close:"Cerrar",status:"Estado",sourceLabel:"fuente",editedByLabel:"editado por",created:"creado",updated:"actualizado",description:"Descripción",descPlaceholder:"Agregar una descripción…",save:"Guardar",cancel:"Cancelar",descEmpty:"Sin descripción — clic para agregar",commentsLabel:"Comentarios ({count})",noComments:"Sin comentarios aún",addComment:"Agregar comentario",commentPlaceholder:"Escribe un comentario… (markdown soportado)",publishComment:"Publicar comentario",publishing:"Publicando…",dangerZone:"Zona peligrosa",deleteTask:"[PELIGROSO] Eliminar tarea",deleting:"eliminando…",deleteConfirm:'¿Eliminar tarea "{title}"? Esta acción no se puede deshacer.'},RM={backToRuns:"← Volver a ejecuciones",loading:"Cargando…",waitingResponse:"Esperando respuesta…",triggering:"Iniciando…",runNow:"Ejecutar ahora",runHistory:"Historial de ejecuciones",noRuns:"Sin ejecuciones aún.",loadingList:"Cargando programados…",emptyIcon:"⏰",emptyText:"Sin programados aún. Pídele al agente que configure tareas recurrentes.",title:"Programados",activeCountOne:"{count} activo",activeCountOther:"{count} activos",next:"Próximo: {time}",last:"Último: {time}",pause:"Pausar",resume:"Reanudar",delete:"Eliminar",deleteConfirm:'¿Eliminar programado "{name}"?'},DM={title:"Flujos de trabajo",emptyText:"Sin flujos de trabajo aún. Pídele al agente que cree uno via chat.",running:"Ejecutando…",run:"Ejecutar",createdOn:"{id} · Creado {date}",back:"← Volver a flujos",run_button:"Ejecutar",stepsTitle:"Pasos ({count})",conditionsOne:"{count} condición",conditionsOther:"{count} condiciones",stepType:"Tipo: {type}",stepTimeout:"Límite de tiempo: {seconds}s",stepId:"ID: {id}",runHistoryTitle:"Historial de ejecuciones ({count})",noRuns:"Sin ejecuciones aún.",runStatus:{running:"en ejecución",completed:"completado",failed:"fallido",cancelled:"cancelado"},newWorkflow:"Nuevo flujo",editWorkflow:"Editar flujo",edit:"Editar",delete:"Eliminar",cancel:"Cancelar",save:"Guardar",saving:"Guardando…",addStep:"Añadir paso",addStepTitle:"Añadir paso",editStepTitle:"Editar paso",moveUp:"Subir",moveDown:"Bajar",noSteps:'Aún no hay pasos. Haz clic en "Añadir paso" para empezar.',confirmDelete:'¿Eliminar el flujo "{name}"? Esto no se puede deshacer.',confirmDeleteStep:'¿Eliminar el paso "{name}"?',formName:"Nombre",formNamePlaceholder:"Resumen diario de LinkedIn",formDescription:"Descripción",formDescriptionPlaceholder:"¿Qué hace este flujo?",formStatus:"Estado",stepNameLabel:"Nombre del paso",stepNamePlaceholder:"Recoger últimas publicaciones",stepTypeLabel:"Tipo",stepScriptLabel:"Script",stepScriptPlaceholder:'echo "hola"',stepShellLabel:"Shell",stepTimeoutLabel:"Tiempo límite (segundos)",stepPromptLabel:"Prompt",stepPromptPlaceholder:"Resume la salida del paso anterior…",stepModelLabel:"Modelo (opcional)",stepModelPlaceholder:"claude-sonnet-4-6"},AM={loading:"Cargando ejecución…",back:"← Volver al flujo",runLabel:"Ejecución —",errorPrefix:"Error:",input:"Entrada",output:"Salida",activity:"Actividad"},IM={loading:"Cargando monitor…",title:"Monitor",idle:"inactivo",claudeSessionsOne:"{count} sesión claude",claudeSessionsOther:"{count} sesiones claude",processes:"Procesos",agentProcess:"Proceso del Agente",guardianProcess:"Guardián (Big Brother)",browserDaemon:"Demonio de Navegador",activeClaudeSessions:"Sesiones Claude Activas — {count}",jobQueue:"Cola de trabajos — {processing} en proceso, {pending} en espera",noActiveJobs:"Sin trabajos activos",processing:"procesando",queued:"en cola",terminate:"Terminar",cancel:"Cancelar",runningWorkflows:"Flujos de trabajo en ejecución",cpu:"CPU",mem:"MEM",rss:"RSS",uptime:"Tiempo activo"},LM={title:"Integraciones",blurb:"Conecta servicios externos. Cada integración almacena un token como secreto y se activa automáticamente.",moreSoon:"Más integraciones próximamente. Para otras claves API y credenciales, usa la sección de Secretos en la barra lateral.",connected:"Conectado",disconnect:"Desconectar",connect:"Conectar",saveAndConnect:"Guardar y conectar",saving:"Guardando…",cancel:"Cancelar",newPrefix:"Nuevo {label}",pasteNewToken:"Pega el nuevo token",updateToken:"Actualizar token",rotateToken:"Rotar token",errorSave:"Error al guardar — revisa la consola",disconnectConfirm:"¿Desconectar {name}? El agente dejará de usarlo inmediatamente.",telegramDescription:"Recibe y responde mensajes a través de un bot de Telegram.",telegramHelp:"Crea un bot mediante @BotFather en Telegram, luego pega el token aquí.",telegramTokenLabel:"Token del bot"},OM={loading:"Escaneando sesiones…",title:"Uso",totalTokens:"Tokens totales",cachedSuffix:"{amount} en caché",sessions:"Sesiones",modelsCount:"{count} modelos",estCost:"Costo est.",periodDays:"Período de {days} días",avgDay:"Prom/Día",sessionsPerDay:"{count} sesiones/día",dailyTokenUsage:"Uso diario de tokens",noUsageData:"Sin datos de uso",dailyCost:"Costo estimado diario",noCostData:"Sin datos de costo",byModel:"Por modelo",modelSessionsBlurb:"{sessions} sesiones · {input} entrada · {output} salida",tokenBreakdown:"Desglose de tokens",inputTokens:"Tokens de entrada",outputTokens:"Tokens de salida",cacheRead:"Lectura de caché",cacheWrite:"Escritura de caché",toolInvocations:"Invocaciones de herramientas",dailyBreakdown:"Desglose diario",date:"Fecha",tableSessions:"Sesiones",tableInput:"Entrada",tableOutput:"Salida",tableCache:"Caché",tableCost:"Costo"},FM={searchPlaceholder:"Buscar registros…",apply:"Aplicar",live:"En vivo",loading:"cargando…",noResults:'sin resultados para "{query}"',noEntries:"sin entradas de registro",loadOlder:"Cargar {count} entradas anteriores…"},$M={views:{chat:"Chat",tasks:"Tareas",skills:"Habilidades",browser:"Navegador",files:"Archivos",workflows:"Flujos de trabajo",schedules:"Programados",monitor:"Monitor",usage:"Uso",logs:"Registros",integrations:"Integraciones",guardian:"Guardián"},comingSoon:"Pronto",secrets:"Secretos",noSecrets:"Sin secretos configurados",updating:"Actualizando {name}",newValue:"nuevo valor",save:"Guardar",secretNamePlaceholder:"NOMBRE",secretValuePlaceholder:"valor",guardrails:"Restricciones",guardrailsBlurb:"Configurado via chat guardián",exportAgent:"📦 Exportar agente",exportTitle:"Descargar una copia de seguridad completa del espacio de trabajo del agente como zip",wipeAgent:"🗑 Borrar agente",wiping:"borrando…"},zM={workspace:"espacio-de-trabajo",savingLabel:"guardando…",saveButton:"Guardar",emptyDir:"Directorio vacío"},BM={common:kM,shell:SM,dashboard:CM,settings:EM,chat:NM,takeover:PM,skillsView:jM,tasks:TM,taskDetail:MM,schedules:RM,workflows:DM,runDetail:AM,monitor:IM,integrations:LM,usage:OM,logs:FM,agentSettings:$M,files:zM},Fy={en:wM,es:BM},nS="granclaw:lang";function WM(){if(typeof window>"u")return"en";try{const t=window.localStorage.getItem(nS);if(t==="en"||t==="es")return t}catch{}return(typeof navigator<"u"?navigator.language:"").toLowerCase().startsWith("es")?"es":"en"}function $y(e,t){const n=t.split(".");let r=e;for(const i of n)if(r&&typeof r=="object"&&i in r)r=r[i];else return;return typeof r=="string"?r:void 0}function HM(e,t){return t?e.replace(/\{(\w+)\}/g,(n,r)=>{const i=t[r];return i==null?`{${r}}`:String(i)}):e}const rS=E.createContext(null);function VM({children:e}){const[t,n]=E.useState(()=>WM()),r=E.useCallback(o=>{n(o);try{window.localStorage.setItem(nS,o)}catch{}},[]);E.useEffect(()=>{try{document.documentElement.lang=t}catch{}},[t]);const i=E.useCallback((o,a)=>{const l=Fy[t],c=$y(l,o)??$y(Fy.en,o)??o;return HM(c,a)},[t]),s=E.useMemo(()=>({lang:t,setLang:r,t:i}),[t,r,i]);return h.jsx(rS.Provider,{value:s,children:e})}function we(){const e=E.useContext(rS);if(!e)throw new Error("useT must be used inside <LanguageProvider>");return e}function UM({className:e}){const{lang:t,setLang:n}=we();return h.jsx("div",{className:`flex items-center gap-0.5 rounded-full bg-surface-container/40 p-[2px] ${e??""}`,children:["en","es"].map(r=>h.jsx("button",{onClick:()=>n(r),className:`px-2 py-[2px] rounded-full text-[10px] font-mono uppercase tracking-wider transition-colors ${t===r?"bg-primary/30 text-primary":"text-on-surface-variant/70 hover:text-on-surface"}`,"aria-pressed":t===r,children:r},r))})}function qM(){const e=ss(),t=os(),n=e.pathname.includes("/chat"),{t:r}=we();return h.jsxs("div",{className:"flex h-screen flex-col overflow-hidden bg-surface",children:[h.jsxs("header",{className:"flex h-11 flex-shrink-0 items-center justify-between border-b border-outline-variant/20 bg-surface-low px-3 sm:px-5",children:[h.jsxs("button",{onClick:()=>t("/dashboard"),className:"flex items-center gap-2 hover:opacity-80 transition-opacity min-w-0",children:[h.jsx("img",{src:"/granclaw-logo.png",alt:"GranClaw",className:"h-6 w-6 rounded flex-shrink-0"}),h.jsx("span",{className:"font-display font-semibold text-on-surface tracking-tight truncate",children:"GranClaw"}),h.jsxs("span",{className:"text-xs font-mono text-on-surface/60 flex-shrink-0",children:["v","0.0.1-beta.96"]})]}),h.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[h.jsx(UM,{}),h.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-secondary-container/20 px-2 sm:px-3 py-1 text-xs font-mono text-secondary flex-shrink-0",children:[h.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-secondary animate-pulse flex-shrink-0"}),h.jsx("span",{className:"hidden sm:inline",children:r("shell.systemPrefix")}),r("shell.onlineSuffix")]})]})]}),h.jsx("main",{className:`flex-1 overflow-auto min-w-0 ${n?"":"p-3 sm:p-5"}`,children:h.jsx(Wj,{})})]})}const se="";async function zy(){const e=await fetch(`${se}/agents`);if(!e.ok)throw new Error(`fetchAgents: ${e.status}`);return e.json()}async function GM(e,t,n,r,i){const s=await fetch(`${se}/agents`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,name:t,model:n,provider:r,...i?{workspaceDir:i}:{}})});if(!s.ok){const o=await s.json().catch(()=>({error:s.statusText}));throw new Error(o.error)}}async function KM(e){const t=await fetch(`${se}/agents/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(`deleteAgent: ${t.status}`)}async function By(e){const t=await fetch(`${se}/agents/${e}`);if(!t.ok)throw new Error(`fetchAgent: ${t.status}`);return t.json()}async function Wy(e,t="ui"){const n=await fetch(`${se}/agents/${e}/messages?channelId=${t}&sortBy=desc&limit=200`,{cache:"no-store"});if(!n.ok)throw new Error(`fetchMessages: ${n.status}`);return(await n.json()).reverse()}async function YM(e){const t=await fetch(`${se}/agents/${e}/reset`,{method:"DELETE"});if(!t.ok)throw new Error(`resetAgent: ${t.status}`)}async function XM(e,t=""){const n=await fetch(`${se}/agents/${e}/files?path=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(`fetchFiles: ${n.status}`);return(await n.json()).entries}async function JM(e,t){const n=await fetch(`${se}/agents/${e}/files/read?path=${encodeURIComponent(t)}`);if(!n.ok)throw new Error(`readFile: ${n.status}`);return(await n.json()).content}async function QM(e,t,n){const r=await fetch(`${se}/agents/${e}/files/write?path=${encodeURIComponent(t)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n})});if(!r.ok)throw new Error(`writeFile: ${r.status}`)}async function ZM(e){const t=await fetch(`${se}/agents/${e}/secrets`);if(!t.ok)throw new Error(`fetchSecrets: ${t.status}`);return t.json()}async function Rp(e,t,n){const r=await fetch(`${se}/agents/${e}/secrets`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,value:n})});if(!r.ok)throw new Error(`addSecret: ${r.status}`)}async function iS(e,t){const n=await fetch(`${se}/agents/${e}/secrets/${encodeURIComponent(t)}`,{method:"DELETE"});if(!n.ok)throw new Error(`deleteSecret: ${n.status}`)}async function eR(e){const t=await fetch(`${se}/agents/${e}/skills`);if(!t.ok)throw new Error(`fetchSkills: ${t.status}`);return(await t.json()).skills}async function tR(e,t){const n=t.split("/").map(encodeURIComponent).join("/"),r=await fetch(`${se}/agents/${e}/skills/${n}`);if(!r.ok)throw new Error(`fetchSkillDetail: ${r.status}`);return r.json()}async function nR(e,t){const r=await fetch(`${se}/agents/${e}/tasks`);if(!r.ok)throw new Error(`fetchTasks: ${r.status}`);return r.json()}async function rR(e,t){const n=await fetch(`${se}/agents/${e}/tasks/${t}`);if(!n.ok)throw new Error(`fetchTask: ${n.status}`);return n.json()}async function iR(e,t){const n=await fetch(`${se}/agents/${e}/tasks`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(`createTask: ${n.status}`);return n.json()}async function Hy(e,t,n){const r=await fetch(`${se}/agents/${e}/tasks/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(`updateTask: ${r.status}`);return r.json()}async function sR(e,t){const n=await fetch(`${se}/agents/${e}/tasks/${t}`,{method:"DELETE"});if(!n.ok)throw new Error(`deleteTask: ${n.status}`)}async function oR(e,t,n){const r=await fetch(`${se}/agents/${e}/tasks/${t}/comments`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:n})});if(!r.ok)throw new Error(`addTaskComment: ${r.status}`);return r.json()}async function aR(e){const t=await fetch(`${se}/agents/${e}/browser-sessions`);if(!t.ok)throw new Error(`fetchBrowserSessions: ${t.status}`);return t.json()}async function sS(e,t){const n=await fetch(`${se}/agents/${e}/browser-sessions/${t}`);if(!n.ok)throw new Error(`fetchBrowserSession: ${n.status}`);return n.json()}function lR(e,t){return`${se}/agents/${e}/browser-sessions/${t}/video`}function oS(e,t){const n=window.location;return`${n.protocol==="https:"?"wss:":"ws:"}//${n.host}/browser-live/${e}/${t}`}function cR(e){return`${se}/agents/${e}/export`}async function Vy(e,t){const n=new URL(`${se}/agents/import`,window.location.origin);t!=null&&t.id&&n.searchParams.set("id",t.id);const r=await fetch(n.toString().replace(window.location.origin,""),{method:"POST",headers:{"Content-Type":"application/zip"},body:e});if(!r.ok){const i=await r.json().catch(()=>({error:r.statusText}));throw new Error(i.error)}return r.json()}async function Uy(e,t){const n=await fetch(`${se}/agents/${e}/monitor/jobs/${t}`,{method:"DELETE"});if(!n.ok)throw new Error(`killJob: ${n.status}`)}async function uR(e){const t=await fetch(`${se}/agents/${e}/monitor`);if(!t.ok)throw new Error(`fetchMonitor: ${t.status}`);return t.json()}async function dR(e,t=30){const n=await fetch(`${se}/agents/${e}/usage?days=${t}`);if(!n.ok)throw new Error(`fetchUsage: ${n.status}`);return n.json()}async function hR(e){const t=await fetch(`${se}/agents/${e}/schedules`);if(!t.ok)throw new Error(`fetchSchedules: ${t.status}`);return t.json()}async function fR(e,t,n){const r=await fetch(`${se}/agents/${e}/schedules/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(`updateSchedule: ${r.status}`);return r.json()}async function pR(e,t){const n=await fetch(`${se}/agents/${e}/schedules/${t}`,{method:"DELETE"});if(!n.ok)throw new Error(`deleteSchedule: ${n.status}`)}async function gR(e,t){const n=await fetch(`${se}/agents/${e}/schedules/${t}/trigger`,{method:"POST"});if(!n.ok)throw new Error(`triggerSchedule: ${n.status}`);return n.json()}async function mR(e,t){const n=await fetch(`${se}/agents/${e}/schedules/${t}/runs`);if(!n.ok)throw new Error(`fetchScheduleRuns: ${n.status}`);return n.json()}async function xR(e,t){const n=await fetch(`${se}/agents/${e}/messages?channelId=${encodeURIComponent(t)}&sortBy=asc&limit=200`);if(!n.ok)throw new Error(`fetchScheduleRunMessages: ${n.status}`);return n.json()}async function vR(e){const t=await fetch(`${se}/agents/${e}/workflows`);if(!t.ok)throw new Error(`fetchWorkflows: ${t.status}`);return t.json()}async function qy(e,t){const n=await fetch(`${se}/agents/${e}/workflows/${t}`);if(!n.ok)throw new Error(`fetchWorkflow: ${n.status}`);return n.json()}async function kh(e,t){const n=await fetch(`${se}/agents/${e}/workflows/${t}/runs`);if(!n.ok)throw new Error(`fetchWorkflowRuns: ${n.status}`);return n.json()}async function yR(e,t,n){const r=await fetch(`${se}/agents/${e}/workflows/${t}/runs/${n}`);if(!r.ok)throw new Error(`fetchWorkflowRun: ${r.status}`);return r.json()}async function bR(e,t){const n=await fetch(`${se}/agents/${e}/workflows/${t}/run`,{method:"POST"});if(!n.ok)throw new Error(`triggerWorkflowRun: ${n.status}`);return n.json()}async function _R(e,t){const n=await fetch(`${se}/agents/${e}/workflows`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(`createWorkflow: ${n.status}`);return n.json()}async function wR(e,t,n){const r=await fetch(`${se}/agents/${e}/workflows/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(`updateWorkflow: ${r.status}`);return r.json()}async function kR(e,t){const n=await fetch(`${se}/agents/${e}/workflows/${t}`,{method:"DELETE"});if(!n.ok)throw new Error(`deleteWorkflow: ${n.status}`)}async function SR(e,t,n){const r=await fetch(`${se}/agents/${e}/workflows/${t}/steps`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(`createStep: ${r.status}`);return r.json()}async function Sh(e,t,n,r){const i=await fetch(`${se}/agents/${e}/workflows/${t}/steps/${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok)throw new Error(`updateStep: ${i.status}`);return i.json()}async function CR(e,t,n){const r=await fetch(`${se}/agents/${e}/workflows/${t}/steps/${n}`,{method:"DELETE"});if(!r.ok)throw new Error(`deleteStep: ${r.status}`)}async function ER(e){const t=new URLSearchParams;e!=null&&e.agentId&&t.set("agentId",e.agentId),e!=null&&e.type&&t.set("type",e.type),e!=null&&e.search&&t.set("search",e.search),(e==null?void 0:e.limit)!=null&&t.set("limit",String(e.limit)),(e==null?void 0:e.offset)!=null&&t.set("offset",String(e.offset));const n=await fetch(`${se}/logs?${t}`);if(!n.ok)throw new Error(`fetchLogs: ${n.status}`);return n.json()}async function aS(){const e=await fetch(`${se}/settings/provider`);if(!e.ok)throw new Error("Failed to fetch provider settings");return e.json()}const Ch={showWorkspaceDirConfig:!0,showBraveSearchConfig:!0,enableIntegrations:!1};async function lS(){try{const e=await fetch(`${se}/settings/app`);if(!e.ok)return{...Ch};const t=await e.json();return{...Ch,...t}}catch{return{...Ch}}}async function Gy(e,t,n){if(!(await fetch(`${se}/settings/provider`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,model:t,apiKey:n})})).ok)throw new Error("Failed to save provider settings")}async function NR(e){if(!(await fetch(`${se}/settings/providers/${encodeURIComponent(e)}`,{method:"DELETE"})).ok)throw new Error("Failed to remove provider")}async function PR(){const e=await fetch(`${se}/settings/search`);return e.ok?e.json():{provider:"brave",configured:!1}}async function jR(e,t){const n=await fetch(`${se}/settings/search`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t})});if(!n.ok)throw new Error(`Failed to save search settings: ${n.status}`)}async function TR(){const e=await fetch(`${se}/settings/search`,{method:"DELETE"});if(!e.ok&&e.status!==204&&e.status!==404)throw new Error(`Failed to clear search settings: ${e.status}`)}const MR={google:[{value:"gemini-2.5-flash",label:"Gemini 2.5 Flash — fast + smart (recommended)"},{value:"gemini-2.5-pro",label:"Gemini 2.5 Pro — most capable"},{value:"gemini-2.5-flash-lite",label:"Gemini 2.5 Flash Lite — cheapest"},{value:"gemini-3-flash-preview",label:"Gemini 3 Flash — preview"},{value:"gemini-3.1-pro-preview",label:"Gemini 3.1 Pro — preview"}],openai:[{value:"gpt-4.1",label:"GPT-4.1 — recommended, 1M ctx"},{value:"gpt-4.1-mini",label:"GPT-4.1 Mini — fast, efficient"},{value:"gpt-4.1-nano",label:"GPT-4.1 Nano — cheapest"}],anthropic:[{value:"claude-sonnet-4-6",label:"Claude Sonnet 4.6 — recommended"},{value:"claude-opus-4-6",label:"Claude Opus 4.6 — most capable"},{value:"claude-haiku-4-5-20251001",label:"Claude Haiku 4.5 — fastest"}],groq:[{value:"openai/gpt-oss-120b",label:"GPT-OSS 120B — flagship, ~500 tok/s"},{value:"openai/gpt-oss-20b",label:"GPT-OSS 20B — fast, efficient"},{value:"llama-3.3-70b-versatile",label:"Llama 3.3 70B — versatile"},{value:"llama-3.1-8b-instant",label:"Llama 3.1 8B — fastest/cheapest"}],openrouter:[{value:"google/gemini-2.5-flash",label:"Gemini 2.5 Flash — best price/perf ($0.30/$2.50 /M)"},{value:"google/gemini-3-flash-preview",label:"Gemini 3 Flash — fast, 1M ctx ($0.50/$3 /M)"},{value:"google/gemini-3.1-pro-preview",label:"Gemini 3.1 Pro — frontier ($2/$12 /M)"},{value:"deepseek/deepseek-v3.2",label:"DeepSeek V3.2 — cheap output ($0.26/$0.38 /M)"},{value:"xiaomi/mimo-v2-pro",label:"MiMo V2 Pro — agentic, 1T params ($1/$3 /M)"},{value:"qwen/qwen3.6-plus",label:"Qwen 3.6 Plus — throughput leader ($0.33/$1.95 /M)"},{value:"minimax/minimax-m2.7",label:"MiniMax M2.7 — agentic ($0.30/$1.20 /M)"},{value:"x-ai/grok-4",label:"Grok 4 — reasoning, 256k ctx ($3/$15 /M)"}],freetier:[{value:"z-ai/glm-5-turbo",label:"GLM 5 Turbo — enterprise default"}]},cS=[{value:"google",label:"Google Gemini"},{value:"openai",label:"OpenAI"},{value:"anthropic",label:"Anthropic"},{value:"groq",label:"Groq"},{value:"openrouter",label:"OpenRouter"}];function hd(e){return MR[e]??[]}function Dp(e){var t;return((t=hd(e)[0])==null?void 0:t.value)??""}const Ui="inline-flex items-center justify-center gap-2 bg-primary text-on-primary px-5 py-2.5 text-sm font-label font-semibold uppercase tracking-widest rounded shadow-sm transition-all hover:bg-surface-tint hover:shadow-md active:scale-[0.98] disabled:opacity-40 disabled:pointer-events-none",Cm="inline-flex items-center justify-center gap-2 border border-outline-variant text-on-surface px-5 py-2.5 text-sm font-label font-semibold uppercase tracking-widest rounded transition-all hover:bg-surface-container hover:border-outline active:scale-[0.98] disabled:opacity-40 disabled:pointer-events-none",qr="inline-flex items-center justify-center gap-1.5 text-on-surface-variant px-2.5 py-1.5 text-xs font-label font-medium uppercase tracking-wider rounded transition-colors hover:bg-surface-container hover:text-on-surface disabled:opacity-40 disabled:pointer-events-none",Ap="inline-flex items-center justify-center gap-1.5 text-error px-2.5 py-1.5 text-xs font-label font-medium uppercase tracking-wider rounded transition-colors hover:bg-error/10 disabled:opacity-40 disabled:pointer-events-none",an="w-full bg-surface-container-lowest text-on-surface placeholder:text-on-surface-variant border border-outline-variant rounded-lg px-3 py-2 text-sm focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",Ip=an.replace("text-sm","text-sm font-mono"),nl="bg-surface-container-lowest border border-outline-variant/40 rounded-xl shadow-callout",Gs="inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-label font-medium uppercase tracking-wider",jc=`${Gs} bg-surface-container border border-outline-variant/40 text-on-surface-variant`,Lp=`${Gs} bg-success/10 border border-success/20 text-success`,Ky=`${Gs} bg-warning/10 border border-warning/20 text-warning`;function RR({agent:e,onDelete:t}){const n=os(),{t:r}=we(),i=e.status==="active",s=e.busy===!0;return h.jsxs("div",{onClick:()=>n(`/agents/${e.id}/chat`),className:"group flex items-center gap-4 rounded-xl bg-surface-container-lowest border border-outline-variant/40 p-4 cursor-pointer transition-all hover:border-primary/40 hover:shadow-callout",children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx("span",{className:"font-headline text-lg font-bold text-on-surface",children:e.name}),s?h.jsxs("span",{"data-testid":"busy-badge",className:"inline-flex items-center gap-1 rounded-full bg-secondary/15 border border-secondary/30 px-2 py-0.5 text-[10px] font-label font-semibold uppercase tracking-wider text-secondary",children:[h.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-secondary animate-pulse"}),"busy"]}):h.jsx("span",{className:i?Lp:jc,children:e.status})]}),h.jsxs("div",{className:"flex items-center gap-3 mt-1",children:[h.jsx("span",{className:"font-mono text-[10px] text-primary/70",children:e.model}),h.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant/60 hidden sm:inline",children:["id: ",e.id]})]})]}),h.jsx("div",{className:"flex items-center gap-2 flex-shrink-0",children:h.jsx("button",{onClick:o=>{o.stopPropagation(),t()},className:`${Ap} sm:opacity-0 sm:group-hover:opacity-100`,children:r("dashboard.delete")})})]})}function DR(){const{t:e}=we(),[t,n]=E.useState([]),[r,i]=E.useState(!0),[s,o]=E.useState(null),[a,l]=E.useState({showWorkspaceDirConfig:!0,showBraveSearchConfig:!0,enableIntegrations:!1}),[c,u]=E.useState(!1),[d,f]=E.useState(""),[p,g]=E.useState(""),[m,y]=E.useState(""),[x,v]=E.useState(""),[b,S]=E.useState(""),[k,_]=E.useState(!1),[C,P]=E.useState(!1),[j,w]=E.useState(null),M=E.useRef(null);async function D(N){var te,T;const Q=(te=N.target.files)==null?void 0:te[0];if(Q){P(!0),w(null);try{let re;try{re=await Vy(Q)}catch(le){const ae=le instanceof Error?le.message:String(le);if(ae.includes("already exists")){const R=(T=prompt(`${ae}
91
+
92
+ Enter a new id for the imported agent:`,""))==null?void 0:T.trim();if(!R){P(!1);return}re=await Vy(Q,{id:R})}else throw le}await F(),$(`/agents/${re.id}/chat`)}catch(re){w(re instanceof Error?re.message:e("dashboard.importFailed"))}finally{P(!1),M.current&&(M.current.value="")}}}const F=()=>{Promise.all([zy(),aS(),lS()]).then(([N,Q,te])=>{var T;if(n(N),o(Q),l(te),!m){const re=(T=Q.providers)==null?void 0:T[0];re&&(y(re.provider),v(re.model))}}).catch(console.error).finally(()=>i(!1))};E.useEffect(()=>{F();const N=setInterval(()=>{zy().then(n).catch(()=>{})},2e3);return()=>clearInterval(N)},[]);const $=os(),I=(s==null?void 0:s.providers)??[],H=m?hd(m):[];function X(N){y(N),v(Dp(N))}async function L(){if(!(!d.trim()||!p.trim())){_(!0),w(null);try{const N=d.trim();await GM(N,p.trim(),x,m||void 0,b.trim()||void 0),$(`/agents/${N}/chat`)}catch(N){w(N instanceof Error?N.message:e("common.errorCreate")),_(!1)}}}async function B(N,Q){confirm(e("dashboard.deleteConfirm",{name:Q,id:N}))&&(await KM(N),F())}return r?h.jsx("div",{className:"font-mono text-xs text-on-surface-variant p-8",children:e("dashboard.loadingAgents")}):s&&!s.configured&&t.length===0?h.jsx("div",{className:"max-w-3xl mx-auto py-16 px-4",children:h.jsxs("div",{className:"text-center",children:[h.jsxs("h1",{className:"font-headline text-4xl font-bold text-on-surface mb-4",children:[e("dashboard.getStartedWith")," ",h.jsx("span",{className:"highlight-marker",children:"GranClaw"})]}),h.jsx("p",{className:"font-mono text-xs text-on-surface-variant mb-8",children:e("dashboard.configureProviderBlurb")}),h.jsx(Sv,{to:"/settings",className:Ui,children:e("dashboard.configureProvider")})]})}):h.jsxs("div",{className:"max-w-4xl mx-auto py-6 sm:py-8 px-4",children:[s&&!s.configured&&h.jsxs("div",{className:"rounded-xl bg-warning/10 border border-warning/30 px-4 py-3 mb-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[h.jsx("p",{className:"font-mono text-[11px] text-warning",children:e("dashboard.noProviderWarning")}),h.jsx(Sv,{to:"/settings",className:"font-label text-[11px] font-semibold uppercase tracking-widest text-primary hover:text-surface-tint flex-shrink-0",children:e("dashboard.configureArrow")})]}),h.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4 mb-6 sm:mb-8",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"font-headline text-3xl sm:text-4xl font-bold text-on-surface",children:e("dashboard.title")}),h.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant mt-1",children:e(t.length===1?"dashboard.agentsCountOne":"dashboard.agentsCountOther",{count:t.length})})]}),h.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[h.jsx("input",{ref:M,type:"file",accept:".zip,application/zip",onChange:D,className:"hidden"}),h.jsx("button",{onClick:()=>{var N;return(N=M.current)==null?void 0:N.click()},disabled:C||!(s!=null&&s.configured),className:Cm,title:e("dashboard.importTitle"),children:e(C?"dashboard.importing":"dashboard.import")}),h.jsx("button",{onClick:()=>u(N=>!N),disabled:!(s!=null&&s.configured),className:Ui,children:e(c?"dashboard.cancel":"dashboard.newAgent")})]})]}),c&&h.jsxs("div",{className:`${nl} p-5 mb-6 space-y-3`,children:[h.jsx("p",{className:"font-label text-[10px] font-semibold uppercase tracking-widest text-on-surface-variant",children:e("dashboard.createNewAgent")}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[h.jsx("input",{className:Ip,placeholder:e("dashboard.agentIdPlaceholder"),value:d,onChange:N=>f(N.target.value.toLowerCase().replace(/[^a-z0-9-]/g,""))}),h.jsx("input",{className:an,placeholder:e("dashboard.displayNamePlaceholder"),value:p,onChange:N=>g(N.target.value)})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:[h.jsx("select",{className:`${an} appearance-none`,value:m,onChange:N=>X(N.target.value),children:I.map(N=>h.jsx("option",{value:N.provider,children:N.label??N.provider},N.provider))}),h.jsx("select",{className:`${an} appearance-none`,value:x,onChange:N=>v(N.target.value),children:H.map(N=>h.jsx("option",{value:N.value,children:N.label},N.value))})]}),a.showWorkspaceDirConfig&&h.jsx("input",{className:Ip,placeholder:e("dashboard.workspacePlaceholder",{id:d||e("dashboard.workspacePlaceholderDefault")}),value:b,onChange:N=>S(N.target.value)}),h.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[h.jsx("button",{onClick:L,disabled:k||!d.trim()||!p.trim()||!x,className:Ui,children:e(k?"dashboard.creating":"dashboard.create")}),j&&h.jsx("span",{className:"font-mono text-[10px] text-error",children:j})]})]}),h.jsx("div",{className:"space-y-3",children:t.length===0?h.jsxs("div",{className:"text-center py-16",children:[h.jsx("span",{className:"text-3xl opacity-30",children:"🤖"}),h.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant mt-3",children:e("dashboard.noAgents")})]}):t.map(N=>h.jsx(RR,{agent:N,onDelete:()=>B(N.id,N.name)},N.id))})]})}function AR(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const IR=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,LR=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,OR={};function Yy(e,t){return(OR.jsx?LR:IR).test(e)}const FR=/[ \t\n\f\r]/g;function $R(e){return typeof e=="object"?e.type==="text"?Xy(e.value):!1:Xy(e)}function Xy(e){return e.replace(FR,"")===""}class vl{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}vl.prototype.normal={};vl.prototype.property={};vl.prototype.space=void 0;function uS(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new vl(n,r,t)}function Op(e){return e.toLowerCase()}class Zt{constructor(t,n){this.attribute=n,this.property=t}}Zt.prototype.attribute="";Zt.prototype.booleanish=!1;Zt.prototype.boolean=!1;Zt.prototype.commaOrSpaceSeparated=!1;Zt.prototype.commaSeparated=!1;Zt.prototype.defined=!1;Zt.prototype.mustUseProperty=!1;Zt.prototype.number=!1;Zt.prototype.overloadedBoolean=!1;Zt.prototype.property="";Zt.prototype.spaceSeparated=!1;Zt.prototype.space=void 0;let zR=0;const he=as(),st=as(),Fp=as(),W=as(),Ie=as(),Ks=as(),nn=as();function as(){return 2**++zR}const $p=Object.freeze(Object.defineProperty({__proto__:null,boolean:he,booleanish:st,commaOrSpaceSeparated:nn,commaSeparated:Ks,number:W,overloadedBoolean:Fp,spaceSeparated:Ie},Symbol.toStringTag,{value:"Module"})),Eh=Object.keys($p);class Em extends Zt{constructor(t,n,r,i){let s=-1;if(super(t,n),Jy(this,"space",i),typeof r=="number")for(;++s<Eh.length;){const o=Eh[s];Jy(this,Eh[s],(r&$p[o])===$p[o])}}}Em.prototype.defined=!0;function Jy(e,t,n){n&&(e[t]=n)}function vo(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Em(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Op(r)]=r,n[Op(s.attribute)]=r}return new vl(t,n,e.space)}const dS=vo({properties:{ariaActiveDescendant:null,ariaAtomic:st,ariaAutoComplete:null,ariaBusy:st,ariaChecked:st,ariaColCount:W,ariaColIndex:W,ariaColSpan:W,ariaControls:Ie,ariaCurrent:null,ariaDescribedBy:Ie,ariaDetails:null,ariaDisabled:st,ariaDropEffect:Ie,ariaErrorMessage:null,ariaExpanded:st,ariaFlowTo:Ie,ariaGrabbed:st,ariaHasPopup:null,ariaHidden:st,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ie,ariaLevel:W,ariaLive:null,ariaModal:st,ariaMultiLine:st,ariaMultiSelectable:st,ariaOrientation:null,ariaOwns:Ie,ariaPlaceholder:null,ariaPosInSet:W,ariaPressed:st,ariaReadOnly:st,ariaRelevant:null,ariaRequired:st,ariaRoleDescription:Ie,ariaRowCount:W,ariaRowIndex:W,ariaRowSpan:W,ariaSelected:st,ariaSetSize:W,ariaSort:null,ariaValueMax:W,ariaValueMin:W,ariaValueNow:W,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function hS(e,t){return t in e?e[t]:t}function fS(e,t){return hS(e,t.toLowerCase())}const BR=vo({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ks,acceptCharset:Ie,accessKey:Ie,action:null,allow:null,allowFullScreen:he,allowPaymentRequest:he,allowUserMedia:he,alt:null,as:null,async:he,autoCapitalize:null,autoComplete:Ie,autoFocus:he,autoPlay:he,blocking:Ie,capture:null,charSet:null,checked:he,cite:null,className:Ie,cols:W,colSpan:null,content:null,contentEditable:st,controls:he,controlsList:Ie,coords:W|Ks,crossOrigin:null,data:null,dateTime:null,decoding:null,default:he,defer:he,dir:null,dirName:null,disabled:he,download:Fp,draggable:st,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:he,formTarget:null,headers:Ie,height:W,hidden:Fp,high:W,href:null,hrefLang:null,htmlFor:Ie,httpEquiv:Ie,id:null,imageSizes:null,imageSrcSet:null,inert:he,inputMode:null,integrity:null,is:null,isMap:he,itemId:null,itemProp:Ie,itemRef:Ie,itemScope:he,itemType:Ie,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:he,low:W,manifest:null,max:null,maxLength:W,media:null,method:null,min:null,minLength:W,multiple:he,muted:he,name:null,nonce:null,noModule:he,noValidate:he,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:he,optimum:W,pattern:null,ping:Ie,placeholder:null,playsInline:he,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:he,referrerPolicy:null,rel:Ie,required:he,reversed:he,rows:W,rowSpan:W,sandbox:Ie,scope:null,scoped:he,seamless:he,selected:he,shadowRootClonable:he,shadowRootDelegatesFocus:he,shadowRootMode:null,shape:null,size:W,sizes:null,slot:null,span:W,spellCheck:st,src:null,srcDoc:null,srcLang:null,srcSet:null,start:W,step:null,style:null,tabIndex:W,target:null,title:null,translate:null,type:null,typeMustMatch:he,useMap:null,value:st,width:W,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ie,axis:null,background:null,bgColor:null,border:W,borderColor:null,bottomMargin:W,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:he,declare:he,event:null,face:null,frame:null,frameBorder:null,hSpace:W,leftMargin:W,link:null,longDesc:null,lowSrc:null,marginHeight:W,marginWidth:W,noResize:he,noHref:he,noShade:he,noWrap:he,object:null,profile:null,prompt:null,rev:null,rightMargin:W,rules:null,scheme:null,scrolling:st,standby:null,summary:null,text:null,topMargin:W,valueType:null,version:null,vAlign:null,vLink:null,vSpace:W,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:he,disableRemotePlayback:he,prefix:null,property:null,results:W,security:null,unselectable:null},space:"html",transform:fS}),WR=vo({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:nn,accentHeight:W,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:W,amplitude:W,arabicForm:null,ascent:W,attributeName:null,attributeType:null,azimuth:W,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:W,by:null,calcMode:null,capHeight:W,className:Ie,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:W,diffuseConstant:W,direction:null,display:null,dur:null,divisor:W,dominantBaseline:null,download:he,dx:null,dy:null,edgeMode:null,editable:null,elevation:W,enableBackground:null,end:null,event:null,exponent:W,externalResourcesRequired:null,fill:null,fillOpacity:W,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:Ks,g2:Ks,glyphName:Ks,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:W,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:W,horizOriginX:W,horizOriginY:W,id:null,ideographic:W,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:W,k:W,k1:W,k2:W,k3:W,k4:W,kernelMatrix:nn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:W,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:W,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:W,overlineThickness:W,paintOrder:null,panose1:null,path:null,pathLength:W,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ie,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:W,pointsAtY:W,pointsAtZ:W,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:nn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:nn,rev:nn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:nn,requiredFeatures:nn,requiredFonts:nn,requiredFormats:nn,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:W,specularExponent:W,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:W,strikethroughThickness:W,string:null,stroke:null,strokeDashArray:nn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:W,strokeOpacity:W,strokeWidth:null,style:null,surfaceScale:W,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:nn,tabIndex:W,tableValues:null,target:null,targetX:W,targetY:W,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:nn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:W,underlineThickness:W,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:W,values:null,vAlphabetic:W,vMathematical:W,vectorEffect:null,vHanging:W,vIdeographic:W,version:null,vertAdvY:W,vertOriginX:W,vertOriginY:W,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:W,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:hS}),pS=vo({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()}}),gS=vo({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:fS}),mS=vo({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),HR={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"},VR=/[A-Z]/g,Qy=/-[a-z]/g,UR=/^data[-\w.:]+$/i;function qR(e,t){const n=Op(t);let r=t,i=Zt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&UR.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Qy,KR);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Qy.test(s)){let o=s.replace(VR,GR);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Em}return new i(r,t)}function GR(e){return"-"+e.toLowerCase()}function KR(e){return e.charAt(1).toUpperCase()}const YR=uS([dS,BR,pS,gS,mS],"html"),Nm=uS([dS,WR,pS,gS,mS],"svg");function XR(e){return e.join(" ").trim()}var Pm={},Zy=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,JR=/\n/g,QR=/^\s*/,ZR=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,eD=/^:\s*/,tD=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,nD=/^[;\s]*/,rD=/^\s+|\s+$/g,iD=`
93
+ `,e0="/",t0="*",Li="",sD="comment",oD="declaration";function aD(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var m=g.match(JR);m&&(n+=m.length);var y=g.lastIndexOf(iD);r=~y?g.length-y:r+g.length}function s(){var g={line:n,column:r};return function(m){return m.position=new o(g),c(),m}}function o(g){this.start=g,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(g){var m=new Error(t.source+":"+n+":"+r+": "+g);if(m.reason=g,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function l(g){var m=g.exec(e);if(m){var y=m[0];return i(y),e=e.slice(y.length),m}}function c(){l(QR)}function u(g){var m;for(g=g||[];m=d();)m!==!1&&g.push(m);return g}function d(){var g=s();if(!(e0!=e.charAt(0)||t0!=e.charAt(1))){for(var m=2;Li!=e.charAt(m)&&(t0!=e.charAt(m)||e0!=e.charAt(m+1));)++m;if(m+=2,Li===e.charAt(m-1))return a("End of comment missing");var y=e.slice(2,m-2);return r+=2,i(y),e=e.slice(m),r+=2,g({type:sD,comment:y})}}function f(){var g=s(),m=l(ZR);if(m){if(d(),!l(eD))return a("property missing ':'");var y=l(tD),x=g({type:oD,property:n0(m[0].replace(Zy,Li)),value:y?n0(y[0].replace(Zy,Li)):Li});return l(nD),x}}function p(){var g=[];u(g);for(var m;m=f();)m!==!1&&(g.push(m),u(g));return g}return c(),p()}function n0(e){return e?e.replace(rD,Li):Li}var lD=aD,cD=Hc&&Hc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pm,"__esModule",{value:!0});Pm.default=dD;const uD=cD(lD);function dD(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,uD.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?t(o,a,s):a&&(n=n||{},n[o]=a)}),n}var fd={};Object.defineProperty(fd,"__esModule",{value:!0});fd.camelCase=void 0;var hD=/^--[a-zA-Z0-9_-]+$/,fD=/-([a-z])/g,pD=/^[^-]+$/,gD=/^-(webkit|moz|ms|o|khtml)-/,mD=/^-(ms)-/,xD=function(e){return!e||pD.test(e)||hD.test(e)},vD=function(e,t){return t.toUpperCase()},r0=function(e,t){return"".concat(t,"-")},yD=function(e,t){return t===void 0&&(t={}),xD(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(mD,r0):e=e.replace(gD,r0),e.replace(fD,vD))};fd.camelCase=yD;var bD=Hc&&Hc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},_D=bD(Pm),wD=fd;function zp(e,t){var n={};return!e||typeof e!="string"||(0,_D.default)(e,function(r,i){r&&i&&(n[(0,wD.camelCase)(r,t)]=i)}),n}zp.default=zp;var kD=zp;const SD=hg(kD),xS=vS("end"),jm=vS("start");function vS(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 CD(e){const t=jm(e),n=xS(e);if(t&&n)return{start:t,end:n}}function ka(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?i0(e.position):"start"in e||"end"in e?i0(e):"line"in e||"column"in e?Bp(e):""}function Bp(e){return s0(e&&e.line)+":"+s0(e&&e.column)}function i0(e){return Bp(e&&e.start)+"-"+Bp(e&&e.end)}function s0(e){return e&&typeof e=="number"?e:1}class Dt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=ka(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Dt.prototype.file="";Dt.prototype.name="";Dt.prototype.reason="";Dt.prototype.message="";Dt.prototype.stack="";Dt.prototype.column=void 0;Dt.prototype.line=void 0;Dt.prototype.ancestors=void 0;Dt.prototype.cause=void 0;Dt.prototype.fatal=void 0;Dt.prototype.place=void 0;Dt.prototype.ruleId=void 0;Dt.prototype.source=void 0;const Tm={}.hasOwnProperty,ED=new Map,ND=/[A-Z]/g,PD=new Set(["table","tbody","thead","tfoot","tr"]),jD=new Set(["td","th"]),yS="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function TD(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=FD(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=OD(n,t.jsx,t.jsxs)}const i={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"?Nm:YR,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=bS(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function bS(e,t,n){if(t.type==="element")return MD(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return RD(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return AD(e,t,n);if(t.type==="mdxjsEsm")return DD(e,t);if(t.type==="root")return ID(e,t,n);if(t.type==="text")return LD(e,t)}function MD(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Nm,e.schema=i),e.ancestors.push(t);const s=wS(e,t.tagName,!1),o=$D(e,t);let a=Rm(e,t);return PD.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!$R(l):!0})),_S(e,o,s,t),Mm(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function RD(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)}rl(e,t.position)}function DD(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);rl(e,t.position)}function AD(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Nm,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:wS(e,t.name,!0),o=zD(e,t),a=Rm(e,t);return _S(e,o,s,t),Mm(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function ID(e,t,n){const r={};return Mm(r,Rm(e,t)),e.create(t,e.Fragment,r,n)}function LD(e,t){return t.value}function _S(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Mm(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function OD(e,t,n){return r;function r(i,s,o,a){const c=Array.isArray(o.children)?n:t;return a?c(s,o,a):c(s,o)}}function FD(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=jm(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function $D(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Tm.call(t.properties,i)){const s=BD(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&jD.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function zD(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else rl(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else rl(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Rm(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:ED;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;o=l+"-"+c,i.set(l,c+1)}}const a=bS(e,s,o);a!==void 0&&n.push(a)}return n}function BD(e,t,n){const r=qR(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?AR(n):XR(n)),r.property==="style"){let i=typeof n=="object"?n:WD(e,String(n));return e.stylePropertyNameCase==="css"&&(i=HD(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?HR[r.property]||r.property:r.attribute,n]}}function WD(e,t){try{return SD(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Dt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=yS+"#cannot-parse-style-attribute",i}}function wS(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=Yy(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=Yy(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Tm.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);rl(e)}function rl(e,t){const n=new Dt("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=yS+"#cannot-handle-mdx-estrees-without-createevaluater",n}function HD(e){const t={};let n;for(n in e)Tm.call(e,n)&&(t[VD(n)]=e[n]);return t}function VD(e){let t=e.replace(ND,UD);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function UD(e){return"-"+e.toLowerCase()}const Nh={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"]},qD={};function Dm(e,t){const n=qD,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return kS(e,r,i)}function kS(e,t,n){if(GD(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 o0(e.children,t,n)}return Array.isArray(e)?o0(e,t,n):""}function o0(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=kS(e[i],t,n);return r.join("")}function GD(e){return!!(e&&typeof e=="object")}const a0=document.createElement("i");function Am(e){const t="&"+e+";";a0.innerHTML=t;const n=a0.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function hn(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function kn(e,t){return e.length>0?(hn(e,e.length,0,t),e):t}const l0={}.hasOwnProperty;function SS(e){const t={};let n=-1;for(;++n<e.length;)KD(t,e[n]);return t}function KD(e,t){let n;for(n in t){const i=(l0.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){l0.call(i,o)||(i[o]=[]);const a=s[o];YD(i[o],Array.isArray(a)?a:a?[a]:[])}}}function YD(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);hn(e,0,0,r)}function CS(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 zn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const $t=bi(/[A-Za-z]/),jt=bi(/[\dA-Za-z]/),XD=bi(/[#-'*+\--9=?A-Z^-~]/);function Ru(e){return e!==null&&(e<32||e===127)}const Wp=bi(/\d/),JD=bi(/[\dA-Fa-f]/),QD=bi(/[!-/:-@[-`{-~]/);function oe(e){return e!==null&&e<-2}function Ae(e){return e!==null&&(e<0||e===32)}function pe(e){return e===-2||e===-1||e===32}const pd=bi(new RegExp("\\p{P}|\\p{S}","u")),es=bi(/\s/);function bi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function yo(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&jt(e.charCodeAt(n+1))&&jt(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function _e(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return pe(l)?(e.enter(n),a(l)):t(l)}function a(l){return pe(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const ZD={tokenize:eA};function eA(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),_e(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return oe(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const tA={tokenize:nA},c0={tokenize:rA};function nA(e){const t=this,n=[];let r=0,i,s,o;return a;function a(b){if(r<n.length){const S=n[r];return t.containerState=S[1],e.attempt(S[0].continuation,l,c)(b)}return c(b)}function l(b){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const S=t.events.length;let k=S,_;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){_=t.events[k][1].end;break}x(r);let C=S;for(;C<t.events.length;)t.events[C][1].end={..._},C++;return hn(t.events,k+1,0,t.events.slice(S)),t.events.length=C,c(b)}return a(b)}function c(b){if(r===n.length){if(!i)return f(b);if(i.currentConstruct&&i.currentConstruct.concrete)return g(b);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(c0,u,d)(b)}function u(b){return i&&v(),x(r),f(b)}function d(b){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(b)}function f(b){return t.containerState={},e.attempt(c0,p,g)(b)}function p(b){return r++,n.push([t.currentConstruct,t.containerState]),f(b)}function g(b){if(b===null){i&&v(),x(0),e.consume(b);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),m(b)}function m(b){if(b===null){y(e.exit("chunkFlow"),!0),x(0),e.consume(b);return}return oe(b)?(e.consume(b),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(b),m)}function y(b,S){const k=t.sliceStream(b);if(S&&k.push(null),b.previous=s,s&&(s.next=b),s=b,i.defineSkip(b.start),i.write(k),t.parser.lazy[b.start.line]){let _=i.events.length;for(;_--;)if(i.events[_][1].start.offset<o&&(!i.events[_][1].end||i.events[_][1].end.offset>o))return;const C=t.events.length;let P=C,j,w;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){if(j){w=t.events[P][1].end;break}j=!0}for(x(r),_=C;_<t.events.length;)t.events[_][1].end={...w},_++;hn(t.events,P+1,0,t.events.slice(C)),t.events.length=_}}function x(b){let S=n.length;for(;S-- >b;){const k=n[S];t.containerState=k[1],k[0].exit.call(t,e)}n.length=b}function v(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function rA(e,t,n){return _e(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function lo(e){if(e===null||Ae(e)||es(e))return 1;if(pd(e))return 2}function gd(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Hp={name:"attention",resolveAll:iA,tokenize:sA};function iA(e,t){let n=-1,r,i,s,o,a,l,c,u;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;l=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 d={...e[r][1].end},f={...e[n][1].start};u0(d,-l),u0(f,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=kn(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=kn(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=kn(c,gd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=kn(c,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=kn(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,hn(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function sA(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=lo(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const c=e.exit("attentionSequence"),u=lo(l),d=!u||u===2&&i||n.includes(l),f=!i||i===2&&u||n.includes(r);return c._open=!!(s===42?d:d&&(i||!f)),c._close=!!(s===42?f:f&&(u||!d)),t(l)}}function u0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const oA={name:"autolink",tokenize:aA};function aA(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return $t(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||jt(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||jt(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Ru(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):XD(p)?(e.consume(p),c):n(p)}function u(p){return jt(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||jt(p))&&r++<63){const g=p===45?f:d;return e.consume(p),g}return n(p)}}const yl={partial:!0,tokenize:lA};function lA(e,t,n){return r;function r(s){return pe(s)?_e(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||oe(s)?t(s):n(s)}}const ES={continuation:{tokenize:uA},exit:dA,name:"blockQuote",tokenize:cA};function cA(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return pe(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function uA(e,t,n){const r=this;return i;function i(o){return pe(o)?_e(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(ES,t,n)(o)}}function dA(e){e.exit("blockQuote")}const NS={name:"characterEscape",tokenize:hA};function hA(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return QD(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const PS={name:"characterReference",tokenize:fA};function fA(e,t,n){const r=this;let i=0,s,o;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,o=jt,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=JD,u):(e.enter("characterReferenceValue"),s=7,o=Wp,u(d))}function u(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return o===jt&&!Am(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<s?(e.consume(d),u):n(d)}}const d0={partial:!0,tokenize:gA},h0={concrete:!0,name:"codeFenced",tokenize:pA};function pA(e,t,n){const r=this,i={partial:!0,tokenize:k};let s=0,o=0,a;return l;function l(_){return c(_)}function c(_){const C=r.events[r.events.length-1];return s=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,a=_,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(_)}function u(_){return _===a?(o++,e.consume(_),u):o<3?n(_):(e.exit("codeFencedFenceSequence"),pe(_)?_e(e,d,"whitespace")(_):d(_))}function d(_){return _===null||oe(_)?(e.exit("codeFencedFence"),r.interrupt?t(_):e.check(d0,m,S)(_)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(_))}function f(_){return _===null||oe(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(_)):pe(_)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),_e(e,p,"whitespace")(_)):_===96&&_===a?n(_):(e.consume(_),f)}function p(_){return _===null||oe(_)?d(_):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(_))}function g(_){return _===null||oe(_)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(_)):_===96&&_===a?n(_):(e.consume(_),g)}function m(_){return e.attempt(i,S,y)(_)}function y(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),x}function x(_){return s>0&&pe(_)?_e(e,v,"linePrefix",s+1)(_):v(_)}function v(_){return _===null||oe(_)?e.check(d0,m,S)(_):(e.enter("codeFlowValue"),b(_))}function b(_){return _===null||oe(_)?(e.exit("codeFlowValue"),v(_)):(e.consume(_),b)}function S(_){return e.exit("codeFenced"),t(_)}function k(_,C,P){let j=0;return w;function w(I){return _.enter("lineEnding"),_.consume(I),_.exit("lineEnding"),M}function M(I){return _.enter("codeFencedFence"),pe(I)?_e(_,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):D(I)}function D(I){return I===a?(_.enter("codeFencedFenceSequence"),F(I)):P(I)}function F(I){return I===a?(j++,_.consume(I),F):j>=o?(_.exit("codeFencedFenceSequence"),pe(I)?_e(_,$,"whitespace")(I):$(I)):P(I)}function $(I){return I===null||oe(I)?(_.exit("codeFencedFence"),C(I)):P(I)}}}function gA(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Ph={name:"codeIndented",tokenize:xA},mA={partial:!0,tokenize:vA};function xA(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),_e(e,s,"linePrefix",5)(c)}function s(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):oe(c)?e.attempt(mA,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||oe(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function vA(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):oe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):_e(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):oe(o)?i(o):n(o)}}const yA={name:"codeText",previous:_A,resolve:bA,tokenize:wA};function bA(e){let t=e.length-4,n=3,r,i;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;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function _A(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function wA(e,t,n){let r=0,i,s;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(s=e.enter("codeTextSequence"),i=0,u(d)):oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||oe(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",c(d))}}class kA{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 i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&zo(this.left,r),s.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),zo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),zo(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);zo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);zo(this.left,n.reverse())}}}function zo(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 jS(e){const t={};let n=-1,r,i,s,o,a,l,c;const u=new kA(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,SA(u,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=u.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,n),a.unshift(r),u.splice(i,n-i+1,a))}}return hn(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function SA(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let u,d,f=-1,p=n,g=0,m=0;const y=[m];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(m=f+1,y.push(m),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),f=y.length;f--;){const x=a.slice(y[f],y[f+1]),v=s.pop();l.push([v,v+x.length-1]),e.splice(v,2,x)}for(l.reverse(),f=-1;++f<l.length;)c[g+l[f][0]]=g+l[f][1],g+=l[f][1]-l[f][0]-1;return c}const CA={resolve:NA,tokenize:PA},EA={partial:!0,tokenize:jA};function NA(e){return jS(e),e}function PA(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):oe(a)?e.check(EA,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function jA(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),_e(e,s,"linePrefix")}function s(o){if(o===null||oe(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function TS(e,t,n,r,i,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(x){return x===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(x),e.exit(s),f):x===null||x===32||x===41||Ru(x)?n(x):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(x))}function f(x){return x===62?(e.enter(s),e.consume(x),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===62?(e.exit("chunkString"),e.exit(a),f(x)):x===null||x===60||oe(x)?n(x):(e.consume(x),x===92?g:p)}function g(x){return x===60||x===62||x===92?(e.consume(x),p):p(x)}function m(x){return!u&&(x===null||x===41||Ae(x))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(x)):u<c&&x===40?(e.consume(x),u++,m):x===41?(e.consume(x),u--,m):x===null||x===32||x===40||Ru(x)?n(x):(e.consume(x),x===92?y:m)}function y(x){return x===40||x===41||x===92?(e.consume(x),m):m(x)}}function MS(e,t,n,r,i,s){const o=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(s),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):oe(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||oe(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!pe(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function RS(e,t,n,r,i,s){let o;return a;function a(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),o=f===40?41:f,l):n(f)}function l(f){return f===o?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(s),c(f))}function c(f){return f===o?(e.exit(s),l(o)):f===null?n(f):oe(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),_e(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===o||f===null||oe(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:u)}function d(f){return f===o||f===92?(e.consume(f),u):u(f)}}function Sa(e,t){let n;return r;function r(i){return oe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):pe(i)?_e(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const TA={name:"definition",tokenize:RA},MA={partial:!0,tokenize:DA};function RA(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return MS.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=zn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return Ae(p)?Sa(e,c)(p):c(p)}function c(p){return TS(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(MA,d,d)(p)}function d(p){return pe(p)?_e(e,f,"whitespace")(p):f(p)}function f(p){return p===null||oe(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function DA(e,t,n){return r;function r(a){return Ae(a)?Sa(e,i)(a):n(a)}function i(a){return RS(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return pe(a)?_e(e,o,"whitespace")(a):o(a)}function o(a){return a===null||oe(a)?t(a):n(a)}}const AA={name:"hardBreakEscape",tokenize:IA};function IA(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return oe(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const LA={name:"headingAtx",resolve:OA,tokenize:FA};function OA(e,t){let n=e.length-2,r=3,i,s;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&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},hn(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function FA(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||Ae(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||oe(u)?(e.exit("atxHeading"),t(u)):pe(u)?_e(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||Ae(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const $A=["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"],f0=["pre","script","style","textarea"],zA={concrete:!0,name:"htmlFlow",resolveTo:HA,tokenize:VA},BA={partial:!0,tokenize:qA},WA={partial:!0,tokenize:UA};function HA(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 VA(e,t,n){const r=this;let i,s,o,a,l;return c;function c(T){return u(T)}function u(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),d}function d(T){return T===33?(e.consume(T),f):T===47?(e.consume(T),s=!0,m):T===63?(e.consume(T),i=3,r.interrupt?t:N):$t(T)?(e.consume(T),o=String.fromCharCode(T),y):n(T)}function f(T){return T===45?(e.consume(T),i=2,p):T===91?(e.consume(T),i=5,a=0,g):$t(T)?(e.consume(T),i=4,r.interrupt?t:N):n(T)}function p(T){return T===45?(e.consume(T),r.interrupt?t:N):n(T)}function g(T){const re="CDATA[";return T===re.charCodeAt(a++)?(e.consume(T),a===re.length?r.interrupt?t:D:g):n(T)}function m(T){return $t(T)?(e.consume(T),o=String.fromCharCode(T),y):n(T)}function y(T){if(T===null||T===47||T===62||Ae(T)){const re=T===47,le=o.toLowerCase();return!re&&!s&&f0.includes(le)?(i=1,r.interrupt?t(T):D(T)):$A.includes(o.toLowerCase())?(i=6,re?(e.consume(T),x):r.interrupt?t(T):D(T)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(T):s?v(T):b(T))}return T===45||jt(T)?(e.consume(T),o+=String.fromCharCode(T),y):n(T)}function x(T){return T===62?(e.consume(T),r.interrupt?t:D):n(T)}function v(T){return pe(T)?(e.consume(T),v):w(T)}function b(T){return T===47?(e.consume(T),w):T===58||T===95||$t(T)?(e.consume(T),S):pe(T)?(e.consume(T),b):w(T)}function S(T){return T===45||T===46||T===58||T===95||jt(T)?(e.consume(T),S):k(T)}function k(T){return T===61?(e.consume(T),_):pe(T)?(e.consume(T),k):b(T)}function _(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),l=T,C):pe(T)?(e.consume(T),_):P(T)}function C(T){return T===l?(e.consume(T),l=null,j):T===null||oe(T)?n(T):(e.consume(T),C)}function P(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||Ae(T)?k(T):(e.consume(T),P)}function j(T){return T===47||T===62||pe(T)?b(T):n(T)}function w(T){return T===62?(e.consume(T),M):n(T)}function M(T){return T===null||oe(T)?D(T):pe(T)?(e.consume(T),M):n(T)}function D(T){return T===45&&i===2?(e.consume(T),H):T===60&&i===1?(e.consume(T),X):T===62&&i===4?(e.consume(T),Q):T===63&&i===3?(e.consume(T),N):T===93&&i===5?(e.consume(T),B):oe(T)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(BA,te,F)(T)):T===null||oe(T)?(e.exit("htmlFlowData"),F(T)):(e.consume(T),D)}function F(T){return e.check(WA,$,te)(T)}function $(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),I}function I(T){return T===null||oe(T)?F(T):(e.enter("htmlFlowData"),D(T))}function H(T){return T===45?(e.consume(T),N):D(T)}function X(T){return T===47?(e.consume(T),o="",L):D(T)}function L(T){if(T===62){const re=o.toLowerCase();return f0.includes(re)?(e.consume(T),Q):D(T)}return $t(T)&&o.length<8?(e.consume(T),o+=String.fromCharCode(T),L):D(T)}function B(T){return T===93?(e.consume(T),N):D(T)}function N(T){return T===62?(e.consume(T),Q):T===45&&i===2?(e.consume(T),N):D(T)}function Q(T){return T===null||oe(T)?(e.exit("htmlFlowData"),te(T)):(e.consume(T),Q)}function te(T){return e.exit("htmlFlow"),t(T)}}function UA(e,t,n){const r=this;return i;function i(o){return oe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function qA(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yl,t,n)}}const GA={name:"htmlText",tokenize:KA};function KA(e,t,n){const r=this;let i,s,o;return a;function a(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),l}function l(N){return N===33?(e.consume(N),c):N===47?(e.consume(N),k):N===63?(e.consume(N),b):$t(N)?(e.consume(N),P):n(N)}function c(N){return N===45?(e.consume(N),u):N===91?(e.consume(N),s=0,g):$t(N)?(e.consume(N),v):n(N)}function u(N){return N===45?(e.consume(N),p):n(N)}function d(N){return N===null?n(N):N===45?(e.consume(N),f):oe(N)?(o=d,X(N)):(e.consume(N),d)}function f(N){return N===45?(e.consume(N),p):d(N)}function p(N){return N===62?H(N):N===45?f(N):d(N)}function g(N){const Q="CDATA[";return N===Q.charCodeAt(s++)?(e.consume(N),s===Q.length?m:g):n(N)}function m(N){return N===null?n(N):N===93?(e.consume(N),y):oe(N)?(o=m,X(N)):(e.consume(N),m)}function y(N){return N===93?(e.consume(N),x):m(N)}function x(N){return N===62?H(N):N===93?(e.consume(N),x):m(N)}function v(N){return N===null||N===62?H(N):oe(N)?(o=v,X(N)):(e.consume(N),v)}function b(N){return N===null?n(N):N===63?(e.consume(N),S):oe(N)?(o=b,X(N)):(e.consume(N),b)}function S(N){return N===62?H(N):b(N)}function k(N){return $t(N)?(e.consume(N),_):n(N)}function _(N){return N===45||jt(N)?(e.consume(N),_):C(N)}function C(N){return oe(N)?(o=C,X(N)):pe(N)?(e.consume(N),C):H(N)}function P(N){return N===45||jt(N)?(e.consume(N),P):N===47||N===62||Ae(N)?j(N):n(N)}function j(N){return N===47?(e.consume(N),H):N===58||N===95||$t(N)?(e.consume(N),w):oe(N)?(o=j,X(N)):pe(N)?(e.consume(N),j):H(N)}function w(N){return N===45||N===46||N===58||N===95||jt(N)?(e.consume(N),w):M(N)}function M(N){return N===61?(e.consume(N),D):oe(N)?(o=M,X(N)):pe(N)?(e.consume(N),M):j(N)}function D(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),i=N,F):oe(N)?(o=D,X(N)):pe(N)?(e.consume(N),D):(e.consume(N),$)}function F(N){return N===i?(e.consume(N),i=void 0,I):N===null?n(N):oe(N)?(o=F,X(N)):(e.consume(N),F)}function $(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||Ae(N)?j(N):(e.consume(N),$)}function I(N){return N===47||N===62||Ae(N)?j(N):n(N)}function H(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):n(N)}function X(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),L}function L(N){return pe(N)?_e(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):B(N)}function B(N){return e.enter("htmlTextData"),o(N)}}const Im={name:"labelEnd",resolveAll:QA,resolveTo:ZA,tokenize:eI},YA={tokenize:tI},XA={tokenize:nI},JA={tokenize:rI};function QA(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 i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&hn(e,0,e.length,n),e}function ZA(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=kn(a,e.slice(s+1,s+r+3)),a=kn(a,[["enter",u,t]]),a=kn(a,gd(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=kn(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=kn(a,e.slice(o+1)),a=kn(a,[["exit",l,t]]),hn(e,s,e.length,a),e}function eI(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(f){return s?s._inactive?d(f):(o=r.parser.defined.includes(zn(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):n(f)}function l(f){return f===40?e.attempt(YA,u,o?u:d)(f):f===91?e.attempt(XA,u,o?c:d)(f):o?u(f):d(f)}function c(f){return e.attempt(JA,u,d)(f)}function u(f){return t(f)}function d(f){return s._balanced=!0,n(f)}}function tI(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return Ae(d)?Sa(e,s)(d):s(d)}function s(d){return d===41?u(d):TS(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return Ae(d)?Sa(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?RS(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return Ae(d)?Sa(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function nI(e,t,n){const r=this;return i;function i(a){return MS.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(zn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function rI(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const iI={name:"labelStartImage",resolveAll:Im.resolveAll,tokenize:sI};function sI(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const oI={name:"labelStartLink",resolveAll:Im.resolveAll,tokenize:aI};function aI(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const jh={name:"lineEnding",tokenize:lI};function lI(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),_e(e,t,"linePrefix")}}const Tc={name:"thematicBreak",tokenize:cI};function cI(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||oe(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),pe(c)?_e(e,a,"whitespace")(c):a(c))}}const Vt={continuation:{tokenize:fI},exit:gI,name:"list",tokenize:hI},uI={partial:!0,tokenize:mI},dI={partial:!0,tokenize:pI};function hI(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Wp(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Tc,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Wp(p)&&++o<10?(e.consume(p),l):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(yl,r.interrupt?n:u,e.attempt(uI,f,d))}function u(p){return r.containerState.initialBlankLine=!0,s++,f(p)}function d(p){return pe(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):n(p)}function f(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function fI(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yl,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,_e(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!pe(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(dI,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,_e(e,e.attempt(Vt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function pI(e,t,n){const r=this;return _e(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function gI(e){e.exit(this.containerState.type)}function mI(e,t,n){const r=this;return _e(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!pe(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const p0={name:"setextUnderline",resolveTo:xI,tokenize:vI};function xI(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function vI(e,t,n){const r=this;let i;return s;function s(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),pe(c)?_e(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||oe(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const yI={tokenize:bI};function bI(e){const t=this,n=e.attempt(yl,r,e.attempt(this.parser.constructs.flowInitial,i,_e(e,e.attempt(this.parser.constructs.flow,i,e.attempt(CA,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const _I={resolveAll:AS()},wI=DS("string"),kI=DS("text");function DS(e){return{resolveAll:AS(e==="text"?SI:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(u){return c(u)?s(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),s(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let f=-1;if(d)for(;++f<d.length;){const p=d[f];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function AS(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function SI(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],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const CI={42:Vt,43:Vt,45:Vt,48:Vt,49:Vt,50:Vt,51:Vt,52:Vt,53:Vt,54:Vt,55:Vt,56:Vt,57:Vt,62:ES},EI={91:TA},NI={[-2]:Ph,[-1]:Ph,32:Ph},PI={35:LA,42:Tc,45:[p0,Tc],60:zA,61:p0,95:Tc,96:h0,126:h0},jI={38:PS,92:NS},TI={[-5]:jh,[-4]:jh,[-3]:jh,33:iI,38:PS,42:Hp,60:[oA,GA],91:oI,92:[AA,NS],93:Im,95:Hp,96:yA},MI={null:[Hp,_I]},RI={null:[42,95]},DI={null:[]},AI=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:RI,contentInitial:EI,disable:DI,document:CI,flow:PI,flowInitial:NI,insideSpan:MI,string:jI,text:TI},Symbol.toStringTag,{value:"Module"}));function II(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 i={},s=[];let o=[],a=[];const l={attempt:C(k),check:C(_),consume:v,enter:b,exit:S,interrupt:C(_,{interrupt:!0})},c={code:null,containerState:{},defineSkip:m,events:[],now:g,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function d(M){return o=kn(o,M),y(),o[o.length-1]!==null?[]:(P(t,0),c.events=gd(s,c.events,c),c.events)}function f(M,D){return OI(p(M),D)}function p(M){return LI(o,M)}function g(){const{_bufferIndex:M,_index:D,line:F,column:$,offset:I}=r;return{_bufferIndex:M,_index:D,line:F,column:$,offset:I}}function m(M){i[M.line]=M.column,w()}function y(){let M;for(;r._index<o.length;){const D=o[r._index];if(typeof D=="string")for(M=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===M&&r._bufferIndex<D.length;)x(D.charCodeAt(r._bufferIndex));else x(D)}}function x(M){u=u(M)}function v(M){oe(M)?(r.line++,r.column=1,r.offset+=M===-3?2:1,w()):M!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=M}function b(M,D){const F=D||{};return F.type=M,F.start=g(),c.events.push(["enter",F,c]),a.push(F),F}function S(M){const D=a.pop();return D.end=g(),c.events.push(["exit",D,c]),D}function k(M,D){P(M,D.from)}function _(M,D){D.restore()}function C(M,D){return F;function F($,I,H){let X,L,B,N;return Array.isArray($)?te($):"tokenize"in $?te([$]):Q($);function Q(ae){return R;function R(ie){const ee=ie!==null&&ae[ie],Pe=ie!==null&&ae.null,Ze=[...Array.isArray(ee)?ee:ee?[ee]:[],...Array.isArray(Pe)?Pe:Pe?[Pe]:[]];return te(Ze)(ie)}}function te(ae){return X=ae,L=0,ae.length===0?H:T(ae[L])}function T(ae){return R;function R(ie){return N=j(),B=ae,ae.partial||(c.currentConstruct=ae),ae.name&&c.parser.constructs.disable.null.includes(ae.name)?le():ae.tokenize.call(D?Object.assign(Object.create(c),D):c,l,re,le)(ie)}}function re(ae){return M(B,N),I}function le(ae){return N.restore(),++L<X.length?T(X[L]):H}}}function P(M,D){M.resolveAll&&!s.includes(M)&&s.push(M),M.resolve&&hn(c.events,D,c.events.length-D,M.resolve(c.events.slice(D),c)),M.resolveTo&&(c.events=M.resolveTo(c.events,c))}function j(){const M=g(),D=c.previous,F=c.currentConstruct,$=c.events.length,I=Array.from(a);return{from:$,restore:H};function H(){r=M,c.previous=D,c.currentConstruct=F,c.events.length=$,a=I,w()}}function w(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function LI(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function OI(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
94
+ `;break}case-3:{o=`\r
95
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function FI(e){const r={constructs:SS([AI,...(e||{}).extensions||[]]),content:i(ZD),defined:[],document:i(tA),flow:i(yI),lazy:{},string:i(wI),text:i(kI)};return r;function i(s){return o;function o(a){return II(r,s,a)}}}function $I(e){for(;!jS(e););return e}const g0=/[\0\t\n\r]/g;function zI(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let c,u,d,f,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(g0.lastIndex=d,c=g0.exec(s),f=c&&c.index!==void 0?c.index:s.length,p=s.charCodeAt(f),!c){t=s.slice(d);break}if(p===10&&d===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<f&&(l.push(s.slice(d,f)),e+=f-d),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=f+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const BI=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function WI(e){return e.replace(BI,HI)}function HI(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return CS(n.slice(s?2:1),s?16:10)}return Am(n)||e}const IS={}.hasOwnProperty;function VI(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),UI(n)($I(FI(n).document().write(zI()(e,t,!0))))}function UI(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Me),autolinkProtocol:j,autolinkEmail:j,atxHeading:s(ke),blockQuote:s(Pe),characterEscape:j,characterReference:j,codeFenced:s(Ze),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(Ze,o),codeText:s(xt,o),codeTextData:j,data:j,codeFlowValue:j,definition:s(q),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(de),hardBreakEscape:s(be),hardBreakTrailing:s(be),htmlFlow:s(Vn,o),htmlFlowData:j,htmlText:s(Vn,o),htmlTextData:j,image:s(Dr),label:o,link:s(Me),listItem:s(Se),listItemValue:f,listOrdered:s(it,d),listUnordered:s(it),paragraph:s(en),reference:T,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(ke),strong:s(mn),thematicBreak:s(bo)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:ee,autolinkProtocol:ie,blockQuote:l(),characterEscapeValue:w,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:ae,characterReference:R,codeFenced:l(y),codeFencedFence:m,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:w,codeIndented:l(x),codeText:l(I),codeTextData:w,data:w,definition:l(),definitionDestinationString:S,definitionLabelString:v,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(D),hardBreakTrailing:l(D),htmlFlow:l(F),htmlFlowData:w,htmlText:l($),htmlTextData:w,image:l(X),label:B,labelText:L,lineEnding:M,link:l(H),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:re,resourceDestinationString:N,resourceTitleString:Q,resource:te,setextHeading:l(P),setextHeadingLineSequence:C,setextHeadingText:_,strong:l(),thematicBreak:l()}};LS(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(O){let G={type:"root",children:[]};const ue={stack:[G],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},ye=[];let Re=-1;for(;++Re<O.length;)if(O[Re][1].type==="listOrdered"||O[Re][1].type==="listUnordered")if(O[Re][0]==="enter")ye.push(Re);else{const jn=ye.pop();Re=i(O,jn,Re)}for(Re=-1;++Re<O.length;){const jn=t[O[Re][0]];IS.call(jn,O[Re][1].type)&&jn[O[Re][1].type].call(Object.assign({sliceSerialize:O[Re][2].sliceSerialize},ue),O[Re][1])}if(ue.tokenStack.length>0){const jn=ue.tokenStack[ue.tokenStack.length-1];(jn[1]||m0).call(ue,void 0,jn[0])}for(G.position={start:$r(O.length>0?O[0][1].start:{line:1,column:1,offset:0}),end:$r(O.length>0?O[O.length-2][1].end:{line:1,column:1,offset:0})},Re=-1;++Re<t.transforms.length;)G=t.transforms[Re](G)||G;return G}function i(O,G,ue){let ye=G-1,Re=-1,jn=!1,wi,ar,_o,wo;for(;++ye<=ue;){const tn=O[ye];switch(tn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{tn[0]==="enter"?Re++:Re--,wo=void 0;break}case"lineEndingBlank":{tn[0]==="enter"&&(wi&&!wo&&!Re&&!_o&&(_o=ye),wo=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:wo=void 0}if(!Re&&tn[0]==="enter"&&tn[1].type==="listItemPrefix"||Re===-1&&tn[0]==="exit"&&(tn[1].type==="listUnordered"||tn[1].type==="listOrdered")){if(wi){let cs=ye;for(ar=void 0;cs--;){const lr=O[cs];if(lr[1].type==="lineEnding"||lr[1].type==="lineEndingBlank"){if(lr[0]==="exit")continue;ar&&(O[ar][1].type="lineEndingBlank",jn=!0),lr[1].type="lineEnding",ar=cs}else if(!(lr[1].type==="linePrefix"||lr[1].type==="blockQuotePrefix"||lr[1].type==="blockQuotePrefixWhitespace"||lr[1].type==="blockQuoteMarker"||lr[1].type==="listItemIndent"))break}_o&&(!ar||_o<ar)&&(wi._spread=!0),wi.end=Object.assign({},ar?O[ar][1].start:tn[1].end),O.splice(ar||ye,0,["exit",wi,tn[2]]),ye++,ue++}if(tn[1].type==="listItemPrefix"){const cs={type:"listItem",_spread:!1,start:Object.assign({},tn[1].start),end:void 0};wi=cs,O.splice(ye,0,["enter",cs,tn[2]]),ye++,ue++,_o=void 0,wo=!0}}}return O[G][1]._spread=jn,ue}function s(O,G){return ue;function ue(ye){a.call(this,O(ye),ye),G&&G.call(this,ye)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(O,G,ue){this.stack[this.stack.length-1].children.push(O),this.stack.push(O),this.tokenStack.push([G,ue||void 0]),O.position={start:$r(G.start),end:void 0}}function l(O){return G;function G(ue){O&&O.call(this,ue),c.call(this,ue)}}function c(O,G){const ue=this.stack.pop(),ye=this.tokenStack.pop();if(ye)ye[0].type!==O.type&&(G?G.call(this,O,ye[0]):(ye[1]||m0).call(this,O,ye[0]));else throw new Error("Cannot close `"+O.type+"` ("+ka({start:O.start,end:O.end})+"): it’s not open");ue.position.end=$r(O.end)}function u(){return Dm(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(O){if(this.data.expectingFirstListItemValue){const G=this.stack[this.stack.length-2];G.start=Number.parseInt(this.sliceSerialize(O),10),this.data.expectingFirstListItemValue=void 0}}function p(){const O=this.resume(),G=this.stack[this.stack.length-1];G.lang=O}function g(){const O=this.resume(),G=this.stack[this.stack.length-1];G.meta=O}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const O=this.resume(),G=this.stack[this.stack.length-1];G.value=O.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const O=this.resume(),G=this.stack[this.stack.length-1];G.value=O.replace(/(\r?\n|\r)$/g,"")}function v(O){const G=this.resume(),ue=this.stack[this.stack.length-1];ue.label=G,ue.identifier=zn(this.sliceSerialize(O)).toLowerCase()}function b(){const O=this.resume(),G=this.stack[this.stack.length-1];G.title=O}function S(){const O=this.resume(),G=this.stack[this.stack.length-1];G.url=O}function k(O){const G=this.stack[this.stack.length-1];if(!G.depth){const ue=this.sliceSerialize(O).length;G.depth=ue}}function _(){this.data.setextHeadingSlurpLineEnding=!0}function C(O){const G=this.stack[this.stack.length-1];G.depth=this.sliceSerialize(O).codePointAt(0)===61?1:2}function P(){this.data.setextHeadingSlurpLineEnding=void 0}function j(O){const ue=this.stack[this.stack.length-1].children;let ye=ue[ue.length-1];(!ye||ye.type!=="text")&&(ye=Nd(),ye.position={start:$r(O.start),end:void 0},ue.push(ye)),this.stack.push(ye)}function w(O){const G=this.stack.pop();G.value+=this.sliceSerialize(O),G.position.end=$r(O.end)}function M(O){const G=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ue=G.children[G.children.length-1];ue.position.end=$r(O.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(G.type)&&(j.call(this,O),w.call(this,O))}function D(){this.data.atHardBreak=!0}function F(){const O=this.resume(),G=this.stack[this.stack.length-1];G.value=O}function $(){const O=this.resume(),G=this.stack[this.stack.length-1];G.value=O}function I(){const O=this.resume(),G=this.stack[this.stack.length-1];G.value=O}function H(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=G,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function X(){const O=this.stack[this.stack.length-1];if(this.data.inReference){const G=this.data.referenceType||"shortcut";O.type+="Reference",O.referenceType=G,delete O.url,delete O.title}else delete O.identifier,delete O.label;this.data.referenceType=void 0}function L(O){const G=this.sliceSerialize(O),ue=this.stack[this.stack.length-2];ue.label=WI(G),ue.identifier=zn(G).toLowerCase()}function B(){const O=this.stack[this.stack.length-1],G=this.resume(),ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,ue.type==="link"){const ye=O.children;ue.children=ye}else ue.alt=G}function N(){const O=this.resume(),G=this.stack[this.stack.length-1];G.url=O}function Q(){const O=this.resume(),G=this.stack[this.stack.length-1];G.title=O}function te(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function re(O){const G=this.resume(),ue=this.stack[this.stack.length-1];ue.label=G,ue.identifier=zn(this.sliceSerialize(O)).toLowerCase(),this.data.referenceType="full"}function le(O){this.data.characterReferenceType=O.type}function ae(O){const G=this.sliceSerialize(O),ue=this.data.characterReferenceType;let ye;ue?(ye=CS(G,ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ye=Am(G);const Re=this.stack[this.stack.length-1];Re.value+=ye}function R(O){const G=this.stack.pop();G.position.end=$r(O.end)}function ie(O){w.call(this,O);const G=this.stack[this.stack.length-1];G.url=this.sliceSerialize(O)}function ee(O){w.call(this,O);const G=this.stack[this.stack.length-1];G.url="mailto:"+this.sliceSerialize(O)}function Pe(){return{type:"blockquote",children:[]}}function Ze(){return{type:"code",lang:null,meta:null,value:""}}function xt(){return{type:"inlineCode",value:""}}function q(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function de(){return{type:"emphasis",children:[]}}function ke(){return{type:"heading",depth:0,children:[]}}function be(){return{type:"break"}}function Vn(){return{type:"html",value:""}}function Dr(){return{type:"image",title:null,url:"",alt:null}}function Me(){return{type:"link",title:null,url:"",children:[]}}function it(O){return{type:"list",ordered:O.type==="listOrdered",start:null,spread:O._spread,children:[]}}function Se(O){return{type:"listItem",spread:O._spread,checked:null,children:[]}}function en(){return{type:"paragraph",children:[]}}function mn(){return{type:"strong",children:[]}}function Nd(){return{type:"text",value:""}}function bo(){return{type:"thematicBreak"}}}function $r(e){return{line:e.line,column:e.column,offset:e.offset}}function LS(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?LS(e,r):qI(e,r)}}function qI(e,t){let n;for(n in t)if(IS.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 m0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ka({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ka({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ka({start:t.start,end:t.end})+") is still open")}function GI(e){const t=this;t.parser=n;function n(r){return VI(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function KI(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 YI(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
96
+ `}]}function XI(e,t){const n=t.value?t.value+`
97
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function JI(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function QI(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZI(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=yo(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function eL(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 tL(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function OS(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 i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function nL(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return OS(e,t);const i={src:yo(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function rL(e,t){const n={src:yo(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 iL(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 sL(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return OS(e,t);const i={href:yo(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function oL(e,t){const n={href:yo(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 aL(e,t,n){const r=e.all(t),i=n?lL(n):FS(t),s={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
98
+ `}),u.type==="element"&&u.tagName==="p"&&!i?o.push(...u.children):o.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
99
+ `});const c={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,c),e.applyData(t,c)}function lL(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=FS(n[r])}return t}function FS(e){const t=e.spread;return t??e.children.length>1}function cL(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function uL(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dL(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function hL(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fL(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=jm(t.children[1]),l=xS(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function pL(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const d=t.children[l],f={},p=o?o[l]:void 0;p&&(f.align=p);let g={type:"element",tagName:s,properties:f,children:[]};d&&(g.children=e.all(d),e.patch(d,g),g=e.applyData(d,g)),c.push(g)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function gL(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const x0=9,v0=32;function mL(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(y0(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(y0(t.slice(i),i>0,!1)),s.join("")}function y0(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===x0||s===v0;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===x0||s===v0;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function xL(e,t){const n={type:"text",value:mL(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function vL(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const yL={blockquote:KI,break:YI,code:XI,delete:JI,emphasis:QI,footnoteReference:ZI,heading:eL,html:tL,imageReference:nL,image:rL,inlineCode:iL,linkReference:sL,link:oL,listItem:aL,list:cL,paragraph:uL,root:dL,strong:hL,table:fL,tableCell:gL,tableRow:pL,text:xL,thematicBreak:vL,toml:Xl,yaml:Xl,definition:Xl,footnoteDefinition:Xl};function Xl(){}const $S=-1,md=0,Ca=1,Du=2,Lm=3,Om=4,Fm=5,$m=6,zS=7,BS=8,b0=typeof self=="object"?self:globalThis,bL=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case md:case $S:return n(o,i);case Ca:{const a=n([],i);for(const l of o)a.push(r(l));return a}case Du:{const a=n({},i);for(const[l,c]of o)a[r(l)]=r(c);return a}case Lm:return n(new Date(o),i);case Om:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case Fm:{const a=n(new Map,i);for(const[l,c]of o)a.set(r(l),r(c));return a}case $m:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case zS:{const{name:a,message:l}=o;return n(new b0[a](l),i)}case BS:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(new b0[s](o),i)};return r},_0=e=>bL(new Map,e)(0),ms="",{toString:_L}={},{keys:wL}=Object,Bo=e=>{const t=typeof e;if(t!=="object"||!e)return[md,t];const n=_L.call(e).slice(8,-1);switch(n){case"Array":return[Ca,ms];case"Object":return[Du,ms];case"Date":return[Lm,ms];case"RegExp":return[Om,ms];case"Map":return[Fm,ms];case"Set":return[$m,ms];case"DataView":return[Ca,n]}return n.includes("Array")?[Ca,n]:n.includes("Error")?[zS,n]:[Du,n]},Jl=([e,t])=>e===md&&(t==="function"||t==="symbol"),kL=(e,t,n,r)=>{const i=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=Bo(o);switch(a){case md:{let u=o;switch(l){case"bigint":a=BS,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([$S],o)}return i([a,u],o)}case Ca:{if(l){let f=o;return l==="DataView"?f=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(f=new Uint8Array(o)),i([l,[...f]],o)}const u=[],d=i([a,u],o);for(const f of o)u.push(s(f));return d}case Du:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const u=[],d=i([a,u],o);for(const f of wL(o))(e||!Jl(Bo(o[f])))&&u.push([s(f),s(o[f])]);return d}case Lm:return i([a,o.toISOString()],o);case Om:{const{source:u,flags:d}=o;return i([a,{source:u,flags:d}],o)}case Fm:{const u=[],d=i([a,u],o);for(const[f,p]of o)(e||!(Jl(Bo(f))||Jl(Bo(p))))&&u.push([s(f),s(p)]);return d}case $m:{const u=[],d=i([a,u],o);for(const f of o)(e||!Jl(Bo(f)))&&u.push(s(f));return d}}const{message:c}=o;return i([a,{name:l,message:c}],o)};return s},w0=(e,{json:t,lossy:n}={})=>{const r=[];return kL(!(t||n),!!t,new Map,r)(e),r},Au=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?_0(w0(e,t)):structuredClone(e):(e,t)=>_0(w0(e,t));function SL(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 CL(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function EL(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||SL,r=e.options.footnoteBackLabel||CL,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),f=yo(d.toLowerCase());let p=0;const g=[],m=e.footnoteCounts.get(d);for(;m!==void 0&&++p<=m;){g.length>0&&g.push({type:"text",value:" "});let v=typeof n=="string"?n:n(l,p);typeof v=="string"&&(v={type:"text",value:v}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const v=y.children[y.children.length-1];v&&v.type==="text"?v.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...g)}else u.push(...g);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(u,!0)};e.patch(c,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Au(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
100
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
101
+ `}]}}const xd=function(e){if(e==null)return TL;if(typeof e=="function")return vd(e);if(typeof e=="object")return Array.isArray(e)?NL(e):PL(e);if(typeof e=="string")return jL(e);throw new Error("Expected function, string, or object as test")};function NL(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=xd(e[n]);return vd(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function PL(e){const t=e;return vd(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function jL(e){return vd(t);function t(n){return n&&n.type===e}}function vd(e){return t;function t(n,r,i){return!!(ML(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function TL(){return!0}function ML(e){return e!==null&&typeof e=="object"&&"type"in e}const WS=[],RL=!0,Vp=!1,DL="skip";function HS(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=xd(i),o=r?-1:1;a(e,void 0,[])();function a(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=WS,g,m,y;if((!t||s(l,c,u[u.length-1]||void 0))&&(p=AL(n(l,u)),p[0]===Vp))return p;if("children"in l&&l.children){const x=l;if(x.children&&p[0]!==DL)for(m=(r?x.children.length:-1)+o,y=u.concat(x);m>-1&&m<x.children.length;){const v=x.children[m];if(g=a(v,m,y)(),g[0]===Vp)return g;m=typeof g[1]=="number"?g[1]:m+o}}return p}}}function AL(e){return Array.isArray(e)?e:typeof e=="number"?[RL,e]:e==null?WS:[e]}function zm(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),HS(e,s,a,i);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return o(l,d,u)}}const Up={}.hasOwnProperty,IL={};function LL(e,t){const n=t||IL,r=new Map,i=new Map,s=new Map,o={...yL,...n.handlers},a={all:c,applyData:FL,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:OL,wrap:zL};return zm(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,f=String(u.identifier).toUpperCase();d.has(f)||d.set(f,u)}}),a;function l(u,d){const f=u.type,p=a.handlers[f];if(Up.call(a.handlers,f)&&p)return p(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(f)){if("children"in u){const{children:m,...y}=u,x=Au(y);return x.children=a.all(u),x}return Au(u)}return(a.options.unknownHandler||$L)(a,u,d)}function c(u){const d=[];if("children"in u){const f=u.children;let p=-1;for(;++p<f.length;){const g=a.one(f[p],u);if(g){if(p&&f[p-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=k0(g.value)),!Array.isArray(g)&&g.type==="element")){const m=g.children[0];m&&m.type==="text"&&(m.value=k0(m.value))}Array.isArray(g)?d.push(...g):d.push(g)}}}return d}}function OL(e,t){e.position&&(t.position=CD(e))}function FL(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,Au(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function $L(e,t){const n=t.data||{},r="value"in t&&!(Up.call(n,"hProperties")||Up.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 zL(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
102
+ `});++r<e.length;)r&&n.push({type:"text",value:`
103
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
104
+ `}),n}function k0(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function S0(e,t){const n=LL(e,t),r=n.one(e,void 0),i=EL(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
105
+ `},i),s}function BL(e,t){return e&&"run"in e?async function(n,r){const i=S0(n,{file:r,...t});await e.run(i,r)}:function(n,r){return S0(n,{file:r,...e||t})}}function C0(e){if(e)throw e}var Mc=Object.prototype.hasOwnProperty,VS=Object.prototype.toString,E0=Object.defineProperty,N0=Object.getOwnPropertyDescriptor,P0=function(t){return typeof Array.isArray=="function"?Array.isArray(t):VS.call(t)==="[object Array]"},j0=function(t){if(!t||VS.call(t)!=="[object Object]")return!1;var n=Mc.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Mc.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Mc.call(t,i)},T0=function(t,n){E0&&n.name==="__proto__"?E0(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},M0=function(t,n){if(n==="__proto__")if(Mc.call(t,n)){if(N0)return N0(t,n).value}else return;return t[n]},WL=function e(){var t,n,r,i,s,o,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=M0(a,n),i=M0(t,n),a!==i&&(u&&i&&(j0(i)||(s=P0(i)))?(s?(s=!1,o=r&&P0(r)?r:[]):o=r&&j0(r)?r:{},T0(a,{name:n,newValue:e(u,o,i)})):typeof i<"u"&&T0(a,{name:n,newValue:i}));return a};const Th=hg(WL);function qp(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 HL(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...c){const u=e[++s];let d=-1;if(l){o(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?VL(u,a)(...c):o(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function VL(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(i);try{l=e.apply(this,o)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const Kn={basename:UL,dirname:qL,extname:GL,join:KL,sep:"/"};function UL(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');bl(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function qL(e){if(bl(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 GL(e){bl(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function KL(...e){let t=-1,n;for(;++t<e.length;)bl(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":YL(n)}function YL(e){bl(e);const t=e.codePointAt(0)===47;let n=XL(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function XL(e,t){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function bl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const JL={cwd:QL};function QL(){return"/"}function Gp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ZL(e){if(typeof e=="string")e=new URL(e);else if(!Gp(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 eO(e)}function eO(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 i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const Mh=["history","path","basename","stem","extname","dirname"];class US{constructor(t){let n;t?Gp(t)?n={path:t}:typeof t=="string"||tO(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":JL.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Mh.length;){const s=Mh[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)Mh.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Kn.basename(this.path):void 0}set basename(t){Dh(t,"basename"),Rh(t,"basename"),this.path=Kn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Kn.dirname(this.path):void 0}set dirname(t){R0(this.basename,"dirname"),this.path=Kn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Kn.extname(this.path):void 0}set extname(t){if(Rh(t,"extname"),R0(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=Kn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Gp(t)&&(t=ZL(t)),Dh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Kn.basename(this.path,this.extname):void 0}set stem(t){Dh(t,"stem"),Rh(t,"stem"),this.path=Kn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Dt(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Rh(e,t){if(e&&e.includes(Kn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Kn.sep+"`")}function Dh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function R0(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function tO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const nO=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},rO={}.hasOwnProperty;class Bm extends nO{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=HL()}copy(){const t=new Bm;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Th(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Lh("data",this.frozen),this.namespace[t]=n,this):rO.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Lh("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 i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Ql(t),r=this.parser||this.Parser;return Ah("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ah("process",this.parser||this.Parser),Ih("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=Ql(t),l=r.parse(a);r.run(l,a,function(u,d,f){if(u||!d||!f)return c(u);const p=d,g=r.stringify(p,f);oO(g)?f.value=g:f.result=g,c(u,f)});function c(u,d){u||!d?o(u):s?s(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Ah("processSync",this.parser||this.Parser),Ih("processSync",this.compiler||this.Compiler),this.process(t,i),A0("processSync","process",n),r;function i(s,o){n=!0,C0(s),r=o}}run(t,n,r){D0(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=Ql(n);i.run(t,l,c);function c(u,d,f){const p=d||t;u?a(u):o?o(p):r(void 0,p,f)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),A0("runSync","run",r),i;function s(o,a){C0(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=Ql(n),i=this.compiler||this.Compiler;return Ih("stringify",i),D0(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Lh("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))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");a(c.plugins),c.settings&&(i.settings=Th(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];s(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===c){f=d;break}if(f===-1)r.push([c,...u]);else if(u.length>0){let[p,...g]=u;const m=r[f][1];qp(m)&&qp(p)&&(p=Th(!0,m,p)),r[f]=[c,p,...g]}}}}const iO=new Bm().freeze();function Ah(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Ih(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Lh(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 D0(e){if(!qp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function A0(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Ql(e){return sO(e)?e:new US(e)}function sO(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function oO(e){return typeof e=="string"||aO(e)}function aO(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const lO="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",I0=[],L0={allowDangerousHtml:!0},cO=/^(https?|ircs?|mailto|xmpp)$/i,uO=[{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 yd(e){const t=dO(e),n=hO(e);return fO(t.runSync(t.parse(n),n),e)}function dO(e){const t=e.rehypePlugins||I0,n=e.remarkPlugins||I0,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...L0}:L0;return iO().use(GI).use(n).use(BL,r).use(t)}function hO(e){const t=e.children||"",n=new US;return typeof t=="string"&&(n.value=t),n}function fO(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||pO;for(const u of uO)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+lO+u.id,void 0);return zm(e,c),TD(e,{Fragment:h.Fragment,components:i,ignoreInvalidStyle:!0,jsx:h.jsx,jsxs:h.jsxs,passKeys:!0,passNode:!0});function c(u,d,f){if(u.type==="raw"&&f&&typeof d=="number")return o?f.children.splice(d,1):f.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let p;for(p in Nh)if(Object.hasOwn(Nh,p)&&Object.hasOwn(u.properties,p)){const g=u.properties[p],m=Nh[p];(m===null||m.includes(u.tagName))&&(u.properties[p]=l(String(g||""),p,u))}}if(u.type==="element"){let p=n?!n.includes(u.tagName):s?s.includes(u.tagName):!1;if(!p&&r&&typeof d=="number"&&(p=!r(u,d,f)),p&&f&&typeof d=="number")return a&&u.children?f.children.splice(d,1,...u.children):f.children.splice(d,1),d}}}function pO(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||cO.test(e.slice(0,t))?e:""}function O0(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function gO(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function qS(e,t,n){const i=xd((n||{}).ignore||[]),s=mO(t);let o=-1;for(;++o<s.length;)HS(e,"text",a);function a(c,u){let d=-1,f;for(;++d<u.length;){const p=u[d],g=f?f.children:void 0;if(i(p,g?g.indexOf(p):void 0,f))return;f=p}if(f)return l(c,u)}function l(c,u){const d=u[u.length-1],f=s[o][0],p=s[o][1];let g=0;const y=d.children.indexOf(c);let x=!1,v=[];f.lastIndex=0;let b=f.exec(c.value);for(;b;){const S=b.index,k={index:b.index,input:b.input,stack:[...u,c]};let _=p(...b,k);if(typeof _=="string"&&(_=_.length>0?{type:"text",value:_}:void 0),_===!1?f.lastIndex=S+1:(g!==S&&v.push({type:"text",value:c.value.slice(g,S)}),Array.isArray(_)?v.push(..._):_&&v.push(_),g=S+b[0].length,x=!0),!f.global)break;b=f.exec(c.value)}return x?(g<c.value.length&&v.push({type:"text",value:c.value.slice(g)}),d.children.splice(y,1,...v)):v=[c],y+v.length}}function mO(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 i=n[r];t.push([xO(i[0]),vO(i[1])])}return t}function xO(e){return typeof e=="string"?new RegExp(gO(e),"g"):e}function vO(e){return typeof e=="function"?e:function(){return e}}const Oh="phrasing",Fh=["autolink","link","image","label"];function yO(){return{transforms:[EO],enter:{literalAutolink:_O,literalAutolinkEmail:$h,literalAutolinkHttp:$h,literalAutolinkWww:$h},exit:{literalAutolink:CO,literalAutolinkEmail:SO,literalAutolinkHttp:wO,literalAutolinkWww:kO}}}function bO(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Oh,notInConstruct:Fh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Oh,notInConstruct:Fh},{character:":",before:"[ps]",after:"\\/",inConstruct:Oh,notInConstruct:Fh}]}}function _O(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function $h(e){this.config.enter.autolinkProtocol.call(this,e)}function wO(e){this.config.exit.autolinkProtocol.call(this,e)}function kO(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 SO(e){this.config.exit.autolinkEmail.call(this,e)}function CO(e){this.exit(e)}function EO(e){qS(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,NO],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),PO]],{ignore:["link","linkReference"]})}function NO(e,t,n,r,i){let s="";if(!GS(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!jO(n)))return!1;const o=TO(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function PO(e,t,n,r){return!GS(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function jO(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 TO(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 i=O0(e,"(");let s=O0(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function GS(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||es(n)||pd(n))&&(!t||n!==47)}KS.peek=$O;function MO(){this.buffer()}function RO(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function DO(){this.buffer()}function AO(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function IO(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=zn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function LO(e){this.exit(e)}function OO(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=zn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function FO(e){this.exit(e)}function $O(){return"["}function KS(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),a(),o(),s+=i.move("]"),s}function zO(){return{enter:{gfmFootnoteCallString:MO,gfmFootnoteCall:RO,gfmFootnoteDefinitionLabelString:DO,gfmFootnoteDefinition:AO},exit:{gfmFootnoteCallString:IO,gfmFootnoteCall:LO,gfmFootnoteDefinitionLabelString:OO,gfmFootnoteDefinition:FO}}}function BO(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:KS},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const a=s.createTracker(o);let l=a.move("[^");const c=s.enter("footnoteDefinition"),u=s.enter("label");return l+=a.move(s.safe(s.associationId(r),{before:l,after:"]"})),u(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
106
+ `:" ")+s.indentLines(s.containerFlow(r,a.current()),t?YS:WO))),c(),l}}function WO(e,t,n){return t===0?e:YS(e,t,n)}function YS(e,t,n){return(n?"":" ")+e}const HO=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];XS.peek=KO;function VO(){return{canContainEols:["delete"],enter:{strikethrough:qO},exit:{strikethrough:GO}}}function UO(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:HO}],handlers:{delete:XS}}}function qO(e){this.enter({type:"delete",children:[]},e)}function GO(e){this.exit(e)}function XS(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function KO(){return"~"}function YO(e){return e.length}function XO(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||YO,s=[],o=[],a=[],l=[];let c=0,u=-1;for(;++u<e.length;){const m=[],y=[];let x=-1;for(e[u].length>c&&(c=e[u].length);++x<e[u].length;){const v=JO(e[u][x]);if(n.alignDelimiters!==!1){const b=i(v);y[x]=b,(l[x]===void 0||b>l[x])&&(l[x]=b)}m.push(v)}o[u]=m,a[u]=y}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<c;)s[d]=F0(r[d]);else{const m=F0(r);for(;++d<c;)s[d]=m}d=-1;const f=[],p=[];for(;++d<c;){const m=s[d];let y="",x="";m===99?(y=":",x=":"):m===108?y=":":m===114&&(x=":");let v=n.alignDelimiters===!1?1:Math.max(1,l[d]-y.length-x.length);const b=y+"-".repeat(v)+x;n.alignDelimiters!==!1&&(v=y.length+v+x.length,v>l[d]&&(l[d]=v),p[d]=v),f[d]=b}o.splice(1,0,f),a.splice(1,0,p),u=-1;const g=[];for(;++u<o.length;){const m=o[u],y=a[u];d=-1;const x=[];for(;++d<c;){const v=m[d]||"";let b="",S="";if(n.alignDelimiters!==!1){const k=l[d]-(y[d]||0),_=s[d];_===114?b=" ".repeat(k):_===99?k%2?(b=" ".repeat(k/2+.5),S=" ".repeat(k/2-.5)):(b=" ".repeat(k/2),S=b):S=" ".repeat(k)}n.delimiterStart!==!1&&!d&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&v==="")&&(n.delimiterStart!==!1||d)&&x.push(" "),n.alignDelimiters!==!1&&x.push(b),x.push(v),n.alignDelimiters!==!1&&x.push(S),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||d!==c-1)&&x.push("|")}g.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return g.join(`
107
+ `)}function JO(e){return e==null?"":String(e)}function F0(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 QO(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),ZO);return i(),o}function ZO(e,t,n){return">"+(n?"":" ")+e}function eF(e,t){return $0(e,t.inConstruct,!0)&&!$0(e,t.notInConstruct,!1)}function $0(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 z0(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
108
+ `&&eF(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
109
+ `}function tF(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function nF(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 rF(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 iF(e,t,n,r){const i=rF(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(nF(e,n)){const d=n.enter("codeIndented"),f=n.indentLines(s,sF);return d(),f}const a=n.createTracker(r),l=i.repeat(Math.max(tF(s,i)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const d=n.enter(`codeFencedLang${o}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:`
110
+ `,encode:["`"],...a.current()})),d()}return u+=a.move(`
111
+ `),s&&(u+=a.move(s+`
112
+ `)),u+=a.move(l),c(),u}function sF(e,t,n){return(n?"":" ")+e}function Wm(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 oF(e,t,n,r){const i=Wm(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
113
+ `,...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),o(),c}function aF(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 il(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Iu(e,t,n){const r=lo(e),i=lo(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}JS.peek=lF;function JS(e,t,n,r){const i=aF(n),s=n.enter("emphasis"),o=n.createTracker(r),a=o.move(i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const c=l.charCodeAt(0),u=Iu(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=il(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=Iu(r.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+il(d));const p=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},a+l+p}function lF(e,t,n){return n.options.emphasis||"*"}function cF(e,t){let n=!1;return zm(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Vp}),!!((!e.depth||e.depth<3)&&Dm(e)&&(t.options.setext||n))}function uF(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(cF(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),f=n.containerPhrasing(e,{...s.current(),before:`
114
+ `,after:`
115
+ `});return d(),u(),f+`
116
+ `+(i===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(`
117
+ `))+1))}const o="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
118
+ `,...s.current()});return/^[\t ]/.test(c)&&(c=il(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c}QS.peek=dF;function QS(e){return e.value||""}function dF(){return"<"}ZS.peek=hF;function ZS(e,t,n,r){const i=Wm(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),o(),c}function hF(){return"!"}eC.peek=fF;function eC(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function fF(){return"!"}tC.peek=pF;function tC(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function pF(){return"`"}function nC(e,t){const n=Dm(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))}rC.peek=gF;function rC(e,t,n,r){const i=Wm(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(nC(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),a(),n.stack=u,d}a=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),l()),c+=o.move(")"),a(),c}function gF(e,t,n){return nC(e,n)?"<":"["}iC.peek=mF;function iC(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function mF(){return"["}function Hm(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 xF(e){const t=Hm(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 vF(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 sC(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 yF(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?vF(n):Hm(n);const a=e.ordered?o==="."?")":".":xF(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&u&&(!u.children||!u.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&&(l=!0),sC(n)===o&&u){let d=-1;for(;++d<e.children.length;){const f=e.children[d];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const c=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),c}function bF(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 _F(e,t,n,r){const i=bF(n);let s=n.bulletCurrent||Hm(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(d,f,p){return f?(p?"":" ".repeat(o))+d:(p?s:s+" ".repeat(o-s.length))+d}}function wF(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const kF=xd(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function SF(e,t,n,r){return(e.children.some(function(o){return kF(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function CF(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}oC.peek=EF;function oC(e,t,n,r){const i=CF(n),s=n.enter("strong"),o=n.createTracker(r),a=o.move(i+i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const c=l.charCodeAt(0),u=Iu(r.before.charCodeAt(r.before.length-1),c,i);u.inside&&(l=il(c)+l.slice(1));const d=l.charCodeAt(l.length-1),f=Iu(r.after.charCodeAt(0),d,i);f.inside&&(l=l.slice(0,-1)+il(d));const p=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},a+l+p}function EF(e,t,n){return n.options.strong||"*"}function NF(e,t,n,r){return n.safe(e.value,r)}function PF(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 jF(e,t,n){const r=(sC(n)+(n.options.ruleSpaces?" ":"")).repeat(PF(n));return n.options.ruleSpaces?r.slice(0,-1):r}const aC={blockquote:QO,break:z0,code:iF,definition:oF,emphasis:JS,hardBreak:z0,heading:uF,html:QS,image:ZS,imageReference:eC,inlineCode:tC,link:rC,linkReference:iC,list:yF,listItem:_F,paragraph:wF,root:SF,strong:oC,text:NF,thematicBreak:jF};function TF(){return{enter:{table:MF,tableData:B0,tableHeader:B0,tableRow:DF},exit:{codeText:AF,table:RF,tableData:zh,tableHeader:zh,tableRow:zh}}}function MF(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 RF(e){this.exit(e),this.data.inTable=void 0}function DF(e){this.enter({type:"tableRow",children:[]},e)}function zh(e){this.exit(e)}function B0(e){this.enter({type:"tableCell",children:[]},e)}function AF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,IF));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function IF(e,t){return t==="|"?t:e}function LF(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
119
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:o,tableCell:l,tableRow:a}};function o(p,g,m,y){return c(u(p,m,y),p.align)}function a(p,g,m,y){const x=d(p,m,y),v=c([x]);return v.slice(0,v.indexOf(`
120
+ `))}function l(p,g,m,y){const x=m.enter("tableCell"),v=m.enter("phrasing"),b=m.containerPhrasing(p,{...y,before:s,after:s});return v(),x(),b}function c(p,g){return XO(p,{align:g,alignDelimiters:r,padding:n,stringLength:i})}function u(p,g,m){const y=p.children;let x=-1;const v=[],b=g.enter("table");for(;++x<y.length;)v[x]=d(y[x],g,m);return b(),v}function d(p,g,m){const y=p.children;let x=-1;const v=[],b=g.enter("tableRow");for(;++x<y.length;)v[x]=l(y[x],p,g,m);return b(),v}function f(p,g,m){let y=aC.inlineCode(p,g,m);return m.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function OF(){return{exit:{taskListCheckValueChecked:W0,taskListCheckValueUnchecked:W0,paragraph:$F}}}function FF(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:zF}}}function W0(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function $F(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 i=t.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===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 zF(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=aC.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+o}}function BF(){return[yO(),zO(),VO(),TF(),OF()]}function WF(e){return{extensions:[bO(),BO(e),UO(),LF(e),FF()]}}const HF={tokenize:YF,partial:!0},lC={tokenize:XF,partial:!0},cC={tokenize:JF,partial:!0},uC={tokenize:QF,partial:!0},VF={tokenize:ZF,partial:!0},dC={name:"wwwAutolink",tokenize:GF,previous:fC},hC={name:"protocolAutolink",tokenize:KF,previous:pC},Mr={name:"emailAutolink",tokenize:qF,previous:gC},or={};function UF(){return{text:or}}let Ei=48;for(;Ei<123;)or[Ei]=Mr,Ei++,Ei===58?Ei=65:Ei===91&&(Ei=97);or[43]=Mr;or[45]=Mr;or[46]=Mr;or[95]=Mr;or[72]=[Mr,hC];or[104]=[Mr,hC];or[87]=[Mr,dC];or[119]=[Mr,dC];function qF(e,t,n){const r=this;let i,s;return o;function o(d){return!Kp(d)||!gC.call(r,r.previous)||Vm(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return Kp(d)?(e.consume(d),a):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(VF,u,c)(d):d===45||d===95||jt(d)?(s=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return s&&i&&$t(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function GF(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!fC.call(r,r.previous)||Vm(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(HF,e.attempt(lC,e.attempt(cC,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function KF(e,t,n){const r=this;let i="",s=!1;return o;function o(d){return(d===72||d===104)&&pC.call(r,r.previous)&&!Vm(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if($t(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){const f=i.toLowerCase();if(f==="http"||f==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),s?c:(s=!0,l)):n(d)}function c(d){return d===null||Ru(d)||Ae(d)||es(d)||pd(d)?n(d):e.attempt(lC,e.attempt(cC,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function YF(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function XF(e,t,n){let r,i,s;return o;function o(c){return c===46||c===95?e.check(uC,l,a)(c):c===null||Ae(c)||es(c)||c!==45&&pd(c)?l(c):(s=!0,e.consume(c),o)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),o}function l(c){return i||r||!s?n(c):t(c)}}function JF(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(uC,t,s)(o):o===null||Ae(o)||es(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function QF(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||Ae(a)||es(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||Ae(a)||es(a)?t(a):r(a)}function s(a){return $t(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):$t(a)?(e.consume(a),o):n(a)}}function ZF(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return jt(s)?n(s):t(s)}}function fC(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ae(e)}function pC(e){return!$t(e)}function gC(e){return!(e===47||Kp(e))}function Kp(e){return e===43||e===45||e===46||e===95||jt(e)}function Vm(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 e$={tokenize:l$,partial:!0};function t$(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:s$,continuation:{tokenize:o$},exit:a$}},text:{91:{name:"gfmFootnoteCall",tokenize:i$},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:n$,resolveTo:r$}}}}function n$(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const c=zn(r.sliceSerialize({start:o.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function r$(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)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function i$(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(s>999||d===93&&!o||d===null||d===91||Ae(d))return n(d);if(d===93){e.exit("chunkString");const f=e.exit("gfmFootnoteCallString");return i.includes(zn(r.sliceSerialize(f)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return Ae(d)||(o=!0),s++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),s++,c):c(d)}}function s$(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(g){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(g){return g===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(g)}function u(g){if(o>999||g===93&&!a||g===null||g===91||Ae(g))return n(g);if(g===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return s=zn(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(g),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),f}return Ae(g)||(a=!0),o++,e.consume(g),g===92?d:u}function d(g){return g===91||g===92||g===93?(e.consume(g),o++,u):u(g)}function f(g){return g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),i.includes(s)||i.push(s),_e(e,p,"gfmFootnoteDefinitionWhitespace")):n(g)}function p(g){return t(g)}}function o$(e,t,n){return e.check(yl,t,e.attempt(e$,t,n))}function a$(e){e.exit("gfmFootnoteDefinition")}function l$(e,t,n){const r=this;return _e(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function c$(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let c=l;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[l][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[l][1].end)},d={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[l][1].start)},f=[["enter",u,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",d,a]],p=a.parser.constructs.insideSpan.null;p&&hn(f,f.length,0,gd(p,o.slice(c+1,l),a)),hn(f,f.length,0,[["exit",d,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",u,a]]),hn(o,c-1,l-c+3,f),l=c+f.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const c=this.previous,u=this.events;let d=0;return f;function f(g){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(g):(o.enter("strikethroughSequenceTemporary"),p(g))}function p(g){const m=lo(c);if(g===126)return d>1?l(g):(o.consume(g),d++,p);if(d<2&&!n)return l(g);const y=o.exit("strikethroughSequenceTemporary"),x=lo(g);return y._open=!x||x===2&&!!m,y._close=!m||m===2&&!!x,a(g)}}}class u${constructor(){this.map=[]}add(t,n,r){d$(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[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 i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function d$(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function h$(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function f$(){return{flow:{null:{name:"table",tokenize:p$,resolveAll:g$}}}}function p$(e,t,n){const r=this;let i=0,s=0,o;return a;function a(w){let M=r.events.length-1;for(;M>-1;){const $=r.events[M][1].type;if($==="lineEnding"||$==="linePrefix")M--;else break}const D=M>-1?r.events[M][1].type:null,F=D==="tableHead"||D==="tableRow"?_:l;return F===_&&r.parser.lazy[r.now().line]?n(w):F(w)}function l(w){return e.enter("tableHead"),e.enter("tableRow"),c(w)}function c(w){return w===124||(o=!0,s+=1),u(w)}function u(w){return w===null?n(w):oe(w)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),p):n(w):pe(w)?_e(e,u,"whitespace")(w):(s+=1,o&&(o=!1,i+=1),w===124?(e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),o=!0,u):(e.enter("data"),d(w)))}function d(w){return w===null||w===124||Ae(w)?(e.exit("data"),u(w)):(e.consume(w),w===92?f:d)}function f(w){return w===92||w===124?(e.consume(w),d):d(w)}function p(w){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(w):(e.enter("tableDelimiterRow"),o=!1,pe(w)?_e(e,g,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):g(w))}function g(w){return w===45||w===58?y(w):w===124?(o=!0,e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),m):k(w)}function m(w){return pe(w)?_e(e,y,"whitespace")(w):y(w)}function y(w){return w===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(w),e.exit("tableDelimiterMarker"),x):w===45?(s+=1,x(w)):w===null||oe(w)?S(w):k(w)}function x(w){return w===45?(e.enter("tableDelimiterFiller"),v(w)):k(w)}function v(w){return w===45?(e.consume(w),v):w===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(w),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(w))}function b(w){return pe(w)?_e(e,S,"whitespace")(w):S(w)}function S(w){return w===124?g(w):w===null||oe(w)?!o||i!==s?k(w):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(w)):k(w)}function k(w){return n(w)}function _(w){return e.enter("tableRow"),C(w)}function C(w){return w===124?(e.enter("tableCellDivider"),e.consume(w),e.exit("tableCellDivider"),C):w===null||oe(w)?(e.exit("tableRow"),t(w)):pe(w)?_e(e,C,"whitespace")(w):(e.enter("data"),P(w))}function P(w){return w===null||w===124||Ae(w)?(e.exit("data"),C(w)):(e.consume(w),w===92?j:P)}function j(w){return w===92||w===124?(e.consume(w),P):P(w)}}function g$(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,c,u,d;const f=new u$;for(;++n<e.length;){const p=e[n],g=p[1];p[0]==="enter"?g.type==="tableHead"?(a=!1,l!==0&&(H0(f,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(n,0,[["enter",c,t]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(r=!0,d=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(n,0,[["enter",u,t]])),i=g.type==="tableDelimiterRow"?2:u?3:1):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],d=Zl(f,t,s,i,void 0,d),s=[0,0,0,0]),o[2]=n)):g.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],d=Zl(f,t,s,i,void 0,d)),s=o,o=[s[1],n,0,0])):g.type==="tableHead"?(a=!0,l=n):g.type==="tableRow"||g.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],d=Zl(f,t,s,i,n,d)):o[1]!==0&&(d=Zl(f,t,o,i,n,d)),i=0):i&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&H0(f,t,l,c,u),f.consume(t.events),n=-1;++n<t.events.length;){const p=t.events[n];p[0]==="enter"&&p[1].type==="table"&&(p[1]._align=h$(t.events,n))}return e}function Zl(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},ws(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=ws(t.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=ws(t.events,n[2]),u=ws(t.events,n[3]),d={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const f=t.events[n[2]],p=t.events[n[3]];if(f[1].end=Object.assign({},p[1].end),f[1].type="chunkText",f[1].contentType="text",n[3]>n[2]+1){const g=n[2]+1,m=n[3]-n[2]-1;e.add(g,m,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(s.end=Object.assign({},ws(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function H0(e,t,n,r,i){const s=[],o=ws(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function ws(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const m$={name:"tasklistCheck",tokenize:v$};function x$(){return{text:{91:m$}}}function v$(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return Ae(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return oe(l)?t(l):pe(l)?e.check({tokenize:y$},t,n)(l):n(l)}}function y$(e,t,n){return _e(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function b$(e){return SS([UF(),t$(),c$(e),f$(),x$()])}const _$={};function mC(e){const t=this,n=e||_$,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(b$(n)),s.push(BF()),o.push(WF(n))}function w$(e){qS(e,[/\r?\n|\r/g,k$])}function k$(){return{type:"break"}}function S$(){return function(e){w$(e)}}let Rc=[];const Dc=[];function C$(e){Rc.some(t=>t.id===e.id)||(Rc=[...Rc,e],Dc.forEach(t=>t()))}function xC(){return Rc}function vC(e){return Dc.push(e),()=>{const t=Dc.indexOf(e);t>=0&&Dc.splice(t,1)}}function V0({title:e,icon:t,count:n,defaultOpen:r=!1,children:i,accentClass:s}){const[o,a]=E.useState(r);return h.jsxs("div",{className:`rounded-md overflow-hidden transition-colors ${o?"bg-surface-container-high":"bg-surface-container"}`,children:[h.jsxs("button",{onClick:()=>a(l=>!l),className:"w-full flex items-center gap-3 px-4 py-3 group transition-colors hover:brightness-110",children:[h.jsx("span",{className:"text-[13px] opacity-60 group-hover:opacity-100 transition-opacity",children:t}),h.jsx("span",{className:`text-[11px] uppercase tracking-[0.14em] font-medium flex-1 text-left ${s??"text-on-surface-variant"}`,children:e}),n!==void 0&&n>0&&h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/70 tabular-nums",children:n}),h.jsx("svg",{className:"w-3 h-3 text-on-surface-variant/70 transition-transform duration-200",style:{transform:o?"rotate(90deg)":"none"},viewBox:"0 0 16 16",fill:"currentColor",children:h.jsx("path",{d:"M6 3l5 5-5 5V3z"})})]}),h.jsx("div",{className:"grid transition-[grid-template-rows] duration-200",style:{gridTemplateRows:o?"1fr":"0fr"},children:h.jsx("div",{className:"overflow-hidden",children:h.jsx("div",{className:"px-4 pb-4 pt-0.5",children:i})})})]})}function vn({icon:e,label:t,active:n,onClick:r}){return h.jsxs("button",{onClick:r,className:`w-full rounded-md flex items-center gap-3 px-4 py-3 transition-colors ${n?"bg-surface-container-high border border-outline-variant/40 text-on-surface":"bg-surface-container-low text-on-surface-variant hover:bg-surface-container hover:text-on-surface"}`,children:[h.jsx("span",{className:"text-[13px]",children:e}),h.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] font-medium",children:t}),n&&h.jsx("span",{className:"ml-auto h-1.5 w-1.5 rounded-full bg-secondary"})]})}const Bh="rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 font-mono transition-shadow";function E$({agentId:e,agent:t,agentDisplayName:n,connected:r,secretNames:i,setSecretNames:s,isWiping:o,isSending:a,onWipe:l,mainView:c,onViewChange:u}){const{t:d}=we(),[f,p]=E.useState({name:"",value:""}),g=E.useSyncExternalStore(vC,xC),m=i.includes(f.name);return h.jsxs("aside",{className:"w-72 flex-shrink-0 flex flex-col gap-1 overflow-y-auto pr-1 pb-4 scrollbar-thin",children:[h.jsx("div",{className:"rounded-md bg-surface-container-lowest border border-outline-variant/40 px-3 py-2.5 relative overflow-hidden",children:h.jsxs("div",{className:"flex items-center justify-between relative",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"font-headline text-[15px] font-semibold text-on-surface tracking-[-0.01em] truncate",children:n??t.name}),h.jsx("p",{className:"font-mono text-[9px] text-primary/50 mt-0.5 truncate",children:t.model})]}),h.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0 ml-3",children:[h.jsx("span",{className:`font-mono text-[9px] ${r?"text-secondary/80":"text-on-surface-variant/70"}`,title:r?"WS connected":"WS disconnected",children:r?"●":"○"}),h.jsx("span",{className:`rounded-full px-1.5 py-[2px] text-[8px] font-semibold uppercase tracking-[0.1em]
121
+ ${t.status==="active"?"bg-secondary-container text-on-primary":"bg-surface-container text-on-surface-variant/60"}`,children:t.status})]})]})}),h.jsx(vn,{icon:"💬",label:d("agentSettings.views.chat"),active:c==="chat",onClick:()=>u("chat")}),h.jsx(vn,{icon:"▦",label:d("agentSettings.views.tasks"),active:c==="tasks",onClick:()=>u("tasks")}),h.jsx(vn,{icon:"🧩",label:d("agentSettings.views.skills"),active:c==="skills",onClick:()=>u("skills")}),h.jsx(vn,{icon:"🌐",label:d("agentSettings.views.browser"),active:c==="browser",onClick:()=>u("browser")}),h.jsx(vn,{icon:"📂",label:d("agentSettings.views.files"),active:c==="files",onClick:()=>u("files")}),h.jsx(vn,{icon:"⚡",label:d("agentSettings.views.workflows"),active:c==="workflows",onClick:()=>u("workflows")}),h.jsx(vn,{icon:"⏰",label:d("agentSettings.views.schedules"),active:c==="schedules",onClick:()=>u("schedules")}),h.jsx(vn,{icon:"📡",label:d("agentSettings.views.monitor"),active:c==="monitor",onClick:()=>u("monitor")}),h.jsx(vn,{icon:"📊",label:d("agentSettings.views.usage"),active:c==="usage",onClick:()=>u("usage")}),h.jsx(vn,{icon:"📋",label:d("agentSettings.views.logs"),active:c==="logs",onClick:()=>u("logs")}),h.jsx(vn,{icon:"🔌",label:d("agentSettings.views.integrations"),active:c==="integrations",onClick:()=>u("integrations")}),g.map(y=>h.jsx(vn,{icon:y.icon,label:y.label,active:c===y.id,onClick:()=>u(y.id)},y.id)),h.jsxs("div",{"data-testid":"guardian-coming-soon",className:"w-full rounded-md flex items-center gap-3 px-4 py-3 bg-surface-container-lowest cursor-default opacity-50 relative",children:[h.jsx("span",{className:"text-[13px]",children:"🛡"}),h.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] font-medium text-on-surface-variant/70",children:d("agentSettings.views.guardian")}),h.jsx("span",{className:"ml-auto rounded-full bg-amber-400/10 border border-amber-400/20 px-1.5 py-[1px] font-mono text-[7px] text-warning uppercase tracking-widest",children:d("agentSettings.comingSoon")})]}),h.jsx("div",{className:"h-px bg-surface-container mx-2 my-1"}),h.jsx(V0,{title:d("agentSettings.secrets"),icon:h.jsx("span",{children:"🔐"}),count:i.length,children:h.jsxs("div",{className:"space-y-2.5",children:[i.length>0&&h.jsx("div",{className:"flex flex-col",children:i.map(y=>h.jsxs("div",{className:"group flex items-center justify-between py-[5px] px-2 -mx-2 rounded transition-colors hover:bg-surface-container/50",children:[h.jsxs("span",{className:`font-mono text-[11px] cursor-pointer transition-colors ${f.name===y?"text-primary":"text-on-surface/70 hover:text-primary/80"}`,onClick:()=>p({name:y,value:""}),title:"Click to update value",children:[h.jsx("span",{className:"text-on-surface-variant/60",children:"🔒 "}),y]}),h.jsx("button",{onClick:async()=>{await iS(e,y),s(x=>x.filter(v=>v!==y)),f.name===y&&p({name:"",value:""})},className:"text-[9px] text-transparent group-hover:text-on-surface-variant/70 hover:!text-error transition-colors flex-shrink-0 ml-2",title:`Remove ${y}`,children:"×"})]},y))}),i.length===0&&h.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant italic",children:d("agentSettings.noSecrets")}),m?h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsx("p",{className:"font-mono text-[9px] text-primary/50",children:d("agentSettings.updating",{name:f.name})}),h.jsxs("div",{className:"flex gap-1.5",children:[h.jsx("input",{type:"password",className:`${Bh} flex-1 min-w-0`,placeholder:d("agentSettings.newValue"),value:f.value,onChange:y=>p(x=>({...x,value:y.target.value}))}),h.jsx("button",{onClick:async()=>{f.value.trim()&&(await Rp(e,f.name.trim(),f.value.trim()),p({name:"",value:""}))},disabled:!f.value.trim(),className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface-variant transition-all disabled:opacity-20 hover:bg-surface-container hover:text-on-surface flex-shrink-0",children:d("agentSettings.save")}),h.jsx("button",{onClick:()=>p({name:"",value:""}),className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface-variant/60 hover:text-on-surface-variant/70 transition-colors flex-shrink-0",children:"×"})]})]}):h.jsxs("div",{className:"flex gap-1.5",children:[h.jsx("input",{className:`${Bh} flex-1 min-w-0`,placeholder:d("agentSettings.secretNamePlaceholder"),value:f.name,onChange:y=>p(x=>({...x,name:y.target.value}))}),h.jsx("input",{type:"password",className:`${Bh} flex-1 min-w-0`,placeholder:d("agentSettings.secretValuePlaceholder"),value:f.value,onChange:y=>p(x=>({...x,value:y.target.value}))}),h.jsx("button",{onClick:async()=>{!f.name.trim()||!f.value.trim()||(await Rp(e,f.name.trim(),f.value.trim()),s(y=>[...y.filter(x=>x!==f.name.trim()),f.name.trim()]),p({name:"",value:""}))},disabled:!f.name.trim()||!f.value.trim(),className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface-variant transition-all disabled:opacity-20 hover:bg-surface-container hover:text-on-surface flex-shrink-0",children:"+"})]})]})}),t.guardrails&&t.guardrails.length>0&&h.jsx(V0,{title:d("agentSettings.guardrails"),icon:h.jsx("span",{children:"🛡"}),count:t.guardrails.length,accentClass:"text-warning/60",children:h.jsxs("div",{className:"space-y-2.5",children:[h.jsx("div",{className:"flex flex-col gap-2",children:t.guardrails.map((y,x)=>h.jsxs("div",{className:"flex items-start gap-2.5",children:[h.jsx("span",{className:"text-amber-500/30 text-[8px] mt-[3px] select-none",children:"●"}),h.jsx("span",{className:"font-mono text-[11px] text-warning/50 leading-relaxed",children:y})]},x))}),h.jsx("p",{className:"font-mono text-[8px] text-on-surface-variant/20 uppercase tracking-[0.15em]",children:d("agentSettings.guardrailsBlurb")})]})}),h.jsxs("div",{className:"mt-auto pt-1 space-y-1",children:[h.jsx("a",{href:cR(e),download:!0,className:"block w-full rounded-md bg-surface-container-lowest px-3 py-2 font-mono text-[10px] text-on-surface-variant/70 transition-all hover:bg-surface-container-lowest border border-outline-variant/40 hover:text-on-surface-variant/70",title:d("agentSettings.exportTitle"),children:d("agentSettings.exportAgent")}),h.jsx("button",{onClick:l,disabled:o||a,className:"w-full rounded-md bg-surface-container-lowest px-3 py-2 text-left font-mono text-[10px] text-error/40 transition-all hover:bg-error/10 hover:text-error disabled:opacity-20",children:d(o?"agentSettings.wiping":"agentSettings.wipeAgent")})]})]})}function N$({agentId:e}){const{t}=we(),[n,r]=E.useState(""),[i,s]=E.useState([]),[o,a]=E.useState(null),[l,c]=E.useState(""),[u,d]=E.useState(""),[f,p]=E.useState(!1),[g,m]=E.useState(null),y=l!==u,x=E.useCallback(async _=>{try{m(null);const C=await XM(e,_);s(C),r(_),a(null),c(""),d("")}catch(C){m(String(C))}},[e]);E.useEffect(()=>{x("")},[x]);const v=async _=>{try{m(null);const C=await JM(e,_);a(_),c(C),d(C)}catch(C){m(String(C))}},b=async()=>{if(!(!o||!y)){p(!0);try{await QM(e,o,l),d(l)}catch(_){m(String(_))}finally{p(!1)}}},S=_=>{const C=n?`${n}/${_.name}`:_.name;_.type==="directory"?x(C):v(C)},k=n?n.split("/"):[];return h.jsxs("div",{className:"flex flex-1 flex-col rounded-md overflow-hidden min-w-0 bg-surface-container-high",children:[h.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 bg-surface-container",children:[h.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0 overflow-x-auto",children:[h.jsx("button",{onClick:()=>x(""),className:"font-mono text-[11px] text-primary/60 hover:text-primary transition-colors flex-shrink-0",children:t("files.workspace")}),k.map((_,C)=>h.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0",children:[h.jsx("span",{className:"text-on-surface-variant/20 text-[10px]",children:"/"}),h.jsx("button",{onClick:()=>x(k.slice(0,C+1).join("/")),className:"font-mono text-[11px] text-on-surface-variant/60 hover:text-on-surface transition-colors",children:_})]},C)),o&&h.jsxs("span",{className:"flex items-center gap-1 flex-shrink-0",children:[h.jsx("span",{className:"text-on-surface-variant/20 text-[10px]",children:"/"}),h.jsx("span",{className:"font-mono text-[11px] text-on-surface",children:o.split("/").pop()}),y&&h.jsx("span",{className:"text-primary text-[9px]",children:"●"})]})]}),o&&h.jsx("button",{onClick:b,disabled:!y||f,className:`rounded px-3 py-1 text-[11px] font-medium transition-all disabled:opacity-20
122
+ bg-primary/20 text-primary hover:bg-primary/30`,children:t(f?"files.savingLabel":"files.saveButton")}),o&&h.jsx("button",{onClick:()=>{a(null),c(""),d("")},className:"rounded px-2 py-1 text-[11px] text-on-surface-variant/70 hover:text-on-surface-variant transition-colors",children:"×"})]}),g&&h.jsx("div",{className:"px-4 py-2 bg-error/10",children:h.jsx("p",{className:"font-mono text-[10px] text-error/70",children:g})}),o?h.jsx("textarea",{className:"flex-1 w-full resize-none bg-transparent px-4 py-3 font-mono text-[12px] text-on-surface/90 leading-relaxed outline-none",style:{tabSize:2},value:l,onChange:_=>c(_.target.value),spellCheck:!1}):h.jsx("div",{className:"flex-1 overflow-y-auto",children:i.length===0?h.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant/60 p-4 italic",children:t("files.emptyDir")}):h.jsxs("div",{className:"flex flex-col",children:[n&&h.jsxs("button",{onClick:()=>{const _=n.split("/").slice(0,-1).join("/");x(_)},className:"flex items-center gap-3 px-4 py-2 text-left transition-colors hover:bg-surface-container/50",children:[h.jsx("span",{className:"text-[13px] opacity-40",children:"↩"}),h.jsx("span",{className:"font-mono text-[11px] text-on-surface-variant",children:".."})]}),i.map(_=>h.jsxs("button",{onClick:()=>S(_),className:"group flex items-center gap-3 px-4 py-2 text-left transition-colors hover:bg-surface-container/50",children:[h.jsx("span",{className:"text-[13px] opacity-50 group-hover:opacity-80 transition-opacity",children:_.type==="directory"?"📁":"📄"}),h.jsx("span",{className:`font-mono text-[11px] flex-1 truncate ${_.type==="directory"?"text-primary/70":"text-on-surface/70"}`,children:_.name}),_.size!==void 0&&h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/25 tabular-nums",children:_.size<1024?`${_.size}B`:`${(_.size/1024).toFixed(1)}K`})]},_.name))]})})]})}const P$=[{value:"backlog",labelKey:"tasks.statusLabels.backlog"},{value:"in_progress",labelKey:"tasks.statusLabels.inProgress"},{value:"scheduled",labelKey:"tasks.statusLabels.scheduled"},{value:"to_review",labelKey:"tasks.statusLabels.toReview"},{value:"done",labelKey:"tasks.statusLabels.done"},{value:"cancelled",labelKey:"tasks.statusLabels.cancelled"}];function yC(){const{t:e}=we();return t=>{const n=Date.now()-t*1e3,r=Math.floor(n/1e3);if(r<60)return e("tasks.relativeNow");const i=Math.floor(r/60);if(i<60)return e("tasks.relativeMinutes",{n:i});const s=Math.floor(i/60);if(s<24)return e("tasks.relativeHours",{n:s});const o=Math.floor(s/24);return e("tasks.relativeDays",{n:o})}}const Wh="rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 transition-shadow w-full";function Yp({source:e}){return h.jsx("span",{className:`rounded-full px-1.5 py-[2px] text-[8px] font-semibold uppercase tracking-[0.08em] ${e==="agent"?"bg-secondary-container text-on-primary":"bg-primary text-on-surface"}`,children:e})}function j$({comment:e}){const t=yC();return h.jsxs("div",{className:"flex flex-col gap-1 py-3",style:{borderTop:"1px solid rgba(255,255,255,0.04)"},children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Yp,{source:e.source}),h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:t(e.createdAt)})]}),h.jsx("div",{className:"text-[12px] text-on-surface/80 leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:h.jsx(yd,{children:e.body})})]})}function T$({task:e,onClose:t,onUpdate:n,onAddComment:r,onDelete:i}){const{t:s}=we(),o=yC(),[a,l]=E.useState(!1),[c,u]=E.useState(e.title),[d,f]=E.useState(!1),[p,g]=E.useState(e.description),[m,y]=E.useState(""),[x,v]=E.useState(!1),[b,S]=E.useState(!1),[k,_]=E.useState(!1),[C,P]=E.useState(e.id);e.id!==C&&(P(e.id),u(e.title),g(e.description),l(!1),f(!1),y(""));const j=async()=>{if(l(!1),c.trim()&&c.trim()!==e.title){S(!0);try{await n(e.id,{title:c.trim()})}finally{S(!1)}}else u(e.title)},w=async()=>{if(f(!1),p!==e.description){S(!0);try{await n(e.id,{description:p})}finally{S(!1)}}},M=async I=>{S(!0);try{await n(e.id,{status:I})}finally{S(!1)}},D=async()=>{if(m.trim()){v(!0);try{await r(e.id,m.trim()),y("")}finally{v(!1)}}},F=async()=>{if(confirm(s("taskDetail.deleteConfirm",{title:e.title}))){_(!0);try{await i(e.id)}finally{_(!1)}}},$=e.updatedBy!==null&&e.updatedBy!==e.source;return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-40",style:{background:"rgba(0,0,0,0.35)"},onClick:t}),h.jsxs("div",{className:"fixed inset-y-0 right-0 w-[min(840px,92vw)] z-50 flex flex-col overflow-hidden bg-surface-container",style:{boxShadow:"-8px 0 40px rgba(0,0,0,0.5)"},children:[h.jsxs("div",{className:"flex items-center justify-between px-5 py-4 flex-shrink-0",style:{borderBottom:"1px solid rgba(255,255,255,0.05)"},children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx("span",{className:"font-mono text-[10px] text-primary/40 flex-shrink-0",children:e.id}),b&&h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60 animate-pulse",children:s("taskDetail.saving")})]}),h.jsx("button",{onClick:t,className:"text-on-surface-variant/70 hover:text-on-surface transition-colors text-[18px] leading-none flex-shrink-0","aria-label":s("taskDetail.close"),children:"×"})]}),h.jsx("div",{className:"flex-1 overflow-y-auto",children:h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-5",children:[h.jsx("div",{children:a?h.jsx("input",{autoFocus:!0,className:`${Wh} text-[15px] font-semibold font-headline`,value:c,onChange:I=>u(I.target.value),onBlur:j,onKeyDown:I=>{I.key==="Enter"&&j(),I.key==="Escape"&&(l(!1),u(e.title))}}):h.jsx("h2",{className:"font-headline text-[17px] font-semibold text-on-surface tracking-[-0.01em] cursor-pointer hover:text-primary/90 transition-colors",onClick:()=>l(!0),title:"Click to edit",children:e.title})}),h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold",children:s("taskDetail.status")}),h.jsx("select",{value:e.status,onChange:I=>void M(I.target.value),className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface outline-none focus:ring-1 focus:ring-primary/25 cursor-pointer font-mono transition-shadow",children:P$.map(I=>h.jsx("option",{value:I.value,children:s(I.labelKey)},I.value))})]}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"text-[8px] uppercase tracking-[0.15em] text-on-surface-variant/60",children:s("taskDetail.sourceLabel")}),h.jsx(Yp,{source:e.source})]}),$&&e.updatedBy&&h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"text-[8px] uppercase tracking-[0.15em] text-on-surface-variant/60",children:s("taskDetail.editedByLabel")}),h.jsx(Yp,{source:e.updatedBy})]})]}),h.jsxs("div",{className:"flex flex-col gap-1",children:[h.jsxs("p",{className:"font-mono text-[10px] text-on-surface-variant/60",children:[h.jsx("span",{className:"text-on-surface-variant/20",children:s("taskDetail.created")})," ",o(e.createdAt)]}),h.jsxs("p",{className:"font-mono text-[10px] text-on-surface-variant/60",children:[h.jsx("span",{className:"text-on-surface-variant/20",children:s("taskDetail.updated")})," ",o(e.updatedAt)]})]}),h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold",children:s("taskDetail.description")}),d?h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsx("textarea",{autoFocus:!0,className:`${Wh} min-h-[360px] resize-y font-mono text-[12px] leading-relaxed`,value:p,onChange:I=>g(I.target.value),placeholder:s("taskDetail.descPlaceholder")}),h.jsxs("div",{className:"flex gap-1.5",children:[h.jsx("button",{onClick:w,className:"flex-1 rounded bg-primary/15 px-2 py-1.5 text-[10px] text-primary/70 hover:bg-primary/25 transition-colors",children:s("taskDetail.save")}),h.jsx("button",{onClick:()=>{f(!1),g(e.description)},className:"rounded bg-surface-container px-2 py-1.5 text-[10px] text-on-surface-variant/70 hover:text-on-surface-variant/70 transition-colors",children:s("taskDetail.cancel")})]})]}):h.jsx("div",{className:"cursor-pointer group",onClick:()=>f(!0),title:"Click to edit",children:e.description?h.jsx("div",{className:"text-[12px] text-on-surface/70 leading-relaxed prose prose-sm dark:prose-invert max-w-none group-hover:text-on-surface/90 transition-colors",children:h.jsx(yd,{children:e.description})}):h.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant/25 italic group-hover:text-on-surface-variant/70 transition-colors",children:s("taskDetail.descEmpty")})})]}),h.jsxs("div",{className:"flex flex-col gap-0",children:[h.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-1",children:s("taskDetail.commentsLabel",{count:e.comments.length})}),e.comments.length===0&&h.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/25 italic py-2",children:s("taskDetail.noComments")}),e.comments.map(I=>h.jsx(j$,{comment:I},I.id))]}),h.jsxs("div",{className:"flex flex-col gap-1.5",children:[h.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold",children:s("taskDetail.addComment")}),h.jsx("textarea",{className:`${Wh} min-h-[200px] resize-y font-mono text-[12px] leading-relaxed`,placeholder:s("taskDetail.commentPlaceholder"),value:m,onChange:I=>y(I.target.value)}),h.jsx("button",{disabled:!m.trim()||x,onClick:D,className:"self-end rounded bg-primary/15 px-3 py-1.5 text-[10px] text-primary/70 hover:bg-primary/25 transition-colors disabled:opacity-30",children:s(x?"taskDetail.publishing":"taskDetail.publishComment")})]}),h.jsxs("div",{className:"mt-2 pt-4",style:{borderTop:"1px solid rgba(255,255,255,0.04)"},children:[h.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-error/30 font-semibold mb-2",children:s("taskDetail.dangerZone")}),h.jsx("button",{onClick:F,disabled:k,className:"w-full rounded bg-red-950/15 px-3 py-2 text-left font-mono text-[11px] text-error/60 transition-all hover:bg-red-950/30 hover:text-error disabled:opacity-20",children:s(k?"taskDetail.deleting":"taskDetail.deleteTask")})]}),h.jsx("div",{className:"h-4"})]})})]})]})}const M$=[{status:"backlog",labelKey:"tasks.columns.backlog"},{status:"in_progress",labelKey:"tasks.columns.inProgress"},{status:"scheduled",labelKey:"tasks.columns.scheduled"},{status:"to_review",labelKey:"tasks.columns.toReview"},{status:"done",labelKey:"tasks.columns.done"},{status:"cancelled",labelKey:"tasks.columns.cancelled"}];function R$(){const{t:e}=we();return t=>{const n=Date.now()-t*1e3,r=Math.floor(n/1e3);if(r<60)return e("tasks.relativeNow");const i=Math.floor(r/60);if(i<60)return e("tasks.relativeMinutes",{n:i});const s=Math.floor(i/60);if(s<24)return e("tasks.relativeHours",{n:s});const o=Math.floor(s/24);return e("tasks.relativeDays",{n:o})}}function D$(e){return e.replace(/#{1,6}\s/g,"").replace(/(\*\*|__)(.*?)\1/g,"$2").replace(/(\*|_)(.*?)\1/g,"$2").replace(/`{1,3}[^`]*`{1,3}/g,"").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/!\[([^\]]*)\]\([^)]+\)/g,"$1").replace(/^\s*[-*+]\s/gm,"").replace(/^\s*\d+\.\s/gm,"").replace(/\n+/g," ").trim()}function A$({task:e,onDragStart:t,onClick:n}){const{t:r}=we(),i=R$(),s=D$(e.description).slice(0,120),o=e.updatedBy!==null&&e.updatedBy!==e.source;return h.jsxs("div",{draggable:!0,onDragStart:()=>t(e.id),onClick:()=>n(e),className:"rounded-md p-3 cursor-pointer transition-colors hover:brightness-110 select-none bg-surface-container-high",children:[h.jsxs("div",{className:"flex items-center justify-between mb-1.5 gap-1",children:[h.jsx("span",{className:"font-mono text-[9px] text-primary/40 truncate",children:e.id}),h.jsx("span",{className:`flex-shrink-0 rounded-full px-1.5 py-[2px] text-[8px] font-semibold uppercase tracking-[0.08em] ${e.source==="agent"?"bg-secondary-container text-on-primary":"bg-primary text-on-surface"}`,children:e.source})]}),h.jsx("p",{className:"text-[12px] font-semibold text-on-surface leading-tight mb-1",children:e.title}),s&&h.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant leading-snug line-clamp-2 mb-2",children:s}),h.jsxs("div",{className:"flex items-center justify-between gap-1 mt-1",children:[h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:i(e.createdAt)}),o&&h.jsx("span",{className:"font-mono text-[8px] text-warning/50 truncate",children:r("tasks.editedBy",{name:e.updatedBy??""})})]})]})}function I$({agentId:e}){const{t}=we(),[n,r]=E.useState([]),[i,s]=E.useState(null),[o,a]=E.useState(null),[l,c]=E.useState(null),[u,d]=E.useState(""),[f,p]=E.useState(""),g=E.useCallback(async()=>{try{const k=await nR(e);r(k)}catch{}},[e]);E.useEffect(()=>{g();const k=setInterval(()=>{g()},4e3);return()=>clearInterval(k)},[g]);const m=E.useCallback(async k=>{try{const _=await rR(e,k.id);s(_)}catch{s({...k,comments:[]})}},[e]),y=E.useCallback(async k=>{if(!o)return;const _=n.find(C=>C.id===o);if(!_||_.status===k){a(null);return}try{const C=await Hy(e,o,{status:k});r(P=>P.map(j=>j.id===o?C:j)),s(P=>P&&P.id===o?{...P,...C}:P)}catch{}a(null)},[e,o,n]),x=E.useCallback(async(k,_,C)=>{if(_.trim()){try{const P=await iR(e,{title:_.trim(),description:C.trim()||void 0,status:k});r(j=>[...j,P])}catch{}c(null),d(""),p("")}},[e]),v=E.useCallback(async(k,_)=>{const C=await Hy(e,k,_);r(P=>P.map(j=>j.id===k?C:j)),s(P=>P&&P.id===k?{...P,...C}:P)},[e]),b=E.useCallback(async(k,_)=>{const C=await oR(e,k,_);s(P=>P&&P.id===k?{...P,comments:[...P.comments,C]}:P)},[e]),S=E.useCallback(async k=>{await sR(e,k),r(_=>_.filter(C=>C.id!==k)),s(null)},[e]);return h.jsxs("div",{className:"flex flex-1 gap-2 overflow-x-auto p-3 relative",children:[M$.map(({status:k,labelKey:_})=>{const C=n.filter(P=>P.status===k);return h.jsx(L$,{status:k,label:t(_),tasks:C,addingTask:l===k,newTitle:l===k?u:"",newDesc:l===k?f:"",onNewTitleChange:P=>d(P),onNewDescChange:P=>p(P),onStartAdding:()=>{c(k),d(""),p("")},onCancelAdding:()=>{c(null),d(""),p("")},onConfirmAdding:()=>x(k,u,f),onDragStart:P=>a(P),onDrop:y,onCardClick:m},k)}),i&&h.jsx(T$,{task:i,onClose:()=>s(null),onUpdate:v,onAddComment:b,onDelete:S})]})}function L$({status:e,label:t,tasks:n,addingTask:r,newTitle:i,newDesc:s,onNewTitleChange:o,onNewDescChange:a,onStartAdding:l,onCancelAdding:c,onConfirmAdding:u,onDragStart:d,onDrop:f,onCardClick:p}){const{t:g}=we(),[m,y]=E.useState(!1);return h.jsxs("div",{className:"w-56 flex-shrink-0 flex flex-col gap-0 rounded-md overflow-hidden bg-surface-container",onDragOver:x=>{x.preventDefault(),y(!0)},onDragLeave:()=>y(!1),onDrop:()=>{y(!1),f(e)},children:[h.jsxs("div",{className:"flex items-center justify-between px-3 py-2.5 flex-shrink-0",style:{borderBottom:m?"1px solid rgba(160,120,255,0.25)":"1px solid rgba(255,255,255,0.04)",background:m?"rgba(160,120,255,0.05)":void 0,transition:"background 0.15s, border-color 0.15s"},children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[9px] uppercase tracking-[0.15em] text-on-surface-variant",children:t}),h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/25 tabular-nums",children:n.length})]}),h.jsx("button",{onClick:l,className:"text-[12px] text-on-surface-variant/60 hover:text-primary/70 transition-colors leading-none w-5 h-5 flex items-center justify-center rounded hover:bg-primary/10",children:"+"})]}),h.jsxs("div",{className:"flex flex-col gap-1.5 p-2 overflow-y-auto flex-1",children:[n.map(x=>h.jsx(A$,{task:x,onDragStart:d,onClick:p},x.id)),r&&h.jsxs("div",{className:"rounded-md p-2.5 flex flex-col gap-2 bg-surface-container-high",children:[h.jsx("input",{autoFocus:!0,className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 w-full",placeholder:g("tasks.titlePlaceholder"),value:i,onChange:x=>o(x.target.value),onKeyDown:x=>{x.key==="Escape"&&c()}}),h.jsx("textarea",{className:"rounded bg-surface-container px-2.5 py-[7px] text-[11px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 w-full resize-y min-h-[48px] font-mono",placeholder:g("tasks.descPlaceholder"),value:s,onChange:x=>a(x.target.value),onKeyDown:x=>{x.key==="Escape"&&c()},rows:2}),h.jsxs("div",{className:"flex gap-1.5",children:[h.jsx("button",{disabled:!i.trim(),onClick:u,className:"flex-1 rounded bg-primary/15 px-2 py-1 text-[10px] text-primary/70 hover:bg-primary/25 transition-colors disabled:opacity-30",children:g("tasks.add")}),h.jsx("button",{onClick:c,className:"rounded bg-surface-container px-2 py-1 text-[10px] text-on-surface-variant/70 hover:text-on-surface-variant/70 transition-colors",children:g("tasks.cancel")})]})]})]})]})}function O$({status:e}){const t=e==="active"?"bg-secondary-container text-on-primary":e==="stale"||e==="crashed"?"bg-amber-500/20 text-warning":"bg-surface-container text-on-surface-variant/60";return h.jsx("span",{className:`rounded-full px-1.5 py-[2px] text-[8px] font-semibold uppercase tracking-[0.1em] ${t}`,children:e})}function bC({commands:e,activeIndex:t,onJump:n}){const r=E.useRef(null);return E.useEffect(()=>{var i;(i=r.current)==null||i.scrollIntoView({behavior:"smooth",block:"nearest"})},[t]),e.length===0?null:h.jsxs("div",{className:"w-56 flex-shrink-0 flex flex-col border-l border-outline-variant/30 overflow-hidden bg-surface-container",children:[h.jsx("div",{className:"px-3 py-2 border-b border-outline-variant/30",children:h.jsxs("span",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold",children:["Events (",e.length,")"]})}),h.jsx("div",{className:"flex-1 overflow-y-auto scrollbar-thin",children:e.map((i,s)=>{const o=s===t;return h.jsxs("div",{ref:o?r:void 0,onClick:()=>n(s),className:`px-3 py-2 border-b border-outline-variant/20 transition-colors cursor-pointer hover:bg-surface-container/50 ${o?"bg-primary/10 border-l-2 border-l-primary":""}`,children:[h.jsx("p",{className:`font-mono text-[10px] leading-snug break-all ${o?"text-primary":"text-on-surface-variant"}`,children:i.args}),h.jsx("p",{className:"font-mono text-[8px] text-on-surface-variant/20 mt-0.5",children:new Date(i.timestamp).toLocaleTimeString()})]},s)})})]})}function F$({agentId:e,session:t}){const[n,r]=E.useState(null),[i,s]=E.useState("connecting"),[o,a]=E.useState(null),[l,c]=E.useState(null),[u,d]=E.useState(!1);return E.useEffect(()=>{const f=new WebSocket(oS(e,t.id));let p=!0;return f.onmessage=g=>{if(p)try{const m=JSON.parse(g.data);m.type==="frame"&&m.data?r(`data:image/jpeg;base64,${m.data}`):m.type==="attached"?(s("attached"),m.url!=null&&m.title!=null&&m.index!=null&&c({index:m.index,url:m.url,title:m.title})):m.type==="tab_changed"&&m.url!=null&&m.title!=null&&m.index!=null?(c({index:m.index,url:m.url,title:m.title}),d(!0),window.setTimeout(()=>d(!1),900)):m.type==="unavailable"?(r(null),s("error"),a(m.reason??"stream unavailable")):(m.type==="error"||m.type==="detached")&&(s("error"),a(m.reason??"stream ended"))}catch{}},f.onclose=()=>{p&&s("closed")},f.onerror=()=>{p&&(s("error"),a("websocket error"))},()=>{p=!1;try{f.close()}catch{}}},[e,t.id]),h.jsxs("div",{className:"flex-1 flex items-center justify-center overflow-hidden relative bg-surface-container-lowest",children:[n?h.jsx("img",{src:n,alt:"live browser frame",className:"max-w-full max-h-full object-contain select-none",draggable:!1}):h.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-8",children:[h.jsx("span",{className:"text-[32px] opacity-10 mb-3",children:"📺"}),h.jsxs("p",{className:"font-mono text-[10px] text-on-surface-variant/35",children:[i==="connecting"&&"connecting to live stream…",i==="attached"&&"waiting for first frame…",i==="error"&&`live stream unavailable${o?` — ${o}`:""}`,i==="closed"&&"live stream closed"]})]}),h.jsxs("div",{className:"absolute top-3 left-3 flex items-center gap-2 max-w-[60%]",children:[h.jsxs("div",{className:"flex items-center gap-1.5 rounded-full bg-black/60 px-2 py-1 flex-shrink-0",children:[h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-secondary animate-pulse inline-block"}),h.jsx("span",{className:"text-[8px] uppercase tracking-[0.15em] text-secondary/70 font-semibold",children:"live"})]}),l&&h.jsxs("div",{className:`flex items-center gap-1.5 rounded-full bg-black/60 px-2.5 py-1 min-w-0 transition-all duration-500 ${u?"ring-1 ring-primary/60 bg-primary/25":""}`,title:l.url,children:[h.jsxs("span",{className:"text-[8px] uppercase tracking-[0.15em] text-on-surface-variant/70 font-semibold flex-shrink-0",children:["tab ",l.index]}),h.jsx("span",{className:"w-1 h-1 rounded-full bg-on-surface-variant/30 flex-shrink-0"}),h.jsx("span",{className:"text-[10px] text-on-surface/90 truncate",children:l.title||l.url})]})]})]})}function $$({agentId:e,session:t}){const n=E.useRef(null),[r,i]=E.useState(0),[s,o]=E.useState(0),a=t.createdAt,l=t.closedAt!=null?t.closedAt-t.createdAt:0,c=t.commands.map(y=>Math.max(0,(y.timestamp-a)/1e3));let u=-1;for(let y=0;y<c.length;y++)c[y]<=s+.01&&(u=y);const d=E.useCallback(y=>{const x=n.current;if(!x)return;const v=c[y]??0;x.currentTime=Math.min(v,x.duration||v),x.play().catch(()=>{})},[c]),f=()=>{var x;const y=((x=n.current)==null?void 0:x.duration)??0;i(Number.isFinite(y)?y:0)},p=()=>{var y;o(((y=n.current)==null?void 0:y.currentTime)??0)},g=t.videoValid?lR(e,t.id):null,m=r||l/1e3;return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"flex-1 flex items-center justify-center overflow-hidden relative bg-surface-container-lowest",style:{minHeight:0},children:g?h.jsxs("div",{className:"relative w-full h-full flex items-center justify-center",children:[h.jsx("video",{ref:n,src:g,controls:!0,preload:"metadata",onLoadedMetadata:f,onTimeUpdate:p,className:"max-w-full max-h-full object-contain"}),m>0&&t.commands.length>0&&h.jsx("div",{className:"absolute left-0 right-0 bottom-[42px] pointer-events-none px-[12px]",children:h.jsx("div",{className:"relative h-2",children:c.map((y,x)=>{const v=Math.min(1,y/m)*100,b=x===u;return h.jsx("button",{onClick:()=>d(x),style:{left:`${v}%`},className:`absolute top-0 -translate-x-1/2 rounded-full pointer-events-auto transition-all ${b?"w-2.5 h-2.5 bg-primary ring-2 ring-primary/30":"w-1.5 h-1.5 bg-primary/50 hover:bg-primary/80"}`,title:t.commands[x].args},x)})})})]}):h.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-8",children:[h.jsx("span",{className:"text-[32px] opacity-10 mb-3",children:"🎞"}),h.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/25",children:"recording unavailable"}),(t.status==="stale"||t.status==="crashed")&&h.jsx("p",{className:"font-mono text-[9px] text-warning/50 mt-2",children:"session was abandoned before finalizing"})]})}),h.jsx(bC,{commands:t.commands,activeIndex:u,onJump:d})]})}function z$({agentId:e,session:t,onBack:n}){const[r,i]=E.useState(t);E.useEffect(()=>{if(r.status!=="active")return;const o=setInterval(()=>{sS(e,r.id).then(i).catch(()=>{})},3e3);return()=>clearInterval(o)},[e,r.id,r.status]),E.useEffect(()=>{const o=a=>{a.key==="Escape"&&n()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n]);const s=r.status==="active";return h.jsxs("div",{className:"flex flex-1 flex-col h-full min-w-0 rounded-lg bg-surface-container-lowest",children:[h.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-outline-variant/30 flex-shrink-0",children:[h.jsx("button",{onClick:n,className:"flex items-center justify-center w-6 h-6 rounded transition-colors hover:bg-surface-container text-on-surface-variant hover:text-on-surface",title:"Back to sessions",children:h.jsx("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor",children:h.jsx("path",{d:"M10 3L5 8l5 5V3z"})})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-[11px] font-medium text-on-surface truncate",children:r.name??"Unnamed session"}),h.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant/60 truncate",children:r.id})]}),h.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[h.jsx(O$,{status:r.status}),h.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/70 tabular-nums",children:[r.commands.length," cmd",r.commands.length===1?"":"s"]})]})]}),h.jsx("div",{className:"flex-1 flex min-h-0",children:s?h.jsxs(h.Fragment,{children:[h.jsx(F$,{agentId:e,session:r}),h.jsx(bC,{commands:r.commands,activeIndex:r.commands.length-1,onJump:()=>{}})]}):h.jsx($$,{agentId:e,session:r})})]})}function B$(e){const t=Date.now()-e,n=Math.floor(t/1e3);if(n<60)return`${n}s ago`;const r=Math.floor(n/60);if(r<60)return`${r}m ago`;const i=Math.floor(r/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}function W$(e,t){const r=(t??Date.now())-e,i=Math.floor(r/1e3);if(i<60)return`${i}s`;const s=Math.floor(i/60);return s<60?`${s}m ${i%60}s`:`${Math.floor(s/60)}h ${s%60}m`}function H$({status:e}){const t=e==="active"?"bg-secondary-container text-on-primary":e==="stale"||e==="crashed"?"bg-amber-500/20 text-warning":"bg-surface-container text-on-surface-variant/60";return h.jsx("span",{className:`rounded-full px-1.5 py-[2px] text-[8px] font-semibold uppercase tracking-[0.1em] ${t}`,children:e})}function V$({session:e,onClick:t}){const n=e.status==="active";return h.jsx("button",{onClick:t,className:`w-full text-left rounded-md transition-colors hover:brightness-110 ${n?"bg-surface-container-high":"bg-surface-container"}`,children:h.jsxs("div",{className:"p-3",children:[n&&h.jsx("div",{className:"absolute top-3 right-3 w-1.5 h-1.5 rounded-full bg-secondary animate-pulse",style:{position:"absolute"}}),h.jsxs("div",{className:"flex items-start justify-between gap-2 relative",children:[h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("p",{className:"text-[11px] font-medium text-on-surface truncate",children:e.name??"Unnamed session"}),h.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-0.5 truncate",children:e.id})]}),h.jsxs("div",{className:"flex flex-col items-end gap-1 flex-shrink-0",children:[h.jsx(H$,{status:e.status}),n&&h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-secondary animate-pulse inline-block"})]})]}),h.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:e.videoValid?"video":"no recording"}),h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/20",children:"·"}),h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:W$(e.createdAt,e.closedAt)}),h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/20",children:"·"}),h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:B$(e.createdAt)})]})]})})}function U$({agentId:e}){const[t,n]=E.useState([]),[r,i]=E.useState(null),[s,o]=E.useState(!1);E.useEffect(()=>{let l=!1;const c=()=>{aR(e).then(d=>{if(!l){const f=[...d].sort((p,g)=>p.status==="active"&&g.status!=="active"?-1:p.status!=="active"&&g.status==="active"?1:g.createdAt-p.createdAt);n(f)}}).catch(console.error)};c();const u=setInterval(c,5e3);return()=>{l=!0,clearInterval(u)}},[e]);const a=async l=>{o(!0);try{const c=await sS(e,l.id);i(c)}catch(c){console.error("Failed to load session",c)}finally{o(!1)}};return r?h.jsx(z$,{agentId:e,session:r,onBack:()=>i(null)}):h.jsxs("div",{className:"flex flex-1 flex-col h-full min-w-0 rounded-lg bg-surface-container-lowest",children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/30",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-[13px] opacity-60",children:"🌐"}),h.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] font-medium text-on-surface-variant",children:"Browser Sessions"})]}),h.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/60 tabular-nums",children:[t.length," sessions"]})]}),s&&h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/60 animate-pulse",children:"loading session…"})}),!s&&h.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-1.5 scrollbar-thin",children:t.length===0?h.jsx("div",{className:"flex items-center justify-center flex-1",children:h.jsxs("div",{className:"max-w-lg w-full mx-auto text-center px-8",children:[h.jsx("img",{src:"/browser-onboarding.png",alt:"",className:"w-44 h-44 mx-auto mb-6 opacity-90"}),h.jsx("h2",{className:"font-headline text-xl font-semibold text-on-surface mb-3",children:"Browser sessions"}),h.jsx("p",{className:"text-[13px] text-on-surface-variant leading-relaxed mb-8 max-w-sm mx-auto",children:"When the agent needs your credentials or hits a captcha, it will hand off control to you."}),h.jsxs("div",{className:"flex flex-col gap-4 max-w-xs mx-auto text-left mb-8",children:[h.jsxs("div",{className:"flex items-start gap-4",children:[h.jsx("span",{className:"w-7 h-7 rounded-full bg-primary/15 text-primary text-[12px] font-bold flex items-center justify-center flex-shrink-0 mt-0.5",children:"1"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-[13px] text-on-surface/80 font-medium",children:"Agent requests takeover"}),h.jsx("p",{className:"text-[11px] text-on-surface-variant/70 mt-0.5",children:"You'll receive a link in chat when the agent needs you"})]})]}),h.jsxs("div",{className:"flex items-start gap-4",children:[h.jsx("span",{className:"w-7 h-7 rounded-full bg-primary/15 text-primary text-[12px] font-bold flex items-center justify-center flex-shrink-0 mt-0.5",children:"2"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-[13px] text-on-surface/80 font-medium",children:"Open the link and take control"}),h.jsx("p",{className:"text-[11px] text-on-surface-variant/70 mt-0.5",children:"Log in, solve the captcha, or complete whatever action is needed"})]})]}),h.jsxs("div",{className:"flex items-start gap-4",children:[h.jsx("span",{className:"w-7 h-7 rounded-full bg-primary/15 text-primary text-[12px] font-bold flex items-center justify-center flex-shrink-0 mt-0.5",children:"3"}),h.jsxs("div",{children:[h.jsx("p",{className:"text-[13px] text-on-surface/80 font-medium",children:"Click Completed"}),h.jsx("p",{className:"text-[11px] text-on-surface-variant/70 mt-0.5",children:"Session and logins are saved — the agent resumes automatically"})]})]})]}),h.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/20",children:"Sessions will appear here once the agent starts browsing."})]})}):t.map(l=>h.jsx(V$,{session:l,onClick:()=>void a(l)},l.id))})]})}const U0=1e3,q$=1e4,G$=9e4;function q0(e,t,n){const r=E.useRef(null),i=E.useRef(null),s=E.useRef(t);s.current=t;const o=E.useRef(n);o.current=n;const[a,l]=E.useState(!1),c=E.useRef(null),u=E.useRef(U0),d=E.useRef(!0),f=E.useRef(null),p=E.useCallback(()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{const v=i.current;v&&(v({type:"error",message:"Stream timeout — no response for 90s"}),v({type:"done",sessionId:""}),i.current=null)},G$)},[]),g=E.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null)},[]);E.useEffect(()=>{if(d.current=!0,!e)return;let v=null;function b(){if(!d.current)return;const k=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/agents/${encodeURIComponent(e)}`,_=new WebSocket(k);r.current=_,_.onopen=()=>{if(!d.current)return;l(!0),u.current=U0;const C=f.current??"ui";_.send(JSON.stringify({type:"subscribe",channelId:C}))},_.onmessage=C=>{let P;try{P=JSON.parse(C.data)}catch{return}const j=i.current??s.current??null;P.type==="chunk"?(p(),j==null||j(P.chunk),(P.chunk.type==="done"||P.chunk.type==="error")&&g()):P.type==="blocked"?j==null||j({type:"blocked",reason:P.reason}):P.type==="pending_approval"?j==null||j({type:"pending_approval",reason:P.reason}):P.type==="error"&&(j==null||j({type:"error",message:P.message}),g())},_.onclose=()=>{d.current&&(l(!1),console.warn(`[ws] ${e} disconnected — reconnecting in ${u.current}ms`),v=setTimeout(()=>{u.current=Math.min(u.current*2,q$),b()},u.current))}}return b(),()=>{var S;d.current=!1,v&&clearTimeout(v),g(),(S=r.current)==null||S.close(),l(!1)}},[e,p,g]);const m=E.useCallback((v,b)=>{var k,_;i.current=b,p();const S=()=>{var C;return(C=r.current)==null?void 0:C.send(JSON.stringify({type:"message",text:v}))};((k=r.current)==null?void 0:k.readyState)===WebSocket.OPEN?S():(_=r.current)==null||_.addEventListener("open",S,{once:!0})},[p]),y=E.useCallback(()=>{var v;((v=r.current)==null?void 0:v.readyState)===WebSocket.OPEN&&r.current.send(JSON.stringify({type:"stop"})),g(),i.current=null},[g]),x=E.useCallback(v=>{var b;f.current=v,((b=r.current)==null?void 0:b.readyState)===WebSocket.OPEN&&r.current.send(JSON.stringify({type:"subscribe",channelId:v}))},[]);return{sendMessage:m,stopMessage:y,subscribeToChannel:x,connected:a}}const G0={pending:"text-on-surface-variant",running:"text-warning",completed:"text-success",failed:"text-error",skipped:"text-on-surface-variant/60"},K$={pending:"○",running:"◉",completed:"●",failed:"✕",skipped:"—"},Y$={tool_call:"→",tool_result:"←",error:"✕"},X$={tool_call:"text-primary",tool_result:"text-success",error:"text-error"};function K0(e){if(e==null)return"";if(typeof e=="string")return e.length>200?e.slice(0,200)+"…":e;try{const t=JSON.stringify(e);return t.length>200?t.slice(0,200)+"…":t}catch{return String(e)}}function J$({agentId:e,workflowId:t,runId:n,steps:r,onBack:i}){const{t:s}=we(),[o,a]=E.useState(null),[l,c]=E.useState(new Set),u=E.useCallback(async()=>{try{const p=await yR(e,t,n);a(p)}catch{}},[e,t,n]);E.useEffect(()=>{u();const p=setInterval(()=>{u()},1500);return()=>clearInterval(p)},[u]);const d=p=>{c(g=>{const m=new Set(g);return m.has(p)?m.delete(p):m.add(p),m})};if(!o)return h.jsx("div",{className:"p-4 font-mono text-sm text-on-surface-variant",children:s("runDetail.loading")});const f=new Map(r.map(p=>[p.id,p]));return h.jsxs("div",{className:"p-4",children:[h.jsx("button",{onClick:i,className:`${qr} mb-3`,children:s("runDetail.back")}),h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsxs("h2",{className:"font-headline text-xl font-bold text-on-surface",children:[s("runDetail.runLabel")," ",h.jsx("span",{className:G0[o.status],children:o.status})]}),h.jsxs("span",{className:"font-mono text-[11px] text-on-surface-variant",children:[new Date(o.startedAt).toLocaleString(),o.finishedAt&&` · ${((o.finishedAt-o.startedAt)/1e3).toFixed(1)}s`]})]}),h.jsx("div",{className:"flex flex-col gap-1",children:o.steps.map(p=>{const g=f.get(p.stepId),m=l.has(p.id);return h.jsxs("div",{className:`${nl} overflow-hidden`,children:[h.jsxs("div",{onClick:()=>d(p.id),className:"flex items-center gap-2 px-3 py-2 cursor-pointer",children:[h.jsx("span",{className:`text-sm ${G0[p.status]}`,children:K$[p.status]}),h.jsx("span",{className:"text-sm text-on-surface flex-1",children:(g==null?void 0:g.name)??p.stepId}),p.durationMs!==null&&h.jsxs("span",{className:"font-mono text-[10px] text-on-surface-variant",children:[(p.durationMs/1e3).toFixed(1),"s"]}),h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:m?"▾":"▸"})]}),m&&h.jsxs("div",{className:"px-3 pb-3 text-sm space-y-2",children:[p.error&&h.jsxs("div",{className:"text-error whitespace-pre-wrap font-mono text-xs",children:[s("runDetail.errorPrefix")," ",p.error]}),p.events&&p.events.length>0&&h.jsxs("div",{children:[h.jsx("div",{className:"font-label text-[10px] font-semibold uppercase tracking-widest text-on-surface-variant mb-1",children:s("runDetail.activity")}),h.jsx("div",{className:"flex flex-col gap-1 bg-surface-container-low p-2 rounded",children:p.events.map((y,x)=>{const v=p.startedAt?((y.ts-p.startedAt)/1e3).toFixed(1):"";return h.jsxs("div",{className:"flex items-start gap-2 font-mono text-[11px]",children:[h.jsx("span",{className:"text-on-surface-variant/60 w-10 text-right shrink-0",children:v&&`+${v}s`}),h.jsx("span",{className:`shrink-0 ${X$[y.type]}`,children:Y$[y.type]}),y.type==="tool_call"&&h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"text-on-surface font-semibold",children:y.tool}),y.input!==void 0&&y.input!==null&&h.jsx("span",{className:"text-on-surface-variant ml-2 break-all",children:K0(y.input)})]}),y.type==="tool_result"&&h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"text-on-surface",children:y.tool}),y.output!==void 0&&y.output!==null&&h.jsx("span",{className:"text-on-surface-variant ml-2 break-all",children:K0(y.output)})]}),y.type==="error"&&h.jsx("div",{className:"flex-1 min-w-0 text-error break-all",children:y.message})]},x)})})]}),p.input!==null&&h.jsxs("div",{children:[h.jsx("div",{className:"font-label text-[10px] font-semibold uppercase tracking-widest text-on-surface-variant mb-1",children:s("runDetail.input")}),h.jsx("pre",{className:"font-mono text-xs text-on-surface bg-surface-container-low p-2 rounded overflow-auto max-h-52 whitespace-pre-wrap break-words",children:typeof p.input=="string"?p.input:JSON.stringify(p.input,null,2)})]}),p.output!==null&&h.jsxs("div",{children:[h.jsx("div",{className:"font-label text-[10px] font-semibold uppercase tracking-widest text-on-surface-variant mb-1",children:s("runDetail.output")}),h.jsx("pre",{className:"font-mono text-xs text-on-surface bg-surface-container-low p-2 rounded overflow-auto max-h-52 whitespace-pre-wrap break-words",children:typeof p.output=="string"?p.output:JSON.stringify(p.output,null,2)})]})]})]},p.id)})})]})}function _C({title:e,initial:t,allowStatus:n,onSave:r,onCancel:i}){const{t:s}=we(),[o,a]=E.useState((t==null?void 0:t.name)??""),[l,c]=E.useState((t==null?void 0:t.description)??""),[u,d]=E.useState((t==null?void 0:t.status)??"active"),[f,p]=E.useState(!1),g=async m=>{if(m.preventDefault(),!(!o.trim()||f)){p(!0);try{await r({name:o.trim(),description:l.trim(),status:n?u:void 0})}finally{p(!1)}}};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-40",style:{background:"rgba(0,0,0,0.4)"},onClick:i}),h.jsx("form",{onSubmit:g,className:"fixed inset-0 z-50 flex items-center justify-center p-4 pointer-events-none",children:h.jsxs("div",{className:"bg-surface-container-lowest border border-outline-variant/40 rounded-xl shadow-callout p-5 w-full max-w-md pointer-events-auto",children:[h.jsx("h3",{className:"font-headline text-lg font-bold text-on-surface mb-4",children:e}),h.jsxs("div",{className:"flex flex-col gap-3 mb-5",children:[h.jsxs("div",{children:[h.jsx("label",{className:"font-label text-[11px] font-semibold uppercase tracking-widest text-on-surface-variant block mb-1",children:s("workflows.formName")}),h.jsx("input",{autoFocus:!0,className:an,value:o,onChange:m=>a(m.target.value),placeholder:s("workflows.formNamePlaceholder")})]}),h.jsxs("div",{children:[h.jsx("label",{className:"font-label text-[11px] font-semibold uppercase tracking-widest text-on-surface-variant block mb-1",children:s("workflows.formDescription")}),h.jsx("textarea",{rows:3,className:an,value:l,onChange:m=>c(m.target.value),placeholder:s("workflows.formDescriptionPlaceholder")})]}),n&&h.jsxs("div",{children:[h.jsx("label",{className:"font-label text-[11px] font-semibold uppercase tracking-widest text-on-surface-variant block mb-1",children:s("workflows.formStatus")}),h.jsxs("select",{className:an,value:u,onChange:m=>d(m.target.value),children:[h.jsx("option",{value:"active",children:"active"}),h.jsx("option",{value:"paused",children:"paused"}),h.jsx("option",{value:"archived",children:"archived"})]})]})]}),h.jsxs("div",{className:"flex items-center justify-end gap-2",children:[h.jsx("button",{type:"button",onClick:i,className:qr,children:s("workflows.cancel")}),h.jsx("button",{type:"submit",disabled:!o.trim()||f,className:Ui,children:s(f?"workflows.saving":"workflows.save")})]})]})})]})}function Y0({title:e,initial:t,onSave:n,onCancel:r}){const{t:i}=we(),s=t==null?void 0:t.config,[o,a]=E.useState((t==null?void 0:t.name)??""),[l,c]=E.useState((t==null?void 0:t.type)??"agent"),[u,d]=E.useState((s==null?void 0:s.script)??""),[f,p]=E.useState((s==null?void 0:s.shell)??"bash"),[g,m]=E.useState((s==null?void 0:s.prompt)??""),[y,x]=E.useState((s==null?void 0:s.model)??""),[v,b]=E.useState(s!=null&&s.timeout_ms?String(s.timeout_ms/1e3):""),[S,k]=E.useState(!1),_=async C=>{if(C.preventDefault(),!o.trim()||S)return;let P;const j=v?Math.round(Number(v)*1e3):void 0;if(l==="code"){if(!u.trim())return;P={script:u,shell:f||void 0,timeout_ms:j}}else{if(!g.trim())return;P={prompt:g,model:y||void 0}}k(!0);try{await n({name:o.trim(),type:l,config:P})}finally{k(!1)}};return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"fixed inset-0 z-40",style:{background:"rgba(0,0,0,0.4)"},onClick:r}),h.jsx("form",{onSubmit:_,className:"fixed inset-0 z-50 flex items-center justify-center p-4 pointer-events-none overflow-y-auto",children:h.jsxs("div",{className:"bg-surface-container-lowest border border-outline-variant/40 rounded-xl shadow-callout p-5 w-full max-w-2xl pointer-events-auto my-8",children:[h.jsx("h3",{className:"font-headline text-lg font-bold text-on-surface mb-4",children:e}),h.jsxs("div",{className:"flex flex-col gap-3 mb-5",children:[h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[1fr,180px] gap-3",children:[h.jsxs("div",{children:[h.jsx("label",{className:"font-label text-[11px] font-semibold uppercase tracking-widest text-on-surface-variant block mb-1",children:i("workflows.stepNameLabel")}),h.jsx("input",{autoFocus:!0,className:an,value:o,onChange:C=>a(C.target.value),placeholder:i("workflows.stepNamePlaceholder")})]}),h.jsxs("div",{children:[h.jsx("label",{className:"font-label text-[11px] font-semibold uppercase tracking-widest text-on-surface-variant block mb-1",children:i("workflows.stepTypeLabel")}),h.jsxs("select",{className:an,value:l,onChange:C=>c(C.target.value),children:[h.jsx("option",{value:"agent",children:"agent"}),h.jsx("option",{value:"llm",children:"llm"}),h.jsx("option",{value:"code",children:"code"})]})]})]}),l==="code"?h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx("label",{className:"font-label text-[11px] font-semibold uppercase tracking-widest text-on-surface-variant block mb-1",children:i("workflows.stepScriptLabel")}),h.jsx("textarea",{rows:8,className:Ip,value:u,onChange:C=>d(C.target.value),placeholder:i("workflows.stepScriptPlaceholder")})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[h.jsxs("div",{children:[h.jsx("label",{className:"font-label text-[11px] font-semibold uppercase tracking-widest text-on-surface-variant block mb-1",children:i("workflows.stepShellLabel")}),h.jsx("input",{className:an,value:f,onChange:C=>p(C.target.value),placeholder:"bash"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"font-label text-[11px] font-semibold uppercase tracking-widest text-on-surface-variant block mb-1",children:i("workflows.stepTimeoutLabel")}),h.jsx("input",{className:an,type:"number",min:0,value:v,onChange:C=>b(C.target.value),placeholder:"30"})]})]})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx("label",{className:"font-label text-[11px] font-semibold uppercase tracking-widest text-on-surface-variant block mb-1",children:i("workflows.stepPromptLabel")}),h.jsx("textarea",{rows:10,className:an,value:g,onChange:C=>m(C.target.value),placeholder:i("workflows.stepPromptPlaceholder")})]}),h.jsxs("div",{children:[h.jsx("label",{className:"font-label text-[11px] font-semibold uppercase tracking-widest text-on-surface-variant block mb-1",children:i("workflows.stepModelLabel")}),h.jsx("input",{className:an,value:y,onChange:C=>x(C.target.value),placeholder:i("workflows.stepModelPlaceholder")})]})]})]}),h.jsxs("div",{className:"flex items-center justify-end gap-2",children:[h.jsx("button",{type:"button",onClick:r,className:qr,children:i("workflows.cancel")}),h.jsx("button",{type:"submit",disabled:!o.trim()||S,className:Ui,children:i(S?"workflows.saving":"workflows.save")})]})]})})]})}const X0={code:`${Gs} bg-primary/10 border border-primary/20 text-primary`,llm:`${Gs} bg-info/10 border border-info/20 text-info`,agent:`${Gs} bg-success/10 border border-success/20 text-success`},Q$={running:"bg-warning",completed:"bg-success",failed:"bg-error",cancelled:"bg-outline"};function Z$({agentId:e,workflow:t,runs:n,onBack:r,onRun:i,onRefresh:s,onDeleted:o}){const{t:a}=we(),[l,c]=E.useState(null),[u,d]=E.useState(new Set),[f,p]=E.useState(!1),[g,m]=E.useState(!1),[y,x]=E.useState(null),v=w=>{d(M=>{const D=new Set(M);return D.has(w)?D.delete(w):D.add(w),D})},b=async w=>{await wR(e,t.id,w),p(!1),await s()},S=async()=>{window.confirm(a("workflows.confirmDelete",{name:t.name}))&&(await kR(e,t.id),await o())},k=async w=>{await SR(e,t.id,w),m(!1),await s()},_=async w=>{y&&(await Sh(e,t.id,y.id,w),x(null),await s())},C=async w=>{window.confirm(a("workflows.confirmDeleteStep",{name:w.name}))&&(await CR(e,t.id,w.id),await s())},P=async(w,M)=>{const D=[...t.steps].sort((H,X)=>H.position-X.position),$=D.findIndex(H=>H.id===w.id)+M;if($<0||$>=D.length)return;const I=D[$];await Promise.all([Sh(e,t.id,w.id,{position:I.position}),Sh(e,t.id,I.id,{position:w.position})]),await s()};if(l)return h.jsx(J$,{agentId:e,workflowId:t.id,runId:l,steps:t.steps,onBack:()=>{c(null),s()}});const j=[...t.steps].sort((w,M)=>w.position-M.position);return h.jsxs("div",{className:"p-4",children:[h.jsx("button",{onClick:()=>void r(),className:`${qr} mb-3`,children:a("workflows.back")}),h.jsxs("div",{className:"flex items-center justify-between mb-4 gap-2 flex-wrap",children:[h.jsx("h2",{className:"font-headline text-xl font-bold text-on-surface",children:t.name}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{onClick:()=>p(!0),className:qr,children:a("workflows.edit")}),h.jsx("button",{onClick:()=>void S(),className:Ap,children:a("workflows.delete")}),h.jsx("button",{onClick:i,className:Ui,children:a("workflows.run_button")})]})]}),t.description&&h.jsx("p",{className:"text-sm text-on-surface-variant mb-4",children:t.description}),h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("h3",{className:"font-label text-[11px] font-semibold uppercase tracking-widest text-on-surface-variant",children:a("workflows.stepsTitle",{count:j.length})}),h.jsx("button",{onClick:()=>m(!0),className:Cm,children:a("workflows.addStep")})]}),h.jsxs("div",{className:"flex flex-col gap-1 mb-6",children:[j.length===0&&h.jsx("p",{className:"text-xs text-on-surface-variant py-2",children:a("workflows.noSteps")}),j.map((w,M)=>{const D=w.config,F=D.prompt??D.script??"",$=u.has(w.id),I=D.timeout_ms;return h.jsxs("div",{className:`${nl} p-3 transition-colors hover:border-primary/40`,children:[h.jsxs("div",{className:"flex items-center gap-2 cursor-pointer",onClick:()=>v(w.id),children:[h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant w-5 text-center",children:M+1}),h.jsx("span",{className:X0[w.type]??X0.agent,children:w.type}),h.jsx("span",{className:"text-sm text-on-surface flex-1",children:w.name}),w.transitions&&h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:a(w.transitions.conditions.length===1?"workflows.conditionsOne":"workflows.conditionsOther",{count:w.transitions.conditions.length})}),h.jsxs("div",{className:"flex items-center gap-0.5",onClick:H=>H.stopPropagation(),children:[h.jsx("button",{onClick:()=>void P(w,-1),disabled:M===0,className:qr,title:a("workflows.moveUp"),children:"↑"}),h.jsx("button",{onClick:()=>void P(w,1),disabled:M===j.length-1,className:qr,title:a("workflows.moveDown"),children:"↓"}),h.jsx("button",{onClick:()=>x(w),className:qr,title:a("workflows.edit"),children:"✎"}),h.jsx("button",{onClick:()=>void C(w),className:Ap,title:a("workflows.delete"),children:"✕"})]}),h.jsx("span",{className:"text-[10px] text-on-surface-variant transition-transform",style:{transform:$?"rotate(90deg)":"none"},children:"▶"})]}),!$&&F&&h.jsx("p",{className:"mt-1 ml-7 text-xs text-on-surface-variant truncate",children:F}),$&&h.jsxs("div",{className:"mt-2 ml-7",children:[F&&h.jsx("pre",{className:"font-mono text-xs text-on-surface-variant whitespace-pre-wrap break-words leading-relaxed p-2 bg-surface-container-low rounded max-h-80 overflow-auto",children:F}),h.jsxs("div",{className:"flex gap-4 mt-1.5 font-mono text-[10px] text-on-surface-variant",children:[h.jsx("span",{children:a("workflows.stepType",{type:w.type})}),I&&h.jsx("span",{children:a("workflows.stepTimeout",{seconds:I/1e3})}),h.jsx("span",{children:a("workflows.stepId",{id:w.id.slice(0,8)})})]})]})]},w.id)})]}),h.jsx("h3",{className:"font-label text-[11px] font-semibold uppercase tracking-widest text-on-surface-variant mb-2",children:a("workflows.runHistoryTitle",{count:n.length})}),n.length===0?h.jsx("p",{className:"text-xs text-on-surface-variant",children:a("workflows.noRuns")}):h.jsx("div",{className:"flex flex-col gap-1",children:n.map(w=>h.jsxs("div",{onClick:()=>c(w.id),className:`${nl} flex items-center justify-between p-2.5 cursor-pointer transition-colors hover:border-primary/40`,children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:`h-2 w-2 rounded-full ${Q$[w.status]??"bg-outline"}`}),h.jsx("span",{className:"text-sm text-on-surface",children:w.status}),h.jsxs("span",{className:"font-mono text-[11px] text-on-surface-variant",children:["(",w.trigger,")"]})]}),h.jsxs("div",{className:"font-mono text-[10px] text-on-surface-variant",children:[new Date(w.startedAt).toLocaleString(),w.finishedAt&&` · ${((w.finishedAt-w.startedAt)/1e3).toFixed(1)}s`]})]},w.id))}),f&&h.jsx(_C,{title:a("workflows.editWorkflow"),initial:{name:t.name,description:t.description,status:t.status},allowStatus:!0,onSave:b,onCancel:()=>p(!1)}),g&&h.jsx(Y0,{title:a("workflows.addStepTitle"),onSave:k,onCancel:()=>m(!1)}),y&&h.jsx(Y0,{title:a("workflows.editStepTitle"),initial:y,onSave:_,onCancel:()=>x(null)})]})}function e5({agentId:e}){const{t}=we(),[n,r]=E.useState([]),[i,s]=E.useState(null),[o,a]=E.useState([]),[l,c]=E.useState(null),[u,d]=E.useState(!1),f=E.useCallback(async()=>{try{const b=await vR(e);r(b)}catch{}},[e]);E.useEffect(()=>{f();const b=setInterval(()=>{f()},4e3);return()=>clearInterval(b)},[f]);const p=async b=>{const[S,k]=await Promise.all([qy(e,b),kh(e,b)]);s(S),a(k)},g=async b=>{c(b);try{await bR(e,b);const S=await kh(e,b);a(S)}catch(S){console.error("Failed to trigger workflow:",S)}finally{c(null)}},m=async b=>{const S=await _R(e,b);d(!1),await f(),await p(S.id)};if(i)return h.jsx(Z$,{agentId:e,workflow:i,runs:o,onBack:async()=>{s(null),await f()},onRun:()=>g(i.id),onRefresh:async()=>{const[b,S]=await Promise.all([qy(e,i.id),kh(e,i.id)]);s(b),a(S)},onDeleted:async()=>{s(null),await f()}});const y={active:Lp,paused:Ky,archived:jc},x=b=>b==="running"?"inline-flex items-center gap-1 px-2 py-0.5 rounded text-[10px] font-mono font-medium bg-primary/15 text-primary":b==="completed"?`${Lp} text-[10px]`:b==="failed"?`${Ky} text-[10px]`:b==="cancelled"?`${jc} text-[10px]`:"",v=b=>{const S=Date.now()-b,k=Math.floor(S/1e3);if(k<60)return`${k}s`;const _=Math.floor(k/60);if(_<60)return`${_}m`;const C=Math.floor(_/60);return C<24?`${C}h`:`${Math.floor(C/24)}d`};return h.jsxs("div",{className:"p-3 sm:p-4 min-w-0",children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsx("h2",{className:"font-headline text-xl font-bold text-on-surface",children:t("workflows.title")}),h.jsx("button",{onClick:()=>d(!0),className:Cm,children:t("workflows.newWorkflow")})]}),n.length===0?h.jsx("p",{className:"font-mono text-xs text-on-surface-variant",children:t("workflows.emptyText")}):h.jsx("div",{className:"flex flex-col gap-2",children:n.map(b=>h.jsxs("div",{onClick:()=>p(b.id),className:`${nl} p-4 cursor-pointer transition-colors hover:border-primary/40`,children:[h.jsxs("div",{className:"flex items-center justify-between gap-3",children:[h.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-wrap",children:[h.jsx("span",{className:"font-headline font-bold text-on-surface truncate",children:b.name}),h.jsx("span",{className:y[b.status]??jc,children:b.status}),b.lastRun&&h.jsxs("span",{className:x(b.lastRun.status),children:[b.lastRun.status==="running"&&h.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-primary animate-pulse"}),t(`workflows.runStatus.${b.lastRun.status}`),h.jsxs("span",{className:"opacity-60",children:["· ",v(b.lastRun.finishedAt??b.lastRun.startedAt)]})]})]}),h.jsx("button",{onClick:S=>{S.stopPropagation(),g(b.id)},disabled:l===b.id||b.status!=="active",className:Ui,children:l===b.id?t("workflows.running"):t("workflows.run")})]}),b.description&&h.jsx("p",{className:"mt-1.5 text-sm text-on-surface-variant",children:b.description}),h.jsx("div",{className:"mt-1 font-mono text-[10px] text-on-surface-variant/60",children:t("workflows.createdOn",{id:b.id,date:new Date(b.createdAt).toLocaleDateString()})})]},b.id))}),u&&h.jsx(_C,{title:t("workflows.newWorkflow"),onSave:m,onCancel:()=>d(!1)})]})}function t5(e){const t=e.split(" ");if(t.length!==5)return e;const[n,r,i,s,o]=t;if(i==="*"&&s==="*"&&o==="*"){if(r!=="*"&&n!=="*")return`Daily at ${r.padStart(2,"0")}:${n.padStart(2,"0")}`;if(r==="*"&&n==="0")return"Every hour";if(r==="*")return`Every hour at :${n.padStart(2,"0")}`}if(i==="*"&&s==="*"&&o!=="*"){const a=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],l=o.split(",").map(c=>a[Number(c)]??c).join(", ");if(r!=="*"&&n!=="*")return`${l} at ${r.padStart(2,"0")}:${n.padStart(2,"0")}`}return e}function J0(e){if(!e)return"—";const t=e-Date.now(),n=Math.abs(t);if(n<6e4)return t>0?"in <1m":"<1m ago";if(n<36e5){const i=Math.round(n/6e4);return t>0?`in ${i}m`:`${i}m ago`}if(n<864e5){const i=Math.round(n/36e5);return t>0?`in ${i}h`:`${i}h ago`}const r=Math.round(n/864e5);return t>0?`in ${r}d`:`${r}d ago`}function n5({agentId:e,run:t,onBack:n}){const{t:r}=we(),[i,s]=E.useState([]),[o,a]=E.useState(!0),l=E.useCallback(async()=>{try{const c=await xR(e,t.channelId);s(c)}catch{}a(!1)},[e,t.channelId]);return E.useEffect(()=>{l();const c=setInterval(()=>{l()},2e3);return()=>clearInterval(c)},[l]),h.jsxs("div",{className:"p-4 flex flex-col gap-3",children:[h.jsx("button",{onClick:n,className:"text-[10px] text-on-surface-variant hover:text-on-surface transition-colors self-start",children:r("schedules.backToRuns")}),h.jsxs("div",{className:"text-[9px] font-mono text-on-surface-variant/60",children:[new Date(t.startedAt).toLocaleString()," · ",t.channelId]}),o&&h.jsx("div",{className:"text-xs text-on-surface-variant/70",children:r("schedules.loading")}),!o&&i.length===0&&h.jsx("div",{className:"text-xs text-on-surface-variant/70 animate-pulse",children:r("schedules.waitingResponse")}),h.jsx("div",{className:"space-y-2",children:i.map(c=>h.jsxs("div",{className:`rounded-md p-2.5 text-[11px] leading-relaxed whitespace-pre-wrap ${c.role==="user"?"bg-surface-container-lowest border border-outline-variant/40 text-on-surface-variant/70":c.role==="tool_call"?"bg-surface-container-low text-on-surface-variant/70 font-mono text-[10px]":"bg-surface-container text-on-surface/90"}`,children:[c.role==="tool_call"&&h.jsx("span",{className:"text-info/60 mr-1",children:"⚙"}),c.content]},c.id))})]})}function r5({agentId:e,schedule:t,onBack:n}){const{t:r}=we(),[i,s]=E.useState([]),[o,a]=E.useState(null),[l,c]=E.useState(!1),u=E.useCallback(async()=>{try{s(await mR(e,t.id))}catch{}},[e,t.id]);E.useEffect(()=>{u()},[u]);async function d(){c(!0);try{await gR(e,t.id),await u()}finally{c(!1)}}return o?h.jsx(n5,{agentId:e,run:o,onBack:()=>a(null)}):h.jsxs("div",{className:"p-4 flex flex-col gap-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{onClick:n,className:"text-[10px] text-on-surface-variant hover:text-on-surface transition-colors",children:"←"}),h.jsx("span",{className:"text-xs text-on-surface font-medium flex-1 truncate",children:t.name}),h.jsx("button",{onClick:d,disabled:l,className:"text-[9px] px-2 py-0.5 rounded bg-surface-container text-on-surface-variant/60 hover:text-on-surface transition-colors disabled:opacity-40",children:r(l?"schedules.triggering":"schedules.runNow")})]}),h.jsx("span",{className:"text-[10px] uppercase tracking-[0.14em] text-on-surface-variant/70 font-medium",children:r("schedules.runHistory")}),i.length===0&&h.jsx("p",{className:"text-[10px] text-on-surface-variant/60",children:r("schedules.noRuns")}),i.map(f=>h.jsxs("button",{onClick:()=>a(f),className:"text-left rounded-md bg-surface-container-low border border-outline-variant/40 p-2.5 hover:bg-surface-container-highest transition-colors",children:[h.jsx("div",{className:"text-[10px] text-on-surface/80",children:new Date(f.startedAt).toLocaleString()}),h.jsx("div",{className:"text-[9px] font-mono text-on-surface-variant/60 mt-0.5",children:f.channelId})]},f.id))]})}function i5({agentId:e}){const{t}=we(),[n,r]=E.useState([]),[i,s]=E.useState(!0),[o,a]=E.useState(null),l=()=>{hR(e).then(r).catch(console.error).finally(()=>s(!1))};E.useEffect(()=>{l()},[e]),E.useEffect(()=>{const f=setInterval(()=>r(p=>[...p]),3e4);return()=>clearInterval(f)},[]);async function c(f){const p=f.status==="active"?"paused":"active";await fR(e,f.id,{status:p}),l()}async function u(f){confirm(t("schedules.deleteConfirm",{name:f.name}))&&(await pR(e,f.id),l())}if(o)return h.jsx(r5,{agentId:e,schedule:o,onBack:()=>a(null)});if(i)return h.jsx("div",{className:"text-on-surface-variant/70 text-xs p-6",children:t("schedules.loadingList")});if(n.length===0)return h.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center p-6 gap-3",children:[h.jsx("span",{className:"text-3xl opacity-30",children:"⏰"}),h.jsx("p",{className:"text-on-surface-variant text-xs",children:t("schedules.emptyText")})]});const d=n.filter(f=>f.status==="active").length;return h.jsxs("div",{className:"p-3 sm:p-4 space-y-2 min-w-0",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] text-on-surface-variant/60 font-medium",children:t("schedules.title")}),h.jsx("span",{className:"text-[9px] font-mono text-on-surface-variant/60",children:t(d===1?"schedules.activeCountOne":"schedules.activeCountOther",{count:d})})]}),n.map(f=>h.jsxs("div",{onClick:()=>a(f),className:"rounded-md bg-surface-container-low border border-outline-variant/40 p-3 space-y-2 cursor-pointer hover:bg-surface-container-highest transition-colors",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${f.status==="active"?"bg-green-500":"bg-yellow-500/50"}`}),h.jsx("span",{className:"text-xs text-on-surface font-medium flex-1 truncate",children:f.name}),h.jsx("span",{className:"text-[9px] font-mono text-on-surface-variant/70",children:f.id})]}),h.jsx("p",{className:"text-[10px] text-on-surface-variant font-mono leading-relaxed break-words",style:{whiteSpace:"pre-wrap"},children:f.message}),h.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] text-on-surface-variant/70",children:[h.jsx("span",{title:f.cron,children:t5(f.cron)}),h.jsx("span",{children:f.timezone}),h.jsx("span",{title:f.nextRun?new Date(f.nextRun).toISOString():"",children:t("schedules.next",{time:J0(f.nextRun)})}),f.lastRun&&h.jsx("span",{title:new Date(f.lastRun).toISOString(),children:t("schedules.last",{time:J0(f.lastRun)})})]}),h.jsxs("div",{className:"flex items-center gap-2 pt-1",onClick:p=>p.stopPropagation(),children:[h.jsx("button",{onClick:()=>c(f),className:"text-[9px] px-2 py-0.5 rounded bg-surface-container text-on-surface-variant/60 hover:text-on-surface transition-colors",children:f.status==="active"?t("schedules.pause"):t("schedules.resume")}),h.jsx("button",{onClick:()=>u(f),className:"text-[9px] px-2 py-0.5 rounded bg-surface-container text-error/60 hover:text-error transition-colors ml-auto",children:t("schedules.delete")})]})]},f.id))]})}function Q0(e){const t=Date.now()-e,n=Math.floor(t/1e3);if(n<60)return`${n}s ago`;const r=Math.floor(n/60);return r<60?`${r}m ago`:`${Math.floor(r/60)}h ${r%60}m ago`}function ks({tone:e,pulse:t}){const n=e==="success"?"bg-success":e==="warning"?"bg-warning":e==="primary"?"bg-primary":e==="info"?"bg-info":e==="muted"?"bg-outline":"bg-outline/50";return h.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full flex-shrink-0 ${t?"animate-pulse":""} ${n}`})}function Z0({info:e,label:t,extra:n}){const{t:r}=we();return e?h.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-3 space-y-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(ks,{tone:"success",pulse:!0}),h.jsx("span",{className:"font-label text-[10px] uppercase tracking-wider text-on-surface font-semibold",children:t}),h.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/60 ml-auto",children:["PID ",e.pid]})]}),h.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[h.jsxs("div",{children:[h.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:r("monitor.cpu")}),h.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:e.cpu})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:r("monitor.mem")}),h.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:e.mem})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:r("monitor.rss")}),h.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:e.rss})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:r("monitor.uptime")}),h.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:e.elapsed})]})]}),n,h.jsx("p",{className:"font-mono text-[8px] text-on-surface-variant/20 truncate",title:e.command,children:e.command})]}):null}function s5({agentId:e}){const{t}=we(),[n,r]=E.useState(null);if(E.useEffect(()=>{const c=()=>uR(e).then(r).catch(console.error);c();const u=setInterval(c,2e3);return()=>clearInterval(u)},[e]),!n)return h.jsx("div",{className:"text-on-surface-variant/70 text-xs p-6",children:t("monitor.loading")});const i=n.jobs.processing,s=n.jobs.pending,o=n.workflows,a=n.claudeProcesses.length,l=i.length===0&&o.length===0&&a===0;return h.jsxs("div",{className:"flex flex-col h-full min-w-0 bg-surface-container-lowest",children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/30",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-[13px] opacity-60",children:"📡"}),h.jsx("span",{className:"font-label text-[11px] uppercase tracking-[0.14em] font-semibold text-on-surface",children:t("monitor.title")})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("span",{className:`font-mono text-[9px] ${l?"text-on-surface-variant/60":"text-secondary"}`,children:l?t("monitor.idle"):t(a===1?"monitor.claudeSessionsOne":"monitor.claudeSessionsOther",{count:a})}),h.jsx("span",{className:`h-1.5 w-1.5 rounded-full animate-pulse ${l?"bg-outline/50":"bg-success"}`})]})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 scrollbar-thin",children:[h.jsxs("div",{children:[h.jsx("p",{className:"font-label text-[9px] uppercase tracking-[0.18em] text-on-surface-variant font-semibold mb-2",children:t("monitor.processes")}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(Z0,{info:n.agent,label:t("monitor.agentProcess"),extra:n.agent?h.jsxs("span",{className:"font-mono text-[9px] text-primary/40",children:["pid ",n.agent.pid]}):void 0}),h.jsx(Z0,{info:n.guardian,label:t("monitor.guardianProcess")}),n.browserProcess&&h.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-3",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(ks,{tone:"warning",pulse:!0}),h.jsx("span",{className:"font-label text-[10px] uppercase tracking-wider text-on-surface font-semibold",children:t("monitor.browserDaemon")}),h.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/60 ml-auto",children:["PID ",n.browserProcess.pid]})]}),h.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-2",children:[h.jsxs("div",{children:[h.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:t("monitor.cpu")}),h.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:n.browserProcess.cpu})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:t("monitor.mem")}),h.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:n.browserProcess.mem})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:t("monitor.rss")}),h.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:n.browserProcess.rss})]})]})]})]})]}),a>0&&h.jsxs("div",{children:[h.jsx("p",{className:"font-label text-[9px] uppercase tracking-[0.18em] text-on-surface-variant font-semibold mb-2",children:t("monitor.activeClaudeSessions",{count:a})}),h.jsx("div",{className:"space-y-1.5",children:n.claudeProcesses.map(c=>h.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-3",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[h.jsx(ks,{tone:"primary",pulse:!0}),h.jsx("span",{className:"font-mono text-[10px] text-on-surface/70",children:"claude"}),h.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant/60 ml-auto",children:["PID ",c.pid]})]}),h.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[h.jsxs("div",{children:[h.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:t("monitor.cpu")}),h.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:c.cpu})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:t("monitor.mem")}),h.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:c.mem})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:t("monitor.rss")}),h.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:c.rss})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant mb-0.5",children:t("monitor.uptime")}),h.jsx("p",{className:"font-mono text-[11px] text-on-surface/80",children:c.elapsed})]})]}),h.jsx("p",{className:"font-mono text-[8px] text-on-surface-variant/20 mt-1.5 break-all leading-relaxed",style:{whiteSpace:"pre-wrap"},children:c.command})]},c.pid))})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-label text-[9px] uppercase tracking-[0.18em] text-on-surface-variant font-semibold mb-2",children:t("monitor.jobQueue",{processing:i.length,pending:s.length})}),i.length===0&&s.length===0?h.jsx("p",{className:"text-[10px] text-on-surface-variant italic",children:t("monitor.noActiveJobs")}):h.jsxs("div",{className:"space-y-1.5",children:[i.map(c=>h.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-2.5",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[h.jsx(ks,{tone:"success",pulse:!0}),h.jsx("span",{className:"font-mono text-[9px] text-secondary/70 uppercase",children:t("monitor.processing")}),h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60 ml-auto",children:c.channelId}),h.jsx("button",{onClick:()=>Uy(e,c.id).catch(console.error),className:"text-[8px] px-1.5 py-0.5 rounded bg-red-950/30 text-error/60 hover:text-error hover:bg-red-950/50 transition-colors",children:t("monitor.terminate")})]}),h.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant leading-relaxed break-words",style:{whiteSpace:"pre-wrap"},children:c.message}),h.jsx("span",{className:"font-mono text-[8px] text-on-surface-variant/20 mt-1 block",children:Q0(c.createdAt)})]},c.id)),s.map(c=>h.jsxs("div",{className:"rounded bg-surface-container-lowest p-2.5",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[h.jsx(ks,{tone:"muted"}),h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/70 uppercase",children:t("monitor.queued")}),h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60 ml-auto",children:c.channelId}),h.jsx("button",{onClick:()=>Uy(e,c.id).catch(console.error),className:"text-[8px] px-1.5 py-0.5 rounded bg-surface-container text-on-surface-variant/70 hover:text-error transition-colors",children:t("monitor.cancel")})]}),h.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/70 leading-relaxed break-words",style:{whiteSpace:"pre-wrap"},children:c.message})]},c.id))]})]}),o.length>0&&h.jsxs("div",{children:[h.jsx("p",{className:"font-label text-[9px] uppercase tracking-[0.18em] text-on-surface-variant font-semibold mb-2",children:t("monitor.runningWorkflows")}),h.jsx("div",{className:"space-y-1.5",children:o.map(c=>h.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-2.5 flex items-center gap-2",children:[h.jsx(ks,{tone:"warning",pulse:!0}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"font-mono text-[10px] text-on-surface/70",children:c.workflowName}),h.jsx("span",{className:"font-mono text-[8px] text-on-surface-variant/60 ml-2",children:c.runId.slice(0,8)})]}),h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60 flex-shrink-0",children:Q0(c.startedAt)})]},c.runId))})]})]})]})}/*!
123
+ * @kurkle/color v0.3.4
124
+ * https://github.com/kurkle/color#readme
125
+ * (c) 2024 Jukka Kurkela
126
+ * Released under the MIT License
127
+ */function _l(e){return e+.5|0}const Xr=(e,t,n)=>Math.max(Math.min(e,n),t);function ra(e){return Xr(_l(e*2.55),0,255)}function di(e){return Xr(_l(e*255),0,255)}function xr(e){return Xr(_l(e/2.55)/100,0,1)}function eb(e){return Xr(_l(e*100),0,100)}const yn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Xp=[..."0123456789ABCDEF"],o5=e=>Xp[e&15],a5=e=>Xp[(e&240)>>4]+Xp[e&15],ec=e=>(e&240)>>4===(e&15),l5=e=>ec(e.r)&&ec(e.g)&&ec(e.b)&&ec(e.a);function c5(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&yn[e[1]]*17,g:255&yn[e[2]]*17,b:255&yn[e[3]]*17,a:t===5?yn[e[4]]*17:255}:(t===7||t===9)&&(n={r:yn[e[1]]<<4|yn[e[2]],g:yn[e[3]]<<4|yn[e[4]],b:yn[e[5]]<<4|yn[e[6]],a:t===9?yn[e[7]]<<4|yn[e[8]]:255})),n}const u5=(e,t)=>e<255?t(e):"";function d5(e){var t=l5(e)?o5:a5;return e?"#"+t(e.r)+t(e.g)+t(e.b)+u5(e.a,t):void 0}const h5=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function wC(e,t,n){const r=t*Math.min(n,1-n),i=(s,o=(s+e/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return[i(0),i(8),i(4)]}function f5(e,t,n){const r=(i,s=(i+e/60)%6)=>n-n*t*Math.max(Math.min(s,4-s,1),0);return[r(5),r(3),r(1)]}function p5(e,t,n){const r=wC(e,1,.5);let i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function g5(e,t,n,r,i){return e===i?(t-n)/r+(t<n?6:0):t===i?(n-e)/r+2:(e-t)/r+4}function Um(e){const n=e.r/255,r=e.g/255,i=e.b/255,s=Math.max(n,r,i),o=Math.min(n,r,i),a=(s+o)/2;let l,c,u;return s!==o&&(u=s-o,c=a>.5?u/(2-s-o):u/(s+o),l=g5(n,r,i,u,s),l=l*60+.5),[l|0,c||0,a]}function qm(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(di)}function Gm(e,t,n){return qm(wC,e,t,n)}function m5(e,t,n){return qm(p5,e,t,n)}function x5(e,t,n){return qm(f5,e,t,n)}function kC(e){return(e%360+360)%360}function v5(e){const t=h5.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?ra(+t[5]):di(+t[5]));const i=kC(+t[2]),s=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?r=m5(i,s,o):t[1]==="hsv"?r=x5(i,s,o):r=Gm(i,s,o),{r:r[0],g:r[1],b:r[2],a:n}}function y5(e,t){var n=Um(e);n[0]=kC(n[0]+t),n=Gm(n),e.r=n[0],e.g=n[1],e.b=n[2]}function b5(e){if(!e)return;const t=Um(e),n=t[0],r=eb(t[1]),i=eb(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${i}%, ${xr(e.a)})`:`hsl(${n}, ${r}%, ${i}%)`}const tb={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},nb={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function _5(){const e={},t=Object.keys(nb),n=Object.keys(tb);let r,i,s,o,a;for(r=0;r<t.length;r++){for(o=a=t[r],i=0;i<n.length;i++)s=n[i],a=a.replace(s,tb[s]);s=parseInt(nb[o],16),e[a]=[s>>16&255,s>>8&255,s&255]}return e}let tc;function w5(e){tc||(tc=_5(),tc.transparent=[0,0,0,0]);const t=tc[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const k5=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function S5(e){const t=k5.exec(e);let n=255,r,i,s;if(t){if(t[7]!==r){const o=+t[7];n=t[8]?ra(o):Xr(o*255,0,255)}return r=+t[1],i=+t[3],s=+t[5],r=255&(t[2]?ra(r):Xr(r,0,255)),i=255&(t[4]?ra(i):Xr(i,0,255)),s=255&(t[6]?ra(s):Xr(s,0,255)),{r,g:i,b:s,a:n}}}function C5(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${xr(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Hh=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,xs=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function E5(e,t,n){const r=xs(xr(e.r)),i=xs(xr(e.g)),s=xs(xr(e.b));return{r:di(Hh(r+n*(xs(xr(t.r))-r))),g:di(Hh(i+n*(xs(xr(t.g))-i))),b:di(Hh(s+n*(xs(xr(t.b))-s))),a:e.a+n*(t.a-e.a)}}function nc(e,t,n){if(e){let r=Um(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Gm(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function SC(e,t){return e&&Object.assign(t||{},e)}function rb(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=di(e[3]))):(t=SC(e,{r:0,g:0,b:0,a:1}),t.a=di(t.a)),t}function N5(e){return e.charAt(0)==="r"?S5(e):v5(e)}class sl{constructor(t){if(t instanceof sl)return t;const n=typeof t;let r;n==="object"?r=rb(t):n==="string"&&(r=c5(t)||w5(t)||N5(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=SC(this._rgb);return t&&(t.a=xr(t.a)),t}set rgb(t){this._rgb=rb(t)}rgbString(){return this._valid?C5(this._rgb):void 0}hexString(){return this._valid?d5(this._rgb):void 0}hslString(){return this._valid?b5(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,i=t.rgb;let s;const o=n===s?.5:n,a=2*o-1,l=r.a-i.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;s=1-c,r.r=255&c*r.r+s*i.r+.5,r.g=255&c*r.g+s*i.g+.5,r.b=255&c*r.b+s*i.b+.5,r.a=o*r.a+(1-o)*i.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=E5(this._rgb,t._rgb,n)),this}clone(){return new sl(this.rgb)}alpha(t){return this._rgb.a=di(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=_l(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return nc(this._rgb,2,t),this}darken(t){return nc(this._rgb,2,-t),this}saturate(t){return nc(this._rgb,1,t),this}desaturate(t){return nc(this._rgb,1,-t),this}rotate(t){return y5(this._rgb,t),this}}/*!
128
+ * Chart.js v4.5.1
129
+ * https://www.chartjs.org
130
+ * (c) 2025 Chart.js Contributors
131
+ * Released under the MIT License
132
+ */function ur(){}const P5=(()=>{let e=0;return()=>e++})();function ge(e){return e==null}function Ve(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function ve(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Qe(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function sn(e,t){return Qe(e)?e:t}function ce(e,t){return typeof e>"u"?t:e}const j5=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,CC=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Le(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function je(e,t,n,r){let i,s,o;if(Ve(e))for(s=e.length,i=0;i<s;i++)t.call(n,e[i],i);else if(ve(e))for(o=Object.keys(e),s=o.length,i=0;i<s;i++)t.call(n,e[o[i]],o[i])}function Lu(e,t){let n,r,i,s;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(i=e[n],s=t[n],i.datasetIndex!==s.datasetIndex||i.index!==s.index)return!1;return!0}function Ou(e){if(Ve(e))return e.map(Ou);if(ve(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let i=0;for(;i<r;++i)t[n[i]]=Ou(e[n[i]]);return t}return e}function EC(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function T5(e,t,n,r){if(!EC(e))return;const i=t[e],s=n[e];ve(i)&&ve(s)?ol(i,s,r):t[e]=Ou(s)}function ol(e,t,n){const r=Ve(t)?t:[t],i=r.length;if(!ve(e))return e;n=n||{};const s=n.merger||T5;let o;for(let a=0;a<i;++a){if(o=r[a],!ve(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)s(l[c],e,o,n)}return e}function Ea(e,t){return ol(e,t,{merger:M5})}function M5(e,t,n){if(!EC(e))return;const r=t[e],i=n[e];ve(r)&&ve(i)?Ea(r,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Ou(i))}const ib={"":e=>e,x:e=>e.x,y:e=>e.y};function R5(e){const t=e.split("."),n=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function D5(e){const t=R5(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function pi(e,t){return(ib[t]||(ib[t]=D5(t)))(e)}function Km(e){return e.charAt(0).toUpperCase()+e.slice(1)}const al=e=>typeof e<"u",gi=e=>typeof e=="function",sb=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function A5(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Ne=Math.PI,We=2*Ne,I5=We+Ne,Fu=Number.POSITIVE_INFINITY,L5=Ne/180,nt=Ne/2,Ni=Ne/4,ob=Ne*2/3,Jr=Math.log10,ir=Math.sign;function Na(e,t,n){return Math.abs(e-t)<n}function ab(e){const t=Math.round(e);e=Na(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Jr(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function O5(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((i,s)=>i-s).pop(),t}function F5(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function co(e){return!F5(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function $5(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function NC(e,t,n){let r,i,s;for(r=0,i=e.length;r<i;r++)s=e[r][n],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function On(e){return e*(Ne/180)}function Ym(e){return e*(180/Ne)}function lb(e){if(!Qe(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function PC(e,t){const n=t.x-e.x,r=t.y-e.y,i=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n);return s<-.5*Ne&&(s+=We),{angle:s,distance:i}}function Jp(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function z5(e,t){return(e-t+I5)%We-Ne}function Nt(e){return(e%We+We)%We}function ll(e,t,n,r){const i=Nt(e),s=Nt(t),o=Nt(n),a=Nt(s-i),l=Nt(o-i),c=Nt(i-s),u=Nt(i-o);return i===s||i===o||r&&s===o||a>l&&c<u}function gt(e,t,n){return Math.max(t,Math.min(n,e))}function B5(e){return gt(e,-32768,32767)}function _r(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Xm(e,t,n){n=n||(o=>e[o]<t);let r=e.length-1,i=0,s;for(;r-i>1;)s=i+r>>1,n(s)?i=s:r=s;return{lo:i,hi:r}}const wr=(e,t,n,r)=>Xm(e,n,r?i=>{const s=e[i][t];return s<n||s===n&&e[i+1][t]===n}:i=>e[i][t]<n),W5=(e,t,n)=>Xm(e,n,r=>e[r][t]>=n);function H5(e,t,n){let r=0,i=e.length;for(;r<i&&e[r]<t;)r++;for(;i>r&&e[i-1]>n;)i--;return r>0||i<e.length?e.slice(r,i):e}const jC=["push","pop","shift","splice","unshift"];function V5(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),jC.forEach(n=>{const r="_onData"+Km(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const o=i.apply(this,s);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...s)}),o}})})}function cb(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(jC.forEach(s=>{delete e[s]}),delete e._chartjs)}function TC(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const MC=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function RC(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,MC.call(window,()=>{r=!1,e.apply(t,n)}))}}function U5(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Jm=e=>e==="start"?"left":e==="end"?"right":"center",Et=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,q5=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function DC(e,t,n){const r=t.length;let i=0,s=r;if(e._sorted){const{iScale:o,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:p,maxDefined:g}=o.getUserBounds();if(p){if(i=Math.min(wr(l,u,d).lo,n?r:wr(t,u,o.getPixelForValue(d)).lo),c){const m=l.slice(0,i+1).reverse().findIndex(y=>!ge(y[a.axis]));i-=Math.max(0,m)}i=gt(i,0,r-1)}if(g){let m=Math.max(wr(l,o.axis,f,!0).hi+1,n?0:wr(t,u,o.getPixelForValue(f),!0).hi+1);if(c){const y=l.slice(m-1).findIndex(x=>!ge(x[a.axis]));m+=Math.max(0,y)}s=gt(m,i,r)-i}else s=r-i}return{start:i,count:s}}function AC(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;const s=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),s}const rc=e=>e===0||e===1,ub=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*We/n)),db=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*We/n)+1,Pa={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*nt)+1,easeOutSine:e=>Math.sin(e*nt),easeInOutSine:e=>-.5*(Math.cos(Ne*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>rc(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>rc(e)?e:ub(e,.075,.3),easeOutElastic:e=>rc(e)?e:db(e,.075,.3),easeInOutElastic(e){return rc(e)?e:e<.5?.5*ub(e*2,.1125,.45):.5+.5*db(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Pa.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Pa.easeInBounce(e*2)*.5:Pa.easeOutBounce(e*2-1)*.5+.5};function Qm(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function hb(e){return Qm(e)?e:new sl(e)}function Vh(e){return Qm(e)?e:new sl(e).saturate(.5).darken(.1).hexString()}const G5=["x","y","borderWidth","radius","tension"],K5=["color","borderColor","backgroundColor"];function Y5(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:K5},numbers:{type:"number",properties:G5}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function X5(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const fb=new Map;function J5(e,t){t=t||{};const n=e+JSON.stringify(t);let r=fb.get(n);return r||(r=new Intl.NumberFormat(e,t),fb.set(n,r)),r}function wl(e,t,n){return J5(t,n).format(e)}const IC={values(e){return Ve(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let i,s=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(i="scientific"),s=Q5(e,n)}const o=Jr(Math.abs(s)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),wl(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Jr(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?IC.numeric.call(this,e,t,n):""}};function Q5(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var bd={formatters:IC};function Z5(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:bd.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const ts=Object.create(null),Qp=Object.create(null);function ja(e,t){if(!t)return e;const n=t.split(".");for(let r=0,i=n.length;r<i;++r){const s=n[r];e=e[s]||(e[s]=Object.create(null))}return e}function Uh(e,t,n){return typeof t=="string"?ol(ja(e,t),n):ol(ja(e,""),t)}class e3{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,i)=>Vh(i.backgroundColor),this.hoverBorderColor=(r,i)=>Vh(i.borderColor),this.hoverColor=(r,i)=>Vh(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Uh(this,t,n)}get(t){return ja(this,t)}describe(t,n){return Uh(Qp,t,n)}override(t,n){return Uh(ts,t,n)}route(t,n,r,i){const s=ja(this,t),o=ja(this,r),a="_"+n;Object.defineProperties(s,{[a]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[i];return ve(l)?Object.assign({},c,l):ce(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Ue=new e3({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Y5,X5,Z5]);function t3(e){return!e||ge(e.size)||ge(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function $u(e,t,n,r,i){let s=t[i];return s||(s=t[i]=e.measureText(i).width,n.push(i)),s>r&&(r=s),r}function n3(e,t,n,r){r=r||{};let i=r.data=r.data||{},s=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},s=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0;const a=n.length;let l,c,u,d,f;for(l=0;l<a;l++)if(d=n[l],d!=null&&!Ve(d))o=$u(e,i,s,o,d);else if(Ve(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!Ve(f)&&(o=$u(e,i,s,o,f));e.restore();const p=s.length/2;if(p>n.length){for(l=0;l<p;l++)delete i[s[l]];s.splice(0,p)}return o}function Pi(e,t,n){const r=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*r)/r+i}function pb(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Zp(e,t,n,r){LC(e,t,n,r,null)}function LC(e,t,n,r,i){let s,o,a,l,c,u,d,f;const p=t.pointStyle,g=t.rotation,m=t.radius;let y=(g||0)*L5;if(p&&typeof p=="object"&&(s=p.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(y),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(m)||m<=0)){switch(e.beginPath(),p){default:i?e.ellipse(n,r,i/2,m,0,0,We):e.arc(n,r,m,0,We),e.closePath();break;case"triangle":u=i?i/2:m,e.moveTo(n+Math.sin(y)*u,r-Math.cos(y)*m),y+=ob,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*m),y+=ob,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*m),e.closePath();break;case"rectRounded":c=m*.516,l=m-c,o=Math.cos(y+Ni)*l,d=Math.cos(y+Ni)*(i?i/2-c:l),a=Math.sin(y+Ni)*l,f=Math.sin(y+Ni)*(i?i/2-c:l),e.arc(n-d,r-a,c,y-Ne,y-nt),e.arc(n+f,r-o,c,y-nt,y),e.arc(n+d,r+a,c,y,y+nt),e.arc(n-f,r+o,c,y+nt,y+Ne),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,u=i?i/2:l,e.rect(n-u,r-l,2*u,2*l);break}y+=Ni;case"rectRot":d=Math.cos(y)*(i?i/2:m),o=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(i?i/2:m),e.moveTo(n-d,r-a),e.lineTo(n+f,r-o),e.lineTo(n+d,r+a),e.lineTo(n-f,r+o),e.closePath();break;case"crossRot":y+=Ni;case"cross":d=Math.cos(y)*(i?i/2:m),o=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(i?i/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case"star":d=Math.cos(y)*(i?i/2:m),o=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(i?i/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o),y+=Ni,d=Math.cos(y)*(i?i/2:m),o=Math.cos(y)*m,a=Math.sin(y)*m,f=Math.sin(y)*(i?i/2:m),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-o),e.lineTo(n-f,r+o);break;case"line":o=i?i/2:Math.cos(y)*m,a=Math.sin(y)*m,e.moveTo(n-o,r-a),e.lineTo(n+o,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(y)*(i?i/2:m),r+Math.sin(y)*m);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function kr(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function _d(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function wd(e){e.restore()}function r3(e,t,n,r,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const s=(t.x+n.x)/2;e.lineTo(s,t.y),e.lineTo(s,n.y)}else i==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function i3(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function s3(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),ge(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function o3(e,t,n,r,i){if(i.strikethrough||i.underline){const s=e.measureText(r),o=t-s.actualBoundingBoxLeft,a=t+s.actualBoundingBoxRight,l=n-s.actualBoundingBoxAscent,c=n+s.actualBoundingBoxDescent,u=i.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(o,u),e.lineTo(a,u),e.stroke()}}function a3(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function ns(e,t,n,r,i,s={}){const o=Ve(t)?t:[t],a=s.strokeWidth>0&&s.strokeColor!=="";let l,c;for(e.save(),e.font=i.string,s3(e,s),l=0;l<o.length;++l)c=o[l],s.backdrop&&a3(e,s.backdrop),a&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),ge(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(c,n,r,s.maxWidth)),e.fillText(c,n,r,s.maxWidth),o3(e,n,r,c,s),r+=Number(i.lineHeight);e.restore()}function cl(e,t){const{x:n,y:r,w:i,h:s,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*Ne,Ne,!0),e.lineTo(n,r+s-o.bottomLeft),e.arc(n+o.bottomLeft,r+s-o.bottomLeft,o.bottomLeft,Ne,nt,!0),e.lineTo(n+i-o.bottomRight,r+s),e.arc(n+i-o.bottomRight,r+s-o.bottomRight,o.bottomRight,nt,0,!0),e.lineTo(n+i,r+o.topRight),e.arc(n+i-o.topRight,r+o.topRight,o.topRight,0,-nt,!0),e.lineTo(n+o.topLeft,r)}const l3=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,c3=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function u3(e,t){const n=(""+e).match(l3);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const d3=e=>+e||0;function Zm(e,t){const n={},r=ve(t),i=r?Object.keys(t):t,s=ve(e)?r?o=>ce(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of i)n[o]=d3(s(o));return n}function OC(e){return Zm(e,{top:"y",right:"x",bottom:"y",left:"x"})}function qi(e){return Zm(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Rt(e){const t=OC(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ft(e,t){e=e||{},t=t||Ue.font;let n=ce(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=ce(e.style,t.style);r&&!(""+r).match(c3)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:ce(e.family,t.family),lineHeight:u3(ce(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:ce(e.weight,t.weight),string:""};return i.string=t3(i),i}function ia(e,t,n,r){let i,s,o;for(i=0,s=e.length;i<s;++i)if(o=e[i],o!==void 0&&o!==void 0)return o}function h3(e,t,n){const{min:r,max:i}=e,s=CC(t,(i-r)/2),o=(a,l)=>n&&a===0?0:a+l;return{min:o(r,-Math.abs(s)),max:o(i,s)}}function _i(e,t){return Object.assign(Object.create(e),t)}function ex(e,t=[""],n,r,i=()=>e[0]){const s=n||e;typeof r>"u"&&(r=BC("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:r,_getTarget:i,override:a=>ex([a,...e],t,s,r)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return $C(a,l,()=>b3(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return mb(a).includes(l)},ownKeys(a){return mb(a)},set(a,l,c){const u=a._storage||(a._storage=i());return a[l]=u[l]=c,delete a._keys,!0}})}function uo(e,t,n,r){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:FC(e,r),setContext:s=>uo(e,s,n,r),override:s=>uo(e.override(s),t,n,r)};return new Proxy(i,{deleteProperty(s,o){return delete s[o],delete e[o],!0},get(s,o,a){return $C(s,o,()=>p3(s,o,a))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(s,o,a){return e[o]=a,delete s[o],!0}})}function FC(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:gi(n)?n:()=>n,isIndexable:gi(r)?r:()=>r}}const f3=(e,t)=>e?e+Km(t):t,tx=(e,t)=>ve(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function $C(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function p3(e,t,n){const{_proxy:r,_context:i,_subProxy:s,_descriptors:o}=e;let a=r[t];return gi(a)&&o.isScriptable(t)&&(a=g3(t,a,e,n)),Ve(a)&&a.length&&(a=m3(t,a,e,o.isIndexable)),tx(t,a)&&(a=uo(a,i,s&&s[t],o)),a}function g3(e,t,n,r){const{_proxy:i,_context:s,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(s,o||r);return a.delete(e),tx(e,l)&&(l=nx(i._scopes,i,e,l)),l}function m3(e,t,n,r){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;if(typeof s.index<"u"&&r(e))return t[s.index%t.length];if(ve(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=nx(c,i,e,u);t.push(uo(d,s,o&&o[e],a))}}return t}function zC(e,t,n){return gi(e)?e(t,n):e}const x3=(e,t)=>e===!0?t:typeof e=="string"?pi(t,e):void 0;function v3(e,t,n,r,i){for(const s of t){const o=x3(n,s);if(o){e.add(o);const a=zC(o._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(o===!1&&typeof r<"u"&&n!==r)return null}return!1}function nx(e,t,n,r){const i=t._rootScopes,s=zC(t._fallback,n,r),o=[...e,...i],a=new Set;a.add(r);let l=gb(a,o,n,s||n,r);return l===null||typeof s<"u"&&s!==n&&(l=gb(a,o,s,l,r),l===null)?!1:ex(Array.from(a),[""],i,s,()=>y3(t,n,r))}function gb(e,t,n,r,i){for(;n;)n=v3(e,t,n,r,i);return n}function y3(e,t,n){const r=e._getTarget();t in r||(r[t]={});const i=r[t];return Ve(i)&&ve(n)?n:i||{}}function b3(e,t,n,r){let i;for(const s of t)if(i=BC(f3(s,e),n),typeof i<"u")return tx(e,i)?nx(n,r,e,i):i}function BC(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function mb(e){let t=e._keys;return t||(t=e._keys=_3(e._scopes)),t}function _3(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}function WC(e,t,n,r){const{iScale:i}=e,{key:s="r"}=this._parsing,o=new Array(r);let a,l,c,u;for(a=0,l=r;a<l;++a)c=a+n,u=t[c],o[a]={r:i.parse(pi(u,s),c)};return o}const w3=Number.EPSILON||1e-14,ho=(e,t)=>t<e.length&&!e[t].skip&&e[t],HC=e=>e==="x"?"y":"x";function k3(e,t,n,r){const i=e.skip?t:e,s=t,o=n.skip?t:n,a=Jp(s,i),l=Jp(o,s);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,f=r*u;return{previous:{x:s.x-d*(o.x-i.x),y:s.y-d*(o.y-i.y)},next:{x:s.x+f*(o.x-i.x),y:s.y+f*(o.y-i.y)}}}function S3(e,t,n){const r=e.length;let i,s,o,a,l,c=ho(e,0);for(let u=0;u<r-1;++u)if(l=c,c=ho(e,u+1),!(!l||!c)){if(Na(t[u],0,w3)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],s=n[u+1]/t[u],a=Math.pow(i,2)+Math.pow(s,2),!(a<=9)&&(o=3/Math.sqrt(a),n[u]=i*o*t[u],n[u+1]=s*o*t[u])}}function C3(e,t,n="x"){const r=HC(n),i=e.length;let s,o,a,l=ho(e,0);for(let c=0;c<i;++c){if(o=a,a=l,l=ho(e,c+1),!a)continue;const u=a[n],d=a[r];o&&(s=(u-o[n])/3,a[`cp1${n}`]=u-s,a[`cp1${r}`]=d-s*t[c]),l&&(s=(l[n]-u)/3,a[`cp2${n}`]=u+s,a[`cp2${r}`]=d+s*t[c])}}function E3(e,t="x"){const n=HC(t),r=e.length,i=Array(r).fill(0),s=Array(r);let o,a,l,c=ho(e,0);for(o=0;o<r;++o)if(a=l,l=c,c=ho(e,o+1),!!l){if(c){const u=c[t]-l[t];i[o]=u!==0?(c[n]-l[n])/u:0}s[o]=a?c?ir(i[o-1])!==ir(i[o])?0:(i[o-1]+i[o])/2:i[o-1]:i[o]}S3(e,i,s),C3(e,s,t)}function ic(e,t,n){return Math.max(Math.min(e,n),t)}function N3(e,t){let n,r,i,s,o,a=kr(e[0],t);for(n=0,r=e.length;n<r;++n)o=s,s=a,a=n<r-1&&kr(e[n+1],t),s&&(i=e[n],o&&(i.cp1x=ic(i.cp1x,t.left,t.right),i.cp1y=ic(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=ic(i.cp2x,t.left,t.right),i.cp2y=ic(i.cp2y,t.top,t.bottom)))}function P3(e,t,n,r,i){let s,o,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")E3(e,i);else{let c=r?e[e.length-1]:e[0];for(s=0,o=e.length;s<o;++s)a=e[s],l=k3(c,a,e[Math.min(s+1,o-(r?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&N3(e,n)}function rx(){return typeof window<"u"&&typeof document<"u"}function ix(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function zu(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const kd=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function j3(e,t){return kd(e).getPropertyValue(t)}const T3=["top","right","bottom","left"];function Gi(e,t,n){const r={};n=n?"-"+n:"";for(let i=0;i<4;i++){const s=T3[i];r[s]=parseFloat(e[t+"-"+s+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const M3=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function R3(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:s}=r;let o=!1,a,l;if(M3(i,s,e.target))a=i,l=s;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function Ai(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,i=kd(n),s=i.boxSizing==="border-box",o=Gi(i,"padding"),a=Gi(i,"border","width"),{x:l,y:c,box:u}=R3(e,n),d=o.left+(u&&a.left),f=o.top+(u&&a.top);let{width:p,height:g}=t;return s&&(p-=o.width+a.width,g-=o.height+a.height),{x:Math.round((l-d)/p*n.width/r),y:Math.round((c-f)/g*n.height/r)}}function D3(e,t,n){let r,i;if(t===void 0||n===void 0){const s=e&&ix(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const o=s.getBoundingClientRect(),a=kd(s),l=Gi(a,"border","width"),c=Gi(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,r=zu(a.maxWidth,s,"clientWidth"),i=zu(a.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:r||Fu,maxHeight:i||Fu}}const Qr=e=>Math.round(e*10)/10;function A3(e,t,n,r){const i=kd(e),s=Gi(i,"margin"),o=zu(i.maxWidth,e,"clientWidth")||Fu,a=zu(i.maxHeight,e,"clientHeight")||Fu,l=D3(e,t,n);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const f=Gi(i,"border","width"),p=Gi(i,"padding");c-=p.width+f.width,u-=p.height+f.height}return c=Math.max(0,c-s.width),u=Math.max(0,r?c/r:u-s.height),c=Qr(Math.min(c,o,l.maxWidth)),u=Qr(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Qr(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=Qr(Math.floor(u*r))),{width:c,height:u}}function xb(e,t,n){const r=t||1,i=Qr(e.height*r),s=Qr(e.width*r);e.height=Qr(e.height),e.width=Qr(e.width);const o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==s?(e.currentDevicePixelRatio=r,o.height=i,o.width=s,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const I3=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};rx()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function vb(e,t){const n=j3(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Ii(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function L3(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function O3(e,t,n,r){const i={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},o=Ii(e,i,n),a=Ii(i,s,n),l=Ii(s,t,n),c=Ii(o,a,n),u=Ii(a,l,n);return Ii(c,u,n)}const F3=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},$3=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Ys(e,t,n){return e?F3(t,n):$3()}function VC(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function UC(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function qC(e){return e==="angle"?{between:ll,compare:z5,normalize:Nt}:{between:_r,compare:(t,n)=>t-n,normalize:t=>t}}function yb({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function z3(e,t,n){const{property:r,start:i,end:s}=n,{between:o,normalize:a}=qC(r),l=t.length;let{start:c,end:u,loop:d}=e,f,p;if(d){for(c+=l,u+=l,f=0,p=l;f<p&&o(a(t[c%l][r]),i,s);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function GC(e,t,n){if(!n)return[e];const{property:r,start:i,end:s}=n,o=t.length,{compare:a,between:l,normalize:c}=qC(r),{start:u,end:d,loop:f,style:p}=z3(e,t,n),g=[];let m=!1,y=null,x,v,b;const S=()=>l(i,b,x)&&a(i,b)!==0,k=()=>a(s,x)===0||l(s,b,x),_=()=>m||S(),C=()=>!m||k();for(let P=u,j=u;P<=d;++P)v=t[P%o],!v.skip&&(x=c(v[r]),x!==b&&(m=l(x,i,s),y===null&&_()&&(y=a(x,i)===0?P:j),y!==null&&C()&&(g.push(yb({start:y,end:P,loop:f,count:o,style:p})),y=null),j=P,b=x));return y!==null&&g.push(yb({start:y,end:d,loop:f,count:o,style:p})),g}function KC(e,t){const n=[],r=e.segments;for(let i=0;i<r.length;i++){const s=GC(r[i],e.points,t);s.length&&n.push(...s)}return n}function B3(e,t,n,r){let i=0,s=t-1;if(n&&!r)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(s+=i);s>i&&e[s%t].skip;)s--;return s%=t,{start:i,end:s}}function W3(e,t,n,r){const i=e.length,s=[];let o=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%i];c.skip||c.stop?a.skip||(r=!1,s.push({start:t%i,end:(l-1)%i,loop:r}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&s.push({start:t%i,end:o%i,loop:r}),s}function H3(e,t){const n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];const s=!!e._loop,{start:o,end:a}=B3(n,i,s,r);if(r===!0)return bb(e,[{start:o,end:a,loop:s}],n,t);const l=a<o?a+i:a,c=!!e._fullLoop&&o===0&&a===i-1;return bb(e,W3(n,o,l,c),n,t)}function bb(e,t,n,r){return!r||!r.setContext||!n?t:V3(e,t,n,r)}function V3(e,t,n,r){const i=e._chart.getContext(),s=_b(e.options),{_datasetIndex:o,options:{spanGaps:a}}=e,l=n.length,c=[];let u=s,d=t[0].start,f=d;function p(g,m,y,x){const v=a?-1:1;if(g!==m){for(g+=l;n[g%l].skip;)g-=v;for(;n[m%l].skip;)m+=v;g%l!==m%l&&(c.push({start:g%l,end:m%l,loop:y,style:x}),u=x,d=m%l)}}for(const g of t){d=a?d:g.start;let m=n[d%l],y;for(f=d+1;f<=g.end;f++){const x=n[f%l];y=_b(r.setContext(_i(i,{type:"segment",p0:m,p1:x,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),U3(y,u)&&p(d,f-1,g.loop,u),m=x,u=y}d<f-1&&p(d,f-1,g.loop,u)}return c}function _b(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function U3(e,t){if(!t)return!1;const n=[],r=function(i,s){return Qm(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function sc(e,t,n){return e.options.clip?e[n]:t[n]}function q3(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:sc(n,t,"left"),right:sc(n,t,"right"),top:sc(r,t,"top"),bottom:sc(r,t,"bottom")}:t}function YC(e,t){const n=t._clip;if(n.disabled)return!1;const r=q3(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}/*!
133
+ * Chart.js v4.5.1
134
+ * https://www.chartjs.org
135
+ * (c) 2025 Chart.js Contributors
136
+ * Released under the MIT License
137
+ */class G3{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,i){const s=n.listeners[i],o=n.duration;s.forEach(a=>a({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=MC.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const s=r.items;let o=s.length-1,a=!1,l;for(;o>=0;--o)l=s[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(s[o]=s[s.length-1],s.pop());a&&(i.draw(),this._notify(i,r,t,"progress")),s.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,i)=>Math.max(r,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var hr=new G3;const wb="transparent",K3={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=hb(e||wb),i=r.valid&&hb(t||wb);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Y3{constructor(t,n,r,i){const s=n[r];i=ia([t.to,i,s,t.from]);const o=ia([t.from,s,i]);this._active=!0,this._fn=t.fn||K3[t.type||typeof o],this._easing=Pa[t.easing]||Pa.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const i=this._target[this._prop],s=r-this._start,o=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=ia([t.to,n,i,t.from]),this._from=ia([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,i=this._prop,s=this._from,o=this._loop,a=this._to;let l;if(this._active=s!==a&&(o||n<r),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=s;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(s,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][n]()}}class XC{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!ve(t))return;const n=Object.keys(Ue.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!ve(s))return;const o={};for(const a of n)o[a]=s[a];(Ve(s.properties)&&s.properties||[i]).forEach(a=>{(a===i||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,i=J3(t,r);if(!i)return[];const s=this._createAnimations(i,r);return r.$shared&&X3(t.options.$animations,r).then(()=>{t.options=r},()=>{}),s}_createAnimations(t,n){const r=this._properties,i=[],s=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[c];let d=s[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}s[c]=d=new Y3(f,t,c,u),i.push(d)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return hr.add(this._chart,r),!0}}function X3(e,t){const n=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const s=e[r[i]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function J3(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function kb(e,t){const n=e&&e.options||{},r=n.reverse,i=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:r?s:i,end:r?i:s}}function Q3(e,t,n){if(n===!1)return!1;const r=kb(e,n),i=kb(t,n);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function Z3(e){let t,n,r,i;return ve(e)?(t=e.top,n=e.right,r=e.bottom,i=e.left):t=n=r=i=e,{top:t,right:n,bottom:r,left:i,disabled:e===!1}}function JC(e,t){const n=[],r=e._getSortedDatasetMetas(t);let i,s;for(i=0,s=r.length;i<s;++i)n.push(r[i].index);return n}function Sb(e,t,n,r={}){const i=e.keys,s=r.mode==="single";let o,a,l,c;if(t===null)return;let u=!1;for(o=0,a=i.length;o<a;++o){if(l=+i[o],l===n){if(u=!0,r.all)continue;break}c=e.values[l],Qe(c)&&(s||t===0||ir(t)===ir(c))&&(t+=c)}return!u&&!r.all?0:t}function ez(e,t){const{iScale:n,vScale:r}=t,i=n.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",o=Object.keys(e),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[i]:u,[s]:e[u]};return a}function qh(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function tz(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function nz(e){const{min:t,max:n,minDefined:r,maxDefined:i}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function rz(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function Cb(e,t,n,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const s=e[i.index];if(n&&s>0||!n&&s<0)return i.index}return null}function Eb(e,t){const{chart:n,_cachedMeta:r}=e,i=n._stacks||(n._stacks={}),{iScale:s,vScale:o,index:a}=r,l=s.axis,c=o.axis,u=tz(s,o,r),d=t.length;let f;for(let p=0;p<d;++p){const g=t[p],{[l]:m,[c]:y}=g,x=g._stacks||(g._stacks={});f=x[c]=rz(i,u,m),f[a]=y,f._top=Cb(f,o,!0,r.type),f._bottom=Cb(f,o,!1,r.type);const v=f._visualValues||(f._visualValues={});v[a]=y}}function Gh(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function iz(e,t){return _i(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function sz(e,t,n){return _i(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Wo(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const i of t){const s=i._stacks;if(!s||s[r]===void 0||s[r][n]===void 0)return;delete s[r][n],s[r]._visualValues!==void 0&&s[r]._visualValues[n]!==void 0&&delete s[r]._visualValues[n]}}}const Kh=e=>e==="reset"||e==="none",Nb=(e,t)=>t?e:Object.assign({},e),oz=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:JC(n,!0),values:null};class Bn{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=qh(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Wo(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),i=(d,f,p,g)=>d==="x"?f:d==="r"?g:p,s=n.xAxisID=ce(r.xAxisID,Gh(t,"x")),o=n.yAxisID=ce(r.yAxisID,Gh(t,"y")),a=n.rAxisID=ce(r.rAxisID,Gh(t,"r")),l=n.indexAxis,c=n.iAxisID=i(l,s,o,a),u=n.vAxisID=i(l,o,s,a);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&cb(this._data,this),t._stacked&&Wo(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(ve(n)){const i=this._cachedMeta;this._data=ez(n,i)}else if(r!==n){if(r){cb(r,this);const i=this._cachedMeta;Wo(i),i._parsed=[]}n&&Object.isExtensible(n)&&V5(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let i=!1;this._dataCheck();const s=n._stacked;n._stacked=qh(n.vScale,n),n.stack!==r.stack&&(i=!0,Wo(n),n.stack=r.stack),this._resyncElements(t),(i||s!==n._stacked)&&(Eb(this,n._parsed),n._stacked=qh(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:i}=this,{iScale:s,_stacked:o}=r,a=s.axis;let l=t===0&&n===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{Ve(i[t])?f=this.parseArrayData(r,i,t,n):ve(i[t])?f=this.parseObjectData(r,i,t,n):f=this.parsePrimitiveData(r,i,t,n);const p=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],l&&(p()&&(l=!1),c=d);r._sorted=l}o&&Eb(this,f)}parsePrimitiveData(t,n,r,i){const{iScale:s,vScale:o}=t,a=s.axis,l=o.axis,c=s.getLabels(),u=s===o,d=new Array(i);let f,p,g;for(f=0,p=i;f<p;++f)g=f+r,d[f]={[a]:u||s.parse(c[g],g),[l]:o.parse(n[g],g)};return d}parseArrayData(t,n,r,i){const{xScale:s,yScale:o}=t,a=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+r,d=n[u],a[l]={x:s.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,n,r,i){const{xScale:s,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,d,f,p;for(u=0,d=i;u<d;++u)f=u+r,p=n[f],c[u]={x:s.parse(pi(p,a),f),y:o.parse(pi(p,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const i=this.chart,s=this._cachedMeta,o=n[t.axis],a={keys:JC(i,!0),values:n._stacks[t.axis]._visualValues};return Sb(a,o,s.index,{mode:r})}updateRangeFromParsed(t,n,r,i){const s=r[n.axis];let o=s===null?NaN:s;const a=i&&r._stacks[n.axis];i&&a&&(i.values=a,o=Sb(i,s,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,i=r._parsed,s=r._sorted&&t===r.iScale,o=i.length,a=this._getOtherScale(t),l=oz(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=nz(a);let f,p;function g(){p=i[f];const m=p[a.axis];return!Qe(p[t.axis])||u>m||d<m}for(f=0;f<o&&!(!g()&&(this.updateRangeFromParsed(c,t,p,l),s));++f);if(s){for(f=o-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let i,s,o;for(i=0,s=n.length;i<s;++i)o=n[i][t.axis],Qe(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,i=n.vScale,s=this.getParsed(t);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:i?""+i.getLabelForValue(s[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=Z3(ce(this.options.clip,Q3(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,i=r.data||[],s=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||i.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,s,a,l),u=a;u<a+l;++u){const d=i[u];d.hidden||(d.active&&c?o.push(d):d.draw(t,s))}for(u=0;u<o.length;++u)o[u].draw(t,s)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const i=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];s=o.$context||(o.$context=sz(this.getContext(),t,o)),s.parsed=this.getParsed(t),s.raw=i.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=iz(this.chart.getContext(),this.index)),s.dataset=i,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=r,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const i=n==="active",s=this._cachedDataOpts,o=t+"-"+n,a=s[o],l=this.enableOptionSharing&&al(r);if(a)return Nb(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),p=Object.keys(Ue.elements[t]),g=()=>this.getContext(r,i,n),m=c.resolveNamedOptions(f,p,g,d);return m.$shared&&(m.$shared=l,s[o]=Object.freeze(Nb(m,l))),m}_resolveAnimations(t,n,r){const i=this.chart,s=this._cachedDataOpts,o=`animation-${n}`,a=s[o];if(a)return a;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,n))}const c=new XC(i,l&&l.animations);return l&&l._cacheable&&(s[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Kh(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),i=this._sharedOptions,s=this.getSharedOptions(r),o=this.includeOptions(n,s)||s!==i;return this.updateSharedOptions(s,n,r),{sharedOptions:s,includeOptions:o}}updateElement(t,n,r,i){Kh(i)?Object.assign(t,r):this._resolveAnimations(n,i).update(t,r)}updateSharedOptions(t,n,r){t&&!Kh(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,i){t.active=i;const s=this.getStyle(n,i);this._resolveAnimations(n,r,i).update(t,{options:!i&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const i=r.length,s=n.length,o=Math.min(s,i);o&&this.parse(0,o),s>i?this._insertElements(i,s-i,t):s<i&&this._removeElements(s,i-s)}_insertElements(t,n,r=!0){const i=this._cachedMeta,s=i.data,o=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(s),a=t;a<o;++a)s[a]=new this.dataElementType;this._parsing&&l(i._parsed),this.parse(t,n),r&&this.updateElements(s,t,n,"reset")}updateElements(t,n,r,i){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,n);r._stacked&&Wo(r,i)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,i]=t;this[n](r,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}U(Bn,"defaults",{}),U(Bn,"datasetElementType",null),U(Bn,"dataElementType",null);function az(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let i=0,s=n.length;i<s;i++)r=r.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=TC(r.sort((i,s)=>i-s))}return e._cache.$bar}function lz(e){const t=e.iScale,n=az(t,e.type);let r=t._length,i,s,o,a;const l=()=>{o===32767||o===-32768||(al(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(i=0,s=n.length;i<s;++i)o=t.getPixelForValue(n[i]),l();for(a=void 0,i=0,s=t.ticks.length;i<s;++i)o=t.getPixelForTick(i),l();return r}function cz(e,t,n,r){const i=n.barThickness;let s,o;return ge(i)?(s=t.min*n.categoryPercentage,o=n.barPercentage):(s=i*r,o=1),{chunk:s/r,ratio:o,start:t.pixels[e]-s/2}}function uz(e,t,n,r){const i=t.pixels,s=i[e];let o=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const l=n.categoryPercentage;o===null&&(o=s-(a===null?t.end-t.start:a-s)),a===null&&(a=s+s-o);const c=s-(s-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/r,ratio:n.barPercentage,start:c}}function dz(e,t,n,r){const i=n.parse(e[0],r),s=n.parse(e[1],r),o=Math.min(i,s),a=Math.max(i,s);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:i,end:s,min:o,max:a}}function QC(e,t,n,r){return Ve(e)?dz(e,t,n,r):t[n.axis]=n.parse(e,r),t}function Pb(e,t,n,r){const i=e.iScale,s=e.vScale,o=i.getLabels(),a=i===s,l=[];let c,u,d,f;for(c=n,u=n+r;c<u;++c)f=t[c],d={},d[i.axis]=a||i.parse(o[c],c),l.push(QC(f,d,s,c));return l}function Yh(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function hz(e,t,n){return e!==0?ir(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function fz(e){let t,n,r,i,s;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(i="end",s="start"):(i="start",s="end"),{start:n,end:r,reverse:t,top:i,bottom:s}}function pz(e,t,n,r){let i=t.borderSkipped;const s={};if(!i){e.borderSkipped=s;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:u}=fz(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?i=c:(n._bottom||0)===r?i=u:(s[jb(u,o,a,l)]=!0,i=c)),s[jb(i,o,a,l)]=!0,e.borderSkipped=s}function jb(e,t,n,r){return r?(e=gz(e,t,n),e=Tb(e,n,t)):e=Tb(e,t,n),e}function gz(e,t,n){return e===t?n:e===n?t:e}function Tb(e,t,n){return e==="start"?t:e==="end"?n:e}function mz(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Ac extends Bn{parsePrimitiveData(t,n,r,i){return Pb(t,n,r,i)}parseArrayData(t,n,r,i){return Pb(t,n,r,i)}parseObjectData(t,n,r,i){const{iScale:s,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=s.axis==="x"?a:l,u=o.axis==="x"?a:l,d=[];let f,p,g,m;for(f=r,p=r+i;f<p;++f)m=n[f],g={},g[s.axis]=s.parse(pi(m,c),f),d.push(QC(pi(m,u),g,o,f));return d}updateRangeFromParsed(t,n,r,i){super.updateRangeFromParsed(t,n,r,i);const s=r._custom;s&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:i}=n,s=this.getParsed(t),o=s._custom,a=Yh(o)?"["+o.start+", "+o.end+"]":""+i.getLabelForValue(s[i.axis]);return{label:""+r.getLabelForValue(s[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,i){const s=i==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,i);for(let p=n;p<n+r;p++){const g=this.getParsed(p),m=s||ge(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),y=this._calculateBarIndexPixels(p,u),x=(g._stacks||{})[a.axis],v={horizontal:c,base:m.base,enableBorderRadius:!x||Yh(g._custom)||o===x._top||o===x._bottom,x:c?m.head:y.center,y:c?y.center:m.head,height:c?y.size:Math.abs(m.size),width:c?Math.abs(m.size):y.size};f&&(v.options=d||this.resolveDataElementOptions(p,t[p].active?"active":i));const b=v.options||t[p].options;pz(v,b,x,o),mz(v,b,u.ratio),this.updateElement(t[p],p,v,i)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=r.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],c=u=>{const d=u._parsed.find(p=>p[r.axis]===l),f=d&&d[u.vScale.axis];if(ge(f)||isNaN(f))return!0};for(const u of i)if(!(n!==void 0&&c(u))&&((s===!1||o.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&o.push(u.stack),u.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[ce(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const i=this._getStacks(t,r),s=n!==void 0?i.indexOf(n):-1;return s===-1?i.length-1:s}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,i=[];let s,o;for(s=0,o=n.data.length;s<o;++s)i.push(r.getPixelForValue(this.getParsed(s)[r.axis],s));const a=t.barThickness;return{min:a||lz(n),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:i},options:{base:s,minBarLength:o}}=this,a=s||0,l=this.getParsed(t),c=l._custom,u=Yh(c);let d=l[n.axis],f=0,p=r?this.applyStack(n,l,r):d,g,m;p!==d&&(f=p-d,p=d),u&&(d=c.barStart,p=c.barEnd-c.barStart,d!==0&&ir(d)!==ir(c.barEnd)&&(f=0),f+=d);const y=!ge(s)&&!u?s:f;let x=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?g=n.getPixelForValue(f+p):g=x,m=g-x,Math.abs(m)<o){m=hz(m,n,a)*o,d===a&&(x-=m/2);const v=n.getPixelForDecimal(0),b=n.getPixelForDecimal(1),S=Math.min(v,b),k=Math.max(v,b);x=Math.max(Math.min(x,k),S),g=x+m,r&&!u&&(l._stacks[n.axis]._visualValues[i]=n.getValueForPixel(g)-n.getValueForPixel(x))}if(x===n.getPixelForValue(a)){const v=ir(m)*n.getLineWidthForValue(a)/2;x+=v,m-=v}return{size:m,base:x,head:g,center:g+m/2}}_calculateBarIndexPixels(t,n){const r=n.scale,i=this.options,s=i.skipNull,o=ce(i.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(n.grouped){const u=s?this._getStackCount(t):n.stackCount,d=i.barThickness==="flex"?uz(t,n,i,u*c):cz(t,n,i,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(ce(f,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+p;a=d.start+d.chunk*g+d.chunk/2,l=Math.min(o,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(o,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,i=r.length;let s=0;for(;s<i;++s)this.getParsed(s)[n.axis]!==null&&!r[s].hidden&&r[s].draw(this._ctx)}}U(Ac,"id","bar"),U(Ac,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),U(Ac,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Ic extends Bn{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,i){const s=super.parsePrimitiveData(t,n,r,i);for(let o=0;o<s.length;o++)s[o]._custom=this.resolveDataElementOptions(o+r).radius;return s}parseArrayData(t,n,r,i){const s=super.parseArrayData(t,n,r,i);for(let o=0;o<s.length;o++){const a=n[r+o];s[o]._custom=ce(a[2],this.resolveDataElementOptions(o+r).radius)}return s}parseObjectData(t,n,r,i){const s=super.parseObjectData(t,n,r,i);for(let o=0;o<s.length;o++){const a=n[r+o];s[o]._custom=ce(a&&a.r&&+a.r,this.resolveDataElementOptions(o+r).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:s}=n,o=this.getParsed(t),a=i.getLabelForValue(o.x),l=s.getLabelForValue(o.y),c=o._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,i),u=o.axis,d=a.axis;for(let f=n;f<n+r;f++){const p=t[f],g=!s&&this.getParsed(f),m={},y=m[u]=s?o.getPixelForDecimal(.5):o.getPixelForValue(g[u]),x=m[d]=s?a.getBasePixel():a.getPixelForValue(g[d]);m.skip=isNaN(y)||isNaN(x),c&&(m.options=l||this.resolveDataElementOptions(f,p.active?"active":i),s&&(m.options.radius=0)),this.updateElement(p,f,m,i)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const s=i.radius;return n!=="active"&&(i.radius=0),i.radius+=ce(r&&r._custom,s),i}}U(Ic,"id","bubble"),U(Ic,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),U(Ic,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function xz(e,t,n){let r=1,i=1,s=0,o=0;if(t<We){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),f=Math.sin(l),p=(b,S,k)=>ll(b,a,l,!0)?1:Math.max(S,S*n,k,k*n),g=(b,S,k)=>ll(b,a,l,!0)?-1:Math.min(S,S*n,k,k*n),m=p(0,c,d),y=p(nt,u,f),x=g(Ne,c,d),v=g(Ne+nt,u,f);r=(m-x)/2,i=(y-v)/2,s=-(m+x)/2,o=-(y+v)/2}return{ratioX:r,ratioY:i,offsetX:s,offsetY:o}}class Bi extends Bn{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let s=l=>+r[l];if(ve(r[t])){const{key:l="value"}=this._parsing;s=c=>+pi(r[c],l)}let o,a;for(o=t,a=t+n;o<a;++o)i._parsed[o]=s(o)}}_getRotation(){return On(this.options.rotation-90)}_getCircumference(){return On(this.options.circumference)}_getRotationExtents(){let t=We,n=-We;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,s=i._getRotation(),o=i._getCircumference();t=Math.min(t,s),n=Math.max(n,s+o)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,i=this._cachedMeta,s=i.data,o=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-o)/2,0),l=Math.min(j5(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:g,offsetY:m}=xz(d,u,l),y=(r.width-o)/f,x=(r.height-o)/p,v=Math.max(Math.min(y,x)/2,0),b=CC(this.options.radius,v),S=Math.max(b*l,0),k=(b-S)/this._getVisibleDatasetWeightTotal();this.offsetX=g*b,this.offsetY=m*b,i.total=this.calculateTotal(),this.outerRadius=b-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*c,0),this.updateElements(s,0,s.length,t)}_circumference(t,n){const r=this.options,i=this._cachedMeta,s=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*s/We)}updateElements(t,n,r,i){const s=i==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=s&&c.animateScale,p=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:m,includeOptions:y}=this._getSharedOptions(n,i);let x=this._getRotation(),v;for(v=0;v<n;++v)x+=this._circumference(v,s);for(v=n;v<n+r;++v){const b=this._circumference(v,s),S=t[v],k={x:u+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+b,circumference:b,outerRadius:g,innerRadius:p};y&&(k.options=m||this.resolveDataElementOptions(v,S.active?"active":i)),x+=b,this.updateElement(S,v,k,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,i;for(i=0;i<n.length;i++){const s=t._parsed[i];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(r+=Math.abs(s))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?We*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],s=wl(n._parsed[t],r.options.locale);return{label:i[t]||"",value:s}}getMaxBorderWidth(t){let n=0;const r=this.chart;let i,s,o,a,l;if(!t){for(i=0,s=r.data.datasets.length;i<s;++i)if(r.isDatasetVisible(i)){o=r.getDatasetMeta(i),t=o.data,a=o.controller;break}}if(!t)return 0;for(i=0,s=t.length;i<s;++i)l=a.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,i=t.length;r<i;++r){const s=this.resolveDataElementOptions(r);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(ce(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}U(Bi,"id","doughnut"),U(Bi,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),U(Bi,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),U(Bi,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:r,textAlign:i,color:s,useBorderRadius:o,borderRadius:a}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const d=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:d.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(c),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:i,pointStyle:r,borderRadius:o&&(a||d.borderRadius),index:c}}):[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class Lc extends Bn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:i=[],_dataset:s}=n,o=this.chart._animationsDisabled;let{start:a,count:l}=DC(n,i,o);this._drawStart=a,this._drawCount=l,AC(n)&&(a=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!o,options:c},t),this.updateElements(i,a,l,t)}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,i),f=o.axis,p=a.axis,{spanGaps:g,segment:m}=this.options,y=co(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||s||i==="none",v=n+r,b=t.length;let S=n>0&&this.getParsed(n-1);for(let k=0;k<b;++k){const _=t[k],C=x?_:{};if(k<n||k>=v){C.skip=!0;continue}const P=this.getParsed(k),j=ge(P[p]),w=C[f]=o.getPixelForValue(P[f],k),M=C[p]=s||j?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,P,l):P[p],k);C.skip=isNaN(w)||isNaN(M)||j,C.stop=k>0&&Math.abs(P[f]-S[f])>y,m&&(C.parsed=P,C.raw=c.data[k]),d&&(C.options=u||this.resolveDataElementOptions(k,_.active?"active":i)),x||this.updateElement(_,k,C,i),S=P}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const s=i[0].size(this.resolveDataElementOptions(0)),o=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,s,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}U(Lc,"id","line"),U(Lc,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),U(Lc,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ta extends Bn{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,i=r.data.labels||[],s=wl(n._parsed[t].r,r.options.locale);return{label:i[t]||"",value:s}}parseObjectData(t,n,r,i){return WC.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,i)=>{const s=this.getParsed(i).r;!isNaN(s)&&this.chart.getDataVisibility(i)&&(s<n.min&&(n.min=s),s>n.max&&(n.max=s))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),s=Math.max(i/2,0),o=Math.max(r.cutoutPercentage?s/100*r.cutoutPercentage:1,0),a=(s-o)/t.getVisibleDatasetCount();this.outerRadius=s-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,i){const s=i==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*Ne;let p=f,g;const m=360/this.countVisibleElements();for(g=0;g<n;++g)p+=this._computeAngle(g,i,m);for(g=n;g<n+r;g++){const y=t[g];let x=p,v=p+this._computeAngle(g,i,m),b=o.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;p=v,s&&(l.animateScale&&(b=0),l.animateRotate&&(x=v=f));const S={x:u,y:d,innerRadius:0,outerRadius:b,startAngle:x,endAngle:v,options:this.resolveDataElementOptions(g,y.active?"active":i)};this.updateElement(y,g,S,i)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?On(this.resolveDataElementOptions(t,n).angle||r):0}}U(Ta,"id","polarArea"),U(Ta,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),U(Ta,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:i}}=t.legend.options;return n.labels.map((s,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:s,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class eg extends Bi{}U(eg,"id","pie"),U(eg,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Oc extends Bn{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,i){return WC.bind(this)(t,n,r,i)}update(t){const n=this._cachedMeta,r=n.dataset,i=n.data||[],s=n.iScale.getLabels();if(r.points=i,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:s.length===i.length,options:o};this.updateElement(r,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,r,i){const s=this._cachedMeta.rScale,o=i==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":i),u=s.getPointPositionForValue(a,this.getParsed(a).r),d=o?s.xCenter:u.x,f=o?s.yCenter:u.y,p={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,a,p,i)}}}U(Oc,"id","radar"),U(Oc,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),U(Oc,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Fc extends Bn{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:s}=n,o=this.getParsed(t),a=i.getLabelForValue(o.x),l=s.getLabelForValue(o.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,i=this.chart._animationsDisabled;let{start:s,count:o}=DC(n,r,i);if(this._drawStart=s,this._drawCount=o,AC(n)&&(s=0,o=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,s,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,i){const s=i==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,i),d=this.getSharedOptions(u),f=this.includeOptions(i,d),p=o.axis,g=a.axis,{spanGaps:m,segment:y}=this.options,x=co(m)?m:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||s||i==="none";let b=n>0&&this.getParsed(n-1);for(let S=n;S<n+r;++S){const k=t[S],_=this.getParsed(S),C=v?k:{},P=ge(_[g]),j=C[p]=o.getPixelForValue(_[p],S),w=C[g]=s||P?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,_,l):_[g],S);C.skip=isNaN(j)||isNaN(w)||P,C.stop=S>0&&Math.abs(_[p]-b[p])>x,y&&(C.parsed=_,C.raw=c.data[S]),f&&(C.options=d||this.resolveDataElementOptions(S,k.active?"active":i)),v||this.updateElement(k,S,C,i),b=_}this.updateSharedOptions(d,i,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!n.length)return i;const s=n[0].size(this.resolveDataElementOptions(0)),o=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,s,o)/2}}U(Fc,"id","scatter"),U(Fc,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),U(Fc,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var vz=Object.freeze({__proto__:null,BarController:Ac,BubbleController:Ic,DoughnutController:Bi,LineController:Lc,PieController:eg,PolarAreaController:Ta,RadarController:Oc,ScatterController:Fc});function ji(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class sx{constructor(t){U(this,"options");this.options=t||{}}static override(t){Object.assign(sx.prototype,t)}init(){}formats(){return ji()}parse(){return ji()}format(){return ji()}add(){return ji()}diff(){return ji()}startOf(){return ji()}endOf(){return ji()}}var yz={_date:sx};function bz(e,t,n,r){const{controller:i,data:s,_sorted:o}=e,a=i._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&s.length){const c=a._reversePixels?W5:wr;if(r){if(i._sharedOptions){const u=s[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=c(s,t,n-d),p=c(s,t,n+d);return{lo:f.lo,hi:p.hi}}}}else{const u=c(s,t,n);if(l){const{vScale:d}=i._cachedMeta,{_parsed:f}=e,p=f.slice(0,u.lo+1).reverse().findIndex(m=>!ge(m[d.axis]));u.lo-=Math.max(0,p);const g=f.slice(u.hi).findIndex(m=>!ge(m[d.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function Sd(e,t,n,r,i){const s=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=s.length;a<l;++a){const{index:c,data:u}=s[a],{lo:d,hi:f}=bz(s[a],t,o,i);for(let p=d;p<=f;++p){const g=u[p];g.skip||r(g,c,p)}}}function _z(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,i){const s=t?Math.abs(r.x-i.x):0,o=n?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function Xh(e,t,n,r,i){const s=[];return!i&&!e.isPointInArea(t)||Sd(e,n,t,function(a,l,c){!i&&!kr(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&s.push({element:a,datasetIndex:l,index:c})},!0),s}function wz(e,t,n,r){let i=[];function s(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],r),{angle:d}=PC(o,{x:t.x,y:t.y});ll(d,c,u)&&i.push({element:o,datasetIndex:a,index:l})}return Sd(e,n,t,s),i}function kz(e,t,n,r,i,s){let o=[];const a=_z(n);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const p=u.inRange(t.x,t.y,i);if(r&&!p)return;const g=u.getCenterPoint(i);if(!(!!s||e.isPointInArea(g))&&!p)return;const y=a(t,g);y<l?(o=[{element:u,datasetIndex:d,index:f}],l=y):y===l&&o.push({element:u,datasetIndex:d,index:f})}return Sd(e,n,t,c),o}function Jh(e,t,n,r,i,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!r?wz(e,t,n,i):kz(e,t,n,r,i,s)}function Mb(e,t,n,r,i){const s=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return Sd(e,n,t,(l,c,u)=>{l[o]&&l[o](t[n],i)&&(s.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,i))}),r&&!a?[]:s}var Sz={modes:{index(e,t,n,r){const i=Ai(t,e),s=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Xh(e,i,s,r,o):Jh(e,i,s,!1,r,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const i=Ai(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Xh(e,i,s,r,o):Jh(e,i,s,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,r){const i=Ai(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Xh(e,i,s,r,o)},nearest(e,t,n,r){const i=Ai(t,e),s=n.axis||"xy",o=n.includeInvisible||!1;return Jh(e,i,s,n.intersect,r,o)},x(e,t,n,r){const i=Ai(t,e);return Mb(e,i,"x",n.intersect,r)},y(e,t,n,r){const i=Ai(t,e);return Mb(e,i,"y",n.intersect,r)}}};const ZC=["left","top","right","bottom"];function Ho(e,t){return e.filter(n=>n.pos===t)}function Rb(e,t){return e.filter(n=>ZC.indexOf(n.pos)===-1&&n.box.axis===t)}function Vo(e,t){return e.sort((n,r)=>{const i=t?r:n,s=t?n:r;return i.weight===s.weight?i.index-s.index:i.weight-s.weight})}function Cz(e){const t=[];let n,r,i,s,o,a;for(n=0,r=(e||[]).length;n<r;++n)i=e[n],{position:s,options:{stack:o,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:s,horizontal:i.isHorizontal(),weight:i.weight,stack:o&&s+o,stackWeight:a});return t}function Ez(e){const t={};for(const n of e){const{stack:r,pos:i,stackWeight:s}=n;if(!r||!ZC.includes(i))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return t}function Nz(e,t){const n=Ez(e),{vBoxMaxWidth:r,hBoxMaxHeight:i}=t;let s,o,a;for(s=0,o=e.length;s<o;++s){a=e[s];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&t.availableWidth,a.height=i):(a.width=r,a.height=u?u*i:l&&t.availableHeight)}return n}function Pz(e){const t=Cz(e),n=Vo(t.filter(c=>c.box.fullSize),!0),r=Vo(Ho(t,"left"),!0),i=Vo(Ho(t,"right")),s=Vo(Ho(t,"top"),!0),o=Vo(Ho(t,"bottom")),a=Rb(t,"x"),l=Rb(t,"y");return{fullSize:n,leftAndTop:r.concat(s),rightAndBottom:i.concat(l).concat(o).concat(a),chartArea:Ho(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:s.concat(o).concat(a)}}function Db(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function eE(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function jz(e,t,n,r){const{pos:i,box:s}=n,o=e.maxPadding;if(!ve(i)){n.size&&(e[i]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?s.height:s.width),n.size=d.size/d.count,e[i]+=n.size}s.getPadding&&eE(o,s.getPadding());const a=Math.max(0,t.outerWidth-Db(o,e,"left","right")),l=Math.max(0,t.outerHeight-Db(o,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function Tz(e){const t=e.maxPadding;function n(r){const i=Math.max(t[r]-e[r],0);return e[r]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Mz(e,t){const n=t.maxPadding;function r(i){const s={left:0,top:0,right:0,bottom:0};return i.forEach(o=>{s[o]=Math.max(t[o],n[o])}),s}return r(e?["left","right"]:["top","bottom"])}function sa(e,t,n,r){const i=[];let s,o,a,l,c,u;for(s=0,o=e.length,c=0;s<o;++s){a=e[s],l=a.box,l.update(a.width||t.w,a.height||t.h,Mz(a.horizontal,t));const{same:d,other:f}=jz(t,n,a,r);c|=d&&i.length,u=u||f,l.fullSize||i.push(a)}return c&&sa(i,t,n,r)||u}function oc(e,t,n,r,i){e.top=n,e.left=t,e.right=t+r,e.bottom=n+i,e.width=r,e.height=i}function Ab(e,t,n,r){const i=n.padding;let{x:s,y:o}=t;for(const a of e){const l=a.box,c=r[a.stack]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,f=c.size||l.height;al(c.start)&&(o=c.start),l.fullSize?oc(l,i.left,o,n.outerWidth-i.right-i.left,f):oc(l,t.left+c.placed,o,d,f),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,f=c.size||l.width;al(c.start)&&(s=c.start),l.fullSize?oc(l,s,i.top,f,n.outerHeight-i.bottom-i.top):oc(l,s,t.top+c.placed,f,d),c.start=s,c.placed+=d,s=l.right}}t.x=s,t.y=o}var Tt={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const i=Rt(e.options.layout.padding),s=Math.max(t-i.width,0),o=Math.max(n-i.height,0),a=Pz(e.boxes),l=a.vertical,c=a.horizontal;je(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const u=l.reduce((m,y)=>y.box.options&&y.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);eE(f,Rt(r));const p=Object.assign({maxPadding:f,w:s,h:o,x:i.left,y:i.top},i),g=Nz(l.concat(c),d);sa(a.fullSize,p,d,g),sa(l,p,d,g),sa(c,p,d,g)&&sa(l,p,d,g),Tz(p),Ab(a.leftAndTop,p,d,g),p.x+=p.w,p.y+=p.h,Ab(a.rightAndBottom,p,d,g),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},je(a.chartArea,m=>{const y=m.box;Object.assign(y,e.chartArea),y.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class tE{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,i){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):r)}}isAttached(t){return!0}updateConfig(t){}}class Rz extends tE{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const $c="$chartjs",Dz={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ib=e=>e===null||e==="";function Az(e,t){const n=e.style,r=e.getAttribute("height"),i=e.getAttribute("width");if(e[$c]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Ib(i)){const s=vb(e,"width");s!==void 0&&(e.width=s)}if(Ib(r))if(e.style.height==="")e.height=e.width/(t||2);else{const s=vb(e,"height");s!==void 0&&(e.height=s)}return e}const nE=I3?{passive:!0}:!1;function Iz(e,t,n){e&&e.addEventListener(t,n,nE)}function Lz(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,nE)}function Oz(e,t){const n=Dz[e.type]||e.type,{x:r,y:i}=Ai(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Bu(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Fz(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||Bu(a.addedNodes,r),o=o&&!Bu(a.removedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function $z(e,t,n){const r=e.canvas,i=new MutationObserver(s=>{let o=!1;for(const a of s)o=o||Bu(a.removedNodes,r),o=o&&!Bu(a.addedNodes,r);o&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const ul=new Map;let Lb=0;function rE(){const e=window.devicePixelRatio;e!==Lb&&(Lb=e,ul.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function zz(e,t){ul.size||window.addEventListener("resize",rE),ul.set(e,t)}function Bz(e){ul.delete(e),ul.size||window.removeEventListener("resize",rE)}function Wz(e,t,n){const r=e.canvas,i=r&&ix(r);if(!i)return;const s=RC((a,l)=>{const c=i.clientWidth;n(a,l),c<i.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||s(c,u)});return o.observe(i),zz(e,s),o}function Qh(e,t,n){n&&n.disconnect(),t==="resize"&&Bz(e)}function Hz(e,t,n){const r=e.canvas,i=RC(s=>{e.ctx!==null&&n(Oz(s,e))},e);return Iz(r,t,i),i}class Vz extends tE{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(Az(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[$c])return!1;const r=n[$c].initial;["height","width"].forEach(s=>{const o=r[s];ge(o)?n.removeAttribute(s):n.setAttribute(s,o)});const i=r.style||{};return Object.keys(i).forEach(s=>{n.style[s]=i[s]}),n.width=n.width,delete n[$c],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),o={attach:Fz,detach:$z,resize:Wz}[n]||Hz;i[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),i=r[n];if(!i)return;({attach:Qh,detach:Qh,resize:Qh}[n]||Lz)(t,n,i),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,i){return A3(t,n,r,i)}isAttached(t){const n=t&&ix(t);return!!(n&&n.isConnected)}}function Uz(e){return!rx()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Rz:Vz}var fc;let Rr=(fc=class{constructor(){U(this,"x");U(this,"y");U(this,"active",!1);U(this,"options");U(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return co(this.x)&&co(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const i={};return t.forEach(s=>{i[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),i}},U(fc,"defaults",{}),U(fc,"defaultRoutes"),fc);function qz(e,t){const n=e.options.ticks,r=Gz(e),i=Math.min(n.maxTicksLimit||r,r),s=n.major.enabled?Yz(t):[],o=s.length,a=s[0],l=s[o-1],c=[];if(o>i)return Xz(t,c,s,o/i),c;const u=Kz(s,t,i);if(o>0){let d,f;const p=o>1?Math.round((l-a)/(o-1)):null;for(ac(t,c,u,ge(p)?0:a-p,a),d=0,f=o-1;d<f;d++)ac(t,c,u,s[d],s[d+1]);return ac(t,c,u,l,ge(p)?t.length:l+p),c}return ac(t,c,u),c}function Gz(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(r,i))}function Kz(e,t,n){const r=Jz(e),i=t.length/n;if(!r)return Math.max(i,1);const s=O5(r);for(let o=0,a=s.length-1;o<a;o++){const l=s[o];if(l>i)return l}return Math.max(i,1)}function Yz(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Xz(e,t,n,r){let i=0,s=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===s&&(t.push(e[o]),i++,s=n[i*r])}function ac(e,t,n,r,i){const s=ce(r,0),o=Math.min(ce(i,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),i&&(l=i-r,n=l/Math.floor(l/n)),u=s;u<0;)a++,u=Math.round(s+a*n);for(c=Math.max(s,0);c<o;c++)c===u&&(t.push(e[c]),a++,u=Math.round(s+a*n))}function Jz(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const Qz=e=>e==="left"?"right":e==="right"?"left":e,Ob=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Fb=(e,t)=>Math.min(t||e,e);function $b(e,t){const n=[],r=e.length/t,i=e.length;let s=0;for(;s<i;s+=r)n.push(e[Math.floor(s)]);return n}function Zz(e,t,n){const r=e.ticks.length,i=Math.min(t,r-1),s=e._startPixel,o=e._endPixel,a=1e-6;let l=e.getPixelForTick(i),c;if(!(n&&(r===1?c=Math.max(l-s,o-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<s-a||l>o+a)))return l}function e4(e,t){je(e,n=>{const r=n.gc,i=r.length/2;let s;if(i>t){for(s=0;s<i;++s)delete n.data[r[s]];r.splice(0,i)}})}function Uo(e){return e.drawTicks?e.tickLength:0}function zb(e,t){if(!e.display)return 0;const n=ft(e.font,t),r=Rt(e.padding);return(Ve(e.text)?e.text.length:1)*n.lineHeight+r.height}function t4(e,t){return _i(e,{scale:t,type:"scale"})}function n4(e,t,n){return _i(e,{tick:n,index:t,type:"tick"})}function r4(e,t,n){let r=Jm(e);return(n&&t!=="right"||!n&&t==="right")&&(r=Qz(r)),r}function i4(e,t,n,r){const{top:i,left:s,bottom:o,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,f,p,g;const m=o-i,y=a-s;if(e.isHorizontal()){if(p=Et(r,s,a),ve(n)){const x=Object.keys(n)[0],v=n[x];g=u[x].getPixelForValue(v)+m-t}else n==="center"?g=(c.bottom+c.top)/2+m-t:g=Ob(e,n,t);f=a-s}else{if(ve(n)){const x=Object.keys(n)[0],v=n[x];p=u[x].getPixelForValue(v)-y+t}else n==="center"?p=(c.left+c.right)/2-y+t:p=Ob(e,n,t);g=Et(r,o,i),d=n==="left"?-nt:nt}return{titleX:p,titleY:g,maxWidth:f,rotation:d}}class ls extends Rr{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:i}=this;return t=sn(t,Number.POSITIVE_INFINITY),n=sn(n,Number.NEGATIVE_INFINITY),r=sn(r,Number.POSITIVE_INFINITY),i=sn(i,Number.NEGATIVE_INFINITY),{min:sn(t,r),max:sn(n,i),minDefined:Qe(t),maxDefined:Qe(n)}}getMinMax(t){let{min:n,max:r,minDefined:i,maxDefined:s}=this.getUserBounds(),o;if(i&&s)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),i||(n=Math.min(n,o.min)),s||(r=Math.max(r,o.max));return n=s&&n>r?r:n,r=i&&n>r?n:r,{min:sn(n,sn(r,n)),max:sn(r,sn(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Le(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:i,grace:s,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=h3(this,s,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?$b(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=qz(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Le(this.options.afterUpdate,[this])}beforeSetDimensions(){Le(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Le(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Le(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Le(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,i,s;for(r=0,i=t.length;r<i;r++)s=t[r],s.label=Le(n.callback,[s.value,r,t],this)}afterTickToLabelConversion(){Le(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Le(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Fb(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,s=n.maxRotation;let o=i,a,l,c;if(!this._isVisible()||!n.display||i>=s||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,p=gt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:p/(r-1),d+6>a&&(a=p/(r-(t.offset?.5:1)),l=this.maxHeight-Uo(t.grid)-n.padding-zb(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=Ym(Math.min(Math.asin(gt((u.highest.height+6)/a,-1,1)),Math.asin(gt(l/c,-1,1))-Math.asin(gt(f/c,-1,1)))),o=Math.max(i,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){Le(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Le(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:i,grid:s}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=zb(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=Uo(s)+l):(t.height=this.maxHeight,t.width=Uo(s)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),p=r.padding*2,g=On(this.labelRotation),m=Math.cos(g),y=Math.sin(g);if(a){const x=r.mirror?0:y*d.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+x+p)}else{const x=r.mirror?0:m*d.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+x+p)}this._calculatePadding(c,u,y,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,i){const{ticks:{align:s,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,p=0;l?c?(f=i*t.width,p=r*n.height):(f=r*t.height,p=i*n.width):s==="start"?p=n.width:s==="end"?f=t.width:s!=="inner"&&(f=t.width/2,p=n.width/2),this.paddingLeft=Math.max((f-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-d+o)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;s==="start"?(u=0,d=t.height):s==="end"&&(u=n.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Le(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)ge(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=$b(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:i,_longestTextCache:s}=this,o=[],a=[],l=Math.floor(n/Fb(n,r));let c=0,u=0,d,f,p,g,m,y,x,v,b,S,k;for(d=0;d<n;d+=l){if(g=t[d].label,m=this._resolveTickFontOptions(d),i.font=y=m.string,x=s[y]=s[y]||{data:{},gc:[]},v=m.lineHeight,b=S=0,!ge(g)&&!Ve(g))b=$u(i,x.data,x.gc,b,g),S=v;else if(Ve(g))for(f=0,p=g.length;f<p;++f)k=g[f],!ge(k)&&!Ve(k)&&(b=$u(i,x.data,x.gc,b,k),S+=v);o.push(b),a.push(S),c=Math.max(b,c),u=Math.max(S,u)}e4(s,n);const _=o.indexOf(c),C=a.indexOf(u),P=j=>({width:o[j]||0,height:a[j]||0});return{first:P(0),last:P(n-1),widest:P(_),highest:P(C),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return B5(this._alignToPixels?Pi(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=n4(this.getContext(),t,r))}return this.$context||(this.$context=t4(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=On(this.labelRotation),r=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),s=this._getLabelSizes(),o=t.autoSkipPadding||0,a=s?s.widest.width+o:0,l=s?s.highest.height+o:0;return this.isHorizontal()?l*r>a*i?a/r:l/i:l*i<a*r?l/r:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,i=this.options,{grid:s,position:o,border:a}=i,l=s.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Uo(s),p=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,y=m/2,x=function(H){return Pi(r,H,m)};let v,b,S,k,_,C,P,j,w,M,D,F;if(o==="top")v=x(this.bottom),C=this.bottom-f,j=v-y,M=x(t.top)+y,F=t.bottom;else if(o==="bottom")v=x(this.top),M=t.top,F=x(t.bottom)-y,C=v+y,j=this.top+f;else if(o==="left")v=x(this.right),_=this.right-f,P=v-y,w=x(t.left)+y,D=t.right;else if(o==="right")v=x(this.left),w=t.left,D=x(t.right)-y,_=v+y,P=this.left+f;else if(n==="x"){if(o==="center")v=x((t.top+t.bottom)/2+.5);else if(ve(o)){const H=Object.keys(o)[0],X=o[H];v=x(this.chart.scales[H].getPixelForValue(X))}M=t.top,F=t.bottom,C=v+y,j=C+f}else if(n==="y"){if(o==="center")v=x((t.left+t.right)/2);else if(ve(o)){const H=Object.keys(o)[0],X=o[H];v=x(this.chart.scales[H].getPixelForValue(X))}_=v-y,P=_-f,w=t.left,D=t.right}const $=ce(i.ticks.maxTicksLimit,d),I=Math.max(1,Math.ceil(d/$));for(b=0;b<d;b+=I){const H=this.getContext(b),X=s.setContext(H),L=a.setContext(H),B=X.lineWidth,N=X.color,Q=L.dash||[],te=L.dashOffset,T=X.tickWidth,re=X.tickColor,le=X.tickBorderDash||[],ae=X.tickBorderDashOffset;S=Zz(this,b,l),S!==void 0&&(k=Pi(r,S,B),c?_=P=w=D=k:C=j=M=F=k,p.push({tx1:_,ty1:C,tx2:P,ty2:j,x1:w,y1:M,x2:D,y2:F,width:B,color:N,borderDash:Q,borderDashOffset:te,tickWidth:T,tickColor:re,tickBorderDash:le,tickBorderDashOffset:ae}))}return this._ticksLength=d,this._borderValue=v,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:i,ticks:s}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=s,f=Uo(r.grid),p=f+u,g=d?-u:p,m=-On(this.labelRotation),y=[];let x,v,b,S,k,_,C,P,j,w,M,D,F="middle";if(i==="top")_=this.bottom-g,C=this._getXAxisLabelAlignment();else if(i==="bottom")_=this.top+g,C=this._getXAxisLabelAlignment();else if(i==="left"){const I=this._getYAxisLabelAlignment(f);C=I.textAlign,k=I.x}else if(i==="right"){const I=this._getYAxisLabelAlignment(f);C=I.textAlign,k=I.x}else if(n==="x"){if(i==="center")_=(t.top+t.bottom)/2+p;else if(ve(i)){const I=Object.keys(i)[0],H=i[I];_=this.chart.scales[I].getPixelForValue(H)+p}C=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")k=(t.left+t.right)/2-p;else if(ve(i)){const I=Object.keys(i)[0],H=i[I];k=this.chart.scales[I].getPixelForValue(H)}C=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const $=this._getLabelSizes();for(x=0,v=a.length;x<v;++x){b=a[x],S=b.label;const I=s.setContext(this.getContext(x));P=this.getPixelForTick(x)+s.labelOffset,j=this._resolveTickFontOptions(x),w=j.lineHeight,M=Ve(S)?S.length:1;const H=M/2,X=I.color,L=I.textStrokeColor,B=I.textStrokeWidth;let N=C;o?(k=P,C==="inner"&&(x===v-1?N=this.options.reverse?"left":"right":x===0?N=this.options.reverse?"right":"left":N="center"),i==="top"?c==="near"||m!==0?D=-M*w+w/2:c==="center"?D=-$.highest.height/2-H*w+w:D=-$.highest.height+w/2:c==="near"||m!==0?D=w/2:c==="center"?D=$.highest.height/2-H*w:D=$.highest.height-M*w,d&&(D*=-1),m!==0&&!I.showLabelBackdrop&&(k+=w/2*Math.sin(m))):(_=P,D=(1-M)*w/2);let Q;if(I.showLabelBackdrop){const te=Rt(I.backdropPadding),T=$.heights[x],re=$.widths[x];let le=D-te.top,ae=0-te.left;switch(F){case"middle":le-=T/2;break;case"bottom":le-=T;break}switch(C){case"center":ae-=re/2;break;case"right":ae-=re;break;case"inner":x===v-1?ae-=re:x>0&&(ae-=re/2);break}Q={left:ae,top:le,width:re+te.width,height:T+te.height,color:I.backdropColor}}y.push({label:S,font:j,textOffset:D,options:{rotation:m,color:X,strokeColor:L,strokeWidth:B,textAlign:N,textBaseline:F,translation:[k,_],backdrop:Q}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-On(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:i,padding:s}}=this.options,o=this._getLabelSizes(),a=t+s,l=o.widest.width;let c,u;return n==="left"?i?(u=this.right+s,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?i?(u=this.left+s,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:i,width:s,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,i,s,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(s=>s.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,o;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(s=0,o=i.length;s<o;++s){const l=i[s];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:i}}=this,s=r.setContext(this.getContext()),o=r.display?s.width:0;if(!o)return;const a=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=Pi(t,this.left,o)-o/2,u=Pi(t,this.right,a)+a/2,d=f=l):(d=Pi(t,this.top,o)-o/2,f=Pi(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&_d(r,i);const s=this.getLabelItems(t);for(const o of s){const a=o.options,l=o.font,c=o.label,u=o.textOffset;ns(r,c,0,u,l,a)}i&&wd(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:i}}=this;if(!r.display)return;const s=ft(r.font),o=Rt(r.padding),a=r.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||ve(n)?(l+=o.bottom,Ve(r.text)&&(l+=s.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=i4(this,l,n,a);ns(t,r.text,0,0,s,{color:r.color,maxWidth:d,rotation:f,textAlign:r4(a,n,i),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=ce(t.grid&&t.grid.z,-1),i=ce(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ls.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[s];a[r]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return ft(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class lc{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;a4(n)&&(r=this.register(n));const i=this.items,s=t.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in i||(i[s]=t,s4(t,o,r),this.override&&Ue.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,i=this.scope;r in n&&delete n[r],i&&r in Ue[i]&&(delete Ue[i][r],this.override&&delete ts[r])}}function s4(e,t,n){const r=ol(Object.create(null),[n?Ue.get(n):{},Ue.get(t),e.defaults]);Ue.set(t,r),e.defaultRoutes&&o4(t,e.defaultRoutes),e.descriptors&&Ue.describe(t,e.descriptors)}function o4(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),i=r.pop(),s=[e].concat(r).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");Ue.route(s,i,l,a)})}function a4(e){return"id"in e&&"defaults"in e}class l4{constructor(){this.controllers=new lc(Bn,"datasets",!0),this.elements=new lc(Rr,"elements"),this.plugins=new lc(Object,"plugins"),this.scales=new lc(ls,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(i=>{const s=r||this._getRegistryForType(i);r||s.isForType(i)||s===this.plugins&&i.id?this._exec(t,s,i):je(i,o=>{const a=r||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,r){const i=Km(t);Le(r["before"+i],[],r),n[t](r),Le(r["after"+i],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Yn=new l4;class c4{constructor(){this._init=void 0}notify(t,n,r,i){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const s=i?this._descriptors(t).filter(i):this._descriptors(t),o=this._notify(s,t,n,r);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),o}_notify(t,n,r,i){i=i||{};for(const s of t){const o=s.plugin,a=o[r],l=[n,i,s.options];if(Le(a,l,o)===!1&&i.cancelable)return!1}return!0}invalidate(){ge(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,i=ce(r.options&&r.options.plugins,{}),s=u4(r);return i===!1&&!n?[]:h4(t,s,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,i=(s,o)=>s.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(i(n,r),t,"stop"),this._notify(i(r,n),t,"start")}}function u4(e){const t={},n=[],r=Object.keys(Yn.plugins.items);for(let s=0;s<r.length;s++)n.push(Yn.getPlugin(r[s]));const i=e.plugins||[];for(let s=0;s<i.length;s++){const o=i[s];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function d4(e,t){return!t&&e===!1?null:e===!0?{}:e}function h4(e,{plugins:t,localIds:n},r,i){const s=[],o=e.getContext();for(const a of t){const l=a.id,c=d4(r[l],i);c!==null&&s.push({plugin:a,options:f4(e.config,{plugin:a,local:n[l]},c,o)})}return s}function f4(e,{plugin:t,local:n},r,i){const s=e.pluginScopeKeys(t),o=e.getOptionScopes(r,s);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function tg(e,t){const n=Ue.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function p4(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function g4(e,t){return e===t?"_index_":"_value_"}function Bb(e){if(e==="x"||e==="y"||e==="r")return e}function m4(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function ng(e,...t){if(Bb(e))return e;for(const n of t){const r=n.axis||m4(n.position)||e.length>1&&Bb(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Wb(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function x4(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Wb(e,"x",n[0])||Wb(e,"y",n[0])}return{}}function v4(e,t){const n=ts[e.type]||{scales:{}},r=t.scales||{},i=tg(e.type,t),s=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!ve(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=ng(o,a,x4(o,e),Ue.scales[a.type]),c=g4(l,i),u=n.scales||{};s[o]=Ea(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||tg(a,t),u=(ts[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=p4(d,l),p=o[f+"AxisID"]||f;s[p]=s[p]||Object.create(null),Ea(s[p],[{axis:f},r[p],u[d]])})}),Object.keys(s).forEach(o=>{const a=s[o];Ea(a,[Ue.scales[a.type],Ue.scale])}),s}function iE(e){const t=e.options||(e.options={});t.plugins=ce(t.plugins,{}),t.scales=v4(e,t)}function sE(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function y4(e){return e=e||{},e.data=sE(e.data),iE(e),e}const Hb=new Map,oE=new Set;function cc(e,t){let n=Hb.get(e);return n||(n=t(),Hb.set(e,n),oE.add(n)),n}const qo=(e,t,n)=>{const r=pi(t,n);r!==void 0&&e.add(r)};class b4{constructor(t){this._config=y4(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=sE(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),iE(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return cc(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return cc(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return cc(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return cc(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let i=r.get(t);return(!i||n)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,n,r){const{options:i,type:s}=this,o=this._cachedScopes(t,r),a=o.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>qo(l,t,d))),u.forEach(d=>qo(l,i,d)),u.forEach(d=>qo(l,ts[s]||{},d)),u.forEach(d=>qo(l,Ue,d)),u.forEach(d=>qo(l,Qp,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),oE.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,ts[n]||{},Ue.datasets[n]||{},{type:n},Ue,Qp]}resolveNamedOptions(t,n,r,i=[""]){const s={$shared:!0},{resolver:o,subPrefixes:a}=Vb(this._resolverCache,t,i);let l=o;if(w4(o,n)){s.$shared=!1,r=gi(r)?r():r;const c=this.createResolver(t,r,a);l=uo(o,r,c)}for(const c of n)s[c]=l[c];return s}createResolver(t,n,r=[""],i){const{resolver:s}=Vb(this._resolverCache,t,r);return ve(n)?uo(s,n,void 0,i):s}}function Vb(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const i=n.join();let s=r.get(i);return s||(s={resolver:ex(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(i,s)),s}const _4=e=>ve(e)&&Object.getOwnPropertyNames(e).some(t=>gi(e[t]));function w4(e,t){const{isScriptable:n,isIndexable:r}=FC(e);for(const i of t){const s=n(i),o=r(i),a=(o||s)&&e[i];if(s&&(gi(a)||_4(a))||o&&Ve(a))return!0}return!1}var k4="4.5.1";const S4=["top","bottom","left","right","chartArea"];function Ub(e,t){return e==="top"||e==="bottom"||S4.indexOf(e)===-1&&t==="x"}function qb(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Gb(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Le(n&&n.onComplete,[e],t)}function C4(e){const t=e.chart,n=t.options.animation;Le(n&&n.onProgress,[e],t)}function aE(e){return rx()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const zc={},Kb=e=>{const t=aE(e);return Object.values(zc).filter(n=>n.canvas===t).pop()};function E4(e,t,n){const r=Object.keys(e);for(const i of r){const s=+i;if(s>=t){const o=e[i];delete e[i],(n>0||s>t)&&(e[s+n]=o)}}}function N4(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}class Jn{static register(...t){Yn.add(...t),Yb()}static unregister(...t){Yn.remove(...t),Yb()}constructor(t,n){const r=this.config=new b4(n),i=aE(t),s=Kb(i);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||Uz(i)),this.platform.updateConfig(r);const a=this.platform.acquireContext(i,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=P5(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new c4,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=U5(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],zc[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}hr.listen(this,"complete",Gb),hr.listen(this,"progress",C4),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:i,_aspectRatio:s}=this;return ge(t)?n&&s?s:i?r/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Yn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():xb(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return pb(this.canvas,this.ctx),this}stop(){return hr.stop(this),this}resize(t,n){hr.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,i=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(i,t,n,s),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,xb(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),Le(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};je(n,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,i=Object.keys(r).reduce((o,a)=>(o[a]=!1,o),{});let s=[];n&&(s=s.concat(Object.keys(n).map(o=>{const a=n[o],l=ng(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),je(s,o=>{const a=o.options,l=a.id,c=ng(l,a),u=ce(a.type,o.dtype);(a.position===void 0||Ub(a.position,c)!==Ub(o.dposition))&&(a.position=o.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=Yn.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),je(i,(o,a)=>{o||delete r[a]}),je(r,o=>{Tt.configure(this,o,o.options),Tt.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((i,s)=>i.index-s.index),r>n){for(let i=n;i<r;++i)this._destroyDatasetMeta(i);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(qb("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,i)=>{n.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=n.length;r<i;r++){const s=n[r];let o=this.getDatasetMeta(r);const a=s.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=a,o.indexAxis=s.indexAxis||tg(a,this.options),o.order=s.order||0,o.index=r,o.label=""+s.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=Yn.getController(a),{datasetElementType:c,dataElementType:u}=Ue.datasets[a];Object.assign(l,{dataElementType:Yn.getElement(u),datasetElementType:c&&Yn.getElement(c)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){je(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!i&&s.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),i||je(s,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(qb("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){je(this.scales,t=>{Tt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!sb(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:s}of n){const o=r==="_removeElements"?-s:s;E4(t,i,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=s=>new Set(t.filter(o=>o[0]===s).map((o,a)=>a+","+o.splice(1).join(","))),i=r(0);for(let s=1;s<n;s++)if(!sb(i,r(s)))return;return Array.from(i).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Tt.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],je(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,s)=>{i._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,gi(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(hr.has(this)?this.attached&&!hr.running(this)&&hr.start(this):(this.draw(),Gb({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let i,s;for(i=0,s=n.length;i<s;++i){const o=n[i];(!t||o.visible)&&r.push(o)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},i=YC(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(i&&_d(n,i),t.controller.draw(),i&&wd(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return kr(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,i){const s=Sz.modes[n];return typeof s=="function"?s(this,t,r,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let i=r.filter(s=>s&&s._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(i)),i}getContext(){return this.$context||(this.$context=_i(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const i=r?"show":"hide",s=this.getDatasetMeta(t),o=s.controller._resolveAnimations(void 0,i);al(n)?(s.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(s,{visible:r}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),hr.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),pb(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete zc[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(s,o)=>{n.addEventListener(this,s,o),t[s]=o},i=(s,o,a)=>{s.offsetX=o,s.offsetY=a,this._eventHandler(s)};je(this.options.events,s=>r(s,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},i=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},s=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{i("attach",a),this.attached=!0,this.resize(),r("resize",s),r("detach",o)};o=()=>{this.attached=!1,i("resize",s),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){je(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},je(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const i=r?"set":"remove";let s,o,a,l;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+i+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[i+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:s,index:o})=>{const a=this.getDatasetMeta(s);if(!a)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:a.data[o],index:o}});!Lu(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const i=this.options.hover,s=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=s(n,t),a=r?t:s(t,n);o.length&&this.updateHoverStyle(o,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const s=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(s||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:i=[],options:s}=this,o=n,a=this._getActiveElements(t,i,r,o),l=A5(t),c=N4(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Le(s.onHover,[t,a,this],this),l&&Le(s.onClick,[t,a,this],this));const u=!Lu(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,i){if(t.type==="mouseout")return[];if(!r)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,i)}}U(Jn,"defaults",Ue),U(Jn,"instances",zc),U(Jn,"overrides",ts),U(Jn,"registry",Yn),U(Jn,"version",k4),U(Jn,"getChart",Kb);function Yb(){return je(Jn.instances,e=>e._plugins.invalidate())}function P4(e,t,n){const{startAngle:r,x:i,y:s,outerRadius:o,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,d=Math.min(c/o,Nt(r-n));if(e.beginPath(),e.arc(i,s,o-c/2,r+d/2,n-d/2),a>0){const f=Math.min(c/a,Nt(r-n));e.arc(i,s,a+c/2,n-f/2,r+f/2,!0)}else{const f=Math.min(c/2,o*Nt(r-n));if(u==="round")e.arc(i,s,f,n-Ne/2,r+Ne/2,!0);else if(u==="bevel"){const p=2*f*f,g=-p*Math.cos(n+Ne/2)+i,m=-p*Math.sin(n+Ne/2)+s,y=p*Math.cos(r+Ne/2)+i,x=p*Math.sin(r+Ne/2)+s;e.lineTo(g,m),e.lineTo(y,x)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function j4(e,t,n){const{startAngle:r,pixelMargin:i,x:s,y:o,outerRadius:a,innerRadius:l}=t;let c=i/a;e.beginPath(),e.arc(s,o,a,r-c,n+c),l>i?(c=i/l,e.arc(s,o,l,n+c,r-c,!0)):e.arc(s,o,i,n+nt,r-nt),e.closePath(),e.clip()}function T4(e){return Zm(e,["outerStart","outerEnd","innerStart","innerEnd"])}function M4(e,t,n,r){const i=T4(e.options.borderRadius),s=(n-t)/2,o=Math.min(s,r*t/2),a=l=>{const c=(n-Math.min(s,l))*r/2;return gt(l,0,Math.min(s,c))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:gt(i.innerStart,0,o),innerEnd:gt(i.innerEnd,0,o)}}function vs(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Wu(e,t,n,r,i,s){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),f=u>0?u+r+n+c:0;let p=0;const g=i-l;if(r){const I=u>0?u-r:0,H=d>0?d-r:0,X=(I+H)/2,L=X!==0?g*X/(X+r):g;p=(g-L)/2}const m=Math.max(.001,g*d-n/Ne)/d,y=(g-m)/2,x=l+y+p,v=i-y-p,{outerStart:b,outerEnd:S,innerStart:k,innerEnd:_}=M4(t,f,d,v-x),C=d-b,P=d-S,j=x+b/C,w=v-S/P,M=f+k,D=f+_,F=x+k/M,$=v-_/D;if(e.beginPath(),s){const I=(j+w)/2;if(e.arc(o,a,d,j,I),e.arc(o,a,d,I,w),S>0){const B=vs(P,w,o,a);e.arc(B.x,B.y,S,w,v+nt)}const H=vs(D,v,o,a);if(e.lineTo(H.x,H.y),_>0){const B=vs(D,$,o,a);e.arc(B.x,B.y,_,v+nt,$+Math.PI)}const X=(v-_/f+(x+k/f))/2;if(e.arc(o,a,f,v-_/f,X,!0),e.arc(o,a,f,X,x+k/f,!0),k>0){const B=vs(M,F,o,a);e.arc(B.x,B.y,k,F+Math.PI,x-nt)}const L=vs(C,x,o,a);if(e.lineTo(L.x,L.y),b>0){const B=vs(C,j,o,a);e.arc(B.x,B.y,b,x-nt,j)}}else{e.moveTo(o,a);const I=Math.cos(j)*d+o,H=Math.sin(j)*d+a;e.lineTo(I,H);const X=Math.cos(w)*d+o,L=Math.sin(w)*d+a;e.lineTo(X,L)}e.closePath()}function R4(e,t,n,r,i){const{fullCircles:s,startAngle:o,circumference:a}=t;let l=t.endAngle;if(s){Wu(e,t,n,r,l,i);for(let c=0;c<s;++c)e.fill();isNaN(a)||(l=o+(a%We||We))}return Wu(e,t,n,r,l,i),e.fill(),l}function D4(e,t,n,r,i){const{fullCircles:s,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f,borderRadius:p}=l,g=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=f,g?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let m=t.endAngle;if(s){Wu(e,t,n,r,m,i);for(let y=0;y<s;++y)e.stroke();isNaN(a)||(m=o+(a%We||We))}g&&j4(e,t,m),l.selfJoin&&m-o>=Ne&&p===0&&u!=="miter"&&P4(e,t,m),s||(Wu(e,t,n,r,m,i),e.stroke())}class oa extends Rr{constructor(n){super();U(this,"circumference");U(this,"endAngle");U(this,"fullCircles");U(this,"innerRadius");U(this,"outerRadius");U(this,"pixelMargin");U(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,i){const s=this.getProps(["x","y"],i),{angle:o,distance:a}=PC(s,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=(this.options.spacing+this.options.borderWidth)/2,g=ce(f,c-l),m=ll(o,l,c)&&l!==c,y=g>=We||m,x=_r(a,u+p,d+p);return y&&x}getCenterPoint(n){const{x:r,y:i,startAngle:s,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(s+o)/2,f=(a+l+u+c)/2;return{x:r+Math.cos(d)*f,y:i+Math.sin(d)*f}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:i}=this,s=(r.offset||0)/4,o=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>We?Math.floor(i/We):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*s,Math.sin(l)*s);const c=1-Math.sin(Math.min(Ne,i||0)),u=s*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,R4(n,this,u,o,a),D4(n,this,u,o,a),n.restore()}}U(oa,"id","arc"),U(oa,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),U(oa,"defaultRoutes",{backgroundColor:"backgroundColor"}),U(oa,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function lE(e,t,n=t){e.lineCap=ce(n.borderCapStyle,t.borderCapStyle),e.setLineDash(ce(n.borderDash,t.borderDash)),e.lineDashOffset=ce(n.borderDashOffset,t.borderDashOffset),e.lineJoin=ce(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=ce(n.borderWidth,t.borderWidth),e.strokeStyle=ce(n.borderColor,t.borderColor)}function A4(e,t,n){e.lineTo(n.x,n.y)}function I4(e){return e.stepped?r3:e.tension||e.cubicInterpolationMode==="monotone"?i3:A4}function cE(e,t,n={}){const r=e.length,{start:i=0,end:s=r-1}=n,{start:o,end:a}=t,l=Math.max(i,o),c=Math.min(s,a),u=i<o&&s<o||i>a&&s>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function L4(e,t,n,r){const{points:i,options:s}=t,{count:o,start:a,loop:l,ilen:c}=cE(i,n,r),u=I4(s);let{move:d=!0,reverse:f}=r||{},p,g,m;for(p=0;p<=c;++p)g=i[(a+(f?c-p:p))%o],!g.skip&&(d?(e.moveTo(g.x,g.y),d=!1):u(e,m,g,f,s.stepped),m=g);return l&&(g=i[(a+(f?c:0))%o],u(e,m,g,f,s.stepped)),!!l}function O4(e,t,n,r){const i=t.points,{count:s,start:o,ilen:a}=cE(i,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,p,g,m,y,x;const v=S=>(o+(c?a-S:S))%s,b=()=>{m!==y&&(e.lineTo(u,y),e.lineTo(u,m),e.lineTo(u,x))};for(l&&(p=i[v(0)],e.moveTo(p.x,p.y)),f=0;f<=a;++f){if(p=i[v(f)],p.skip)continue;const S=p.x,k=p.y,_=S|0;_===g?(k<m?m=k:k>y&&(y=k),u=(d*u+S)/++d):(b(),e.lineTo(S,k),g=_,d=0,m=y=k),x=k}b()}function rg(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?O4:L4}function F4(e){return e.stepped?L3:e.tension||e.cubicInterpolationMode==="monotone"?O3:Ii}function $4(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),lE(e,t.options),e.stroke(i)}function z4(e,t,n,r){const{segments:i,options:s}=t,o=rg(t);for(const a of i)lE(e,s,a.style),e.beginPath(),o(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const B4=typeof Path2D=="function";function W4(e,t,n,r){B4&&!t.options.segment?$4(e,t,n,r):z4(e,t,n,r)}class Zr extends Rr{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;P3(this._points,r,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=H3(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,i=t[n],s=this.points,o=KC(this,{property:n,start:i,end:i});if(!o.length)return;const a=[],l=F4(r);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:f}=o[c],p=s[d],g=s[f];if(p===g){a.push(p);continue}const m=Math.abs((i-p[n])/(g[n]-p[n])),y=l(p,g,m,r.stepped);y[n]=t[n],a.push(y)}return a.length===1?a[0]:a}pathSegment(t,n,r){return rg(this)(t,this,n,r)}path(t,n,r){const i=this.segments,s=rg(this);let o=this._loop;n=n||0,r=r||this.points.length-n;for(const a of i)o&=s(t,this,a,{start:n,end:n+r-1});return!!o}draw(t,n,r,i){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),W4(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}U(Zr,"id","line"),U(Zr,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),U(Zr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),U(Zr,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Xb(e,t,n,r){const i=e.options,{[n]:s}=e.getProps([n],r);return Math.abs(t-s)<i.radius+i.hitRadius}class Bc extends Rr{constructor(n){super();U(this,"parsed");U(this,"skip");U(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(n-o,2)+Math.pow(r-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,r){return Xb(this,n,"x",r)}inYRange(n,r){return Xb(this,n,"y",r)}getCenterPoint(n){const{x:r,y:i}=this.getProps(["x","y"],n);return{x:r,y:i}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const i=r&&n.borderWidth||0;return(r+i)*2}draw(n,r){const i=this.options;this.skip||i.radius<.1||!kr(this,r,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,Zp(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}U(Bc,"id","point"),U(Bc,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),U(Bc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function uE(e,t){const{x:n,y:r,base:i,width:s,height:o}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,d;return e.horizontal?(d=o/2,a=Math.min(n,i),l=Math.max(n,i),c=r-d,u=r+d):(d=s/2,a=n-d,l=n+d,c=Math.min(r,i),u=Math.max(r,i)),{left:a,top:c,right:l,bottom:u}}function ei(e,t,n,r){return e?0:gt(t,n,r)}function H4(e,t,n){const r=e.options.borderWidth,i=e.borderSkipped,s=OC(r);return{t:ei(i.top,s.top,0,n),r:ei(i.right,s.right,0,t),b:ei(i.bottom,s.bottom,0,n),l:ei(i.left,s.left,0,t)}}function V4(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,s=qi(i),o=Math.min(t,n),a=e.borderSkipped,l=r||ve(i);return{topLeft:ei(!l||a.top||a.left,s.topLeft,0,o),topRight:ei(!l||a.top||a.right,s.topRight,0,o),bottomLeft:ei(!l||a.bottom||a.left,s.bottomLeft,0,o),bottomRight:ei(!l||a.bottom||a.right,s.bottomRight,0,o)}}function U4(e){const t=uE(e),n=t.right-t.left,r=t.bottom-t.top,i=H4(e,n/2,r/2),s=V4(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:s},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,s.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(i.b,i.r))}}}}function Zh(e,t,n,r){const i=t===null,s=n===null,a=e&&!(i&&s)&&uE(e,r);return a&&(i||_r(t,a.left,a.right))&&(s||_r(n,a.top,a.bottom))}function q4(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function G4(e,t){e.rect(t.x,t.y,t.w,t.h)}function ef(e,t,n={}){const r=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,s=(e.x+e.w!==n.x+n.w?t:0)-r,o=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+r,y:e.y+i,w:e.w+s,h:e.h+o,radius:e.radius}}class Wc extends Rr{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:i}}=this,{inner:s,outer:o}=U4(this),a=q4(o.radius)?cl:G4;t.save(),(o.w!==s.w||o.h!==s.h)&&(t.beginPath(),a(t,ef(o,n,s)),t.clip(),a(t,ef(s,-n,o)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,ef(s,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,r){return Zh(this,t,n,r)}inXRange(t,n){return Zh(this,t,null,n)}inYRange(t,n){return Zh(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:i,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(n+i)/2:n,y:s?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}U(Wc,"id","bar"),U(Wc,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),U(Wc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var K4=Object.freeze({__proto__:null,ArcElement:oa,BarElement:Wc,LineElement:Zr,PointElement:Bc});const ig=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Jb=ig.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function dE(e){return ig[e%ig.length]}function hE(e){return Jb[e%Jb.length]}function Y4(e,t){return e.borderColor=dE(t),e.backgroundColor=hE(t),++t}function X4(e,t){return e.backgroundColor=e.data.map(()=>dE(t++)),t}function J4(e,t){return e.backgroundColor=e.data.map(()=>hE(t++)),t}function Q4(e){let t=0;return(n,r)=>{const i=e.getDatasetMeta(r).controller;i instanceof Bi?t=X4(n,t):i instanceof Ta?t=J4(n,t):i&&(t=Y4(n,t))}}function Qb(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Z4(e){return e&&(e.borderColor||e.backgroundColor)}function eB(){return Ue.borderColor!=="rgba(0,0,0,0.1)"||Ue.backgroundColor!=="rgba(0,0,0,0.1)"}var tB={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:i}=e.config,{elements:s}=i,o=Qb(r)||Z4(i)||s&&Qb(s)||eB();if(!n.forceOverride&&o)return;const a=Q4(e);r.forEach(a)}};function nB(e,t,n,r,i){const s=i.samples||r;if(s>=n)return e.slice(t,t+n);const o=[],a=(n-2)/(s-2);let l=0;const c=t+n-1;let u=t,d,f,p,g,m;for(o[l++]=e[u],d=0;d<s-2;d++){let y=0,x=0,v;const b=Math.floor((d+1)*a)+1+t,S=Math.min(Math.floor((d+2)*a)+1,n)+t,k=S-b;for(v=b;v<S;v++)y+=e[v].x,x+=e[v].y;y/=k,x/=k;const _=Math.floor(d*a)+1+t,C=Math.min(Math.floor((d+1)*a)+1,n)+t,{x:P,y:j}=e[u];for(p=g=-1,v=_;v<C;v++)g=.5*Math.abs((P-y)*(e[v].y-j)-(P-e[v].x)*(x-j)),g>p&&(p=g,f=e[v],m=v);o[l++]=f,u=m}return o[l++]=e[c],o}function rB(e,t,n,r){let i=0,s=0,o,a,l,c,u,d,f,p,g,m;const y=[],x=t+n-1,v=e[t].x,S=e[x].x-v;for(o=t;o<t+n;++o){a=e[o],l=(a.x-v)/S*r,c=a.y;const k=l|0;if(k===u)c<g?(g=c,d=o):c>m&&(m=c,f=o),i=(s*i+a.x)/++s;else{const _=o-1;if(!ge(d)&&!ge(f)){const C=Math.min(d,f),P=Math.max(d,f);C!==p&&C!==_&&y.push({...e[C],x:i}),P!==p&&P!==_&&y.push({...e[P],x:i})}o>0&&_!==p&&y.push(e[_]),y.push(a),u=k,s=0,g=m=c,d=f=p=o}}return y}function fE(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Zb(e){e.data.datasets.forEach(t=>{fE(t)})}function iB(e,t){const n=t.length;let r=0,i;const{iScale:s}=e,{min:o,max:a,minDefined:l,maxDefined:c}=s.getUserBounds();return l&&(r=gt(wr(t,s.axis,o).lo,0,n-1)),c?i=gt(wr(t,s.axis,a).hi+1,r,n)-r:i=n-r,{start:r,count:i}}var sB={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Zb(e);return}const r=e.width;e.data.datasets.forEach((i,s)=>{const{_data:o,indexAxis:a}=i,l=e.getDatasetMeta(s),c=o||i.data;if(ia([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:f}=iB(l,c);const p=n.threshold||4*r;if(f<=p){fE(i);return}ge(o)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let g;switch(n.algorithm){case"lttb":g=nB(c,d,f,r,n);break;case"min-max":g=rB(c,d,f,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=g})},destroy(e){Zb(e)}};function oB(e,t,n){const r=e.segments,i=e.points,s=t.points,o=[];for(const a of r){let{start:l,end:c}=a;c=Cd(l,c,i);const u=sg(n,i[l],i[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:i[l],end:i[c]});continue}const d=KC(t,u);for(const f of d){const p=sg(n,s[f.start],s[f.end],f.loop),g=GC(a,i,p);for(const m of g)o.push({source:m,target:f,start:{[n]:e_(u,p,"start",Math.max)},end:{[n]:e_(u,p,"end",Math.min)}})}}return o}function sg(e,t,n,r){if(r)return;let i=t[e],s=n[e];return e==="angle"&&(i=Nt(i),s=Nt(s)),{property:e,start:i,end:s}}function aB(e,t){const{x:n=null,y:r=null}=e||{},i=t.points,s=[];return t.segments.forEach(({start:o,end:a})=>{a=Cd(o,a,i);const l=i[o],c=i[a];r!==null?(s.push({x:l.x,y:r}),s.push({x:c.x,y:r})):n!==null&&(s.push({x:n,y:l.y}),s.push({x:n,y:c.y}))}),s}function Cd(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function e_(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function pE(e,t){let n=[],r=!1;return Ve(e)?(r=!0,n=e):n=aB(e,t),n.length?new Zr({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function t_(e){return e&&e.fill!==!1}function lB(e,t,n){let i=e[t].fill;const s=[t];let o;if(!n)return i;for(;i!==!1&&s.indexOf(i)===-1;){if(!Qe(i))return i;if(o=e[i],!o)return!1;if(o.visible)return i;s.push(i),i=o.fill}return!1}function cB(e,t,n){const r=fB(e);if(ve(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return Qe(i)&&Math.floor(i)===i?uB(r[0],t,i,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function uB(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function dB(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:ve(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function hB(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:ve(e)?r=e.value:r=t.getBaseValue(),r}function fB(e){const t=e.options,n=t.fill;let r=ce(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function pB(e){const{scale:t,index:n,line:r}=e,i=[],s=r.segments,o=r.points,a=gB(t,n);a.push(pE({x:null,y:t.bottom},r));for(let l=0;l<s.length;l++){const c=s[l];for(let u=c.start;u<=c.end;u++)mB(i,o[u],a)}return new Zr({points:i,options:{}})}function gB(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const s=r[i];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function mB(e,t,n){const r=[];for(let i=0;i<n.length;i++){const s=n[i],{first:o,last:a,point:l}=xB(s,t,"x");if(!(!l||o&&a)){if(o)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function xB(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const i=r[n],s=e.segments,o=e.points;let a=!1,l=!1;for(let c=0;c<s.length;c++){const u=s[c],d=o[u.start][n],f=o[u.end][n];if(_r(i,d,f)){a=i===d,l=i===f;break}}return{first:a,last:l,point:r}}class gE{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:i,y:s,radius:o}=this;return n=n||{start:0,end:We},t.arc(i,s,o,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:i}=this,s=t.angle;return{x:n+Math.cos(s)*i,y:r+Math.sin(s)*i,angle:s}}}function vB(e){const{chart:t,fill:n,line:r}=e;if(Qe(n))return yB(t,n);if(n==="stack")return pB(e);if(n==="shape")return!0;const i=bB(e);return i instanceof gE?i:pE(i,r)}function yB(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function bB(e){return(e.scale||{}).getPointPositionForValue?wB(e):_B(e)}function _B(e){const{scale:t={},fill:n}=e,r=dB(n,t);if(Qe(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function wB(e){const{scale:t,fill:n}=e,r=t.options,i=t.getLabels().length,s=r.reverse?t.max:t.min,o=hB(n,t,s),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,s);return new gE({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<i;++l)a.push(t.getPointPositionForValue(l,o));return a}function tf(e,t,n){const r=vB(t),{chart:i,index:s,line:o,scale:a,axis:l}=t,c=o.options,u=c.fill,d=c.backgroundColor,{above:f=d,below:p=d}=u||{},g=i.getDatasetMeta(s),m=YC(i,g);r&&o.points.length&&(_d(e,n),kB(e,{line:o,target:r,above:f,below:p,area:n,scale:a,axis:l,clip:m}),wd(e))}function kB(e,t){const{line:n,target:r,above:i,below:s,area:o,scale:a,clip:l}=t,c=n._loop?"angle":t.axis;e.save();let u=s;s!==i&&(c==="x"?(n_(e,r,o.top),nf(e,{line:n,target:r,color:i,scale:a,property:c,clip:l}),e.restore(),e.save(),n_(e,r,o.bottom)):c==="y"&&(r_(e,r,o.left),nf(e,{line:n,target:r,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),r_(e,r,o.right),u=i)),nf(e,{line:n,target:r,color:u,scale:a,property:c,clip:l}),e.restore()}function n_(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],d=i[Cd(l,c,i)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function r_(e,t,n){const{segments:r,points:i}=t;let s=!0,o=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=i[l],d=i[Cd(l,c,i)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),o=!!t.pathSegment(e,a,{move:o}),o?e.closePath():e.lineTo(n,d.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function nf(e,t){const{line:n,target:r,property:i,color:s,scale:o,clip:a}=t,l=oB(n,r,i);for(const{source:c,target:u,start:d,end:f}of l){const{style:{backgroundColor:p=s}={}}=c,g=r!==!0;e.save(),e.fillStyle=p,SB(e,o,a,g&&sg(i,d,f)),e.beginPath();const m=!!n.pathSegment(e,c);let y;if(g){m?e.closePath():i_(e,r,f,i);const x=!!r.pathSegment(e,u,{move:m,reverse:!0});y=m&&x,y||i_(e,r,d,i)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function SB(e,t,n,r){const i=t.chart.chartArea,{property:s,start:o,end:a}=r||{};if(s==="x"||s==="y"){let l,c,u,d;s==="x"?(l=o,c=i.top,u=a,d=i.bottom):(l=i.left,c=o,u=i.right,d=a),e.beginPath(),n&&(l=Math.max(l,n.left),u=Math.min(u,n.right),c=Math.max(c,n.top),d=Math.min(d,n.bottom)),e.rect(l,c,u-l,d-c),e.clip()}}function i_(e,t,n,r){const i=t.interpolate(n,r);i&&e.lineTo(i.x,i.y)}var CB={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,i=[];let s,o,a,l;for(o=0;o<r;++o)s=e.getDatasetMeta(o),a=s.dataset,l=null,a&&a.options&&a instanceof Zr&&(l={visible:e.isDatasetVisible(o),index:o,fill:cB(a,o,r),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:a}),s.$filler=l,i.push(l);for(o=0;o<r;++o)l=i[o],!(!l||l.fill===!1)&&(l.fill=lB(i,o,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let o=i.length-1;o>=0;--o){const a=i[o].$filler;a&&(a.line.updateControlPoints(s,a.axis),r&&a.fill&&tf(e.ctx,a,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const s=r[i].$filler;t_(s)&&tf(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!t_(r)||n.drawTime!=="beforeDatasetDraw"||tf(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const s_=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},EB=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class o_ extends Rr{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Le(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,i)=>t.sort(r,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,i=ft(r.font),s=i.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=s_(r,s);let c,u;n.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,s,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,i,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,i){const{ctx:s,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+a;let d=t;s.textAlign="left",s.textBaseline="middle";let f=-1,p=-u;return this.legendItems.forEach((g,m)=>{const y=r+n/2+s.measureText(g.text).width;(m===0||c[c.length-1]+y+2*a>o)&&(d+=u,c[c.length-(m>0?0:1)]=0,p+=u,f++),l[m]={left:0,top:p,row:f,width:y,height:i},c[c.length-1]+=y+a}),d}_fitCols(t,n,r,i){const{ctx:s,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,f=0,p=0,g=0,m=0;return this.legendItems.forEach((y,x)=>{const{itemWidth:v,itemHeight:b}=NB(r,n,s,y,i);x>0&&p+b+2*a>u&&(d+=f+a,c.push({width:f,height:p}),g+=f+a,m++,f=p=0),l[x]={left:g,top:p,col:m,width:v,height:b},f=Math.max(f,v),p+=b+a}),d+=f,c.push({width:f,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:i},rtl:s}}=this,o=Ys(s,this.left,this.width);if(this.isHorizontal()){let a=0,l=Et(r,this.left+i,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Et(r,this.left+i,this.right-this.lineWidths[a])),c.top+=this.top+t+i,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+i}else{let a=0,l=Et(r,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Et(r,this.top+t+i,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+i,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;_d(t,this),this._draw(),wd(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:i}=this,{align:s,labels:o}=t,a=Ue.color,l=Ys(t.rtl,this.left,this.width),c=ft(o.font),{padding:u}=o,d=c.size,f=d/2;let p;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:g,boxHeight:m,itemHeight:y}=s_(o,d),x=function(_,C,P){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;i.save();const j=ce(P.lineWidth,1);if(i.fillStyle=ce(P.fillStyle,a),i.lineCap=ce(P.lineCap,"butt"),i.lineDashOffset=ce(P.lineDashOffset,0),i.lineJoin=ce(P.lineJoin,"miter"),i.lineWidth=j,i.strokeStyle=ce(P.strokeStyle,a),i.setLineDash(ce(P.lineDash,[])),o.usePointStyle){const w={radius:m*Math.SQRT2/2,pointStyle:P.pointStyle,rotation:P.rotation,borderWidth:j},M=l.xPlus(_,g/2),D=C+f;LC(i,w,M,D,o.pointStyleWidth&&g)}else{const w=C+Math.max((d-m)/2,0),M=l.leftForLtr(_,g),D=qi(P.borderRadius);i.beginPath(),Object.values(D).some(F=>F!==0)?cl(i,{x:M,y:w,w:g,h:m,radius:D}):i.rect(M,w,g,m),i.fill(),j!==0&&i.stroke()}i.restore()},v=function(_,C,P){ns(i,P.text,_,C+y/2,c,{strikethrough:P.hidden,textAlign:l.textAlign(P.textAlign)})},b=this.isHorizontal(),S=this._computeTitleHeight();b?p={x:Et(s,this.left+u,this.right-r[0]),y:this.top+u+S,line:0}:p={x:this.left+u,y:Et(s,this.top+S+u,this.bottom-n[0].height),line:0},VC(this.ctx,t.textDirection);const k=y+u;this.legendItems.forEach((_,C)=>{i.strokeStyle=_.fontColor,i.fillStyle=_.fontColor;const P=i.measureText(_.text).width,j=l.textAlign(_.textAlign||(_.textAlign=o.textAlign)),w=g+f+P;let M=p.x,D=p.y;l.setWidth(this.width),b?C>0&&M+w+u>this.right&&(D=p.y+=k,p.line++,M=p.x=Et(s,this.left+u,this.right-r[p.line])):C>0&&D+k>this.bottom&&(M=p.x=M+n[p.line].width+u,p.line++,D=p.y=Et(s,this.top+S+u,this.bottom-n[p.line].height));const F=l.x(M);if(x(F,D,_),M=q5(j,M+g+f,b?M+w:this.right,t.rtl),v(l.x(M),D,_),b)p.x+=w+u;else if(typeof _.text!="string"){const $=c.lineHeight;p.y+=mE(_,$)+u}else p.y+=k}),UC(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=ft(n.font),i=Rt(n.padding);if(!n.display)return;const s=Ys(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,c=i.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=Et(t.align,d,this.right-f);else{const g=this.columnSizes.reduce((m,y)=>Math.max(m,y.height),0);u=c+Et(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const p=Et(a,d,d+f);o.textAlign=s.textAlign(Jm(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,ns(o,n.text,p,u,r)}_computeTitleHeight(){const t=this.options.title,n=ft(t.font),r=Rt(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,i,s;if(_r(t,this.left,this.right)&&_r(n,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(i=s[r],_r(t,i.left,i.left+i.width)&&_r(n,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!TB(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,s=EB(i,r);i&&!s&&Le(n.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!s&&Le(n.onHover,[t,r,this],this)}else r&&Le(n.onClick,[t,r,this],this)}}function NB(e,t,n,r,i){const s=PB(r,e,t,n),o=jB(i,r,t.lineHeight);return{itemWidth:s,itemHeight:o}}function PB(e,t,n,r){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((s,o)=>s.length>o.length?s:o)),t+n.size/2+r.measureText(i).width}function jB(e,t,n){let r=e;return typeof t.text!="string"&&(r=mE(t,n)),r}function mE(e,t){const n=e.text?e.text.length:0;return t*n}function TB(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var MB={id:"legend",_element:o_,start(e,t,n){const r=e.legend=new o_({ctx:e.ctx,options:n,chart:e});Tt.configure(e,r,n),Tt.addBox(e,r)},stop(e){Tt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Tt.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:s,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Rt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class ox extends Rr{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=Ve(r.text)?r.text.length:1;this._padding=Rt(r.padding);const s=i*ft(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:i,right:s,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Et(a,r,s),d=n+t,c=s-r):(o.position==="left"?(u=r+t,d=Et(a,i,n),l=Ne*-.5):(u=s-t,d=Et(a,n,i),l=Ne*.5),c=i-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=ft(n.font),s=r.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(s);ns(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Jm(n.align),textBaseline:"middle",translation:[o,a]})}}function RB(e,t){const n=new ox({ctx:e.ctx,options:t,chart:e});Tt.configure(e,n,t),Tt.addBox(e,n),e.titleBlock=n}var DB={id:"title",_element:ox,start(e,t,n){RB(e,n)},stop(e){const t=e.titleBlock;Tt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Tt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const uc=new WeakMap;var AB={id:"subtitle",start(e,t,n){const r=new ox({ctx:e.ctx,options:n,chart:e});Tt.configure(e,r,n),Tt.addBox(e,r),uc.set(e,r)},stop(e){Tt.removeBox(e,uc.get(e)),uc.delete(e)},beforeUpdate(e,t,n){const r=uc.get(e);Tt.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const aa={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,s=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),i+=l.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:i/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=Number.POSITIVE_INFINITY,s,o,a;for(s=0,o=e.length;s<o;++s){const l=e[s].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Jp(t,c);u<i&&(i=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function qn(e,t){return t&&(Ve(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function fr(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
138
+ `)>-1?e.split(`
139
+ `):e}function IB(e,t){const{element:n,datasetIndex:r,index:i}=t,s=e.getDatasetMeta(r).controller,{label:o,value:a}=s.getLabelAndValue(i);return{chart:e,label:o,parsed:s.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:a,dataset:s.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function a_(e,t){const n=e.chart.ctx,{body:r,footer:i,title:s}=e,{boxWidth:o,boxHeight:a}=t,l=ft(t.bodyFont),c=ft(t.titleFont),u=ft(t.footerFont),d=s.length,f=i.length,p=r.length,g=Rt(t.padding);let m=g.height,y=0,x=r.reduce((S,k)=>S+k.before.length+k.lines.length+k.after.length,0);if(x+=e.beforeBody.length+e.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),x){const S=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=p*S+(x-p)*l.lineHeight+(x-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0;const b=function(S){y=Math.max(y,n.measureText(S).width+v)};return n.save(),n.font=c.string,je(e.title,b),n.font=l.string,je(e.beforeBody.concat(e.afterBody),b),v=t.displayColors?o+2+t.boxPadding:0,je(r,S=>{je(S.before,b),je(S.lines,b),je(S.after,b)}),v=0,n.font=u.string,je(e.footer,b),n.restore(),y+=g.width,{width:y,height:m}}function LB(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function OB(e,t,n,r){const{x:i,width:s}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&i+s+o>t.width||e==="right"&&i-s-o<0)return!0}function FB(e,t,n,r){const{x:i,width:s}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=i<=(a+l)/2?"left":"right":i<=s/2?c="left":i>=o-s/2&&(c="right"),OB(c,e,t,n)&&(c="center"),c}function l_(e,t,n){const r=n.yAlign||t.yAlign||LB(e,n);return{xAlign:n.xAlign||t.xAlign||FB(e,t,n,r),yAlign:r}}function $B(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function zB(e,t,n){let{y:r,height:i}=e;return t==="top"?r+=n:t==="bottom"?r-=i+n:r-=i/2,r}function c_(e,t,n,r){const{caretSize:i,caretPadding:s,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=i+s,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=qi(o);let g=$B(t,a);const m=zB(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(u,f)+i:a==="right"&&(g+=Math.max(d,p)+i),{x:gt(g,0,r.width-t.width),y:gt(m,0,r.height-t.height)}}function dc(e,t,n){const r=Rt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function u_(e){return qn([],fr(e))}function BB(e,t,n){return _i(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function d_(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const xE={beforeTitle:ur,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:ur,beforeBody:ur,beforeLabel:ur,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return ge(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:ur,afterBody:ur,beforeFooter:ur,footer:ur,afterFooter:ur};function Ht(e,t,n,r){const i=e[t].call(n,r);return typeof i>"u"?xE[t].call(n,r):i}class og extends Rr{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),i=r.enabled&&n.options.animation&&r.animations,s=new XC(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=BB(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,i=Ht(r,"beforeTitle",this,t),s=Ht(r,"title",this,t),o=Ht(r,"afterTitle",this,t);let a=[];return a=qn(a,fr(i)),a=qn(a,fr(s)),a=qn(a,fr(o)),a}getBeforeBody(t,n){return u_(Ht(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,i=[];return je(t,s=>{const o={before:[],lines:[],after:[]},a=d_(r,s);qn(o.before,fr(Ht(a,"beforeLabel",this,s))),qn(o.lines,Ht(a,"label",this,s)),qn(o.after,fr(Ht(a,"afterLabel",this,s))),i.push(o)}),i}getAfterBody(t,n){return u_(Ht(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,i=Ht(r,"beforeFooter",this,t),s=Ht(r,"footer",this,t),o=Ht(r,"afterFooter",this,t);let a=[];return a=qn(a,fr(i)),a=qn(a,fr(s)),a=qn(a,fr(o)),a}_createItems(t){const n=this._active,r=this.chart.data,i=[],s=[],o=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(IB(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),je(a,u=>{const d=d_(t.callbacks,u);i.push(Ht(d,"labelColor",this,u)),s.push(Ht(d,"labelPointStyle",this,u)),o.push(Ht(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),i=this._active;let s,o=[];if(!i.length)this.opacity!==0&&(s={opacity:0});else{const a=aa[r.position].call(this,i,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=a_(this,r),c=Object.assign({},a,l),u=l_(this.chart,r,c),d=c_(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,i){const s=this.getCaretPosition(t,r,i);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,r){const{xAlign:i,yAlign:s}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=qi(a),{x:f,y:p}=t,{width:g,height:m}=n;let y,x,v,b,S,k;return s==="center"?(S=p+m/2,i==="left"?(y=f,x=y-o,b=S+o,k=S-o):(y=f+g,x=y+o,b=S-o,k=S+o),v=y):(i==="left"?x=f+Math.max(l,u)+o:i==="right"?x=f+g-Math.max(c,d)-o:x=this.caretX,s==="top"?(b=p,S=b-o,y=x-o,v=x+o):(b=p+m,S=b+o,y=x+o,v=x-o),k=b),{x1:y,x2:x,x3:v,y1:b,y2:S,y3:k}}drawTitle(t,n,r){const i=this.title,s=i.length;let o,a,l;if(s){const c=Ys(r.rtl,this.x,this.width);for(t.x=dc(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",o=ft(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<s;++l)n.fillText(i[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===s&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,i,s){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=s,u=ft(s.bodyFont),d=dc(this,"left",s),f=i.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,g=n.y+p;if(s.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=i.leftForLtr(f,c)+c/2,x=g+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,Zp(t,m,y,x),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Zp(t,m,y,x)}else{t.lineWidth=ve(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const m=i.leftForLtr(f,c),y=i.leftForLtr(i.xPlus(f,1),c-2),x=qi(o.borderRadius);Object.values(x).some(v=>v!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,cl(t,{x:m,y:g,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),cl(t,{x:y,y:g+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=o.backgroundColor,t.fillRect(y,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:i}=this,{bodySpacing:s,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=ft(r.bodyFont);let f=d.lineHeight,p=0;const g=Ys(r.rtl,this.x,this.width),m=function(P){n.fillText(P,g.x(t.x+p),t.y+f/2),t.y+=f+s},y=g.textAlign(o);let x,v,b,S,k,_,C;for(n.textAlign=o,n.textBaseline="middle",n.font=d.string,t.x=dc(this,y,r),n.fillStyle=r.bodyColor,je(this.beforeBody,m),p=a&&y!=="right"?o==="center"?c/2+u:c+2+u:0,S=0,_=i.length;S<_;++S){for(x=i[S],v=this.labelTextColors[S],n.fillStyle=v,je(x.before,m),b=x.lines,a&&b.length&&(this._drawColorBox(n,t,S,g,r),f=Math.max(d.lineHeight,l)),k=0,C=b.length;k<C;++k)m(b[k]),f=d.lineHeight;je(x.after,m)}p=0,f=d.lineHeight,je(this.afterBody,m),t.y-=s}drawFooter(t,n,r){const i=this.footer,s=i.length;let o,a;if(s){const l=Ys(r.rtl,this.x,this.width);for(t.x=dc(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=ft(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<s;++a)n.fillText(i[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,i){const{xAlign:s,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:g}=qi(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+d,l),o==="top"&&this.drawCaret(t,n,r,i),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&s==="right"&&this.drawCaret(t,n,r,i),n.lineTo(a+c,l+u-g),n.quadraticCurveTo(a+c,l+u,a+c-g,l+u),o==="bottom"&&this.drawCaret(t,n,r,i),n.lineTo(a+p,l+u),n.quadraticCurveTo(a,l+u,a,l+u-p),o==="center"&&s==="left"&&this.drawCaret(t,n,r,i),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,l),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,i=r&&r.x,s=r&&r.y;if(i||s){const o=aa[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=a_(this,t),l=Object.assign({},o,this._size),c=l_(n,t,l),u=c_(t,l,c,n);(i._to!==u.x||s._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Rt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(s,t,i,n),VC(t,n.textDirection),s.y+=o.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),UC(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,i=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),s=!Lu(r,i),o=this._positionChanged(i,n);(s||o)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,s=this._active||[],o=this._getActiveElements(t,s,n,r),a=this._positionChanged(o,t),l=n||!Lu(o,s)||a;return l&&(this._active=o,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,i){const s=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,s.mode,s,r);return s.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:i,options:s}=this,o=aa[s.position].call(this,t,n);return o!==!1&&(r!==o.x||i!==o.y)}}U(og,"positioners",aa);var WB={id:"tooltip",_element:og,positioners:aa,afterInit(e,t,n){n&&(e.tooltip=new og({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:xE},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},HB=Object.freeze({__proto__:null,Colors:tB,Decimation:sB,Filler:CB,Legend:MB,SubTitle:AB,Title:DB,Tooltip:WB});const VB=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function UB(e,t,n,r){const i=e.indexOf(t);if(i===-1)return VB(e,t,n,r);const s=e.lastIndexOf(t);return i!==s?n:i}const qB=(e,t)=>e===null?null:gt(Math.round(e),0,t);function h_(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class ag extends ls{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:i,label:s}of n)r[i]===s&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(ge(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:UB(r,t,ce(n,t),this._addedLabels),qB(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,i=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)i.push({value:o});return i}getLabelForValue(t){return h_.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}U(ag,"id","category"),U(ag,"defaults",{ticks:{callback:h_}});function GB(e,t){const n=[],{bounds:i,step:s,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,p=s||1,g=u-1,{min:m,max:y}=t,x=!ge(o),v=!ge(a),b=!ge(c),S=(y-m)/(d+1);let k=ab((y-m)/g/p)*p,_,C,P,j;if(k<1e-14&&!x&&!v)return[{value:m},{value:y}];j=Math.ceil(y/k)-Math.floor(m/k),j>g&&(k=ab(j*k/g/p)*p),ge(l)||(_=Math.pow(10,l),k=Math.ceil(k*_)/_),i==="ticks"?(C=Math.floor(m/k)*k,P=Math.ceil(y/k)*k):(C=m,P=y),x&&v&&s&&$5((a-o)/s,k/1e3)?(j=Math.round(Math.min((a-o)/k,u)),k=(a-o)/j,C=o,P=a):b?(C=x?o:C,P=v?a:P,j=c-1,k=(P-C)/j):(j=(P-C)/k,Na(j,Math.round(j),k/1e3)?j=Math.round(j):j=Math.ceil(j));const w=Math.max(lb(k),lb(C));_=Math.pow(10,ge(l)?w:l),C=Math.round(C*_)/_,P=Math.round(P*_)/_;let M=0;for(x&&(f&&C!==o?(n.push({value:o}),C<o&&M++,Na(Math.round((C+M*k)*_)/_,o,f_(o,S,e))&&M++):C<o&&M++);M<j;++M){const D=Math.round((C+M*k)*_)/_;if(v&&D>a)break;n.push({value:D})}return v&&f&&P!==a?n.length&&Na(n[n.length-1].value,a,f_(a,S,e))?n[n.length-1].value=a:n.push({value:a}):(!v||P===a)&&n.push({value:P}),n}function f_(e,t,{horizontal:n,minRotation:r}){const i=On(r),s=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(""+e).length;return Math.min(t/s,o)}class Hu extends ls{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return ge(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:i,max:s}=this;const o=l=>i=n?i:l,a=l=>s=r?s:l;if(t){const l=ir(i),c=ir(s);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(i===s){let l=s===0?1:Math.abs(s*.05);a(s+l),t||o(i-l)}this.min=i,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,o=GB(i,s);return t.bounds==="ticks"&&NC(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-n)/Math.max(t.length-1,1)/2;n-=i,r+=i}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return wl(t,this.chart.options.locale,this.options.ticks.format)}}class lg extends Hu{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Qe(t)?t:0,this.max=Qe(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=On(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}U(lg,"id","linear"),U(lg,"defaults",{ticks:{callback:bd.formatters.numeric}});const dl=e=>Math.floor(Jr(e)),Ti=(e,t)=>Math.pow(10,dl(e)+t);function p_(e){return e/Math.pow(10,dl(e))===1}function g_(e,t,n){const r=Math.pow(10,n),i=Math.floor(e/r);return Math.ceil(t/r)-i}function KB(e,t){const n=t-e;let r=dl(n);for(;g_(e,t,r)>10;)r++;for(;g_(e,t,r)<10;)r--;return Math.min(r,dl(e))}function YB(e,{min:t,max:n}){t=sn(e.min,t);const r=[],i=dl(t);let s=KB(t,n),o=s<0?Math.pow(10,Math.abs(s)):1;const a=Math.pow(10,s),l=i>s?Math.pow(10,i):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,s)),f=sn(e.min,Math.round((l+u+d*Math.pow(10,s))*o)/o);for(;f<n;)r.push({value:f,major:p_(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(s++,d=2,o=s>=0?1:o),f=Math.round((l+u+d*Math.pow(10,s))*o)/o;const p=sn(e.max,f);return r.push({value:p,major:p_(p),significand:d}),r}class cg extends ls{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Hu.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Qe(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Qe(t)?Math.max(0,t):null,this.max=Qe(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Qe(this._userMin)&&(this.min=t===Ti(this.min,0)?Ti(this.min,-1):Ti(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,i=this.max;const s=a=>r=t?r:a,o=a=>i=n?i:a;r===i&&(r<=0?(s(1),o(10)):(s(Ti(r,-1)),o(Ti(i,1)))),r<=0&&s(Ti(i,-1)),i<=0&&o(Ti(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=YB(n,this);return t.bounds==="ticks"&&NC(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":wl(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Jr(t),this._valueRange=Jr(this.max)-Jr(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Jr(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}U(cg,"id","logarithmic"),U(cg,"defaults",{ticks:{callback:bd.formatters.logarithmic,major:{enabled:!0}}});function ug(e){const t=e.ticks;if(t.display&&e.display){const n=Rt(t.backdropPadding);return ce(t.font&&t.font.size,Ue.font.size)+n.height}return 0}function XB(e,t,n){return n=Ve(n)?n:[n],{w:n3(e,t.string,n),h:n.length*t.lineHeight}}function m_(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:e<r||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function JB(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],s=e._pointLabels.length,o=e.options.pointLabels,a=o.centerPointLabels?Ne/s:0;for(let l=0;l<s;l++){const c=o.setContext(e.getPointLabelContext(l));i[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+i[l],a),d=ft(c.font),f=XB(e.ctx,d,e._pointLabels[l]);r[l]=f;const p=Nt(e.getIndexAngle(l)+a),g=Math.round(Ym(p)),m=m_(g,u.x,f.w,0,180),y=m_(g,u.y,f.h,90,270);QB(n,t,p,m,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=t6(e,r,i)}function QB(e,t,n,r,i){const s=Math.abs(Math.sin(n)),o=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/s,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/s,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(l=(t.t-i.start)/o,e.t=Math.min(e.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+l))}function ZB(e,t,n){const r=e.drawingArea,{extra:i,additionalAngle:s,padding:o,size:a}=n,l=e.getPointPosition(t,r+i+o,s),c=Math.round(Ym(Nt(l.angle+nt))),u=i6(l.y,a.h,c),d=n6(c),f=r6(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function e6(e,t){if(!t)return!0;const{left:n,top:r,right:i,bottom:s}=e;return!(kr({x:n,y:r},t)||kr({x:n,y:s},t)||kr({x:i,y:r},t)||kr({x:i,y:s},t))}function t6(e,t,n){const r=[],i=e._pointLabels.length,s=e.options,{centerPointLabels:o,display:a}=s.pointLabels,l={extra:ug(s)/2,additionalAngle:o?Ne/i:0};let c;for(let u=0;u<i;u++){l.padding=n[u],l.size=t[u];const d=ZB(e,u,l);r.push(d),a==="auto"&&(d.visible=e6(d,c),d.visible&&(c=d))}return r}function n6(e){return e===0||e===180?"center":e<180?"left":"right"}function r6(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function i6(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function s6(e,t,n){const{left:r,top:i,right:s,bottom:o}=n,{backdropColor:a}=t;if(!ge(a)){const l=qi(t.borderRadius),c=Rt(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=i-c.top,f=s-r+c.width,p=o-i+c.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),cl(e,{x:u,y:d,w:f,h:p,radius:l}),e.fill()):e.fillRect(u,d,f,p)}}function o6(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){const s=e._pointLabelItems[i];if(!s.visible)continue;const o=r.setContext(e.getPointLabelContext(i));s6(n,o,s);const a=ft(o.font),{x:l,y:c,textAlign:u}=s;ns(n,e._pointLabels[i],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function vE(e,t,n,r){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,We);else{let s=e.getPointPosition(0,t);i.moveTo(s.x,s.y);for(let o=1;o<r;o++)s=e.getPointPosition(o,t),i.lineTo(s.x,s.y)}}function a6(e,t,n,r,i){const s=e.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!r||!a||!l||n<0||(s.save(),s.strokeStyle=a,s.lineWidth=l,s.setLineDash(i.dash||[]),s.lineDashOffset=i.dashOffset,s.beginPath(),vE(e,n,o,r),s.closePath(),s.stroke(),s.restore())}function l6(e,t,n){return _i(e,{label:n,index:t,type:"pointLabel"})}class la extends Hu{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Rt(ug(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=Qe(t)&&!isNaN(t)?t:0,this.max=Qe(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ug(this.options))}generateTickLabels(t){Hu.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const i=Le(this.options.pointLabels.callback,[n,r],this);return i||i===0?i:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?JB(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,i))}getIndexAngle(t){const n=We/(this._pointLabels.length||1),r=this.options.startAngle||0;return Nt(t*n+On(r))}getDistanceFromCenterForValue(t){if(ge(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(ge(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return l6(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const i=this.getIndexAngle(t)-nt+r;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:i,bottom:s}=this._pointLabelItems[t];return{left:n,top:r,right:i,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),vE(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:i,border:s}=n,o=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&o6(this,o),i.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),p=i.setContext(f),g=s.setContext(f);a6(this,p,l,o,g)}}),r.display){for(t.save(),a=o-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let s,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=ft(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Rt(c.backdropPadding);t.fillRect(-o/2-d.left,-s-u.size/2-d.top,o+d.width,u.size+d.height)}ns(t,a.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}U(la,"id","radialLinear"),U(la,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:bd.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),U(la,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),U(la,"descriptors",{angleLines:{_fallback:"grid"}});const Ed={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Gt=Object.keys(Ed);function x_(e,t){return e-t}function v_(e,t){if(ge(t))return null;const n=e._adapter,{parser:r,round:i,isoWeekday:s}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),Qe(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i==="week"&&(co(s)||s===!0)?n.startOf(o,"isoWeek",s):n.startOf(o,i)),+o)}function y_(e,t,n,r){const i=Gt.length;for(let s=Gt.indexOf(e);s<i-1;++s){const o=Ed[Gt[s]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return Gt[s]}return Gt[i-1]}function c6(e,t,n,r,i){for(let s=Gt.length-1;s>=Gt.indexOf(n);s--){const o=Gt[s];if(Ed[o].common&&e._adapter.diff(i,r,o)>=t-1)return o}return Gt[n?Gt.indexOf(n):0]}function u6(e){for(let t=Gt.indexOf(e)+1,n=Gt.length;t<n;++t)if(Ed[Gt[t]].common)return Gt[t]}function b_(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:i}=Xm(n,t),s=n[r]>=t?n[r]:n[i];e[s]=!0}}function d6(e,t,n,r){const i=e._adapter,s=+i.startOf(t[0].value,r),o=t[t.length-1].value;let a,l;for(a=s;a<=o;a=+i.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function __(e,t,n){const r=[],i={},s=t.length;let o,a;for(o=0;o<s;++o)a=t[o],i[a]=o,r.push({value:a,major:!1});return s===0||!n?r:d6(e,r,i,n)}class hl extends ls{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),i=this._adapter=new yz._date(t.adapters.date);i.init(n),Ea(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:v_(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:i,max:s,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(i=Math.min(i,c.min)),!a&&!isNaN(c.max)&&(s=Math.max(s,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),i=Qe(i)&&!isNaN(i)?i:+n.startOf(Date.now(),r),s=Qe(s)&&!isNaN(s)?s:+n.endOf(Date.now(),r)+1,this.min=Math.min(i,s-1),this.max=Math.max(i+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const s=this.min,o=this.max,a=H5(i,s,o);return this._unit=n.unit||(r.autoSkip?y_(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):c6(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:u6(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),__(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,i,s;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?r=s:r=(s-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=gt(n,0,o),r=gt(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,i=this.options,s=i.time,o=s.unit||y_(s.minUnit,n,r,this._getLabelCapacity(n)),a=ce(i.ticks.stepSize,1),l=o==="week"?s.isoWeekday:!1,c=co(l)||l===!0,u={};let d=n,f,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const g=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;f<r;f=+t.add(f,a,o),p++)b_(u,f,g);return(f===r||i.bounds==="ticks"||p===1)&&b_(u,f,g),Object.keys(u).sort(x_).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,s=this._unit,o=n||i[s];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,i){const s=this.options,o=s.ticks.callback;if(o)return Le(o,[t,n,r],this);const a=s.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=r[n],p=c&&d&&f&&f.major;return this._adapter.format(t,i||(p?d:u))}generateTickLabels(t){let n,r,i;for(n=0,r=t.length;n<r;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,i=On(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(i),o=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:r*s+a*o,h:r*o+a*s}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,i=r[n.unit]||r.millisecond,s=this._tickFormatFunction(t,0,__(this,[t],this._majorUnit),i),o=this._getLabelSize(s),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,r=i.length;n<r;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const i=this.getLabels();for(n=0,r=i.length;n<r;++n)t.push(v_(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return TC(t.sort(x_))}}U(hl,"id","time"),U(hl,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function hc(e,t,n){let r=0,i=e.length-1,s,o,a,l;n?(t>=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=wr(e,"pos",t)),{pos:s,time:a}=e[r],{pos:o,time:l}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=wr(e,"time",t)),{time:s,pos:a}=e[r],{time:o,pos:l}=e[i]);const c=o-s;return c?a+(l-a)*(t-s)/c:a}class dg extends hl{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=hc(n,this.min),this._tableRange=hc(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,i=[],s=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=n&&c<=r&&i.push(c);if(i.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=i.length;o<a;++o)u=i[o+1],l=i[o-1],c=i[o],Math.round((u+l)/2)!==c&&s.push({time:c,pos:o/(a-1)});return s}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((i,s)=>i-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(hc(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return hc(this._table,r*this._tableRange+this._minPos,!0)}}U(dg,"id","timeseries"),U(dg,"defaults",hl.defaults);var h6=Object.freeze({__proto__:null,CategoryScale:ag,LinearScale:lg,LogarithmicScale:cg,RadialLinearScale:la,TimeScale:hl,TimeSeriesScale:dg});const f6=[vz,K4,HB,h6];Jn.register(...f6);function rn(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function Ft(e,t=1){if(typeof document>"u")return`rgba(0,0,0,${t})`;const n=getComputedStyle(document.documentElement).getPropertyValue(`--${e}`).trim();return n?`rgba(${n.split(/\s+/).join(", ")}, ${t})`:`rgba(0,0,0,${t})`}function p6({data:e}){const t=E.useRef(null),n=E.useRef(null);return E.useEffect(()=>{if(!(!t.current||e.daily.length===0))return n.current&&n.current.destroy(),n.current=new Jn(t.current,{type:"bar",data:{labels:e.daily.map(r=>r.date.slice(5)),datasets:[{label:"Input",data:e.daily.map(r=>r.inputTokens),backgroundColor:Ft("primary",.75),borderRadius:2},{label:"Output",data:e.daily.map(r=>r.outputTokens),backgroundColor:Ft("info",.7),borderRadius:2},{label:"Cache Read",data:e.daily.map(r=>r.cacheReadTokens),backgroundColor:Ft("success",.45),borderRadius:2},{label:"Cache Write",data:e.daily.map(r=>r.cacheCreateTokens),backgroundColor:Ft("tertiary-fixed",.75),borderRadius:2}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{position:"bottom",labels:{color:Ft("on-surface-variant"),font:{size:10,family:"monospace"},boxWidth:12}},tooltip:{callbacks:{label:r=>`${r.dataset.label}: ${rn(r.raw)} tokens`}}},scales:{x:{stacked:!0,grid:{color:Ft("outline-variant",.3)},ticks:{color:Ft("on-surface-variant"),font:{size:9,family:"monospace"}}},y:{stacked:!0,grid:{color:Ft("outline-variant",.3)},ticks:{color:Ft("on-surface-variant"),font:{size:9,family:"monospace"},callback:r=>rn(r)}}}}}),()=>{var r;(r=n.current)==null||r.destroy()}},[e]),h.jsx("canvas",{ref:t})}function g6({data:e}){const t=E.useRef(null),n=E.useRef(null);return E.useEffect(()=>{if(!(!t.current||e.daily.length===0))return n.current&&n.current.destroy(),n.current=new Jn(t.current,{type:"bar",data:{labels:e.daily.map(r=>r.date.slice(5)),datasets:[{label:"Est. Cost (USD)",data:e.daily.map(r=>Number(r.estimatedCostUsd.toFixed(2))),backgroundColor:Ft("secondary",.75),borderRadius:2}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{labels:{color:Ft("on-surface-variant"),font:{size:10,family:"monospace"},boxWidth:12}},tooltip:{callbacks:{label:r=>`$${r.raw.toFixed(2)}`}}},scales:{x:{grid:{color:Ft("outline-variant",.3)},ticks:{color:Ft("on-surface-variant"),font:{size:9,family:"monospace"}}},y:{grid:{color:Ft("outline-variant",.3)},ticks:{color:Ft("on-surface-variant"),font:{size:9,family:"monospace"},callback:r=>`$${r}`}}}}}),()=>{var r;(r=n.current)==null||r.destroy()}},[e]),h.jsx("canvas",{ref:t})}function m6({agentId:e}){const{t}=we(),[n,r]=E.useState(null),[i,s]=E.useState(30),[o,a]=E.useState(!0);if(E.useEffect(()=>{a(!0),dR(e,i).then(r).catch(console.error).finally(()=>a(!1))},[e,i]),o||!n)return h.jsx("div",{className:"text-on-surface-variant/70 text-xs p-6",children:t("usage.loading")});const l=Object.entries(n.byModel).sort((c,u)=>u[1].estimatedCostUsd-c[1].estimatedCostUsd);return h.jsxs("div",{className:"flex flex-col h-full w-full min-w-0 bg-background",children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-outline-variant/30",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-[13px] opacity-60",children:"📊"}),h.jsx("span",{className:"text-[11px] uppercase tracking-[0.14em] font-medium text-on-surface-variant",children:t("usage.title")})]}),h.jsx("div",{className:"flex items-center gap-1",children:[7,14,30].map(c=>h.jsxs("button",{onClick:()=>s(c),className:`px-2 py-0.5 rounded text-[9px] font-mono transition-colors ${i===c?"bg-primary/20 text-primary":"text-on-surface-variant/70 hover:text-on-surface-variant/70"}`,children:[c,"d"]},c))})]}),h.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 scrollbar-thin",children:[h.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[h.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[h.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:t("usage.totalTokens")}),h.jsx("p",{className:"font-mono text-[20px] text-on-surface/80",children:rn(n.totalInputTokens+n.totalOutputTokens)}),h.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:t("usage.cachedSuffix",{amount:rn(n.totalCacheReadTokens+n.totalCacheCreateTokens)})})]}),h.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[h.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:t("usage.sessions")}),h.jsx("p",{className:"font-mono text-[20px] text-on-surface/80",children:n.totalSessions}),h.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:t("usage.modelsCount",{count:Object.keys(n.byModel).length})})]}),h.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[h.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:t("usage.estCost")}),h.jsxs("p",{className:"font-mono text-[20px] text-error/80",children:["$",n.totalEstimatedCostUsd.toFixed(2)]}),h.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:t("usage.periodDays",{days:i})})]}),h.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[h.jsx("p",{className:"text-[9px] uppercase text-on-surface-variant/60 mb-1.5",children:t("usage.avgDay")}),h.jsxs("p",{className:"font-mono text-[20px] text-warning/80",children:["$",n.daily.length>0?(n.totalEstimatedCostUsd/n.daily.length).toFixed(2):"0.00"]}),h.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant/60 mt-1",children:t("usage.sessionsPerDay",{count:n.daily.length>0?Math.round(n.totalSessions/n.daily.length):0})})]})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:t("usage.dailyTokenUsage")}),h.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",style:{height:"300px"},children:n.daily.length>0?h.jsx(p6,{data:n}):h.jsx("p",{className:"text-on-surface-variant/25 text-xs text-center pt-20",children:t("usage.noUsageData")})})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:t("usage.dailyCost")}),h.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",style:{height:"250px"},children:n.daily.length>0?h.jsx(g6,{data:n}):h.jsx("p",{className:"text-on-surface-variant/25 text-xs text-center pt-16",children:t("usage.noCostData")})})]}),l.length>0&&h.jsxs("div",{children:[h.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:t("usage.byModel")}),h.jsx("div",{className:"space-y-1",children:l.map(([c,u])=>h.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-2.5 flex items-center gap-3",children:[h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"font-mono text-[10px] text-on-surface/70 truncate block",children:c}),h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:t("usage.modelSessionsBlurb",{sessions:u.sessions,input:rn(u.inputTokens),output:rn(u.outputTokens)})})]}),h.jsxs("span",{className:"font-mono text-[10px] text-error/60 flex-shrink-0",children:["$",u.estimatedCostUsd.toFixed(2)]})]},c))})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:t("usage.tokenBreakdown")}),h.jsxs("div",{className:"rounded bg-surface-container-lowest border border-outline-variant/40 p-3 space-y-1.5",children:[h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:t("usage.inputTokens")}),h.jsx("span",{className:"font-mono text-[10px] text-primary",children:rn(n.totalInputTokens)})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:t("usage.outputTokens")}),h.jsx("span",{className:"font-mono text-[10px] text-info",children:rn(n.totalOutputTokens)})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:t("usage.cacheRead")}),h.jsx("span",{className:"font-mono text-[10px] text-success",children:rn(n.totalCacheReadTokens)})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant",children:t("usage.cacheWrite")}),h.jsx("span",{className:"font-mono text-[10px] text-warning",children:rn(n.totalCacheCreateTokens)})]})]})]}),Object.keys(n.byTool).length>0&&h.jsxs("div",{children:[h.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:t("usage.toolInvocations")}),h.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-3 space-y-1",children:Object.entries(n.byTool).sort((c,u)=>u[1]-c[1]).map(([c,u])=>{const d=Math.max(...Object.values(n.byTool));return h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant w-40 truncate flex-shrink-0",title:c,children:c}),h.jsx("div",{className:"flex-1 h-3 rounded-sm bg-background overflow-hidden",children:h.jsx("div",{className:"h-full rounded-sm bg-primary/40",style:{width:`${u/d*100}%`}})}),h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/70 w-8 text-right flex-shrink-0",children:u})]},c)})})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-[8px] uppercase tracking-[0.18em] text-on-surface-variant/35 font-semibold mb-2",children:t("usage.dailyBreakdown")}),h.jsx("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 overflow-hidden",children:h.jsxs("table",{className:"w-full",children:[h.jsx("thead",{children:h.jsxs("tr",{className:"border-b border-outline-variant/30",children:[h.jsx("th",{className:"px-3 py-2 text-left text-[9px] font-mono text-on-surface-variant/70 font-medium",children:t("usage.date")}),h.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:t("usage.tableSessions")}),h.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:t("usage.tableInput")}),h.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:t("usage.tableOutput")}),h.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:t("usage.tableCache")}),h.jsx("th",{className:"px-3 py-2 text-right text-[9px] font-mono text-on-surface-variant/70 font-medium",children:t("usage.tableCost")})]})}),h.jsx("tbody",{children:[...n.daily].reverse().map(c=>h.jsxs("tr",{className:"border-b border-white/[0.03] hover:bg-white/[0.02]",children:[h.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-on-surface/70",children:c.date}),h.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-on-surface-variant text-right",children:c.sessions}),h.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-primary text-right",children:rn(c.inputTokens)}),h.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-info text-right",children:rn(c.outputTokens)}),h.jsx("td",{className:"px-3 py-1.5 font-mono text-[10px] text-success text-right",children:rn(c.cacheReadTokens+c.cacheCreateTokens)}),h.jsxs("td",{className:"px-3 py-1.5 font-mono text-[10px] text-error/60 text-right",children:["$",c.estimatedCostUsd.toFixed(2)]})]},c.date))})]})})]})]})]})}function x6(e){const t=e.createdAt??e.created_at;return{_id:e._id??e.id,agentId:e.agentId??e.agent_id??"",type:e.type,input:e.input,output:e.output,durationMs:e.durationMs??e.duration_ms,createdAt:typeof t=="number"?new Date(t).toISOString():t??""}}const v6=[{label:"All",value:"default",color:""},{label:"MSG",value:"message",color:"bg-emerald-500"},{label:"TOOL",value:"tool_call",color:"bg-blue-500"},{label:"ERR",value:"error",color:"bg-red-500"},{label:"SYS",value:"system",color:"bg-gray-500"}];function y6(e){return{message:"text-success",tool_call:"text-info",tool_result:"text-info/60",error:"text-error",system:"text-gray-500"}[e]??"text-gray-500"}function b6(e){return{message:"bg-emerald-500/10",tool_call:"bg-blue-500/10",tool_result:"bg-blue-500/5",error:"bg-red-500/10",system:""}[e]??""}function _6(e){return{message:"bg-emerald-400",tool_call:"bg-blue-400",tool_result:"bg-blue-400/60",error:"bg-red-400",system:"bg-gray-600"}[e]??"bg-gray-600"}function w6(e){const t=new Date(e),n=new Date,r=t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return t.toDateString()!==n.toDateString()?`${t.toLocaleDateString("en-US",{month:"short",day:"numeric"})} ${r}`:r}function Ma(e){if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e}function k6(e){const t=Ma(e.input),n=Ma(e.output);if(e.type==="message"){const r=(t==null?void 0:t.text)??"";return String(r)||"(no text)"}if(e.type==="tool_call"){const r=(t==null?void 0:t.tool)??(t==null?void 0:t.tool_name)??(t==null?void 0:t.name)??"",i=(t==null?void 0:t.description)??"";if(r){({...t});const s=Ma(t==null?void 0:t.input),o=s?Object.values(s).map(l=>String(l).slice(0,60)).join(", ").slice(0,80):"",a=o?`${r}(${o})`:String(r);return i?`${a} — ${i}`:a}return JSON.stringify(t??{}).slice(0,200)}if(e.type==="tool_result")return JSON.stringify(n??{}).slice(0,200);if(e.type==="error")return String((n==null?void 0:n.message)??n??"unknown error");if(e.type==="system"){const r=n==null?void 0:n.exitCode;return r!==void 0?`process exited (${r})`:"—"}return JSON.stringify(n??{}).slice(0,200)}function S6(e,t){if(!t)return e;const n=e.toLowerCase().indexOf(t.toLowerCase());return n===-1?e:h.jsxs(h.Fragment,{children:[e.slice(0,n),h.jsx("mark",{className:"bg-yellow-400/30 text-yellow-200 rounded-sm px-0.5",children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function C6({agentId:e}){const{t}=we(),[n,r]=E.useState("default"),[i,s]=E.useState(""),[o,a]=E.useState(""),[l,c]=E.useState([]),[u,d]=E.useState(0),[f,p]=E.useState(!0),[g,m]=E.useState(new Set),[y,x]=E.useState(100),[v,b]=E.useState(!0),S=E.useRef(null),k=E.useRef(null),_=()=>a(i),C=E.useCallback(()=>{ER({agentId:e,type:n==="default"||n==="all"?void 0:n,search:o||void 0,limit:y}).then(w=>{let M=w.items.map(x6);n==="default"&&(M=M.filter(D=>D.type!=="system")),c(M),d(w.total)}).catch(console.error).finally(()=>p(!1))},[e,n,o,y]);E.useEffect(()=>{p(!0),C()},[C]),E.useEffect(()=>{if(!v)return;const w=setInterval(C,3e3);return()=>clearInterval(w)},[v,C]);const P=w=>{m(M=>{const D=new Set(M);return D.has(w)?D.delete(w):D.add(w),D})},j=l;return h.jsxs("div",{className:"flex flex-col h-full w-full min-w-0 rounded-lg overflow-hidden bg-surface-container-lowest",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-3 py-2 border-b border-outline-variant/30 bg-background",children:[h.jsxs("div",{className:"flex-1 min-w-0 flex items-center gap-1.5",children:[h.jsxs("div",{className:"flex-1 relative",children:[h.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-on-surface-variant/60",viewBox:"0 0 20 20",fill:"currentColor",children:h.jsx("path",{fillRule:"evenodd",d:"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z",clipRule:"evenodd"})}),h.jsx("input",{className:"w-full bg-surface-container-lowest rounded pl-8 pr-7 py-1.5 text-[11px] text-on-surface font-mono placeholder:text-on-surface-variant/25 outline-none focus:ring-1 focus:ring-primary/30 transition-shadow",placeholder:t("logs.searchPlaceholder"),value:i,onChange:w=>s(w.target.value),onKeyDown:w=>w.key==="Enter"&&_()}),i&&h.jsx("button",{onClick:()=>{s(""),a("")},className:"absolute right-2 top-1/2 -translate-y-1/2 text-on-surface-variant hover:text-on-surface text-xs",children:"x"})]}),h.jsx("button",{onClick:_,disabled:i===o,className:"px-2.5 py-1.5 rounded bg-primary/20 text-[10px] font-mono text-primary transition-colors hover:bg-primary/30 disabled:opacity-30 disabled:cursor-default flex-shrink-0",children:t("logs.apply")})]}),h.jsx("div",{className:"flex items-center gap-0.5",children:v6.map(({label:w,value:M,color:D})=>h.jsxs("button",{onClick:()=>r(M),className:`flex items-center gap-1 px-2 py-1 rounded text-[9px] font-mono transition-colors ${n===M?"bg-surface-container-high text-on-surface":"text-on-surface-variant hover:text-on-surface hover:bg-surface-container/50"}`,children:[D&&h.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${D}`}),w]},M))}),h.jsxs("button",{onClick:()=>b(w=>!w),className:`flex items-center gap-1.5 px-2 py-1 rounded text-[9px] font-mono transition-colors ${v?"bg-success/15 text-success":"text-on-surface-variant hover:text-on-surface"}`,children:[h.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${v?"bg-success animate-pulse":"bg-outline/60"}`}),t("logs.live")]}),h.jsxs("span",{className:"font-mono text-[9px] text-on-surface-variant tabular-nums",children:[l.length,"/",u]})]}),h.jsx("div",{ref:k,className:"flex-1 overflow-y-auto scrollbar-thin font-mono text-[11px]",children:f&&l.length===0?h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("span",{className:"text-on-surface-variant text-[10px]",children:t("logs.loading")})}):j.length===0?h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("span",{className:"text-on-surface-variant text-[10px]",children:i?t("logs.noResults",{query:i}):t("logs.noEntries")})}):h.jsxs("div",{className:"py-1",children:[j.map(w=>{const M=g.has(w._id),D=k6(w);return h.jsxs("div",{onClick:()=>P(w._id),className:`group px-3 py-[5px] cursor-pointer transition-colors hover:bg-surface-container/40 ${b6(w.type)} ${M?"bg-surface-container/30":""}`,children:[h.jsxs("div",{className:"flex items-start gap-2 leading-relaxed",children:[h.jsx("span",{className:`mt-[6px] w-[5px] h-[5px] rounded-full flex-shrink-0 ${_6(w.type)}`}),h.jsx("span",{className:"text-on-surface-variant flex-shrink-0 w-[70px] tabular-nums",children:w6(w.createdAt)}),h.jsx("span",{className:`flex-shrink-0 w-[52px] uppercase text-[9px] ${y6(w.type)}`,children:w.type==="tool_call"?"tool":w.type==="tool_result"?"result":w.type}),h.jsx("span",{className:`flex-1 min-w-0 ${M?"":"truncate"} ${w.type==="error"?"text-error":"text-on-surface"}`,children:S6(D,o)}),w.durationMs!=null&&h.jsx("span",{className:"flex-shrink-0 text-[9px] text-on-surface-variant tabular-nums",children:w.durationMs>1e3?`${(w.durationMs/1e3).toFixed(1)}s`:`${w.durationMs}ms`}),h.jsx("span",{className:"flex-shrink-0 text-[8px] text-on-surface-variant opacity-0 group-hover:opacity-100 transition-opacity",children:M?"−":"+"})]}),M&&h.jsxs("div",{className:"ml-[79px] mt-1.5 mb-1 space-y-1.5",children:[!!w.input&&w.input!=="null"&&h.jsxs("div",{children:[h.jsx("span",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant",children:"input"}),h.jsx("pre",{className:"text-[10px] text-on-surface mt-0.5 bg-surface-container-high rounded px-2.5 py-1.5 overflow-auto max-h-48 whitespace-pre-wrap break-words",children:JSON.stringify(Ma(w.input),null,2)})]}),!!w.output&&w.output!=="null"&&h.jsxs("div",{children:[h.jsx("span",{className:"font-label text-[8px] uppercase tracking-wider text-on-surface-variant",children:"output"}),h.jsx("pre",{className:"text-[10px] text-on-surface mt-0.5 bg-surface-container-high rounded px-2.5 py-1.5 overflow-auto max-h-48 whitespace-pre-wrap break-words",children:JSON.stringify(Ma(w.output),null,2)})]})]})]},w._id)}),l.length<u&&h.jsx("div",{className:"px-3 py-2 text-center",children:h.jsx("button",{onClick:()=>x(w=>w+100),className:"text-[9px] text-primary/40 hover:text-primary/70 transition-colors",children:t("logs.loadOlder",{count:Math.min(100,u-l.length)})})}),h.jsx("div",{ref:S})]})})]})}const E6=[{id:"telegram",name:"Telegram",descriptionKey:"integrations.telegramDescription",icon:"✈️",secretKey:"TELEGRAM_BOT_TOKEN",tokenLabelKey:"integrations.telegramTokenLabel",tokenPlaceholder:"110201543:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw",helpTextKey:"integrations.telegramHelp"}],w_="w-full rounded bg-surface-container px-3 py-2 text-[11px] text-on-surface placeholder:text-on-surface-variant/40 outline-none focus:ring-1 focus:ring-primary/25 font-mono transition-shadow";function N6({def:e,agentId:t,enabled:n,onEnable:r,onDisable:i}){const{t:s}=we(),[o,a]=E.useState(!1),[l,c]=E.useState(""),[u,d]=E.useState(!1),[f,p]=E.useState(null);async function g(){if(!l.trim()){p(s("common.tokenRequired"));return}d(!0),p(null);try{await Rp(t,e.secretKey,l.trim()),r(e.secretKey),a(!1),c("")}catch{p(s("integrations.errorSave"))}finally{d(!1)}}async function m(){confirm(s("integrations.disconnectConfirm",{name:e.name}))&&(await iS(t,e.secretKey),i(e.secretKey))}return h.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-start justify-between gap-3",children:[h.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[h.jsx("span",{className:"text-[20px] flex-shrink-0",children:e.icon}),h.jsxs("div",{className:"min-w-0",children:[h.jsx("p",{className:"text-[13px] font-semibold text-on-surface",children:e.name}),h.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/70 mt-0.5 leading-relaxed",children:s(e.descriptionKey)})]})]}),h.jsx("div",{className:"flex-shrink-0 flex items-center gap-2",children:n?h.jsxs(h.Fragment,{children:[h.jsxs("span",{className:"font-mono text-[9px] text-secondary/80 flex items-center gap-1",children:[h.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-secondary/70"}),s("integrations.connected")]}),h.jsx("button",{onClick:m,className:"rounded px-2 py-1 text-[10px] font-mono text-error/50 hover:text-error hover:bg-error/10 transition-colors",children:s("integrations.disconnect")})]}):h.jsx("button",{onClick:()=>{a(!0),p(null)},className:"rounded bg-primary/10 border border-primary/20 px-3 py-1 text-[11px] font-medium text-primary hover:bg-primary/20 transition-colors",children:s("integrations.connect")})})]}),!n&&o&&h.jsxs("div",{className:"pt-2 border-t border-outline-variant/30 space-y-3",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:s(e.tokenLabelKey)}),h.jsx("input",{type:"password",className:w_,placeholder:e.tokenPlaceholder,value:l,onChange:y=>{c(y.target.value),p(null)},autoComplete:"off",autoFocus:!0}),h.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant/50 mt-1.5 leading-relaxed",children:s(e.helpTextKey)})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{onClick:g,disabled:u||!l.trim(),className:"rounded bg-primary px-3 py-1.5 text-[12px] font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:s(u?"integrations.saving":"integrations.saveAndConnect")}),h.jsx("button",{onClick:()=>{a(!1),c(""),p(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:s("integrations.cancel")}),f&&h.jsx("span",{className:"font-mono text-[10px] text-error",children:f})]})]}),n&&o&&h.jsxs("div",{className:"pt-2 border-t border-outline-variant/30 space-y-3",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:s("integrations.newPrefix",{label:s(e.tokenLabelKey)})}),h.jsx("input",{type:"password",className:w_,placeholder:s("integrations.pasteNewToken"),value:l,onChange:y=>{c(y.target.value),p(null)},autoComplete:"off",autoFocus:!0})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{onClick:g,disabled:u||!l.trim(),className:"rounded bg-primary px-3 py-1.5 text-[12px] font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:s(u?"integrations.saving":"integrations.updateToken")}),h.jsx("button",{onClick:()=>{a(!1),c(""),p(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:s("integrations.cancel")}),f&&h.jsx("span",{className:"font-mono text-[10px] text-error",children:f})]})]}),n&&!o&&h.jsx("button",{onClick:()=>{a(!0),p(null)},className:"font-mono text-[10px] text-on-surface-variant/50 hover:text-on-surface-variant transition-colors",children:s("integrations.rotateToken")})]})}function P6({agentId:e,secretNames:t,setSecretNames:n}){const{t:r}=we();return h.jsxs("div",{className:"flex flex-col gap-4 max-w-xl",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"font-headline text-[22px] font-bold text-on-surface",children:r("integrations.title")}),h.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant/70 mt-1",children:r("integrations.blurb")})]}),h.jsx("div",{className:"space-y-3",children:E6.map(i=>h.jsx(N6,{def:i,agentId:e,enabled:t.includes(i.secretKey),onEnable:s=>n(o=>o.includes(s)?o:[...o,s]),onDisable:s=>n(o=>o.filter(a=>a!==s))},i.id))}),h.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/40 mt-2",children:r("integrations.moreSoon")})]})}function j6({agentId:e}){const{t}=we(),[n,r]=E.useState(null),[i,s]=E.useState(null),[o,a]=E.useState(null),[l,c]=E.useState(null);return E.useEffect(()=>{let u=!1;return eR(e).then(d=>{u||r(d)}).catch(()=>{u||r([])}),()=>{u=!0}},[e]),E.useEffect(()=>{if(!i){a(null),c(null);return}let u=!1;return a(null),c(null),tR(e,i).then(d=>{u||a(d)}).catch(d=>{u||c(d instanceof Error?d.message:String(d))}),()=>{u=!0}},[e,i]),h.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[h.jsxs("div",{className:"w-72 border-r border-outline/20 overflow-y-auto bg-surface-container-lowest",children:[h.jsxs("div",{className:"p-4 border-b border-outline/20",children:[h.jsx("h2",{className:"text-[13px] font-semibold text-on-surface",children:t("skillsView.title")}),h.jsx("p",{className:"text-[10px] text-on-surface-variant mt-1 leading-relaxed",children:t("skillsView.subtitle")})]}),n===null?h.jsx("div",{className:"p-4 text-[11px] text-on-surface-variant font-mono",children:t("skillsView.loading")}):n.length===0?h.jsx("div",{className:"p-4 text-[11px] text-on-surface-variant leading-relaxed",children:t("skillsView.empty")}):h.jsx("ul",{className:"divide-y divide-outline/10",children:n.map(u=>{const d=u.path.lastIndexOf("/"),f=d>=0?u.path.slice(0,d+1):"",p=d>=0?u.path.slice(d+1):u.name;return h.jsx("li",{children:h.jsxs("button",{type:"button",onClick:()=>s(u.path),className:`w-full text-left px-4 py-3 hover:bg-surface-container transition-colors ${i===u.path?"bg-surface-container":""}`,children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("span",{className:"text-[12px] font-mono truncate",children:[f&&h.jsx("span",{className:"text-on-surface-variant/60",children:f}),h.jsx("span",{className:"text-on-surface",children:p})]}),u.userInvocable&&h.jsx("span",{className:"text-[8px] uppercase tracking-wider px-1.5 py-0.5 rounded bg-primary/15 text-primary font-medium",children:t("skillsView.userInvocable")})]}),h.jsx("div",{className:"text-[10px] text-on-surface-variant mt-1 line-clamp-2 leading-snug",children:u.description})]})},u.path)})})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:i?l?h.jsx("div",{className:"text-[11px] text-error font-mono",children:t("skillsView.loadError",{error:l})}):o?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"mb-4",children:[h.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[h.jsxs("h2",{className:"text-[16px] font-semibold font-mono",children:[o.path.includes("/")&&h.jsx("span",{className:"text-on-surface-variant/60",children:o.path.slice(0,o.path.lastIndexOf("/")+1)}),h.jsx("span",{className:"text-on-surface",children:o.name})]}),o.userInvocable&&h.jsx("span",{className:"text-[9px] uppercase tracking-wider px-1.5 py-0.5 rounded bg-primary/15 text-primary font-medium",children:t("skillsView.userInvocable")})]}),h.jsx("p",{className:"text-[12px] text-on-surface-variant",children:o.description}),o.allowedTools&&h.jsxs("p",{className:"text-[10px] text-on-surface-variant mt-2 font-mono",children:[h.jsxs("span",{className:"opacity-60",children:[t("skillsView.allowedTools"),":"]})," ",o.allowedTools]})]}),h.jsx("div",{className:"text-[12px] text-on-surface/85 leading-relaxed prose prose-sm dark:prose-invert max-w-none",children:h.jsx(yd,{remarkPlugins:[mC],children:T6(o.content)})})]}):h.jsx("div",{className:"text-[11px] text-on-surface-variant font-mono",children:t("skillsView.loading")}):h.jsx("div",{className:"text-[11px] text-on-surface-variant font-mono",children:t("skillsView.selectSkill")})})]})}function T6(e){if(!e.startsWith("---"))return e;const t=e.indexOf(`
140
+ ---`,3);return t===-1?e:e.slice(t+4).replace(/^\n+/,"")}function M6({active:e,completed:t}){const{t:n}=we();if(!e&&!t)return null;const r=e?n("chat.compactingContext"):t&&t>1?`${t}× ${n("chat.compactedContext")}`:n("chat.compactedContext");return h.jsxs("div",{"data-testid":e?"compaction-active":"compaction-done",className:"flex items-center gap-2 px-2 py-1 rounded w-full max-w-xl text-left",children:[e?h.jsx("span",{className:"h-3 w-3 rounded-full border-2 border-primary/40 border-t-primary animate-spin flex-shrink-0"}):h.jsx("span",{className:"text-[10px] text-primary/60 flex-shrink-0",children:"🗜"}),h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant flex-1 truncate",children:r})]})}function R6(e){const t=e.toLowerCase();return t.includes("key limit")||t.includes("credit")||t.includes("insufficient_quota")||t.includes("quota exceeded")||t.includes("billing")?"creditLimit":t.includes("rate limit")||t.includes("rate_limit")||t.includes("too many requests")||t.includes("429")?"rateLimit":t.includes("401")||t.includes("invalid api key")||t.includes("invalid_api_key")||t.includes("authentication")?"auth":t.includes("no provider configured")?"noProvider":t.includes("api key missing")?"noKey":t.includes("timeout")||t.includes("timed out")?"timeout":"generic"}const D6=["chat","files","tasks","skills","browser","workflows","schedules","monitor","usage","logs","integrations"];function A6(){return h.jsx("span",{className:"inline-flex items-end gap-[3px] h-4",children:[0,1,2].map(e=>h.jsx("span",{className:"block w-1.5 h-1.5 rounded-full bg-current",style:{animation:`heartbeat-dot 1.2s ease-in-out ${e*.2}s infinite`}},e))})}function rf({className:e=""}){return h.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",children:h.jsx("path",{d:"M12 2L3 7v5c0 5.25 3.75 10.15 9 11.25C17.25 22.15 21 17.25 21 12V7L12 2z"})})}function I6({toolCalls:e,isStreaming:t}){const{t:n}=we(),[r,i]=E.useState(!1),s=e.length,o=l=>{const c=l.match(/^([^(]+)/);return c?c[1]:l},a=o(e[s-1]??"");return h.jsxs("div",{className:"w-full max-w-xl",children:[h.jsxs("button",{onClick:()=>i(l=>!l),className:"flex items-center gap-2 px-2 py-1 rounded hover:bg-surface-container-lowest/50 transition-colors w-full text-left",children:[t?h.jsx("span",{className:"h-3 w-3 rounded-full border-2 border-primary/40 border-t-primary animate-spin flex-shrink-0"}):h.jsx("span",{className:"text-[10px] text-primary/60 flex-shrink-0",children:"⚙"}),h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant flex-1 truncate",children:t?n("chat.executing",{tool:a}):n(s===1?"chat.toolCallsOne":"chat.toolCallsOther",{count:s})}),h.jsx("svg",{className:"w-2.5 h-2.5 text-on-surface-variant/30 transition-transform duration-150 flex-shrink-0",style:{transform:r?"rotate(90deg)":"none"},viewBox:"0 0 16 16",fill:"currentColor",children:h.jsx("path",{d:"M6 3l5 5-5 5V3z"})})]}),r&&h.jsx("div",{className:"mt-1 rounded bg-surface-container-lowest/50 overflow-y-auto scrollbar-thin",style:{maxHeight:"10rem"},children:e.map((l,c)=>h.jsxs("div",{className:"font-mono text-[9px] text-on-surface-variant/40 px-2.5 py-1 border-b border-white/[0.03] last:border-0 truncate hover:text-on-surface-variant/60 transition-colors",title:l,children:[h.jsx("span",{className:"text-primary/50",children:o(l)}),h.jsx("span",{className:"text-on-surface-variant/20 ml-1",children:l.slice(o(l).length)})]},c))})]})}function L6(){var xt;const{t:e}=we(),{id:t=""}=Zf(),n=E.useSyncExternalStore(vC,xC),r=Zf()["*"]??"",i=r==="chat"?"chat":r.startsWith("view/")?r.slice(5):void 0,s=os(),o=[...D6,...n.map(q=>q.id)],a=i&&o.includes(i)?i:"chat",l=q=>{Mp("chat_view_changed",{agentId:t,view:q}),q==="chat"?s(`/agents/${t}/chat`,{replace:!0}):s(`/agents/${t}/view/${q}`,{replace:!0})},[c,u]=E.useState(null),[d,f]=E.useState(null),[p,g]=E.useState([]),[m,y]=E.useState(""),[x,v]=E.useState(!1),[b,S]=E.useState(!1),[k,_]=E.useState(null),[C,P]=E.useState([]),j=E.useRef(null),[w]=E.useState(!0),[M,D]=E.useState([]),[,F]=E.useState(null),[,$]=E.useState(!1),I=E.useRef(null),H=E.useCallback(()=>{g(q=>q.map(de=>de.isStreaming?{...de,isStreaming:!1,text:de.text||"(connection lost)"}:de)),v(!1),_(null)},[]),X=E.useCallback(()=>{t&&Wy(t,"ui").then(q=>{const de=[];let ke=[];for(const be of q)if(be.role==="tool_call")ke.push(be.content);else if(be.role==="assistant"){if(!be.content&&ke.length===0)continue;de.push({id:be.id,role:"agent",text:be.content,toolCalls:ke.length>0?ke:void 0}),ke=[]}else ke.length>0&&(de.push({id:crypto.randomUUID(),role:"agent",text:"",toolCalls:ke}),ke=[]),de.push({id:be.id,role:"user",text:be.content});ke.length>0&&de.push({id:crypto.randomUUID(),role:"agent",text:"",toolCalls:ke}),g(de)}).catch(console.error)},[t]),L=E.useRef(!1);L.current=x;const B=E.useCallback(q=>{L.current||(q.type==="done"||q.type==="error"||q.type==="blocked")&&X()},[X]),{sendMessage:N,stopMessage:Q,connected:te}=q0(c==null?void 0:c.id,B,H);function T(){Q(),g(q=>q.map(de=>de.isStreaming?{...de,isStreaming:!1,text:de.text+`
141
+
142
+ *(stopped)*`}:de)),v(!1)}const re=E.useRef(!1),le=E.useRef(null),ae=E.useCallback(q=>{if(!re.current){if(q.type==="text")if(le.current){const de=le.current;D(ke=>ke.map(be=>be.id===de?{...be,text:be.text+q.text}:be))}else{const de=crypto.randomUUID();le.current=de,D(ke=>[...ke,{id:de,role:"agent",text:q.text,isStreaming:!0}])}else if(q.type==="done"&&le.current){const de=le.current;D(ke=>ke.map(be=>be.id===de?{...be,isStreaming:!1}:be)),le.current=null}}},[]);q0(void 0,ae),E.useEffect(()=>{if(!t)return;const q=setInterval(()=>{By(t).then(u).catch(console.error)},3e4);return()=>clearInterval(q)},[t]),E.useEffect(()=>{t&&(By(t).then(u).catch(console.error),ZM(t).then(q=>P(q.names)).catch(console.error),X(),Wy(t,"bb").then(q=>D(q.map(de=>({id:de.id,role:de.role==="user"?"user":"agent",text:de.content})))).catch(console.error))},[t,X]),E.useEffect(()=>{var q;(q=j.current)==null||q.scrollIntoView({behavior:"smooth"})},[p,a]),E.useEffect(()=>{var q;(q=I.current)==null||q.scrollIntoView({behavior:"smooth"})},[M]);function R(){const q=m.trim();if(!q||x)return;Mp("chat_message_sent",{agentId:t});const de={id:crypto.randomUUID(),role:"user",text:q},ke=crypto.randomUUID(),be={id:ke,role:"agent",text:"",isStreaming:!0,toolCalls:[]};g(Me=>[...Me,de,be]),y(""),v(!0);let Vn="",Dr=null;N(q,Me=>{if(Me.type==="text"){const Se=Dr==="tool_call"&&Vn.length>0?`
143
+
144
+ ${Me.text}`:Me.text;Vn+=Se,g(en=>en.map(mn=>mn.id===ke?{...mn,text:mn.text+Se}:mn)),Dr="text"}else if(Me.type==="tool_call")g(it=>it.map(Se=>Se.id===ke?{...Se,toolCalls:[...Se.toolCalls??[],`${Me.tool}(${JSON.stringify(Me.input)})`]}:Se)),Dr="tool_call";else if(Me.type==="compaction_start")g(it=>it.map(Se=>Se.id===ke?{...Se,isCompacting:!0}:Se));else if(Me.type==="compaction_end")g(it=>it.map(Se=>Se.id===ke?{...Se,isCompacting:!1,compactions:(Se.compactions??0)+1}:Se));else if(Me.type==="pending_approval")_({reason:Me.reason}),g(it=>it.map(Se=>Se.id===ke?{...Se,text:e("chat.pendingApproval",{reason:Me.reason})}:Se));else if(Me.type==="blocked"){const it=`🛡 Blocked: ${Me.reason}`;_(null),g(Se=>Se.map(en=>en.id===ke?{...en,isStreaming:!1,text:it}:en)),v(!1)}else if(Me.type==="agent_ready")f(Me.name);else if(Me.type==="error"){const it=R6(Me.message),en=`⚠ ${{creditLimit:e("chat.errorCreditLimit"),rateLimit:e("chat.errorRateLimit"),auth:e("chat.errorAuth"),noProvider:e("chat.errorNoProvider"),noKey:e("chat.errorNoKey"),timeout:e("chat.errorTimeout")}[it]??e("chat.errorGeneric",{message:Me.message})}`,mn=Vn?`${Vn}
145
+
146
+ ${en}`:en;_(null),g(Nd=>Nd.map(bo=>bo.id===ke?{...bo,isStreaming:!1,text:mn}:bo)),v(!1)}else Me.type==="done"&&(_(null),g(it=>it.map(Se=>Se.id===ke?{...Se,isStreaming:!1,text:Se.text||Vn}:Se)),v(!1))})}async function ie(){if(window.confirm(e("chat.wipeConfirm"))){S(!0);try{await YM(t),g([]),D([]),f(null),F(null),$(!1)}catch(q){console.error("wipe failed",q)}finally{S(!1)}}}const ee=((xt=c==null?void 0:c.bigBrother)==null?void 0:xt.enabled)&&c.bbPort!==null,[Pe,Ze]=E.useState(!1);return h.jsxs("div",{className:"flex h-full gap-0 md:gap-5 relative",children:[Pe&&h.jsx("div",{className:"fixed inset-0 z-30 bg-black/50 md:hidden",onClick:()=>Ze(!1)}),h.jsx("div",{className:`fixed md:static top-11 bottom-0 left-0 z-40 w-72 flex-shrink-0 flex flex-col bg-surface-container-lowest md:bg-transparent transition-transform duration-300 ease-in-out ${Pe?"translate-x-0 shadow-2xl":"-translate-x-full md:translate-x-0"}`,children:c?h.jsx(E$,{agentId:t,agent:c,agentDisplayName:d,connected:te,secretNames:C,setSecretNames:P,isWiping:b,isSending:x,onWipe:ie,mainView:a,onViewChange:q=>{l(q),Ze(!1)}}):h.jsx("aside",{className:"w-full h-full rounded-md bg-surface-container-lowest p-4",children:h.jsx("p",{className:"font-mono text-xs text-on-surface-variant",children:e("common.loading")})})}),h.jsxs("div",{className:"flex-1 min-w-0 flex flex-col overflow-hidden",children:[h.jsxs("div",{className:"md:hidden flex-shrink-0 sticky top-0 z-20 flex items-center gap-2 px-3 py-2 bg-surface-container-low border-b border-outline-variant/20",children:[h.jsxs("button",{type:"button",onClick:()=>Ze(q=>!q),className:"flex items-center gap-2 text-on-surface-variant hover:text-on-surface transition-colors",children:[h.jsx("span",{className:"material-symbols-outlined text-[18px]",children:"menu"}),h.jsx("span",{className:"font-mono text-[11px] truncate max-w-[160px]",children:d??(c==null?void 0:c.name)??t})]}),h.jsxs("div",{className:"ml-auto flex items-center gap-1.5",children:[h.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${te?"bg-secondary animate-pulse":"bg-outline/50"}`}),h.jsx("span",{className:"font-mono text-[9px] text-on-surface-variant/60",children:e(te?"chat.live":"chat.disconnected")})]})]}),a==="files"?h.jsx(N$,{agentId:t}):a==="browser"?h.jsx(U$,{agentId:t}):a==="tasks"?h.jsx(I$,{agentId:t}):a==="skills"?h.jsx(j6,{agentId:t}):a==="workflows"?h.jsx(e5,{agentId:t}):a==="schedules"?h.jsx(i5,{agentId:t}):a==="monitor"?h.jsx(s5,{agentId:t}):a==="usage"?h.jsx(m6,{agentId:t}):a==="logs"?h.jsx(C6,{agentId:t}):a==="integrations"?h.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:h.jsx(P6,{agentId:t,secretNames:C,setSecretNames:P})}):n.find(q=>q.id===a)?h.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:(()=>{const q=n.find(de=>de.id===a);return h.jsx(q.component,{agentId:t})})()}):h.jsxs("div",{className:"flex flex-1 flex-col rounded-lg bg-surface-container-lowest overflow-hidden min-w-0",children:[h.jsxs("div",{className:"flex-1 overflow-y-auto p-4 flex flex-col gap-3",children:[p.length===0&&h.jsx("p",{className:"font-mono text-xs text-on-surface-variant m-auto",children:e("chat.emptyConversation")}),p.map(q=>{var de;return h.jsxs("div",{className:`flex flex-col gap-1 ${q.role==="user"?"items-end":"items-start"}`,children:[h.jsx("span",{className:"text-[10px] uppercase tracking-widest text-on-surface-variant font-medium",children:q.role==="user"?e("chat.roleUser"):(c==null?void 0:c.name)??e("chat.roleAgentFallback")}),(((de=q.toolCalls)==null?void 0:de.length)??0)>0&&h.jsx(I6,{toolCalls:q.toolCalls,isStreaming:q.isStreaming}),h.jsx(M6,{active:q.isCompacting,completed:q.compactions}),(q.text||q.isStreaming)&&h.jsx("div",{className:`max-w-[min(36rem,100%)] w-full sm:w-auto rounded-lg px-3 py-2 text-sm leading-relaxed
147
+ ${q.text.startsWith("🛡 Blocked:")?"bg-red-950/40 border border-red-800/50 text-error font-mono text-xs":q.role==="user"?"bg-primary/20 text-on-surface font-mono whitespace-pre-wrap break-words":"bg-surface-container text-on-surface"}
148
+ ${q.isStreaming?"animate-pulse":""}
149
+ `,children:q.text.startsWith("🛡 Blocked:")?q.text:q.role==="user"?q.text||"…":q.text?h.jsx("div",{className:`prose prose-sm dark:prose-invert max-w-none text-on-surface
150
+ prose-p:my-1 prose-headings:mt-3 prose-headings:mb-1
151
+ prose-code:bg-surface-dim prose-code:px-1 prose-code:rounded prose-code:text-xs
152
+ prose-pre:bg-surface-dim prose-pre:text-xs
153
+ prose-ul:my-1 prose-ol:my-1 prose-li:my-0
154
+ prose-a:text-secondary prose-strong:text-on-surface
155
+ prose-table:border-collapse prose-table:text-xs prose-table:w-full
156
+ prose-th:border prose-th:border-outline-variant/40 prose-th:px-2 prose-th:py-1 prose-th:bg-surface-dim prose-th:text-left prose-th:font-medium
157
+ prose-td:border prose-td:border-outline-variant/40 prose-td:px-2 prose-td:py-1`,children:h.jsx(yd,{remarkPlugins:[mC,S$],children:q.text})}):h.jsx(A6,{})})]},q.id)}),h.jsx("div",{ref:j})]}),k&&h.jsxs("div",{"data-testid":"pending-approval",className:"flex items-center gap-3 border-t border-amber-800/50 bg-amber-950/40 px-4 py-3",children:[h.jsx(rf,{className:"h-5 w-5 text-warning flex-shrink-0 animate-pulse"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"font-mono text-xs text-warning font-semibold",children:e("chat.waitingApproval")}),h.jsx("p",{className:"font-mono text-[11px] text-warning/80 mt-0.5",children:k.reason}),h.jsx("p",{className:"font-mono text-[10px] text-amber-500/60 mt-1",children:e("chat.respondInGuardian")})]})]}),h.jsxs("div",{className:"flex gap-2 border-t border-outline-variant/20 p-2 sm:p-3",children:[h.jsx("textarea",{className:"flex-1 min-w-0 rounded bg-surface-container-high px-3 py-2 text-sm text-on-surface placeholder-on-surface-variant outline-none focus:ring-1 focus:ring-primary/40 font-mono resize-none",placeholder:e("chat.messagePlaceholder",{name:d??(c==null?void 0:c.name)??e("chat.roleAgentFallback")}),value:m,onChange:q=>y(q.target.value),onKeyDown:q=>{q.key==="Enter"&&!q.shiftKey&&(q.preventDefault(),R())},disabled:x,rows:Math.min(m.split(`
158
+ `).length,8),style:{minHeight:"2.5rem",maxHeight:"12rem",overflow:"auto"}}),x?h.jsx("button",{onClick:T,className:"rounded bg-red-500/20 px-4 py-2 text-sm font-medium text-red-400 transition-opacity hover:bg-red-500/30",children:e("chat.stop")}):h.jsx("button",{onClick:R,disabled:!m.trim()||!te,className:"rounded bg-primary px-4 py-2 text-sm font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:e("chat.send")})]})]})]}),ee&&a==="chat"&&h.jsxs("div",{"data-testid":"bb-panel",className:`hidden md:flex relative flex-shrink-0 flex-col rounded-lg bg-surface-container-lowest overflow-hidden transition-all duration-200 ${w?"w-96":"w-10"}`,children:[h.jsxs("div",{"data-testid":"guardian-coming-soon-overlay",className:"absolute inset-0 z-20 flex flex-col items-center justify-center bg-surface-container-lowest/90 backdrop-blur-sm rounded-lg",children:[h.jsx(rf,{className:"h-12 w-12 text-warning/30 mb-4"}),w&&h.jsxs(h.Fragment,{children:[h.jsx("p",{className:"font-headline text-lg font-semibold text-on-surface tracking-tight mb-2",children:e("chat.guardian")}),h.jsx("span",{className:"rounded-full bg-warning/10 border border-warning/30 px-3 py-1 font-label text-[10px] font-semibold text-warning uppercase tracking-widest mb-4",children:e("chat.comingSoon")}),h.jsxs("p",{className:"max-w-[260px] text-center font-mono text-[10px] text-on-surface-variant/50 leading-relaxed px-4",children:[e("chat.guardianBlurb1")," ",e("chat.guardianBlurb2")]})]})]}),h.jsxs("div",{className:"flex items-center gap-2 px-3 py-3 border-b border-outline-variant/20",children:[h.jsx(rf,{className:"h-4 w-4 flex-shrink-0 text-on-surface-variant"}),w&&h.jsx(h.Fragment,{children:h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"font-headline text-xs font-semibold text-on-surface truncate",children:"Guardian"}),h.jsx("p",{className:"font-mono text-[9px] text-on-surface-variant",children:e("chat.guardianDisconnected")})]})})]}),w&&h.jsx("div",{className:"flex-1 overflow-hidden p-3 flex flex-col gap-2",children:h.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/20 m-auto text-center leading-relaxed",dangerouslySetInnerHTML:{__html:e("chat.guardianChatBlurb")}})})]})]})}const Oi="rounded bg-surface-container px-3 py-2 text-[12px] text-on-surface placeholder:text-on-surface-variant/60 outline-none focus:ring-1 focus:ring-primary/25 font-mono transition-shadow w-full",yE=Object.fromEntries(cS.map(e=>[e.value,e.label]));function O6({entry:e}){const{t}=we();return h.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[13px] text-on-surface font-semibold",children:e.label??e.provider}),h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/70",children:e.model}),h.jsx("span",{className:"text-success text-[10px] font-mono",children:"✓"})]}),h.jsx("span",{className:"rounded px-2 py-0.5 text-[10px] font-mono bg-primary/10 text-primary",children:"managed"})]}),h.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/60 mt-2",children:t("settings.managedBlurb")})]})}function F6({entry:e,onRemove:t,onReplaceKey:n}){const{t:r}=we(),[i,s]=E.useState(!1),[o,a]=E.useState(e.model),[l,c]=E.useState(""),[u,d]=E.useState(!1),[f,p]=E.useState(null),[g,m]=E.useState(!1);async function y(){if(!l.trim()){p(r("common.apiKeyRequired"));return}d(!0),p(null),m(!1);try{await n(e.provider,o,l.trim()),m(!0),c(""),s(!1)}catch(x){p(x instanceof Error?x.message:r("common.errorSave"))}finally{d(!1)}}return h.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-4 space-y-3",children:[h.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("span",{className:"font-mono text-[13px] text-on-surface font-semibold",children:yE[e.provider]??e.provider}),h.jsx("span",{className:"font-mono text-[10px] text-on-surface-variant/70 ml-2",children:e.model}),h.jsx("span",{className:"ml-2 text-success text-[10px] font-mono",children:"✓"})]}),h.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[!i&&h.jsx("button",{onClick:()=>{s(!0),m(!1)},className:"rounded px-2 py-1 text-[11px] font-mono text-on-surface-variant hover:text-on-surface bg-surface-container transition-colors",children:r("settings.replaceKey")}),h.jsx("button",{onClick:t,className:"rounded px-2 py-1 text-[11px] font-mono text-error/60 hover:text-error hover:bg-error/10 transition-colors",children:r("settings.delete")})]})]}),i&&h.jsxs("div",{className:"space-y-2 pt-1 border-t border-outline-variant/40",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1",children:r("settings.model")}),h.jsx("select",{className:`${Oi} appearance-none`,value:o,onChange:x=>a(x.target.value),children:hd(e.provider).map(x=>h.jsx("option",{value:x.value,children:x.label},x.value))})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1",children:r("settings.newApiKey")}),h.jsx("input",{type:"password",className:Oi,placeholder:r("settings.pasteNewKey"),value:l,onChange:x=>{c(x.target.value),p(null)},autoComplete:"off",autoFocus:!0})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{onClick:y,disabled:u,className:"rounded bg-primary px-3 py-1.5 text-[12px] font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:r(u?"common.saving":"common.save")}),h.jsx("button",{onClick:()=>{s(!1),c(""),p(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:r("common.cancel")}),g&&h.jsx("span",{className:"font-mono text-[11px] text-success",children:r("common.saved")}),f&&h.jsx("span",{className:"font-mono text-[10px] text-error",children:f})]})]})]})}function $6(){const{t:e}=we(),t=os(),[n,r]=E.useState(!0),[i,s]=E.useState([]),[o,a]=E.useState({showWorkspaceDirConfig:!0,showBraveSearchConfig:!0,enableIntegrations:!1}),[l,c]=E.useState(""),[u,d]=E.useState(""),[f,p]=E.useState(""),[g,m]=E.useState(!1),[y,x]=E.useState(null),[v,b]=E.useState(!1),[S,k]=E.useState(""),[_,C]=E.useState(!1),[P,j]=E.useState(null),[w,M]=E.useState(!1),[D,F]=E.useState(!1),[$,I]=E.useState(!1);E.useEffect(()=>{Promise.all([aS(),PR(),lS()]).then(([R,ie,ee])=>{s(R.providers??[]),F(ie.configured),a(ee)}).catch(console.error).finally(()=>r(!1))},[]);const H=i.filter(R=>R.managed),X=i.filter(R=>!R.managed),L=new Set(X.map(R=>R.provider)),B=new Set(H.map(R=>R.provider)),N=cS.filter(R=>!L.has(R.value)&&!B.has(R.value));E.useEffect(()=>{if(N.length>0&&!N.find(R=>R.value===l)){const R=N[0].value;c(R),d(Dp(R))}},[i.length]);function Q(R){c(R),d(Dp(R))}async function te(){if(!l||!u||!f.trim()){x(e("common.allFieldsRequired"));return}m(!0),x(null),b(!1);try{await Gy(l,u,f.trim()),s(R=>[...R.filter(ee=>ee.provider!==l),{provider:l,model:u}]),b(!0),p("")}catch(R){x(R instanceof Error?R.message:e("common.errorSave"))}finally{m(!1)}}async function T(R,ie,ee){await Gy(R,ie,ee),s(Pe=>Pe.map(Ze=>Ze.provider===R&&!Ze.managed?{provider:R,model:ie}:Ze))}async function re(R){confirm(e("settings.removeConfirm",{name:yE[R]??R}))&&(await NR(R),s(ie=>ie.filter(ee=>ee.provider!==R)))}async function le(){if(!S.trim()){j(e("common.apiKeyRequired"));return}C(!0),j(null),M(!1);try{await jR("brave",S.trim()),M(!0),F(!0),k(""),I(!1)}catch(R){j(R instanceof Error?R.message:e("common.errorSave"))}finally{C(!1)}}async function ae(){C(!0),j(null);try{await TR(),F(!1),k(""),M(!1),I(!1)}catch(R){j(R instanceof Error?R.message:e("common.errorReset"))}finally{C(!1)}}return n?h.jsx("div",{className:"text-on-surface-variant/70 font-mono text-xs p-8",children:e("common.loading")}):h.jsxs("div",{className:"max-w-2xl mx-auto py-6 sm:py-8 px-4",children:[h.jsxs("button",{type:"button",onClick:()=>t(-1),className:"flex items-center gap-1.5 mb-6 font-mono text-[12px] text-on-surface-variant hover:text-on-surface transition-colors",children:[h.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_back"}),e("settings.backToAgent")]}),h.jsxs("div",{className:"mb-8",children:[h.jsxs("h1",{className:"font-headline text-4xl font-bold text-on-surface",children:[h.jsx("span",{className:"highlight-marker",children:e("settings.titleHighlight")})," ",e("settings.titleSuffix")]}),h.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant mt-2",children:e("settings.blurb")})]}),H.length>0&&h.jsx("div",{className:"space-y-2 mb-4",children:H.map(R=>h.jsx(O6,{entry:R},`managed-${R.provider}`))}),X.length===0&&H.length===0?h.jsx("p",{className:"font-mono text-[11px] text-warning/80 mb-4",children:e("settings.noProvidersWarning")}):X.length>0?h.jsx("div",{className:"space-y-2 mb-6",children:X.map(R=>h.jsx(F6,{entry:R,onRemove:()=>re(R.provider),onReplaceKey:T},R.provider))}):null,N.length>0&&h.jsxs("div",{className:"rounded-lg bg-surface-container-lowest border border-outline-variant/40 p-5 space-y-4",children:[h.jsx("p",{className:"text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium",children:e("settings.addProvider")}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:e("settings.provider")}),h.jsx("select",{className:`${Oi} appearance-none`,value:l,onChange:R=>Q(R.target.value),children:N.map(R=>h.jsx("option",{value:R.value,children:R.label},R.value))})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:e("settings.model")}),h.jsx("select",{className:`${Oi} appearance-none`,value:u,onChange:R=>d(R.target.value),children:hd(l).map(R=>h.jsx("option",{value:R.value,children:R.label},R.value))})]})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-[10px] uppercase tracking-[0.14em] text-on-surface-variant font-medium mb-1.5",children:e("settings.apiKey")}),h.jsx("input",{type:"password",className:Oi,placeholder:e("settings.pasteApiKey"),value:f,onChange:R=>{p(R.target.value),x(null),b(!1)},autoComplete:"off"})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("button",{onClick:te,disabled:g||!f.trim(),className:"rounded bg-primary px-4 py-2 text-sm font-medium text-on-primary transition-opacity disabled:opacity-40 hover:opacity-90",children:e(g?"common.adding":"common.add")}),v&&h.jsx("span",{className:"font-mono text-[11px] text-success",children:e("settings.added")}),y&&h.jsx("span",{className:"font-mono text-[10px] text-error",children:y})]})]}),h.jsxs("div",{className:"mt-8 pt-8 border-t border-outline-variant/40",children:[h.jsx("h2",{className:"font-headline text-2xl font-bold text-on-surface mb-1",children:e("settings.webSearch")}),o.showBraveSearchConfig?h.jsxs(h.Fragment,{children:[h.jsxs("p",{className:"font-mono text-[11px] text-on-surface-variant/70 mb-6",children:[e("settings.braveBlurbPrefix")," ",D?h.jsx("span",{className:"text-success",children:e("settings.configured")}):h.jsx("span",{className:"text-warning",children:e("settings.notConfigured")})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block font-mono text-[11px] text-on-surface-variant mb-1",children:e("settings.braveKeyLabel")}),D&&!$?h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"password",className:Oi,value:"••••••••••••••••••••",readOnly:!0}),h.jsx("button",{type:"button",onClick:()=>{I(!0),M(!1)},className:"shrink-0 rounded px-3 py-2 text-[11px] font-mono text-on-surface-variant hover:text-on-surface bg-surface-container transition-colors",children:e("common.replace")})]}):h.jsx("input",{type:"password",className:Oi,placeholder:e("settings.enterBraveKey"),value:S,onChange:R=>{k(R.target.value),M(!1)},autoComplete:"off",autoFocus:$})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[(!D||$)&&h.jsx("button",{onClick:le,disabled:_||!S.trim(),className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-on-primary transition-opacity hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",children:e(_?"common.saving":"common.save")}),$&&h.jsx("button",{onClick:()=>{I(!1),k(""),j(null)},className:"rounded px-3 py-1.5 text-[12px] font-mono text-on-surface-variant hover:text-on-surface transition-colors",children:e("common.cancel")}),D&&h.jsx("button",{onClick:ae,disabled:_,className:"rounded px-3 py-2 text-[12px] font-mono text-on-surface-variant hover:text-error hover:bg-error/10 transition-colors disabled:opacity-40",children:e("common.delete")}),w&&h.jsx("span",{className:"font-mono text-[11px] text-success",children:e("common.saved")}),P&&h.jsx("span",{className:"font-mono text-[10px] text-error",children:P})]})]})]}):h.jsxs("p",{className:"font-mono text-[11px] text-on-surface-variant/70 mt-2",children:[e("settings.braveManagedBlurb")," ",h.jsx("span",{className:"text-success",children:e("settings.active")})]})]})]})}const z6=1280,B6=800,k_=500,S_=5,C_={Backspace:8,Tab:9,Enter:13,Shift:16,Control:17,Alt:18,Pause:19,CapsLock:20,Escape:27,PageUp:33,PageDown:34,End:35,Home:36,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Insert:45,Delete:46,Meta:91,ContextMenu:93,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123};function W6(){const{t:e}=we(),{token:t}=Zf(),[n,r]=E.useState(null),[i,s]=E.useState(!1),[o,a]=E.useState(null),[l,c]=E.useState(null),[u,d]=E.useState(!1),[f,p]=E.useState(!1),[g,m]=E.useState(""),[y,x]=E.useState(""),[v,b]=E.useState(""),[S,k]=E.useState(""),[_,C]=E.useState(!1),P=E.useRef(null),j=E.useRef(null),w=E.useRef(null),M=E.useRef(null),D=E.useRef({time:0,x:0,y:0});E.useEffect(()=>{t&&fetch(`/api/takeover/${t}`).then(R=>R.status===404?(s(!0),null):R.json()).then(R=>{R&&(r(R),R.url&&x(R.url))}).catch(()=>s(!0))},[t]),E.useEffect(()=>{if(!n)return;const R=new WebSocket(oS(n.agentId,n.sessionId));return j.current=R,R.onmessage=ie=>{try{const ee=JSON.parse(ie.data);ee.type==="frame"&&ee.data?(a(`data:image/jpeg;base64,${ee.data}`),c(null)):ee.type==="unavailable"?(c(ee.reason??"unknown"),a(null)):(ee.type==="attached"||ee.type==="tab_changed"||ee.type==="url_changed")&&(ee.url&&/^https?:\/\//i.test(ee.url)&&x(ee.url),ee.title&&b(ee.title),c(null))}catch{}},()=>{R.onmessage=null,R.close()}},[n]),E.useEffect(()=>{var R;(R=w.current)==null||R.focus()},[n]);const F=E.useCallback(R=>{var ie;((ie=j.current)==null?void 0:ie.readyState)===WebSocket.OPEN&&j.current.send(JSON.stringify(R))},[]);E.useEffect(()=>{_||k(y||(n==null?void 0:n.url)||"")},[y,n==null?void 0:n.url,_]);const $=E.useCallback(()=>{const R=S.trim();if(!R)return;const ie=/^https?:\/\//i.test(R)?R:`https://${R}`;F({type:"navigate",url:ie}),x(ie)},[S,F]),I=E.useCallback((R,ie)=>{const ee=P.current;if(!ee)return{x:0,y:0};const Pe=ee.getBoundingClientRect();if(Pe.width===0||Pe.height===0)return{x:0,y:0};const Ze=ee.naturalWidth||z6,xt=ee.naturalHeight||B6,q=Math.max(0,Math.min(Pe.width,R-Pe.left)),de=Math.max(0,Math.min(Pe.height,ie-Pe.top));return{x:Math.round(q/Pe.width*Ze),y:Math.round(de/Pe.height*xt)}},[]),H=E.useCallback(R=>(R.shiftKey?8:0)|(R.ctrlKey?2:0)|(R.altKey?1:0)|(R.metaKey?4:0),[]),X=R=>R===2?"right":R===1?"middle":"left",L=R=>{const{x:ie,y:ee}=I(R.clientX,R.clientY);F({type:"mouse",eventType:"mouseMoved",x:ie,y:ee,button:M.current??"none",clickCount:0,modifiers:H(R.nativeEvent)})},B=R=>{var be;(be=w.current)==null||be.focus();const{x:ie,y:ee}=I(R.clientX,R.clientY),Pe=X(R.button),Ze=Date.now(),xt=Ze-D.current.time,q=Math.abs(ie-D.current.x),de=Math.abs(ee-D.current.y),ke=xt<k_&&q<S_&&de<S_?2:1;D.current={time:Ze,x:ie,y:ee},M.current=Pe,F({type:"mouse",eventType:"mousePressed",x:ie,y:ee,button:Pe,clickCount:ke,modifiers:H(R.nativeEvent)})},N=R=>{const{x:ie,y:ee}=I(R.clientX,R.clientY),Pe=X(R.button),Ze=D.current.time===0?1:Date.now()-D.current.time<k_?2:1;M.current=null,F({type:"mouse",eventType:"mouseReleased",x:ie,y:ee,button:Pe,clickCount:Ze,modifiers:H(R.nativeEvent)})},Q=()=>{M.current&&(M.current=null)},te=R=>{F({type:"scroll",...I(R.clientX,R.clientY),deltaY:R.deltaY})},T=R=>{var ee;if(((ee=R.target)==null?void 0:ee.tagName)==="INPUT")return;R.preventDefault();const ie=C_[R.key];R.key.length===1?(F({type:"key",eventType:"rawKeyDown",key:R.key,code:R.code,modifiers:H(R.nativeEvent),windowsVirtualKeyCode:R.key.toUpperCase().charCodeAt(0)}),!R.ctrlKey&&!R.metaKey&&F({type:"insertText",text:R.key})):F({type:"key",eventType:"rawKeyDown",key:R.key,code:R.code,modifiers:H(R.nativeEvent),windowsVirtualKeyCode:ie??0})},re=R=>{var ee;if(((ee=R.target)==null?void 0:ee.tagName)==="INPUT")return;const ie=R.key.length===1?R.key.toUpperCase().charCodeAt(0):C_[R.key]??0;F({type:"key",eventType:"keyUp",key:R.key,code:R.code,modifiers:H(R.nativeEvent),windowsVirtualKeyCode:ie})},le=R=>{var ee;if(((ee=R.target)==null?void 0:ee.tagName)==="INPUT")return;R.preventDefault();const ie=R.clipboardData.getData("text/plain");ie&&F({type:"insertText",text:ie})},ae=async()=>{var R;if(!(!t||f)){p(!0);try{await fetch(`/api/takeover/${t}/resolve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({note:g.trim()||void 0})}),(R=j.current)==null||R.close(),d(!0)}catch{p(!1)}}};return i?h.jsx("div",{className:"flex h-screen items-center justify-center bg-background font-body text-on-surface px-6",children:h.jsxs("div",{className:"text-center max-w-md",children:[h.jsx("p",{className:"text-[11px] font-label uppercase tracking-[0.15em] text-secondary/70 mb-2",children:e("takeover.sessionExpiredLabel")}),h.jsx("h1",{className:"font-headline text-[32px] leading-tight text-on-surface mb-3",children:e("takeover.sessionExpired")}),h.jsx("p",{className:"text-[15px] leading-relaxed text-on-surface-variant italic",children:e("takeover.sessionExpiredBlurb")})]})}):u?h.jsx("div",{className:"flex h-screen items-center justify-center bg-background font-body text-on-surface px-6",children:h.jsxs("div",{className:"text-center max-w-md",children:[h.jsx("p",{className:"text-[11px] font-label uppercase tracking-[0.15em] text-primary/70 mb-2",children:e("takeover.completeLabel")}),h.jsx("h1",{className:"font-headline text-[32px] leading-tight text-on-surface mb-3",children:e("takeover.controlReturned")}),h.jsx("p",{className:"text-[15px] leading-relaxed text-on-surface-variant italic",children:e("takeover.closeTab")})]})}):n?h.jsxs("div",{className:"flex flex-col h-screen bg-background font-body text-on-surface overflow-hidden",children:[h.jsxs("div",{className:"flex items-start gap-4 px-8 py-5 bg-surface-container-low flex-shrink-0",children:[h.jsx("div",{className:"flex-shrink-0 mt-1 w-7 h-7 rounded-full bg-primary-fixed flex items-center justify-center",children:h.jsx("span",{className:"font-headline italic text-[15px] text-primary",children:"!"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-[10px] font-label uppercase tracking-[0.15em] text-primary/70 mb-1",children:e("takeover.agentNeedsHelp")}),h.jsx("p",{className:"font-headline text-[17px] leading-snug text-on-surface",children:n.reason})]})]}),h.jsxs("div",{className:"flex items-center gap-3 px-6 py-3 bg-surface-container flex-shrink-0",children:[h.jsxs("div",{className:"flex gap-1.5 flex-shrink-0",children:[h.jsx("span",{className:"w-3 h-3 rounded-full bg-secondary/60"}),h.jsx("span",{className:"w-3 h-3 rounded-full bg-tertiary-fixed"}),h.jsx("span",{className:"w-3 h-3 rounded-full bg-primary/40"})]}),h.jsxs("div",{className:"flex-1 flex items-center gap-2 bg-surface-container-lowest rounded-md px-3 py-1.5 min-w-0",children:[h.jsx("span",{className:"text-[11px] text-primary flex-shrink-0","aria-hidden":!0,children:"∎"}),h.jsx("input",{type:"text",value:S,onChange:R=>k(R.target.value),onFocus:R=>{C(!0),R.target.select()},onBlur:()=>C(!1),onKeyDown:R=>{R.stopPropagation(),R.key==="Enter"?(R.preventDefault(),$(),R.currentTarget.blur()):R.key==="Escape"&&(R.preventDefault(),k(y||n.url||""),R.currentTarget.blur())},onKeyUp:R=>R.stopPropagation(),onPaste:R=>R.stopPropagation(),placeholder:e("takeover.urlBarPlaceholder"),spellCheck:!1,autoComplete:"off",className:"flex-1 min-w-0 bg-transparent outline-none text-[12px] font-mono text-on-surface placeholder:text-on-surface-variant/50"}),v&&!_&&h.jsxs("span",{className:"text-[11px] font-body italic text-on-surface-variant/70 flex-shrink-0 hidden md:inline",children:["— ",v]})]}),h.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-secondary animate-pulse"}),h.jsx("span",{className:"text-[10px] font-label uppercase tracking-[0.15em] text-secondary",children:e("takeover.liveLabel")})]})]}),h.jsx("div",{ref:w,tabIndex:0,className:"flex-1 flex items-center justify-center overflow-hidden outline-none cursor-default bg-surface-container-highest",onMouseMove:L,onMouseDown:B,onMouseUp:N,onMouseLeave:Q,onWheel:te,onKeyDown:T,onKeyUp:re,onPaste:le,onContextMenu:R=>R.preventDefault(),children:o&&!l?h.jsx("img",{ref:P,src:o,alt:"live browser",className:"max-w-full max-h-full object-contain select-none",draggable:!1,style:{pointerEvents:"none"}}):h.jsx("p",{className:"font-mono text-[10px] text-on-surface-variant/50 animate-pulse",children:e(l==="no_suitable_target"?"takeover.browserNotReady":l?"takeover.browserStarting":"takeover.waitingStream")})}),h.jsxs("div",{className:"flex items-end gap-4 px-8 py-5 bg-surface-container-low flex-shrink-0",children:[h.jsxs("div",{className:"flex-1 flex flex-col",children:[h.jsxs("label",{className:"text-[10px] font-label uppercase tracking-[0.15em] text-on-surface-variant/70 mb-1",children:[e("takeover.whatDidYouDo")," ",h.jsx("span",{className:"italic text-on-surface-variant/50",children:e("takeover.optional")})]}),h.jsx("input",{type:"text",value:g,onChange:R=>m(R.target.value),onKeyDown:R=>{R.key==="Enter"&&!R.shiftKey&&(R.preventDefault(),ae())},placeholder:e("takeover.describeActionPlaceholder"),disabled:f,className:"bg-transparent border-0 border-b border-outline-variant/30 focus:border-primary focus:outline-none font-body text-[15px] text-on-surface placeholder:text-on-surface-variant/40 placeholder:italic px-0 py-2 disabled:opacity-50"})]}),h.jsx("button",{onClick:ae,disabled:f,className:"flex-shrink-0 rounded-sm bg-primary text-on-primary font-label text-[11px] uppercase tracking-[0.15em] px-5 py-3 hover:bg-primary/90 transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:e(f?"takeover.returning":"takeover.completed")})]})]}):h.jsx("div",{className:"flex h-screen items-center justify-center bg-background font-body",children:h.jsx("p",{className:"font-mono text-[11px] text-on-surface-variant/60 animate-pulse",children:e("takeover.connecting")})})}function H6(){const e=ss();return E.useEffect(()=>{Mp("page_viewed",{path:e.pathname})},[e.pathname]),h.jsxs(Vj,{children:[h.jsx(zr,{path:"takeover/:token",element:h.jsx(W6,{})}),h.jsxs(zr,{element:h.jsx(qM,{}),children:[h.jsx(zr,{index:!0,element:h.jsx(wv,{to:"/dashboard",replace:!0})}),h.jsx(zr,{path:"dashboard",element:h.jsx(DR,{})}),h.jsx(zr,{path:"agents/:id/*",element:h.jsx(L6,{})}),h.jsx(zr,{path:"settings",element:h.jsx($6,{})}),h.jsx(zr,{path:"*",element:h.jsx(wv,{to:"/dashboard",replace:!0})})]})]})}rM();window.__granclaw={React:xg,useState:E.useState,useEffect:E.useEffect,useCallback:E.useCallback,useRef:E.useRef,registerView:C$};sf.createRoot(document.getElementById("root")).render(h.jsx(xg.StrictMode,{children:h.jsx(VM,{children:h.jsx(Jj,{children:h.jsx(H6,{})})})}));fetch("/ext/index.js").then(e=>{if(!(!e.ok||!(e.headers.get("content-type")||"").includes("javascript")))return e.text()}).then(e=>{if(!e)return;const t=document.createElement("script");t.textContent=e,document.head.appendChild(t)}).catch(()=>{});