yamchart 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,165 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginPage-BrI0Po1-.js","assets/echarts-DtOYsfLX.js","assets/SetupWizard-DR7B3Vpm.js","assets/UserManagement-D8OUccL0.js","assets/ShareManagement-DyIWeXEC.js","assets/PublicViewer-DNmvz77v.js"])))=>i.map(i=>d[i]);
2
- var rw=Object.defineProperty;var ry=e=>{throw TypeError(e)};var sw=(e,t,n)=>t in e?rw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var we=(e,t,n)=>sw(e,typeof t!="symbol"?t+"":t,n),Jf=(e,t,n)=>t.has(e)||ry("Cannot "+n);var Y=(e,t,n)=>(Jf(e,t,"read from private field"),n?n.call(e):t.get(e)),Se=(e,t,n)=>t.has(e)?ry("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ye=(e,t,n,r)=>(Jf(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),We=(e,t,n)=>(Jf(e,t,"access private method"),n);var lc=(e,t,n,r)=>({set _(a){ye(e,t,a,n)},get _(){return Y(e,t,r)}});import{r as si,a as I,R as xe,E as aw,g as Hb}from"./echarts-DtOYsfLX.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();var Zf={exports:{}},tu={};/**
3
- * @license React
4
- * react-jsx-runtime.production.min.js
5
- *
6
- * Copyright (c) Facebook, Inc. and its affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var sy;function iw(){if(sy)return tu;sy=1;var e=si(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function u(c,d,f){var p,g={},x=null,E=null;f!==void 0&&(x=""+f),d.key!==void 0&&(x=""+d.key),d.ref!==void 0&&(E=d.ref);for(p in d)r.call(d,p)&&!o.hasOwnProperty(p)&&(g[p]=d[p]);if(c&&c.defaultProps)for(p in d=c.defaultProps,d)g[p]===void 0&&(g[p]=d[p]);return{$$typeof:t,type:c,key:x,ref:E,props:g,_owner:a.current}}return tu.Fragment=n,tu.jsx=u,tu.jsxs=u,tu}var ay;function ow(){return ay||(ay=1,Zf.exports=iw()),Zf.exports}var m=ow(),cc={},eh={exports:{}},Vn={},th={exports:{}},nh={};/**
11
- * @license React
12
- * scheduler.production.min.js
13
- *
14
- * Copyright (c) Facebook, Inc. and its affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var iy;function uw(){return iy||(iy=1,(function(e){function t(G,ee){var D=G.length;G.push(ee);e:for(;0<D;){var ue=D-1>>>1,ae=G[ue];if(0<a(ae,ee))G[ue]=ee,G[D]=ae,D=ue;else break e}}function n(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var ee=G[0],D=G.pop();if(D!==ee){G[0]=D;e:for(var ue=0,ae=G.length,U=ae>>>1;ue<U;){var Ee=2*(ue+1)-1,De=G[Ee],ve=Ee+1,ze=G[ve];if(0>a(De,D))ve<ae&&0>a(ze,De)?(G[ue]=ze,G[ve]=D,ue=ve):(G[ue]=De,G[Ee]=D,ue=Ee);else if(ve<ae&&0>a(ze,D))G[ue]=ze,G[ve]=D,ue=ve;else break e}}return ee}function a(G,ee){var D=G.sortIndex-ee.sortIndex;return D!==0?D:G.id-ee.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,c=u.now();e.unstable_now=function(){return u.now()-c}}var d=[],f=[],p=1,g=null,x=3,E=!1,_=!1,S=!1,w=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(G){for(var ee=n(f);ee!==null;){if(ee.callback===null)r(f);else if(ee.startTime<=G)r(f),ee.sortIndex=ee.expirationTime,t(d,ee);else break;ee=n(f)}}function L(G){if(S=!1,O(G),!_)if(n(d)!==null)_=!0,K(B);else{var ee=n(f);ee!==null&&Z(L,ee.startTime-G)}}function B(G,ee){_=!1,S&&(S=!1,T(R),R=-1),E=!0;var D=x;try{for(O(ee),g=n(d);g!==null&&(!(g.expirationTime>ee)||G&&!P());){var ue=g.callback;if(typeof ue=="function"){g.callback=null,x=g.priorityLevel;var ae=ue(g.expirationTime<=ee);ee=e.unstable_now(),typeof ae=="function"?g.callback=ae:g===n(d)&&r(d),O(ee)}else r(d);g=n(d)}if(g!==null)var U=!0;else{var Ee=n(f);Ee!==null&&Z(L,Ee.startTime-ee),U=!1}return U}finally{g=null,x=D,E=!1}}var k=!1,N=null,R=-1,j=5,M=-1;function P(){return!(e.unstable_now()-M<j)}function F(){if(N!==null){var G=e.unstable_now();M=G;var ee=!0;try{ee=N(!0,G)}finally{ee?W():(k=!1,N=null)}}else k=!1}var W;if(typeof C=="function")W=function(){C(F)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,J=V.port2;V.port1.onmessage=F,W=function(){J.postMessage(null)}}else W=function(){w(F,0)};function K(G){N=G,k||(k=!0,W())}function Z(G,ee){R=w(function(){G(e.unstable_now())},ee)}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(G){G.callback=null},e.unstable_continueExecution=function(){_||E||(_=!0,K(B))},e.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<G?Math.floor(1e3/G):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(G){switch(x){case 1:case 2:case 3:var ee=3;break;default:ee=x}var D=x;x=ee;try{return G()}finally{x=D}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(G,ee){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var D=x;x=G;try{return ee()}finally{x=D}},e.unstable_scheduleCallback=function(G,ee,D){var ue=e.unstable_now();switch(typeof D=="object"&&D!==null?(D=D.delay,D=typeof D=="number"&&0<D?ue+D:ue):D=ue,G){case 1:var ae=-1;break;case 2:ae=250;break;case 5:ae=1073741823;break;case 4:ae=1e4;break;default:ae=5e3}return ae=D+ae,G={id:p++,callback:ee,priorityLevel:G,startTime:D,expirationTime:ae,sortIndex:-1},D>ue?(G.sortIndex=D,t(f,G),n(d)===null&&G===n(f)&&(S?(T(R),R=-1):S=!0,Z(L,D-ue))):(G.sortIndex=ae,t(d,G),_||E||(_=!0,K(B))),G},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(G){var ee=x;return function(){var D=x;x=ee;try{return G.apply(this,arguments)}finally{x=D}}}})(nh)),nh}var oy;function lw(){return oy||(oy=1,th.exports=uw()),th.exports}/**
19
- * @license React
20
- * react-dom.production.min.js
21
- *
22
- * Copyright (c) Facebook, Inc. and its affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var uy;function cw(){if(uy)return Vn;uy=1;var e=si(),t=lw();function n(s){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+s,l=1;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l]);return"Minified React error #"+s+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function o(s,i){u(s,i),u(s+"Capture",i)}function u(s,i){for(a[s]=i,s=0;s<i.length;s++)r.add(i[s])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[: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]*$/,p={},g={};function x(s){return d.call(g,s)?!0:d.call(p,s)?!1:f.test(s)?g[s]=!0:(p[s]=!0,!1)}function E(s,i,l,h){if(l!==null&&l.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return h?!1:l!==null?!l.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function _(s,i,l,h){if(i===null||typeof i>"u"||E(s,i,l,h))return!0;if(h)return!1;if(l!==null)switch(l.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function S(s,i,l,h,b,v,A){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=h,this.attributeNamespace=b,this.mustUseProperty=l,this.propertyName=s,this.type=i,this.sanitizeURL=v,this.removeEmptyString=A}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){w[s]=new S(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var i=s[0];w[i]=new S(i,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){w[s]=new S(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){w[s]=new S(s,2,!1,s,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(s){w[s]=new S(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){w[s]=new S(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){w[s]=new S(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){w[s]=new S(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){w[s]=new S(s,5,!1,s.toLowerCase(),null,!1,!1)});var T=/[\-:]([a-z])/g;function C(s){return s[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(s){var i=s.replace(T,C);w[i]=new S(i,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var i=s.replace(T,C);w[i]=new S(i,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var i=s.replace(T,C);w[i]=new S(i,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){w[s]=new S(s,1,!1,s.toLowerCase(),null,!1,!1)}),w.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){w[s]=new S(s,1,!1,s.toLowerCase(),null,!0,!0)});function O(s,i,l,h){var b=w.hasOwnProperty(i)?w[i]:null;(b!==null?b.type!==0:h||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(_(i,l,b,h)&&(l=null),h||b===null?x(i)&&(l===null?s.removeAttribute(i):s.setAttribute(i,""+l)):b.mustUseProperty?s[b.propertyName]=l===null?b.type===3?!1:"":l:(i=b.attributeName,h=b.attributeNamespace,l===null?s.removeAttribute(i):(b=b.type,l=b===3||b===4&&l===!0?"":""+l,h?s.setAttributeNS(h,i,l):s.setAttribute(i,l))))}var L=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,B=Symbol.for("react.element"),k=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),M=Symbol.for("react.provider"),P=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),W=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),Z=Symbol.for("react.offscreen"),G=Symbol.iterator;function ee(s){return s===null||typeof s!="object"?null:(s=G&&s[G]||s["@@iterator"],typeof s=="function"?s:null)}var D=Object.assign,ue;function ae(s){if(ue===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);ue=i&&i[1]||""}return`
27
- `+ue+s}var U=!1;function Ee(s,i){if(!s||U)return"";U=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(se){var h=se}Reflect.construct(s,[],i)}else{try{i.call()}catch(se){h=se}s.call(i.prototype)}else{try{throw Error()}catch(se){h=se}s()}}catch(se){if(se&&h&&typeof se.stack=="string"){for(var b=se.stack.split(`
28
- `),v=h.stack.split(`
29
- `),A=b.length-1,q=v.length-1;1<=A&&0<=q&&b[A]!==v[q];)q--;for(;1<=A&&0<=q;A--,q--)if(b[A]!==v[q]){if(A!==1||q!==1)do if(A--,q--,0>q||b[A]!==v[q]){var Q=`
30
- `+b[A].replace(" at new "," at ");return s.displayName&&Q.includes("<anonymous>")&&(Q=Q.replace("<anonymous>",s.displayName)),Q}while(1<=A&&0<=q);break}}}finally{U=!1,Error.prepareStackTrace=l}return(s=s?s.displayName||s.name:"")?ae(s):""}function De(s){switch(s.tag){case 5:return ae(s.type);case 16:return ae("Lazy");case 13:return ae("Suspense");case 19:return ae("SuspenseList");case 0:case 2:case 15:return s=Ee(s.type,!1),s;case 11:return s=Ee(s.type.render,!1),s;case 1:return s=Ee(s.type,!0),s;default:return""}}function ve(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case N:return"Fragment";case k:return"Portal";case j:return"Profiler";case R:return"StrictMode";case W:return"Suspense";case V:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case P:return(s.displayName||"Context")+".Consumer";case M:return(s._context.displayName||"Context")+".Provider";case F:var i=s.render;return s=s.displayName,s||(s=i.displayName||i.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case J:return i=s.displayName||null,i!==null?i:ve(s.type)||"Memo";case K:i=s._payload,s=s._init;try{return ve(s(i))}catch{}}return null}function ze(s){var i=s.type;switch(s.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=i.render,s=s.displayName||s.name||"",i.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ve(i);case 8:return i===R?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function Ue(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Le(s){var i=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Ge(s){var i=Le(s)?"checked":"value",l=Object.getOwnPropertyDescriptor(s.constructor.prototype,i),h=""+s[i];if(!s.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var b=l.get,v=l.set;return Object.defineProperty(s,i,{configurable:!0,get:function(){return b.call(this)},set:function(A){h=""+A,v.call(this,A)}}),Object.defineProperty(s,i,{enumerable:l.enumerable}),{getValue:function(){return h},setValue:function(A){h=""+A},stopTracking:function(){s._valueTracker=null,delete s[i]}}}}function Fe(s){s._valueTracker||(s._valueTracker=Ge(s))}function Rt(s){if(!s)return!1;var i=s._valueTracker;if(!i)return!0;var l=i.getValue(),h="";return s&&(h=Le(s)?s.checked?"true":"false":s.value),s=h,s!==l?(i.setValue(s),!0):!1}function Et(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Cn(s,i){var l=i.checked;return D({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??s._wrapperState.initialChecked})}function $t(s,i){var l=i.defaultValue==null?"":i.defaultValue,h=i.checked!=null?i.checked:i.defaultChecked;l=Ue(i.value!=null?i.value:l),s._wrapperState={initialChecked:h,initialValue:l,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function gt(s,i){i=i.checked,i!=null&&O(s,"checked",i,!1)}function Lt(s,i){gt(s,i);var l=Ue(i.value),h=i.type;if(l!=null)h==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+l):s.value!==""+l&&(s.value=""+l);else if(h==="submit"||h==="reset"){s.removeAttribute("value");return}i.hasOwnProperty("value")?it(s,i.type,l):i.hasOwnProperty("defaultValue")&&it(s,i.type,Ue(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(s.defaultChecked=!!i.defaultChecked)}function er(s,i,l){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var h=i.type;if(!(h!=="submit"&&h!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+s._wrapperState.initialValue,l||i===s.value||(s.value=i),s.defaultValue=i}l=s.name,l!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,l!==""&&(s.name=l)}function it(s,i,l){(i!=="number"||Et(s.ownerDocument)!==s)&&(l==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+l&&(s.defaultValue=""+l))}var nt=Array.isArray;function vt(s,i,l,h){if(s=s.options,i){i={};for(var b=0;b<l.length;b++)i["$"+l[b]]=!0;for(l=0;l<s.length;l++)b=i.hasOwnProperty("$"+s[l].value),s[l].selected!==b&&(s[l].selected=b),b&&h&&(s[l].defaultSelected=!0)}else{for(l=""+Ue(l),i=null,b=0;b<s.length;b++){if(s[b].value===l){s[b].selected=!0,h&&(s[b].defaultSelected=!0);return}i!==null||s[b].disabled||(i=s[b])}i!==null&&(i.selected=!0)}}function Dt(s,i){if(i.dangerouslySetInnerHTML!=null)throw Error(n(91));return D({},i,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function ln(s,i){var l=i.value;if(l==null){if(l=i.children,i=i.defaultValue,l!=null){if(i!=null)throw Error(n(92));if(nt(l)){if(1<l.length)throw Error(n(93));l=l[0]}i=l}i==null&&(i=""),l=i}s._wrapperState={initialValue:Ue(l)}}function tr(s,i){var l=Ue(i.value),h=Ue(i.defaultValue);l!=null&&(l=""+l,l!==s.value&&(s.value=l),i.defaultValue==null&&s.defaultValue!==l&&(s.defaultValue=l)),h!=null&&(s.defaultValue=""+h)}function cn(s){var i=s.textContent;i===s._wrapperState.initialValue&&i!==""&&i!==null&&(s.value=i)}function oe(s){switch(s){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 me(s,i){return s==null||s==="http://www.w3.org/1999/xhtml"?oe(i):s==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var Ae,Ye=(function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,l,h,b){MSApp.execUnsafeLocalFunction(function(){return s(i,l,h,b)})}:s})(function(s,i){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=i;else{for(Ae=Ae||document.createElement("div"),Ae.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=Ae.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;i.firstChild;)s.appendChild(i.firstChild)}});function Xe(s,i){if(i){var l=s.firstChild;if(l&&l===s.lastChild&&l.nodeType===3){l.nodeValue=i;return}}s.textContent=i}var yt={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},Vt=["Webkit","ms","Moz","O"];Object.keys(yt).forEach(function(s){Vt.forEach(function(i){i=i+s.charAt(0).toUpperCase()+s.substring(1),yt[i]=yt[s]})});function an(s,i,l){return i==null||typeof i=="boolean"||i===""?"":l||typeof i!="number"||i===0||yt.hasOwnProperty(s)&&yt[s]?(""+i).trim():i+"px"}function kn(s,i){s=s.style;for(var l in i)if(i.hasOwnProperty(l)){var h=l.indexOf("--")===0,b=an(l,i[l],h);l==="float"&&(l="cssFloat"),h?s.setProperty(l,b):s[l]=b}}var Hn=D({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 Mt(s,i){if(i){if(Hn[s]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(n(137,s));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(n(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(n(61))}if(i.style!=null&&typeof i.style!="object")throw Error(n(62))}}function bt(s,i){if(s.indexOf("-")===-1)return typeof i.is=="string";switch(s){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 dn=null;function Cr(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Pe=null,Ke=null,be=null;function ke(s){if(s=Ho(s)){if(typeof Pe!="function")throw Error(n(280));var i=s.stateNode;i&&(i=Sl(i),Pe(s.stateNode,s.type,i))}}function et(s){Ke?be?be.push(s):be=[s]:Ke=s}function _e(){if(Ke){var s=Ke,i=be;if(be=Ke=null,ke(s),i)for(s=0;s<i.length;s++)ke(i[s])}}function Pt(s,i){return s(i)}function Qt(){}var Gt=!1;function Ft(s,i,l){if(Gt)return s(i,l);Gt=!0;try{return Pt(s,i,l)}finally{Gt=!1,(Ke!==null||be!==null)&&(Qt(),_e())}}function Xt(s,i){var l=s.stateNode;if(l===null)return null;var h=Sl(l);if(h===null)return null;l=h[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(s=s.type,h=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!h;break e;default:s=!1}if(s)return null;if(l&&typeof l!="function")throw Error(n(231,i,typeof l));return l}var _n=!1;if(c)try{var Un={};Object.defineProperty(Un,"passive",{get:function(){_n=!0}}),window.addEventListener("test",Un,Un),window.removeEventListener("test",Un,Un)}catch{_n=!1}function Ur(s,i,l,h,b,v,A,q,Q){var se=Array.prototype.slice.call(arguments,3);try{i.apply(l,se)}catch(de){this.onError(de)}}var Ne=!1,Ve=null,je=!1,rt=null,dt={onError:function(s){Ne=!0,Ve=s}};function ot(s,i,l,h,b,v,A,q,Q){Ne=!1,Ve=null,Ur.apply(dt,arguments)}function Tt(s,i,l,h,b,v,A,q,Q){if(ot.apply(this,arguments),Ne){if(Ne){var se=Ve;Ne=!1,Ve=null}else throw Error(n(198));je||(je=!0,rt=se)}}function wt(s){var i=s,l=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(l=i.return),s=i.return;while(s)}return i.tag===3?l:null}function xt(s){if(s.tag===13){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null}function fn(s){if(wt(s)!==s)throw Error(n(188))}function di(s){var i=s.alternate;if(!i){if(i=wt(s),i===null)throw Error(n(188));return i!==s?null:s}for(var l=s,h=i;;){var b=l.return;if(b===null)break;var v=b.alternate;if(v===null){if(h=b.return,h!==null){l=h;continue}break}if(b.child===v.child){for(v=b.child;v;){if(v===l)return fn(b),s;if(v===h)return fn(b),i;v=v.sibling}throw Error(n(188))}if(l.return!==h.return)l=b,h=v;else{for(var A=!1,q=b.child;q;){if(q===l){A=!0,l=b,h=v;break}if(q===h){A=!0,h=b,l=v;break}q=q.sibling}if(!A){for(q=v.child;q;){if(q===l){A=!0,l=v,h=b;break}if(q===h){A=!0,h=v,l=b;break}q=q.sibling}if(!A)throw Error(n(189))}}if(l.alternate!==h)throw Error(n(190))}if(l.tag!==3)throw Error(n(188));return l.stateNode.current===l?s:i}function dr(s){return s=di(s),s!==null?As(s):null}function As(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var i=As(s);if(i!==null)return i;s=s.sibling}return null}var va=t.unstable_scheduleCallback,St=t.unstable_cancelCallback,vo=t.unstable_shouldYield,fi=t.unstable_requestPaint,Ct=t.unstable_now,rl=t.unstable_getCurrentPriorityLevel,Ta=t.unstable_ImmediatePriority,Im=t.unstable_UserBlockingPriority,sl=t.unstable_NormalPriority,yv=t.unstable_LowPriority,Rm=t.unstable_IdlePriority,al=null,zr=null;function bv(s){if(zr&&typeof zr.onCommitFiberRoot=="function")try{zr.onCommitFiberRoot(al,s,void 0,(s.current.flags&128)===128)}catch{}}var kr=Math.clz32?Math.clz32:vv,xv=Math.log,Ev=Math.LN2;function vv(s){return s>>>=0,s===0?32:31-(xv(s)/Ev|0)|0}var il=64,ol=4194304;function To(s){switch(s&-s){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 s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function ul(s,i){var l=s.pendingLanes;if(l===0)return 0;var h=0,b=s.suspendedLanes,v=s.pingedLanes,A=l&268435455;if(A!==0){var q=A&~b;q!==0?h=To(q):(v&=A,v!==0&&(h=To(v)))}else A=l&~b,A!==0?h=To(A):v!==0&&(h=To(v));if(h===0)return 0;if(i!==0&&i!==h&&(i&b)===0&&(b=h&-h,v=i&-i,b>=v||b===16&&(v&4194240)!==0))return i;if((h&4)!==0&&(h|=l&16),i=s.entangledLanes,i!==0)for(s=s.entanglements,i&=h;0<i;)l=31-kr(i),b=1<<l,h|=s[l],i&=~b;return h}function Tv(s,i){switch(s){case 1:case 2:case 4:return i+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 i+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 wv(s,i){for(var l=s.suspendedLanes,h=s.pingedLanes,b=s.expirationTimes,v=s.pendingLanes;0<v;){var A=31-kr(v),q=1<<A,Q=b[A];Q===-1?((q&l)===0||(q&h)!==0)&&(b[A]=Tv(q,i)):Q<=i&&(s.expiredLanes|=q),v&=~q}}function bd(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function Lm(){var s=il;return il<<=1,(il&4194240)===0&&(il=64),s}function xd(s){for(var i=[],l=0;31>l;l++)i.push(s);return i}function wo(s,i,l){s.pendingLanes|=i,i!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,i=31-kr(i),s[i]=l}function Sv(s,i){var l=s.pendingLanes&~i;s.pendingLanes=i,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=i,s.mutableReadLanes&=i,s.entangledLanes&=i,i=s.entanglements;var h=s.eventTimes;for(s=s.expirationTimes;0<l;){var b=31-kr(l),v=1<<b;i[b]=0,h[b]=-1,s[b]=-1,l&=~v}}function Ed(s,i){var l=s.entangledLanes|=i;for(s=s.entanglements;l;){var h=31-kr(l),b=1<<h;b&i|s[h]&i&&(s[h]|=i),l&=~b}}var mt=0;function Mm(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var Pm,vd,Fm,jm,Bm,Td=!1,ll=[],Is=null,Rs=null,Ls=null,So=new Map,Co=new Map,Ms=[],Cv="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 Hm(s,i){switch(s){case"focusin":case"focusout":Is=null;break;case"dragenter":case"dragleave":Rs=null;break;case"mouseover":case"mouseout":Ls=null;break;case"pointerover":case"pointerout":So.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Co.delete(i.pointerId)}}function ko(s,i,l,h,b,v){return s===null||s.nativeEvent!==v?(s={blockedOn:i,domEventName:l,eventSystemFlags:h,nativeEvent:v,targetContainers:[b]},i!==null&&(i=Ho(i),i!==null&&vd(i)),s):(s.eventSystemFlags|=h,i=s.targetContainers,b!==null&&i.indexOf(b)===-1&&i.push(b),s)}function kv(s,i,l,h,b){switch(i){case"focusin":return Is=ko(Is,s,i,l,h,b),!0;case"dragenter":return Rs=ko(Rs,s,i,l,h,b),!0;case"mouseover":return Ls=ko(Ls,s,i,l,h,b),!0;case"pointerover":var v=b.pointerId;return So.set(v,ko(So.get(v)||null,s,i,l,h,b)),!0;case"gotpointercapture":return v=b.pointerId,Co.set(v,ko(Co.get(v)||null,s,i,l,h,b)),!0}return!1}function Um(s){var i=wa(s.target);if(i!==null){var l=wt(i);if(l!==null){if(i=l.tag,i===13){if(i=xt(l),i!==null){s.blockedOn=i,Bm(s.priority,function(){Fm(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){s.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}s.blockedOn=null}function cl(s){if(s.blockedOn!==null)return!1;for(var i=s.targetContainers;0<i.length;){var l=Sd(s.domEventName,s.eventSystemFlags,i[0],s.nativeEvent);if(l===null){l=s.nativeEvent;var h=new l.constructor(l.type,l);dn=h,l.target.dispatchEvent(h),dn=null}else return i=Ho(l),i!==null&&vd(i),s.blockedOn=l,!1;i.shift()}return!0}function zm(s,i,l){cl(s)&&l.delete(i)}function _v(){Td=!1,Is!==null&&cl(Is)&&(Is=null),Rs!==null&&cl(Rs)&&(Rs=null),Ls!==null&&cl(Ls)&&(Ls=null),So.forEach(zm),Co.forEach(zm)}function _o(s,i){s.blockedOn===i&&(s.blockedOn=null,Td||(Td=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,_v)))}function No(s){function i(b){return _o(b,s)}if(0<ll.length){_o(ll[0],s);for(var l=1;l<ll.length;l++){var h=ll[l];h.blockedOn===s&&(h.blockedOn=null)}}for(Is!==null&&_o(Is,s),Rs!==null&&_o(Rs,s),Ls!==null&&_o(Ls,s),So.forEach(i),Co.forEach(i),l=0;l<Ms.length;l++)h=Ms[l],h.blockedOn===s&&(h.blockedOn=null);for(;0<Ms.length&&(l=Ms[0],l.blockedOn===null);)Um(l),l.blockedOn===null&&Ms.shift()}var hi=L.ReactCurrentBatchConfig,dl=!0;function Nv(s,i,l,h){var b=mt,v=hi.transition;hi.transition=null;try{mt=1,wd(s,i,l,h)}finally{mt=b,hi.transition=v}}function Ov(s,i,l,h){var b=mt,v=hi.transition;hi.transition=null;try{mt=4,wd(s,i,l,h)}finally{mt=b,hi.transition=v}}function wd(s,i,l,h){if(dl){var b=Sd(s,i,l,h);if(b===null)Ud(s,i,h,fl,l),Hm(s,h);else if(kv(b,s,i,l,h))h.stopPropagation();else if(Hm(s,h),i&4&&-1<Cv.indexOf(s)){for(;b!==null;){var v=Ho(b);if(v!==null&&Pm(v),v=Sd(s,i,l,h),v===null&&Ud(s,i,h,fl,l),v===b)break;b=v}b!==null&&h.stopPropagation()}else Ud(s,i,h,null,l)}}var fl=null;function Sd(s,i,l,h){if(fl=null,s=Cr(h),s=wa(s),s!==null)if(i=wt(s),i===null)s=null;else if(l=i.tag,l===13){if(s=xt(i),s!==null)return s;s=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;s=null}else i!==s&&(s=null);return fl=s,null}function Wm(s){switch(s){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(rl()){case Ta:return 1;case Im:return 4;case sl:case yv:return 16;case Rm:return 536870912;default:return 16}default:return 16}}var Ps=null,Cd=null,hl=null;function Ym(){if(hl)return hl;var s,i=Cd,l=i.length,h,b="value"in Ps?Ps.value:Ps.textContent,v=b.length;for(s=0;s<l&&i[s]===b[s];s++);var A=l-s;for(h=1;h<=A&&i[l-h]===b[v-h];h++);return hl=b.slice(s,1<h?1-h:void 0)}function ml(s){var i=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&i===13&&(s=13)):s=i,s===10&&(s=13),32<=s||s===13?s:0}function pl(){return!0}function qm(){return!1}function nr(s){function i(l,h,b,v,A){this._reactName=l,this._targetInst=b,this.type=h,this.nativeEvent=v,this.target=A,this.currentTarget=null;for(var q in s)s.hasOwnProperty(q)&&(l=s[q],this[q]=l?l(v):v[q]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?pl:qm,this.isPropagationStopped=qm,this}return D(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=pl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=pl)},persist:function(){},isPersistent:pl}),i}var mi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kd=nr(mi),Oo=D({},mi,{view:0,detail:0}),Dv=nr(Oo),_d,Nd,Do,gl=D({},Oo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Dd,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Do&&(Do&&s.type==="mousemove"?(_d=s.screenX-Do.screenX,Nd=s.screenY-Do.screenY):Nd=_d=0,Do=s),_d)},movementY:function(s){return"movementY"in s?s.movementY:Nd}}),$m=nr(gl),Av=D({},gl,{dataTransfer:0}),Iv=nr(Av),Rv=D({},Oo,{relatedTarget:0}),Od=nr(Rv),Lv=D({},mi,{animationName:0,elapsedTime:0,pseudoElement:0}),Mv=nr(Lv),Pv=D({},mi,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),Fv=nr(Pv),jv=D({},mi,{data:0}),Vm=nr(jv),Bv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hv={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"},Uv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zv(s){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(s):(s=Uv[s])?!!i[s]:!1}function Dd(){return zv}var Wv=D({},Oo,{key:function(s){if(s.key){var i=Bv[s.key]||s.key;if(i!=="Unidentified")return i}return s.type==="keypress"?(s=ml(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?Hv[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Dd,charCode:function(s){return s.type==="keypress"?ml(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?ml(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),Yv=nr(Wv),qv=D({},gl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qm=nr(qv),$v=D({},Oo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Dd}),Vv=nr($v),Qv=D({},mi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Gv=nr(Qv),Xv=D({},gl,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),Kv=nr(Xv),Jv=[9,13,27,32],Ad=c&&"CompositionEvent"in window,Ao=null;c&&"documentMode"in document&&(Ao=document.documentMode);var Zv=c&&"TextEvent"in window&&!Ao,Gm=c&&(!Ad||Ao&&8<Ao&&11>=Ao),Xm=" ",Km=!1;function Jm(s,i){switch(s){case"keyup":return Jv.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Zm(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var pi=!1;function eT(s,i){switch(s){case"compositionend":return Zm(i);case"keypress":return i.which!==32?null:(Km=!0,Xm);case"textInput":return s=i.data,s===Xm&&Km?null:s;default:return null}}function tT(s,i){if(pi)return s==="compositionend"||!Ad&&Jm(s,i)?(s=Ym(),hl=Cd=Ps=null,pi=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Gm&&i.locale!=="ko"?null:i.data;default:return null}}var nT={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 ep(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i==="input"?!!nT[s.type]:i==="textarea"}function tp(s,i,l,h){et(h),i=vl(i,"onChange"),0<i.length&&(l=new kd("onChange","change",null,l,h),s.push({event:l,listeners:i}))}var Io=null,Ro=null;function rT(s){xp(s,0)}function yl(s){var i=Ei(s);if(Rt(i))return s}function sT(s,i){if(s==="change")return i}var np=!1;if(c){var Id;if(c){var Rd="oninput"in document;if(!Rd){var rp=document.createElement("div");rp.setAttribute("oninput","return;"),Rd=typeof rp.oninput=="function"}Id=Rd}else Id=!1;np=Id&&(!document.documentMode||9<document.documentMode)}function sp(){Io&&(Io.detachEvent("onpropertychange",ap),Ro=Io=null)}function ap(s){if(s.propertyName==="value"&&yl(Ro)){var i=[];tp(i,Ro,s,Cr(s)),Ft(rT,i)}}function aT(s,i,l){s==="focusin"?(sp(),Io=i,Ro=l,Io.attachEvent("onpropertychange",ap)):s==="focusout"&&sp()}function iT(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return yl(Ro)}function oT(s,i){if(s==="click")return yl(i)}function uT(s,i){if(s==="input"||s==="change")return yl(i)}function lT(s,i){return s===i&&(s!==0||1/s===1/i)||s!==s&&i!==i}var _r=typeof Object.is=="function"?Object.is:lT;function Lo(s,i){if(_r(s,i))return!0;if(typeof s!="object"||s===null||typeof i!="object"||i===null)return!1;var l=Object.keys(s),h=Object.keys(i);if(l.length!==h.length)return!1;for(h=0;h<l.length;h++){var b=l[h];if(!d.call(i,b)||!_r(s[b],i[b]))return!1}return!0}function ip(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function op(s,i){var l=ip(s);s=0;for(var h;l;){if(l.nodeType===3){if(h=s+l.textContent.length,s<=i&&h>=i)return{node:l,offset:i-s};s=h}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=ip(l)}}function up(s,i){return s&&i?s===i?!0:s&&s.nodeType===3?!1:i&&i.nodeType===3?up(s,i.parentNode):"contains"in s?s.contains(i):s.compareDocumentPosition?!!(s.compareDocumentPosition(i)&16):!1:!1}function lp(){for(var s=window,i=Et();i instanceof s.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)s=i.contentWindow;else break;i=Et(s.document)}return i}function Ld(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i&&(i==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||i==="textarea"||s.contentEditable==="true")}function cT(s){var i=lp(),l=s.focusedElem,h=s.selectionRange;if(i!==l&&l&&l.ownerDocument&&up(l.ownerDocument.documentElement,l)){if(h!==null&&Ld(l)){if(i=h.start,s=h.end,s===void 0&&(s=i),"selectionStart"in l)l.selectionStart=i,l.selectionEnd=Math.min(s,l.value.length);else if(s=(i=l.ownerDocument||document)&&i.defaultView||window,s.getSelection){s=s.getSelection();var b=l.textContent.length,v=Math.min(h.start,b);h=h.end===void 0?v:Math.min(h.end,b),!s.extend&&v>h&&(b=h,h=v,v=b),b=op(l,v);var A=op(l,h);b&&A&&(s.rangeCount!==1||s.anchorNode!==b.node||s.anchorOffset!==b.offset||s.focusNode!==A.node||s.focusOffset!==A.offset)&&(i=i.createRange(),i.setStart(b.node,b.offset),s.removeAllRanges(),v>h?(s.addRange(i),s.extend(A.node,A.offset)):(i.setEnd(A.node,A.offset),s.addRange(i)))}}for(i=[],s=l;s=s.parentNode;)s.nodeType===1&&i.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l<i.length;l++)s=i[l],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var dT=c&&"documentMode"in document&&11>=document.documentMode,gi=null,Md=null,Mo=null,Pd=!1;function cp(s,i,l){var h=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Pd||gi==null||gi!==Et(h)||(h=gi,"selectionStart"in h&&Ld(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Mo&&Lo(Mo,h)||(Mo=h,h=vl(Md,"onSelect"),0<h.length&&(i=new kd("onSelect","select",null,i,l),s.push({event:i,listeners:h}),i.target=gi)))}function bl(s,i){var l={};return l[s.toLowerCase()]=i.toLowerCase(),l["Webkit"+s]="webkit"+i,l["Moz"+s]="moz"+i,l}var yi={animationend:bl("Animation","AnimationEnd"),animationiteration:bl("Animation","AnimationIteration"),animationstart:bl("Animation","AnimationStart"),transitionend:bl("Transition","TransitionEnd")},Fd={},dp={};c&&(dp=document.createElement("div").style,"AnimationEvent"in window||(delete yi.animationend.animation,delete yi.animationiteration.animation,delete yi.animationstart.animation),"TransitionEvent"in window||delete yi.transitionend.transition);function xl(s){if(Fd[s])return Fd[s];if(!yi[s])return s;var i=yi[s],l;for(l in i)if(i.hasOwnProperty(l)&&l in dp)return Fd[s]=i[l];return s}var fp=xl("animationend"),hp=xl("animationiteration"),mp=xl("animationstart"),pp=xl("transitionend"),gp=new Map,yp="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 Fs(s,i){gp.set(s,i),o(i,[s])}for(var jd=0;jd<yp.length;jd++){var Bd=yp[jd],fT=Bd.toLowerCase(),hT=Bd[0].toUpperCase()+Bd.slice(1);Fs(fT,"on"+hT)}Fs(fp,"onAnimationEnd"),Fs(hp,"onAnimationIteration"),Fs(mp,"onAnimationStart"),Fs("dblclick","onDoubleClick"),Fs("focusin","onFocus"),Fs("focusout","onBlur"),Fs(pp,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Po="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(" "),mT=new Set("cancel close invalid load scroll toggle".split(" ").concat(Po));function bp(s,i,l){var h=s.type||"unknown-event";s.currentTarget=l,Tt(h,i,void 0,s),s.currentTarget=null}function xp(s,i){i=(i&4)!==0;for(var l=0;l<s.length;l++){var h=s[l],b=h.event;h=h.listeners;e:{var v=void 0;if(i)for(var A=h.length-1;0<=A;A--){var q=h[A],Q=q.instance,se=q.currentTarget;if(q=q.listener,Q!==v&&b.isPropagationStopped())break e;bp(b,q,se),v=Q}else for(A=0;A<h.length;A++){if(q=h[A],Q=q.instance,se=q.currentTarget,q=q.listener,Q!==v&&b.isPropagationStopped())break e;bp(b,q,se),v=Q}}}if(je)throw s=rt,je=!1,rt=null,s}function At(s,i){var l=i[Vd];l===void 0&&(l=i[Vd]=new Set);var h=s+"__bubble";l.has(h)||(Ep(i,s,2,!1),l.add(h))}function Hd(s,i,l){var h=0;i&&(h|=4),Ep(l,s,h,i)}var El="_reactListening"+Math.random().toString(36).slice(2);function Fo(s){if(!s[El]){s[El]=!0,r.forEach(function(l){l!=="selectionchange"&&(mT.has(l)||Hd(l,!1,s),Hd(l,!0,s))});var i=s.nodeType===9?s:s.ownerDocument;i===null||i[El]||(i[El]=!0,Hd("selectionchange",!1,i))}}function Ep(s,i,l,h){switch(Wm(i)){case 1:var b=Nv;break;case 4:b=Ov;break;default:b=wd}l=b.bind(null,i,l,s),b=void 0,!_n||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(b=!0),h?b!==void 0?s.addEventListener(i,l,{capture:!0,passive:b}):s.addEventListener(i,l,!0):b!==void 0?s.addEventListener(i,l,{passive:b}):s.addEventListener(i,l,!1)}function Ud(s,i,l,h,b){var v=h;if((i&1)===0&&(i&2)===0&&h!==null)e:for(;;){if(h===null)return;var A=h.tag;if(A===3||A===4){var q=h.stateNode.containerInfo;if(q===b||q.nodeType===8&&q.parentNode===b)break;if(A===4)for(A=h.return;A!==null;){var Q=A.tag;if((Q===3||Q===4)&&(Q=A.stateNode.containerInfo,Q===b||Q.nodeType===8&&Q.parentNode===b))return;A=A.return}for(;q!==null;){if(A=wa(q),A===null)return;if(Q=A.tag,Q===5||Q===6){h=v=A;continue e}q=q.parentNode}}h=h.return}Ft(function(){var se=v,de=Cr(l),fe=[];e:{var le=gp.get(s);if(le!==void 0){var Te=kd,Oe=s;switch(s){case"keypress":if(ml(l)===0)break e;case"keydown":case"keyup":Te=Yv;break;case"focusin":Oe="focus",Te=Od;break;case"focusout":Oe="blur",Te=Od;break;case"beforeblur":case"afterblur":Te=Od;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Te=$m;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Te=Iv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Te=Vv;break;case fp:case hp:case mp:Te=Mv;break;case pp:Te=Gv;break;case"scroll":Te=Dv;break;case"wheel":Te=Kv;break;case"copy":case"cut":case"paste":Te=Fv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Te=Qm}var Ie=(i&4)!==0,en=!Ie&&s==="scroll",te=Ie?le!==null?le+"Capture":null:le;Ie=[];for(var X=se,re;X!==null;){re=X;var ge=re.stateNode;if(re.tag===5&&ge!==null&&(re=ge,te!==null&&(ge=Xt(X,te),ge!=null&&Ie.push(jo(X,ge,re)))),en)break;X=X.return}0<Ie.length&&(le=new Te(le,Oe,null,l,de),fe.push({event:le,listeners:Ie}))}}if((i&7)===0){e:{if(le=s==="mouseover"||s==="pointerover",Te=s==="mouseout"||s==="pointerout",le&&l!==dn&&(Oe=l.relatedTarget||l.fromElement)&&(wa(Oe)||Oe[cs]))break e;if((Te||le)&&(le=de.window===de?de:(le=de.ownerDocument)?le.defaultView||le.parentWindow:window,Te?(Oe=l.relatedTarget||l.toElement,Te=se,Oe=Oe?wa(Oe):null,Oe!==null&&(en=wt(Oe),Oe!==en||Oe.tag!==5&&Oe.tag!==6)&&(Oe=null)):(Te=null,Oe=se),Te!==Oe)){if(Ie=$m,ge="onMouseLeave",te="onMouseEnter",X="mouse",(s==="pointerout"||s==="pointerover")&&(Ie=Qm,ge="onPointerLeave",te="onPointerEnter",X="pointer"),en=Te==null?le:Ei(Te),re=Oe==null?le:Ei(Oe),le=new Ie(ge,X+"leave",Te,l,de),le.target=en,le.relatedTarget=re,ge=null,wa(de)===se&&(Ie=new Ie(te,X+"enter",Oe,l,de),Ie.target=re,Ie.relatedTarget=en,ge=Ie),en=ge,Te&&Oe)t:{for(Ie=Te,te=Oe,X=0,re=Ie;re;re=bi(re))X++;for(re=0,ge=te;ge;ge=bi(ge))re++;for(;0<X-re;)Ie=bi(Ie),X--;for(;0<re-X;)te=bi(te),re--;for(;X--;){if(Ie===te||te!==null&&Ie===te.alternate)break t;Ie=bi(Ie),te=bi(te)}Ie=null}else Ie=null;Te!==null&&vp(fe,le,Te,Ie,!1),Oe!==null&&en!==null&&vp(fe,en,Oe,Ie,!0)}}e:{if(le=se?Ei(se):window,Te=le.nodeName&&le.nodeName.toLowerCase(),Te==="select"||Te==="input"&&le.type==="file")var Re=sT;else if(ep(le))if(np)Re=uT;else{Re=iT;var Be=aT}else(Te=le.nodeName)&&Te.toLowerCase()==="input"&&(le.type==="checkbox"||le.type==="radio")&&(Re=oT);if(Re&&(Re=Re(s,se))){tp(fe,Re,l,de);break e}Be&&Be(s,le,se),s==="focusout"&&(Be=le._wrapperState)&&Be.controlled&&le.type==="number"&&it(le,"number",le.value)}switch(Be=se?Ei(se):window,s){case"focusin":(ep(Be)||Be.contentEditable==="true")&&(gi=Be,Md=se,Mo=null);break;case"focusout":Mo=Md=gi=null;break;case"mousedown":Pd=!0;break;case"contextmenu":case"mouseup":case"dragend":Pd=!1,cp(fe,l,de);break;case"selectionchange":if(dT)break;case"keydown":case"keyup":cp(fe,l,de)}var He;if(Ad)e:{switch(s){case"compositionstart":var qe="onCompositionStart";break e;case"compositionend":qe="onCompositionEnd";break e;case"compositionupdate":qe="onCompositionUpdate";break e}qe=void 0}else pi?Jm(s,l)&&(qe="onCompositionEnd"):s==="keydown"&&l.keyCode===229&&(qe="onCompositionStart");qe&&(Gm&&l.locale!=="ko"&&(pi||qe!=="onCompositionStart"?qe==="onCompositionEnd"&&pi&&(He=Ym()):(Ps=de,Cd="value"in Ps?Ps.value:Ps.textContent,pi=!0)),Be=vl(se,qe),0<Be.length&&(qe=new Vm(qe,s,null,l,de),fe.push({event:qe,listeners:Be}),He?qe.data=He:(He=Zm(l),He!==null&&(qe.data=He)))),(He=Zv?eT(s,l):tT(s,l))&&(se=vl(se,"onBeforeInput"),0<se.length&&(de=new Vm("onBeforeInput","beforeinput",null,l,de),fe.push({event:de,listeners:se}),de.data=He))}xp(fe,i)})}function jo(s,i,l){return{instance:s,listener:i,currentTarget:l}}function vl(s,i){for(var l=i+"Capture",h=[];s!==null;){var b=s,v=b.stateNode;b.tag===5&&v!==null&&(b=v,v=Xt(s,l),v!=null&&h.unshift(jo(s,v,b)),v=Xt(s,i),v!=null&&h.push(jo(s,v,b))),s=s.return}return h}function bi(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function vp(s,i,l,h,b){for(var v=i._reactName,A=[];l!==null&&l!==h;){var q=l,Q=q.alternate,se=q.stateNode;if(Q!==null&&Q===h)break;q.tag===5&&se!==null&&(q=se,b?(Q=Xt(l,v),Q!=null&&A.unshift(jo(l,Q,q))):b||(Q=Xt(l,v),Q!=null&&A.push(jo(l,Q,q)))),l=l.return}A.length!==0&&s.push({event:i,listeners:A})}var pT=/\r\n?/g,gT=/\u0000|\uFFFD/g;function Tp(s){return(typeof s=="string"?s:""+s).replace(pT,`
31
- `).replace(gT,"")}function Tl(s,i,l){if(i=Tp(i),Tp(s)!==i&&l)throw Error(n(425))}function wl(){}var zd=null,Wd=null;function Yd(s,i){return s==="textarea"||s==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var qd=typeof setTimeout=="function"?setTimeout:void 0,yT=typeof clearTimeout=="function"?clearTimeout:void 0,wp=typeof Promise=="function"?Promise:void 0,bT=typeof queueMicrotask=="function"?queueMicrotask:typeof wp<"u"?function(s){return wp.resolve(null).then(s).catch(xT)}:qd;function xT(s){setTimeout(function(){throw s})}function $d(s,i){var l=i,h=0;do{var b=l.nextSibling;if(s.removeChild(l),b&&b.nodeType===8)if(l=b.data,l==="/$"){if(h===0){s.removeChild(b),No(i);return}h--}else l!=="$"&&l!=="$?"&&l!=="$!"||h++;l=b}while(l);No(i)}function js(s){for(;s!=null;s=s.nextSibling){var i=s.nodeType;if(i===1||i===3)break;if(i===8){if(i=s.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return s}function Sp(s){s=s.previousSibling;for(var i=0;s;){if(s.nodeType===8){var l=s.data;if(l==="$"||l==="$!"||l==="$?"){if(i===0)return s;i--}else l==="/$"&&i++}s=s.previousSibling}return null}var xi=Math.random().toString(36).slice(2),Wr="__reactFiber$"+xi,Bo="__reactProps$"+xi,cs="__reactContainer$"+xi,Vd="__reactEvents$"+xi,ET="__reactListeners$"+xi,vT="__reactHandles$"+xi;function wa(s){var i=s[Wr];if(i)return i;for(var l=s.parentNode;l;){if(i=l[cs]||l[Wr]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(s=Sp(s);s!==null;){if(l=s[Wr])return l;s=Sp(s)}return i}s=l,l=s.parentNode}return null}function Ho(s){return s=s[Wr]||s[cs],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function Ei(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(n(33))}function Sl(s){return s[Bo]||null}var Qd=[],vi=-1;function Bs(s){return{current:s}}function It(s){0>vi||(s.current=Qd[vi],Qd[vi]=null,vi--)}function kt(s,i){vi++,Qd[vi]=s.current,s.current=i}var Hs={},Nn=Bs(Hs),zn=Bs(!1),Sa=Hs;function Ti(s,i){var l=s.type.contextTypes;if(!l)return Hs;var h=s.stateNode;if(h&&h.__reactInternalMemoizedUnmaskedChildContext===i)return h.__reactInternalMemoizedMaskedChildContext;var b={},v;for(v in l)b[v]=i[v];return h&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=i,s.__reactInternalMemoizedMaskedChildContext=b),b}function Wn(s){return s=s.childContextTypes,s!=null}function Cl(){It(zn),It(Nn)}function Cp(s,i,l){if(Nn.current!==Hs)throw Error(n(168));kt(Nn,i),kt(zn,l)}function kp(s,i,l){var h=s.stateNode;if(i=i.childContextTypes,typeof h.getChildContext!="function")return l;h=h.getChildContext();for(var b in h)if(!(b in i))throw Error(n(108,ze(s)||"Unknown",b));return D({},l,h)}function kl(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||Hs,Sa=Nn.current,kt(Nn,s),kt(zn,zn.current),!0}function _p(s,i,l){var h=s.stateNode;if(!h)throw Error(n(169));l?(s=kp(s,i,Sa),h.__reactInternalMemoizedMergedChildContext=s,It(zn),It(Nn),kt(Nn,s)):It(zn),kt(zn,l)}var ds=null,_l=!1,Gd=!1;function Np(s){ds===null?ds=[s]:ds.push(s)}function TT(s){_l=!0,Np(s)}function Us(){if(!Gd&&ds!==null){Gd=!0;var s=0,i=mt;try{var l=ds;for(mt=1;s<l.length;s++){var h=l[s];do h=h(!0);while(h!==null)}ds=null,_l=!1}catch(b){throw ds!==null&&(ds=ds.slice(s+1)),va(Ta,Us),b}finally{mt=i,Gd=!1}}return null}var wi=[],Si=0,Nl=null,Ol=0,fr=[],hr=0,Ca=null,fs=1,hs="";function ka(s,i){wi[Si++]=Ol,wi[Si++]=Nl,Nl=s,Ol=i}function Op(s,i,l){fr[hr++]=fs,fr[hr++]=hs,fr[hr++]=Ca,Ca=s;var h=fs;s=hs;var b=32-kr(h)-1;h&=~(1<<b),l+=1;var v=32-kr(i)+b;if(30<v){var A=b-b%5;v=(h&(1<<A)-1).toString(32),h>>=A,b-=A,fs=1<<32-kr(i)+b|l<<b|h,hs=v+s}else fs=1<<v|l<<b|h,hs=s}function Xd(s){s.return!==null&&(ka(s,1),Op(s,1,0))}function Kd(s){for(;s===Nl;)Nl=wi[--Si],wi[Si]=null,Ol=wi[--Si],wi[Si]=null;for(;s===Ca;)Ca=fr[--hr],fr[hr]=null,hs=fr[--hr],fr[hr]=null,fs=fr[--hr],fr[hr]=null}var rr=null,sr=null,jt=!1,Nr=null;function Dp(s,i){var l=yr(5,null,null,0);l.elementType="DELETED",l.stateNode=i,l.return=s,i=s.deletions,i===null?(s.deletions=[l],s.flags|=16):i.push(l)}function Ap(s,i){switch(s.tag){case 5:var l=s.type;return i=i.nodeType!==1||l.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(s.stateNode=i,rr=s,sr=js(i.firstChild),!0):!1;case 6:return i=s.pendingProps===""||i.nodeType!==3?null:i,i!==null?(s.stateNode=i,rr=s,sr=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(l=Ca!==null?{id:fs,overflow:hs}:null,s.memoizedState={dehydrated:i,treeContext:l,retryLane:1073741824},l=yr(18,null,null,0),l.stateNode=i,l.return=s,s.child=l,rr=s,sr=null,!0):!1;default:return!1}}function Jd(s){return(s.mode&1)!==0&&(s.flags&128)===0}function Zd(s){if(jt){var i=sr;if(i){var l=i;if(!Ap(s,i)){if(Jd(s))throw Error(n(418));i=js(l.nextSibling);var h=rr;i&&Ap(s,i)?Dp(h,l):(s.flags=s.flags&-4097|2,jt=!1,rr=s)}}else{if(Jd(s))throw Error(n(418));s.flags=s.flags&-4097|2,jt=!1,rr=s}}}function Ip(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;rr=s}function Dl(s){if(s!==rr)return!1;if(!jt)return Ip(s),jt=!0,!1;var i;if((i=s.tag!==3)&&!(i=s.tag!==5)&&(i=s.type,i=i!=="head"&&i!=="body"&&!Yd(s.type,s.memoizedProps)),i&&(i=sr)){if(Jd(s))throw Rp(),Error(n(418));for(;i;)Dp(s,i),i=js(i.nextSibling)}if(Ip(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(n(317));e:{for(s=s.nextSibling,i=0;s;){if(s.nodeType===8){var l=s.data;if(l==="/$"){if(i===0){sr=js(s.nextSibling);break e}i--}else l!=="$"&&l!=="$!"&&l!=="$?"||i++}s=s.nextSibling}sr=null}}else sr=rr?js(s.stateNode.nextSibling):null;return!0}function Rp(){for(var s=sr;s;)s=js(s.nextSibling)}function Ci(){sr=rr=null,jt=!1}function ef(s){Nr===null?Nr=[s]:Nr.push(s)}var wT=L.ReactCurrentBatchConfig;function Uo(s,i,l){if(s=l.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(l._owner){if(l=l._owner,l){if(l.tag!==1)throw Error(n(309));var h=l.stateNode}if(!h)throw Error(n(147,s));var b=h,v=""+s;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===v?i.ref:(i=function(A){var q=b.refs;A===null?delete q[v]:q[v]=A},i._stringRef=v,i)}if(typeof s!="string")throw Error(n(284));if(!l._owner)throw Error(n(290,s))}return s}function Al(s,i){throw s=Object.prototype.toString.call(i),Error(n(31,s==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":s))}function Lp(s){var i=s._init;return i(s._payload)}function Mp(s){function i(te,X){if(s){var re=te.deletions;re===null?(te.deletions=[X],te.flags|=16):re.push(X)}}function l(te,X){if(!s)return null;for(;X!==null;)i(te,X),X=X.sibling;return null}function h(te,X){for(te=new Map;X!==null;)X.key!==null?te.set(X.key,X):te.set(X.index,X),X=X.sibling;return te}function b(te,X){return te=Gs(te,X),te.index=0,te.sibling=null,te}function v(te,X,re){return te.index=re,s?(re=te.alternate,re!==null?(re=re.index,re<X?(te.flags|=2,X):re):(te.flags|=2,X)):(te.flags|=1048576,X)}function A(te){return s&&te.alternate===null&&(te.flags|=2),te}function q(te,X,re,ge){return X===null||X.tag!==6?(X=$f(re,te.mode,ge),X.return=te,X):(X=b(X,re),X.return=te,X)}function Q(te,X,re,ge){var Re=re.type;return Re===N?de(te,X,re.props.children,ge,re.key):X!==null&&(X.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===K&&Lp(Re)===X.type)?(ge=b(X,re.props),ge.ref=Uo(te,X,re),ge.return=te,ge):(ge=tc(re.type,re.key,re.props,null,te.mode,ge),ge.ref=Uo(te,X,re),ge.return=te,ge)}function se(te,X,re,ge){return X===null||X.tag!==4||X.stateNode.containerInfo!==re.containerInfo||X.stateNode.implementation!==re.implementation?(X=Vf(re,te.mode,ge),X.return=te,X):(X=b(X,re.children||[]),X.return=te,X)}function de(te,X,re,ge,Re){return X===null||X.tag!==7?(X=La(re,te.mode,ge,Re),X.return=te,X):(X=b(X,re),X.return=te,X)}function fe(te,X,re){if(typeof X=="string"&&X!==""||typeof X=="number")return X=$f(""+X,te.mode,re),X.return=te,X;if(typeof X=="object"&&X!==null){switch(X.$$typeof){case B:return re=tc(X.type,X.key,X.props,null,te.mode,re),re.ref=Uo(te,null,X),re.return=te,re;case k:return X=Vf(X,te.mode,re),X.return=te,X;case K:var ge=X._init;return fe(te,ge(X._payload),re)}if(nt(X)||ee(X))return X=La(X,te.mode,re,null),X.return=te,X;Al(te,X)}return null}function le(te,X,re,ge){var Re=X!==null?X.key:null;if(typeof re=="string"&&re!==""||typeof re=="number")return Re!==null?null:q(te,X,""+re,ge);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case B:return re.key===Re?Q(te,X,re,ge):null;case k:return re.key===Re?se(te,X,re,ge):null;case K:return Re=re._init,le(te,X,Re(re._payload),ge)}if(nt(re)||ee(re))return Re!==null?null:de(te,X,re,ge,null);Al(te,re)}return null}function Te(te,X,re,ge,Re){if(typeof ge=="string"&&ge!==""||typeof ge=="number")return te=te.get(re)||null,q(X,te,""+ge,Re);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case B:return te=te.get(ge.key===null?re:ge.key)||null,Q(X,te,ge,Re);case k:return te=te.get(ge.key===null?re:ge.key)||null,se(X,te,ge,Re);case K:var Be=ge._init;return Te(te,X,re,Be(ge._payload),Re)}if(nt(ge)||ee(ge))return te=te.get(re)||null,de(X,te,ge,Re,null);Al(X,ge)}return null}function Oe(te,X,re,ge){for(var Re=null,Be=null,He=X,qe=X=0,bn=null;He!==null&&qe<re.length;qe++){He.index>qe?(bn=He,He=null):bn=He.sibling;var ut=le(te,He,re[qe],ge);if(ut===null){He===null&&(He=bn);break}s&&He&&ut.alternate===null&&i(te,He),X=v(ut,X,qe),Be===null?Re=ut:Be.sibling=ut,Be=ut,He=bn}if(qe===re.length)return l(te,He),jt&&ka(te,qe),Re;if(He===null){for(;qe<re.length;qe++)He=fe(te,re[qe],ge),He!==null&&(X=v(He,X,qe),Be===null?Re=He:Be.sibling=He,Be=He);return jt&&ka(te,qe),Re}for(He=h(te,He);qe<re.length;qe++)bn=Te(He,te,qe,re[qe],ge),bn!==null&&(s&&bn.alternate!==null&&He.delete(bn.key===null?qe:bn.key),X=v(bn,X,qe),Be===null?Re=bn:Be.sibling=bn,Be=bn);return s&&He.forEach(function(Xs){return i(te,Xs)}),jt&&ka(te,qe),Re}function Ie(te,X,re,ge){var Re=ee(re);if(typeof Re!="function")throw Error(n(150));if(re=Re.call(re),re==null)throw Error(n(151));for(var Be=Re=null,He=X,qe=X=0,bn=null,ut=re.next();He!==null&&!ut.done;qe++,ut=re.next()){He.index>qe?(bn=He,He=null):bn=He.sibling;var Xs=le(te,He,ut.value,ge);if(Xs===null){He===null&&(He=bn);break}s&&He&&Xs.alternate===null&&i(te,He),X=v(Xs,X,qe),Be===null?Re=Xs:Be.sibling=Xs,Be=Xs,He=bn}if(ut.done)return l(te,He),jt&&ka(te,qe),Re;if(He===null){for(;!ut.done;qe++,ut=re.next())ut=fe(te,ut.value,ge),ut!==null&&(X=v(ut,X,qe),Be===null?Re=ut:Be.sibling=ut,Be=ut);return jt&&ka(te,qe),Re}for(He=h(te,He);!ut.done;qe++,ut=re.next())ut=Te(He,te,qe,ut.value,ge),ut!==null&&(s&&ut.alternate!==null&&He.delete(ut.key===null?qe:ut.key),X=v(ut,X,qe),Be===null?Re=ut:Be.sibling=ut,Be=ut);return s&&He.forEach(function(nw){return i(te,nw)}),jt&&ka(te,qe),Re}function en(te,X,re,ge){if(typeof re=="object"&&re!==null&&re.type===N&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case B:e:{for(var Re=re.key,Be=X;Be!==null;){if(Be.key===Re){if(Re=re.type,Re===N){if(Be.tag===7){l(te,Be.sibling),X=b(Be,re.props.children),X.return=te,te=X;break e}}else if(Be.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===K&&Lp(Re)===Be.type){l(te,Be.sibling),X=b(Be,re.props),X.ref=Uo(te,Be,re),X.return=te,te=X;break e}l(te,Be);break}else i(te,Be);Be=Be.sibling}re.type===N?(X=La(re.props.children,te.mode,ge,re.key),X.return=te,te=X):(ge=tc(re.type,re.key,re.props,null,te.mode,ge),ge.ref=Uo(te,X,re),ge.return=te,te=ge)}return A(te);case k:e:{for(Be=re.key;X!==null;){if(X.key===Be)if(X.tag===4&&X.stateNode.containerInfo===re.containerInfo&&X.stateNode.implementation===re.implementation){l(te,X.sibling),X=b(X,re.children||[]),X.return=te,te=X;break e}else{l(te,X);break}else i(te,X);X=X.sibling}X=Vf(re,te.mode,ge),X.return=te,te=X}return A(te);case K:return Be=re._init,en(te,X,Be(re._payload),ge)}if(nt(re))return Oe(te,X,re,ge);if(ee(re))return Ie(te,X,re,ge);Al(te,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,X!==null&&X.tag===6?(l(te,X.sibling),X=b(X,re),X.return=te,te=X):(l(te,X),X=$f(re,te.mode,ge),X.return=te,te=X),A(te)):l(te,X)}return en}var ki=Mp(!0),Pp=Mp(!1),Il=Bs(null),Rl=null,_i=null,tf=null;function nf(){tf=_i=Rl=null}function rf(s){var i=Il.current;It(Il),s._currentValue=i}function sf(s,i,l){for(;s!==null;){var h=s.alternate;if((s.childLanes&i)!==i?(s.childLanes|=i,h!==null&&(h.childLanes|=i)):h!==null&&(h.childLanes&i)!==i&&(h.childLanes|=i),s===l)break;s=s.return}}function Ni(s,i){Rl=s,tf=_i=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&i)!==0&&(Yn=!0),s.firstContext=null)}function mr(s){var i=s._currentValue;if(tf!==s)if(s={context:s,memoizedValue:i,next:null},_i===null){if(Rl===null)throw Error(n(308));_i=s,Rl.dependencies={lanes:0,firstContext:s}}else _i=_i.next=s;return i}var _a=null;function af(s){_a===null?_a=[s]:_a.push(s)}function Fp(s,i,l,h){var b=i.interleaved;return b===null?(l.next=l,af(i)):(l.next=b.next,b.next=l),i.interleaved=l,ms(s,h)}function ms(s,i){s.lanes|=i;var l=s.alternate;for(l!==null&&(l.lanes|=i),l=s,s=s.return;s!==null;)s.childLanes|=i,l=s.alternate,l!==null&&(l.childLanes|=i),l=s,s=s.return;return l.tag===3?l.stateNode:null}var zs=!1;function of(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function jp(s,i){s=s.updateQueue,i.updateQueue===s&&(i.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function ps(s,i){return{eventTime:s,lane:i,tag:0,payload:null,callback:null,next:null}}function Ws(s,i,l){var h=s.updateQueue;if(h===null)return null;if(h=h.shared,(at&2)!==0){var b=h.pending;return b===null?i.next=i:(i.next=b.next,b.next=i),h.pending=i,ms(s,l)}return b=h.interleaved,b===null?(i.next=i,af(h)):(i.next=b.next,b.next=i),h.interleaved=i,ms(s,l)}function Ll(s,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194240)!==0)){var h=i.lanes;h&=s.pendingLanes,l|=h,i.lanes=l,Ed(s,l)}}function Bp(s,i){var l=s.updateQueue,h=s.alternate;if(h!==null&&(h=h.updateQueue,l===h)){var b=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var A={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};v===null?b=v=A:v=v.next=A,l=l.next}while(l!==null);v===null?b=v=i:v=v.next=i}else b=v=i;l={baseState:h.baseState,firstBaseUpdate:b,lastBaseUpdate:v,shared:h.shared,effects:h.effects},s.updateQueue=l;return}s=l.lastBaseUpdate,s===null?l.firstBaseUpdate=i:s.next=i,l.lastBaseUpdate=i}function Ml(s,i,l,h){var b=s.updateQueue;zs=!1;var v=b.firstBaseUpdate,A=b.lastBaseUpdate,q=b.shared.pending;if(q!==null){b.shared.pending=null;var Q=q,se=Q.next;Q.next=null,A===null?v=se:A.next=se,A=Q;var de=s.alternate;de!==null&&(de=de.updateQueue,q=de.lastBaseUpdate,q!==A&&(q===null?de.firstBaseUpdate=se:q.next=se,de.lastBaseUpdate=Q))}if(v!==null){var fe=b.baseState;A=0,de=se=Q=null,q=v;do{var le=q.lane,Te=q.eventTime;if((h&le)===le){de!==null&&(de=de.next={eventTime:Te,lane:0,tag:q.tag,payload:q.payload,callback:q.callback,next:null});e:{var Oe=s,Ie=q;switch(le=i,Te=l,Ie.tag){case 1:if(Oe=Ie.payload,typeof Oe=="function"){fe=Oe.call(Te,fe,le);break e}fe=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ie.payload,le=typeof Oe=="function"?Oe.call(Te,fe,le):Oe,le==null)break e;fe=D({},fe,le);break e;case 2:zs=!0}}q.callback!==null&&q.lane!==0&&(s.flags|=64,le=b.effects,le===null?b.effects=[q]:le.push(q))}else Te={eventTime:Te,lane:le,tag:q.tag,payload:q.payload,callback:q.callback,next:null},de===null?(se=de=Te,Q=fe):de=de.next=Te,A|=le;if(q=q.next,q===null){if(q=b.shared.pending,q===null)break;le=q,q=le.next,le.next=null,b.lastBaseUpdate=le,b.shared.pending=null}}while(!0);if(de===null&&(Q=fe),b.baseState=Q,b.firstBaseUpdate=se,b.lastBaseUpdate=de,i=b.shared.interleaved,i!==null){b=i;do A|=b.lane,b=b.next;while(b!==i)}else v===null&&(b.shared.lanes=0);Da|=A,s.lanes=A,s.memoizedState=fe}}function Hp(s,i,l){if(s=i.effects,i.effects=null,s!==null)for(i=0;i<s.length;i++){var h=s[i],b=h.callback;if(b!==null){if(h.callback=null,h=l,typeof b!="function")throw Error(n(191,b));b.call(h)}}}var zo={},Yr=Bs(zo),Wo=Bs(zo),Yo=Bs(zo);function Na(s){if(s===zo)throw Error(n(174));return s}function uf(s,i){switch(kt(Yo,i),kt(Wo,s),kt(Yr,zo),s=i.nodeType,s){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:me(null,"");break;default:s=s===8?i.parentNode:i,i=s.namespaceURI||null,s=s.tagName,i=me(i,s)}It(Yr),kt(Yr,i)}function Oi(){It(Yr),It(Wo),It(Yo)}function Up(s){Na(Yo.current);var i=Na(Yr.current),l=me(i,s.type);i!==l&&(kt(Wo,s),kt(Yr,l))}function lf(s){Wo.current===s&&(It(Yr),It(Wo))}var Ut=Bs(0);function Pl(s){for(var i=s;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||l.data==="$?"||l.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var cf=[];function df(){for(var s=0;s<cf.length;s++)cf[s]._workInProgressVersionPrimary=null;cf.length=0}var Fl=L.ReactCurrentDispatcher,ff=L.ReactCurrentBatchConfig,Oa=0,zt=null,hn=null,gn=null,jl=!1,qo=!1,$o=0,ST=0;function On(){throw Error(n(321))}function hf(s,i){if(i===null)return!1;for(var l=0;l<i.length&&l<s.length;l++)if(!_r(s[l],i[l]))return!1;return!0}function mf(s,i,l,h,b,v){if(Oa=v,zt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Fl.current=s===null||s.memoizedState===null?NT:OT,s=l(h,b),qo){v=0;do{if(qo=!1,$o=0,25<=v)throw Error(n(301));v+=1,gn=hn=null,i.updateQueue=null,Fl.current=DT,s=l(h,b)}while(qo)}if(Fl.current=Ul,i=hn!==null&&hn.next!==null,Oa=0,gn=hn=zt=null,jl=!1,i)throw Error(n(300));return s}function pf(){var s=$o!==0;return $o=0,s}function qr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gn===null?zt.memoizedState=gn=s:gn=gn.next=s,gn}function pr(){if(hn===null){var s=zt.alternate;s=s!==null?s.memoizedState:null}else s=hn.next;var i=gn===null?zt.memoizedState:gn.next;if(i!==null)gn=i,hn=s;else{if(s===null)throw Error(n(310));hn=s,s={memoizedState:hn.memoizedState,baseState:hn.baseState,baseQueue:hn.baseQueue,queue:hn.queue,next:null},gn===null?zt.memoizedState=gn=s:gn=gn.next=s}return gn}function Vo(s,i){return typeof i=="function"?i(s):i}function gf(s){var i=pr(),l=i.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=s;var h=hn,b=h.baseQueue,v=l.pending;if(v!==null){if(b!==null){var A=b.next;b.next=v.next,v.next=A}h.baseQueue=b=v,l.pending=null}if(b!==null){v=b.next,h=h.baseState;var q=A=null,Q=null,se=v;do{var de=se.lane;if((Oa&de)===de)Q!==null&&(Q=Q.next={lane:0,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),h=se.hasEagerState?se.eagerState:s(h,se.action);else{var fe={lane:de,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null};Q===null?(q=Q=fe,A=h):Q=Q.next=fe,zt.lanes|=de,Da|=de}se=se.next}while(se!==null&&se!==v);Q===null?A=h:Q.next=q,_r(h,i.memoizedState)||(Yn=!0),i.memoizedState=h,i.baseState=A,i.baseQueue=Q,l.lastRenderedState=h}if(s=l.interleaved,s!==null){b=s;do v=b.lane,zt.lanes|=v,Da|=v,b=b.next;while(b!==s)}else b===null&&(l.lanes=0);return[i.memoizedState,l.dispatch]}function yf(s){var i=pr(),l=i.queue;if(l===null)throw Error(n(311));l.lastRenderedReducer=s;var h=l.dispatch,b=l.pending,v=i.memoizedState;if(b!==null){l.pending=null;var A=b=b.next;do v=s(v,A.action),A=A.next;while(A!==b);_r(v,i.memoizedState)||(Yn=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),l.lastRenderedState=v}return[v,h]}function zp(){}function Wp(s,i){var l=zt,h=pr(),b=i(),v=!_r(h.memoizedState,b);if(v&&(h.memoizedState=b,Yn=!0),h=h.queue,bf($p.bind(null,l,h,s),[s]),h.getSnapshot!==i||v||gn!==null&&gn.memoizedState.tag&1){if(l.flags|=2048,Qo(9,qp.bind(null,l,h,b,i),void 0,null),yn===null)throw Error(n(349));(Oa&30)!==0||Yp(l,i,b)}return b}function Yp(s,i,l){s.flags|=16384,s={getSnapshot:i,value:l},i=zt.updateQueue,i===null?(i={lastEffect:null,stores:null},zt.updateQueue=i,i.stores=[s]):(l=i.stores,l===null?i.stores=[s]:l.push(s))}function qp(s,i,l,h){i.value=l,i.getSnapshot=h,Vp(i)&&Qp(s)}function $p(s,i,l){return l(function(){Vp(i)&&Qp(s)})}function Vp(s){var i=s.getSnapshot;s=s.value;try{var l=i();return!_r(s,l)}catch{return!0}}function Qp(s){var i=ms(s,1);i!==null&&Ir(i,s,1,-1)}function Gp(s){var i=qr();return typeof s=="function"&&(s=s()),i.memoizedState=i.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:s},i.queue=s,s=s.dispatch=_T.bind(null,zt,s),[i.memoizedState,s]}function Qo(s,i,l,h){return s={tag:s,create:i,destroy:l,deps:h,next:null},i=zt.updateQueue,i===null?(i={lastEffect:null,stores:null},zt.updateQueue=i,i.lastEffect=s.next=s):(l=i.lastEffect,l===null?i.lastEffect=s.next=s:(h=l.next,l.next=s,s.next=h,i.lastEffect=s)),s}function Xp(){return pr().memoizedState}function Bl(s,i,l,h){var b=qr();zt.flags|=s,b.memoizedState=Qo(1|i,l,void 0,h===void 0?null:h)}function Hl(s,i,l,h){var b=pr();h=h===void 0?null:h;var v=void 0;if(hn!==null){var A=hn.memoizedState;if(v=A.destroy,h!==null&&hf(h,A.deps)){b.memoizedState=Qo(i,l,v,h);return}}zt.flags|=s,b.memoizedState=Qo(1|i,l,v,h)}function Kp(s,i){return Bl(8390656,8,s,i)}function bf(s,i){return Hl(2048,8,s,i)}function Jp(s,i){return Hl(4,2,s,i)}function Zp(s,i){return Hl(4,4,s,i)}function eg(s,i){if(typeof i=="function")return s=s(),i(s),function(){i(null)};if(i!=null)return s=s(),i.current=s,function(){i.current=null}}function tg(s,i,l){return l=l!=null?l.concat([s]):null,Hl(4,4,eg.bind(null,i,s),l)}function xf(){}function ng(s,i){var l=pr();i=i===void 0?null:i;var h=l.memoizedState;return h!==null&&i!==null&&hf(i,h[1])?h[0]:(l.memoizedState=[s,i],s)}function rg(s,i){var l=pr();i=i===void 0?null:i;var h=l.memoizedState;return h!==null&&i!==null&&hf(i,h[1])?h[0]:(s=s(),l.memoizedState=[s,i],s)}function sg(s,i,l){return(Oa&21)===0?(s.baseState&&(s.baseState=!1,Yn=!0),s.memoizedState=l):(_r(l,i)||(l=Lm(),zt.lanes|=l,Da|=l,s.baseState=!0),i)}function CT(s,i){var l=mt;mt=l!==0&&4>l?l:4,s(!0);var h=ff.transition;ff.transition={};try{s(!1),i()}finally{mt=l,ff.transition=h}}function ag(){return pr().memoizedState}function kT(s,i,l){var h=Vs(s);if(l={lane:h,action:l,hasEagerState:!1,eagerState:null,next:null},ig(s))og(i,l);else if(l=Fp(s,i,l,h),l!==null){var b=jn();Ir(l,s,h,b),ug(l,i,h)}}function _T(s,i,l){var h=Vs(s),b={lane:h,action:l,hasEagerState:!1,eagerState:null,next:null};if(ig(s))og(i,b);else{var v=s.alternate;if(s.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var A=i.lastRenderedState,q=v(A,l);if(b.hasEagerState=!0,b.eagerState=q,_r(q,A)){var Q=i.interleaved;Q===null?(b.next=b,af(i)):(b.next=Q.next,Q.next=b),i.interleaved=b;return}}catch{}finally{}l=Fp(s,i,b,h),l!==null&&(b=jn(),Ir(l,s,h,b),ug(l,i,h))}}function ig(s){var i=s.alternate;return s===zt||i!==null&&i===zt}function og(s,i){qo=jl=!0;var l=s.pending;l===null?i.next=i:(i.next=l.next,l.next=i),s.pending=i}function ug(s,i,l){if((l&4194240)!==0){var h=i.lanes;h&=s.pendingLanes,l|=h,i.lanes=l,Ed(s,l)}}var Ul={readContext:mr,useCallback:On,useContext:On,useEffect:On,useImperativeHandle:On,useInsertionEffect:On,useLayoutEffect:On,useMemo:On,useReducer:On,useRef:On,useState:On,useDebugValue:On,useDeferredValue:On,useTransition:On,useMutableSource:On,useSyncExternalStore:On,useId:On,unstable_isNewReconciler:!1},NT={readContext:mr,useCallback:function(s,i){return qr().memoizedState=[s,i===void 0?null:i],s},useContext:mr,useEffect:Kp,useImperativeHandle:function(s,i,l){return l=l!=null?l.concat([s]):null,Bl(4194308,4,eg.bind(null,i,s),l)},useLayoutEffect:function(s,i){return Bl(4194308,4,s,i)},useInsertionEffect:function(s,i){return Bl(4,2,s,i)},useMemo:function(s,i){var l=qr();return i=i===void 0?null:i,s=s(),l.memoizedState=[s,i],s},useReducer:function(s,i,l){var h=qr();return i=l!==void 0?l(i):i,h.memoizedState=h.baseState=i,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:i},h.queue=s,s=s.dispatch=kT.bind(null,zt,s),[h.memoizedState,s]},useRef:function(s){var i=qr();return s={current:s},i.memoizedState=s},useState:Gp,useDebugValue:xf,useDeferredValue:function(s){return qr().memoizedState=s},useTransition:function(){var s=Gp(!1),i=s[0];return s=CT.bind(null,s[1]),qr().memoizedState=s,[i,s]},useMutableSource:function(){},useSyncExternalStore:function(s,i,l){var h=zt,b=qr();if(jt){if(l===void 0)throw Error(n(407));l=l()}else{if(l=i(),yn===null)throw Error(n(349));(Oa&30)!==0||Yp(h,i,l)}b.memoizedState=l;var v={value:l,getSnapshot:i};return b.queue=v,Kp($p.bind(null,h,v,s),[s]),h.flags|=2048,Qo(9,qp.bind(null,h,v,l,i),void 0,null),l},useId:function(){var s=qr(),i=yn.identifierPrefix;if(jt){var l=hs,h=fs;l=(h&~(1<<32-kr(h)-1)).toString(32)+l,i=":"+i+"R"+l,l=$o++,0<l&&(i+="H"+l.toString(32)),i+=":"}else l=ST++,i=":"+i+"r"+l.toString(32)+":";return s.memoizedState=i},unstable_isNewReconciler:!1},OT={readContext:mr,useCallback:ng,useContext:mr,useEffect:bf,useImperativeHandle:tg,useInsertionEffect:Jp,useLayoutEffect:Zp,useMemo:rg,useReducer:gf,useRef:Xp,useState:function(){return gf(Vo)},useDebugValue:xf,useDeferredValue:function(s){var i=pr();return sg(i,hn.memoizedState,s)},useTransition:function(){var s=gf(Vo)[0],i=pr().memoizedState;return[s,i]},useMutableSource:zp,useSyncExternalStore:Wp,useId:ag,unstable_isNewReconciler:!1},DT={readContext:mr,useCallback:ng,useContext:mr,useEffect:bf,useImperativeHandle:tg,useInsertionEffect:Jp,useLayoutEffect:Zp,useMemo:rg,useReducer:yf,useRef:Xp,useState:function(){return yf(Vo)},useDebugValue:xf,useDeferredValue:function(s){var i=pr();return hn===null?i.memoizedState=s:sg(i,hn.memoizedState,s)},useTransition:function(){var s=yf(Vo)[0],i=pr().memoizedState;return[s,i]},useMutableSource:zp,useSyncExternalStore:Wp,useId:ag,unstable_isNewReconciler:!1};function Or(s,i){if(s&&s.defaultProps){i=D({},i),s=s.defaultProps;for(var l in s)i[l]===void 0&&(i[l]=s[l]);return i}return i}function Ef(s,i,l,h){i=s.memoizedState,l=l(h,i),l=l==null?i:D({},i,l),s.memoizedState=l,s.lanes===0&&(s.updateQueue.baseState=l)}var zl={isMounted:function(s){return(s=s._reactInternals)?wt(s)===s:!1},enqueueSetState:function(s,i,l){s=s._reactInternals;var h=jn(),b=Vs(s),v=ps(h,b);v.payload=i,l!=null&&(v.callback=l),i=Ws(s,v,b),i!==null&&(Ir(i,s,b,h),Ll(i,s,b))},enqueueReplaceState:function(s,i,l){s=s._reactInternals;var h=jn(),b=Vs(s),v=ps(h,b);v.tag=1,v.payload=i,l!=null&&(v.callback=l),i=Ws(s,v,b),i!==null&&(Ir(i,s,b,h),Ll(i,s,b))},enqueueForceUpdate:function(s,i){s=s._reactInternals;var l=jn(),h=Vs(s),b=ps(l,h);b.tag=2,i!=null&&(b.callback=i),i=Ws(s,b,h),i!==null&&(Ir(i,s,h,l),Ll(i,s,h))}};function lg(s,i,l,h,b,v,A){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(h,v,A):i.prototype&&i.prototype.isPureReactComponent?!Lo(l,h)||!Lo(b,v):!0}function cg(s,i,l){var h=!1,b=Hs,v=i.contextType;return typeof v=="object"&&v!==null?v=mr(v):(b=Wn(i)?Sa:Nn.current,h=i.contextTypes,v=(h=h!=null)?Ti(s,b):Hs),i=new i(l,v),s.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=zl,s.stateNode=i,i._reactInternals=s,h&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=b,s.__reactInternalMemoizedMaskedChildContext=v),i}function dg(s,i,l,h){s=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,h),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,h),i.state!==s&&zl.enqueueReplaceState(i,i.state,null)}function vf(s,i,l,h){var b=s.stateNode;b.props=l,b.state=s.memoizedState,b.refs={},of(s);var v=i.contextType;typeof v=="object"&&v!==null?b.context=mr(v):(v=Wn(i)?Sa:Nn.current,b.context=Ti(s,v)),b.state=s.memoizedState,v=i.getDerivedStateFromProps,typeof v=="function"&&(Ef(s,i,v,l),b.state=s.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(i=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),i!==b.state&&zl.enqueueReplaceState(b,b.state,null),Ml(s,l,b,h),b.state=s.memoizedState),typeof b.componentDidMount=="function"&&(s.flags|=4194308)}function Di(s,i){try{var l="",h=i;do l+=De(h),h=h.return;while(h);var b=l}catch(v){b=`
32
- Error generating stack: `+v.message+`
33
- `+v.stack}return{value:s,source:i,stack:b,digest:null}}function Tf(s,i,l){return{value:s,source:null,stack:l??null,digest:i??null}}function wf(s,i){try{console.error(i.value)}catch(l){setTimeout(function(){throw l})}}var AT=typeof WeakMap=="function"?WeakMap:Map;function fg(s,i,l){l=ps(-1,l),l.tag=3,l.payload={element:null};var h=i.value;return l.callback=function(){Gl||(Gl=!0,jf=h),wf(s,i)},l}function hg(s,i,l){l=ps(-1,l),l.tag=3;var h=s.type.getDerivedStateFromError;if(typeof h=="function"){var b=i.value;l.payload=function(){return h(b)},l.callback=function(){wf(s,i)}}var v=s.stateNode;return v!==null&&typeof v.componentDidCatch=="function"&&(l.callback=function(){wf(s,i),typeof h!="function"&&(qs===null?qs=new Set([this]):qs.add(this));var A=i.stack;this.componentDidCatch(i.value,{componentStack:A!==null?A:""})}),l}function mg(s,i,l){var h=s.pingCache;if(h===null){h=s.pingCache=new AT;var b=new Set;h.set(i,b)}else b=h.get(i),b===void 0&&(b=new Set,h.set(i,b));b.has(l)||(b.add(l),s=qT.bind(null,s,i,l),i.then(s,s))}function pg(s){do{var i;if((i=s.tag===13)&&(i=s.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return s;s=s.return}while(s!==null);return null}function gg(s,i,l,h,b){return(s.mode&1)===0?(s===i?s.flags|=65536:(s.flags|=128,l.flags|=131072,l.flags&=-52805,l.tag===1&&(l.alternate===null?l.tag=17:(i=ps(-1,1),i.tag=2,Ws(l,i,1))),l.lanes|=1),s):(s.flags|=65536,s.lanes=b,s)}var IT=L.ReactCurrentOwner,Yn=!1;function Fn(s,i,l,h){i.child=s===null?Pp(i,null,l,h):ki(i,s.child,l,h)}function yg(s,i,l,h,b){l=l.render;var v=i.ref;return Ni(i,b),h=mf(s,i,l,h,v,b),l=pf(),s!==null&&!Yn?(i.updateQueue=s.updateQueue,i.flags&=-2053,s.lanes&=~b,gs(s,i,b)):(jt&&l&&Xd(i),i.flags|=1,Fn(s,i,h,b),i.child)}function bg(s,i,l,h,b){if(s===null){var v=l.type;return typeof v=="function"&&!qf(v)&&v.defaultProps===void 0&&l.compare===null&&l.defaultProps===void 0?(i.tag=15,i.type=v,xg(s,i,v,h,b)):(s=tc(l.type,null,h,i,i.mode,b),s.ref=i.ref,s.return=i,i.child=s)}if(v=s.child,(s.lanes&b)===0){var A=v.memoizedProps;if(l=l.compare,l=l!==null?l:Lo,l(A,h)&&s.ref===i.ref)return gs(s,i,b)}return i.flags|=1,s=Gs(v,h),s.ref=i.ref,s.return=i,i.child=s}function xg(s,i,l,h,b){if(s!==null){var v=s.memoizedProps;if(Lo(v,h)&&s.ref===i.ref)if(Yn=!1,i.pendingProps=h=v,(s.lanes&b)!==0)(s.flags&131072)!==0&&(Yn=!0);else return i.lanes=s.lanes,gs(s,i,b)}return Sf(s,i,l,h,b)}function Eg(s,i,l){var h=i.pendingProps,b=h.children,v=s!==null?s.memoizedState:null;if(h.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},kt(Ii,ar),ar|=l;else{if((l&1073741824)===0)return s=v!==null?v.baseLanes|l:l,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:s,cachePool:null,transitions:null},i.updateQueue=null,kt(Ii,ar),ar|=s,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},h=v!==null?v.baseLanes:l,kt(Ii,ar),ar|=h}else v!==null?(h=v.baseLanes|l,i.memoizedState=null):h=l,kt(Ii,ar),ar|=h;return Fn(s,i,b,l),i.child}function vg(s,i){var l=i.ref;(s===null&&l!==null||s!==null&&s.ref!==l)&&(i.flags|=512,i.flags|=2097152)}function Sf(s,i,l,h,b){var v=Wn(l)?Sa:Nn.current;return v=Ti(i,v),Ni(i,b),l=mf(s,i,l,h,v,b),h=pf(),s!==null&&!Yn?(i.updateQueue=s.updateQueue,i.flags&=-2053,s.lanes&=~b,gs(s,i,b)):(jt&&h&&Xd(i),i.flags|=1,Fn(s,i,l,b),i.child)}function Tg(s,i,l,h,b){if(Wn(l)){var v=!0;kl(i)}else v=!1;if(Ni(i,b),i.stateNode===null)Yl(s,i),cg(i,l,h),vf(i,l,h,b),h=!0;else if(s===null){var A=i.stateNode,q=i.memoizedProps;A.props=q;var Q=A.context,se=l.contextType;typeof se=="object"&&se!==null?se=mr(se):(se=Wn(l)?Sa:Nn.current,se=Ti(i,se));var de=l.getDerivedStateFromProps,fe=typeof de=="function"||typeof A.getSnapshotBeforeUpdate=="function";fe||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(q!==h||Q!==se)&&dg(i,A,h,se),zs=!1;var le=i.memoizedState;A.state=le,Ml(i,h,A,b),Q=i.memoizedState,q!==h||le!==Q||zn.current||zs?(typeof de=="function"&&(Ef(i,l,de,h),Q=i.memoizedState),(q=zs||lg(i,l,q,h,le,Q,se))?(fe||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(i.flags|=4194308)):(typeof A.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=h,i.memoizedState=Q),A.props=h,A.state=Q,A.context=se,h=q):(typeof A.componentDidMount=="function"&&(i.flags|=4194308),h=!1)}else{A=i.stateNode,jp(s,i),q=i.memoizedProps,se=i.type===i.elementType?q:Or(i.type,q),A.props=se,fe=i.pendingProps,le=A.context,Q=l.contextType,typeof Q=="object"&&Q!==null?Q=mr(Q):(Q=Wn(l)?Sa:Nn.current,Q=Ti(i,Q));var Te=l.getDerivedStateFromProps;(de=typeof Te=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(q!==fe||le!==Q)&&dg(i,A,h,Q),zs=!1,le=i.memoizedState,A.state=le,Ml(i,h,A,b);var Oe=i.memoizedState;q!==fe||le!==Oe||zn.current||zs?(typeof Te=="function"&&(Ef(i,l,Te,h),Oe=i.memoizedState),(se=zs||lg(i,l,se,h,le,Oe,Q)||!1)?(de||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(h,Oe,Q),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(h,Oe,Q)),typeof A.componentDidUpdate=="function"&&(i.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof A.componentDidUpdate!="function"||q===s.memoizedProps&&le===s.memoizedState||(i.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||q===s.memoizedProps&&le===s.memoizedState||(i.flags|=1024),i.memoizedProps=h,i.memoizedState=Oe),A.props=h,A.state=Oe,A.context=Q,h=se):(typeof A.componentDidUpdate!="function"||q===s.memoizedProps&&le===s.memoizedState||(i.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||q===s.memoizedProps&&le===s.memoizedState||(i.flags|=1024),h=!1)}return Cf(s,i,l,h,v,b)}function Cf(s,i,l,h,b,v){vg(s,i);var A=(i.flags&128)!==0;if(!h&&!A)return b&&_p(i,l,!1),gs(s,i,v);h=i.stateNode,IT.current=i;var q=A&&typeof l.getDerivedStateFromError!="function"?null:h.render();return i.flags|=1,s!==null&&A?(i.child=ki(i,s.child,null,v),i.child=ki(i,null,q,v)):Fn(s,i,q,v),i.memoizedState=h.state,b&&_p(i,l,!0),i.child}function wg(s){var i=s.stateNode;i.pendingContext?Cp(s,i.pendingContext,i.pendingContext!==i.context):i.context&&Cp(s,i.context,!1),uf(s,i.containerInfo)}function Sg(s,i,l,h,b){return Ci(),ef(b),i.flags|=256,Fn(s,i,l,h),i.child}var kf={dehydrated:null,treeContext:null,retryLane:0};function _f(s){return{baseLanes:s,cachePool:null,transitions:null}}function Cg(s,i,l){var h=i.pendingProps,b=Ut.current,v=!1,A=(i.flags&128)!==0,q;if((q=A)||(q=s!==null&&s.memoizedState===null?!1:(b&2)!==0),q?(v=!0,i.flags&=-129):(s===null||s.memoizedState!==null)&&(b|=1),kt(Ut,b&1),s===null)return Zd(i),s=i.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((i.mode&1)===0?i.lanes=1:s.data==="$!"?i.lanes=8:i.lanes=1073741824,null):(A=h.children,s=h.fallback,v?(h=i.mode,v=i.child,A={mode:"hidden",children:A},(h&1)===0&&v!==null?(v.childLanes=0,v.pendingProps=A):v=nc(A,h,0,null),s=La(s,h,l,null),v.return=i,s.return=i,v.sibling=s,i.child=v,i.child.memoizedState=_f(l),i.memoizedState=kf,s):Nf(i,A));if(b=s.memoizedState,b!==null&&(q=b.dehydrated,q!==null))return RT(s,i,A,h,q,b,l);if(v){v=h.fallback,A=i.mode,b=s.child,q=b.sibling;var Q={mode:"hidden",children:h.children};return(A&1)===0&&i.child!==b?(h=i.child,h.childLanes=0,h.pendingProps=Q,i.deletions=null):(h=Gs(b,Q),h.subtreeFlags=b.subtreeFlags&14680064),q!==null?v=Gs(q,v):(v=La(v,A,l,null),v.flags|=2),v.return=i,h.return=i,h.sibling=v,i.child=h,h=v,v=i.child,A=s.child.memoizedState,A=A===null?_f(l):{baseLanes:A.baseLanes|l,cachePool:null,transitions:A.transitions},v.memoizedState=A,v.childLanes=s.childLanes&~l,i.memoizedState=kf,h}return v=s.child,s=v.sibling,h=Gs(v,{mode:"visible",children:h.children}),(i.mode&1)===0&&(h.lanes=l),h.return=i,h.sibling=null,s!==null&&(l=i.deletions,l===null?(i.deletions=[s],i.flags|=16):l.push(s)),i.child=h,i.memoizedState=null,h}function Nf(s,i){return i=nc({mode:"visible",children:i},s.mode,0,null),i.return=s,s.child=i}function Wl(s,i,l,h){return h!==null&&ef(h),ki(i,s.child,null,l),s=Nf(i,i.pendingProps.children),s.flags|=2,i.memoizedState=null,s}function RT(s,i,l,h,b,v,A){if(l)return i.flags&256?(i.flags&=-257,h=Tf(Error(n(422))),Wl(s,i,A,h)):i.memoizedState!==null?(i.child=s.child,i.flags|=128,null):(v=h.fallback,b=i.mode,h=nc({mode:"visible",children:h.children},b,0,null),v=La(v,b,A,null),v.flags|=2,h.return=i,v.return=i,h.sibling=v,i.child=h,(i.mode&1)!==0&&ki(i,s.child,null,A),i.child.memoizedState=_f(A),i.memoizedState=kf,v);if((i.mode&1)===0)return Wl(s,i,A,null);if(b.data==="$!"){if(h=b.nextSibling&&b.nextSibling.dataset,h)var q=h.dgst;return h=q,v=Error(n(419)),h=Tf(v,h,void 0),Wl(s,i,A,h)}if(q=(A&s.childLanes)!==0,Yn||q){if(h=yn,h!==null){switch(A&-A){case 4:b=2;break;case 16:b=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:b=32;break;case 536870912:b=268435456;break;default:b=0}b=(b&(h.suspendedLanes|A))!==0?0:b,b!==0&&b!==v.retryLane&&(v.retryLane=b,ms(s,b),Ir(h,s,b,-1))}return Yf(),h=Tf(Error(n(421))),Wl(s,i,A,h)}return b.data==="$?"?(i.flags|=128,i.child=s.child,i=$T.bind(null,s),b._reactRetry=i,null):(s=v.treeContext,sr=js(b.nextSibling),rr=i,jt=!0,Nr=null,s!==null&&(fr[hr++]=fs,fr[hr++]=hs,fr[hr++]=Ca,fs=s.id,hs=s.overflow,Ca=i),i=Nf(i,h.children),i.flags|=4096,i)}function kg(s,i,l){s.lanes|=i;var h=s.alternate;h!==null&&(h.lanes|=i),sf(s.return,i,l)}function Of(s,i,l,h,b){var v=s.memoizedState;v===null?s.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:h,tail:l,tailMode:b}:(v.isBackwards=i,v.rendering=null,v.renderingStartTime=0,v.last=h,v.tail=l,v.tailMode=b)}function _g(s,i,l){var h=i.pendingProps,b=h.revealOrder,v=h.tail;if(Fn(s,i,h.children,l),h=Ut.current,(h&2)!==0)h=h&1|2,i.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=i.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&kg(s,l,i);else if(s.tag===19)kg(s,l,i);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}h&=1}if(kt(Ut,h),(i.mode&1)===0)i.memoizedState=null;else switch(b){case"forwards":for(l=i.child,b=null;l!==null;)s=l.alternate,s!==null&&Pl(s)===null&&(b=l),l=l.sibling;l=b,l===null?(b=i.child,i.child=null):(b=l.sibling,l.sibling=null),Of(i,!1,b,l,v);break;case"backwards":for(l=null,b=i.child,i.child=null;b!==null;){if(s=b.alternate,s!==null&&Pl(s)===null){i.child=b;break}s=b.sibling,b.sibling=l,l=b,b=s}Of(i,!0,l,null,v);break;case"together":Of(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function Yl(s,i){(i.mode&1)===0&&s!==null&&(s.alternate=null,i.alternate=null,i.flags|=2)}function gs(s,i,l){if(s!==null&&(i.dependencies=s.dependencies),Da|=i.lanes,(l&i.childLanes)===0)return null;if(s!==null&&i.child!==s.child)throw Error(n(153));if(i.child!==null){for(s=i.child,l=Gs(s,s.pendingProps),i.child=l,l.return=i;s.sibling!==null;)s=s.sibling,l=l.sibling=Gs(s,s.pendingProps),l.return=i;l.sibling=null}return i.child}function LT(s,i,l){switch(i.tag){case 3:wg(i),Ci();break;case 5:Up(i);break;case 1:Wn(i.type)&&kl(i);break;case 4:uf(i,i.stateNode.containerInfo);break;case 10:var h=i.type._context,b=i.memoizedProps.value;kt(Il,h._currentValue),h._currentValue=b;break;case 13:if(h=i.memoizedState,h!==null)return h.dehydrated!==null?(kt(Ut,Ut.current&1),i.flags|=128,null):(l&i.child.childLanes)!==0?Cg(s,i,l):(kt(Ut,Ut.current&1),s=gs(s,i,l),s!==null?s.sibling:null);kt(Ut,Ut.current&1);break;case 19:if(h=(l&i.childLanes)!==0,(s.flags&128)!==0){if(h)return _g(s,i,l);i.flags|=128}if(b=i.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),kt(Ut,Ut.current),h)break;return null;case 22:case 23:return i.lanes=0,Eg(s,i,l)}return gs(s,i,l)}var Ng,Df,Og,Dg;Ng=function(s,i){for(var l=i.child;l!==null;){if(l.tag===5||l.tag===6)s.appendChild(l.stateNode);else if(l.tag!==4&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return;l=l.return}l.sibling.return=l.return,l=l.sibling}},Df=function(){},Og=function(s,i,l,h){var b=s.memoizedProps;if(b!==h){s=i.stateNode,Na(Yr.current);var v=null;switch(l){case"input":b=Cn(s,b),h=Cn(s,h),v=[];break;case"select":b=D({},b,{value:void 0}),h=D({},h,{value:void 0}),v=[];break;case"textarea":b=Dt(s,b),h=Dt(s,h),v=[];break;default:typeof b.onClick!="function"&&typeof h.onClick=="function"&&(s.onclick=wl)}Mt(l,h);var A;l=null;for(se in b)if(!h.hasOwnProperty(se)&&b.hasOwnProperty(se)&&b[se]!=null)if(se==="style"){var q=b[se];for(A in q)q.hasOwnProperty(A)&&(l||(l={}),l[A]="")}else se!=="dangerouslySetInnerHTML"&&se!=="children"&&se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&se!=="autoFocus"&&(a.hasOwnProperty(se)?v||(v=[]):(v=v||[]).push(se,null));for(se in h){var Q=h[se];if(q=b!=null?b[se]:void 0,h.hasOwnProperty(se)&&Q!==q&&(Q!=null||q!=null))if(se==="style")if(q){for(A in q)!q.hasOwnProperty(A)||Q&&Q.hasOwnProperty(A)||(l||(l={}),l[A]="");for(A in Q)Q.hasOwnProperty(A)&&q[A]!==Q[A]&&(l||(l={}),l[A]=Q[A])}else l||(v||(v=[]),v.push(se,l)),l=Q;else se==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,q=q?q.__html:void 0,Q!=null&&q!==Q&&(v=v||[]).push(se,Q)):se==="children"?typeof Q!="string"&&typeof Q!="number"||(v=v||[]).push(se,""+Q):se!=="suppressContentEditableWarning"&&se!=="suppressHydrationWarning"&&(a.hasOwnProperty(se)?(Q!=null&&se==="onScroll"&&At("scroll",s),v||q===Q||(v=[])):(v=v||[]).push(se,Q))}l&&(v=v||[]).push("style",l);var se=v;(i.updateQueue=se)&&(i.flags|=4)}},Dg=function(s,i,l,h){l!==h&&(i.flags|=4)};function Go(s,i){if(!jt)switch(s.tailMode){case"hidden":i=s.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?s.tail=null:l.sibling=null;break;case"collapsed":l=s.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?i||s.tail===null?s.tail=null:s.tail.sibling=null:h.sibling=null}}function Dn(s){var i=s.alternate!==null&&s.alternate.child===s.child,l=0,h=0;if(i)for(var b=s.child;b!==null;)l|=b.lanes|b.childLanes,h|=b.subtreeFlags&14680064,h|=b.flags&14680064,b.return=s,b=b.sibling;else for(b=s.child;b!==null;)l|=b.lanes|b.childLanes,h|=b.subtreeFlags,h|=b.flags,b.return=s,b=b.sibling;return s.subtreeFlags|=h,s.childLanes=l,i}function MT(s,i,l){var h=i.pendingProps;switch(Kd(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Dn(i),null;case 1:return Wn(i.type)&&Cl(),Dn(i),null;case 3:return h=i.stateNode,Oi(),It(zn),It(Nn),df(),h.pendingContext&&(h.context=h.pendingContext,h.pendingContext=null),(s===null||s.child===null)&&(Dl(i)?i.flags|=4:s===null||s.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Nr!==null&&(Uf(Nr),Nr=null))),Df(s,i),Dn(i),null;case 5:lf(i);var b=Na(Yo.current);if(l=i.type,s!==null&&i.stateNode!=null)Og(s,i,l,h,b),s.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!h){if(i.stateNode===null)throw Error(n(166));return Dn(i),null}if(s=Na(Yr.current),Dl(i)){h=i.stateNode,l=i.type;var v=i.memoizedProps;switch(h[Wr]=i,h[Bo]=v,s=(i.mode&1)!==0,l){case"dialog":At("cancel",h),At("close",h);break;case"iframe":case"object":case"embed":At("load",h);break;case"video":case"audio":for(b=0;b<Po.length;b++)At(Po[b],h);break;case"source":At("error",h);break;case"img":case"image":case"link":At("error",h),At("load",h);break;case"details":At("toggle",h);break;case"input":$t(h,v),At("invalid",h);break;case"select":h._wrapperState={wasMultiple:!!v.multiple},At("invalid",h);break;case"textarea":ln(h,v),At("invalid",h)}Mt(l,v),b=null;for(var A in v)if(v.hasOwnProperty(A)){var q=v[A];A==="children"?typeof q=="string"?h.textContent!==q&&(v.suppressHydrationWarning!==!0&&Tl(h.textContent,q,s),b=["children",q]):typeof q=="number"&&h.textContent!==""+q&&(v.suppressHydrationWarning!==!0&&Tl(h.textContent,q,s),b=["children",""+q]):a.hasOwnProperty(A)&&q!=null&&A==="onScroll"&&At("scroll",h)}switch(l){case"input":Fe(h),er(h,v,!0);break;case"textarea":Fe(h),cn(h);break;case"select":case"option":break;default:typeof v.onClick=="function"&&(h.onclick=wl)}h=b,i.updateQueue=h,h!==null&&(i.flags|=4)}else{A=b.nodeType===9?b:b.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=oe(l)),s==="http://www.w3.org/1999/xhtml"?l==="script"?(s=A.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof h.is=="string"?s=A.createElement(l,{is:h.is}):(s=A.createElement(l),l==="select"&&(A=s,h.multiple?A.multiple=!0:h.size&&(A.size=h.size))):s=A.createElementNS(s,l),s[Wr]=i,s[Bo]=h,Ng(s,i,!1,!1),i.stateNode=s;e:{switch(A=bt(l,h),l){case"dialog":At("cancel",s),At("close",s),b=h;break;case"iframe":case"object":case"embed":At("load",s),b=h;break;case"video":case"audio":for(b=0;b<Po.length;b++)At(Po[b],s);b=h;break;case"source":At("error",s),b=h;break;case"img":case"image":case"link":At("error",s),At("load",s),b=h;break;case"details":At("toggle",s),b=h;break;case"input":$t(s,h),b=Cn(s,h),At("invalid",s);break;case"option":b=h;break;case"select":s._wrapperState={wasMultiple:!!h.multiple},b=D({},h,{value:void 0}),At("invalid",s);break;case"textarea":ln(s,h),b=Dt(s,h),At("invalid",s);break;default:b=h}Mt(l,b),q=b;for(v in q)if(q.hasOwnProperty(v)){var Q=q[v];v==="style"?kn(s,Q):v==="dangerouslySetInnerHTML"?(Q=Q?Q.__html:void 0,Q!=null&&Ye(s,Q)):v==="children"?typeof Q=="string"?(l!=="textarea"||Q!=="")&&Xe(s,Q):typeof Q=="number"&&Xe(s,""+Q):v!=="suppressContentEditableWarning"&&v!=="suppressHydrationWarning"&&v!=="autoFocus"&&(a.hasOwnProperty(v)?Q!=null&&v==="onScroll"&&At("scroll",s):Q!=null&&O(s,v,Q,A))}switch(l){case"input":Fe(s),er(s,h,!1);break;case"textarea":Fe(s),cn(s);break;case"option":h.value!=null&&s.setAttribute("value",""+Ue(h.value));break;case"select":s.multiple=!!h.multiple,v=h.value,v!=null?vt(s,!!h.multiple,v,!1):h.defaultValue!=null&&vt(s,!!h.multiple,h.defaultValue,!0);break;default:typeof b.onClick=="function"&&(s.onclick=wl)}switch(l){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}}h&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return Dn(i),null;case 6:if(s&&i.stateNode!=null)Dg(s,i,s.memoizedProps,h);else{if(typeof h!="string"&&i.stateNode===null)throw Error(n(166));if(l=Na(Yo.current),Na(Yr.current),Dl(i)){if(h=i.stateNode,l=i.memoizedProps,h[Wr]=i,(v=h.nodeValue!==l)&&(s=rr,s!==null))switch(s.tag){case 3:Tl(h.nodeValue,l,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&Tl(h.nodeValue,l,(s.mode&1)!==0)}v&&(i.flags|=4)}else h=(l.nodeType===9?l:l.ownerDocument).createTextNode(h),h[Wr]=i,i.stateNode=h}return Dn(i),null;case 13:if(It(Ut),h=i.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(jt&&sr!==null&&(i.mode&1)!==0&&(i.flags&128)===0)Rp(),Ci(),i.flags|=98560,v=!1;else if(v=Dl(i),h!==null&&h.dehydrated!==null){if(s===null){if(!v)throw Error(n(318));if(v=i.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(n(317));v[Wr]=i}else Ci(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Dn(i),v=!1}else Nr!==null&&(Uf(Nr),Nr=null),v=!0;if(!v)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=l,i):(h=h!==null,h!==(s!==null&&s.memoizedState!==null)&&h&&(i.child.flags|=8192,(i.mode&1)!==0&&(s===null||(Ut.current&1)!==0?mn===0&&(mn=3):Yf())),i.updateQueue!==null&&(i.flags|=4),Dn(i),null);case 4:return Oi(),Df(s,i),s===null&&Fo(i.stateNode.containerInfo),Dn(i),null;case 10:return rf(i.type._context),Dn(i),null;case 17:return Wn(i.type)&&Cl(),Dn(i),null;case 19:if(It(Ut),v=i.memoizedState,v===null)return Dn(i),null;if(h=(i.flags&128)!==0,A=v.rendering,A===null)if(h)Go(v,!1);else{if(mn!==0||s!==null&&(s.flags&128)!==0)for(s=i.child;s!==null;){if(A=Pl(s),A!==null){for(i.flags|=128,Go(v,!1),h=A.updateQueue,h!==null&&(i.updateQueue=h,i.flags|=4),i.subtreeFlags=0,h=l,l=i.child;l!==null;)v=l,s=h,v.flags&=14680066,A=v.alternate,A===null?(v.childLanes=0,v.lanes=s,v.child=null,v.subtreeFlags=0,v.memoizedProps=null,v.memoizedState=null,v.updateQueue=null,v.dependencies=null,v.stateNode=null):(v.childLanes=A.childLanes,v.lanes=A.lanes,v.child=A.child,v.subtreeFlags=0,v.deletions=null,v.memoizedProps=A.memoizedProps,v.memoizedState=A.memoizedState,v.updateQueue=A.updateQueue,v.type=A.type,s=A.dependencies,v.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),l=l.sibling;return kt(Ut,Ut.current&1|2),i.child}s=s.sibling}v.tail!==null&&Ct()>Ri&&(i.flags|=128,h=!0,Go(v,!1),i.lanes=4194304)}else{if(!h)if(s=Pl(A),s!==null){if(i.flags|=128,h=!0,l=s.updateQueue,l!==null&&(i.updateQueue=l,i.flags|=4),Go(v,!0),v.tail===null&&v.tailMode==="hidden"&&!A.alternate&&!jt)return Dn(i),null}else 2*Ct()-v.renderingStartTime>Ri&&l!==1073741824&&(i.flags|=128,h=!0,Go(v,!1),i.lanes=4194304);v.isBackwards?(A.sibling=i.child,i.child=A):(l=v.last,l!==null?l.sibling=A:i.child=A,v.last=A)}return v.tail!==null?(i=v.tail,v.rendering=i,v.tail=i.sibling,v.renderingStartTime=Ct(),i.sibling=null,l=Ut.current,kt(Ut,h?l&1|2:l&1),i):(Dn(i),null);case 22:case 23:return Wf(),h=i.memoizedState!==null,s!==null&&s.memoizedState!==null!==h&&(i.flags|=8192),h&&(i.mode&1)!==0?(ar&1073741824)!==0&&(Dn(i),i.subtreeFlags&6&&(i.flags|=8192)):Dn(i),null;case 24:return null;case 25:return null}throw Error(n(156,i.tag))}function PT(s,i){switch(Kd(i),i.tag){case 1:return Wn(i.type)&&Cl(),s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 3:return Oi(),It(zn),It(Nn),df(),s=i.flags,(s&65536)!==0&&(s&128)===0?(i.flags=s&-65537|128,i):null;case 5:return lf(i),null;case 13:if(It(Ut),s=i.memoizedState,s!==null&&s.dehydrated!==null){if(i.alternate===null)throw Error(n(340));Ci()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 19:return It(Ut),null;case 4:return Oi(),null;case 10:return rf(i.type._context),null;case 22:case 23:return Wf(),null;case 24:return null;default:return null}}var ql=!1,An=!1,FT=typeof WeakSet=="function"?WeakSet:Set,Ce=null;function Ai(s,i){var l=s.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(h){Kt(s,i,h)}else l.current=null}function Af(s,i,l){try{l()}catch(h){Kt(s,i,h)}}var Ag=!1;function jT(s,i){if(zd=dl,s=lp(),Ld(s)){if("selectionStart"in s)var l={start:s.selectionStart,end:s.selectionEnd};else e:{l=(l=s.ownerDocument)&&l.defaultView||window;var h=l.getSelection&&l.getSelection();if(h&&h.rangeCount!==0){l=h.anchorNode;var b=h.anchorOffset,v=h.focusNode;h=h.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var A=0,q=-1,Q=-1,se=0,de=0,fe=s,le=null;t:for(;;){for(var Te;fe!==l||b!==0&&fe.nodeType!==3||(q=A+b),fe!==v||h!==0&&fe.nodeType!==3||(Q=A+h),fe.nodeType===3&&(A+=fe.nodeValue.length),(Te=fe.firstChild)!==null;)le=fe,fe=Te;for(;;){if(fe===s)break t;if(le===l&&++se===b&&(q=A),le===v&&++de===h&&(Q=A),(Te=fe.nextSibling)!==null)break;fe=le,le=fe.parentNode}fe=Te}l=q===-1||Q===-1?null:{start:q,end:Q}}else l=null}l=l||{start:0,end:0}}else l=null;for(Wd={focusedElem:s,selectionRange:l},dl=!1,Ce=i;Ce!==null;)if(i=Ce,s=i.child,(i.subtreeFlags&1028)!==0&&s!==null)s.return=i,Ce=s;else for(;Ce!==null;){i=Ce;try{var Oe=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(Oe!==null){var Ie=Oe.memoizedProps,en=Oe.memoizedState,te=i.stateNode,X=te.getSnapshotBeforeUpdate(i.elementType===i.type?Ie:Or(i.type,Ie),en);te.__reactInternalSnapshotBeforeUpdate=X}break;case 3:var re=i.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ge){Kt(i,i.return,ge)}if(s=i.sibling,s!==null){s.return=i.return,Ce=s;break}Ce=i.return}return Oe=Ag,Ag=!1,Oe}function Xo(s,i,l){var h=i.updateQueue;if(h=h!==null?h.lastEffect:null,h!==null){var b=h=h.next;do{if((b.tag&s)===s){var v=b.destroy;b.destroy=void 0,v!==void 0&&Af(i,l,v)}b=b.next}while(b!==h)}}function $l(s,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var l=i=i.next;do{if((l.tag&s)===s){var h=l.create;l.destroy=h()}l=l.next}while(l!==i)}}function If(s){var i=s.ref;if(i!==null){var l=s.stateNode;switch(s.tag){case 5:s=l;break;default:s=l}typeof i=="function"?i(s):i.current=s}}function Ig(s){var i=s.alternate;i!==null&&(s.alternate=null,Ig(i)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(i=s.stateNode,i!==null&&(delete i[Wr],delete i[Bo],delete i[Vd],delete i[ET],delete i[vT])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function Rg(s){return s.tag===5||s.tag===3||s.tag===4}function Lg(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Rg(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Rf(s,i,l){var h=s.tag;if(h===5||h===6)s=s.stateNode,i?l.nodeType===8?l.parentNode.insertBefore(s,i):l.insertBefore(s,i):(l.nodeType===8?(i=l.parentNode,i.insertBefore(s,l)):(i=l,i.appendChild(s)),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=wl));else if(h!==4&&(s=s.child,s!==null))for(Rf(s,i,l),s=s.sibling;s!==null;)Rf(s,i,l),s=s.sibling}function Lf(s,i,l){var h=s.tag;if(h===5||h===6)s=s.stateNode,i?l.insertBefore(s,i):l.appendChild(s);else if(h!==4&&(s=s.child,s!==null))for(Lf(s,i,l),s=s.sibling;s!==null;)Lf(s,i,l),s=s.sibling}var Tn=null,Dr=!1;function Ys(s,i,l){for(l=l.child;l!==null;)Mg(s,i,l),l=l.sibling}function Mg(s,i,l){if(zr&&typeof zr.onCommitFiberUnmount=="function")try{zr.onCommitFiberUnmount(al,l)}catch{}switch(l.tag){case 5:An||Ai(l,i);case 6:var h=Tn,b=Dr;Tn=null,Ys(s,i,l),Tn=h,Dr=b,Tn!==null&&(Dr?(s=Tn,l=l.stateNode,s.nodeType===8?s.parentNode.removeChild(l):s.removeChild(l)):Tn.removeChild(l.stateNode));break;case 18:Tn!==null&&(Dr?(s=Tn,l=l.stateNode,s.nodeType===8?$d(s.parentNode,l):s.nodeType===1&&$d(s,l),No(s)):$d(Tn,l.stateNode));break;case 4:h=Tn,b=Dr,Tn=l.stateNode.containerInfo,Dr=!0,Ys(s,i,l),Tn=h,Dr=b;break;case 0:case 11:case 14:case 15:if(!An&&(h=l.updateQueue,h!==null&&(h=h.lastEffect,h!==null))){b=h=h.next;do{var v=b,A=v.destroy;v=v.tag,A!==void 0&&((v&2)!==0||(v&4)!==0)&&Af(l,i,A),b=b.next}while(b!==h)}Ys(s,i,l);break;case 1:if(!An&&(Ai(l,i),h=l.stateNode,typeof h.componentWillUnmount=="function"))try{h.props=l.memoizedProps,h.state=l.memoizedState,h.componentWillUnmount()}catch(q){Kt(l,i,q)}Ys(s,i,l);break;case 21:Ys(s,i,l);break;case 22:l.mode&1?(An=(h=An)||l.memoizedState!==null,Ys(s,i,l),An=h):Ys(s,i,l);break;default:Ys(s,i,l)}}function Pg(s){var i=s.updateQueue;if(i!==null){s.updateQueue=null;var l=s.stateNode;l===null&&(l=s.stateNode=new FT),i.forEach(function(h){var b=VT.bind(null,s,h);l.has(h)||(l.add(h),h.then(b,b))})}}function Ar(s,i){var l=i.deletions;if(l!==null)for(var h=0;h<l.length;h++){var b=l[h];try{var v=s,A=i,q=A;e:for(;q!==null;){switch(q.tag){case 5:Tn=q.stateNode,Dr=!1;break e;case 3:Tn=q.stateNode.containerInfo,Dr=!0;break e;case 4:Tn=q.stateNode.containerInfo,Dr=!0;break e}q=q.return}if(Tn===null)throw Error(n(160));Mg(v,A,b),Tn=null,Dr=!1;var Q=b.alternate;Q!==null&&(Q.return=null),b.return=null}catch(se){Kt(b,i,se)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)Fg(i,s),i=i.sibling}function Fg(s,i){var l=s.alternate,h=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(Ar(i,s),$r(s),h&4){try{Xo(3,s,s.return),$l(3,s)}catch(Ie){Kt(s,s.return,Ie)}try{Xo(5,s,s.return)}catch(Ie){Kt(s,s.return,Ie)}}break;case 1:Ar(i,s),$r(s),h&512&&l!==null&&Ai(l,l.return);break;case 5:if(Ar(i,s),$r(s),h&512&&l!==null&&Ai(l,l.return),s.flags&32){var b=s.stateNode;try{Xe(b,"")}catch(Ie){Kt(s,s.return,Ie)}}if(h&4&&(b=s.stateNode,b!=null)){var v=s.memoizedProps,A=l!==null?l.memoizedProps:v,q=s.type,Q=s.updateQueue;if(s.updateQueue=null,Q!==null)try{q==="input"&&v.type==="radio"&&v.name!=null&&gt(b,v),bt(q,A);var se=bt(q,v);for(A=0;A<Q.length;A+=2){var de=Q[A],fe=Q[A+1];de==="style"?kn(b,fe):de==="dangerouslySetInnerHTML"?Ye(b,fe):de==="children"?Xe(b,fe):O(b,de,fe,se)}switch(q){case"input":Lt(b,v);break;case"textarea":tr(b,v);break;case"select":var le=b._wrapperState.wasMultiple;b._wrapperState.wasMultiple=!!v.multiple;var Te=v.value;Te!=null?vt(b,!!v.multiple,Te,!1):le!==!!v.multiple&&(v.defaultValue!=null?vt(b,!!v.multiple,v.defaultValue,!0):vt(b,!!v.multiple,v.multiple?[]:"",!1))}b[Bo]=v}catch(Ie){Kt(s,s.return,Ie)}}break;case 6:if(Ar(i,s),$r(s),h&4){if(s.stateNode===null)throw Error(n(162));b=s.stateNode,v=s.memoizedProps;try{b.nodeValue=v}catch(Ie){Kt(s,s.return,Ie)}}break;case 3:if(Ar(i,s),$r(s),h&4&&l!==null&&l.memoizedState.isDehydrated)try{No(i.containerInfo)}catch(Ie){Kt(s,s.return,Ie)}break;case 4:Ar(i,s),$r(s);break;case 13:Ar(i,s),$r(s),b=s.child,b.flags&8192&&(v=b.memoizedState!==null,b.stateNode.isHidden=v,!v||b.alternate!==null&&b.alternate.memoizedState!==null||(Ff=Ct())),h&4&&Pg(s);break;case 22:if(de=l!==null&&l.memoizedState!==null,s.mode&1?(An=(se=An)||de,Ar(i,s),An=se):Ar(i,s),$r(s),h&8192){if(se=s.memoizedState!==null,(s.stateNode.isHidden=se)&&!de&&(s.mode&1)!==0)for(Ce=s,de=s.child;de!==null;){for(fe=Ce=de;Ce!==null;){switch(le=Ce,Te=le.child,le.tag){case 0:case 11:case 14:case 15:Xo(4,le,le.return);break;case 1:Ai(le,le.return);var Oe=le.stateNode;if(typeof Oe.componentWillUnmount=="function"){h=le,l=le.return;try{i=h,Oe.props=i.memoizedProps,Oe.state=i.memoizedState,Oe.componentWillUnmount()}catch(Ie){Kt(h,l,Ie)}}break;case 5:Ai(le,le.return);break;case 22:if(le.memoizedState!==null){Hg(fe);continue}}Te!==null?(Te.return=le,Ce=Te):Hg(fe)}de=de.sibling}e:for(de=null,fe=s;;){if(fe.tag===5){if(de===null){de=fe;try{b=fe.stateNode,se?(v=b.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none"):(q=fe.stateNode,Q=fe.memoizedProps.style,A=Q!=null&&Q.hasOwnProperty("display")?Q.display:null,q.style.display=an("display",A))}catch(Ie){Kt(s,s.return,Ie)}}}else if(fe.tag===6){if(de===null)try{fe.stateNode.nodeValue=se?"":fe.memoizedProps}catch(Ie){Kt(s,s.return,Ie)}}else if((fe.tag!==22&&fe.tag!==23||fe.memoizedState===null||fe===s)&&fe.child!==null){fe.child.return=fe,fe=fe.child;continue}if(fe===s)break e;for(;fe.sibling===null;){if(fe.return===null||fe.return===s)break e;de===fe&&(de=null),fe=fe.return}de===fe&&(de=null),fe.sibling.return=fe.return,fe=fe.sibling}}break;case 19:Ar(i,s),$r(s),h&4&&Pg(s);break;case 21:break;default:Ar(i,s),$r(s)}}function $r(s){var i=s.flags;if(i&2){try{e:{for(var l=s.return;l!==null;){if(Rg(l)){var h=l;break e}l=l.return}throw Error(n(160))}switch(h.tag){case 5:var b=h.stateNode;h.flags&32&&(Xe(b,""),h.flags&=-33);var v=Lg(s);Lf(s,v,b);break;case 3:case 4:var A=h.stateNode.containerInfo,q=Lg(s);Rf(s,q,A);break;default:throw Error(n(161))}}catch(Q){Kt(s,s.return,Q)}s.flags&=-3}i&4096&&(s.flags&=-4097)}function BT(s,i,l){Ce=s,jg(s)}function jg(s,i,l){for(var h=(s.mode&1)!==0;Ce!==null;){var b=Ce,v=b.child;if(b.tag===22&&h){var A=b.memoizedState!==null||ql;if(!A){var q=b.alternate,Q=q!==null&&q.memoizedState!==null||An;q=ql;var se=An;if(ql=A,(An=Q)&&!se)for(Ce=b;Ce!==null;)A=Ce,Q=A.child,A.tag===22&&A.memoizedState!==null?Ug(b):Q!==null?(Q.return=A,Ce=Q):Ug(b);for(;v!==null;)Ce=v,jg(v),v=v.sibling;Ce=b,ql=q,An=se}Bg(s)}else(b.subtreeFlags&8772)!==0&&v!==null?(v.return=b,Ce=v):Bg(s)}}function Bg(s){for(;Ce!==null;){var i=Ce;if((i.flags&8772)!==0){var l=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:An||$l(5,i);break;case 1:var h=i.stateNode;if(i.flags&4&&!An)if(l===null)h.componentDidMount();else{var b=i.elementType===i.type?l.memoizedProps:Or(i.type,l.memoizedProps);h.componentDidUpdate(b,l.memoizedState,h.__reactInternalSnapshotBeforeUpdate)}var v=i.updateQueue;v!==null&&Hp(i,v,h);break;case 3:var A=i.updateQueue;if(A!==null){if(l=null,i.child!==null)switch(i.child.tag){case 5:l=i.child.stateNode;break;case 1:l=i.child.stateNode}Hp(i,A,l)}break;case 5:var q=i.stateNode;if(l===null&&i.flags&4){l=q;var Q=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":Q.autoFocus&&l.focus();break;case"img":Q.src&&(l.src=Q.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var se=i.alternate;if(se!==null){var de=se.memoizedState;if(de!==null){var fe=de.dehydrated;fe!==null&&No(fe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}An||i.flags&512&&If(i)}catch(le){Kt(i,i.return,le)}}if(i===s){Ce=null;break}if(l=i.sibling,l!==null){l.return=i.return,Ce=l;break}Ce=i.return}}function Hg(s){for(;Ce!==null;){var i=Ce;if(i===s){Ce=null;break}var l=i.sibling;if(l!==null){l.return=i.return,Ce=l;break}Ce=i.return}}function Ug(s){for(;Ce!==null;){var i=Ce;try{switch(i.tag){case 0:case 11:case 15:var l=i.return;try{$l(4,i)}catch(Q){Kt(i,l,Q)}break;case 1:var h=i.stateNode;if(typeof h.componentDidMount=="function"){var b=i.return;try{h.componentDidMount()}catch(Q){Kt(i,b,Q)}}var v=i.return;try{If(i)}catch(Q){Kt(i,v,Q)}break;case 5:var A=i.return;try{If(i)}catch(Q){Kt(i,A,Q)}}}catch(Q){Kt(i,i.return,Q)}if(i===s){Ce=null;break}var q=i.sibling;if(q!==null){q.return=i.return,Ce=q;break}Ce=i.return}}var HT=Math.ceil,Vl=L.ReactCurrentDispatcher,Mf=L.ReactCurrentOwner,gr=L.ReactCurrentBatchConfig,at=0,yn=null,on=null,wn=0,ar=0,Ii=Bs(0),mn=0,Ko=null,Da=0,Ql=0,Pf=0,Jo=null,qn=null,Ff=0,Ri=1/0,ys=null,Gl=!1,jf=null,qs=null,Xl=!1,$s=null,Kl=0,Zo=0,Bf=null,Jl=-1,Zl=0;function jn(){return(at&6)!==0?Ct():Jl!==-1?Jl:Jl=Ct()}function Vs(s){return(s.mode&1)===0?1:(at&2)!==0&&wn!==0?wn&-wn:wT.transition!==null?(Zl===0&&(Zl=Lm()),Zl):(s=mt,s!==0||(s=window.event,s=s===void 0?16:Wm(s.type)),s)}function Ir(s,i,l,h){if(50<Zo)throw Zo=0,Bf=null,Error(n(185));wo(s,l,h),((at&2)===0||s!==yn)&&(s===yn&&((at&2)===0&&(Ql|=l),mn===4&&Qs(s,wn)),$n(s,h),l===1&&at===0&&(i.mode&1)===0&&(Ri=Ct()+500,_l&&Us()))}function $n(s,i){var l=s.callbackNode;wv(s,i);var h=ul(s,s===yn?wn:0);if(h===0)l!==null&&St(l),s.callbackNode=null,s.callbackPriority=0;else if(i=h&-h,s.callbackPriority!==i){if(l!=null&&St(l),i===1)s.tag===0?TT(Wg.bind(null,s)):Np(Wg.bind(null,s)),bT(function(){(at&6)===0&&Us()}),l=null;else{switch(Mm(h)){case 1:l=Ta;break;case 4:l=Im;break;case 16:l=sl;break;case 536870912:l=Rm;break;default:l=sl}l=Kg(l,zg.bind(null,s))}s.callbackPriority=i,s.callbackNode=l}}function zg(s,i){if(Jl=-1,Zl=0,(at&6)!==0)throw Error(n(327));var l=s.callbackNode;if(Li()&&s.callbackNode!==l)return null;var h=ul(s,s===yn?wn:0);if(h===0)return null;if((h&30)!==0||(h&s.expiredLanes)!==0||i)i=ec(s,h);else{i=h;var b=at;at|=2;var v=qg();(yn!==s||wn!==i)&&(ys=null,Ri=Ct()+500,Ia(s,i));do try{WT();break}catch(q){Yg(s,q)}while(!0);nf(),Vl.current=v,at=b,on!==null?i=0:(yn=null,wn=0,i=mn)}if(i!==0){if(i===2&&(b=bd(s),b!==0&&(h=b,i=Hf(s,b))),i===1)throw l=Ko,Ia(s,0),Qs(s,h),$n(s,Ct()),l;if(i===6)Qs(s,h);else{if(b=s.current.alternate,(h&30)===0&&!UT(b)&&(i=ec(s,h),i===2&&(v=bd(s),v!==0&&(h=v,i=Hf(s,v))),i===1))throw l=Ko,Ia(s,0),Qs(s,h),$n(s,Ct()),l;switch(s.finishedWork=b,s.finishedLanes=h,i){case 0:case 1:throw Error(n(345));case 2:Ra(s,qn,ys);break;case 3:if(Qs(s,h),(h&130023424)===h&&(i=Ff+500-Ct(),10<i)){if(ul(s,0)!==0)break;if(b=s.suspendedLanes,(b&h)!==h){jn(),s.pingedLanes|=s.suspendedLanes&b;break}s.timeoutHandle=qd(Ra.bind(null,s,qn,ys),i);break}Ra(s,qn,ys);break;case 4:if(Qs(s,h),(h&4194240)===h)break;for(i=s.eventTimes,b=-1;0<h;){var A=31-kr(h);v=1<<A,A=i[A],A>b&&(b=A),h&=~v}if(h=b,h=Ct()-h,h=(120>h?120:480>h?480:1080>h?1080:1920>h?1920:3e3>h?3e3:4320>h?4320:1960*HT(h/1960))-h,10<h){s.timeoutHandle=qd(Ra.bind(null,s,qn,ys),h);break}Ra(s,qn,ys);break;case 5:Ra(s,qn,ys);break;default:throw Error(n(329))}}}return $n(s,Ct()),s.callbackNode===l?zg.bind(null,s):null}function Hf(s,i){var l=Jo;return s.current.memoizedState.isDehydrated&&(Ia(s,i).flags|=256),s=ec(s,i),s!==2&&(i=qn,qn=l,i!==null&&Uf(i)),s}function Uf(s){qn===null?qn=s:qn.push.apply(qn,s)}function UT(s){for(var i=s;;){if(i.flags&16384){var l=i.updateQueue;if(l!==null&&(l=l.stores,l!==null))for(var h=0;h<l.length;h++){var b=l[h],v=b.getSnapshot;b=b.value;try{if(!_r(v(),b))return!1}catch{return!1}}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Qs(s,i){for(i&=~Pf,i&=~Ql,s.suspendedLanes|=i,s.pingedLanes&=~i,s=s.expirationTimes;0<i;){var l=31-kr(i),h=1<<l;s[l]=-1,i&=~h}}function Wg(s){if((at&6)!==0)throw Error(n(327));Li();var i=ul(s,0);if((i&1)===0)return $n(s,Ct()),null;var l=ec(s,i);if(s.tag!==0&&l===2){var h=bd(s);h!==0&&(i=h,l=Hf(s,h))}if(l===1)throw l=Ko,Ia(s,0),Qs(s,i),$n(s,Ct()),l;if(l===6)throw Error(n(345));return s.finishedWork=s.current.alternate,s.finishedLanes=i,Ra(s,qn,ys),$n(s,Ct()),null}function zf(s,i){var l=at;at|=1;try{return s(i)}finally{at=l,at===0&&(Ri=Ct()+500,_l&&Us())}}function Aa(s){$s!==null&&$s.tag===0&&(at&6)===0&&Li();var i=at;at|=1;var l=gr.transition,h=mt;try{if(gr.transition=null,mt=1,s)return s()}finally{mt=h,gr.transition=l,at=i,(at&6)===0&&Us()}}function Wf(){ar=Ii.current,It(Ii)}function Ia(s,i){s.finishedWork=null,s.finishedLanes=0;var l=s.timeoutHandle;if(l!==-1&&(s.timeoutHandle=-1,yT(l)),on!==null)for(l=on.return;l!==null;){var h=l;switch(Kd(h),h.tag){case 1:h=h.type.childContextTypes,h!=null&&Cl();break;case 3:Oi(),It(zn),It(Nn),df();break;case 5:lf(h);break;case 4:Oi();break;case 13:It(Ut);break;case 19:It(Ut);break;case 10:rf(h.type._context);break;case 22:case 23:Wf()}l=l.return}if(yn=s,on=s=Gs(s.current,null),wn=ar=i,mn=0,Ko=null,Pf=Ql=Da=0,qn=Jo=null,_a!==null){for(i=0;i<_a.length;i++)if(l=_a[i],h=l.interleaved,h!==null){l.interleaved=null;var b=h.next,v=l.pending;if(v!==null){var A=v.next;v.next=b,h.next=A}l.pending=h}_a=null}return s}function Yg(s,i){do{var l=on;try{if(nf(),Fl.current=Ul,jl){for(var h=zt.memoizedState;h!==null;){var b=h.queue;b!==null&&(b.pending=null),h=h.next}jl=!1}if(Oa=0,gn=hn=zt=null,qo=!1,$o=0,Mf.current=null,l===null||l.return===null){mn=1,Ko=i,on=null;break}e:{var v=s,A=l.return,q=l,Q=i;if(i=wn,q.flags|=32768,Q!==null&&typeof Q=="object"&&typeof Q.then=="function"){var se=Q,de=q,fe=de.tag;if((de.mode&1)===0&&(fe===0||fe===11||fe===15)){var le=de.alternate;le?(de.updateQueue=le.updateQueue,de.memoizedState=le.memoizedState,de.lanes=le.lanes):(de.updateQueue=null,de.memoizedState=null)}var Te=pg(A);if(Te!==null){Te.flags&=-257,gg(Te,A,q,v,i),Te.mode&1&&mg(v,se,i),i=Te,Q=se;var Oe=i.updateQueue;if(Oe===null){var Ie=new Set;Ie.add(Q),i.updateQueue=Ie}else Oe.add(Q);break e}else{if((i&1)===0){mg(v,se,i),Yf();break e}Q=Error(n(426))}}else if(jt&&q.mode&1){var en=pg(A);if(en!==null){(en.flags&65536)===0&&(en.flags|=256),gg(en,A,q,v,i),ef(Di(Q,q));break e}}v=Q=Di(Q,q),mn!==4&&(mn=2),Jo===null?Jo=[v]:Jo.push(v),v=A;do{switch(v.tag){case 3:v.flags|=65536,i&=-i,v.lanes|=i;var te=fg(v,Q,i);Bp(v,te);break e;case 1:q=Q;var X=v.type,re=v.stateNode;if((v.flags&128)===0&&(typeof X.getDerivedStateFromError=="function"||re!==null&&typeof re.componentDidCatch=="function"&&(qs===null||!qs.has(re)))){v.flags|=65536,i&=-i,v.lanes|=i;var ge=hg(v,q,i);Bp(v,ge);break e}}v=v.return}while(v!==null)}Vg(l)}catch(Re){i=Re,on===l&&l!==null&&(on=l=l.return);continue}break}while(!0)}function qg(){var s=Vl.current;return Vl.current=Ul,s===null?Ul:s}function Yf(){(mn===0||mn===3||mn===2)&&(mn=4),yn===null||(Da&268435455)===0&&(Ql&268435455)===0||Qs(yn,wn)}function ec(s,i){var l=at;at|=2;var h=qg();(yn!==s||wn!==i)&&(ys=null,Ia(s,i));do try{zT();break}catch(b){Yg(s,b)}while(!0);if(nf(),at=l,Vl.current=h,on!==null)throw Error(n(261));return yn=null,wn=0,mn}function zT(){for(;on!==null;)$g(on)}function WT(){for(;on!==null&&!vo();)$g(on)}function $g(s){var i=Xg(s.alternate,s,ar);s.memoizedProps=s.pendingProps,i===null?Vg(s):on=i,Mf.current=null}function Vg(s){var i=s;do{var l=i.alternate;if(s=i.return,(i.flags&32768)===0){if(l=MT(l,i,ar),l!==null){on=l;return}}else{if(l=PT(l,i),l!==null){l.flags&=32767,on=l;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{mn=6,on=null;return}}if(i=i.sibling,i!==null){on=i;return}on=i=s}while(i!==null);mn===0&&(mn=5)}function Ra(s,i,l){var h=mt,b=gr.transition;try{gr.transition=null,mt=1,YT(s,i,l,h)}finally{gr.transition=b,mt=h}return null}function YT(s,i,l,h){do Li();while($s!==null);if((at&6)!==0)throw Error(n(327));l=s.finishedWork;var b=s.finishedLanes;if(l===null)return null;if(s.finishedWork=null,s.finishedLanes=0,l===s.current)throw Error(n(177));s.callbackNode=null,s.callbackPriority=0;var v=l.lanes|l.childLanes;if(Sv(s,v),s===yn&&(on=yn=null,wn=0),(l.subtreeFlags&2064)===0&&(l.flags&2064)===0||Xl||(Xl=!0,Kg(sl,function(){return Li(),null})),v=(l.flags&15990)!==0,(l.subtreeFlags&15990)!==0||v){v=gr.transition,gr.transition=null;var A=mt;mt=1;var q=at;at|=4,Mf.current=null,jT(s,l),Fg(l,s),cT(Wd),dl=!!zd,Wd=zd=null,s.current=l,BT(l),fi(),at=q,mt=A,gr.transition=v}else s.current=l;if(Xl&&(Xl=!1,$s=s,Kl=b),v=s.pendingLanes,v===0&&(qs=null),bv(l.stateNode),$n(s,Ct()),i!==null)for(h=s.onRecoverableError,l=0;l<i.length;l++)b=i[l],h(b.value,{componentStack:b.stack,digest:b.digest});if(Gl)throw Gl=!1,s=jf,jf=null,s;return(Kl&1)!==0&&s.tag!==0&&Li(),v=s.pendingLanes,(v&1)!==0?s===Bf?Zo++:(Zo=0,Bf=s):Zo=0,Us(),null}function Li(){if($s!==null){var s=Mm(Kl),i=gr.transition,l=mt;try{if(gr.transition=null,mt=16>s?16:s,$s===null)var h=!1;else{if(s=$s,$s=null,Kl=0,(at&6)!==0)throw Error(n(331));var b=at;for(at|=4,Ce=s.current;Ce!==null;){var v=Ce,A=v.child;if((Ce.flags&16)!==0){var q=v.deletions;if(q!==null){for(var Q=0;Q<q.length;Q++){var se=q[Q];for(Ce=se;Ce!==null;){var de=Ce;switch(de.tag){case 0:case 11:case 15:Xo(8,de,v)}var fe=de.child;if(fe!==null)fe.return=de,Ce=fe;else for(;Ce!==null;){de=Ce;var le=de.sibling,Te=de.return;if(Ig(de),de===se){Ce=null;break}if(le!==null){le.return=Te,Ce=le;break}Ce=Te}}}var Oe=v.alternate;if(Oe!==null){var Ie=Oe.child;if(Ie!==null){Oe.child=null;do{var en=Ie.sibling;Ie.sibling=null,Ie=en}while(Ie!==null)}}Ce=v}}if((v.subtreeFlags&2064)!==0&&A!==null)A.return=v,Ce=A;else e:for(;Ce!==null;){if(v=Ce,(v.flags&2048)!==0)switch(v.tag){case 0:case 11:case 15:Xo(9,v,v.return)}var te=v.sibling;if(te!==null){te.return=v.return,Ce=te;break e}Ce=v.return}}var X=s.current;for(Ce=X;Ce!==null;){A=Ce;var re=A.child;if((A.subtreeFlags&2064)!==0&&re!==null)re.return=A,Ce=re;else e:for(A=X;Ce!==null;){if(q=Ce,(q.flags&2048)!==0)try{switch(q.tag){case 0:case 11:case 15:$l(9,q)}}catch(Re){Kt(q,q.return,Re)}if(q===A){Ce=null;break e}var ge=q.sibling;if(ge!==null){ge.return=q.return,Ce=ge;break e}Ce=q.return}}if(at=b,Us(),zr&&typeof zr.onPostCommitFiberRoot=="function")try{zr.onPostCommitFiberRoot(al,s)}catch{}h=!0}return h}finally{mt=l,gr.transition=i}}return!1}function Qg(s,i,l){i=Di(l,i),i=fg(s,i,1),s=Ws(s,i,1),i=jn(),s!==null&&(wo(s,1,i),$n(s,i))}function Kt(s,i,l){if(s.tag===3)Qg(s,s,l);else for(;i!==null;){if(i.tag===3){Qg(i,s,l);break}else if(i.tag===1){var h=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(qs===null||!qs.has(h))){s=Di(l,s),s=hg(i,s,1),i=Ws(i,s,1),s=jn(),i!==null&&(wo(i,1,s),$n(i,s));break}}i=i.return}}function qT(s,i,l){var h=s.pingCache;h!==null&&h.delete(i),i=jn(),s.pingedLanes|=s.suspendedLanes&l,yn===s&&(wn&l)===l&&(mn===4||mn===3&&(wn&130023424)===wn&&500>Ct()-Ff?Ia(s,0):Pf|=l),$n(s,i)}function Gg(s,i){i===0&&((s.mode&1)===0?i=1:(i=ol,ol<<=1,(ol&130023424)===0&&(ol=4194304)));var l=jn();s=ms(s,i),s!==null&&(wo(s,i,l),$n(s,l))}function $T(s){var i=s.memoizedState,l=0;i!==null&&(l=i.retryLane),Gg(s,l)}function VT(s,i){var l=0;switch(s.tag){case 13:var h=s.stateNode,b=s.memoizedState;b!==null&&(l=b.retryLane);break;case 19:h=s.stateNode;break;default:throw Error(n(314))}h!==null&&h.delete(i),Gg(s,l)}var Xg;Xg=function(s,i,l){if(s!==null)if(s.memoizedProps!==i.pendingProps||zn.current)Yn=!0;else{if((s.lanes&l)===0&&(i.flags&128)===0)return Yn=!1,LT(s,i,l);Yn=(s.flags&131072)!==0}else Yn=!1,jt&&(i.flags&1048576)!==0&&Op(i,Ol,i.index);switch(i.lanes=0,i.tag){case 2:var h=i.type;Yl(s,i),s=i.pendingProps;var b=Ti(i,Nn.current);Ni(i,l),b=mf(null,i,h,s,b,l);var v=pf();return i.flags|=1,typeof b=="object"&&b!==null&&typeof b.render=="function"&&b.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,Wn(h)?(v=!0,kl(i)):v=!1,i.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,of(i),b.updater=zl,i.stateNode=b,b._reactInternals=i,vf(i,h,s,l),i=Cf(null,i,h,!0,v,l)):(i.tag=0,jt&&v&&Xd(i),Fn(null,i,b,l),i=i.child),i;case 16:h=i.elementType;e:{switch(Yl(s,i),s=i.pendingProps,b=h._init,h=b(h._payload),i.type=h,b=i.tag=GT(h),s=Or(h,s),b){case 0:i=Sf(null,i,h,s,l);break e;case 1:i=Tg(null,i,h,s,l);break e;case 11:i=yg(null,i,h,s,l);break e;case 14:i=bg(null,i,h,Or(h.type,s),l);break e}throw Error(n(306,h,""))}return i;case 0:return h=i.type,b=i.pendingProps,b=i.elementType===h?b:Or(h,b),Sf(s,i,h,b,l);case 1:return h=i.type,b=i.pendingProps,b=i.elementType===h?b:Or(h,b),Tg(s,i,h,b,l);case 3:e:{if(wg(i),s===null)throw Error(n(387));h=i.pendingProps,v=i.memoizedState,b=v.element,jp(s,i),Ml(i,h,null,l);var A=i.memoizedState;if(h=A.element,v.isDehydrated)if(v={element:h,isDehydrated:!1,cache:A.cache,pendingSuspenseBoundaries:A.pendingSuspenseBoundaries,transitions:A.transitions},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){b=Di(Error(n(423)),i),i=Sg(s,i,h,l,b);break e}else if(h!==b){b=Di(Error(n(424)),i),i=Sg(s,i,h,l,b);break e}else for(sr=js(i.stateNode.containerInfo.firstChild),rr=i,jt=!0,Nr=null,l=Pp(i,null,h,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Ci(),h===b){i=gs(s,i,l);break e}Fn(s,i,h,l)}i=i.child}return i;case 5:return Up(i),s===null&&Zd(i),h=i.type,b=i.pendingProps,v=s!==null?s.memoizedProps:null,A=b.children,Yd(h,b)?A=null:v!==null&&Yd(h,v)&&(i.flags|=32),vg(s,i),Fn(s,i,A,l),i.child;case 6:return s===null&&Zd(i),null;case 13:return Cg(s,i,l);case 4:return uf(i,i.stateNode.containerInfo),h=i.pendingProps,s===null?i.child=ki(i,null,h,l):Fn(s,i,h,l),i.child;case 11:return h=i.type,b=i.pendingProps,b=i.elementType===h?b:Or(h,b),yg(s,i,h,b,l);case 7:return Fn(s,i,i.pendingProps,l),i.child;case 8:return Fn(s,i,i.pendingProps.children,l),i.child;case 12:return Fn(s,i,i.pendingProps.children,l),i.child;case 10:e:{if(h=i.type._context,b=i.pendingProps,v=i.memoizedProps,A=b.value,kt(Il,h._currentValue),h._currentValue=A,v!==null)if(_r(v.value,A)){if(v.children===b.children&&!zn.current){i=gs(s,i,l);break e}}else for(v=i.child,v!==null&&(v.return=i);v!==null;){var q=v.dependencies;if(q!==null){A=v.child;for(var Q=q.firstContext;Q!==null;){if(Q.context===h){if(v.tag===1){Q=ps(-1,l&-l),Q.tag=2;var se=v.updateQueue;if(se!==null){se=se.shared;var de=se.pending;de===null?Q.next=Q:(Q.next=de.next,de.next=Q),se.pending=Q}}v.lanes|=l,Q=v.alternate,Q!==null&&(Q.lanes|=l),sf(v.return,l,i),q.lanes|=l;break}Q=Q.next}}else if(v.tag===10)A=v.type===i.type?null:v.child;else if(v.tag===18){if(A=v.return,A===null)throw Error(n(341));A.lanes|=l,q=A.alternate,q!==null&&(q.lanes|=l),sf(A,l,i),A=v.sibling}else A=v.child;if(A!==null)A.return=v;else for(A=v;A!==null;){if(A===i){A=null;break}if(v=A.sibling,v!==null){v.return=A.return,A=v;break}A=A.return}v=A}Fn(s,i,b.children,l),i=i.child}return i;case 9:return b=i.type,h=i.pendingProps.children,Ni(i,l),b=mr(b),h=h(b),i.flags|=1,Fn(s,i,h,l),i.child;case 14:return h=i.type,b=Or(h,i.pendingProps),b=Or(h.type,b),bg(s,i,h,b,l);case 15:return xg(s,i,i.type,i.pendingProps,l);case 17:return h=i.type,b=i.pendingProps,b=i.elementType===h?b:Or(h,b),Yl(s,i),i.tag=1,Wn(h)?(s=!0,kl(i)):s=!1,Ni(i,l),cg(i,h,b),vf(i,h,b,l),Cf(null,i,h,!0,s,l);case 19:return _g(s,i,l);case 22:return Eg(s,i,l)}throw Error(n(156,i.tag))};function Kg(s,i){return va(s,i)}function QT(s,i,l,h){this.tag=s,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yr(s,i,l,h){return new QT(s,i,l,h)}function qf(s){return s=s.prototype,!(!s||!s.isReactComponent)}function GT(s){if(typeof s=="function")return qf(s)?1:0;if(s!=null){if(s=s.$$typeof,s===F)return 11;if(s===J)return 14}return 2}function Gs(s,i){var l=s.alternate;return l===null?(l=yr(s.tag,i,s.key,s.mode),l.elementType=s.elementType,l.type=s.type,l.stateNode=s.stateNode,l.alternate=s,s.alternate=l):(l.pendingProps=i,l.type=s.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=s.flags&14680064,l.childLanes=s.childLanes,l.lanes=s.lanes,l.child=s.child,l.memoizedProps=s.memoizedProps,l.memoizedState=s.memoizedState,l.updateQueue=s.updateQueue,i=s.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=s.sibling,l.index=s.index,l.ref=s.ref,l}function tc(s,i,l,h,b,v){var A=2;if(h=s,typeof s=="function")qf(s)&&(A=1);else if(typeof s=="string")A=5;else e:switch(s){case N:return La(l.children,b,v,i);case R:A=8,b|=8;break;case j:return s=yr(12,l,i,b|2),s.elementType=j,s.lanes=v,s;case W:return s=yr(13,l,i,b),s.elementType=W,s.lanes=v,s;case V:return s=yr(19,l,i,b),s.elementType=V,s.lanes=v,s;case Z:return nc(l,b,v,i);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case M:A=10;break e;case P:A=9;break e;case F:A=11;break e;case J:A=14;break e;case K:A=16,h=null;break e}throw Error(n(130,s==null?s:typeof s,""))}return i=yr(A,l,i,b),i.elementType=s,i.type=h,i.lanes=v,i}function La(s,i,l,h){return s=yr(7,s,h,i),s.lanes=l,s}function nc(s,i,l,h){return s=yr(22,s,h,i),s.elementType=Z,s.lanes=l,s.stateNode={isHidden:!1},s}function $f(s,i,l){return s=yr(6,s,null,i),s.lanes=l,s}function Vf(s,i,l){return i=yr(4,s.children!==null?s.children:[],s.key,i),i.lanes=l,i.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},i}function XT(s,i,l,h,b){this.tag=i,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xd(0),this.expirationTimes=xd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xd(0),this.identifierPrefix=h,this.onRecoverableError=b,this.mutableSourceEagerHydrationData=null}function Qf(s,i,l,h,b,v,A,q,Q){return s=new XT(s,i,l,q,Q),i===1?(i=1,v===!0&&(i|=8)):i=0,v=yr(3,null,null,i),s.current=v,v.stateNode=s,v.memoizedState={element:h,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},of(v),s}function KT(s,i,l){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:k,key:h==null?null:""+h,children:s,containerInfo:i,implementation:l}}function Jg(s){if(!s)return Hs;s=s._reactInternals;e:{if(wt(s)!==s||s.tag!==1)throw Error(n(170));var i=s;do{switch(i.tag){case 3:i=i.stateNode.context;break e;case 1:if(Wn(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(n(171))}if(s.tag===1){var l=s.type;if(Wn(l))return kp(s,l,i)}return i}function Zg(s,i,l,h,b,v,A,q,Q){return s=Qf(l,h,!0,s,b,v,A,q,Q),s.context=Jg(null),l=s.current,h=jn(),b=Vs(l),v=ps(h,b),v.callback=i??null,Ws(l,v,b),s.current.lanes=b,wo(s,b,h),$n(s,h),s}function rc(s,i,l,h){var b=i.current,v=jn(),A=Vs(b);return l=Jg(l),i.context===null?i.context=l:i.pendingContext=l,i=ps(v,A),i.payload={element:s},h=h===void 0?null:h,h!==null&&(i.callback=h),s=Ws(b,i,A),s!==null&&(Ir(s,b,A,v),Ll(s,b,A)),A}function sc(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function ey(s,i){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var l=s.retryLane;s.retryLane=l!==0&&l<i?l:i}}function Gf(s,i){ey(s,i),(s=s.alternate)&&ey(s,i)}function JT(){return null}var ty=typeof reportError=="function"?reportError:function(s){console.error(s)};function Xf(s){this._internalRoot=s}ac.prototype.render=Xf.prototype.render=function(s){var i=this._internalRoot;if(i===null)throw Error(n(409));rc(s,i,null,null)},ac.prototype.unmount=Xf.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var i=s.containerInfo;Aa(function(){rc(null,s,null,null)}),i[cs]=null}};function ac(s){this._internalRoot=s}ac.prototype.unstable_scheduleHydration=function(s){if(s){var i=jm();s={blockedOn:null,target:s,priority:i};for(var l=0;l<Ms.length&&i!==0&&i<Ms[l].priority;l++);Ms.splice(l,0,s),l===0&&Um(s)}};function Kf(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function ic(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function ny(){}function ZT(s,i,l,h,b){if(b){if(typeof h=="function"){var v=h;h=function(){var se=sc(A);v.call(se)}}var A=Zg(i,h,s,0,null,!1,!1,"",ny);return s._reactRootContainer=A,s[cs]=A.current,Fo(s.nodeType===8?s.parentNode:s),Aa(),A}for(;b=s.lastChild;)s.removeChild(b);if(typeof h=="function"){var q=h;h=function(){var se=sc(Q);q.call(se)}}var Q=Qf(s,0,!1,null,null,!1,!1,"",ny);return s._reactRootContainer=Q,s[cs]=Q.current,Fo(s.nodeType===8?s.parentNode:s),Aa(function(){rc(i,Q,l,h)}),Q}function oc(s,i,l,h,b){var v=l._reactRootContainer;if(v){var A=v;if(typeof b=="function"){var q=b;b=function(){var Q=sc(A);q.call(Q)}}rc(i,A,s,b)}else A=ZT(l,i,s,b,h);return sc(A)}Pm=function(s){switch(s.tag){case 3:var i=s.stateNode;if(i.current.memoizedState.isDehydrated){var l=To(i.pendingLanes);l!==0&&(Ed(i,l|1),$n(i,Ct()),(at&6)===0&&(Ri=Ct()+500,Us()))}break;case 13:Aa(function(){var h=ms(s,1);if(h!==null){var b=jn();Ir(h,s,1,b)}}),Gf(s,1)}},vd=function(s){if(s.tag===13){var i=ms(s,134217728);if(i!==null){var l=jn();Ir(i,s,134217728,l)}Gf(s,134217728)}},Fm=function(s){if(s.tag===13){var i=Vs(s),l=ms(s,i);if(l!==null){var h=jn();Ir(l,s,i,h)}Gf(s,i)}},jm=function(){return mt},Bm=function(s,i){var l=mt;try{return mt=s,i()}finally{mt=l}},Pe=function(s,i,l){switch(i){case"input":if(Lt(s,l),i=l.name,l.type==="radio"&&i!=null){for(l=s;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<l.length;i++){var h=l[i];if(h!==s&&h.form===s.form){var b=Sl(h);if(!b)throw Error(n(90));Rt(h),Lt(h,b)}}}break;case"textarea":tr(s,l);break;case"select":i=l.value,i!=null&&vt(s,!!l.multiple,i,!1)}},Pt=zf,Qt=Aa;var ew={usingClientEntryPoint:!1,Events:[Ho,Ei,Sl,et,_e,zf]},eu={findFiberByHostInstance:wa,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},tw={bundleType:eu.bundleType,version:eu.version,rendererPackageName:eu.rendererPackageName,rendererConfig:eu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:L.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=dr(s),s===null?null:s.stateNode},findFiberByHostInstance:eu.findFiberByHostInstance||JT,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 uc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!uc.isDisabled&&uc.supportsFiber)try{al=uc.inject(tw),zr=uc}catch{}}return Vn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ew,Vn.createPortal=function(s,i){var l=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Kf(i))throw Error(n(200));return KT(s,i,null,l)},Vn.createRoot=function(s,i){if(!Kf(s))throw Error(n(299));var l=!1,h="",b=ty;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onRecoverableError!==void 0&&(b=i.onRecoverableError)),i=Qf(s,1,!1,null,null,l,!1,h,b),s[cs]=i.current,Fo(s.nodeType===8?s.parentNode:s),new Xf(i)},Vn.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var i=s._reactInternals;if(i===void 0)throw typeof s.render=="function"?Error(n(188)):(s=Object.keys(s).join(","),Error(n(268,s)));return s=dr(i),s=s===null?null:s.stateNode,s},Vn.flushSync=function(s){return Aa(s)},Vn.hydrate=function(s,i,l){if(!ic(i))throw Error(n(200));return oc(null,s,i,!0,l)},Vn.hydrateRoot=function(s,i,l){if(!Kf(s))throw Error(n(405));var h=l!=null&&l.hydratedSources||null,b=!1,v="",A=ty;if(l!=null&&(l.unstable_strictMode===!0&&(b=!0),l.identifierPrefix!==void 0&&(v=l.identifierPrefix),l.onRecoverableError!==void 0&&(A=l.onRecoverableError)),i=Zg(i,null,s,1,l??null,b,!1,v,A),s[cs]=i.current,Fo(s),h)for(s=0;s<h.length;s++)l=h[s],b=l._getVersion,b=b(l._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[l,b]:i.mutableSourceEagerHydrationData.push(l,b);return new ac(i)},Vn.render=function(s,i,l){if(!ic(i))throw Error(n(200));return oc(null,s,i,!1,l)},Vn.unmountComponentAtNode=function(s){if(!ic(s))throw Error(n(40));return s._reactRootContainer?(Aa(function(){oc(null,null,s,!1,function(){s._reactRootContainer=null,s[cs]=null})}),!0):!1},Vn.unstable_batchedUpdates=zf,Vn.unstable_renderSubtreeIntoContainer=function(s,i,l,h){if(!ic(l))throw Error(n(200));if(s==null||s._reactInternals===void 0)throw Error(n(38));return oc(s,i,l,!1,h)},Vn.version="18.3.1-next-f1338f8080-20240426",Vn}var ly;function $c(){if(ly)return eh.exports;ly=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),eh.exports=cw(),eh.exports}var cy;function dw(){if(cy)return cc;cy=1;var e=$c();return cc.createRoot=e.createRoot,cc.hydrateRoot=e.hydrateRoot,cc}var fw=dw(),ai=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},hw={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},sa,_0,Nb,mw=(Nb=class{constructor(){Se(this,sa,hw);Se(this,_0,!1)}setTimeoutProvider(e){ye(this,sa,e)}setTimeout(e,t){return Y(this,sa).setTimeout(e,t)}clearTimeout(e){Y(this,sa).clearTimeout(e)}setInterval(e,t){return Y(this,sa).setInterval(e,t)}clearInterval(e){Y(this,sa).clearInterval(e)}},sa=new WeakMap,_0=new WeakMap,Nb),ja=new mw;function pw(e){setTimeout(e,0)}var Za=typeof window>"u"||"Deno"in globalThis;function Rn(){}function gw(e,t){return typeof e=="function"?e(t):e}function jh(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ub(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ga(e,t){return typeof e=="function"?e(t):e}function vr(e,t){return typeof e=="function"?e(t):e}function dy(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:o,queryKey:u,stale:c}=e;if(u){if(r){if(t.queryHash!==N0(u,t.options))return!1}else if(!Au(t.queryKey,u))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||a&&a!==t.state.fetchStatus||o&&!o(t))}function fy(e,t){const{exact:n,status:r,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(ei(t.options.mutationKey)!==ei(o))return!1}else if(!Au(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function N0(e,t){return((t==null?void 0:t.queryKeyHashFn)||ei)(e)}function ei(e){return JSON.stringify(e,(t,n)=>Bh(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Au(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Au(e[n],t[n])):!1}var yw=Object.prototype.hasOwnProperty;function O0(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=hy(e)&&hy(t);if(!r&&!(Bh(e)&&Bh(t)))return t;const o=(r?e:Object.keys(e)).length,u=r?t:Object.keys(t),c=u.length,d=r?new Array(c):{};let f=0;for(let p=0;p<c;p++){const g=r?p:u[p],x=e[g],E=t[g];if(x===E){d[g]=x,(r?p<o:yw.call(e,g))&&f++;continue}if(x===null||E===null||typeof x!="object"||typeof E!="object"){d[g]=E;continue}const _=O0(x,E,n+1);d[g]=_,_===x&&f++}return o===c&&f===o?e:d}function Iu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function hy(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Bh(e){if(!my(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!my(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function my(e){return Object.prototype.toString.call(e)==="[object Object]"}function bw(e){return new Promise(t=>{ja.setTimeout(t,e)})}function Hh(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?O0(e,t):t}function xw(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ew(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var D0=Symbol();function zb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===D0?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function A0(e,t){return typeof e=="function"?e(...t):!!e}function vw(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var za,aa,zi,Ob,Tw=(Ob=class extends ai{constructor(){super();Se(this,za);Se(this,aa);Se(this,zi);ye(this,zi,t=>{if(!Za&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Y(this,aa)||this.setEventListener(Y(this,zi))}onUnsubscribe(){var t;this.hasListeners()||((t=Y(this,aa))==null||t.call(this),ye(this,aa,void 0))}setEventListener(t){var n;ye(this,zi,t),(n=Y(this,aa))==null||n.call(this),ye(this,aa,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){Y(this,za)!==t&&(ye(this,za,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof Y(this,za)=="boolean"?Y(this,za):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},za=new WeakMap,aa=new WeakMap,zi=new WeakMap,Ob),I0=new Tw;function Uh(){let e,t;const n=new Promise((a,o)=>{e=a,t=o});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var ww=pw;function Sw(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=ww;const o=c=>{t?e.push(c):a(()=>{n(c)})},u=()=>{const c=e;e=[],c.length&&a(()=>{r(()=>{c.forEach(d=>{n(d)})})})};return{batch:c=>{let d;t++;try{d=c()}finally{t--,t||u()}return d},batchCalls:c=>(...d)=>{o(()=>{c(...d)})},schedule:o,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{a=c}}}var Yt=Sw(),Wi,ia,Yi,Db,Cw=(Db=class extends ai{constructor(){super();Se(this,Wi,!0);Se(this,ia);Se(this,Yi);ye(this,Yi,t=>{if(!Za&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){Y(this,ia)||this.setEventListener(Y(this,Yi))}onUnsubscribe(){var t;this.hasListeners()||((t=Y(this,ia))==null||t.call(this),ye(this,ia,void 0))}setEventListener(t){var n;ye(this,Yi,t),(n=Y(this,ia))==null||n.call(this),ye(this,ia,t(this.setOnline.bind(this)))}setOnline(t){Y(this,Wi)!==t&&(ye(this,Wi,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return Y(this,Wi)}},Wi=new WeakMap,ia=new WeakMap,Yi=new WeakMap,Db),Ac=new Cw;function kw(e){return Math.min(1e3*2**e,3e4)}function Wb(e){return(e??"online")==="online"?Ac.isOnline():!0}var zh=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Yb(e){let t=!1,n=0,r;const a=Uh(),o=()=>a.status!=="pending",u=S=>{var w;if(!o()){const T=new zh(S);x(T),(w=e.onCancel)==null||w.call(e,T)}},c=()=>{t=!0},d=()=>{t=!1},f=()=>I0.isFocused()&&(e.networkMode==="always"||Ac.isOnline())&&e.canRun(),p=()=>Wb(e.networkMode)&&e.canRun(),g=S=>{o()||(r==null||r(),a.resolve(S))},x=S=>{o()||(r==null||r(),a.reject(S))},E=()=>new Promise(S=>{var w;r=T=>{(o()||f())&&S(T)},(w=e.onPause)==null||w.call(e)}).then(()=>{var S;r=void 0,o()||(S=e.onContinue)==null||S.call(e)}),_=()=>{if(o())return;let S;const w=n===0?e.initialPromise:void 0;try{S=w??e.fn()}catch(T){S=Promise.reject(T)}Promise.resolve(S).then(g).catch(T=>{var k;if(o())return;const C=e.retry??(Za?0:3),O=e.retryDelay??kw,L=typeof O=="function"?O(n,T):O,B=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,T);if(t||!B){x(T);return}n++,(k=e.onFail)==null||k.call(e,n,T),bw(L).then(()=>f()?void 0:E()).then(()=>{t?x(T):_()})})};return{promise:a,status:()=>a.status,cancel:u,continue:()=>(r==null||r(),a),cancelRetry:c,continueRetry:d,canStart:p,start:()=>(p()?_():E().then(_),a)}}var Wa,Ab,qb=(Ab=class{constructor(){Se(this,Wa)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),jh(this.gcTime)&&ye(this,Wa,ja.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Za?1/0:300*1e3))}clearGcTimeout(){Y(this,Wa)&&(ja.clearTimeout(Y(this,Wa)),ye(this,Wa,void 0))}},Wa=new WeakMap,Ab),Ya,qi,xr,qa,En,Fu,$a,Mr,xs,Ib,_w=(Ib=class extends qb{constructor(t){super();Se(this,Mr);Se(this,Ya);Se(this,qi);Se(this,xr);Se(this,qa);Se(this,En);Se(this,Fu);Se(this,$a);ye(this,$a,!1),ye(this,Fu,t.defaultOptions),this.setOptions(t.options),this.observers=[],ye(this,qa,t.client),ye(this,xr,Y(this,qa).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ye(this,Ya,gy(this.options)),this.state=t.state??Y(this,Ya),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=Y(this,En))==null?void 0:t.promise}setOptions(t){if(this.options={...Y(this,Fu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=gy(this.options);n.data!==void 0&&(this.setState(py(n.data,n.dataUpdatedAt)),ye(this,Ya,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Y(this,xr).remove(this)}setData(t,n){const r=Hh(this.state.data,t,this.options);return We(this,Mr,xs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){We(this,Mr,xs).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=Y(this,En))==null?void 0:r.promise;return(a=Y(this,En))==null||a.cancel(t),n?n.then(Rn).catch(Rn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Y(this,Ya))}isActive(){return this.observers.some(t=>vr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===D0||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>ga(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ub(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=Y(this,En))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=Y(this,En))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),Y(this,xr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(Y(this,En)&&(Y(this,$a)?Y(this,En).cancel({revert:!0}):Y(this,En).cancelRetry()),this.scheduleGc()),Y(this,xr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||We(this,Mr,xs).call(this,{type:"invalidate"})}async fetch(t,n){var d,f,p,g,x,E,_,S,w,T,C,O;if(this.state.fetchStatus!=="idle"&&((d=Y(this,En))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Y(this,En))return Y(this,En).continueRetry(),Y(this,En).promise}if(t&&this.setOptions(t),!this.options.queryFn){const L=this.observers.find(B=>B.options.queryFn);L&&this.setOptions(L.options)}const r=new AbortController,a=L=>{Object.defineProperty(L,"signal",{enumerable:!0,get:()=>(ye(this,$a,!0),r.signal)})},o=()=>{const L=zb(this.options,n),k=(()=>{const N={client:Y(this,qa),queryKey:this.queryKey,meta:this.meta};return a(N),N})();return ye(this,$a,!1),this.options.persister?this.options.persister(L,k,this):L(k)},c=(()=>{const L={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Y(this,qa),state:this.state,fetchFn:o};return a(L),L})();(f=this.options.behavior)==null||f.onFetch(c,this),ye(this,qi,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=c.fetchOptions)==null?void 0:p.meta))&&We(this,Mr,xs).call(this,{type:"fetch",meta:(g=c.fetchOptions)==null?void 0:g.meta}),ye(this,En,Yb({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:L=>{L instanceof zh&&L.revert&&this.setState({...Y(this,qi),fetchStatus:"idle"}),r.abort()},onFail:(L,B)=>{We(this,Mr,xs).call(this,{type:"failed",failureCount:L,error:B})},onPause:()=>{We(this,Mr,xs).call(this,{type:"pause"})},onContinue:()=>{We(this,Mr,xs).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const L=await Y(this,En).start();if(L===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(L),(E=(x=Y(this,xr).config).onSuccess)==null||E.call(x,L,this),(S=(_=Y(this,xr).config).onSettled)==null||S.call(_,L,this.state.error,this),L}catch(L){if(L instanceof zh){if(L.silent)return Y(this,En).promise;if(L.revert){if(this.state.data===void 0)throw L;return this.state.data}}throw We(this,Mr,xs).call(this,{type:"error",error:L}),(T=(w=Y(this,xr).config).onError)==null||T.call(w,L,this),(O=(C=Y(this,xr).config).onSettled)==null||O.call(C,this.state.data,L,this),L}finally{this.scheduleGc()}}},Ya=new WeakMap,qi=new WeakMap,xr=new WeakMap,qa=new WeakMap,En=new WeakMap,Fu=new WeakMap,$a=new WeakMap,Mr=new WeakSet,xs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...$b(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...py(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ye(this,qi,t.manual?a:void 0),a;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Yt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),Y(this,xr).notify({query:this,type:"updated",action:t})})},Ib);function $b(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Wb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function py(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function gy(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Xn,st,ju,Bn,Va,$i,vs,oa,Bu,Vi,Qi,Qa,Ga,ua,Gi,ft,Eu,Wh,Yh,qh,$h,Vh,Qh,Gh,Vb,Rb,R0=(Rb=class extends ai{constructor(t,n){super();Se(this,ft);Se(this,Xn);Se(this,st);Se(this,ju);Se(this,Bn);Se(this,Va);Se(this,$i);Se(this,vs);Se(this,oa);Se(this,Bu);Se(this,Vi);Se(this,Qi);Se(this,Qa);Se(this,Ga);Se(this,ua);Se(this,Gi,new Set);this.options=n,ye(this,Xn,t),ye(this,oa,null),ye(this,vs,Uh()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Y(this,st).addObserver(this),yy(Y(this,st),this.options)?We(this,ft,Eu).call(this):this.updateResult(),We(this,ft,$h).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Xh(Y(this,st),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Xh(Y(this,st),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,We(this,ft,Vh).call(this),We(this,ft,Qh).call(this),Y(this,st).removeObserver(this)}setOptions(t){const n=this.options,r=Y(this,st);if(this.options=Y(this,Xn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof vr(this.options.enabled,Y(this,st))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");We(this,ft,Gh).call(this),Y(this,st).setOptions(this.options),n._defaulted&&!Iu(this.options,n)&&Y(this,Xn).getQueryCache().notify({type:"observerOptionsUpdated",query:Y(this,st),observer:this});const a=this.hasListeners();a&&by(Y(this,st),r,this.options,n)&&We(this,ft,Eu).call(this),this.updateResult(),a&&(Y(this,st)!==r||vr(this.options.enabled,Y(this,st))!==vr(n.enabled,Y(this,st))||ga(this.options.staleTime,Y(this,st))!==ga(n.staleTime,Y(this,st)))&&We(this,ft,Wh).call(this);const o=We(this,ft,Yh).call(this);a&&(Y(this,st)!==r||vr(this.options.enabled,Y(this,st))!==vr(n.enabled,Y(this,st))||o!==Y(this,ua))&&We(this,ft,qh).call(this,o)}getOptimisticResult(t){const n=Y(this,Xn).getQueryCache().build(Y(this,Xn),t),r=this.createResult(n,t);return Ow(this,r)&&(ye(this,Bn,r),ye(this,$i,this.options),ye(this,Va,Y(this,st).state)),r}getCurrentResult(){return Y(this,Bn)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&Y(this,vs).status==="pending"&&Y(this,vs).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){Y(this,Gi).add(t)}getCurrentQuery(){return Y(this,st)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=Y(this,Xn).defaultQueryOptions(t),r=Y(this,Xn).getQueryCache().build(Y(this,Xn),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return We(this,ft,Eu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),Y(this,Bn)))}createResult(t,n){var j;const r=Y(this,st),a=this.options,o=Y(this,Bn),u=Y(this,Va),c=Y(this,$i),f=t!==r?t.state:Y(this,ju),{state:p}=t;let g={...p},x=!1,E;if(n._optimisticResults){const M=this.hasListeners(),P=!M&&yy(t,n),F=M&&by(t,r,n,a);(P||F)&&(g={...g,...$b(p.data,t.options)}),n._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:_,errorUpdatedAt:S,status:w}=g;E=g.data;let T=!1;if(n.placeholderData!==void 0&&E===void 0&&w==="pending"){let M;o!=null&&o.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(M=o.data,T=!0):M=typeof n.placeholderData=="function"?n.placeholderData((j=Y(this,Qi))==null?void 0:j.state.data,Y(this,Qi)):n.placeholderData,M!==void 0&&(w="success",E=Hh(o==null?void 0:o.data,M,n),x=!0)}if(n.select&&E!==void 0&&!T)if(o&&E===(u==null?void 0:u.data)&&n.select===Y(this,Bu))E=Y(this,Vi);else try{ye(this,Bu,n.select),E=n.select(E),E=Hh(o==null?void 0:o.data,E,n),ye(this,Vi,E),ye(this,oa,null)}catch(M){ye(this,oa,M)}Y(this,oa)&&(_=Y(this,oa),E=Y(this,Vi),S=Date.now(),w="error");const C=g.fetchStatus==="fetching",O=w==="pending",L=w==="error",B=O&&C,k=E!==void 0,R={status:w,fetchStatus:g.fetchStatus,isPending:O,isSuccess:w==="success",isError:L,isInitialLoading:B,isLoading:B,data:E,dataUpdatedAt:g.dataUpdatedAt,error:_,errorUpdatedAt:S,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>f.dataUpdateCount||g.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!O,isLoadingError:L&&!k,isPaused:g.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:L&&k,isStale:L0(t,n),refetch:this.refetch,promise:Y(this,vs),isEnabled:vr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const M=R.data!==void 0,P=R.status==="error"&&!M,F=J=>{P?J.reject(R.error):M&&J.resolve(R.data)},W=()=>{const J=ye(this,vs,R.promise=Uh());F(J)},V=Y(this,vs);switch(V.status){case"pending":t.queryHash===r.queryHash&&F(V);break;case"fulfilled":(P||R.data!==V.value)&&W();break;case"rejected":(!P||R.error!==V.reason)&&W();break}}return R}updateResult(){const t=Y(this,Bn),n=this.createResult(Y(this,st),this.options);if(ye(this,Va,Y(this,st).state),ye(this,$i,this.options),Y(this,Va).data!==void 0&&ye(this,Qi,Y(this,st)),Iu(n,t))return;ye(this,Bn,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!Y(this,Gi).size)return!0;const u=new Set(o??Y(this,Gi));return this.options.throwOnError&&u.add("error"),Object.keys(Y(this,Bn)).some(c=>{const d=c;return Y(this,Bn)[d]!==t[d]&&u.has(d)})};We(this,ft,Vb).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&We(this,ft,$h).call(this)}},Xn=new WeakMap,st=new WeakMap,ju=new WeakMap,Bn=new WeakMap,Va=new WeakMap,$i=new WeakMap,vs=new WeakMap,oa=new WeakMap,Bu=new WeakMap,Vi=new WeakMap,Qi=new WeakMap,Qa=new WeakMap,Ga=new WeakMap,ua=new WeakMap,Gi=new WeakMap,ft=new WeakSet,Eu=function(t){We(this,ft,Gh).call(this);let n=Y(this,st).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Rn)),n},Wh=function(){We(this,ft,Vh).call(this);const t=ga(this.options.staleTime,Y(this,st));if(Za||Y(this,Bn).isStale||!jh(t))return;const r=Ub(Y(this,Bn).dataUpdatedAt,t)+1;ye(this,Qa,ja.setTimeout(()=>{Y(this,Bn).isStale||this.updateResult()},r))},Yh=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Y(this,st)):this.options.refetchInterval)??!1},qh=function(t){We(this,ft,Qh).call(this),ye(this,ua,t),!(Za||vr(this.options.enabled,Y(this,st))===!1||!jh(Y(this,ua))||Y(this,ua)===0)&&ye(this,Ga,ja.setInterval(()=>{(this.options.refetchIntervalInBackground||I0.isFocused())&&We(this,ft,Eu).call(this)},Y(this,ua)))},$h=function(){We(this,ft,Wh).call(this),We(this,ft,qh).call(this,We(this,ft,Yh).call(this))},Vh=function(){Y(this,Qa)&&(ja.clearTimeout(Y(this,Qa)),ye(this,Qa,void 0))},Qh=function(){Y(this,Ga)&&(ja.clearInterval(Y(this,Ga)),ye(this,Ga,void 0))},Gh=function(){const t=Y(this,Xn).getQueryCache().build(Y(this,Xn),this.options);if(t===Y(this,st))return;const n=Y(this,st);ye(this,st,t),ye(this,ju,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Vb=function(t){Yt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(Y(this,Bn))}),Y(this,Xn).getQueryCache().notify({query:Y(this,st),type:"observerResultsUpdated"})})},Rb);function Nw(e,t){return vr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function yy(e,t){return Nw(e,t)||e.state.data!==void 0&&Xh(e,t,t.refetchOnMount)}function Xh(e,t,n){if(vr(t.enabled,e)!==!1&&ga(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&L0(e,t)}return!1}function by(e,t,n,r){return(e!==t||vr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&L0(e,n)}function L0(e,t){return vr(t.enabled,e)!==!1&&e.isStaleByTime(ga(t.staleTime,e))}function Ow(e,t){return!Iu(e.getCurrentResult(),t)}function xy(e){return{onFetch:(t,n)=>{var p,g,x,E,_;const r=t.options,a=(x=(g=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:g.fetchMore)==null?void 0:x.direction,o=((E=t.state.data)==null?void 0:E.pages)||[],u=((_=t.state.data)==null?void 0:_.pageParams)||[];let c={pages:[],pageParams:[]},d=0;const f=async()=>{let S=!1;const w=O=>{vw(O,()=>t.signal,()=>S=!0)},T=zb(t.options,t.fetchOptions),C=async(O,L,B)=>{if(S)return Promise.reject();if(L==null&&O.pages.length)return Promise.resolve(O);const N=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:L,direction:B?"backward":"forward",meta:t.options.meta};return w(P),P})(),R=await T(N),{maxPages:j}=t.options,M=B?Ew:xw;return{pages:M(O.pages,R,j),pageParams:M(O.pageParams,L,j)}};if(a&&o.length){const O=a==="backward",L=O?Dw:Ey,B={pages:o,pageParams:u},k=L(r,B);c=await C(B,k,O)}else{const O=e??o.length;do{const L=d===0?u[0]??r.initialPageParam:Ey(r,c);if(d>0&&L==null)break;c=await C(c,L),d++}while(d<O)}return c};t.options.persister?t.fetchFn=()=>{var S,w;return(w=(S=t.options).persister)==null?void 0:w.call(S,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=f}}}function Ey(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Dw(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Hu,Xr,In,Xa,Kr,ta,Lb,Aw=(Lb=class extends qb{constructor(t){super();Se(this,Kr);Se(this,Hu);Se(this,Xr);Se(this,In);Se(this,Xa);ye(this,Hu,t.client),this.mutationId=t.mutationId,ye(this,In,t.mutationCache),ye(this,Xr,[]),this.state=t.state||Qb(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){Y(this,Xr).includes(t)||(Y(this,Xr).push(t),this.clearGcTimeout(),Y(this,In).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ye(this,Xr,Y(this,Xr).filter(n=>n!==t)),this.scheduleGc(),Y(this,In).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){Y(this,Xr).length||(this.state.status==="pending"?this.scheduleGc():Y(this,In).remove(this))}continue(){var t;return((t=Y(this,Xa))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,c,d,f,p,g,x,E,_,S,w,T,C,O,L,B,k,N;const n=()=>{We(this,Kr,ta).call(this,{type:"continue"})},r={client:Y(this,Hu),meta:this.options.meta,mutationKey:this.options.mutationKey};ye(this,Xa,Yb({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(R,j)=>{We(this,Kr,ta).call(this,{type:"failed",failureCount:R,error:j})},onPause:()=>{We(this,Kr,ta).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Y(this,In).canRun(this)}));const a=this.state.status==="pending",o=!Y(this,Xa).canStart();try{if(a)n();else{We(this,Kr,ta).call(this,{type:"pending",variables:t,isPaused:o}),Y(this,In).config.onMutate&&await Y(this,In).config.onMutate(t,this,r);const j=await((c=(u=this.options).onMutate)==null?void 0:c.call(u,t,r));j!==this.state.context&&We(this,Kr,ta).call(this,{type:"pending",context:j,variables:t,isPaused:o})}const R=await Y(this,Xa).start();return await((f=(d=Y(this,In).config).onSuccess)==null?void 0:f.call(d,R,t,this.state.context,this,r)),await((g=(p=this.options).onSuccess)==null?void 0:g.call(p,R,t,this.state.context,r)),await((E=(x=Y(this,In).config).onSettled)==null?void 0:E.call(x,R,null,this.state.variables,this.state.context,this,r)),await((S=(_=this.options).onSettled)==null?void 0:S.call(_,R,null,t,this.state.context,r)),We(this,Kr,ta).call(this,{type:"success",data:R}),R}catch(R){try{await((T=(w=Y(this,In).config).onError)==null?void 0:T.call(w,R,t,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((O=(C=this.options).onError)==null?void 0:O.call(C,R,t,this.state.context,r))}catch(j){Promise.reject(j)}try{await((B=(L=Y(this,In).config).onSettled)==null?void 0:B.call(L,void 0,R,this.state.variables,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((N=(k=this.options).onSettled)==null?void 0:N.call(k,void 0,R,t,this.state.context,r))}catch(j){Promise.reject(j)}throw We(this,Kr,ta).call(this,{type:"error",error:R}),R}finally{Y(this,In).runNext(this)}}},Hu=new WeakMap,Xr=new WeakMap,In=new WeakMap,Xa=new WeakMap,Kr=new WeakSet,ta=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Yt.batch(()=>{Y(this,Xr).forEach(r=>{r.onMutationUpdate(t)}),Y(this,In).notify({mutation:this,type:"updated",action:t})})},Lb);function Qb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ts,Pr,Uu,Mb,Iw=(Mb=class extends ai{constructor(t={}){super();Se(this,Ts);Se(this,Pr);Se(this,Uu);this.config=t,ye(this,Ts,new Set),ye(this,Pr,new Map),ye(this,Uu,0)}build(t,n,r){const a=new Aw({client:t,mutationCache:this,mutationId:++lc(this,Uu)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){Y(this,Ts).add(t);const n=dc(t);if(typeof n=="string"){const r=Y(this,Pr).get(n);r?r.push(t):Y(this,Pr).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(Y(this,Ts).delete(t)){const n=dc(t);if(typeof n=="string"){const r=Y(this,Pr).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&Y(this,Pr).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=dc(t);if(typeof n=="string"){const r=Y(this,Pr).get(n),a=r==null?void 0:r.find(o=>o.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=dc(t);if(typeof n=="string"){const a=(r=Y(this,Pr).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Yt.batch(()=>{Y(this,Ts).forEach(t=>{this.notify({type:"removed",mutation:t})}),Y(this,Ts).clear(),Y(this,Pr).clear()})}getAll(){return Array.from(Y(this,Ts))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>fy(n,r))}findAll(t={}){return this.getAll().filter(n=>fy(t,n))}notify(t){Yt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Yt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Rn))))}},Ts=new WeakMap,Pr=new WeakMap,Uu=new WeakMap,Mb);function dc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ws,la,Kn,Ss,Ns,_c,Kh,Pb,Rw=(Pb=class extends ai{constructor(n,r){super();Se(this,Ns);Se(this,ws);Se(this,la);Se(this,Kn);Se(this,Ss);ye(this,ws,n),this.setOptions(r),this.bindMethods(),We(this,Ns,_c).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=Y(this,ws).defaultMutationOptions(n),Iu(this.options,r)||Y(this,ws).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Y(this,Kn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ei(r.mutationKey)!==ei(this.options.mutationKey)?this.reset():((a=Y(this,Kn))==null?void 0:a.state.status)==="pending"&&Y(this,Kn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=Y(this,Kn))==null||n.removeObserver(this)}onMutationUpdate(n){We(this,Ns,_c).call(this),We(this,Ns,Kh).call(this,n)}getCurrentResult(){return Y(this,la)}reset(){var n;(n=Y(this,Kn))==null||n.removeObserver(this),ye(this,Kn,void 0),We(this,Ns,_c).call(this),We(this,Ns,Kh).call(this)}mutate(n,r){var a;return ye(this,Ss,r),(a=Y(this,Kn))==null||a.removeObserver(this),ye(this,Kn,Y(this,ws).getMutationCache().build(Y(this,ws),this.options)),Y(this,Kn).addObserver(this),Y(this,Kn).execute(n)}},ws=new WeakMap,la=new WeakMap,Kn=new WeakMap,Ss=new WeakMap,Ns=new WeakSet,_c=function(){var r;const n=((r=Y(this,Kn))==null?void 0:r.state)??Qb();ye(this,la,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Kh=function(n){Yt.batch(()=>{var r,a,o,u,c,d,f,p;if(Y(this,Ss)&&this.hasListeners()){const g=Y(this,la).variables,x=Y(this,la).context,E={client:Y(this,ws),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=Y(this,Ss)).onSuccess)==null||a.call(r,n.data,g,x,E)}catch(_){Promise.reject(_)}try{(u=(o=Y(this,Ss)).onSettled)==null||u.call(o,n.data,null,g,x,E)}catch(_){Promise.reject(_)}}else if((n==null?void 0:n.type)==="error"){try{(d=(c=Y(this,Ss)).onError)==null||d.call(c,n.error,g,x,E)}catch(_){Promise.reject(_)}try{(p=(f=Y(this,Ss)).onSettled)==null||p.call(f,void 0,n.error,g,x,E)}catch(_){Promise.reject(_)}}}this.listeners.forEach(g=>{g(Y(this,la))})})},Pb);function vy(e,t){const n=new Set(t);return e.filter(r=>!n.has(r))}function Lw(e,t,n){const r=e.slice(0);return r[t]=n,r}var Xi,or,Ki,Ji,Er,ca,zu,Wu,Yu,qu,Sn,Jh,Zh,e0,t0,n0,Fb,Mw=(Fb=class extends ai{constructor(t,n,r){super();Se(this,Sn);Se(this,Xi);Se(this,or);Se(this,Ki);Se(this,Ji);Se(this,Er);Se(this,ca);Se(this,zu);Se(this,Wu);Se(this,Yu);Se(this,qu,[]);ye(this,Xi,t),ye(this,Ji,r),ye(this,Ki,[]),ye(this,Er,[]),ye(this,or,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&Y(this,Er).forEach(t=>{t.subscribe(n=>{We(this,Sn,t0).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,Y(this,Er).forEach(t=>{t.destroy()})}setQueries(t,n){ye(this,Ki,t),ye(this,Ji,n),Yt.batch(()=>{const r=Y(this,Er),a=We(this,Sn,e0).call(this,Y(this,Ki));a.forEach(g=>g.observer.setOptions(g.defaultedQueryOptions));const o=a.map(g=>g.observer),u=o.map(g=>g.getCurrentResult()),c=r.length!==o.length,d=o.some((g,x)=>g!==r[x]),f=c||d,p=f?!0:u.some((g,x)=>{const E=Y(this,or)[x];return!E||!Iu(g,E)});!f&&!p||(f&&(ye(this,qu,a),ye(this,Er,o)),ye(this,or,u),this.hasListeners()&&(f&&(vy(r,o).forEach(g=>{g.destroy()}),vy(o,r).forEach(g=>{g.subscribe(x=>{We(this,Sn,t0).call(this,g,x)})})),We(this,Sn,n0).call(this)))})}getCurrentResult(){return Y(this,or)}getQueries(){return Y(this,Er).map(t=>t.getCurrentQuery())}getObservers(){return Y(this,Er)}getOptimisticResult(t,n){const r=We(this,Sn,e0).call(this,t),a=r.map(u=>u.observer.getOptimisticResult(u.defaultedQueryOptions)),o=r.map(u=>u.defaultedQueryOptions.queryHash);return[a,u=>We(this,Sn,Zh).call(this,u??a,n,o),()=>We(this,Sn,Jh).call(this,a,r)]}},Xi=new WeakMap,or=new WeakMap,Ki=new WeakMap,Ji=new WeakMap,Er=new WeakMap,ca=new WeakMap,zu=new WeakMap,Wu=new WeakMap,Yu=new WeakMap,qu=new WeakMap,Sn=new WeakSet,Jh=function(t,n){return n.map((r,a)=>{const o=t[a];return r.defaultedQueryOptions.notifyOnChangeProps?o:r.observer.trackResult(o,u=>{n.forEach(c=>{c.observer.trackProp(u)})})})},Zh=function(t,n,r){if(n){const a=Y(this,Yu),o=r!==void 0&&a!==void 0&&(a.length!==r.length||r.some((u,c)=>u!==a[c]));return(!Y(this,ca)||Y(this,or)!==Y(this,Wu)||o||n!==Y(this,zu))&&(ye(this,zu,n),ye(this,Wu,Y(this,or)),r!==void 0&&ye(this,Yu,r),ye(this,ca,O0(Y(this,ca),n(t)))),Y(this,ca)}return t},e0=function(t){const n=new Map;Y(this,Er).forEach(a=>{const o=a.options.queryHash;if(!o)return;const u=n.get(o);u?u.push(a):n.set(o,[a])});const r=[];return t.forEach(a=>{var d;const o=Y(this,Xi).defaultQueryOptions(a),c=((d=n.get(o.queryHash))==null?void 0:d.shift())??new R0(Y(this,Xi),o);r.push({defaultedQueryOptions:o,observer:c})}),r},t0=function(t,n){const r=Y(this,Er).indexOf(t);r!==-1&&(ye(this,or,Lw(Y(this,or),r,n)),We(this,Sn,n0).call(this))},n0=function(){var t;if(this.hasListeners()){const n=Y(this,ca),r=We(this,Sn,Jh).call(this,Y(this,or),Y(this,qu)),a=We(this,Sn,Zh).call(this,r,(t=Y(this,Ji))==null?void 0:t.combine);n!==a&&Yt.batch(()=>{this.listeners.forEach(o=>{o(Y(this,or))})})}},Fb),Jr,jb,Pw=(jb=class extends ai{constructor(t={}){super();Se(this,Jr);this.config=t,ye(this,Jr,new Map)}build(t,n,r){const a=n.queryKey,o=n.queryHash??N0(a,n);let u=this.get(o);return u||(u=new _w({client:t,queryKey:a,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(u)),u}add(t){Y(this,Jr).has(t.queryHash)||(Y(this,Jr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=Y(this,Jr).get(t.queryHash);n&&(t.destroy(),n===t&&Y(this,Jr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Yt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return Y(this,Jr).get(t)}getAll(){return[...Y(this,Jr).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>dy(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>dy(t,r)):n}notify(t){Yt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Yt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Yt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Jr=new WeakMap,jb),Jt,da,fa,Zi,eo,ha,to,no,Bb,Fw=(Bb=class{constructor(e={}){Se(this,Jt);Se(this,da);Se(this,fa);Se(this,Zi);Se(this,eo);Se(this,ha);Se(this,to);Se(this,no);ye(this,Jt,e.queryCache||new Pw),ye(this,da,e.mutationCache||new Iw),ye(this,fa,e.defaultOptions||{}),ye(this,Zi,new Map),ye(this,eo,new Map),ye(this,ha,0)}mount(){lc(this,ha)._++,Y(this,ha)===1&&(ye(this,to,I0.subscribe(async e=>{e&&(await this.resumePausedMutations(),Y(this,Jt).onFocus())})),ye(this,no,Ac.subscribe(async e=>{e&&(await this.resumePausedMutations(),Y(this,Jt).onOnline())})))}unmount(){var e,t;lc(this,ha)._--,Y(this,ha)===0&&((e=Y(this,to))==null||e.call(this),ye(this,to,void 0),(t=Y(this,no))==null||t.call(this),ye(this,no,void 0))}isFetching(e){return Y(this,Jt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return Y(this,da).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Y(this,Jt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=Y(this,Jt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ga(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return Y(this,Jt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=Y(this,Jt).get(r.queryHash),o=a==null?void 0:a.state.data,u=gw(t,o);if(u!==void 0)return Y(this,Jt).build(this,r).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return Yt.batch(()=>Y(this,Jt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=Y(this,Jt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=Y(this,Jt);Yt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=Y(this,Jt);return Yt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Yt.batch(()=>Y(this,Jt).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Rn).catch(Rn)}invalidateQueries(e,t={}){return Yt.batch(()=>(Y(this,Jt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Yt.batch(()=>Y(this,Jt).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,n);return n.throwOnError||(o=o.catch(Rn)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Rn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=Y(this,Jt).build(this,t);return n.isStaleByTime(ga(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Rn).catch(Rn)}fetchInfiniteQuery(e){return e.behavior=xy(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Rn).catch(Rn)}ensureInfiniteQueryData(e){return e.behavior=xy(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ac.isOnline()?Y(this,da).resumePausedMutations():Promise.resolve()}getQueryCache(){return Y(this,Jt)}getMutationCache(){return Y(this,da)}getDefaultOptions(){return Y(this,fa)}setDefaultOptions(e){ye(this,fa,e)}setQueryDefaults(e,t){Y(this,Zi).set(ei(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...Y(this,Zi).values()],n={};return t.forEach(r=>{Au(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){Y(this,eo).set(ei(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...Y(this,eo).values()],n={};return t.forEach(r=>{Au(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...Y(this,fa).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=N0(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===D0&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...Y(this,fa).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){Y(this,Jt).clear(),Y(this,da).clear()}},Jt=new WeakMap,da=new WeakMap,fa=new WeakMap,Zi=new WeakMap,eo=new WeakMap,ha=new WeakMap,to=new WeakMap,no=new WeakMap,Bb),Gb=I.createContext(void 0),jr=e=>{const t=I.useContext(Gb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},jw=({client:e,children:t})=>(I.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),m.jsx(Gb.Provider,{value:e,children:t})),Xb=I.createContext(!1),Kb=()=>I.useContext(Xb);Xb.Provider;function Bw(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Hw=I.createContext(Bw()),Jb=()=>I.useContext(Hw),Zb=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?A0(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},ex=e=>{I.useEffect(()=>{e.clearReset()},[e])},tx=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||A0(n,[e.error,r])),nx=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},rx=(e,t)=>e.isLoading&&e.isFetching&&!t,r0=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Ic=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ty({queries:e,...t},n){const r=jr(),a=Kb(),o=Jb(),u=I.useMemo(()=>e.map(S=>{const w=r.defaultQueryOptions(S);return w._optimisticResults=a?"isRestoring":"optimistic",w}),[e,r,a]);u.forEach(S=>{nx(S);const w=r.getQueryCache().get(S.queryHash);Zb(S,o,w)}),ex(o);const[c]=I.useState(()=>new Mw(r,u,t)),[d,f,p]=c.getOptimisticResult(u,t.combine),g=!a&&t.subscribed!==!1;I.useSyncExternalStore(I.useCallback(S=>g?c.subscribe(Yt.batchCalls(S)):Rn,[c,g]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),I.useEffect(()=>{c.setQueries(u,t)},[u,t,c]);const E=d.some((S,w)=>r0(u[w],S))?d.flatMap((S,w)=>{const T=u[w];if(T){const C=new R0(r,T);if(r0(T,S))return Ic(T,C,o);rx(S,a)&&Ic(T,C,o)}return[]}):[];if(E.length>0)throw Promise.all(E);const _=d.find((S,w)=>{const T=u[w];return T&&tx({result:S,errorResetBoundary:o,throwOnError:T.throwOnError,query:r.getQueryCache().get(T.queryHash),suspense:T.suspense})});if(_!=null&&_.error)throw _.error;return f(p())}function Uw(e,t,n){var x,E,_,S;const r=Kb(),a=Jb(),o=jr(),u=o.defaultQueryOptions(e);(E=(x=o.getDefaultOptions().queries)==null?void 0:x._experimental_beforeQuery)==null||E.call(x,u);const c=o.getQueryCache().get(u.queryHash);u._optimisticResults=r?"isRestoring":"optimistic",nx(u),Zb(u,a,c),ex(a);const d=!o.getQueryCache().get(u.queryHash),[f]=I.useState(()=>new t(o,u)),p=f.getOptimisticResult(u),g=!r&&e.subscribed!==!1;if(I.useSyncExternalStore(I.useCallback(w=>{const T=g?f.subscribe(Yt.batchCalls(w)):Rn;return f.updateResult(),T},[f,g]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),I.useEffect(()=>{f.setOptions(u)},[u,f]),r0(u,p))throw Ic(u,f,a);if(tx({result:p,errorResetBoundary:a,throwOnError:u.throwOnError,query:c,suspense:u.suspense}))throw p.error;if((S=(_=o.getDefaultOptions().queries)==null?void 0:_._experimental_afterQuery)==null||S.call(_,u,p),u.experimental_prefetchInRender&&!Za&&rx(p,r)){const w=d?Ic(u,f,a):c==null?void 0:c.promise;w==null||w.catch(Rn).finally(()=>{f.updateResult()})}return u.notifyOnChangeProps?p:f.trackResult(p)}function is(e,t){return Uw(e,R0)}function zw(e,t){const n=jr(),r=n.getQueryCache();return I.useSyncExternalStore(I.useCallback(a=>r.subscribe(Yt.batchCalls(a)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}function Ww(e,t){const n=jr(),[r]=I.useState(()=>new Rw(n,e));I.useEffect(()=>{r.setOptions(e)},[r,e]);const a=I.useSyncExternalStore(I.useCallback(u=>r.subscribe(Yt.batchCalls(u)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=I.useCallback((u,c)=>{r.mutate(u,c).catch(Rn)},[r]);if(a.error&&A0(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}function Yw({children:e}){const[t]=I.useState(()=>new Fw({defaultOptions:{queries:{staleTime:3e5,gcTime:18e5,refetchOnWindowFocus:!1,retry:1}}}));return m.jsx(jw,{client:t,children:e})}const qw="modulepreload",$w=function(e){return"/"+e},wy={},Os=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let u=function(f){return Promise.all(f.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));a=u(n.map(f=>{if(f=$w(f),f in wy)return;wy[f]=!0;const p=f.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const x=document.createElement("link");if(x.rel=p?"stylesheet":qw,p||(x.as="script"),x.crossOrigin="",x.href=f,d&&x.setAttribute("nonce",d),document.head.appendChild(x),p)return new Promise((E,_)=>{x.addEventListener("load",E),x.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(u){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=u,window.dispatchEvent(c),!c.defaultPrevented)throw u}return a.then(u=>{for(const c of u||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})},Sy={md:768,lg:1024};function Cy(e){return e>=Sy.lg?"lg":e>=Sy.md?"md":"sm"}function M0(){const[e,t]=I.useState(()=>typeof window<"u"?Cy(window.innerWidth):"lg");return I.useEffect(()=>{function n(){t(Cy(window.innerWidth))}return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e}const P0="/api";class $u extends Error{constructor(t,n,r){super(n),this.status=t,this.errorType=r,this.name="ApiError"}}async function _t(e,t){const n=await fetch(`${P0}${e}`,{credentials:"include",...t,headers:{"Content-Type":"application/json",...t==null?void 0:t.headers}});if(!n.ok){const r=await n.json().catch(()=>({error:"Unknown error"}));throw new $u(n.status,r.error||`HTTP ${n.status}`,r.errorType)}return n.json()}async function fc(e,t){const n=await fetch(`${P0}${e}`,{credentials:"omit",...t,headers:{"Content-Type":"application/json",...t==null?void 0:t.headers}});if(!n.ok){const r=await n.json().catch(()=>({error:"Unknown error"}));throw new $u(n.status,r.error||`HTTP ${n.status}`,r.errorType)}return n.json()}const Ht={getHealth:()=>_t("/health"),getConfig:()=>_t("/config"),getChart:e=>_t(`/charts/${encodeURIComponent(e)}`),queryChart:(e,t={},n={})=>_t(`/charts/${encodeURIComponent(e)}/query${n.includeConfig?"?includeConfig=true":""}`,{method:"POST",body:JSON.stringify(t)}),queryChartsBatch:(e,t={})=>_t("/charts/batch",{method:"POST",body:JSON.stringify({charts:e,includeConfig:t.includeConfig})}),invalidateChart:e=>_t(`/charts/${encodeURIComponent(e)}/invalidate`,{method:"POST"}),getParameterOptions:(e,t)=>_t(`/charts/${encodeURIComponent(e)}/parameters/${encodeURIComponent(t)}/options`),getModelOptions:(e,t,n)=>_t(`/models/${encodeURIComponent(e)}/options?value_field=${encodeURIComponent(t)}&label_field=${encodeURIComponent(n)}`),getDashboards:()=>_t("/dashboards"),getDashboard:(e,t)=>{const n=t?`/dashboards/${encodeURIComponent(e)}?branch=${encodeURIComponent(t)}`:`/dashboards/${encodeURIComponent(e)}`;return _t(n)},saveDashboard:(e,t,n,r)=>_t(`/dashboards/${encodeURIComponent(e)}`,{method:"POST",body:JSON.stringify(r?{tab:r,tabLayout:t,message:n}:{layout:t,message:n})}),warmDashboardCache:(e,t={},n)=>_t(`/dashboards/${encodeURIComponent(e)}/warm-cache`,{method:"POST",body:JSON.stringify({params:t,...n?{tab:n}:{}})}),getBranches:()=>_t("/git/branches"),createBranch:(e,t)=>_t("/git/branches",{method:"POST",body:JSON.stringify({name:e,from:t})}),checkoutBranch:e=>_t("/git/checkout",{method:"POST",body:JSON.stringify({branch:e})}),getAuthMe:async()=>{const e=await fetch(`${P0}/auth/me`,{credentials:"include",headers:{"Content-Type":"application/json"}});if(e.status===401)return{providers:(await e.json().catch(()=>({}))).providers};if(!e.ok)throw new $u(e.status,`HTTP ${e.status}`);return e.json()},authSetup:e=>_t("/auth/setup",{method:"POST",body:JSON.stringify(e)}),authLogin:e=>_t("/auth/login",{method:"POST",body:JSON.stringify(e)}),authLogout:()=>_t("/auth/logout",{method:"POST"}),authChangePassword:e=>_t("/auth/me/password",{method:"PUT",body:JSON.stringify(e)}),authListUsers:()=>_t("/auth/users"),authCreateUser:e=>_t("/auth/users",{method:"POST",body:JSON.stringify(e)}),authUpdateUser:(e,t)=>_t(`/auth/users/${encodeURIComponent(e)}`,{method:"PUT",body:JSON.stringify(t)}),authDeleteUser:e=>_t(`/auth/users/${encodeURIComponent(e)}`,{method:"DELETE"}),createShareLink:e=>_t("/shares",{method:"POST",body:JSON.stringify(e)}),listShareLinks:()=>_t("/shares"),revokeShareLink:e=>_t(`/shares/${encodeURIComponent(e)}`,{method:"DELETE"}),getPublicConfig:e=>fc(`/public/config?share_token=${encodeURIComponent(e)}`),getPublicDashboard:(e,t)=>fc(`/public/dashboards/${encodeURIComponent(e)}?share_token=${encodeURIComponent(t)}`),queryPublicChart:(e,t,n,r=!1)=>{const a=new URLSearchParams({share_token:n});return r&&a.set("includeConfig","true"),fc(`/public/charts/${encodeURIComponent(e)}/query?${a}`,{method:"POST",body:JSON.stringify(t)})},queryPublicChartBatch:(e,t,n=!1)=>fc(`/public/charts/batch?share_token=${encodeURIComponent(t)}`,{method:"POST",body:JSON.stringify({charts:e,includeConfig:n})})};function ii(){return is({queryKey:["config"],queryFn:Ht.getConfig,staleTime:1/0})}function Vw(){return is({queryKey:["health"],queryFn:Ht.getHealth,refetchInterval:3e4})}function sx(e){return is({queryKey:["chart",e],queryFn:()=>Ht.getChart(e),enabled:!!e,staleTime:1e3*60*10})}const ky=e=>{let t;const n=new Set,r=(f,p)=>{const g=typeof f=="function"?f(t):f;if(!Object.is(g,t)){const x=t;t=p??(typeof g!="object"||g===null)?g:Object.assign({},t,g),n.forEach(E=>E(t,x))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>d,subscribe:f=>(n.add(f),()=>n.delete(f))},d=t=e(r,a,c);return c},Qw=(e=>e?ky(e):ky),Gw=e=>e;function Xw(e,t=Gw){const n=xe.useSyncExternalStore(e.subscribe,xe.useCallback(()=>t(e.getState()),[e,t]),xe.useCallback(()=>t(e.getInitialState()),[e,t]));return xe.useDebugValue(n),n}const _y=e=>{const t=Qw(e),n=r=>Xw(t,r);return Object.assign(n,t),n},ax=(e=>e?_y(e):_y),Qe=ax((e,t)=>({globalFilters:{},chartFilters:{},crossFilters:{},setGlobalFilter:(n,r)=>e(a=>({globalFilters:{...a.globalFilters,[n]:r}})),setChartFilter:(n,r,a)=>e(o=>({chartFilters:{...o.chartFilters,[n]:{...o.chartFilters[n],[r]:a}}})),setCrossFilter:(n,r,a)=>e(o=>{const u=o.crossFilters[n];if(u&&u.value===r){const{[n]:c,...d}=o.crossFilters;return{crossFilters:d}}return{crossFilters:{...o.crossFilters,[n]:{field:n,value:r,sourceChart:a}}}}),clearCrossFilter:n=>e(r=>{const{[n]:a,...o}=r.crossFilters;return{crossFilters:o}}),clearAllCrossFilters:()=>e({crossFilters:{}}),getEffectiveFilters:n=>{const{globalFilters:r,crossFilters:a,chartFilters:o}=t(),u={};for(const c of Object.values(a))c.sourceChart!==n&&(u[c.field]=c.value);return{...r,...u,...o[n]}},resetFilters:()=>e({globalFilters:{},chartFilters:{},crossFilters:{}}),resetChartFilters:n=>e(r=>{const{[n]:a,...o}=r.chartFilters;return{chartFilters:o}})}));function ix(e){const t=Qe(u=>u.globalFilters),n=Qe(u=>u.chartFilters),r=Qe(u=>u.crossFilters),a=Qe(u=>u.getEffectiveFilters),o=I.useMemo(()=>Object.fromEntries(Object.entries(a(e)).filter(([u,c])=>c!=null)),[t,n,r,e]);return is({queryKey:["chartData",e,o],queryFn:()=>Ht.queryChart(e,o),enabled:!!e})}function Kw(e){const t=Qe(u=>u.globalFilters),n=Qe(u=>u.chartFilters),r=Qe(u=>u.crossFilters),a=Qe(u=>u.getEffectiveFilters),o=I.useMemo(()=>Object.fromEntries(Object.entries(a(e)).filter(([u,c])=>c!=null)),[t,n,r,e]);return is({queryKey:["chartWithData",e,o],queryFn:()=>Ht.queryChart(e,o,{includeConfig:!0}),enabled:!!e})}function F0(){const e=jr();return t=>{e.invalidateQueries({queryKey:["chartData",t]}),e.invalidateQueries({queryKey:["chartWithData",t]})}}function ox(){return is({queryKey:["dashboards"],queryFn:()=>Ht.getDashboards()})}function Ny(e){const t=[];for(const n of e.rows)for(const r of n.widgets)r.type==="chart"&&r.ref&&t.push(r.ref);return t}function Jw(e){return e.tabs?e.tabs[0]?Ny(e.tabs[0].layout):[]:e.layout?Ny(e.layout):[]}function Zw(e,t){var o,u,c;const n=jr(),r=Qe(d=>d.globalFilters),a=is({queryKey:["dashboard",e,t],queryFn:()=>Ht.getDashboard(e,t),enabled:!!e});return I.useEffect(()=>{var d,f,p,g,x;if((d=a.data)!=null&&d.name&&((f=a.data)!=null&&f.layout||(p=a.data)!=null&&p.tabs)){const E=Jw(a.data);(x=(g=a.data.tabs)==null?void 0:g[0])==null||x.name;const _=Object.fromEntries(Object.entries(r).filter(([S,w])=>w!=null));E.forEach(S=>{n.prefetchQuery({queryKey:["chartWithData",S,_],queryFn:()=>Ht.queryChart(S,_,{includeConfig:!0}),staleTime:1e3*60*5})})}},[(o=a.data)==null?void 0:o.layout,(u=a.data)==null?void 0:u.tabs,(c=a.data)==null?void 0:c.name,r,n]),a}function eS(e){const t=jr();return Ww({mutationFn:({layout:n,message:r,tab:a})=>Ht.saveDashboard(e,n,r,a),onSuccess:()=>{t.invalidateQueries({queryKey:["dashboard",e]})}})}function tS(){const e=jr();return()=>{e.invalidateQueries({queryKey:["chartData"]}),e.invalidateQueries({queryKey:["chartWithData"]})}}function nS(){const e=jr();I.useRef(1e3),I.useEffect(()=>{},[e])}const j0=I.createContext(null),hc="yc-theme-mode";function rS(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function sS({configMode:e,children:t}){const n=I.useCallback(()=>{const d=localStorage.getItem(hc);return d==="light"||d==="dark"?d:e==="light"||e==="dark"?e:rS()},[e]),[r,a]=I.useState(n);I.useEffect(()=>{if(localStorage.getItem(hc)||e&&e!=="auto")return;const f=window.matchMedia("(prefers-color-scheme: dark)"),p=g=>a(g.matches?"dark":"light");return f.addEventListener("change",p),()=>f.removeEventListener("change",p)},[e]),I.useEffect(()=>{document.documentElement.setAttribute("data-theme",r)},[r]);const o=I.useCallback(()=>{a(d=>{const f=d==="light"?"dark":"light";return localStorage.setItem(hc,f),f})},[]),u=I.useCallback(()=>{localStorage.removeItem(hc),a(n())},[n]),c=I.useMemo(()=>({mode:r,toggleMode:o,clearOverride:u}),[r,o,u]);return m.jsx(j0.Provider,{value:c,children:t})}function ux(){const e=I.useContext(j0);if(!e)throw new Error("useThemeMode must be used within ThemeModeProvider");return e}function aS(){return I.useContext(j0)}const mc={textColor:"#6b7280",borderColor:"#e5e7eb",surfaceColor:"#ffffff",splitLineColor:"#e5e7eb"};function os(){const e=aS(),t=(e==null?void 0:e.mode)??"light";return I.useMemo(()=>{const n=getComputedStyle(document.documentElement);return{textColor:n.getPropertyValue("--yc-color-text-secondary").trim()||mc.textColor,borderColor:n.getPropertyValue("--yc-color-border").trim()||mc.borderColor,surfaceColor:n.getPropertyValue("--yc-color-surface").trim()||mc.surfaceColor,splitLineColor:n.getPropertyValue("--yc-color-border").trim()||mc.splitLineColor}},[t])}const lx=new Set(["system-ui","serif","sans-serif","monospace","ui-monospace","cursive"]),iS={compact:"13px",default:"14px",comfortable:"16px"},oS={modern:{colors:{primary:"#3B82F6",background:"#f1f5f9",surface:"#ffffff",sidebar:"#ffffff",text:"#111827"},modeColors:{light:{primary:"#3B82F6",background:"#f1f5f9",surface:"#ffffff",sidebar:"#ffffff",text:"#111827",textSecondary:"#6b7280",border:"#e5e7eb",surfaceHover:"#f1f5f9",textMuted:"#9ca3af",inputBg:"#f9fafb",danger:"#ef4444",success:"#10b981"},dark:{primary:"#60a5fa",background:"#0f172a",surface:"#1e293b",sidebar:"#0f172a",text:"#f1f5f9",textSecondary:"#94a3b8",border:"#334155",surfaceHover:"#334155",textMuted:"#64748b",inputBg:"#1e293b",danger:"#f87171",success:"#34d399"}},fonts:{heading:"Inter",body:"Inter",mono:"JetBrains Mono",size:"default"},palette:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#06B6D4","#F97316","#84CC16","#14B8A6"],radius:"8px",shadow:"0 1px 3px rgba(0,0,0,0.1)",cardPadding:"20px",cardBorder:"none",sidebarShow:!0},executive:{colors:{primary:"#0ea5e9",background:"#f8fafc",surface:"#ffffff",sidebar:"#1e293b",text:"#0f172a"},modeColors:{light:{primary:"#0ea5e9",background:"#f8fafc",surface:"#ffffff",sidebar:"#1e293b",text:"#0f172a",textSecondary:"#6b7280",border:"#e5e7eb",surfaceHover:"#f1f5f9",textMuted:"#9ca3af",inputBg:"#f9fafb",danger:"#ef4444",success:"#10b981"},dark:{primary:"#38bdf8",background:"#0c1322",surface:"#1a2332",sidebar:"#0c1322",text:"#e2e8f0",textSecondary:"#94a3b8",border:"#2d3a4a",surfaceHover:"#2d3a4a",textMuted:"#64748b",inputBg:"#1a2332",danger:"#f87171",success:"#34d399"}},fonts:{heading:"system-ui",body:"system-ui",mono:"ui-monospace",size:"compact"},palette:["#1e3a5f","#0d9488","#d97706","#64748b","#9f1239","#4338ca","#0369a1","#b45309","#475569","#7c3aed"],radius:"2px",shadow:"none",cardPadding:"16px",cardBorder:"1px solid #e2e8f0",sidebarShow:!0},minimal:{colors:{primary:"#6366f1",background:"#f8fafc",surface:"#ffffff",sidebar:"#f1f5f9",text:"#1e293b"},modeColors:{light:{primary:"#6366f1",background:"#f8fafc",surface:"#ffffff",sidebar:"#f1f5f9",text:"#1e293b",textSecondary:"#6b7280",border:"#e5e7eb",surfaceHover:"#f1f5f9",textMuted:"#9ca3af",inputBg:"#f9fafb",danger:"#ef4444",success:"#10b981"},dark:{primary:"#818cf8",background:"#0f172a",surface:"#1e293b",sidebar:"#1e293b",text:"#f1f5f9",textSecondary:"#94a3b8",border:"#334155",surfaceHover:"#334155",textMuted:"#64748b",inputBg:"#1e293b",danger:"#f87171",success:"#34d399"}},fonts:{heading:"system-ui",body:"system-ui",mono:"JetBrains Mono",size:"comfortable"},palette:["#3b82f6","#2563eb","#1d4ed8","#1e40af","#10b981","#059669","#047857","#065f46","#6366f1","#4f46e5"],radius:"0px",shadow:"none",cardPadding:"12px",cardBorder:"none",sidebarShow:!1}};function uS(e){const t=parseInt(e.replace("#",""),16),n=(t>>16)/255,r=(t>>8&255)/255,a=(t&255)/255,o=u=>u<=.03928?u/12.92:((u+.055)/1.055)**2.4;return .2126*o(n)+.7152*o(r)+.0722*o(a)}function Oy(e,t){const n=parseInt(e.replace("#",""),16),r=Math.min(255,Math.max(0,(n>>16)+Math.round(2.55*t))),a=Math.min(255,Math.max(0,(n>>8&255)+Math.round(2.55*t))),o=Math.min(255,Math.max(0,(n&255)+Math.round(2.55*t)));return`#${((1<<24)+(r<<16)+(a<<8)+o).toString(16).slice(1)}`}function rh(e){return lx.has(e)?`${e}, sans-serif`:e.toLowerCase().includes("mono")?`'${e}', monospace`:`'${e}', system-ui, sans-serif`}function lS(e,t="light"){var k,N,R,j,M,P,F,W,V,J,K,Z;const n=e.base??"modern",r=oS[n],a=r.modeColors[t],o=((k=e.colors)==null?void 0:k.primary)??a.primary,u=((N=e.colors)==null?void 0:N.background)??a.background,c=((R=e.colors)==null?void 0:R.surface)??a.surface,d=((j=e.colors)==null?void 0:j.sidebar)??a.sidebar,f=((M=e.colors)==null?void 0:M.text)??a.text,p=((P=e.fonts)==null?void 0:P.heading)??r.fonts.heading,g=((F=e.fonts)==null?void 0:F.body)??r.fonts.body,x=((W=e.fonts)==null?void 0:W.mono)??r.fonts.mono,E=iS[((V=e.fonts)==null?void 0:V.size)??r.fonts.size]??"14px",_=e.palette??r.palette,S=new Set;for(const G of[p,g,x])!lx.has(G)&&G!=="ui-monospace"&&S.add(G);const w=S.size>0?`https://fonts.googleapis.com/css2?${[...S].map(G=>`family=${encodeURIComponent(G)}:wght@400;500;600;700`).join("&")}&display=swap`:null,T=uS(d)<.2,C=T?"#f1f5f9":f,O=T?"#94a3b8":a.textSecondary,L=T?"rgba(255,255,255,0.1)":a.border,B={"--yc-color-primary":o,"--yc-color-primary-light":Oy(o,t==="dark"?15:20),"--yc-color-primary-dark":Oy(o,t==="dark"?-10:-15),"--yc-color-background":u,"--yc-color-surface":c,"--yc-color-sidebar":d,"--yc-color-text":f,"--yc-color-text-secondary":a.textSecondary,"--yc-color-border":a.border,"--yc-color-surface-hover":a.surfaceHover,"--yc-color-text-muted":a.textMuted,"--yc-color-input-bg":a.inputBg,"--yc-color-danger":a.danger,"--yc-color-success":a.success,"--yc-color-sidebar-text":C,"--yc-color-sidebar-text-secondary":O,"--yc-color-sidebar-border":L,"--yc-font-heading":rh(p),"--yc-font-body":rh(g),"--yc-font-mono":rh(x),"--yc-font-size-base":E,"--yc-radius":r.radius,"--yc-shadow":r.shadow,"--yc-card-padding":r.cardPadding,"--yc-card-border":r.cardBorder,"--yc-grid-gap":"16px","--yc-topbar-height":"40px"};return{base:n,mode:t,cssVars:B,palette:_,sidebarShow:((J=e.sidebar)==null?void 0:J.show)??r.sidebarShow,sidebarLinks:(K=e.sidebar)==null?void 0:K.links,sidebarSections:(Z=e.sidebar)==null?void 0:Z.sections,logo:e.logo,favicon:e.favicon,title:e.title,customCss:e.customCss,googleFontsUrl:w}}const cx=I.createContext(null);function cS({children:e}){const{data:t}=ii(),{mode:n}=ux(),r=I.useMemo(()=>lS((t==null?void 0:t.theme)??{},n),[t==null?void 0:t.theme,n]);return I.useEffect(()=>{const a=document.documentElement;for(const[o,u]of Object.entries(r.cssVars))a.style.setProperty(o,u);return()=>{for(const o of Object.keys(r.cssVars))a.style.removeProperty(o)}},[r.cssVars]),I.useEffect(()=>{if(!r.googleFontsUrl)return;const a="yc-google-fonts";let o=document.getElementById(a);return o||(o=document.createElement("link"),o.id=a,o.rel="stylesheet",document.head.appendChild(o)),o.href=r.googleFontsUrl,()=>{o==null||o.remove()}},[r.googleFontsUrl]),I.useEffect(()=>{if(!r.customCss)return;const a="yc-custom-css";let o=document.getElementById(a);return o||(o=document.createElement("link"),o.id=a,o.rel="stylesheet",document.head.appendChild(o)),o.href="/api/theme/custom.css",()=>{o==null||o.remove()}},[r.customCss]),I.useEffect(()=>{const a=r.title||(t==null?void 0:t.name)||"Yamchart";document.title=a},[r.title,t==null?void 0:t.name]),I.useEffect(()=>{if(!r.favicon)return;const a="yc-favicon";let o=document.querySelector(`link#${a}`);o||(o=document.createElement("link"),o.id=a,o.rel="icon",document.head.appendChild(o)),o.href=`/api/assets/${r.favicon.replace(/^\.\/assets\//,"")}`},[r.favicon]),m.jsx(cx.Provider,{value:r,children:e})}function dS({children:e}){var r;const{data:t}=ii(),n=(r=t==null?void 0:t.theme)==null?void 0:r.mode;return m.jsx(sS,{configMode:n,children:m.jsx(cS,{children:e})})}function B0(){const e=I.useContext(cx);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function dx(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=dx(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Sr(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=dx(e))&&(r&&(r+=" "),r+=t);return r}const Dy="yamchart-sidebar-folders";function fS(e){return e?e.replace(/[-_]/g," ").replace(/\b\w/g,t=>t.toUpperCase()):"Ungrouped"}function Ay(e){const t=new Map;for(const r of e){const a=r.folder??"";t.has(a)||t.set(a,[]),t.get(a).push(r)}const n=[];for(const[r,a]of t)a.sort((o,u)=>{const c=o.title||o.name,d=u.title||u.name;return c.localeCompare(d)}),n.push({folder:r,label:fS(r),items:a});return n.sort((r,a)=>!r.folder&&!a.folder?0:r.folder?a.folder?r.label.localeCompare(a.label):-1:1),n}function sh({type:e,className:t,style:n}){const r={className:t,style:n,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},a={strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5};switch(e){case"bar":return m.jsx("svg",{...r,children:m.jsx("path",{...a,d:"M3 20h18M5 20V10h3v10M10 20V4h3v16M15 20v-8h3v8"})});case"line":return m.jsx("svg",{...r,children:m.jsx("path",{...a,d:"M3 20h18M4 16l4-6 4 4 4-8 4 6"})});case"area":return m.jsxs("svg",{...r,children:[m.jsx("path",{...a,d:"M3 20h18"}),m.jsx("path",{...a,d:"M4 16l4-6 4 4 4-8 4 6v8H4z",fill:"currentColor",opacity:.15}),m.jsx("path",{...a,d:"M4 16l4-6 4 4 4-8 4 6"})]});case"pie":return m.jsxs("svg",{...r,children:[m.jsx("path",{...a,d:"M12 2a10 10 0 110 20 10 10 0 010-20z"}),m.jsx("path",{...a,d:"M12 2v10l8.66 5"})]});case"donut":return m.jsxs("svg",{...r,children:[m.jsx("circle",{...a,cx:"12",cy:"12",r:"10"}),m.jsx("circle",{...a,cx:"12",cy:"12",r:"5"}),m.jsx("path",{...a,d:"M12 2v5M22 12h-5"})]});case"scatter":return m.jsxs("svg",{...r,children:[m.jsx("path",{...a,d:"M3 20h18M3 20V4"}),m.jsx("circle",{cx:"7",cy:"15",r:"1.5",fill:"currentColor"}),m.jsx("circle",{cx:"10",cy:"10",r:"1.5",fill:"currentColor"}),m.jsx("circle",{cx:"13",cy:"13",r:"1.5",fill:"currentColor"}),m.jsx("circle",{cx:"15",cy:"7",r:"1.5",fill:"currentColor"}),m.jsx("circle",{cx:"18",cy:"9",r:"1.5",fill:"currentColor"})]});case"combo":return m.jsxs("svg",{...r,children:[m.jsx("path",{...a,d:"M3 20h18"}),m.jsx("path",{...a,d:"M5 20v-6h3v6M10 20v-10h3v10"}),m.jsx("path",{...a,d:"M5 10l4-3 4 2 5-5"})]});case"heatmap":return m.jsxs("svg",{...r,children:[m.jsx("rect",{...a,x:"3",y:"3",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.2}),m.jsx("rect",{...a,x:"10",y:"3",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.6}),m.jsx("rect",{...a,x:"17",y:"3",width:"4",height:"5",rx:"1",fill:"currentColor",opacity:.4}),m.jsx("rect",{...a,x:"3",y:"10",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.8}),m.jsx("rect",{...a,x:"10",y:"10",width:"5",height:"5",rx:"1",fill:"currentColor",opacity:.3}),m.jsx("rect",{...a,x:"17",y:"10",width:"4",height:"5",rx:"1",fill:"currentColor",opacity:.9}),m.jsx("rect",{...a,x:"3",y:"17",width:"5",height:"4",rx:"1",fill:"currentColor",opacity:.5}),m.jsx("rect",{...a,x:"10",y:"17",width:"5",height:"4",rx:"1",fill:"currentColor",opacity:.7}),m.jsx("rect",{...a,x:"17",y:"17",width:"4",height:"4",rx:"1",fill:"currentColor",opacity:.1})]});case"funnel":return m.jsx("svg",{...r,children:m.jsx("path",{...a,d:"M3 4h18l-3 5H6L3 4zM6 9h12l-2 5H8L6 9zM8 14h8l-2 5h-4l-2-5z"})});case"waterfall":return m.jsxs("svg",{...r,children:[m.jsx("path",{...a,d:"M3 20h18"}),m.jsx("path",{...a,d:"M5 8h3v4H5zM9 6h3v2H9zM13 10h3v4h-3zM17 6h3v8h-3"}),m.jsx("path",{...a,d:"M8 10h1M12 8h1",strokeDasharray:"2 1"})]});case"gauge":return m.jsxs("svg",{...r,children:[m.jsx("path",{...a,d:"M4.93 17.07A10 10 0 0112 2a10 10 0 017.07 15.07"}),m.jsx("path",{...a,d:"M12 12l-3-6",strokeWidth:2}),m.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"})]});case"kpi":case"metric":return m.jsxs("svg",{...r,children:[m.jsx("path",{...a,d:"M4 6h16M4 6v12a2 2 0 002 2h12a2 2 0 002-2V6"}),m.jsx("path",{...a,d:"M9 11h6M12 11v5",strokeWidth:2})]});case"table":return m.jsx("svg",{...r,children:m.jsx("path",{...a,d:"M3 5h18M3 10h18M3 15h18M3 20h18M8 5v15M15 5v15"})});default:return m.jsx("svg",{...r,children:m.jsx("path",{...a,d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"})})}}function Iy({expanded:e,className:t,style:n}){return m.jsx("svg",{className:Sr("w-3.5 h-3.5 transition-transform",e&&"rotate-90",t),style:n,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}function Ry({dashboards:e,charts:t,currentPath:n,onNavigate:r,collapsed:a=!1}){var B,k;const o=B0(),u=n.split("?")[0],c=N=>u===N,d=((B=o.sidebarSections)==null?void 0:B.dashboards)!==!1,f=((k=o.sidebarSections)==null?void 0:k.charts)!==!1,p={backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)",borderColor:"var(--yc-color-primary)"},g=I.useMemo(()=>Ay(e),[e]),x=I.useMemo(()=>Ay(t),[t]),E=I.useMemo(()=>{for(const N of e)if(c(`/dashboards/${N.name}`))return N.folder??"";return null},[e,u]),_=I.useMemo(()=>{for(const N of t)if(c(`/charts/${N.name}`))return N.folder??"";return null},[t,u]),[S,w]=I.useState(()=>{try{const N=localStorage.getItem(Dy);return N?JSON.parse(N):{}}catch{return{}}});I.useEffect(()=>{try{localStorage.setItem(Dy,JSON.stringify(S))}catch{}},[S]);const T=I.useCallback((N,R)=>{const j=`${N}:${R}`;return N==="dashboards"&&E===R||N==="charts"&&_===R?!0:S[j]??!1},[S,E,_]),C=I.useCallback((N,R)=>{const j=`${N}:${R}`,M=N==="dashboards"&&E===R||N==="charts"&&_===R;w(P=>{const F=P[j]??M;return{...P,[j]:!F}})},[E,_]),O=g.length>1||g.some(N=>N.folder!==""),L=x.length>1||x.some(N=>N.folder!=="");return m.jsx("aside",{className:Sr("yc-sidebar border-r flex flex-col transition-all overflow-hidden",a?"w-16":"w-56"),style:{backgroundColor:"var(--yc-color-sidebar)",borderColor:"var(--yc-color-sidebar-border)"},children:a?m.jsxs("div",{className:"py-3 flex flex-col items-center gap-1 overflow-y-auto",children:[d&&e.map(N=>{const R=`/dashboards/${N.name}`,j=c(R);return m.jsx("button",{onClick:()=>r(R),className:"p-2 rounded transition-colors",title:N.title,style:j?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-sidebar-text-secondary)"},children:m.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})})},N.name)}),d&&f&&e.length>0&&t.length>0&&m.jsx("div",{className:"w-8 border-t my-1",style:{borderColor:"var(--yc-color-sidebar-border)"}}),f&&t.map(N=>{const R=`/charts/${N.name}`,j=c(R);return m.jsx("button",{onClick:()=>r(R),className:"p-2 rounded transition-colors",title:N.title,style:j?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-sidebar-text-secondary)"},children:m.jsx(sh,{type:N.type,className:"w-5 h-5"})},N.name)})]}):m.jsxs(m.Fragment,{children:[d&&e.length>0&&m.jsxs("div",{className:"py-2",children:[m.jsx("div",{className:"px-4 py-2 text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:"Dashboards"}),O?g.map(N=>{const R=T("dashboards",N.folder);return m.jsxs("div",{children:[m.jsxs("button",{onClick:()=>C("dashboards",N.folder),className:"w-full flex items-center gap-2 px-4 py-1.5 text-xs font-medium hover:bg-white/5 transition-colors",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:[m.jsx(Iy,{expanded:R}),m.jsx("span",{className:"truncate",children:N.label}),m.jsx("span",{className:"ml-auto opacity-50",children:N.items.length})]}),R&&N.items.map(j=>{const M=`/dashboards/${j.name}`,P=c(M);return m.jsxs("button",{onClick:()=>r(M),className:Sr("w-full flex items-center gap-3 pl-8 pr-4 py-2 text-sm transition-colors",P&&"border-r-2"),style:P?p:{color:"var(--yc-color-sidebar-text)"},title:j.title,children:[m.jsx("svg",{className:"w-5 h-5 flex-shrink-0",style:{color:P?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})}),m.jsx("span",{className:"truncate",children:j.title})]},j.name)})]},N.folder)}):e.map(N=>{const R=`/dashboards/${N.name}`,j=c(R);return m.jsxs("button",{onClick:()=>r(R),className:Sr("w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors",j&&"border-r-2"),style:j?p:{color:"var(--yc-color-sidebar-text)"},title:N.title,children:[m.jsx("svg",{className:"w-5 h-5 flex-shrink-0",style:{color:j?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})}),m.jsx("span",{className:"truncate",children:N.title})]},N.name)})]}),d&&f&&e.length>0&&t.length>0&&m.jsx("div",{className:"mx-4 border-t",style:{borderColor:"var(--yc-color-sidebar-border)"}}),f&&t.length>0&&m.jsxs("div",{className:"py-2 flex-1 overflow-y-auto",children:[m.jsx("div",{className:"px-4 py-2 text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:"Charts"}),L?x.map(N=>{const R=T("charts",N.folder);return m.jsxs("div",{children:[m.jsxs("button",{onClick:()=>C("charts",N.folder),className:"w-full flex items-center gap-2 px-4 py-1.5 text-xs font-medium hover:bg-white/5 transition-colors",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:[m.jsx(Iy,{expanded:R}),m.jsx("span",{className:"truncate",children:N.label}),m.jsx("span",{className:"ml-auto opacity-50",children:N.items.length})]}),R&&N.items.map(j=>{const M=`/charts/${j.name}`,P=c(M);return m.jsxs("button",{onClick:()=>r(M),className:Sr("w-full flex items-center gap-3 pl-8 pr-4 py-2 text-sm transition-colors",P&&"border-r-2"),style:P?p:{color:"var(--yc-color-sidebar-text)"},title:j.title,children:[m.jsx(sh,{type:j.type,className:"w-5 h-5 flex-shrink-0",style:{color:P?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"}}),m.jsx("span",{className:"truncate",children:j.title})]},j.name)})]},N.folder)}):t.map(N=>{const R=`/charts/${N.name}`,j=c(R);return m.jsxs("button",{onClick:()=>r(R),className:Sr("w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors",j&&"border-r-2"),style:j?p:{color:"var(--yc-color-sidebar-text)"},title:N.title,children:[m.jsx(sh,{type:N.type,className:"w-5 h-5 flex-shrink-0",style:{color:j?"var(--yc-color-primary)":"var(--yc-color-sidebar-text-secondary)"}}),m.jsx("span",{className:"truncate",children:N.title})]},N.name)})]}),o.sidebarLinks&&o.sidebarLinks.length>0&&m.jsx("div",{className:"py-2 border-t",style:{borderColor:"var(--yc-color-sidebar-border)"},children:o.sidebarLinks.map(N=>m.jsxs("a",{href:N.url,target:"_blank",rel:"noopener noreferrer",className:"w-full flex items-center gap-3 px-4 py-2 text-sm transition-colors hover:bg-white/10",style:{color:"var(--yc-color-sidebar-text-secondary)"},children:[m.jsx("svg",{className:"w-5 h-5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),m.jsx("span",{className:"truncate",children:N.label})]},N.url))})]})})}function hS({connection:e}){return m.jsxs("div",{className:"absolute right-0 top-full mt-2 z-50 min-w-[200px] bg-gray-900 text-white text-xs rounded-lg shadow-lg p-3 opacity-0 invisible group-hover:opacity-100 group-hover:visible transition-all duration-200",children:[m.jsx("div",{className:"absolute -top-1 right-4 w-2 h-2 bg-gray-900 rotate-45"}),m.jsxs("div",{className:"space-y-1.5",children:[m.jsxs("div",{className:"flex justify-between gap-4",children:[m.jsx("span",{className:"text-gray-400",children:"Name"}),m.jsx("span",{className:"font-medium",children:e.name})]}),m.jsxs("div",{className:"flex justify-between gap-4",children:[m.jsx("span",{className:"text-gray-400",children:"Type"}),m.jsx("span",{className:"font-medium capitalize",children:e.type})]}),(e.type==="duckdb"||e.type==="sqlite")&&e.path&&m.jsxs("div",{className:"flex justify-between gap-4",children:[m.jsx("span",{className:"text-gray-400",children:"Path"}),m.jsx("span",{className:"font-medium truncate max-w-[120px]",title:e.path,children:e.path})]}),(e.type==="postgres"||e.type==="mysql")&&m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"flex justify-between gap-4",children:[m.jsx("span",{className:"text-gray-400",children:"Host"}),m.jsxs("span",{className:"font-medium",children:[e.host,":",e.port]})]}),m.jsxs("div",{className:"flex justify-between gap-4",children:[m.jsx("span",{className:"text-gray-400",children:"Database"}),m.jsx("span",{className:"font-medium",children:e.database})]}),e.schema&&m.jsxs("div",{className:"flex justify-between gap-4",children:[m.jsx("span",{className:"text-gray-400",children:"Schema"}),m.jsx("span",{className:"font-medium",children:e.schema})]})]}),e.type==="snowflake"&&m.jsxs(m.Fragment,{children:[e.account&&m.jsxs("div",{className:"flex justify-between gap-4",children:[m.jsx("span",{className:"text-gray-400",children:"Account"}),m.jsx("span",{className:"font-medium truncate max-w-[120px]",title:e.account,children:e.account})]}),e.warehouse&&m.jsxs("div",{className:"flex justify-between gap-4",children:[m.jsx("span",{className:"text-gray-400",children:"Warehouse"}),m.jsx("span",{className:"font-medium",children:e.warehouse})]}),e.database&&m.jsxs("div",{className:"flex justify-between gap-4",children:[m.jsx("span",{className:"text-gray-400",children:"Database"}),m.jsx("span",{className:"font-medium",children:e.database})]}),e.schema&&m.jsxs("div",{className:"flex justify-between gap-4",children:[m.jsx("span",{className:"text-gray-400",children:"Schema"}),m.jsx("span",{className:"font-medium",children:e.schema})]}),e.role&&m.jsxs("div",{className:"flex justify-between gap-4",children:[m.jsx("span",{className:"text-gray-400",children:"Role"}),m.jsx("span",{className:"font-medium",children:e.role})]})]})]})]})}function mS({status:e,connection:t}){return m.jsxs("div",{className:"relative group",children:[m.jsxs("div",{className:"flex items-center gap-2 cursor-default",children:[m.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:e==="ok"?"var(--yc-color-success)":"var(--yc-color-danger)"}}),m.jsx("span",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:e==="ok"?"Connected":"Disconnected"})]}),t&&m.jsx(hS,{connection:t})]})}const ro=ax(e=>({auth:{status:"loading"},providers:[],checkAuth:async()=>{try{const t=await Ht.getAuthMe(),n=t.providers??[];t.needsSetup?e({auth:{status:"needs_setup"},providers:n}):t.user?e({auth:{status:"authenticated",user:t.user},providers:n}):e({auth:{status:"unauthenticated"},providers:n})}catch(t){t instanceof $u?t.status===404?e({auth:{status:"disabled"},providers:[]}):e({auth:{status:"disabled"},providers:[]}):e({auth:{status:"disabled"},providers:[]})}},login:async(t,n)=>{const{user:r}=await Ht.authLogin({email:t,password:n});e({auth:{status:"authenticated",user:r}})},setup:async(t,n,r)=>{const{user:a}=await Ht.authSetup({email:t,name:n,password:r});e({auth:{status:"authenticated",user:a}})},logout:async()=>{await Ht.authLogout(),e({auth:{status:"unauthenticated"}})}}));function pS({onClose:e}){const[t,n]=I.useState(""),[r,a]=I.useState(""),[o,u]=I.useState(""),[c,d]=I.useState(""),[f,p]=I.useState(!1),[g,x]=I.useState(!1),E=async _=>{if(_.preventDefault(),d(""),r!==o){d("New passwords do not match");return}if(r.length<8){d("Password must be at least 8 characters");return}x(!0);try{await Ht.authChangePassword({current_password:t,new_password:r}),p(!0),setTimeout(e,1500)}catch(S){d(S instanceof $u?S.message:"An error occurred")}finally{x(!1)}};return m.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",onClick:e,children:m.jsxs("div",{className:"rounded-lg shadow-lg p-6 w-full max-w-md",style:{backgroundColor:"var(--yc-color-surface)"},onClick:_=>_.stopPropagation(),children:[m.jsx("h2",{className:"text-lg font-semibold mb-4",style:{color:"var(--yc-color-text)"},children:"Change Password"}),f?m.jsx("div",{className:"text-sm rounded-md px-4 py-3",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-success) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--yc-color-success) 30%, transparent)",color:"var(--yc-color-success)"},children:"Password changed successfully."}):m.jsxs("form",{onSubmit:E,className:"space-y-4",children:[c&&m.jsx("div",{className:"text-sm rounded-md px-4 py-3",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-danger) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--yc-color-danger) 30%, transparent)",color:"var(--yc-color-danger)"},children:c}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium mb-1",style:{color:"var(--yc-color-text-secondary)"},children:"Current Password"}),m.jsx("input",{type:"password",value:t,onChange:_=>n(_.target.value),required:!0,className:"w-full px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",style:{backgroundColor:"var(--yc-color-input-bg)",color:"var(--yc-color-text)",borderColor:"var(--yc-color-border)"}})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium mb-1",style:{color:"var(--yc-color-text-secondary)"},children:"New Password"}),m.jsx("input",{type:"password",value:r,onChange:_=>a(_.target.value),required:!0,minLength:8,className:"w-full px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",style:{backgroundColor:"var(--yc-color-input-bg)",color:"var(--yc-color-text)",borderColor:"var(--yc-color-border)"}})]}),m.jsxs("div",{children:[m.jsx("label",{className:"block text-sm font-medium mb-1",style:{color:"var(--yc-color-text-secondary)"},children:"Confirm New Password"}),m.jsx("input",{type:"password",value:o,onChange:_=>u(_.target.value),required:!0,className:"w-full px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500",style:{backgroundColor:"var(--yc-color-input-bg)",color:"var(--yc-color-text)",borderColor:"var(--yc-color-border)"}})]}),m.jsxs("div",{className:"flex justify-end gap-3",children:[m.jsx("button",{type:"button",onClick:e,className:"px-4 py-2 text-sm hover:bg-black/5 rounded-md",style:{color:"var(--yc-color-text-secondary)"},children:"Cancel"}),m.jsx("button",{type:"submit",disabled:g,className:"px-4 py-2 text-sm bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50",children:g?"Saving...":"Change Password"})]})]})]})})}function gS({onNavigateToUsers:e,onNavigateToShares:t}){const n=ro(f=>f.auth),r=ro(f=>f.logout),[a,o]=I.useState(!1),[u,c]=I.useState(!1),d=I.useRef(null);return I.useEffect(()=>{const f=p=>{d.current&&!d.current.contains(p.target)&&o(!1)};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[]),n.status!=="authenticated"?null:m.jsxs("div",{className:"relative",ref:d,children:[m.jsxs("button",{onClick:()=>o(!a),className:"flex items-center gap-2 text-sm px-2 py-1 rounded-md hover:bg-black/5",style:{color:"var(--yc-color-text-secondary)"},children:[m.jsx("span",{className:"w-7 h-7 rounded-full flex items-center justify-center text-xs font-medium",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"},children:n.user.name.charAt(0).toUpperCase()}),m.jsx("span",{children:n.user.name})]}),a&&m.jsxs("div",{className:"absolute right-0 mt-1 w-48 rounded-md shadow-lg py-1 z-50",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[m.jsx("div",{className:"px-4 py-2 text-xs border-b",style:{color:"var(--yc-color-text-secondary)",borderColor:"var(--yc-color-border)"},children:n.user.email}),n.user.role==="admin"&&m.jsxs(m.Fragment,{children:[m.jsx("button",{onClick:()=>{o(!1),e()},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5",style:{color:"var(--yc-color-text-secondary)"},children:"User Management"}),t&&m.jsx("button",{onClick:()=>{o(!1),t()},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5",style:{color:"var(--yc-color-text-secondary)"},children:"Shared Links"})]}),m.jsx("button",{onClick:()=>{o(!1),c(!0)},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5",style:{color:"var(--yc-color-text-secondary)"},children:"Change Password"}),m.jsx("button",{onClick:()=>{o(!1),r()},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5",style:{color:"var(--yc-color-danger)"},children:"Sign Out"})]}),u&&m.jsx(pS,{onClose:()=>c(!1)})]})}function yS({onToggleSidebar:e,currentPath:t,onNavigateToUsers:n,onNavigateToShares:r}){const a=B0(),{mode:o,toggleMode:u}=ux(),{data:c}=Vw(),d=ro(g=>g.auth),f=t.replace(/\?.*$/,"").replace(/^\//,"").split("/").filter(Boolean).map(g=>decodeURIComponent(g).replace(/-/g," ").replace(/\b\w/g,x=>x.toUpperCase())),p=typeof a.logo=="string"?`/api/assets/${a.logo.replace(/^\.\/assets\//,"")}`:a.logo?`/api/assets/${(o==="dark"&&a.logo.dark?a.logo.dark:a.logo.light).replace(/^\.\/assets\//,"")}`:null;return m.jsxs("header",{className:"yc-topbar flex items-center justify-between px-4 border-b flex-shrink-0",style:{height:"var(--yc-topbar-height)",backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("button",{onClick:e,className:"p-1.5 rounded hover:bg-black/5 transition-colors",title:"Toggle sidebar",children:m.jsx("svg",{className:"w-5 h-5",style:{color:"var(--yc-color-text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),p&&m.jsx("img",{src:p,alt:"",className:"h-6 w-auto"}),m.jsx("nav",{className:"flex items-center gap-1.5 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:f.map((g,x)=>m.jsxs("span",{className:"flex items-center gap-1.5",children:[x>0&&m.jsx("span",{children:"/"}),m.jsx("span",{className:x===f.length-1?"font-medium":"",style:x===f.length-1?{color:"var(--yc-color-text)"}:void 0,children:g})]},x))})]}),m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx(mS,{status:c==null?void 0:c.status,connection:c==null?void 0:c.connection}),m.jsx("button",{onClick:u,className:"p-1.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},title:o==="dark"?"Switch to light mode":"Switch to dark mode",children:o==="dark"?m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"})}):m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"})})}),m.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["v",c==null?void 0:c.version]}),d.status==="authenticated"&&n&&m.jsx(gS,{onNavigateToUsers:n,onNavigateToShares:r})]})]})}const Ly="yamchart-sidebar-hidden";function bS({children:e,currentPath:t,onNavigate:n,onNavigateToUsers:r,onNavigateToShares:a}){const{data:o}=ii(),{data:u}=ox(),c=B0(),d=M0(),f=(o==null?void 0:o.charts)||[],p=u||[],[g,x]=I.useState(()=>c.sidebarShow?localStorage.getItem(Ly)==="true":!0),[E,_]=I.useState(!1),S=!g&&d!=="sm",w=d==="md"&&!g,T=I.useCallback(()=>{if(d==="sm"){_(C=>!C);return}x(C=>{const O=!C;return localStorage.setItem(Ly,String(O)),O})},[d]);return m.jsxs("div",{className:"flex h-screen",style:{backgroundColor:"var(--yc-color-background)"},children:[S&&m.jsx(Ry,{dashboards:p,charts:f,currentPath:t,onNavigate:n,collapsed:w}),d==="sm"&&E&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 transition-opacity",onClick:()=>_(!1)}),m.jsx("aside",{className:"fixed inset-y-0 left-0 z-50 w-64 shadow-xl",style:{backgroundColor:"var(--yc-color-sidebar)"},children:m.jsx(Ry,{dashboards:p,charts:f,currentPath:t,onNavigate:C=>{n(C),_(!1)}})})]}),m.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[m.jsx(yS,{onToggleSidebar:T,currentPath:t,onNavigateToUsers:r,onNavigateToShares:a}),m.jsx("main",{className:"flex-1 overflow-auto",children:e})]})]})}function xS(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const ah={},vu={};function Ba(e,t){try{const r=(ah[e]||(ah[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return r in vu?vu[r]:My(r,r.split(":"))}catch{if(e in vu)return vu[e];const n=e==null?void 0:e.match(ES);return n?My(e,n.slice(1)):NaN}}const ES=/([+-]\d\d):?(\d\d)?/;function My(e,t){const n=+(t[0]||0),r=+(t[1]||0),a=+(t[2]||0)/60;return vu[e]=n*60+r>0?n*60+r+a:n*60-r-a}class rs extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(Ba(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),fx(this),s0(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new rs(...n,t):new rs(Date.now(),t)}withTimeZone(t){return new rs(+this,t)}getTimezoneOffset(){const t=-Ba(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),s0(this),+this}[Symbol.for("constructDateFrom")](t){return new rs(+new Date(t),this.timeZone)}}const Py=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!Py.test(e))return;const t=e.replace(Py,"$1UTC");rs.prototype[t]&&(e.startsWith("get")?rs.prototype[e]=function(){return this.internal[t]()}:(rs.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),vS(this),+this},rs.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),s0(this),+this}))});function s0(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-Ba(e.timeZone,e)*60))}function vS(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),fx(e)}function fx(e){const t=Ba(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),o=-new Date(+r).getTimezoneOffset(),u=a-o,c=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();u&&c&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+u);const d=a-n;d&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+d);const f=new Date(+e);f.setUTCSeconds(0);const p=a>0?f.getSeconds():(f.getSeconds()-60)%60,g=Math.round(-(Ba(e.timeZone,e)*60))%60;(g||p)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+g),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+g+p));const x=Ba(e.timeZone,e),E=x>0?Math.floor(x):Math.ceil(x),S=-new Date(+e).getTimezoneOffset()-E,w=E!==n,T=S-d;if(w&&T){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+T);const C=Ba(e.timeZone,e),O=C>0?Math.floor(C):Math.ceil(C),L=E-O;L&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+L),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+L))}}class Ln extends rs{static tz(t,...n){return n.length?new Ln(...n,t):new Ln(Date.now(),t)}toISOString(){const[t,n,r]=this.tzComponents(),a=`${t}${n}:${r}`;return this.internal.toISOString().slice(0,-1)+a}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,r,a]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${r} ${n} ${a}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,r,a]=this.tzComponents();return`${t} GMT${n}${r}${a} (${xS(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",r=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),a=String(Math.abs(t)%60).padStart(2,"0");return[n,r,a]}withTimeZone(t){return new Ln(+this,t)}[Symbol.for("constructDateFrom")](t){return new Ln(+new Date(t),this.timeZone)}}const hx=6048e5,TS=864e5,H0=6e4,U0=36e5,wS=1e3,Fy=Symbol.for("constructDateFrom");function ht(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Fy in e?e[Fy](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ze(e,t){return ht(t||e,e)}function ti(e,t,n){const r=Ze(e,n==null?void 0:n.in);return isNaN(t)?ht((n==null?void 0:n.in)||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Vu(e,t,n){const r=Ze(e,n==null?void 0:n.in);if(isNaN(t))return ht((n==null?void 0:n.in)||e,NaN);if(!t)return r;const a=r.getDate(),o=ht((n==null?void 0:n.in)||e,r.getTime());o.setMonth(r.getMonth()+t+1,0);const u=o.getDate();return a>=u?o:(r.setFullYear(o.getFullYear(),o.getMonth(),a),r)}let SS={};function oi(){return SS}function ss(e,t){var c,d,f,p;const n=oi(),r=(t==null?void 0:t.weekStartsOn)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??n.weekStartsOn??((p=(f=n.locale)==null?void 0:f.options)==null?void 0:p.weekStartsOn)??0,a=Ze(e,t==null?void 0:t.in),o=a.getDay(),u=(o<r?7:0)+o-r;return a.setDate(a.getDate()-u),a.setHours(0,0,0,0),a}function ni(e,t){return ss(e,{...t,weekStartsOn:1})}function mx(e,t){const n=Ze(e,t==null?void 0:t.in),r=n.getFullYear(),a=ht(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const o=ni(a),u=ht(n,0);u.setFullYear(r,0,4),u.setHours(0,0,0,0);const c=ni(u);return n.getTime()>=o.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Rc(e){const t=Ze(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function lo(e,...t){const n=ht.bind(null,t.find(r=>typeof r=="object"));return t.map(n)}function so(e,t){const n=Ze(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function z0(e,t,n){const[r,a]=lo(n==null?void 0:n.in,e,t),o=so(r),u=so(a),c=+o-Rc(o),d=+u-Rc(u);return Math.round((c-d)/TS)}function CS(e,t){const n=mx(e,t),r=ht(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),ni(r)}function px(e,t,n){return Vu(e,t*3,n)}function W0(e,t,n){return ti(e,t*7,n)}function Y0(e,t,n){return Vu(e,t*12,n)}function kS(e,t){let n,r=t==null?void 0:t.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=ht.bind(null,a));const o=Ze(a,r);(!n||n<o||isNaN(+o))&&(n=o)}),ht(r,n||NaN)}function _S(e,t){let n,r=t==null?void 0:t.in;return e.forEach(a=>{!r&&typeof a=="object"&&(r=ht.bind(null,a));const o=Ze(a,r);(!n||n>o||isNaN(+o))&&(n=o)}),ht(r,n||NaN)}function NS(e,t,n){const[r,a]=lo(n==null?void 0:n.in,e,t);return+so(r)==+so(a)}function gx(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function OS(e){return!(!gx(e)&&typeof e!="number"||isNaN(+Ze(e)))}function yx(e,t,n){const[r,a]=lo(n==null?void 0:n.in,e,t),o=r.getFullYear()-a.getFullYear(),u=r.getMonth()-a.getMonth();return o*12+u}function DS(e,t){const n=Ze(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function bx(e,t){const n=Ze(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function xx(e,t){const[n,r]=lo(e,t.start,t.end);return{start:n,end:r}}function AS(e,t){const{start:n,end:r}=xx(t==null?void 0:t.in,e);let a=+n>+r;const o=a?+n:+r,u=a?r:n;u.setHours(0,0,0,0),u.setDate(1);let c=1;const d=[];for(;+u<=o;)d.push(ht(n,u)),u.setMonth(u.getMonth()+c);return a?d.reverse():d}function IS(e,t){const n=Ze(e,t==null?void 0:t.in),r=n.getMonth(),a=r-r%3;return n.setMonth(a,1),n.setHours(0,0,0,0),n}function Ex(e,t){const n=Ze(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function vx(e,t){const n=Ze(e,t==null?void 0:t.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function q0(e,t){const n=Ze(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function RS(e,t){const{start:n,end:r}=xx(t==null?void 0:t.in,e);let a=+n>+r;const o=a?+n:+r,u=a?r:n;u.setHours(0,0,0,0),u.setMonth(0,1);let c=1;const d=[];for(;+u<=o;)d.push(ht(n,u)),u.setFullYear(u.getFullYear()+c);return a?d.reverse():d}function $0(e,t){var c,d,f,p;const n=oi(),r=(t==null?void 0:t.weekStartsOn)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??n.weekStartsOn??((p=(f=n.locale)==null?void 0:f.options)==null?void 0:p.weekStartsOn)??0,a=Ze(e,t==null?void 0:t.in),o=a.getDay(),u=(o<r?-7:0)+6-(o-r);return a.setDate(a.getDate()+u),a.setHours(23,59,59,999),a}function LS(e,t){return $0(e,{...t,weekStartsOn:1})}function MS(e,t){const n=Ze(e,t==null?void 0:t.in),r=n.getMonth(),a=r-r%3+3;return n.setMonth(a,0),n.setHours(23,59,59,999),n}const PS={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},FS=(e,t,n)=>{let r;const a=PS[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function ih(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const jS={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},BS={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},HS={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},US={date:ih({formats:jS,defaultWidth:"full"}),time:ih({formats:BS,defaultWidth:"full"}),dateTime:ih({formats:HS,defaultWidth:"full"})},zS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},WS=(e,t,n,r)=>zS[e];function nu(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const u=e.defaultFormattingWidth||e.defaultWidth,c=n!=null&&n.width?String(n.width):u;a=e.formattingValues[c]||e.formattingValues[u]}else{const u=e.defaultWidth,c=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[c]||e.values[u]}const o=e.argumentCallback?e.argumentCallback(t):t;return a[o]}}const YS={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},qS={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},$S={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},VS={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},QS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},GS={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},XS=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},KS={ordinalNumber:XS,era:nu({values:YS,defaultWidth:"wide"}),quarter:nu({values:qS,defaultWidth:"wide",argumentCallback:e=>e-1}),month:nu({values:$S,defaultWidth:"wide"}),day:nu({values:VS,defaultWidth:"wide"}),dayPeriod:nu({values:QS,defaultWidth:"wide",formattingValues:GS,defaultFormattingWidth:"wide"})};function ru(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(a);if(!o)return null;const u=o[0],c=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(c)?ZS(c,g=>g.test(u)):JS(c,g=>g.test(u));let f;f=e.valueCallback?e.valueCallback(d):d,f=n.valueCallback?n.valueCallback(f):f;const p=t.slice(u.length);return{value:f,rest:p}}}function JS(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function ZS(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function eC(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],o=t.match(e.parsePattern);if(!o)return null;let u=e.valueCallback?e.valueCallback(o[0]):o[0];u=n.valueCallback?n.valueCallback(u):u;const c=t.slice(a.length);return{value:u,rest:c}}}const tC=/^(\d+)(th|st|nd|rd)?/i,nC=/\d+/i,rC={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},sC={any:[/^b/i,/^(a|c)/i]},aC={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},iC={any:[/1/i,/2/i,/3/i,/4/i]},oC={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},uC={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},lC={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},cC={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},dC={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},fC={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},hC={ordinalNumber:eC({matchPattern:tC,parsePattern:nC,valueCallback:e=>parseInt(e,10)}),era:ru({matchPatterns:rC,defaultMatchWidth:"wide",parsePatterns:sC,defaultParseWidth:"any"}),quarter:ru({matchPatterns:aC,defaultMatchWidth:"wide",parsePatterns:iC,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ru({matchPatterns:oC,defaultMatchWidth:"wide",parsePatterns:uC,defaultParseWidth:"any"}),day:ru({matchPatterns:lC,defaultMatchWidth:"wide",parsePatterns:cC,defaultParseWidth:"any"}),dayPeriod:ru({matchPatterns:dC,defaultMatchWidth:"any",parsePatterns:fC,defaultParseWidth:"any"})},Fa={code:"en-US",formatDistance:FS,formatLong:US,formatRelative:WS,localize:KS,match:hC,options:{weekStartsOn:0,firstWeekContainsDate:1}};function mC(e,t){const n=Ze(e,t==null?void 0:t.in);return z0(n,q0(n))+1}function Vc(e,t){const n=Ze(e,t==null?void 0:t.in),r=+ni(n)-+CS(n);return Math.round(r/hx)+1}function V0(e,t){var p,g,x,E;const n=Ze(e,t==null?void 0:t.in),r=n.getFullYear(),a=oi(),o=(t==null?void 0:t.firstWeekContainsDate)??((g=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:g.firstWeekContainsDate)??a.firstWeekContainsDate??((E=(x=a.locale)==null?void 0:x.options)==null?void 0:E.firstWeekContainsDate)??1,u=ht((t==null?void 0:t.in)||e,0);u.setFullYear(r+1,0,o),u.setHours(0,0,0,0);const c=ss(u,t),d=ht((t==null?void 0:t.in)||e,0);d.setFullYear(r,0,o),d.setHours(0,0,0,0);const f=ss(d,t);return+n>=+c?r+1:+n>=+f?r:r-1}function pC(e,t){var c,d,f,p;const n=oi(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(c=t==null?void 0:t.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(f=n.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,a=V0(e,t),o=ht((t==null?void 0:t.in)||e,0);return o.setFullYear(a,0,r),o.setHours(0,0,0,0),ss(o,t)}function Qc(e,t){const n=Ze(e,t==null?void 0:t.in),r=+ss(n,t)-+pC(n,t);return Math.round(r/hx)+1}function pt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ks={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return pt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):pt(n+1,2)},d(e,t){return pt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return pt(e.getHours()%12||12,t.length)},H(e,t){return pt(e.getHours(),t.length)},m(e,t){return pt(e.getMinutes(),t.length)},s(e,t){return pt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return pt(a,t.length)}},Mi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},jy={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return Ks.y(e,t)},Y:function(e,t,n,r){const a=V0(e,r),o=a>0?a:1-a;if(t==="YY"){const u=o%100;return pt(u,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):pt(o,t.length)},R:function(e,t){const n=mx(e);return pt(n,t.length)},u:function(e,t){const n=e.getFullYear();return pt(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return pt(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return pt(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Ks.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return pt(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=Qc(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):pt(a,t.length)},I:function(e,t,n){const r=Vc(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):pt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ks.d(e,t)},D:function(e,t,n){const r=mC(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):pt(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return pt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return pt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return pt(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=Mi.noon:r===0?a=Mi.midnight:a=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=Mi.evening:r>=12?a=Mi.afternoon:r>=4?a=Mi.morning:a=Mi.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Ks.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ks.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):pt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):pt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ks.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ks.s(e,t)},S:function(e,t){return Ks.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Hy(r);case"XXXX":case"XX":return Ma(r);case"XXXXX":case"XXX":default:return Ma(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Hy(r);case"xxxx":case"xx":return Ma(r);case"xxxxx":case"xxx":default:return Ma(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+By(r,":");case"OOOO":default:return"GMT"+Ma(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+By(r,":");case"zzzz":default:return"GMT"+Ma(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return pt(r,t.length)},T:function(e,t,n){return pt(+e,t.length)}};function By(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),o=r%60;return o===0?n+String(a):n+String(a)+t+pt(o,2)}function Hy(e,t){return e%60===0?(e>0?"-":"+")+pt(Math.abs(e)/60,2):Ma(e,t)}function Ma(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=pt(Math.trunc(r/60),2),o=pt(r%60,2);return n+a+t+o}const Uy=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Tx=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},gC=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return Uy(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Uy(r,t)).replace("{{time}}",Tx(a,t))},a0={p:Tx,P:gC},yC=/^D+$/,bC=/^Y+$/,xC=["D","DD","YY","YYYY"];function wx(e){return yC.test(e)}function Sx(e){return bC.test(e)}function i0(e,t,n){const r=EC(e,t,n);if(console.warn(r),xC.includes(e))throw new RangeError(r)}function EC(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const vC=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,TC=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,wC=/^'([^]*?)'?$/,SC=/''/g,CC=/[a-zA-Z]/;function pn(e,t,n){var p,g,x,E,_,S,w,T;const r=oi(),a=(n==null?void 0:n.locale)??r.locale??Fa,o=(n==null?void 0:n.firstWeekContainsDate)??((g=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:g.firstWeekContainsDate)??r.firstWeekContainsDate??((E=(x=r.locale)==null?void 0:x.options)==null?void 0:E.firstWeekContainsDate)??1,u=(n==null?void 0:n.weekStartsOn)??((S=(_=n==null?void 0:n.locale)==null?void 0:_.options)==null?void 0:S.weekStartsOn)??r.weekStartsOn??((T=(w=r.locale)==null?void 0:w.options)==null?void 0:T.weekStartsOn)??0,c=Ze(e,n==null?void 0:n.in);if(!OS(c))throw new RangeError("Invalid time value");let d=t.match(TC).map(C=>{const O=C[0];if(O==="p"||O==="P"){const L=a0[O];return L(C,a.formatLong)}return C}).join("").match(vC).map(C=>{if(C==="''")return{isToken:!1,value:"'"};const O=C[0];if(O==="'")return{isToken:!1,value:kC(C)};if(jy[O])return{isToken:!0,value:C};if(O.match(CC))throw new RangeError("Format string contains an unescaped latin alphabet character `"+O+"`");return{isToken:!1,value:C}});a.localize.preprocessor&&(d=a.localize.preprocessor(c,d));const f={firstWeekContainsDate:o,weekStartsOn:u,locale:a};return d.map(C=>{if(!C.isToken)return C.value;const O=C.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Sx(O)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&wx(O))&&i0(O,t,String(e));const L=jy[O[0]];return L(c,O,a.localize,f)}).join("")}function kC(e){const t=e.match(wC);return t?t[1].replace(SC,"'"):e}function _C(e,t){const n=Ze(e,t==null?void 0:t.in),r=n.getFullYear(),a=n.getMonth(),o=ht(n,0);return o.setFullYear(r,a+1,0),o.setHours(0,0,0,0),o.getDate()}function NC(){return Object.assign({},oi())}function OC(e,t){const n=Ze(e,t==null?void 0:t.in).getDay();return n===0?7:n}function DC(e,t){return Ze(e,t==null?void 0:t.in).getMonth()}function AC(e,t){return Ze(e,t==null?void 0:t.in).getFullYear()}function IC(e,t){return+Ze(e)>+Ze(t)}function RC(e,t){return+Ze(e)<+Ze(t)}function LC(e,t){const n=MC(t)?new t(0):ht(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function MC(e){var t;return typeof e=="function"&&((t=e.prototype)==null?void 0:t.constructor)===e}const PC=10;class Cx{constructor(){we(this,"subPriority",0)}validate(t,n){return!0}}class FC extends Cx{constructor(t,n,r,a,o){super(),this.value=t,this.validateValue=n,this.setValue=r,this.priority=a,o&&(this.subPriority=o)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,r){return this.setValue(t,n,this.value,r)}}class jC extends Cx{constructor(n,r){super();we(this,"priority",PC);we(this,"subPriority",-1);this.context=n||(a=>ht(r,a))}set(n,r){return r.timestampIsSet?n:ht(n,LC(n,this.context))}}let ct=class{run(t,n,r,a){const o=this.parse(t,n,r,a);return o?{setter:new FC(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,n,r){return!0}};class BC extends ct{constructor(){super(...arguments);we(this,"priority",140);we(this,"incompatibleTokens",["R","u","t","T"])}parse(n,r,a){switch(r){case"G":case"GG":case"GGG":return a.era(n,{width:"abbreviated"})||a.era(n,{width:"narrow"});case"GGGGG":return a.era(n,{width:"narrow"});case"GGGG":default:return a.era(n,{width:"wide"})||a.era(n,{width:"abbreviated"})||a.era(n,{width:"narrow"})}}set(n,r,a){return r.era=a,n.setFullYear(a,0,1),n.setHours(0,0,0,0),n}}const rn={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},es={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function sn(e,t){return e&&{value:t(e.value),rest:e.rest}}function qt(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function ts(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const r=n[1]==="+"?1:-1,a=n[2]?parseInt(n[2],10):0,o=n[3]?parseInt(n[3],10):0,u=n[5]?parseInt(n[5],10):0;return{value:r*(a*U0+o*H0+u*wS),rest:t.slice(n[0].length)}}function kx(e){return qt(rn.anyDigitsSigned,e)}function Zt(e,t){switch(e){case 1:return qt(rn.singleDigit,t);case 2:return qt(rn.twoDigits,t);case 3:return qt(rn.threeDigits,t);case 4:return qt(rn.fourDigits,t);default:return qt(new RegExp("^\\d{1,"+e+"}"),t)}}function Lc(e,t){switch(e){case 1:return qt(rn.singleDigitSigned,t);case 2:return qt(rn.twoDigitsSigned,t);case 3:return qt(rn.threeDigitsSigned,t);case 4:return qt(rn.fourDigitsSigned,t);default:return qt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Q0(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function _x(e,t){const n=t>0,r=n?t:1-t;let a;if(r<=50)a=e||100;else{const o=r+50,u=Math.trunc(o/100)*100,c=e>=o%100;a=e+u-(c?100:0)}return n?a:1-a}function Nx(e){return e%400===0||e%4===0&&e%100!==0}class HC extends ct{constructor(){super(...arguments);we(this,"priority",130);we(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,r,a){const o=u=>({year:u,isTwoDigitYear:r==="yy"});switch(r){case"y":return sn(Zt(4,n),o);case"yo":return sn(a.ordinalNumber(n,{unit:"year"}),o);default:return sn(Zt(r.length,n),o)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,a){const o=n.getFullYear();if(a.isTwoDigitYear){const c=_x(a.year,o);return n.setFullYear(c,0,1),n.setHours(0,0,0,0),n}const u=!("era"in r)||r.era===1?a.year:1-a.year;return n.setFullYear(u,0,1),n.setHours(0,0,0,0),n}}class UC extends ct{constructor(){super(...arguments);we(this,"priority",130);we(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,r,a){const o=u=>({year:u,isTwoDigitYear:r==="YY"});switch(r){case"Y":return sn(Zt(4,n),o);case"Yo":return sn(a.ordinalNumber(n,{unit:"year"}),o);default:return sn(Zt(r.length,n),o)}}validate(n,r){return r.isTwoDigitYear||r.year>0}set(n,r,a,o){const u=V0(n,o);if(a.isTwoDigitYear){const d=_x(a.year,u);return n.setFullYear(d,0,o.firstWeekContainsDate),n.setHours(0,0,0,0),ss(n,o)}const c=!("era"in r)||r.era===1?a.year:1-a.year;return n.setFullYear(c,0,o.firstWeekContainsDate),n.setHours(0,0,0,0),ss(n,o)}}class zC extends ct{constructor(){super(...arguments);we(this,"priority",130);we(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,r){return Lc(r==="R"?4:r.length,n)}set(n,r,a){const o=ht(n,0);return o.setFullYear(a,0,4),o.setHours(0,0,0,0),ni(o)}}class WC extends ct{constructor(){super(...arguments);we(this,"priority",130);we(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,r){return Lc(r==="u"?4:r.length,n)}set(n,r,a){return n.setFullYear(a,0,1),n.setHours(0,0,0,0),n}}class YC extends ct{constructor(){super(...arguments);we(this,"priority",120);we(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"Q":case"QQ":return Zt(r.length,n);case"Qo":return a.ordinalNumber(n,{unit:"quarter"});case"QQQ":return a.quarter(n,{width:"abbreviated",context:"formatting"})||a.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(n,{width:"wide",context:"formatting"})||a.quarter(n,{width:"abbreviated",context:"formatting"})||a.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=1&&r<=4}set(n,r,a){return n.setMonth((a-1)*3,1),n.setHours(0,0,0,0),n}}class qC extends ct{constructor(){super(...arguments);we(this,"priority",120);we(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"q":case"qq":return Zt(r.length,n);case"qo":return a.ordinalNumber(n,{unit:"quarter"});case"qqq":return a.quarter(n,{width:"abbreviated",context:"standalone"})||a.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(n,{width:"wide",context:"standalone"})||a.quarter(n,{width:"abbreviated",context:"standalone"})||a.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=1&&r<=4}set(n,r,a){return n.setMonth((a-1)*3,1),n.setHours(0,0,0,0),n}}class $C extends ct{constructor(){super(...arguments);we(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);we(this,"priority",110)}parse(n,r,a){const o=u=>u-1;switch(r){case"M":return sn(qt(rn.month,n),o);case"MM":return sn(Zt(2,n),o);case"Mo":return sn(a.ordinalNumber(n,{unit:"month"}),o);case"MMM":return a.month(n,{width:"abbreviated",context:"formatting"})||a.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(n,{width:"wide",context:"formatting"})||a.month(n,{width:"abbreviated",context:"formatting"})||a.month(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=11}set(n,r,a){return n.setMonth(a,1),n.setHours(0,0,0,0),n}}class VC extends ct{constructor(){super(...arguments);we(this,"priority",110);we(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,r,a){const o=u=>u-1;switch(r){case"L":return sn(qt(rn.month,n),o);case"LL":return sn(Zt(2,n),o);case"Lo":return sn(a.ordinalNumber(n,{unit:"month"}),o);case"LLL":return a.month(n,{width:"abbreviated",context:"standalone"})||a.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(n,{width:"wide",context:"standalone"})||a.month(n,{width:"abbreviated",context:"standalone"})||a.month(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=11}set(n,r,a){return n.setMonth(a,1),n.setHours(0,0,0,0),n}}function QC(e,t,n){const r=Ze(e,n==null?void 0:n.in),a=Qc(r,n)-t;return r.setDate(r.getDate()-a*7),Ze(r,n==null?void 0:n.in)}class GC extends ct{constructor(){super(...arguments);we(this,"priority",100);we(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,r,a){switch(r){case"w":return qt(rn.week,n);case"wo":return a.ordinalNumber(n,{unit:"week"});default:return Zt(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,a,o){return ss(QC(n,a,o),o)}}function XC(e,t,n){const r=Ze(e,n==null?void 0:n.in),a=Vc(r,n)-t;return r.setDate(r.getDate()-a*7),r}class KC extends ct{constructor(){super(...arguments);we(this,"priority",100);we(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,r,a){switch(r){case"I":return qt(rn.week,n);case"Io":return a.ordinalNumber(n,{unit:"week"});default:return Zt(r.length,n)}}validate(n,r){return r>=1&&r<=53}set(n,r,a){return ni(XC(n,a))}}const JC=[31,28,31,30,31,30,31,31,30,31,30,31],ZC=[31,29,31,30,31,30,31,31,30,31,30,31];class ek extends ct{constructor(){super(...arguments);we(this,"priority",90);we(this,"subPriority",1);we(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"d":return qt(rn.date,n);case"do":return a.ordinalNumber(n,{unit:"date"});default:return Zt(r.length,n)}}validate(n,r){const a=n.getFullYear(),o=Nx(a),u=n.getMonth();return o?r>=1&&r<=ZC[u]:r>=1&&r<=JC[u]}set(n,r,a){return n.setDate(a),n.setHours(0,0,0,0),n}}class tk extends ct{constructor(){super(...arguments);we(this,"priority",90);we(this,"subpriority",1);we(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,r,a){switch(r){case"D":case"DD":return qt(rn.dayOfYear,n);case"Do":return a.ordinalNumber(n,{unit:"date"});default:return Zt(r.length,n)}}validate(n,r){const a=n.getFullYear();return Nx(a)?r>=1&&r<=366:r>=1&&r<=365}set(n,r,a){return n.setMonth(0,a),n.setHours(0,0,0,0),n}}function G0(e,t,n){var g,x,E,_;const r=oi(),a=(n==null?void 0:n.weekStartsOn)??((x=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:x.weekStartsOn)??r.weekStartsOn??((_=(E=r.locale)==null?void 0:E.options)==null?void 0:_.weekStartsOn)??0,o=Ze(e,n==null?void 0:n.in),u=o.getDay(),d=(t%7+7)%7,f=7-a,p=t<0||t>6?t-(u+f)%7:(d+f)%7-(u+f)%7;return ti(o,p,n)}class nk extends ct{constructor(){super(...arguments);we(this,"priority",90);we(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,r,a){switch(r){case"E":case"EE":case"EEE":return a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(n,{width:"wide",context:"formatting"})||a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,a,o){return n=G0(n,a,o),n.setHours(0,0,0,0),n}}class rk extends ct{constructor(){super(...arguments);we(this,"priority",90);we(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,r,a,o){const u=c=>{const d=Math.floor((c-1)/7)*7;return(c+o.weekStartsOn+6)%7+d};switch(r){case"e":case"ee":return sn(Zt(r.length,n),u);case"eo":return sn(a.ordinalNumber(n,{unit:"day"}),u);case"eee":return a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"});case"eeeee":return a.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(n,{width:"wide",context:"formatting"})||a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"})}}validate(n,r){return r>=0&&r<=6}set(n,r,a,o){return n=G0(n,a,o),n.setHours(0,0,0,0),n}}class sk extends ct{constructor(){super(...arguments);we(this,"priority",90);we(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,r,a,o){const u=c=>{const d=Math.floor((c-1)/7)*7;return(c+o.weekStartsOn+6)%7+d};switch(r){case"c":case"cc":return sn(Zt(r.length,n),u);case"co":return sn(a.ordinalNumber(n,{unit:"day"}),u);case"ccc":return a.day(n,{width:"abbreviated",context:"standalone"})||a.day(n,{width:"short",context:"standalone"})||a.day(n,{width:"narrow",context:"standalone"});case"ccccc":return a.day(n,{width:"narrow",context:"standalone"});case"cccccc":return a.day(n,{width:"short",context:"standalone"})||a.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(n,{width:"wide",context:"standalone"})||a.day(n,{width:"abbreviated",context:"standalone"})||a.day(n,{width:"short",context:"standalone"})||a.day(n,{width:"narrow",context:"standalone"})}}validate(n,r){return r>=0&&r<=6}set(n,r,a,o){return n=G0(n,a,o),n.setHours(0,0,0,0),n}}function ak(e,t,n){const r=Ze(e,n==null?void 0:n.in),a=OC(r,n),o=t-a;return ti(r,o,n)}class ik extends ct{constructor(){super(...arguments);we(this,"priority",90);we(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,r,a){const o=u=>u===0?7:u;switch(r){case"i":case"ii":return Zt(r.length,n);case"io":return a.ordinalNumber(n,{unit:"day"});case"iii":return sn(a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"}),o);case"iiiii":return sn(a.day(n,{width:"narrow",context:"formatting"}),o);case"iiiiii":return sn(a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"}),o);case"iiii":default:return sn(a.day(n,{width:"wide",context:"formatting"})||a.day(n,{width:"abbreviated",context:"formatting"})||a.day(n,{width:"short",context:"formatting"})||a.day(n,{width:"narrow",context:"formatting"}),o)}}validate(n,r){return r>=1&&r<=7}set(n,r,a){return n=ak(n,a),n.setHours(0,0,0,0),n}}class ok extends ct{constructor(){super(...arguments);we(this,"priority",80);we(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,r,a){switch(r){case"a":case"aa":case"aaa":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(n,{width:"wide",context:"formatting"})||a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,a){return n.setHours(Q0(a),0,0,0),n}}class uk extends ct{constructor(){super(...arguments);we(this,"priority",80);we(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,r,a){switch(r){case"b":case"bb":case"bbb":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(n,{width:"wide",context:"formatting"})||a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,a){return n.setHours(Q0(a),0,0,0),n}}class lk extends ct{constructor(){super(...arguments);we(this,"priority",80);we(this,"incompatibleTokens",["a","b","t","T"])}parse(n,r,a){switch(r){case"B":case"BB":case"BBB":return a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(n,{width:"wide",context:"formatting"})||a.dayPeriod(n,{width:"abbreviated",context:"formatting"})||a.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,r,a){return n.setHours(Q0(a),0,0,0),n}}class ck extends ct{constructor(){super(...arguments);we(this,"priority",70);we(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,r,a){switch(r){case"h":return qt(rn.hour12h,n);case"ho":return a.ordinalNumber(n,{unit:"hour"});default:return Zt(r.length,n)}}validate(n,r){return r>=1&&r<=12}set(n,r,a){const o=n.getHours()>=12;return o&&a<12?n.setHours(a+12,0,0,0):!o&&a===12?n.setHours(0,0,0,0):n.setHours(a,0,0,0),n}}class dk extends ct{constructor(){super(...arguments);we(this,"priority",70);we(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,r,a){switch(r){case"H":return qt(rn.hour23h,n);case"Ho":return a.ordinalNumber(n,{unit:"hour"});default:return Zt(r.length,n)}}validate(n,r){return r>=0&&r<=23}set(n,r,a){return n.setHours(a,0,0,0),n}}class fk extends ct{constructor(){super(...arguments);we(this,"priority",70);we(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,r,a){switch(r){case"K":return qt(rn.hour11h,n);case"Ko":return a.ordinalNumber(n,{unit:"hour"});default:return Zt(r.length,n)}}validate(n,r){return r>=0&&r<=11}set(n,r,a){return n.getHours()>=12&&a<12?n.setHours(a+12,0,0,0):n.setHours(a,0,0,0),n}}class hk extends ct{constructor(){super(...arguments);we(this,"priority",70);we(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,r,a){switch(r){case"k":return qt(rn.hour24h,n);case"ko":return a.ordinalNumber(n,{unit:"hour"});default:return Zt(r.length,n)}}validate(n,r){return r>=1&&r<=24}set(n,r,a){const o=a<=24?a%24:a;return n.setHours(o,0,0,0),n}}class mk extends ct{constructor(){super(...arguments);we(this,"priority",60);we(this,"incompatibleTokens",["t","T"])}parse(n,r,a){switch(r){case"m":return qt(rn.minute,n);case"mo":return a.ordinalNumber(n,{unit:"minute"});default:return Zt(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,a){return n.setMinutes(a,0,0),n}}class pk extends ct{constructor(){super(...arguments);we(this,"priority",50);we(this,"incompatibleTokens",["t","T"])}parse(n,r,a){switch(r){case"s":return qt(rn.second,n);case"so":return a.ordinalNumber(n,{unit:"second"});default:return Zt(r.length,n)}}validate(n,r){return r>=0&&r<=59}set(n,r,a){return n.setSeconds(a,0),n}}class gk extends ct{constructor(){super(...arguments);we(this,"priority",30);we(this,"incompatibleTokens",["t","T"])}parse(n,r){const a=o=>Math.trunc(o*Math.pow(10,-r.length+3));return sn(Zt(r.length,n),a)}set(n,r,a){return n.setMilliseconds(a),n}}class yk extends ct{constructor(){super(...arguments);we(this,"priority",10);we(this,"incompatibleTokens",["t","T","x"])}parse(n,r){switch(r){case"X":return ts(es.basicOptionalMinutes,n);case"XX":return ts(es.basic,n);case"XXXX":return ts(es.basicOptionalSeconds,n);case"XXXXX":return ts(es.extendedOptionalSeconds,n);case"XXX":default:return ts(es.extended,n)}}set(n,r,a){return r.timestampIsSet?n:ht(n,n.getTime()-Rc(n)-a)}}class bk extends ct{constructor(){super(...arguments);we(this,"priority",10);we(this,"incompatibleTokens",["t","T","X"])}parse(n,r){switch(r){case"x":return ts(es.basicOptionalMinutes,n);case"xx":return ts(es.basic,n);case"xxxx":return ts(es.basicOptionalSeconds,n);case"xxxxx":return ts(es.extendedOptionalSeconds,n);case"xxx":default:return ts(es.extended,n)}}set(n,r,a){return r.timestampIsSet?n:ht(n,n.getTime()-Rc(n)-a)}}class xk extends ct{constructor(){super(...arguments);we(this,"priority",40);we(this,"incompatibleTokens","*")}parse(n){return kx(n)}set(n,r,a){return[ht(n,a*1e3),{timestampIsSet:!0}]}}class Ek extends ct{constructor(){super(...arguments);we(this,"priority",20);we(this,"incompatibleTokens","*")}parse(n){return kx(n)}set(n,r,a){return[ht(n,a),{timestampIsSet:!0}]}}const vk={G:new BC,y:new HC,Y:new UC,R:new zC,u:new WC,Q:new YC,q:new qC,M:new $C,L:new VC,w:new GC,I:new KC,d:new ek,D:new tk,E:new nk,e:new rk,c:new sk,i:new ik,a:new ok,b:new uk,B:new lk,h:new ck,H:new dk,K:new fk,k:new hk,m:new mk,s:new pk,S:new gk,X:new yk,x:new bk,t:new xk,T:new Ek},Tk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,wk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sk=/^'([^]*?)'?$/,Ck=/''/g,kk=/\S/,_k=/[a-zA-Z]/;function oh(e,t,n,r){var w,T,C,O;const a=()=>ht(n,NaN),o=NC(),u=o.locale??Fa,c=o.firstWeekContainsDate??((T=(w=o.locale)==null?void 0:w.options)==null?void 0:T.firstWeekContainsDate)??1,d=o.weekStartsOn??((O=(C=o.locale)==null?void 0:C.options)==null?void 0:O.weekStartsOn)??0,f={firstWeekContainsDate:c,weekStartsOn:d,locale:u},p=[new jC(r==null?void 0:r.in,n)],g=t.match(wk).map(L=>{const B=L[0];if(B in a0){const k=a0[B];return k(L,u.formatLong)}return L}).join("").match(Tk),x=[];for(let L of g){Sx(L)&&i0(L,t,e),wx(L)&&i0(L,t,e);const B=L[0],k=vk[B];if(k){const{incompatibleTokens:N}=k;if(Array.isArray(N)){const j=x.find(M=>N.includes(M.token)||M.token===B);if(j)throw new RangeError(`The format string mustn't contain \`${j.fullToken}\` and \`${L}\` at the same time`)}else if(k.incompatibleTokens==="*"&&x.length>0)throw new RangeError(`The format string mustn't contain \`${L}\` and any other token at the same time`);x.push({token:B,fullToken:L});const R=k.run(e,L,u.match,f);if(!R)return a();p.push(R.setter),e=R.rest}else{if(B.match(_k))throw new RangeError("Format string contains an unescaped latin alphabet character `"+B+"`");if(L==="''"?L="'":B==="'"&&(L=Nk(L)),e.indexOf(L)===0)e=e.slice(L.length);else return a()}}if(e.length>0&&kk.test(e))return a();const E=p.map(L=>L.priority).sort((L,B)=>B-L).filter((L,B,k)=>k.indexOf(L)===B).map(L=>p.filter(B=>B.priority===L).sort((B,k)=>k.subPriority-B.subPriority)).map(L=>L[0]);let _=Ze(n,r==null?void 0:r.in);if(isNaN(+_))return a();const S={};for(const L of E){if(!L.validate(_,f))return a();const B=L.set(_,S,f);Array.isArray(B)?(_=B[0],Object.assign(S,B[1])):_=B}return _}function Nk(e){return e.match(Sk)[1].replace(Ck,"'")}function Ok(e,t,n){const[r,a]=lo(n==null?void 0:n.in,e,t);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}function Dk(e,t,n){const[r,a]=lo(n==null?void 0:n.in,e,t);return r.getFullYear()===a.getFullYear()}function zy(e,t,n){return ti(e,-t,n)}function Mc(e,t){const n=()=>ht(t==null?void 0:t.in,NaN),a=Lk(e);let o;if(a.date){const f=Mk(a.date,2);o=Pk(f.restDateString,f.year)}if(!o||isNaN(+o))return n();const u=+o;let c=0,d;if(a.time&&(c=Fk(a.time),isNaN(c)))return n();if(a.timezone){if(d=jk(a.timezone),isNaN(d))return n()}else{const f=new Date(u+c),p=Ze(0,t==null?void 0:t.in);return p.setFullYear(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate()),p.setHours(f.getUTCHours(),f.getUTCMinutes(),f.getUTCSeconds(),f.getUTCMilliseconds()),p}return Ze(u+c+d,t==null?void 0:t.in)}const pc={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Ak=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ik=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Rk=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Lk(e){const t={},n=e.split(pc.dateTimeDelimiter);let r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],pc.timeZoneDelimiter.test(t.date)&&(t.date=e.split(pc.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){const a=pc.timezone.exec(r);a?(t.time=r.replace(a[1],""),t.timezone=a[1]):t.time=r}return t}function Mk(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:NaN,restDateString:""};const a=r[1]?parseInt(r[1]):null,o=r[2]?parseInt(r[2]):null;return{year:o===null?a:o*100,restDateString:e.slice((r[1]||r[2]).length)}}function Pk(e,t){if(t===null)return new Date(NaN);const n=e.match(Ak);if(!n)return new Date(NaN);const r=!!n[4],a=su(n[1]),o=su(n[2])-1,u=su(n[3]),c=su(n[4]),d=su(n[5])-1;if(r)return Wk(t,c,d)?Bk(t,c,d):new Date(NaN);{const f=new Date(0);return!Uk(t,o,u)||!zk(t,a)?new Date(NaN):(f.setUTCFullYear(t,o,Math.max(a,u)),f)}}function su(e){return e?parseInt(e):1}function Fk(e){const t=e.match(Ik);if(!t)return NaN;const n=uh(t[1]),r=uh(t[2]),a=uh(t[3]);return Yk(n,r,a)?n*U0+r*H0+a*1e3:NaN}function uh(e){return e&&parseFloat(e.replace(",","."))||0}function jk(e){if(e==="Z")return 0;const t=e.match(Rk);if(!t)return 0;const n=t[1]==="+"?-1:1,r=parseInt(t[2]),a=t[3]&&parseInt(t[3])||0;return qk(r,a)?n*(r*U0+a*H0):NaN}function Bk(e,t,n){const r=new Date(0);r.setUTCFullYear(e,0,4);const a=r.getUTCDay()||7,o=(t-1)*7+n+1-a;return r.setUTCDate(r.getUTCDate()+o),r}const Hk=[31,null,31,30,31,30,31,31,30,31,30,31];function Ox(e){return e%400===0||e%4===0&&e%100!==0}function Uk(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Hk[t]||(Ox(e)?29:28))}function zk(e,t){return t>=1&&t<=(Ox(e)?366:365)}function Wk(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function Yk(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function qk(e,t){return t>=0&&t<=59}function $k(e,t,n){const r=Ze(e,n==null?void 0:n.in),a=r.getFullYear(),o=r.getDate(),u=ht(e,0);u.setFullYear(a,t,15),u.setHours(0,0,0,0);const c=_C(u);return r.setMonth(t,Math.min(o,c)),r}function Vk(e,t,n){const r=Ze(e,n==null?void 0:n.in);return isNaN(+r)?ht(e,NaN):(r.setFullYear(t),r)}function Qk(e,t,n){return Vu(e,-t,n)}function Gk(e,t,n){return px(e,-t,n)}function Xk(e,t,n){return W0(e,-t,n)}function Kk(e,t,n){return Y0(e,-t,n)}const Wy=5,Jk=4;function Zk(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,a=t.addDays(e,-r+1),o=t.addDays(a,Wy*7-1);return t.getMonth(e)===t.getMonth(o)?Wy:Jk}function Dx(e,t){const n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function e_(e,t){const n=Dx(e,t),r=Zk(e,t);return t.addDays(n,r*7-1)}const Ax={...Fa,labels:{labelDayButton:(e,t,n,r)=>{let a;r&&typeof r.format=="function"?a=r.format.bind(r):a=(u,c)=>pn(u,c,{locale:Fa,...n});let o=a(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(a,o)=>pn(a,o,{locale:Fa,...t}),r(e,"LLLL yyyy")},labelGridcell:(e,t,n,r)=>{let a;r&&typeof r.format=="function"?a=r.format.bind(r):a=(u,c)=>pn(u,c,{locale:Fa,...n});let o=a(e,"PPPP");return t!=null&&t.today&&(o=`Today, ${o}`),o},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let r;return n&&typeof n.format=="function"?r=n.format.bind(n):r=(a,o)=>pn(a,o,{locale:Fa,...t}),r(e,"cccc")}}};class cr{constructor(t,n){this.Date=Date,this.today=()=>{var r;return(r=this.overrides)!=null&&r.today?this.overrides.today():this.options.timeZone?Ln.tz(this.options.timeZone):new this.Date},this.newDate=(r,a,o)=>{var u;return(u=this.overrides)!=null&&u.newDate?this.overrides.newDate(r,a,o):this.options.timeZone?new Ln(r,a,o,this.options.timeZone):new Date(r,a,o)},this.addDays=(r,a)=>{var o;return(o=this.overrides)!=null&&o.addDays?this.overrides.addDays(r,a):ti(r,a)},this.addMonths=(r,a)=>{var o;return(o=this.overrides)!=null&&o.addMonths?this.overrides.addMonths(r,a):Vu(r,a)},this.addWeeks=(r,a)=>{var o;return(o=this.overrides)!=null&&o.addWeeks?this.overrides.addWeeks(r,a):W0(r,a)},this.addYears=(r,a)=>{var o;return(o=this.overrides)!=null&&o.addYears?this.overrides.addYears(r,a):Y0(r,a)},this.differenceInCalendarDays=(r,a)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,a):z0(r,a)},this.differenceInCalendarMonths=(r,a)=>{var o;return(o=this.overrides)!=null&&o.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,a):yx(r,a)},this.eachMonthOfInterval=r=>{var a;return(a=this.overrides)!=null&&a.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):AS(r)},this.eachYearOfInterval=r=>{var c;const a=(c=this.overrides)!=null&&c.eachYearOfInterval?this.overrides.eachYearOfInterval(r):RS(r),o=new Set(a.map(d=>this.getYear(d)));if(o.size===a.length)return a;const u=[];return o.forEach(d=>{u.push(new Date(d,0,1))}),u},this.endOfBroadcastWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):e_(r,this)},this.endOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.endOfISOWeek?this.overrides.endOfISOWeek(r):LS(r)},this.endOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.endOfMonth?this.overrides.endOfMonth(r):bx(r)},this.endOfWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.endOfWeek?this.overrides.endOfWeek(r,a):$0(r,this.options)},this.endOfYear=r=>{var a;return(a=this.overrides)!=null&&a.endOfYear?this.overrides.endOfYear(r):vx(r)},this.format=(r,a,o)=>{var c;const u=(c=this.overrides)!=null&&c.format?this.overrides.format(r,a,this.options):pn(r,a,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(u):u},this.getISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.getISOWeek?this.overrides.getISOWeek(r):Vc(r)},this.getMonth=(r,a)=>{var o;return(o=this.overrides)!=null&&o.getMonth?this.overrides.getMonth(r,this.options):DC(r,this.options)},this.getYear=(r,a)=>{var o;return(o=this.overrides)!=null&&o.getYear?this.overrides.getYear(r,this.options):AC(r,this.options)},this.getWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.getWeek?this.overrides.getWeek(r,this.options):Qc(r,this.options)},this.isAfter=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isAfter?this.overrides.isAfter(r,a):IC(r,a)},this.isBefore=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isBefore?this.overrides.isBefore(r,a):RC(r,a)},this.isDate=r=>{var a;return(a=this.overrides)!=null&&a.isDate?this.overrides.isDate(r):gx(r)},this.isSameDay=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isSameDay?this.overrides.isSameDay(r,a):NS(r,a)},this.isSameMonth=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isSameMonth?this.overrides.isSameMonth(r,a):Ok(r,a)},this.isSameYear=(r,a)=>{var o;return(o=this.overrides)!=null&&o.isSameYear?this.overrides.isSameYear(r,a):Dk(r,a)},this.max=r=>{var a;return(a=this.overrides)!=null&&a.max?this.overrides.max(r):kS(r)},this.min=r=>{var a;return(a=this.overrides)!=null&&a.min?this.overrides.min(r):_S(r)},this.setMonth=(r,a)=>{var o;return(o=this.overrides)!=null&&o.setMonth?this.overrides.setMonth(r,a):$k(r,a)},this.setYear=(r,a)=>{var o;return(o=this.overrides)!=null&&o.setYear?this.overrides.setYear(r,a):Vk(r,a)},this.startOfBroadcastWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):Dx(r,this)},this.startOfDay=r=>{var a;return(a=this.overrides)!=null&&a.startOfDay?this.overrides.startOfDay(r):so(r)},this.startOfISOWeek=r=>{var a;return(a=this.overrides)!=null&&a.startOfISOWeek?this.overrides.startOfISOWeek(r):ni(r)},this.startOfMonth=r=>{var a;return(a=this.overrides)!=null&&a.startOfMonth?this.overrides.startOfMonth(r):Ex(r)},this.startOfWeek=(r,a)=>{var o;return(o=this.overrides)!=null&&o.startOfWeek?this.overrides.startOfWeek(r,this.options):ss(r,this.options)},this.startOfYear=r=>{var a;return(a=this.overrides)!=null&&a.startOfYear?this.overrides.startOfYear(r):q0(r)},this.options={locale:Ax,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),r={};for(let a=0;a<10;a++)r[a.toString()]=n.format(a);return r}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,r=>n[r]||r)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&cr.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:r,numerals:a}=this.options,o=n==null?void 0:n.code;if(o&&cr.yearFirstLocales.has(o))try{return new Intl.DateTimeFormat(o,{month:"long",year:"numeric",timeZone:r,numberingSystem:a}).format(t)}catch{}const u=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,u)}}cr.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const us=new cr;class Ix{constructor(t,n,r=us){this.date=t,this.displayMonth=n,this.outside=!!(n&&!r.isSameMonth(t,n)),this.dateLib=r,this.isoDate=r.format(t,"yyyy-MM-dd"),this.displayMonthId=r.format(n,"yyyy-MM"),this.dateMonthId=r.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class t_{constructor(t,n){this.date=t,this.weeks=n}}class n_{constructor(t,n){this.days=n,this.weekNumber=t}}function r_(e){return xe.createElement("button",{...e})}function s_(e){return xe.createElement("span",{...e})}function a_(e){const{size:t=24,orientation:n="left",className:r}=e;return xe.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&xe.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&xe.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&xe.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&xe.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function i_(e){const{day:t,modifiers:n,...r}=e;return xe.createElement("td",{...r})}function o_(e){const{day:t,modifiers:n,...r}=e,a=xe.useRef(null);return xe.useEffect(()=>{var o;n.focused&&((o=a.current)==null||o.focus())},[n.focused]),xe.createElement("button",{ref:a,...r})}var Me;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(Me||(Me={}));var Wt;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(Wt||(Wt={}));var Fr;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(Fr||(Fr={}));var ur;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(ur||(ur={}));function u_(e){const{options:t,className:n,components:r,classNames:a,...o}=e,u=[a[Me.Dropdown],n].join(" "),c=t==null?void 0:t.find(({value:d})=>d===o.value);return xe.createElement("span",{"data-disabled":o.disabled,className:a[Me.DropdownRoot]},xe.createElement(r.Select,{className:u,...o},t==null?void 0:t.map(({value:d,label:f,disabled:p})=>xe.createElement(r.Option,{key:d,value:d,disabled:p},f))),xe.createElement("span",{className:a[Me.CaptionLabel],"aria-hidden":!0},c==null?void 0:c.label,xe.createElement(r.Chevron,{orientation:"down",size:18,className:a[Me.Chevron]})))}function l_(e){return xe.createElement("div",{...e})}function c_(e){return xe.createElement("div",{...e})}function d_(e){const{calendarMonth:t,displayIndex:n,...r}=e;return xe.createElement("div",{...r},e.children)}function f_(e){const{calendarMonth:t,displayIndex:n,...r}=e;return xe.createElement("div",{...r})}function h_(e){return xe.createElement("table",{...e})}function m_(e){return xe.createElement("div",{...e})}const Rx=I.createContext(void 0);function Qu(){const e=I.useContext(Rx);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function p_(e){const{components:t}=Qu();return xe.createElement(t.Dropdown,{...e})}function g_(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:a,...o}=e,{components:u,classNames:c,labels:{labelPrevious:d,labelNext:f}}=Qu(),p=I.useCallback(x=>{a&&(n==null||n(x))},[a,n]),g=I.useCallback(x=>{r&&(t==null||t(x))},[r,t]);return xe.createElement("nav",{...o},xe.createElement(u.PreviousMonthButton,{type:"button",className:c[Me.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":d(r),onClick:g},xe.createElement(u.Chevron,{disabled:r?void 0:!0,className:c[Me.Chevron],orientation:"left"})),xe.createElement(u.NextMonthButton,{type:"button",className:c[Me.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":a?void 0:!0,"aria-label":f(a),onClick:p},xe.createElement(u.Chevron,{disabled:a?void 0:!0,orientation:"right",className:c[Me.Chevron]})))}function y_(e){const{components:t}=Qu();return xe.createElement(t.Button,{...e})}function b_(e){return xe.createElement("option",{...e})}function x_(e){const{components:t}=Qu();return xe.createElement(t.Button,{...e})}function E_(e){const{rootRef:t,...n}=e;return xe.createElement("div",{...n,ref:t})}function v_(e){return xe.createElement("select",{...e})}function T_(e){const{week:t,...n}=e;return xe.createElement("tr",{...n})}function w_(e){return xe.createElement("th",{...e})}function S_(e){return xe.createElement("thead",{"aria-hidden":!0},xe.createElement("tr",{...e}))}function C_(e){const{week:t,...n}=e;return xe.createElement("th",{...n})}function k_(e){return xe.createElement("th",{...e})}function __(e){return xe.createElement("tbody",{...e})}function N_(e){const{components:t}=Qu();return xe.createElement(t.Dropdown,{...e})}const O_=Object.freeze(Object.defineProperty({__proto__:null,Button:r_,CaptionLabel:s_,Chevron:a_,Day:i_,DayButton:o_,Dropdown:u_,DropdownNav:l_,Footer:c_,Month:d_,MonthCaption:f_,MonthGrid:h_,Months:m_,MonthsDropdown:p_,Nav:g_,NextMonthButton:y_,Option:b_,PreviousMonthButton:x_,Root:E_,Select:v_,Week:T_,WeekNumber:C_,WeekNumberHeader:k_,Weekday:w_,Weekdays:S_,Weeks:__,YearsDropdown:N_},Symbol.toStringTag,{value:"Module"}));function ks(e,t,n=!1,r=us){let{from:a,to:o}=e;const{differenceInCalendarDays:u,isSameDay:c}=r;return a&&o?(u(o,a)<0&&([a,o]=[o,a]),u(t,a)>=(n?1:0)&&u(o,t)>=(n?1:0)):!n&&o?c(o,t):!n&&a?c(a,t):!1}function X0(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Gc(e){return!!(e&&typeof e=="object"&&"from"in e)}function K0(e){return!!(e&&typeof e=="object"&&"after"in e)}function J0(e){return!!(e&&typeof e=="object"&&"before"in e)}function Lx(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Mx(e,t){return Array.isArray(e)&&e.every(t.isDate)}function _s(e,t,n=us){const r=Array.isArray(t)?t:[t],{isSameDay:a,differenceInCalendarDays:o,isAfter:u}=n;return r.some(c=>{if(typeof c=="boolean")return c;if(n.isDate(c))return a(e,c);if(Mx(c,n))return c.some(d=>a(e,d));if(Gc(c))return ks(c,e,!1,n);if(Lx(c))return Array.isArray(c.dayOfWeek)?c.dayOfWeek.includes(e.getDay()):c.dayOfWeek===e.getDay();if(X0(c)){const d=o(c.before,e),f=o(c.after,e),p=d>0,g=f<0;return u(c.before,c.after)?g&&p:p||g}return K0(c)?o(e,c.after)>0:J0(c)?o(c.before,e)>0:typeof c=="function"?c(e):!1})}function D_(e,t,n,r,a){const{disabled:o,hidden:u,modifiers:c,showOutsideDays:d,broadcastCalendar:f,today:p=a.today()}=t,{isSameDay:g,isSameMonth:x,startOfMonth:E,isBefore:_,endOfMonth:S,isAfter:w}=a,T=n&&E(n),C=r&&S(r),O={[Wt.focused]:[],[Wt.outside]:[],[Wt.disabled]:[],[Wt.hidden]:[],[Wt.today]:[]},L={};for(const B of e){const{date:k,displayMonth:N}=B,R=!!(N&&!x(k,N)),j=!!(T&&_(k,T)),M=!!(C&&w(k,C)),P=!!(o&&_s(k,o,a)),F=!!(u&&_s(k,u,a))||j||M||!f&&!d&&R||f&&d===!1&&R,W=g(k,p);R&&O.outside.push(B),P&&O.disabled.push(B),F&&O.hidden.push(B),W&&O.today.push(B),c&&Object.keys(c).forEach(V=>{const J=c==null?void 0:c[V];J&&_s(k,J,a)&&(L[V]?L[V].push(B):L[V]=[B])})}return B=>{const k={[Wt.focused]:!1,[Wt.disabled]:!1,[Wt.hidden]:!1,[Wt.outside]:!1,[Wt.today]:!1},N={};for(const R in O){const j=O[R];k[R]=j.some(M=>M===B)}for(const R in L)N[R]=L[R].some(j=>j===B);return{...k,...N}}}function A_(e,t,n={}){return Object.entries(e).filter(([,a])=>a===!0).reduce((a,[o])=>(n[o]?a.push(n[o]):t[Wt[o]]?a.push(t[Wt[o]]):t[Fr[o]]&&a.push(t[Fr[o]]),a),[t[Me.Day]])}function I_(e){return{...O_,...e}}function R_(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,r])=>{n.startsWith("data-")&&(t[n]=r)}),t}function L_(){const e={};for(const t in Me)e[Me[t]]=`rdp-${Me[t]}`;for(const t in Wt)e[Wt[t]]=`rdp-${Wt[t]}`;for(const t in Fr)e[Fr[t]]=`rdp-${Fr[t]}`;for(const t in ur)e[ur[t]]=`rdp-${ur[t]}`;return e}function Px(e,t,n){return(n??new cr(t)).formatMonthYear(e)}const M_=Px;function P_(e,t,n){return(n??new cr(t)).format(e,"d")}function F_(e,t=us){return t.format(e,"LLLL")}function j_(e,t,n){return(n??new cr(t)).format(e,"cccccc")}function B_(e,t=us){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function H_(){return""}function Fx(e,t=us){return t.format(e,"yyyy")}const U_=Fx,z_=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:Px,formatDay:P_,formatMonthCaption:M_,formatMonthDropdown:F_,formatWeekNumber:B_,formatWeekNumberHeader:H_,formatWeekdayName:j_,formatYearCaption:U_,formatYearDropdown:Fx},Symbol.toStringTag,{value:"Module"}));function W_(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...z_,...e}}function Z0(e,t,n,r){let a=(r??new cr(n)).format(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a}const Y_=Z0;function em(e,t,n){return(n??new cr(t)).formatMonthYear(e)}const q_=em;function jx(e,t,n,r){let a=(r??new cr(n)).format(e,"PPPP");return t!=null&&t.today&&(a=`Today, ${a}`),a}function Bx(e){return"Choose the Month"}function Hx(){return""}const $_="Go to the Next Month";function Ux(e,t){return $_}function zx(e){return"Go to the Previous Month"}function Wx(e,t,n){return(n??new cr(t)).format(e,"cccc")}function Yx(e,t){return`Week ${e}`}function qx(e){return"Week Number"}function $x(e){return"Choose the Year"}const V_=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:q_,labelDay:Y_,labelDayButton:Z0,labelGrid:em,labelGridcell:jx,labelMonthDropdown:Bx,labelNav:Hx,labelNext:Ux,labelPrevious:zx,labelWeekNumber:Yx,labelWeekNumberHeader:qx,labelWeekday:Wx,labelYearDropdown:$x},Symbol.toStringTag,{value:"Module"})),Rr=(e,t,n)=>t||(n?typeof n=="function"?n:(...r)=>n:e);function Q_(e,t){var r;const n=((r=t.locale)==null?void 0:r.labels)??{};return{...V_,...e??{},labelDayButton:Rr(Z0,e==null?void 0:e.labelDayButton,n.labelDayButton),labelMonthDropdown:Rr(Bx,e==null?void 0:e.labelMonthDropdown,n.labelMonthDropdown),labelNext:Rr(Ux,e==null?void 0:e.labelNext,n.labelNext),labelPrevious:Rr(zx,e==null?void 0:e.labelPrevious,n.labelPrevious),labelWeekNumber:Rr(Yx,e==null?void 0:e.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:Rr($x,e==null?void 0:e.labelYearDropdown,n.labelYearDropdown),labelGrid:Rr(em,e==null?void 0:e.labelGrid,n.labelGrid),labelGridcell:Rr(jx,e==null?void 0:e.labelGridcell,n.labelGridcell),labelNav:Rr(Hx,e==null?void 0:e.labelNav,n.labelNav),labelWeekNumberHeader:Rr(qx,e==null?void 0:e.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:Rr(Wx,e==null?void 0:e.labelWeekday,n.labelWeekday)}}function G_(e,t,n,r,a){const{startOfMonth:o,startOfYear:u,endOfYear:c,eachMonthOfInterval:d,getMonth:f}=a;return d({start:u(e),end:c(e)}).map(x=>{const E=r.formatMonthDropdown(x,a),_=f(x),S=t&&x<o(t)||n&&x>o(n)||!1;return{value:_,label:E,disabled:S}})}function X_(e,t={},n={}){let r={...t==null?void 0:t[Me.Day]};return Object.entries(e).filter(([,a])=>a===!0).forEach(([a])=>{r={...r,...n==null?void 0:n[a]}}),r}function K_(e,t,n,r){const a=r??e.today(),o=n?e.startOfBroadcastWeek(a,e):t?e.startOfISOWeek(a):e.startOfWeek(a),u=[];for(let c=0;c<7;c++){const d=e.addDays(o,c);u.push(d)}return u}function J_(e,t,n,r,a=!1){if(!e||!t)return;const{startOfYear:o,endOfYear:u,eachYearOfInterval:c,getYear:d}=r,f=o(e),p=u(t),g=c({start:f,end:p});return a&&g.reverse(),g.map(x=>{const E=n.formatYearDropdown(x,r);return{value:d(x),label:E,disabled:!1}})}function Z_(e,t={}){var c;const{weekStartsOn:n,locale:r}=t,a=n??((c=r==null?void 0:r.options)==null?void 0:c.weekStartsOn)??0,o=d=>{const f=typeof d=="number"||typeof d=="string"?new Date(d):d;return new Ln(f.getFullYear(),f.getMonth(),f.getDate(),12,0,0,e)},u=d=>{const f=o(d);return new Date(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0,0)};return{today:()=>o(Ln.tz(e)),newDate:(d,f,p)=>new Ln(d,f,p,12,0,0,e),startOfDay:d=>o(d),startOfWeek:(d,f)=>{const p=o(d),g=(f==null?void 0:f.weekStartsOn)??a,x=(p.getDay()-g+7)%7;return p.setDate(p.getDate()-x),p},startOfISOWeek:d=>{const f=o(d),p=(f.getDay()-1+7)%7;return f.setDate(f.getDate()-p),f},startOfMonth:d=>{const f=o(d);return f.setDate(1),f},startOfYear:d=>{const f=o(d);return f.setMonth(0,1),f},endOfWeek:(d,f)=>{const p=o(d),E=((((f==null?void 0:f.weekStartsOn)??a)+6)%7-p.getDay()+7)%7;return p.setDate(p.getDate()+E),p},endOfISOWeek:d=>{const f=o(d),p=(7-f.getDay())%7;return f.setDate(f.getDate()+p),f},endOfMonth:d=>{const f=o(d);return f.setMonth(f.getMonth()+1,0),f},endOfYear:d=>{const f=o(d);return f.setMonth(11,31),f},eachMonthOfInterval:d=>{const f=o(d.start),p=o(d.end),g=[],x=new Ln(f.getFullYear(),f.getMonth(),1,12,0,0,e),E=p.getFullYear()*12+p.getMonth();for(;x.getFullYear()*12+x.getMonth()<=E;)g.push(new Ln(x,e)),x.setMonth(x.getMonth()+1,1);return g},addDays:(d,f)=>{const p=o(d);return p.setDate(p.getDate()+f),p},addWeeks:(d,f)=>{const p=o(d);return p.setDate(p.getDate()+f*7),p},addMonths:(d,f)=>{const p=o(d);return p.setMonth(p.getMonth()+f),p},addYears:(d,f)=>{const p=o(d);return p.setFullYear(p.getFullYear()+f),p},eachYearOfInterval:d=>{const f=o(d.start),p=o(d.end),g=[],x=new Ln(f.getFullYear(),0,1,12,0,0,e);for(;x.getFullYear()<=p.getFullYear();)g.push(new Ln(x,e)),x.setFullYear(x.getFullYear()+1,0,1);return g},getWeek:(d,f)=>{var g;const p=u(d);return Qc(p,{weekStartsOn:(f==null?void 0:f.weekStartsOn)??a,firstWeekContainsDate:(f==null?void 0:f.firstWeekContainsDate)??((g=r==null?void 0:r.options)==null?void 0:g.firstWeekContainsDate)??1})},getISOWeek:d=>{const f=u(d);return Vc(f)},differenceInCalendarDays:(d,f)=>{const p=u(d),g=u(f);return z0(p,g)},differenceInCalendarMonths:(d,f)=>{const p=u(d),g=u(f);return yx(p,g)}}}const Gu=e=>e instanceof HTMLElement?e:null,lh=e=>[...e.querySelectorAll("[data-animated-month]")??[]],e3=e=>Gu(e.querySelector("[data-animated-month]")),ch=e=>Gu(e.querySelector("[data-animated-caption]")),dh=e=>Gu(e.querySelector("[data-animated-weeks]")),t3=e=>Gu(e.querySelector("[data-animated-nav]")),n3=e=>Gu(e.querySelector("[data-animated-weekdays]"));function r3(e,t,{classNames:n,months:r,focused:a,dateLib:o}){const u=I.useRef(null),c=I.useRef(r),d=I.useRef(!1);I.useLayoutEffect(()=>{const f=c.current;if(c.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||f.length===0||r.length!==f.length)return;const p=o.isSameMonth(r[0].date,f[0].date),g=o.isAfter(r[0].date,f[0].date),x=g?n[ur.caption_after_enter]:n[ur.caption_before_enter],E=g?n[ur.weeks_after_enter]:n[ur.weeks_before_enter],_=u.current,S=e.current.cloneNode(!0);if(S instanceof HTMLElement?(lh(S).forEach(O=>{if(!(O instanceof HTMLElement))return;const L=e3(O);L&&O.contains(L)&&O.removeChild(L);const B=ch(O);B&&B.classList.remove(x);const k=dh(O);k&&k.classList.remove(E)}),u.current=S):u.current=null,d.current||p||a)return;const w=_ instanceof HTMLElement?lh(_):[],T=lh(e.current);if(T!=null&&T.every(C=>C instanceof HTMLElement)&&w&&w.every(C=>C instanceof HTMLElement)){d.current=!0,e.current.style.isolation="isolate";const C=t3(e.current);C&&(C.style.zIndex="1"),T.forEach((O,L)=>{const B=w[L];if(!B)return;O.style.position="relative",O.style.overflow="hidden";const k=ch(O);k&&k.classList.add(x);const N=dh(O);N&&N.classList.add(E);const R=()=>{d.current=!1,e.current&&(e.current.style.isolation=""),C&&(C.style.zIndex=""),k&&k.classList.remove(x),N&&N.classList.remove(E),O.style.position="",O.style.overflow="",O.contains(B)&&O.removeChild(B)};B.style.pointerEvents="none",B.style.position="absolute",B.style.overflow="hidden",B.setAttribute("aria-hidden","true");const j=n3(B);j&&(j.style.opacity="0");const M=ch(B);M&&(M.classList.add(g?n[ur.caption_before_exit]:n[ur.caption_after_exit]),M.addEventListener("animationend",R));const P=dh(B);P&&P.classList.add(g?n[ur.weeks_before_exit]:n[ur.weeks_after_exit]),O.insertBefore(B,O.firstChild)})}})}function s3(e,t,n,r){const a=e[0],o=e[e.length-1],{ISOWeek:u,fixedWeeks:c,broadcastCalendar:d}=n??{},{addDays:f,differenceInCalendarDays:p,differenceInCalendarMonths:g,endOfBroadcastWeek:x,endOfISOWeek:E,endOfMonth:_,endOfWeek:S,isAfter:w,startOfBroadcastWeek:T,startOfISOWeek:C,startOfWeek:O}=r,L=d?T(a,r):u?C(a):O(a),B=d?x(o):u?E(_(o)):S(_(o)),k=t&&(d?x(t):u?E(t):S(t)),N=k&&w(B,k)?k:B,R=p(N,L),j=g(o,a)+1,M=[];for(let W=0;W<=R;W++){const V=f(L,W);M.push(V)}const F=(d?35:42)*j;if(c&&M.length<F){const W=F-M.length;for(let V=0;V<W;V++){const J=f(M[M.length-1],1);M.push(J)}}return M}function a3(e){const t=[];return e.reduce((n,r)=>{const a=r.weeks.reduce((o,u)=>o.concat(u.days.slice()),t.slice());return n.concat(a.slice())},t.slice())}function i3(e,t,n,r){const{numberOfMonths:a=1}=n,o=[];for(let u=0;u<a;u++){const c=r.addMonths(e,u);if(t&&c>t)break;o.push(c)}return o}function Yy(e,t,n,r){const{month:a,defaultMonth:o,today:u=r.today(),numberOfMonths:c=1}=e;let d=a||o||u;const{differenceInCalendarMonths:f,addMonths:p,startOfMonth:g}=r;if(n&&f(n,d)<c-1){const x=-1*(c-1);d=p(n,x)}return t&&f(d,t)<0&&(d=t),g(d)}function o3(e,t,n,r){const{addDays:a,endOfBroadcastWeek:o,endOfISOWeek:u,endOfMonth:c,endOfWeek:d,getISOWeek:f,getWeek:p,startOfBroadcastWeek:g,startOfISOWeek:x,startOfWeek:E}=r,_=e.reduce((S,w)=>{const T=n.broadcastCalendar?g(w,r):n.ISOWeek?x(w):E(w),C=n.broadcastCalendar?o(w):n.ISOWeek?u(c(w)):d(c(w)),O=t.filter(N=>N>=T&&N<=C),L=n.broadcastCalendar?35:42;if(n.fixedWeeks&&O.length<L){const N=t.filter(R=>{const j=L-O.length;return R>C&&R<=a(C,j)});O.push(...N)}const B=O.reduce((N,R)=>{const j=n.ISOWeek?f(R):p(R),M=N.find(F=>F.weekNumber===j),P=new Ix(R,w,r);return M?M.days.push(P):N.push(new n_(j,[P])),N},[]),k=new t_(w,B);return S.push(k),S},[]);return n.reverseMonths?_.reverse():_}function u3(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:a,startOfDay:o,startOfMonth:u,endOfMonth:c,addYears:d,endOfYear:f,newDate:p,today:g}=t,{fromYear:x,toYear:E,fromMonth:_,toMonth:S}=e;!n&&_&&(n=_),!n&&x&&(n=t.newDate(x,0,1)),!r&&S&&(r=S),!r&&E&&(r=p(E,11,31));const w=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=u(n):x?n=p(x,0,1):!n&&w&&(n=a(d(e.today??g(),-100))),r?r=c(r):E?r=p(E,11,31):!r&&w&&(r=f(e.today??g())),[n&&o(n),r&&o(r)]}function l3(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:o=1}=n,{startOfMonth:u,addMonths:c,differenceInCalendarMonths:d}=r,f=a?o:1,p=u(e);if(!t)return c(p,f);if(!(d(t,e)<o))return c(p,f)}function c3(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:o}=n,{startOfMonth:u,addMonths:c,differenceInCalendarMonths:d}=r,f=a?o??1:1,p=u(e);if(!t)return c(p,-f);if(!(d(p,t)<=0))return c(p,-f)}function d3(e){const t=[];return e.reduce((n,r)=>n.concat(r.weeks.slice()),t.slice())}function Xc(e,t){const[n,r]=I.useState(e);return[t===void 0?n:t,r]}function f3(e,t){var L;const[n,r]=u3(e,t),{startOfMonth:a,endOfMonth:o}=t,u=Yy(e,n,r,t),[c,d]=Xc(u,e.month?u:void 0);I.useEffect(()=>{const B=Yy(e,n,r,t);d(B)},[e.timeZone]);const{months:f,weeks:p,days:g,previousMonth:x,nextMonth:E}=I.useMemo(()=>{const B=i3(c,r,{numberOfMonths:e.numberOfMonths},t),k=s3(B,e.endMonth?o(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),N=o3(B,k,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),R=d3(N),j=a3(N),M=c3(c,n,e,t),P=l3(c,r,e,t);return{months:N,weeks:R,days:j,previousMonth:M,nextMonth:P}},[t,c.getTime(),r==null?void 0:r.getTime(),n==null?void 0:n.getTime(),e.disableNavigation,e.broadcastCalendar,(L=e.endMonth)==null?void 0:L.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:_,onMonthChange:S}=e,w=B=>p.some(k=>k.days.some(N=>N.isEqualTo(B))),T=B=>{if(_)return;let k=a(B);n&&k<a(n)&&(k=a(n)),r&&k>a(r)&&(k=a(r)),d(k),S==null||S(k)};return{months:f,weeks:p,days:g,navStart:n,navEnd:r,previousMonth:x,nextMonth:E,goToMonth:T,goToDay:B=>{w(B)||T(B.date)}}}var Qr;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(Qr||(Qr={}));function qy(e){return!e[Wt.disabled]&&!e[Wt.hidden]&&!e[Wt.outside]}function h3(e,t,n,r){let a,o=-1;for(const u of e){const c=t(u);qy(c)&&(c[Wt.focused]&&o<Qr.FocusedModifier?(a=u,o=Qr.FocusedModifier):r!=null&&r.isEqualTo(u)&&o<Qr.LastFocused?(a=u,o=Qr.LastFocused):n(u.date)&&o<Qr.Selected?(a=u,o=Qr.Selected):c[Wt.today]&&o<Qr.Today&&(a=u,o=Qr.Today))}return a||(a=e.find(u=>qy(t(u)))),a}function m3(e,t,n,r,a,o,u){const{ISOWeek:c,broadcastCalendar:d}=o,{addDays:f,addMonths:p,addWeeks:g,addYears:x,endOfBroadcastWeek:E,endOfISOWeek:_,endOfWeek:S,max:w,min:T,startOfBroadcastWeek:C,startOfISOWeek:O,startOfWeek:L}=u;let k={day:f,week:g,month:p,year:x,startOfWeek:N=>d?C(N,u):c?O(N):L(N),endOfWeek:N=>d?E(N):c?_(N):S(N)}[e](n,t==="after"?1:-1);return t==="before"&&r?k=w([r,k]):t==="after"&&a&&(k=T([a,k])),k}function Vx(e,t,n,r,a,o,u,c=0){if(c>365)return;const d=m3(e,t,n.date,r,a,o,u),f=!!(o.disabled&&_s(d,o.disabled,u)),p=!!(o.hidden&&_s(d,o.hidden,u)),g=d,x=new Ix(d,g,u);return!f&&!p?x:Vx(e,t,x,r,a,o,u,c+1)}function p3(e,t,n,r,a){const{autoFocus:o}=e,[u,c]=I.useState(),d=h3(t.days,n,r||(()=>!1),u),[f,p]=I.useState(o?d:void 0);return{isFocusTarget:S=>!!(d!=null&&d.isEqualTo(S)),setFocused:p,focused:f,blur:()=>{c(f),p(void 0)},moveFocus:(S,w)=>{if(!f)return;const T=Vx(S,w,f,t.navStart,t.navEnd,e,a);T&&(e.disableNavigation&&!t.days.some(O=>O.isEqualTo(T))||(t.goToDay(T),p(T)))}}}function g3(e,t){const{selected:n,required:r,onSelect:a}=e,[o,u]=Xc(n,a?n:void 0),c=a?n:o,{isSameDay:d}=t,f=E=>(c==null?void 0:c.some(_=>d(_,E)))??!1,{min:p,max:g}=e;return{selected:c,select:(E,_,S)=>{let w=[...c??[]];if(f(E)){if((c==null?void 0:c.length)===p||r&&(c==null?void 0:c.length)===1)return;w=c==null?void 0:c.filter(T=>!d(T,E))}else(c==null?void 0:c.length)===g?w=[E]:w=[...w,E];return a||u(w),a==null||a(w,E,_,S),w},isSelected:f}}function y3(e,t,n=0,r=0,a=!1,o=us){const{from:u,to:c}=t||{},{isSameDay:d,isAfter:f,isBefore:p}=o;let g;if(!u&&!c)g={from:e,to:n>0?void 0:e};else if(u&&!c)d(u,e)?n===0?g={from:u,to:e}:a?g={from:u,to:void 0}:g=void 0:p(e,u)?g={from:e,to:u}:g={from:u,to:e};else if(u&&c)if(d(u,e)&&d(c,e))a?g={from:u,to:c}:g=void 0;else if(d(u,e))g={from:u,to:n>0?void 0:e};else if(d(c,e))g={from:e,to:n>0?void 0:e};else if(p(e,u))g={from:e,to:c};else if(f(e,u))g={from:u,to:e};else if(f(e,c))g={from:u,to:e};else throw new Error("Invalid range");if(g!=null&&g.from&&(g!=null&&g.to)){const x=o.differenceInCalendarDays(g.to,g.from);r>0&&x>r?g={from:e,to:void 0}:n>1&&x<n&&(g={from:e,to:void 0})}return g}function b3(e,t,n=us){const r=Array.isArray(t)?t:[t];let a=e.from;const o=n.differenceInCalendarDays(e.to,e.from),u=Math.min(o,6);for(let c=0;c<=u;c++){if(r.includes(a.getDay()))return!0;a=n.addDays(a,1)}return!1}function $y(e,t,n=us){return ks(e,t.from,!1,n)||ks(e,t.to,!1,n)||ks(t,e.from,!1,n)||ks(t,e.to,!1,n)}function x3(e,t,n=us){const r=Array.isArray(t)?t:[t];if(r.filter(c=>typeof c!="function").some(c=>typeof c=="boolean"?c:n.isDate(c)?ks(e,c,!1,n):Mx(c,n)?c.some(d=>ks(e,d,!1,n)):Gc(c)?c.from&&c.to?$y(e,{from:c.from,to:c.to},n):!1:Lx(c)?b3(e,c.dayOfWeek,n):X0(c)?n.isAfter(c.before,c.after)?$y(e,{from:n.addDays(c.after,1),to:n.addDays(c.before,-1)},n):_s(e.from,c,n)||_s(e.to,c,n):K0(c)||J0(c)?_s(e.from,c,n)||_s(e.to,c,n):!1))return!0;const u=r.filter(c=>typeof c=="function");if(u.length){let c=e.from;const d=n.differenceInCalendarDays(e.to,e.from);for(let f=0;f<=d;f++){if(u.some(p=>p(c)))return!0;c=n.addDays(c,1)}}return!1}function E3(e,t){const{disabled:n,excludeDisabled:r,selected:a,required:o,onSelect:u}=e,[c,d]=Xc(a,u?a:void 0),f=u?a:c;return{selected:f,select:(x,E,_)=>{const{min:S,max:w}=e,T=x?y3(x,f,S,w,o,t):void 0;return r&&n&&(T!=null&&T.from)&&T.to&&x3({from:T.from,to:T.to},n,t)&&(T.from=x,T.to=void 0),u||d(T),u==null||u(T,x,E,_),T},isSelected:x=>f&&ks(f,x,!1,t)}}function v3(e,t){const{selected:n,required:r,onSelect:a}=e,[o,u]=Xc(n,a?n:void 0),c=a?n:o,{isSameDay:d}=t;return{selected:c,select:(g,x,E)=>{let _=g;return!r&&c&&c&&d(g,c)&&(_=void 0),a||u(_),a==null||a(_,g,x,E),_},isSelected:g=>c?d(c,g):!1}}function T3(e,t){const n=v3(e,t),r=g3(e,t),a=E3(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return a;default:return}}function br(e,t){return e instanceof Ln&&e.timeZone===t?e:new Ln(e,t)}function Pi(e,t,n){return br(e,t)}function Vy(e,t,n){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?Pi(e,t):Array.isArray(e)?e.map(r=>r instanceof Date?Pi(r,t):r):Gc(e)?{...e,from:e.from?br(e.from,t):e.from,to:e.to?br(e.to,t):e.to}:X0(e)?{before:Pi(e.before,t),after:Pi(e.after,t)}:K0(e)?{after:Pi(e.after,t)}:J0(e)?{before:Pi(e.before,t)}:e}function fh(e,t,n){return e&&(Array.isArray(e)?e.map(r=>Vy(r,t)):Vy(e,t))}function Qy(e){var Cr;let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=br(t.today,n)),t.month&&(t.month=br(t.month,n)),t.defaultMonth&&(t.defaultMonth=br(t.defaultMonth,n)),t.startMonth&&(t.startMonth=br(t.startMonth,n)),t.endMonth&&(t.endMonth=br(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=br(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=(Cr=t.selected)==null?void 0:Cr.map(Pe=>br(Pe,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?br(t.selected.from,n):t.selected.from,to:t.selected.to?br(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=fh(t.disabled,n)),t.hidden!==void 0&&(t.hidden=fh(t.hidden,n)),t.modifiers)){const Pe={};Object.keys(t.modifiers).forEach(Ke=>{var be;Pe[Ke]=fh((be=t.modifiers)==null?void 0:be[Ke],n)}),t.modifiers=Pe}const{components:r,formatters:a,labels:o,dateLib:u,locale:c,classNames:d}=I.useMemo(()=>{const Pe={...Ax,...t.locale},Ke=t.broadcastCalendar?1:t.weekStartsOn,be=t.noonSafe&&t.timeZone?Z_(t.timeZone,{weekStartsOn:Ke,locale:Pe}):void 0,ke=t.dateLib&&be?{...be,...t.dateLib}:t.dateLib??be,et=new cr({locale:Pe,weekStartsOn:Ke,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},ke);return{dateLib:et,components:I_(t.components),formatters:W_(t.formatters),labels:Q_(t.labels,et.options),locale:Pe,classNames:{...L_(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:u.today()});const{captionLayout:f,mode:p,navLayout:g,numberOfMonths:x=1,onDayBlur:E,onDayClick:_,onDayFocus:S,onDayKeyDown:w,onDayMouseEnter:T,onDayMouseLeave:C,onNextClick:O,onPrevClick:L,showWeekNumber:B,styles:k}=t,{formatCaption:N,formatDay:R,formatMonthDropdown:j,formatWeekNumber:M,formatWeekNumberHeader:P,formatWeekdayName:F,formatYearDropdown:W}=a,V=f3(t,u),{days:J,months:K,navStart:Z,navEnd:G,previousMonth:ee,nextMonth:D,goToMonth:ue}=V,ae=D_(J,t,Z,G,u),{isSelected:U,select:Ee,selected:De}=T3(t,u)??{},{blur:ve,focused:ze,isFocusTarget:Ue,moveFocus:Le,setFocused:Ge}=p3(t,V,ae,U??(()=>!1),u),{labelDayButton:Fe,labelGridcell:Rt,labelGrid:Et,labelMonthDropdown:Cn,labelNav:$t,labelPrevious:gt,labelNext:Lt,labelWeekday:er,labelWeekNumber:it,labelWeekNumberHeader:nt,labelYearDropdown:vt}=o,Dt=I.useMemo(()=>K_(u,t.ISOWeek,t.broadcastCalendar,t.today),[u,t.ISOWeek,t.broadcastCalendar,t.today]),ln=p!==void 0||_!==void 0,tr=I.useCallback(()=>{ee&&(ue(ee),L==null||L(ee))},[ee,ue,L]),cn=I.useCallback(()=>{D&&(ue(D),O==null||O(D))},[ue,D,O]),oe=I.useCallback((Pe,Ke)=>be=>{be.preventDefault(),be.stopPropagation(),Ge(Pe),!Ke.disabled&&(Ee==null||Ee(Pe.date,Ke,be),_==null||_(Pe.date,Ke,be))},[Ee,_,Ge]),me=I.useCallback((Pe,Ke)=>be=>{Ge(Pe),S==null||S(Pe.date,Ke,be)},[S,Ge]),Ae=I.useCallback((Pe,Ke)=>be=>{ve(),E==null||E(Pe.date,Ke,be)},[ve,E]),Ye=I.useCallback((Pe,Ke)=>be=>{const ke={ArrowLeft:[be.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[be.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[be.shiftKey?"year":"week","after"],ArrowUp:[be.shiftKey?"year":"week","before"],PageUp:[be.shiftKey?"year":"month","before"],PageDown:[be.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(ke[be.key]){be.preventDefault(),be.stopPropagation();const[et,_e]=ke[be.key];Le(et,_e)}w==null||w(Pe.date,Ke,be)},[Le,w,t.dir]),Xe=I.useCallback((Pe,Ke)=>be=>{T==null||T(Pe.date,Ke,be)},[T]),yt=I.useCallback((Pe,Ke)=>be=>{C==null||C(Pe.date,Ke,be)},[C]),Vt=I.useCallback(Pe=>Ke=>{const be=Number(Ke.target.value),ke=u.setMonth(u.startOfMonth(Pe),be);ue(ke)},[u,ue]),an=I.useCallback(Pe=>Ke=>{const be=Number(Ke.target.value),ke=u.setYear(u.startOfMonth(Pe),be);ue(ke)},[u,ue]),{className:kn,style:Hn}=I.useMemo(()=>({className:[d[Me.Root],t.className].filter(Boolean).join(" "),style:{...k==null?void 0:k[Me.Root],...t.style}}),[d,t.className,t.style,k]),Mt=R_(t),bt=I.useRef(null);r3(bt,!!t.animate,{classNames:d,months:K,focused:ze,dateLib:u});const dn={dayPickerProps:t,selected:De,select:Ee,isSelected:U,months:K,nextMonth:D,previousMonth:ee,goToMonth:ue,getModifiers:ae,components:r,classNames:d,styles:k,labels:o,formatters:a};return xe.createElement(Rx.Provider,{value:dn},xe.createElement(r.Root,{rootRef:t.animate?bt:void 0,className:kn,style:Hn,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Mt},xe.createElement(r.Months,{className:d[Me.Months],style:k==null?void 0:k[Me.Months]},!t.hideNavigation&&!g&&xe.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:d[Me.Nav],style:k==null?void 0:k[Me.Nav],"aria-label":$t(),onPreviousClick:tr,onNextClick:cn,previousMonth:ee,nextMonth:D}),K.map((Pe,Ke)=>xe.createElement(r.Month,{"data-animated-month":t.animate?"true":void 0,className:d[Me.Month],style:k==null?void 0:k[Me.Month],key:Ke,displayIndex:Ke,calendarMonth:Pe},g==="around"&&!t.hideNavigation&&Ke===0&&xe.createElement(r.PreviousMonthButton,{type:"button",className:d[Me.PreviousMonthButton],tabIndex:ee?void 0:-1,"aria-disabled":ee?void 0:!0,"aria-label":gt(ee),onClick:tr,"data-animated-button":t.animate?"true":void 0},xe.createElement(r.Chevron,{disabled:ee?void 0:!0,className:d[Me.Chevron],orientation:t.dir==="rtl"?"right":"left"})),xe.createElement(r.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:d[Me.MonthCaption],style:k==null?void 0:k[Me.MonthCaption],calendarMonth:Pe,displayIndex:Ke},f!=null&&f.startsWith("dropdown")?xe.createElement(r.DropdownNav,{className:d[Me.Dropdowns],style:k==null?void 0:k[Me.Dropdowns]},(()=>{const be=f==="dropdown"||f==="dropdown-months"?xe.createElement(r.MonthsDropdown,{key:"month",className:d[Me.MonthsDropdown],"aria-label":Cn(),classNames:d,components:r,disabled:!!t.disableNavigation,onChange:Vt(Pe.date),options:G_(Pe.date,Z,G,a,u),style:k==null?void 0:k[Me.Dropdown],value:u.getMonth(Pe.date)}):xe.createElement("span",{key:"month"},j(Pe.date,u)),ke=f==="dropdown"||f==="dropdown-years"?xe.createElement(r.YearsDropdown,{key:"year",className:d[Me.YearsDropdown],"aria-label":vt(u.options),classNames:d,components:r,disabled:!!t.disableNavigation,onChange:an(Pe.date),options:J_(Z,G,a,u,!!t.reverseYears),style:k==null?void 0:k[Me.Dropdown],value:u.getYear(Pe.date)}):xe.createElement("span",{key:"year"},W(Pe.date,u));return u.getMonthYearOrder()==="year-first"?[ke,be]:[be,ke]})(),xe.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},N(Pe.date,u.options,u))):xe.createElement(r.CaptionLabel,{className:d[Me.CaptionLabel],role:"status","aria-live":"polite"},N(Pe.date,u.options,u))),g==="around"&&!t.hideNavigation&&Ke===x-1&&xe.createElement(r.NextMonthButton,{type:"button",className:d[Me.NextMonthButton],tabIndex:D?void 0:-1,"aria-disabled":D?void 0:!0,"aria-label":Lt(D),onClick:cn,"data-animated-button":t.animate?"true":void 0},xe.createElement(r.Chevron,{disabled:D?void 0:!0,className:d[Me.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Ke===x-1&&g==="after"&&!t.hideNavigation&&xe.createElement(r.Nav,{"data-animated-nav":t.animate?"true":void 0,className:d[Me.Nav],style:k==null?void 0:k[Me.Nav],"aria-label":$t(),onPreviousClick:tr,onNextClick:cn,previousMonth:ee,nextMonth:D}),xe.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":p==="multiple"||p==="range","aria-label":Et(Pe.date,u.options,u)||void 0,className:d[Me.MonthGrid],style:k==null?void 0:k[Me.MonthGrid]},!t.hideWeekdays&&xe.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:d[Me.Weekdays],style:k==null?void 0:k[Me.Weekdays]},B&&xe.createElement(r.WeekNumberHeader,{"aria-label":nt(u.options),className:d[Me.WeekNumberHeader],style:k==null?void 0:k[Me.WeekNumberHeader],scope:"col"},P()),Dt.map(be=>xe.createElement(r.Weekday,{"aria-label":er(be,u.options,u),className:d[Me.Weekday],key:String(be),style:k==null?void 0:k[Me.Weekday],scope:"col"},F(be,u.options,u)))),xe.createElement(r.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:d[Me.Weeks],style:k==null?void 0:k[Me.Weeks]},Pe.weeks.map(be=>xe.createElement(r.Week,{className:d[Me.Week],key:be.weekNumber,style:k==null?void 0:k[Me.Week],week:be},B&&xe.createElement(r.WeekNumber,{week:be,style:k==null?void 0:k[Me.WeekNumber],"aria-label":it(be.weekNumber,{locale:c}),className:d[Me.WeekNumber],scope:"row",role:"rowheader"},M(be.weekNumber,u)),be.days.map(ke=>{const{date:et}=ke,_e=ae(ke);if(_e[Wt.focused]=!_e.hidden&&!!(ze!=null&&ze.isEqualTo(ke)),_e[Fr.selected]=(U==null?void 0:U(et))||_e.selected,Gc(De)){const{from:Ft,to:Xt}=De;_e[Fr.range_start]=!!(Ft&&Xt&&u.isSameDay(et,Ft)),_e[Fr.range_end]=!!(Ft&&Xt&&u.isSameDay(et,Xt)),_e[Fr.range_middle]=ks(De,et,!0,u)}const Pt=X_(_e,k,t.modifiersStyles),Qt=A_(_e,d,t.modifiersClassNames),Gt=!ln&&!_e.hidden?Rt(et,_e,u.options,u):void 0;return xe.createElement(r.Day,{key:`${ke.isoDate}_${ke.displayMonthId}`,day:ke,modifiers:_e,className:Qt.join(" "),style:Pt,role:"gridcell","aria-selected":_e.selected||void 0,"aria-label":Gt,"data-day":ke.isoDate,"data-month":ke.outside?ke.dateMonthId:void 0,"data-selected":_e.selected||void 0,"data-disabled":_e.disabled||void 0,"data-hidden":_e.hidden||void 0,"data-outside":ke.outside||void 0,"data-focused":_e.focused||void 0,"data-today":_e.today||void 0},!_e.hidden&&ln?xe.createElement(r.DayButton,{className:d[Me.DayButton],style:k==null?void 0:k[Me.DayButton],type:"button",day:ke,modifiers:_e,disabled:!_e.focused&&_e.disabled||void 0,"aria-disabled":_e.focused&&_e.disabled||void 0,tabIndex:Ue(ke)?0:-1,"aria-label":Fe(et,_e,u.options,u),onClick:oe(ke,_e),onBlur:Ae(ke,_e),onFocus:me(ke,_e),onKeyDown:Ye(ke,_e),onMouseEnter:Xe(ke,_e),onMouseLeave:yt(ke,_e)},R(et,u.options,u)):!_e.hidden&&R(ke.date,u.options,u))})))))))),t.footer&&xe.createElement(r.Footer,{className:d[Me.Footer],style:k==null?void 0:k[Me.Footer],role:"status","aria-live":"polite"},t.footer)))}function co({trigger:e,children:t,isOpen:n,onOpenChange:r,width:a=340}){const[o,u]=I.useState(!1),c=I.useRef(null),d=I.useRef(null),f=n!==void 0?n:o,p=I.useCallback(x=>{r?r(x):u(x)},[r]),g=I.useCallback(()=>p(!1),[p]);return I.useEffect(()=>{if(!f)return;function x(E){const _=E.target;c.current&&!c.current.contains(_)&&d.current&&!d.current.contains(_)&&g()}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[f,g]),I.useEffect(()=>{if(!f)return;function x(E){E.key==="Escape"&&g()}return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[f,g]),m.jsxs("div",{className:"relative",style:{display:"inline-flex"},children:[m.jsx("div",{ref:d,onClick:()=>p(!f),children:e}),f&&m.jsx("div",{ref:c,className:"absolute top-full left-0 mt-1 rounded-lg shadow-lg border z-50",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border, #e5e7eb)",width:a},children:t})]})}function fo(){const[e,t]=I.useState(!1);return{isOpen:e,open:()=>t(!0),close:()=>t(!1),toggle:()=>t(n=>!n),onOpenChange:t}}function ho({label:e,value:t,active:n,icon:r,onClick:a}){return m.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-1.5 border rounded-full px-3 py-1.5 text-sm cursor-pointer transition-colors hover:border-blue-300",style:{borderColor:n?"var(--yc-color-primary)":"var(--yc-color-border, #e5e7eb)",backgroundColor:n?"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)":"var(--yc-color-surface)"},children:[r&&m.jsx("span",{className:"flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},children:r}),t?m.jsx("span",{style:{color:n?"var(--yc-color-primary)":"var(--yc-color-text, #111)"},className:"font-medium",children:t}):m.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:e}),m.jsx("svg",{className:"w-3 h-3 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})}function ui({title:e,onBack:t}){return m.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:[t&&m.jsx("button",{type:"button",onClick:t,className:"flex items-center justify-center w-6 h-6 rounded hover:bg-black/5",style:{color:"var(--yc-color-text-secondary)"},children:m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),m.jsx("span",{className:"text-sm font-medium",style:{color:"var(--yc-color-text, #111)"},children:e})]})}const Qx=[{value:"today",label:"Today"},{value:"yesterday",label:"Yesterday"},{value:"last_7_days",label:"Previous 7 days"},{value:"last_30_days",label:"Previous 30 days"},{value:"last_90_days",label:"Previous 90 days"},{divider:!0},{value:"previous_month",label:"Previous month"},{value:"previous_quarter",label:"Previous quarter"},{value:"previous_year",label:"Previous year"},{divider:!0},{value:"month_to_date",label:"Month to date"},{value:"quarter_to_date",label:"Quarter to date"},{value:"year_to_date",label:"Year to date"},{value:"last_12_months",label:"Last 12 months"}],w3=`
34
- .rdp-root {
35
- --rdp-accent-color: var(--yc-color-primary, #2563eb);
36
- --rdp-accent-background-color: color-mix(in srgb, var(--yc-color-primary, #2563eb) 15%, transparent);
37
- --rdp-range_start-color: white;
38
- --rdp-range_start-background: var(--yc-color-primary, #2563eb);
39
- --rdp-range_end-color: white;
40
- --rdp-range_end-background: var(--yc-color-primary, #2563eb);
41
- --rdp-range_middle-background: color-mix(in srgb, var(--yc-color-primary, #2563eb) 15%, transparent);
42
- --rdp-range_middle-color: var(--yc-color-primary, #1e40af);
43
- color: var(--yc-color-text);
44
- }
45
- .rdp-day { border-radius: 6px; }
46
- .rdp-selected .rdp-day_button { font-weight: 600; }
47
- .rdp-range_start .rdp-day_button,
48
- .rdp-range_end .rdp-day_button {
49
- background-color: var(--yc-color-primary, #2563eb) !important;
50
- color: white !important;
51
- font-weight: 600;
52
- }
53
- .rdp-range_middle .rdp-day_button {
54
- background-color: color-mix(in srgb, var(--yc-color-primary, #2563eb) 15%, transparent) !important;
55
- color: var(--yc-color-primary, #1e40af) !important;
56
- }
57
- .rdp-today .rdp-day_button {
58
- font-weight: 700;
59
- border: 2px solid var(--yc-color-primary, #2563eb);
60
- }
61
- .rdp-day_button:hover { background-color: var(--yc-color-surface-hover, #e5e7eb) !important; }
62
- .rdp-range_start .rdp-day_button:hover,
63
- .rdp-range_end .rdp-day_button:hover {
64
- background-color: color-mix(in srgb, var(--yc-color-primary, #2563eb) 80%, black) !important;
65
- }
66
- `;function o0(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="custom"}function Gx(e){return typeof e=="object"&&e!==null&&"type"in e&&e.type==="relative"}function Xx(e){const n=so(new Date);if(e.direction==="current")switch(e.unit){case"day":return{start:n,end:DS(n)};case"week":return{start:ss(n,{weekStartsOn:1}),end:$0(n,{weekStartsOn:1})};case"month":return{start:Ex(n),end:bx(n)};case"quarter":return{start:IS(n),end:MS(n)};case"year":return{start:q0(n),end:vx(n)}}const r=e.value??1,a=e.direction==="previous",u=(a?{day:zy,week:Xk,month:Qk,quarter:Gk,year:Kk}:{day:ti,week:W0,month:Vu,quarter:px,year:Y0})[e.unit];if(a){const c=e.includeToday?n:zy(n,1),d=u((e.includeToday,n),r);return{start:d<c?d:c,end:d<c?c:d}}else{const c=e.includeToday?n:ti(n,1),d=u(c,r);return{start:c<d?c:d,end:c<d?d:c}}}function S3(e){if(o0(e))return`${e.start} to ${e.end}`;if(Gx(e)){const t=Xx(e);return`${pn(t.start,"MMM d")} – ${pn(t.end,"MMM d, yyyy")}`}if(typeof e=="string"){const t=Qx.find(r=>"value"in r&&r.value===e);return t&&"label"in t?t.label:{last_7_days:"Previous 7 days",last_30_days:"Previous 30 days",last_90_days:"Previous 90 days",last_12_months:"Last 12 months"}[e]||e.replace(/_/g," ").replace(/\b\w/g,r=>r.toUpperCase())}return String(e)}const C3=m.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})});function Kx({name:e,label:t="Date",chartName:n,defaultValue:r="last_30_days"}){var E;const a=fo(),o=Qe(_=>_.globalFilters),u=Qe(_=>_.chartFilters),c=Qe(_=>_.setGlobalFilter),d=Qe(_=>_.setChartFilter),f=n?((E=u[n])==null?void 0:E[e])??o[e]??r:o[e]??r;I.useEffect(()=>{var S;(n?((S=u[n])==null?void 0:S[e])??o[e]:o[e])===void 0&&r&&(n?d(n,e,r):c(e,r))},[n,e,r,o,u,c,d]);const p=_=>{const S=_;n?d(n,e,S):c(e,S),a.close()},g=typeof f=="string"?f!==r:!0,x=S3(f);return m.jsx(co,{isOpen:a.isOpen,onOpenChange:a.onOpenChange,width:520,trigger:m.jsx(ho,{label:t,value:x,active:g,icon:C3}),children:m.jsx(k3,{currentValue:f,onApply:p,onClose:a.close})})}function k3({currentValue:e,onApply:t,onClose:n}){const[r,a]=I.useState("presets");return m.jsxs("div",{children:[r==="presets"&&m.jsx(_3,{currentValue:e,onSelectPreset:o=>{t(o),n()},onNavigate:a}),r==="fixed"&&m.jsx(N3,{currentValue:e,onApply:t,onBack:()=>a("presets")}),r==="relative"&&m.jsx(O3,{currentValue:e,onApply:t,onBack:()=>a("presets")})]})}function _3({currentValue:e,onSelectPreset:t,onNavigate:n}){return m.jsxs("div",{className:"py-1",children:[Qx.map((r,a)=>{if("divider"in r)return m.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border, #e5e7eb)"}},`divider-${a}`);const o=typeof e=="string"&&e===r.value;return m.jsxs("button",{type:"button",onClick:()=>t(r.value),className:"w-full text-left px-4 py-2 text-sm hover:bg-gray-50 flex items-center justify-between",style:{color:o?"var(--yc-color-primary)":"var(--yc-color-text, #111)"},children:[m.jsx("span",{className:o?"font-medium":"",children:r.label}),o&&m.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-primary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]},r.value)}),m.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border, #e5e7eb)"}}),m.jsxs("button",{type:"button",onClick:()=>n("fixed"),className:"w-full text-left px-4 py-2 text-sm hover:bg-gray-50 flex items-center justify-between",style:{color:"var(--yc-color-text, #111)"},children:[m.jsx("span",{children:"Fixed date range..."}),m.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]}),m.jsxs("button",{type:"button",onClick:()=>n("relative"),className:"w-full text-left px-4 py-2 text-sm hover:bg-gray-50 flex items-center justify-between",style:{color:"var(--yc-color-text, #111)"},children:[m.jsx("span",{children:"Relative date range..."}),m.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})}function N3({currentValue:e,onApply:t,onBack:n}){const[r,a]=I.useState("between"),[o,u]=I.useState(()=>{if(o0(e)){const x=oh(e.start,"yyyy-MM-dd",new Date),E=oh(e.end,"yyyy-MM-dd",new Date);return{from:x,to:E}}}),[c,d]=I.useState(()=>{if(o0(e)&&r!=="between")return oh(e.start,"yyyy-MM-dd",new Date)}),f=()=>{if(r==="between"&&(o!=null&&o.from)&&(o!=null&&o.to))t({type:"custom",start:pn(o.from,"yyyy-MM-dd"),end:pn(o.to,"yyyy-MM-dd")});else if(r==="on"&&c){const x=pn(c,"yyyy-MM-dd");t({type:"custom",start:x,end:x})}else r==="before"&&c?t({type:"custom",start:"1970-01-01",end:pn(c,"yyyy-MM-dd")}):r==="after"&&c&&t({type:"custom",start:pn(c,"yyyy-MM-dd"),end:pn(new Date(2099,11,31),"yyyy-MM-dd")})},p=r==="between"?!!(o!=null&&o.from&&(o!=null&&o.to)):!!c,g=[{key:"between",label:"Between"},{key:"before",label:"Before"},{key:"on",label:"On"},{key:"after",label:"After"}];return m.jsxs("div",{children:[m.jsx(ui,{title:"Fixed date range",onBack:n}),m.jsx("div",{className:"px-4 pt-3",children:m.jsx("div",{className:"flex gap-1 mb-3",children:g.map(x=>m.jsx("button",{type:"button",onClick:()=>a(x.key),className:"px-3 py-1 text-xs rounded-full font-medium transition-colors",style:r===x.key?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-text-secondary)"},children:x.label},x.key))})}),m.jsxs("div",{className:"px-4 flex justify-center",children:[m.jsx("style",{children:w3}),r==="between"?m.jsx(Qy,{mode:"range",selected:o,onSelect:u,numberOfMonths:2,defaultMonth:(o==null?void 0:o.from)||new Date}):m.jsx(Qy,{mode:"single",selected:c,onSelect:d,numberOfMonths:2,defaultMonth:c||new Date})]}),m.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:m.jsx("button",{type:"button",onClick:f,disabled:!p,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-40 disabled:cursor-not-allowed",children:"Update filter"})})]})}function O3({currentValue:e,onApply:t,onBack:n}){const r=Gx(e)?e:{direction:"previous",value:30,unit:"day",includeToday:!1},[a,o]=I.useState(r.direction),[u,c]=I.useState(r.value??30),[d,f]=I.useState(r.unit),[p,g]=I.useState(r.includeToday??!1),x=I.useMemo(()=>{const C=Xx({direction:a,value:a==="current"?void 0:u,unit:d,includeToday:p}),O=C.start.getFullYear(),L=C.end.getFullYear();return O===L?`${pn(C.start,"MMM d")} – ${pn(C.end,"MMM d, yyyy")}`:`${pn(C.start,"MMM d, yyyy")} – ${pn(C.end,"MMM d, yyyy")}`},[a,u,d,p]),E=()=>{t({type:"relative",direction:a,value:a==="current"?void 0:u,unit:d,includeToday:p})},_=[{key:"previous",label:"Previous"},{key:"current",label:"Current"},{key:"next",label:"Next"}],S=[{value:"day",label:"days"},{value:"week",label:"weeks"},{value:"month",label:"months"},{value:"quarter",label:"quarters"},{value:"year",label:"years"}],w=[{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"},{value:"quarter",label:"Quarter"},{value:"year",label:"Year"}];return m.jsxs("div",{children:[m.jsx(ui,{title:"Relative date range",onBack:n}),m.jsxs("div",{className:"p-4 space-y-4",children:[m.jsx("div",{className:"flex gap-1",children:_.map(T=>m.jsx("button",{type:"button",onClick:()=>o(T.key),className:"px-3 py-1 text-xs rounded-full font-medium transition-colors",style:a===T.key?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 15%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-text-secondary)"},children:T.label},T.key))}),a==="current"?m.jsx("div",{className:"flex gap-2",children:w.map(T=>m.jsx("button",{type:"button",onClick:()=>f(T.value),className:"px-3 py-1.5 text-sm rounded border transition-colors",style:d===T.value?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",borderColor:"var(--yc-color-primary)",color:"var(--yc-color-primary)",fontWeight:500}:{borderColor:"var(--yc-color-border)",color:"var(--yc-color-text-secondary)"},children:T.label},T.value))}):m.jsxs("div",{className:"flex gap-2",children:[m.jsx("input",{type:"number",min:1,value:u,onChange:T=>c(Math.max(1,parseInt(T.target.value)||1)),className:"w-20 px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"}}),m.jsx("select",{value:d,onChange:T=>f(T.target.value),className:"px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},children:S.map(T=>m.jsx("option",{value:T.value,children:T.label},T.value))})]}),a!=="current"&&m.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",style:{color:"var(--yc-color-text-secondary)"},children:[m.jsx("input",{type:"checkbox",checked:p,onChange:T=>g(T.target.checked),className:"rounded border-gray-300"}),"Include today"]}),m.jsxs("div",{className:"flex items-center gap-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),m.jsx("span",{children:x})]})]}),m.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:m.jsx("button",{type:"button",onClick:E,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}function Pc({name:e,label:t=e,options:n,chartName:r,defaultValue:a,source:o}){var R,j;const u=fo(),c=Qe(M=>M.globalFilters),d=Qe(M=>M.chartFilters),f=Qe(M=>M.setGlobalFilter),p=Qe(M=>M.setChartFilter),g=!!o,{data:x,isLoading:E}=is({queryKey:g?r?["parameterOptions",r,e]:["modelOptions",o.model,o.value_field,o.label_field]:["noop"],queryFn:()=>r?Ht.getParameterOptions(r,e):Ht.getModelOptions(o.model,o.value_field,o.label_field),enabled:g,staleTime:300*1e3}),_=g?[{value:"",label:"All"},...(x==null?void 0:x.options)??[]]:[{value:"",label:"All"},...n??[]],S=r?((R=d[r])==null?void 0:R[e])??c[e]??a??"":c[e]??a??"",[w,T]=I.useState(S),[C,O]=I.useState("");I.useEffect(()=>{u.isOpen&&(T(S),O(""))},[u.isOpen,S]),I.useEffect(()=>{var P;(r?((P=d[r])==null?void 0:P[e])??c[e]:c[e])===void 0&&a&&(r?p(r,e,a):f(e,a))},[r,e,a,c,d,f,p]);const L=()=>{r?p(r,e,w):f(e,w),u.close()},B=C?_.filter(M=>M.label.toLowerCase().includes(C.toLowerCase())):_,k=S?((j=_.find(M=>M.value===S))==null?void 0:j.label)||S:void 0,N=!!S&&S!==a;return g&&E?m.jsx("div",{className:"flex items-center border rounded-full px-3 py-1.5 text-sm gap-1.5",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-surface)"},children:m.jsx("span",{className:"text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Loading..."})}):m.jsxs(co,{isOpen:u.isOpen,onOpenChange:u.onOpenChange,trigger:m.jsx(ho,{label:t,value:k||t,active:N}),children:[m.jsx(ui,{title:t}),m.jsxs("div",{className:"p-3",children:[_.length>6&&m.jsx("div",{className:"mb-2",children:m.jsx("input",{type:"text",placeholder:"Search...",value:C,onChange:M=>O(M.target.value),className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},autoFocus:!0})}),m.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[B.map(M=>m.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm",children:[m.jsx("input",{type:"radio",name:`select-${e}`,checked:w===M.value,onChange:()=>T(M.value),className:"text-blue-600"}),m.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:M.label})]},M.value)),B.length===0&&m.jsx("div",{className:"text-sm px-2 py-3 text-center",style:{color:"var(--yc-color-text-muted)"},children:"No matches"})]})]}),m.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:m.jsx("button",{type:"button",onClick:L,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}function Jx({name:e,label:t=e,options:n,chartName:r,defaultValue:a,source:o}){const u=fo(),c=Qe(P=>P.globalFilters),d=Qe(P=>P.chartFilters),f=Qe(P=>P.setGlobalFilter),p=Qe(P=>P.setChartFilter),g=!!o,{data:x,isLoading:E}=is({queryKey:g?r?["parameterOptions",r,e]:["modelOptions",o.model,o.value_field,o.label_field]:["noop"],queryFn:()=>r?Ht.getParameterOptions(r,e):Ht.getModelOptions(o.model,o.value_field,o.label_field),enabled:g,staleTime:300*1e3}),_=g?(x==null?void 0:x.options)??[]:n??[],S=(()=>{var F;const P=r?((F=d[r])==null?void 0:F[e])??c[e]??a??[]:c[e]??a??[];return Array.isArray(P)?P:[]})(),[w,T]=I.useState(S),[C,O]=I.useState("");I.useEffect(()=>{u.isOpen&&(T(S),O(""))},[u.isOpen]),I.useEffect(()=>{var F;(r?((F=d[r])==null?void 0:F[e])??c[e]:c[e])===void 0&&a&&(r?p(r,e,a):f(e,a))},[r,e,a,c,d,f,p]);const L=P=>{T(F=>F.includes(P)?F.filter(W=>W!==P):[...F,P])},B=()=>{w.length===_.length?T([]):T(_.map(P=>P.value))},k=()=>{r?p(r,e,w):f(e,w),u.close()},N=C?_.filter(P=>P.label.toLowerCase().includes(C.toLowerCase())):_,R=S.length===0?void 0:S.length<=2?S.map(P=>{var F;return((F=_.find(W=>W.value===P))==null?void 0:F.label)||P}).join(", "):`${S.length} selected`,j=S.length>0,M=w.length===_.length&&_.length>0;return g&&E?m.jsx("div",{className:"flex items-center border rounded-full px-3 py-1.5 text-sm gap-1.5",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-surface)"},children:m.jsx("span",{className:"text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Loading..."})}):m.jsxs(co,{isOpen:u.isOpen,onOpenChange:u.onOpenChange,trigger:m.jsx(ho,{label:t,value:R||t,active:j}),children:[m.jsx(ui,{title:t}),m.jsxs("div",{className:"p-3",children:[_.length>6&&m.jsx("div",{className:"mb-2",children:m.jsx("input",{type:"text",placeholder:"Search...",value:C,onChange:P=>O(P.target.value),className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},autoFocus:!0})}),m.jsxs("div",{className:"max-h-60 overflow-y-auto",children:[!C&&m.jsxs(m.Fragment,{children:[m.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm font-medium",children:[m.jsx("input",{type:"checkbox",checked:M,onChange:B,className:"text-blue-600 rounded"}),m.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:"Select all"})]}),m.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border, #e5e7eb)"}})]}),N.map(P=>m.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm",children:[m.jsx("input",{type:"checkbox",checked:w.includes(P.value),onChange:()=>L(P.value),className:"text-blue-600 rounded"}),m.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:P.label})]},P.value)),N.length===0&&m.jsx("div",{className:"text-sm px-2 py-3 text-center",style:{color:"var(--yc-color-text-muted)"},children:"No matches"})]})]}),m.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:m.jsx("button",{type:"button",onClick:k,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}const u0=[{value:"is",label:"is"},{value:"is_not",label:"is not"},{value:"contains",label:"contains"},{value:"does_not_contain",label:"does not contain"},{value:"starts_with",label:"starts with"},{value:"ends_with",label:"ends with"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],Zx=["is_empty","is_not_empty"];function eE(e){return typeof e=="object"&&e!==null&&"operator"in e&&"value"in e}function D3(e){var t,n;if(eE(e))return Zx.includes(e.operator)?(t=u0.find(a=>a.value===e.operator))==null?void 0:t.label:`${((n=u0.find(a=>a.value===e.operator))==null?void 0:n.label)||e.operator} "${e.value}"`;if(typeof e=="string"&&e)return e}function tE({name:e,label:t=e,chartName:n,defaultValue:r}){var O;const a=fo(),o=Qe(L=>L.globalFilters),u=Qe(L=>L.chartFilters),c=Qe(L=>L.setGlobalFilter),d=Qe(L=>L.setChartFilter),f=n?((O=u[n])==null?void 0:O[e])??o[e]??r??null:o[e]??r??null,[p,g]=I.useState("contains"),[x,E]=I.useState("");I.useEffect(()=>{a.isOpen&&(eE(f)?(g(f.operator),E(f.value)):typeof f=="string"?(g("is"),E(f)):(g("contains"),E("")))},[a.isOpen]);const _=()=>{const L={operator:p,value:x};n?d(n,e,L):c(e,L),a.close()},S=!Zx.includes(p),w=!S||x.trim().length>0,T=D3(f),C=!!T;return m.jsxs(co,{isOpen:a.isOpen,onOpenChange:a.onOpenChange,trigger:m.jsx(ho,{label:t,value:T||t,active:C}),children:[m.jsx(ui,{title:t}),m.jsxs("div",{className:"p-4 space-y-3",children:[m.jsx("select",{value:p,onChange:L=>g(L.target.value),className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},children:u0.map(L=>m.jsx("option",{value:L.value,children:L.label},L.value))}),S&&m.jsx("input",{type:"text",value:x,onChange:L=>E(L.target.value),placeholder:"Enter value...",className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},autoFocus:!0,onKeyDown:L=>{L.key==="Enter"&&w&&_()}})]}),m.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:m.jsx("button",{type:"button",onClick:_,disabled:!w,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-40 disabled:cursor-not-allowed",children:"Update filter"})})]})}const l0=[{value:"equal",label:"equal to"},{value:"not_equal",label:"not equal to"},{value:"greater",label:"greater than"},{value:"less",label:"less than"},{value:"greater_or_equal",label:"greater than or equal to"},{value:"less_or_equal",label:"less than or equal to"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],nE=["is_empty","is_not_empty"];function rE(e){return typeof e=="object"&&e!==null&&"operator"in e&&"value"in e&&typeof e.value=="number"}function A3(e){var t,n;if(rE(e)){if(nE.includes(e.operator))return(t=l0.find(a=>a.value===e.operator))==null?void 0:t.label;const r=((n=l0.find(a=>a.value===e.operator))==null?void 0:n.label)||e.operator;return e.operator==="between"&&e.value2!==void 0?`${e.value} – ${e.value2}`:`${r} ${e.value}`}if(typeof e=="number")return String(e)}function sE({name:e,label:t=e,chartName:n,defaultValue:r}){var k;const a=fo(),o=Qe(N=>N.globalFilters),u=Qe(N=>N.chartFilters),c=Qe(N=>N.setGlobalFilter),d=Qe(N=>N.setChartFilter),f=n?((k=u[n])==null?void 0:k[e])??o[e]??r??null:o[e]??r??null,[p,g]=I.useState("equal"),[x,E]=I.useState(""),[_,S]=I.useState("");I.useEffect(()=>{a.isOpen&&(rE(f)?(g(f.operator),E(String(f.value)),S(f.value2!==void 0?String(f.value2):"")):typeof f=="number"?(g("equal"),E(String(f)),S("")):(g("equal"),E(""),S("")))},[a.isOpen]);const w=()=>{const N={operator:p,value:parseFloat(x)||0,...p==="between"?{value2:parseFloat(_)||0}:{}};n?d(n,e,N):c(e,N),a.close()},T=!nE.includes(p),C=p==="between",O=!T||x!==""&&(!C||_!==""),L=A3(f),B=!!L;return m.jsxs(co,{isOpen:a.isOpen,onOpenChange:a.onOpenChange,trigger:m.jsx(ho,{label:t,value:L||t,active:B}),children:[m.jsx(ui,{title:t}),m.jsxs("div",{className:"p-4 space-y-3",children:[m.jsx("select",{value:p,onChange:N=>g(N.target.value),className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},children:l0.map(N=>m.jsx("option",{value:N.value,children:N.label},N.value))}),T&&m.jsxs("div",{className:"flex gap-2",children:[m.jsx("input",{type:"number",value:x,onChange:N=>E(N.target.value),placeholder:C?"Min":"Enter value...",className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)",backgroundColor:"var(--yc-color-surface)",color:"var(--yc-color-text)"},autoFocus:!0,onKeyDown:N=>{N.key==="Enter"&&O&&w()}}),C&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-sm self-center",style:{color:"var(--yc-color-text-muted)"},children:"and"}),m.jsx("input",{type:"number",value:_,onChange:N=>S(N.target.value),placeholder:"Max",className:"w-full px-3 py-1.5 border rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-400",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},onKeyDown:N=>{N.key==="Enter"&&O&&w()}})]})]})]}),m.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:m.jsx("button",{type:"button",onClick:w,disabled:!O,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700 disabled:opacity-40 disabled:cursor-not-allowed",children:"Update filter"})})]})}function aE({name:e,label:t=e,chartName:n}){var _;const r=fo(),a=Qe(S=>S.globalFilters),o=Qe(S=>S.chartFilters),u=Qe(S=>S.setGlobalFilter),c=Qe(S=>S.setChartFilter),d=n?((_=o[n])==null?void 0:_[e])??a[e]??null:a[e]??null,[f,p]=I.useState(typeof d=="boolean"?d:null);I.useEffect(()=>{r.isOpen&&p(typeof d=="boolean"?d:null)},[r.isOpen]);const g=()=>{n?c(n,e,f):u(e,f),r.close()},x=typeof d=="boolean"?d?"True":"False":void 0,E=typeof d=="boolean";return m.jsxs(co,{isOpen:r.isOpen,onOpenChange:r.onOpenChange,width:240,trigger:m.jsx(ho,{label:t,value:x||t,active:E}),children:[m.jsx(ui,{title:t}),m.jsxs("div",{className:"p-4 space-y-1",children:[[{value:!0,label:"True"},{value:!1,label:"False"}].map(S=>m.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 cursor-pointer text-sm",children:[m.jsx("input",{type:"radio",name:`bool-${e}`,checked:f===S.value,onChange:()=>p(S.value),className:"text-blue-600"}),m.jsx("span",{style:{color:"var(--yc-color-text, #111)"},children:S.label})]},String(S.value))),m.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-black/5 cursor-pointer text-sm",style:{color:"var(--yc-color-text-muted)"},children:[m.jsx("input",{type:"radio",name:`bool-${e}`,checked:f===null,onChange:()=>p(null),className:"text-blue-600"}),m.jsx("span",{children:"Any"})]})]}),m.jsx("div",{className:"flex justify-end px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border, #e5e7eb)"},children:m.jsx("button",{type:"button",onClick:g,className:"px-4 py-1.5 text-sm font-medium bg-blue-600 text-white rounded hover:bg-blue-700",children:"Update filter"})})]})}function Ru(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim()}function iE({parameters:e,chartName:t}){return e.length===0?null:m.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.map(n=>{const r=n.label||Ru(n.name),a=typeof n.default=="string"?n.default:void 0;switch(n.type){case"date_range":return m.jsx(Kx,{name:n.name,label:r,chartName:t,defaultValue:a},n.name);case"select":{const o=(n.options||[]).map(u=>typeof u=="string"?{value:u,label:u}:u);return m.jsx(Pc,{name:n.name,label:r,options:o,chartName:t,defaultValue:a},n.name)}case"dynamic_select":return!t&&!n.source?m.jsxs("div",{className:"text-sm text-gray-500",children:[r,": dynamic_select requires chartName or source"]},n.name):m.jsx(Pc,{name:n.name,label:r,chartName:t,defaultValue:a,source:n.source},n.name);case"multi_select":{const o=(n.options||[]).map(u=>typeof u=="string"?{value:u,label:u}:u);return m.jsx(Jx,{name:n.name,label:r,options:o,chartName:t,defaultValue:Array.isArray(n.default)?n.default:void 0,source:n.source},n.name)}case"text":return m.jsx(tE,{name:n.name,label:r,chartName:t,defaultValue:a},n.name);case"number":return m.jsx(sE,{name:n.name,label:r,chartName:t,defaultValue:typeof n.default=="number"?n.default:void 0},n.name);case"boolean":return m.jsx(aE,{name:n.name,label:r,chartName:t},n.name);default:return m.jsxs("div",{className:"text-sm text-gray-500",children:[r,": ",n.type," (not supported)"]},n.name)}})})}function I3({resourceType:e,resourceName:t}){const n=ro(S=>S.auth),[r,a]=I.useState(!1),[o,u]=I.useState(null),[c,d]=I.useState(null),[f,p]=I.useState(!1),g=I.useRef(null);if(n.status!=="authenticated")return null;const x=n.user.role==="admin"||n.user.role==="editor";I.useEffect(()=>{if(!r)return;const S=w=>{g.current&&!g.current.contains(w.target)&&a(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[r]);const E=async()=>{const S=e==="dashboard"?`#/dashboards/${t}`:`#/charts/${t}`,w=`${window.location.origin}/${S}`;await navigator.clipboard.writeText(w),d("link"),setTimeout(()=>d(null),2e3)},_=async()=>{p(!0);try{const S=await Ht.createShareLink({resourceType:e,resourceName:t}),w=e==="dashboard"?`#/public/dashboards/${t}?token=${S.token}`:`#/public/charts/${t}?token=${S.token}`,T=`${window.location.origin}/${w}`;u(T),await navigator.clipboard.writeText(T),d("public"),setTimeout(()=>d(null),2e3)}catch(S){console.error("Failed to create share link:",S)}finally{p(!1)}};return m.jsxs("div",{className:"relative",ref:g,children:[m.jsxs("button",{onClick:()=>a(!r),className:"text-sm flex items-center gap-1.5 px-2 py-1 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},title:"Share",children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z"})}),m.jsx("span",{children:"Share"})]}),r&&m.jsxs("div",{className:"absolute right-0 top-full mt-1 border rounded-lg shadow-lg py-1 w-64 z-50",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[m.jsxs("button",{onClick:E,className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[m.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-muted)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})}),c==="link"?m.jsx("span",{style:{color:"var(--yc-color-success)"},children:"Copied!"}):m.jsx("span",{children:"Copy link (requires login)"})]}),x&&m.jsxs("button",{onClick:_,disabled:f,className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[m.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-muted)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),f?m.jsx("span",{style:{color:"var(--yc-color-text-muted)"},children:"Creating..."}):c==="public"?m.jsx("span",{style:{color:"var(--yc-color-success)"},children:"Public link copied!"}):m.jsx("span",{children:"Create public link"})]}),o&&m.jsxs("div",{className:"px-3 py-2 border-t",style:{borderColor:"var(--yc-color-border)"},children:[m.jsx("div",{className:"text-xs mb-1",style:{color:"var(--yc-color-text-muted)"},children:"Public URL:"}),m.jsx("div",{className:"text-xs break-all font-mono p-1.5 rounded",style:{color:"var(--yc-color-text-secondary)",backgroundColor:"var(--yc-color-input-bg)"},children:o})]})]})]})}function R3({rowCount:e,durationMs:t,cached:n,view:r,onToggleView:a,onExportCSV:o,onExportPNG:u,onShowSql:c}){const[d,f]=I.useState(!1);return m.jsxs("div",{className:"yc-chart-footer flex items-center justify-between px-4 py-2 border-t text-xs",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)",color:"var(--yc-color-text-secondary)"},children:[m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("button",{onClick:()=>a("chart"),className:`p-1.5 rounded transition-colors ${r==="chart"?"bg-black/5":"hover:bg-black/5"}`,title:"Chart view",children:m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"})})}),m.jsx("button",{onClick:()=>a("table"),className:`p-1.5 rounded transition-colors ${r==="table"?"bg-black/5":"hover:bg-black/5"}`,title:"Table view",children:m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 10h18M3 14h18m-9-4v8m-7 0h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]}),m.jsxs("div",{className:"flex items-center gap-3",children:[e!=null&&m.jsxs("span",{children:[e.toLocaleString()," rows"]}),t!=null&&m.jsxs("span",{children:[n&&m.jsx("span",{className:"text-green-600 mr-1",title:"Served from cache",children:"cached"}),t,"ms"]}),c&&m.jsx("button",{onClick:c,className:"px-2 py-0.5 rounded border hover:bg-black/5 transition-colors font-mono",style:{borderColor:"var(--yc-color-border)"},children:"SQL"}),(o||u)&&m.jsxs("div",{className:"relative",children:[m.jsx("button",{onClick:()=>f(!d),className:"px-2 py-0.5 rounded border hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)"},children:"Export"}),d&&m.jsxs("div",{className:"absolute right-0 bottom-full mb-1 w-32 rounded-md shadow-lg border py-1 z-50",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[o&&m.jsx("button",{onClick:()=>{o(),f(!1)},className:"w-full text-left px-3 py-1.5 text-xs hover:bg-black/5",style:{color:"var(--yc-color-text)"},children:"Export CSV"}),u&&m.jsx("button",{onClick:()=>{u(),f(!1)},className:"w-full text-left px-3 py-1.5 text-xs hover:bg-black/5",style:{color:"var(--yc-color-text)"},children:"Export PNG"})]})]})]})]})}const L3=new Set(["SELECT","FROM","WHERE","AND","OR","NOT","IN","IS","NULL","AS","ON","JOIN","LEFT","RIGHT","INNER","OUTER","FULL","CROSS","GROUP","BY","ORDER","HAVING","LIMIT","OFFSET","UNION","ALL","INSERT","INTO","VALUES","UPDATE","SET","DELETE","CREATE","DROP","ALTER","TABLE","INDEX","VIEW","WITH","RECURSIVE","DISTINCT","CASE","WHEN","THEN","ELSE","END","BETWEEN","LIKE","ILIKE","EXISTS","ANY","SOME","ASC","DESC","NULLS","FIRST","LAST","TRUE","FALSE","OVER","PARTITION","ROWS","RANGE","PRECEDING","FOLLOWING","UNBOUNDED","CURRENT","ROW","FILTER","WITHIN","LATERAL","NATURAL","USING","EXCEPT","INTERSECT","FETCH","NEXT","ONLY","FOR","IF","REPLACE","CASCADE","RESTRICT","TEMPORARY","TEMP","MATERIALIZED","EXPLAIN","ANALYZE","WINDOW"]),M3=new Set(["COUNT","SUM","AVG","MIN","MAX","COALESCE","NULLIF","CAST","CONVERT","IFNULL","NVL","TRIM","LTRIM","RTRIM","UPPER","LOWER","LENGTH","SUBSTRING","SUBSTR","REPLACE","CONCAT","CONCAT_WS","DATE_TRUNC","DATE_PART","EXTRACT","NOW","CURRENT_DATE","CURRENT_TIMESTAMP","DATEADD","DATEDIFF","TO_DATE","TO_CHAR","TO_NUMBER","TO_TIMESTAMP","ROUND","FLOOR","CEIL","CEILING","ABS","MOD","POWER","SQRT","LOG","LN","EXP","SIGN","ROW_NUMBER","RANK","DENSE_RANK","NTILE","LAG","LEAD","FIRST_VALUE","LAST_VALUE","NTH_VALUE","LISTAGG","STRING_AGG","ARRAY_AGG","JSON_AGG","BOOL_OR","BOOL_AND","GREATEST","LEAST","DECODE","IFF","ZEROIFNULL","TRY_CAST"]);function Lr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function P3(e){const t=[];let n=0;const r=a=>e.charAt(a);for(;n<e.length;){if(r(n)==="-"&&r(n+1)==="-"){const a=e.indexOf(`
67
- `,n),o=a===-1?e.slice(n):e.slice(n,a);t.push(`<span class="sql-comment">${Lr(o)}</span>`),n+=o.length;continue}if(r(n)==="/"&&r(n+1)==="*"){const a=e.indexOf("*/",n+2),o=a===-1?e.slice(n):e.slice(n,a+2);t.push(`<span class="sql-comment">${Lr(o)}</span>`),n+=o.length;continue}if(r(n)==="'"){let a=n+1;for(;a<e.length;)if(r(a)==="'"&&r(a+1)==="'")a+=2;else if(r(a)==="'"){a++;break}else a++;t.push(`<span class="sql-string">${Lr(e.slice(n,a))}</span>`),n=a;continue}if(r(n)==='"'){const a=e.indexOf('"',n+1),o=a===-1?e.slice(n):e.slice(n,a+1);t.push(`<span class="sql-identifier">${Lr(o)}</span>`),n+=o.length;continue}if(/\d/.test(r(n))&&(n===0||/[\s,=(]/.test(r(n-1)))){let a=n;for(;a<e.length&&/[\d.]/.test(r(a));)a++;t.push(`<span class="sql-number">${Lr(e.slice(n,a))}</span>`),n=a;continue}if(/[a-zA-Z_]/.test(r(n))){let a=n;for(;a<e.length&&/[a-zA-Z0-9_]/.test(r(a));)a++;const o=e.slice(n,a),u=o.toUpperCase(),c=e.slice(a);/^\s*\(/.test(c)&&M3.has(u)?t.push(`<span class="sql-function">${Lr(o)}</span>`):L3.has(u)?t.push(`<span class="sql-keyword">${Lr(o)}</span>`):t.push(Lr(o)),n=a;continue}if(r(n)===":"&&r(n+1)===":"){let a=n+2;for(;a<e.length&&/[a-zA-Z0-9_]/.test(r(a));)a++;t.push(`<span class="sql-type">${Lr(e.slice(n,a))}</span>`),n=a;continue}if("=<>!+-*/%".includes(r(n))){t.push(`<span class="sql-operator">${Lr(r(n))}</span>`),n++;continue}t.push(Lr(r(n))),n++}return t.join("")}function F3({isOpen:e,onClose:t,compiledSql:n,modelName:r,connection:a,durationMs:o,rowCount:u,cached:c}){const[d,f]=I.useState(!1),p=I.useMemo(()=>n?P3(n):"",[n]);if(!e)return null;const g=async()=>{if(n)try{await navigator.clipboard.writeText(n),f(!0),setTimeout(()=>f(!1),2e3)}catch{}};return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"fixed inset-0 bg-black/20 z-40",onClick:t}),m.jsxs("div",{className:"fixed top-0 right-0 bottom-0 w-[480px] max-w-[90vw] z-50 flex flex-col shadow-xl border-l",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[m.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b flex-shrink-0",style:{borderColor:"var(--yc-color-border)"},children:[m.jsx("h2",{className:"text-base font-semibold",style:{color:"var(--yc-color-text)",fontFamily:"var(--yc-font-heading)"},children:"Query Details"}),m.jsx("button",{onClick:t,className:"p-1.5 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},children:m.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),m.jsxs("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-5",children:[m.jsxs("div",{className:"space-y-2",children:[m.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-text-secondary)"},children:"Metadata"}),m.jsxs("div",{className:"text-sm space-y-1.5 p-3 rounded",style:{backgroundColor:"var(--yc-color-background)",border:"1px solid var(--yc-color-border)"},children:[r&&m.jsxs("div",{className:"flex justify-between",children:[m.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Model"}),m.jsx("span",{className:"font-mono text-xs",style:{color:"var(--yc-color-text)"},children:r})]}),a&&m.jsxs("div",{className:"flex justify-between",children:[m.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Connection"}),m.jsx("span",{style:{color:"var(--yc-color-text)"},children:a})]}),u!=null&&m.jsxs("div",{className:"flex justify-between",children:[m.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Rows"}),m.jsx("span",{style:{color:"var(--yc-color-text)"},children:u.toLocaleString()})]}),o!=null&&m.jsxs("div",{className:"flex justify-between",children:[m.jsx("span",{style:{color:"var(--yc-color-text-secondary)"},children:"Duration"}),m.jsxs("span",{style:{color:"var(--yc-color-text)"},children:[o,"ms",c&&m.jsx("span",{className:"ml-2 text-green-600 text-xs",children:"(cached)"})]})]})]})]}),m.jsxs("div",{className:"space-y-2",children:[m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("h3",{className:"text-xs font-medium uppercase tracking-wider",style:{color:"var(--yc-color-text-secondary)"},children:"Compiled SQL"}),m.jsx("button",{onClick:g,className:"text-xs px-2 py-1 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-primary)"},children:d?"Copied!":"Copy"})]}),n?m.jsx("pre",{className:"text-xs p-4 rounded overflow-x-auto whitespace-pre-wrap break-words leading-relaxed",style:{fontFamily:"var(--yc-font-mono)",backgroundColor:"var(--yc-color-background)",color:"var(--yc-color-text)",border:"1px solid var(--yc-color-border)"},dangerouslySetInnerHTML:{__html:p}}):m.jsx("p",{className:"text-sm italic",style:{color:"var(--yc-color-text-secondary)"},children:"No SQL available."})]})]})]})]})}async function j3(e,t,n="png"){const{default:r}=await Os(async()=>{const{default:u}=await import("./html2canvas.esm-QH1iLAAe.js");return{default:u}},[]),o=(await r(e,{backgroundColor:"#f9fafb",scale:2,useCORS:!0,logging:!1})).toDataURL(`image/${n}`,n==="jpeg"?.9:void 0);Fc(o,`${t}.${n}`)}async function B3(e,t,n){const[{default:r},{jsPDF:a}]=await Promise.all([Os(()=>import("./html2canvas.esm-QH1iLAAe.js"),[]),Os(()=>import("./jspdf.es.min-fNEhp1P4.js").then(L=>L.j),[])]),o=await r(e,{backgroundColor:"#f9fafb",scale:2,useCORS:!0,logging:!1}),u=o.toDataURL("image/png"),c=o.width,d=o.height,p=c/d>1,g=new a({orientation:p?"landscape":"portrait",unit:"mm"}),x=g.internal.pageSize.getWidth(),E=g.internal.pageSize.getHeight();let _=10;n&&(g.setFontSize(16),g.text(n,x/2,_,{align:"center"}),_=20);const S=x-20,w=E-_-10;let T=S,C=d/c*T;C>w&&(C=w,T=c/d*C);const O=(x-T)/2;g.addImage(u,"PNG",O,_,T,C),g.save(`${t}.pdf`)}async function H3(e,t,n){const{jsPDF:r}=await Os(async()=>{const{jsPDF:w}=await import("./jspdf.es.min-fNEhp1P4.js").then(T=>T.j);return{jsPDF:w}},[]),a=new Image;a.src=e,await new Promise(w=>{a.onload=w});const u=a.width/a.height>1.2,c=new r({orientation:u?"landscape":"portrait",unit:"mm"}),d=c.internal.pageSize.getWidth(),f=c.internal.pageSize.getHeight();let p=15;n&&(c.setFontSize(14),c.text(n,d/2,10,{align:"center"}));const g=d-20,x=f-p-15;let E=g,_=a.height/a.width*E;_>x&&(_=x,E=a.width/a.height*_);const S=(d-E)/2;c.addImage(e,"PNG",S,p,E,_),c.save(`${t}.pdf`)}function Kc(e,t,n){if(e.length===0)return;const r=t.map(u=>u.name),a=e.map(u=>t.map(c=>{const d=u[c.name];if(d==null)return"";const f=String(d);return f.includes(",")||f.includes('"')||f.includes(`
68
- `)?`"${f.replace(/"/g,'""')}"`:f})),o=[r.join(","),...a.map(u=>u.join(","))].join(`
69
- `);oE(o,`${n}.csv`,"text/csv;charset=utf-8;")}function U3(e,t){const n=JSON.stringify(e,null,2);oE(n,`${t}.json`,"application/json;charset=utf-8;")}function Fc(e,t){const n=document.createElement("a");n.href=e,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function oE(e,t,n){const r=new Blob([e],{type:n}),a=URL.createObjectURL(r),o=document.createElement("a");o.href=a,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(a)}const au=50;function z3({data:e,columns:t,drillDownColumns:n,filterDisplay:r,chartName:a}){const[o,u]=I.useState(null),[c,d]=I.useState(0),f=I.useMemo(()=>n&&n.length>0?n.map(C=>({field:C.field,label:C.label??C.field,format:C.format})):t.map(C=>({field:C.name,label:C.name,format:void 0})),[n,t]),p=I.useMemo(()=>{if(!o)return e;const{field:C,direction:O}=o;return[...e].sort((L,B)=>{const k=L[C],N=B[C];if(k==null&&N==null)return 0;if(k==null)return 1;if(N==null)return-1;if(typeof k=="number"&&typeof N=="number")return O==="asc"?k-N:N-k;const R=String(k),j=String(N);return O==="asc"?R.localeCompare(j):j.localeCompare(R)})},[e,o]),g=Math.ceil(p.length/au),x=p.slice(c*au,(c+1)*au),E=c*au+1,_=Math.min((c+1)*au,p.length),S=C=>{u(O=>!O||O.field!==C?{field:C,direction:"asc"}:O.direction==="asc"?{field:C,direction:"desc"}:null),d(0)},w=(C,O)=>C==null?"":O&&typeof C=="number"?O.includes("$")?`$${C.toLocaleString()}`:O.includes("%")?`${C.toFixed(1)}%`:C.toLocaleString():String(C),T=C=>!o||o.field!==C?"":o.direction==="asc"?" ↑":" ↓";return m.jsxs("div",{className:"border rounded-lg overflow-hidden",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[m.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-input-bg)"},children:[m.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["Showing ",p.length," rows filtered by ",r]}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("button",{onClick:()=>Kc(e,t,`${a}-drill-down`),className:"text-sm px-3 py-1 border rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)",borderColor:"var(--yc-color-border)"},children:"Export CSV"}),m.jsx("button",{onClick:()=>U3(e,`${a}-drill-down`),className:"text-sm px-3 py-1 border rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)",borderColor:"var(--yc-color-border)"},children:"Export JSON"})]})]}),m.jsx("div",{className:"overflow-x-auto",children:m.jsxs("table",{className:"w-full text-sm",children:[m.jsx("thead",{children:m.jsx("tr",{className:"border-b",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-input-bg)"},children:f.map(C=>m.jsxs("th",{className:"px-4 py-2 text-left font-medium cursor-pointer hover:bg-black/5 select-none",style:{color:"var(--yc-color-text)"},onClick:()=>S(C.field),children:[C.label,T(C.field)]},C.field))})}),m.jsx("tbody",{children:x.map((C,O)=>m.jsx("tr",{style:{backgroundColor:O%2===0?"var(--yc-color-surface)":"var(--yc-color-input-bg)"},children:f.map(L=>m.jsx("td",{className:"px-4 py-2",style:{color:"var(--yc-color-text-secondary)"},children:w(C[L.field],L.format)},L.field))},O))})]})}),g>1&&m.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-input-bg)"},children:[m.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["Showing ",E,"-",_," of ",p.length]}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("button",{onClick:()=>d(C=>Math.max(0,C-1)),disabled:c===0,className:"text-sm px-3 py-1 border rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)"},children:"Previous"}),m.jsx("button",{onClick:()=>d(C=>Math.min(g-1,C+1)),disabled:c>=g-1,className:"text-sm px-3 py-1 border rounded disabled:opacity-50 disabled:cursor-not-allowed hover:bg-black/5 transition-colors",style:{borderColor:"var(--yc-color-border)"},children:"Next"})]})]})]})}class tm extends I.Component{constructor(t){super(t),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}componentDidUpdate(t){this.state.error&&t.resetKey!==this.props.resetKey&&this.setState({error:null})}render(){return this.state.error?this.props.fallback(this.state.error,()=>this.setState({error:null})):this.props.children}}const Br=I.forwardRef(function({option:t,height:n=400,loading:r=!1,onEvents:a},o){const u=I.useRef(null),c=I.useRef(null);I.useImperativeHandle(o,()=>({getDataURL:f=>{var g;const p=(g=u.current)==null?void 0:g.getEchartsInstance();if(p)try{return p.getDataURL({type:f==="png"?"png":"svg",pixelRatio:2,backgroundColor:"#fff"})}catch{return p.getDataURL({type:"svg",pixelRatio:2,backgroundColor:"#fff"})}},getInstance:()=>{var f;return(f=u.current)==null?void 0:f.getEchartsInstance()}})),I.useEffect(()=>{const f=c.current;if(!f)return;let p;const g=new ResizeObserver(()=>{clearTimeout(p),p=setTimeout(()=>{var x,E;(E=(x=u.current)==null?void 0:x.getEchartsInstance())==null||E.resize()},150)});return g.observe(f),()=>{clearTimeout(p),g.disconnect()}},[]);const d=I.useCallback(f=>f.preventDefault(),[]);return m.jsx("div",{ref:c,onContextMenu:a!=null&&a.contextmenu?d:void 0,style:{height:n,width:"100%"},children:m.jsx(aw,{ref:u,option:t,style:{height:"100%",width:"100%"},showLoading:r,onEvents:a,opts:{renderer:"canvas"}})})}),W3=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#06B6D4","#F97316","#84CC16","#14B8A6"];function ao(e,t,n){if(t)return t;const r=(n==null?void 0:n.palette)??W3;return r[e%r.length]}function Y3(e,t,n,r){return n!=null&&n[e]?n[e]:ao(t,void 0,r)}function q3(e){return"field"in e}function $3(e){return"columns"in e}function hh(e){if(e.length===0)return e;const t=e[0].data.length;for(let n=0;n<t;n++){let r=0;for(const a of e)r+=a.data[n]??0;for(const a of e)a.data[n]=r===0?0:(a.data[n]??0)/r*100}return e}function Jc(e,t,n){var a,o;const r=t.stacking?"total":void 0;if(!t.series){const u=((a=t.y)==null?void 0:a.field)??"",c=e.map(f=>{const p=f[u];return typeof p=="number"?p:parseFloat(String(p))||0}),d=[{name:u,data:c,color:ao(0,void 0,n),stack:r}];return t.stacking==="percent"?hh(d):d}if(q3(t.series)){const u=t.series.field,c=t.series.colors,d=((o=t.y)==null?void 0:o.field)??"",f=[],p=new Map;e.forEach(x=>{const E=String(x[u]??"");p.has(E)||(f.push(E),p.set(E,[]));const _=x[d];p.get(E).push(typeof _=="number"?_:parseFloat(String(_))||0)});const g=f.map((x,E)=>({name:x,data:p.get(x),color:Y3(x,E,c,n),stack:r}));return t.stacking==="percent"?hh(g):g}if($3(t.series)){const u=t.series.columns.map((c,d)=>{const f=e.map(p=>{const g=p[c.field];return typeof g=="number"?g:parseFloat(String(g))||0});return{name:c.name??c.field,data:f,color:ao(d,c.color,n),opacity:c.opacity,style:c.style,gradient:c.gradient,stack:r,chartType:c.type,yAxisIndex:c.axis==="right"?1:c.axis==="left"?0:void 0}});return t.stacking==="percent"?hh(u):u}return[]}function V3(e){return e.replace(/'/g,"''").replace(/%Y/g,"yyyy").replace(/%y/g,"yy").replace(/%m/g,"MM").replace(/%b/g,"MMM").replace(/%B/g,"MMMM").replace(/%d/g,"dd").replace(/%H/g,"HH").replace(/%I/g,"hh").replace(/%M/g,"mm").replace(/%S/g,"ss").replace(/%p/g,"a").replace(/%P/g,"a")}function uE(e){const t=Math.floor(e.getMonth()/3)+1,n=e.getFullYear().toString().slice(-2);return`Q${t} '${n}`}function Q3(e){if(e.length<2)return"MMM dd, yyyy";const t=e.map(c=>c.getTime()).sort((c,d)=>c-d),n=t[0],r=t[t.length-1],a=(r-n)/(1e3*60*60*24);return a<2?"MMM dd, h:mm a":a<=90||(r-n)/(t.length-1)/(1e3*60*60*24)<28?"MMM dd":a<=730?"MMM yyyy":"yyyy"}function G3(e){if(e.length<2)return"MMM dd, yyyy";const t=e.map(r=>r.getTime()).sort((r,a)=>r-a),n=(t[t.length-1]-t[0])/((t.length-1)*864e5);return n<1?"MMM dd, yyyy h:mm a":n<28?"MMM dd, yyyy":"MMM yyyy"}function Zc(e,t){const n=new Set,r=e.filter(u=>{const c=u[t.field];return n.has(c)?!1:(n.add(c),!0)});if(t.type!=="temporal")return r.map(u=>String(u[t.field]??""));const a=[];for(const u of r){const c=u[t.field];if(typeof c=="string")try{a.push(Mc(c))}catch{}}const o=a.length>0?G3(a):"MMM dd, yyyy";return r.map(u=>{const c=u[t.field];if(typeof c=="string")try{const d=Mc(c);return t.format==="quarter"?uE(d):pn(d,o)}catch{return String(c??"")}return String(c??"")})}function ed(e,t){const n=new Set,r=e.filter(a=>{const o=a[t.field];return n.has(o)?!1:(n.add(o),!0)});return Xu(r,t)}function Xu(e,t){let n;if(t.type==="temporal"&&!t.format){const r=[];for(const a of e){const o=a[t.field];if(typeof o=="string")try{r.push(Mc(o))}catch{}}r.length>0&&(n=Q3(r))}return e.map(r=>{const a=r[t.field];if(t.type==="temporal"&&typeof a=="string")try{const o=Mc(a);if(t.format==="quarter")return uE(o);const u=t.format?V3(t.format):n??"MMM yyyy";return pn(o,u)}catch{return String(a??"")}return String(a??"")})}function ya(e,t){if(t){if(t.includes("$"))return`$${e.toLocaleString()}`;if(t.includes("%"))return`${e.toFixed(1)}%`}return e.toLocaleString()}function X3(e){const t=e.replace("#","").match(/^([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function td(e,t){if(!t)return null;if(typeof t=="object")return{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:t.from},{offset:1,color:t.to}]};const n=X3(e);return n?{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:`rgba(${n.r}, ${n.g}, ${n.b}, 0.4)`},{offset:1,color:`rgba(${n.r}, ${n.g}, ${n.b}, 0.05)`}]}:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:e},{offset:1,color:"rgba(0,0,0,0)"}]}}function Ds(e){return((e==null?void 0:e.base)??"modern")==="modern"?{smooth:!0,barBorderRadius:[4,4,0,0],pieBorderRadius:4}:{smooth:!1,barBorderRadius:[0,0,0,0],pieBorderRadius:0}}const lE=I.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:a,theme:o,height:u=400,loading:c=!1,onCrossFilter:d,onDrillDown:f},p){var L,B,k,N,R,j;const g=os(),E=(a==null?void 0:a.series)&&"field"in a.series?ed(t,n):Xu(t,n),_=n.type==="temporal"?Zc(t,n):E,S=I.useMemo(()=>{const M={};return d&&(M.click=P=>{const F=P;if(F.componentType!=="series")return;const W=F.name;W==null||W===""||d(n.field,String(W))}),f&&(M.contextmenu=(P,F)=>{var Z,G,ee,D,ue,ae,U;const W=P;if(W.componentType!=="series")return;const V=W.name;if(V==null||V==="")return;(G=(Z=W.event)==null?void 0:Z.event)==null||G.preventDefault(),(ee=F==null?void 0:F.dispatchAction)==null||ee.call(F,{type:"hideTip"});const J=((ue=(D=W.event)==null?void 0:D.event)==null?void 0:ue.clientX)??0,K=((U=(ae=W.event)==null?void 0:ae.event)==null?void 0:U.clientY)??0;f(n.field,String(V),{x:J,y:K})}),Object.keys(M).length>0?M:void 0},[d,f,n.field]);let w,T,C;if(a){const M=Jc(t,{type:a.type,y:r?{field:r.field,type:r.type}:void 0,series:a.series,stacking:a.stacking},o),P=Ds(o);w=M.map(F=>{const W=td(F.color,F.gradient??a.gradient);return{type:"line",name:F.name,data:F.data,smooth:P.smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:F.color,type:F.style==="dashed"?"dashed":F.style==="dotted"?"dotted":"solid"},itemStyle:{color:F.color},areaStyle:W?{color:W}:void 0,stack:F.stack,...F.opacity!==void 0?{opacity:F.opacity}:{}}}),M.length>1&&(T={show:((L=a.legend)==null?void 0:L.show)!==!1,...((B=a.legend)==null?void 0:B.position)==="top"?{top:0}:((k=a.legend)==null?void 0:k.position)==="left"?{left:0,orient:"vertical"}:((N=a.legend)==null?void 0:N.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:g.textColor,fontSize:12}}),(R=a.interactions)!=null&&R.zoom&&(C=[{type:"inside",start:0,end:100},{type:"slider",start:0,end:100,bottom:0}])}else{const M=(r==null?void 0:r.field)??"";w=[{type:"line",data:t.map(F=>{const W=F[M];return typeof W=="number"?W:parseFloat(String(W))||0}),smooth:Ds(o).smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:"#3B82F6"},itemStyle:{color:"#3B82F6"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(59, 130, 246, 0.2)"},{offset:1,color:"rgba(59, 130, 246, 0)"}]}}}]}const O={tooltip:{trigger:"axis",formatter:M=>{const P=M;if(!Array.isArray(P)||P.length===0)return"";let W=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${_[P[0].dataIndex]??P[0].name}</div>`;for(const V of P)W+=`<div>${V.marker} ${V.seriesName}: ${ya(V.value,r==null?void 0:r.format)}</div>`;return W+="</div>",W}},legend:T,grid:{left:"3%",right:"4%",bottom:"10%",top:"10%",containLabel:!0},xAxis:{type:"category",data:E,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:g.textColor,fontSize:12},axisLabel:{color:g.textColor,fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:g.borderColor}},axisTick:{show:!1}},yAxis:{type:((j=a==null?void 0:a.y)==null?void 0:j.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:g.textColor,fontSize:12},axisLabel:{color:g.textColor,fontSize:12,formatter:M=>ya(M,r==null?void 0:r.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:g.splitLineColor,type:"dashed"}}},series:w,...C?{dataZoom:C}:{},animation:!0,animationDuration:300};return m.jsx(Br,{ref:p,option:O,height:u,loading:c,onEvents:S})}),cE=I.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:a,theme:o,height:u=400,loading:c=!1,horizontal:d=!1,onCrossFilter:f,activeCrossFilter:p,onDrillDown:g},x){var M,P,F,W,V,J;const E=os(),S=(a==null?void 0:a.series)&&"field"in a.series?ed(t,n):Xu(t,n),w=n.type==="temporal"?Zc(t,n):S,T=(p==null?void 0:p.field)===n.field,C=d||(a==null?void 0:a.orientation)==="horizontal",O=I.useMemo(()=>{const K={};return f&&(K.click=Z=>{const G=Z;if(G.componentType!=="series")return;const ee=G.name;ee==null||ee===""||f(n.field,String(ee))}),g&&(K.contextmenu=(Z,G)=>{var U,Ee,De,ve,ze,Ue,Le;const ee=Z;if(ee.componentType!=="series")return;const D=ee.name;if(D==null||D==="")return;(Ee=(U=ee.event)==null?void 0:U.event)==null||Ee.preventDefault(),(De=G==null?void 0:G.dispatchAction)==null||De.call(G,{type:"hideTip"});const ue=((ze=(ve=ee.event)==null?void 0:ve.event)==null?void 0:ze.clientX)??0,ae=((Le=(Ue=ee.event)==null?void 0:Ue.event)==null?void 0:Le.clientY)??0;g(n.field,String(D),{x:ue,y:ae})}),Object.keys(K).length>0?K:void 0},[f,g,n.field]),L=(a==null?void 0:a.stacking)==="percent",B=K=>L?`${K.toFixed(1)}%`:ya(K,r==null?void 0:r.format);let k,N=!1;if(a){const K=Jc(t,{type:a.type,y:r?{field:r.field,type:r.type}:void 0,series:a.series,stacking:a.stacking},o),Z=K.length>1,G=!!a.stacking;N=Z;const ee=Ds(o);k=K.map(D=>{const ue=td(D.color,D.gradient??a.gradient);return{type:"bar",name:D.name,data:T?D.data.map((ae,U)=>({value:ae,itemStyle:{opacity:S[U]===(p==null?void 0:p.value)?1:.3}})):D.data,barWidth:Z&&!G?void 0:"60%",itemStyle:{color:ue??D.color,borderRadius:ee.barBorderRadius},stack:D.stack,...D.opacity!==void 0?{opacity:D.opacity}:{}}})}else{const K=(r==null?void 0:r.field)??"",Z=t.map(ee=>{const D=ee[K];return typeof D=="number"?D:parseFloat(String(D))||0}),G=Ds(o);k=[{type:"bar",data:T?Z.map((ee,D)=>({value:ee,itemStyle:{opacity:S[D]===(p==null?void 0:p.value)?1:.3}})):Z,barWidth:"60%",itemStyle:{color:"#3B82F6",borderRadius:G.barBorderRadius},emphasis:{itemStyle:{color:"#2563EB"}}}]}const j={tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:K=>{const Z=K;if(!Array.isArray(Z)||Z.length===0)return"";const G=w[Z[0].dataIndex]??Z[0].name;if(Z.length===1){const D=Z[0];return`
70
- <div style="padding: 8px;">
71
- <div style="font-weight: 600; margin-bottom: 4px;">${G}</div>
72
- <div>${D.marker} ${(r==null?void 0:r.label)||(r==null?void 0:r.field)||D.seriesName}: ${B(D.value)}</div>
73
- </div>
74
- `}const ee=Z.map(D=>`<div>${D.marker} ${D.seriesName}: ${B(D.value)}</div>`).join("");return`
75
- <div style="padding: 8px;">
76
- <div style="font-weight: 600; margin-bottom: 4px;">${G}</div>
77
- ${ee}
78
- </div>
79
- `}},legend:N?{show:((M=a==null?void 0:a.legend)==null?void 0:M.show)!==!1,...((P=a==null?void 0:a.legend)==null?void 0:P.position)==="top"?{top:0}:((F=a==null?void 0:a.legend)==null?void 0:F.position)==="left"?{left:0,orient:"vertical"}:((W=a==null?void 0:a.legend)==null?void 0:W.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:E.textColor,fontSize:12}}:void 0,grid:{left:"3%",right:"4%",bottom:N?"15%":"10%",top:"10%",containLabel:!0},xAxis:C?{type:((V=a==null?void 0:a.y)==null?void 0:V.scale)==="log"?"log":"value",axisLabel:{color:E.textColor,fontSize:12,formatter:K=>B(K)},axisLine:{show:!1},splitLine:{lineStyle:{color:E.splitLineColor,type:"dashed"}}}:{type:"category",data:S,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:E.textColor,fontSize:12},axisLabel:{color:E.textColor,fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:E.borderColor}},axisTick:{show:!1}},yAxis:C?{type:"category",data:S,axisLabel:{color:E.textColor,fontSize:12},axisLine:{show:!1},axisTick:{show:!1}}:{type:((J=a==null?void 0:a.y)==null?void 0:J.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:E.textColor,fontSize:12},...L?{max:100}:{},axisLabel:{color:E.textColor,fontSize:12,formatter:K=>B(K)},axisLine:{show:!1},splitLine:{lineStyle:{color:E.splitLineColor,type:"dashed"}}},series:k,animation:!0,animationDuration:300};return m.jsx(Br,{ref:x,option:j,height:u,loading:c,onEvents:O})}),dE=I.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:a,theme:o,height:u=400,loading:c=!1,onCrossFilter:d,onDrillDown:f},p){var B,k,N,R,j,M;const g=os(),E=(a==null?void 0:a.series)&&"field"in a.series?ed(t,n):Xu(t,n),_=n.type==="temporal"?Zc(t,n):E,S=(a==null?void 0:a.stacking)==="percent",w=I.useMemo(()=>{const P={};return d&&(P.click=F=>{const W=F;if(W.componentType!=="series")return;const V=W.name;V==null||V===""||d(n.field,String(V))}),f&&(P.contextmenu=(F,W)=>{var G,ee,D,ue,ae,U,Ee;const V=F;if(V.componentType!=="series")return;const J=V.name;if(J==null||J==="")return;(ee=(G=V.event)==null?void 0:G.event)==null||ee.preventDefault(),(D=W==null?void 0:W.dispatchAction)==null||D.call(W,{type:"hideTip"});const K=((ae=(ue=V.event)==null?void 0:ue.event)==null?void 0:ae.clientX)??0,Z=((Ee=(U=V.event)==null?void 0:U.event)==null?void 0:Ee.clientY)??0;f(n.field,String(J),{x:K,y:Z})}),Object.keys(P).length>0?P:void 0},[d,f,n.field]);let T,C,O;if(a){const P=Jc(t,{type:a.type,y:r?{field:r.field,type:r.type}:void 0,series:a.series,stacking:a.stacking},o),F=Ds(o);T=P.map(W=>{const V=td(W.color,W.gradient??a.gradient??!0);return{type:"line",name:W.name,data:W.data,smooth:F.smooth,symbol:"none",lineStyle:{width:2,color:W.color,type:W.style==="dashed"?"dashed":W.style==="dotted"?"dotted":"solid"},itemStyle:{color:W.color},areaStyle:{color:V??W.color},stack:W.stack,...W.opacity!==void 0?{opacity:W.opacity}:{}}}),P.length>1&&(C={show:((B=a.legend)==null?void 0:B.show)!==!1,...((k=a.legend)==null?void 0:k.position)==="top"?{top:0}:((N=a.legend)==null?void 0:N.position)==="left"?{left:0,orient:"vertical"}:((R=a.legend)==null?void 0:R.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:g.textColor,fontSize:12}}),(j=a.interactions)!=null&&j.zoom&&(O=[{type:"inside",start:0,end:100},{type:"slider",start:0,end:100,bottom:0}])}else{const P=(r==null?void 0:r.field)??"";T=[{type:"line",data:t.map(W=>{const V=W[P];return typeof V=="number"?V:parseFloat(String(V))||0}),smooth:Ds(o).smooth,symbol:"none",lineStyle:{width:2,color:"#10B981"},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(16, 185, 129, 0.4)"},{offset:1,color:"rgba(16, 185, 129, 0.05)"}]}}}]}const L={tooltip:{trigger:"axis",formatter:P=>{const F=P;if(!Array.isArray(F)||F.length===0)return"";let V=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${_[F[0].dataIndex]??F[0].name}</div>`;for(const J of F){const K=S?`${J.value.toFixed(1)}%`:ya(J.value,r==null?void 0:r.format);V+=`<div>${J.marker} ${J.seriesName}: ${K}</div>`}return V+="</div>",V}},legend:C,grid:{left:"3%",right:"4%",bottom:"10%",top:"10%",containLabel:!0},xAxis:{type:"category",data:E,boundaryGap:!1,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:g.textColor,fontSize:12},axisLabel:{color:g.textColor,fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:g.borderColor}},axisTick:{show:!1}},yAxis:{type:((M=a==null?void 0:a.y)==null?void 0:M.scale)==="log"?"log":"value",name:r==null?void 0:r.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:g.textColor,fontSize:12},...S?{max:100}:{},axisLabel:{color:g.textColor,fontSize:12,formatter:P=>S?`${P}%`:ya(P,r==null?void 0:r.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:g.splitLineColor,type:"dashed"}}},series:T,...O?{dataZoom:O}:{},animation:!0,animationDuration:300};return m.jsx(Br,{ref:p,option:L,height:u,loading:c,onEvents:w})}),fE=I.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:a,theme:o,height:u=400,loading:c=!1,onCrossFilter:d,activeCrossFilter:f,onDrillDown:p},g){var C,O,L,B;const x=os(),E=(f==null?void 0:f.field)===n.field,_=I.useMemo(()=>{const k={};return d&&(k.click=N=>{const R=N;if(R.componentType!=="series")return;const j=R.name;j==null||j===""||d(n.field,String(j))}),p&&(k.contextmenu=(N,R)=>{var W,V,J,K,Z,G,ee;const j=N;if(j.componentType!=="series")return;const M=j.name;if(M==null||M==="")return;(V=(W=j.event)==null?void 0:W.event)==null||V.preventDefault(),(J=R==null?void 0:R.dispatchAction)==null||J.call(R,{type:"hideTip"});const P=((Z=(K=j.event)==null?void 0:K.event)==null?void 0:Z.clientX)??0,F=((ee=(G=j.event)==null?void 0:G.event)==null?void 0:ee.clientY)??0;p(n.field,String(M),{x:P,y:F})}),Object.keys(k).length>0?k:void 0},[d,p,n.field]),S=t.map((k,N)=>{const R=k[r.field],j=typeof R=="number"?R:parseFloat(String(R))||0;return{name:String(k[n.field]??""),value:j,itemStyle:{color:ao(N,void 0,o)}}}),w=k=>{if(r.format){if(r.format.includes("$"))return`$${k.toLocaleString()}`;if(r.format.includes("%"))return`${k.toFixed(1)}%`}return k.toLocaleString()},T={tooltip:{trigger:"item",formatter:k=>{const N=k;return`
80
- <div style="padding: 8px;">
81
- <div style="font-weight: 600; margin-bottom: 4px;">${N.name}</div>
82
- <div>${N.marker} ${r.label||r.field}: ${w(N.value)}</div>
83
- <div style="color: ${x.textColor}; font-size: 12px;">${N.percent.toFixed(1)}%</div>
84
- </div>
85
- `}},legend:{show:((C=a==null?void 0:a.legend)==null?void 0:C.show)!==!1,...((O=a==null?void 0:a.legend)==null?void 0:O.position)==="top"?{top:0}:((L=a==null?void 0:a.legend)==null?void 0:L.position)==="bottom"?{bottom:0}:((B=a==null?void 0:a.legend)==null?void 0:B.position)==="left"?{left:0,orient:"vertical",top:"center"}:{orient:"vertical",right:"5%",top:"center"},textStyle:{color:x.textColor,fontSize:12}},series:[{type:"pie",radius:["40%","70%"],center:["40%","50%"],avoidLabelOverlap:!0,itemStyle:{borderRadius:Ds(o).pieBorderRadius,borderColor:x.surfaceColor,borderWidth:2},label:{show:!1},emphasis:{label:{show:!0,fontSize:14,fontWeight:"bold"}},labelLine:{show:!1},data:S.map(k=>({...k,itemStyle:{...k.itemStyle,...E&&(f==null?void 0:f.value)!==k.name?{opacity:.3}:{}}}))}],animation:!0,animationDuration:300};return m.jsx(Br,{ref:g,option:T,height:u,loading:c,onEvents:_})}),hE=I.forwardRef(function({data:t,xAxis:n,yAxis:r,centerValue:a,chartConfig:o,theme:u,height:c=400,loading:d=!1,onCrossFilter:f,activeCrossFilter:p,onDrillDown:g},x){var B,k,N,R,j;const E=os(),_=(p==null?void 0:p.field)===n.field,S=I.useMemo(()=>{const M={};return f&&(M.click=P=>{const F=P;if(F.componentType!=="series")return;const W=F.name;W==null||W===""||f(n.field,String(W))}),g&&(M.contextmenu=(P,F)=>{var Z,G,ee,D,ue,ae,U;const W=P;if(W.componentType!=="series")return;const V=W.name;if(V==null||V==="")return;(G=(Z=W.event)==null?void 0:Z.event)==null||G.preventDefault(),(ee=F==null?void 0:F.dispatchAction)==null||ee.call(F,{type:"hideTip"});const J=((ue=(D=W.event)==null?void 0:D.event)==null?void 0:ue.clientX)??0,K=((U=(ae=W.event)==null?void 0:ae.event)==null?void 0:U.clientY)??0;g(n.field,String(V),{x:J,y:K})}),Object.keys(M).length>0?M:void 0},[f,g,n.field]),w=t.map((M,P)=>{const F=M[r.field],W=typeof F=="number"?F:parseFloat(String(F))||0;return{name:String(M[n.field]??""),value:W,itemStyle:{color:ao(P,void 0,u)}}});let T=null;if(a)if(a.field==="total"||!a.field)T=w.reduce((M,P)=>M+P.value,0);else{const M=(B=t[0])==null?void 0:B[a.field];T=typeof M=="number"?M:parseFloat(String(M))||null}const C=(M,P)=>{if(P){if(P.includes("$"))return`$${M.toLocaleString()}`;if(P.includes("%"))return`${M.toFixed(1)}%`}return M.toLocaleString()},O=T!==null?a!=null&&a.label?`{value|${C(T,(a==null?void 0:a.format)||r.format)}}
86
- {label|${a.label}}`:`{value|${C(T,(a==null?void 0:a.format)||r.format)}}`:"",L={tooltip:{trigger:"item",formatter:M=>{const P=M;return`
87
- <div style="padding: 8px;">
88
- <div style="font-weight: 600; margin-bottom: 4px;">${P.name}</div>
89
- <div>${P.marker} ${r.label||r.field}: ${C(P.value,r.format)}</div>
90
- <div style="color: ${E.textColor}; font-size: 12px;">${P.percent.toFixed(1)}%</div>
91
- </div>
92
- `}},legend:{show:((k=o==null?void 0:o.legend)==null?void 0:k.show)!==!1,...((N=o==null?void 0:o.legend)==null?void 0:N.position)==="top"?{top:0}:((R=o==null?void 0:o.legend)==null?void 0:R.position)==="bottom"?{bottom:0}:((j=o==null?void 0:o.legend)==null?void 0:j.position)==="left"?{left:0,orient:"vertical",top:"center"}:{orient:"vertical",right:"5%",top:"center"},textStyle:{color:E.textColor,fontSize:12}},series:[{type:"pie",radius:["45%","70%"],center:["40%","50%"],avoidLabelOverlap:!0,itemStyle:{borderRadius:Ds(u).pieBorderRadius,borderColor:E.surfaceColor,borderWidth:2},label:{show:T!==null,position:"center",formatter:O,rich:{value:{fontSize:22,fontWeight:"bold",color:E.textColor,lineHeight:30},label:{fontSize:12,color:E.textColor,lineHeight:20}}},emphasis:{label:{show:!0,fontSize:14,fontWeight:"bold"},scaleSize:5},labelLine:{show:!1},data:w.map(M=>({...M,itemStyle:{...M.itemStyle,..._&&(p==null?void 0:p.value)!==M.name?{opacity:.3}:{}}}))}],animation:!0,animationDuration:300};return m.jsx(Br,{ref:x,option:L,height:c,loading:d,onEvents:S})}),K3=5,J3=50;function mh(e){if(e==null)return null;const t=typeof e=="number"?e:parseFloat(String(e));return isNaN(t)?null:t}function Z3(e,t,n,r,a){return n===t?(r+a)/2:r+(e-t)/(n-t)*(a-r)}function eN(e,t,n,r){const{size:a,group:o}=r,u=(a==null?void 0:a.min)??K3,c=(a==null?void 0:a.max)??J3,d=[];for(const E of e){const _=mh(E[t]),S=mh(E[n]);if(_===null||S===null)continue;let w=null;if(a&&(w=mh(E[a.field]),w===null))continue;const T=o?String(E[o.field]??"Other"):"data";d.push({x:_,y:S,sizeVal:w,groupVal:T})}let f=1/0,p=-1/0;if(a){for(const E of d)E.sizeVal!==null&&(f=Math.min(f,E.sizeVal),p=Math.max(p,E.sizeVal));isFinite(f)||(f=0,p=0)}const g=new Map;for(const E of d){const _=g.get(E.groupVal);_?_.push(E):g.set(E.groupVal,[E])}if(g.size===0)return{series:[{name:"data",data:[],symbolSizes:a?[]:void 0}]};const x=[];for(const[E,_]of g){const S=[],w=[];for(const T of _)a&&T.sizeVal!==null?(S.push([T.x,T.y,T.sizeVal]),w.push(Z3(T.sizeVal,f,p,u,c))):S.push([T.x,T.y]);x.push({name:E,data:S,symbolSizes:a?w:void 0})}return{series:x}}function tN(e){const t=e.length;if(t<2)return null;let n=0,r=0,a=0,o=0;for(const[w,T]of e)n+=w,r+=T,a+=w*T,o+=w*w;const u=t*o-n*n;if(u===0)return null;const c=(t*a-n*r)/u,d=(r-c*n)/t,f=r/t;let p=0,g=0;for(const[w,T]of e){const C=c*w+d;p+=(T-C)**2,g+=(T-f)**2}const x=g===0?1:1-p/g,E=e.map(([w])=>w),_=Math.min(...E),S=Math.max(...E);return{slope:c,intercept:d,rSquared:x,line:[[_,c*_+d],[S,c*S+d]]}}const mE=I.forwardRef(function({data:t,xAxis:n,yAxis:r,chartConfig:a,theme:o,height:u=400,loading:c=!1},d){const f=os(),p=I.useMemo(()=>{var C,O,L;const g={size:a==null?void 0:a.size,group:a==null?void 0:a.group},{series:x}=eN(t,n.field,r.field,g),E=(B,k)=>{if(k.format){if(k.format.includes("$"))return`$${B.toLocaleString()}`;if(k.format.includes("%"))return`${B.toFixed(1)}%`}return B.toLocaleString()},_=[],S=[];x.forEach((B,k)=>{const N=ao(k,x.length===1&&typeof(a==null?void 0:a.color)=="string"?a.color:void 0,o),R=B.symbolSizes;if(_.push({type:"scatter",name:B.name,data:B.data,symbolSize:R?(j,M)=>R[M.dataIndex]??10:10,itemStyle:{color:N},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.3)"}}}),a!=null&&a.regression&&B.data.length>=2){const j=B.data.map(P=>[P[0],P[1]]),M=tN(j);if(M){_.push({type:"line",name:`${B.name} trend`,data:M.line,showSymbol:!1,lineStyle:{color:N,type:"dashed",opacity:.6,width:2},itemStyle:{color:N},tooltip:{show:!1},silent:!0});const P=[];if(a.regression.show_equation){const F=M.intercept>=0?"+":"-";P.push(`y = ${M.slope.toFixed(2)}x ${F} ${Math.abs(M.intercept).toFixed(2)}`)}if(a.regression.show_r_squared&&P.push(`R² = ${M.rSquared.toFixed(3)}`),P.length>0){const F=k*20;S.push({type:"text",left:"70%",top:`${12+F}%`,style:{text:P.join(" "),fill:N,fontSize:11,fontFamily:"monospace"}})}}}});const w=((C=a==null?void 0:a.size)==null?void 0:C.label)??((O=a==null?void 0:a.size)==null?void 0:O.field);return{tooltip:{trigger:"item",formatter:B=>{const k=B,N=k.value[0]??0,R=k.value[1]??0,j=k.value[2];let M='<div style="padding: 8px;">';return x.length>1&&(M+=`<div style="font-weight: 600; margin-bottom: 4px;">${k.seriesName}</div>`),M+=`<div>${k.marker} ${n.label||n.field}: ${E(N,n)}</div>`,M+=`<div>${k.marker} ${r.label||r.field}: ${E(R,r)}</div>`,w&&j!=null&&(M+=`<div>${k.marker} ${w}: ${j.toLocaleString()}</div>`),M+="</div>",M}},legend:x.length>1?{show:((L=a==null?void 0:a.legend)==null?void 0:L.show)!==!1,top:0,data:x.map(B=>B.name)}:void 0,grid:{left:"3%",right:"4%",bottom:"3%",top:x.length>1?"15%":"10%",containLabel:!0},xAxis:{type:"value",name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:f.textColor,fontSize:12},axisLabel:{color:f.textColor,fontSize:12,formatter:B=>E(B,n)},axisLine:{lineStyle:{color:f.borderColor}},splitLine:{lineStyle:{color:f.splitLineColor,type:"dashed"}}},yAxis:{type:"value",name:r.label,nameLocation:"middle",nameGap:50,nameTextStyle:{color:f.textColor,fontSize:12},axisLabel:{color:f.textColor,fontSize:12,formatter:B=>E(B,r)},axisLine:{show:!1},splitLine:{lineStyle:{color:f.splitLineColor,type:"dashed"}}},series:_,graphic:S.length>0?S:void 0,animation:!0,animationDuration:300}},[t,n,r,a,o,f]);return m.jsx(Br,{ref:d,option:p,height:u,loading:c})});function Gy(e,t){return e==null?"-":typeof e=="number"?t!=null&&t.includes("$")?`$${e.toLocaleString()}`:t!=null&&t.includes("%")?`${e.toFixed(1)}%`:e.toLocaleString():String(e)}function c0({data:e,columns:t,chartConfig:n,height:r=400,loading:a=!1}){var N,R,j;const[o,u]=I.useState(((N=n==null?void 0:n.sort)==null?void 0:N.field)??null),[c,d]=I.useState(((R=n==null?void 0:n.sort)==null?void 0:R.direction)??(n!=null&&n.sort?"asc":null)),[f,p]=I.useState([]),g=I.useRef([]),x=I.useMemo(()=>{let M;n!=null&&n.columns&&n.columns.length>0?M=n.columns.map(F=>({field:F.field,label:F.label??Ru(F.field),format:F.format,sticky:F.sticky??!1,stickyIndex:-1,summary:F.summary})):M=t.map(F=>({field:F.name,label:Ru(F.name),format:void 0,sticky:!1,stickyIndex:-1,summary:void 0}));let P=0;return M.map(F=>F.sticky&&P<3?{...F,stickyIndex:P++}:{...F,sticky:!1,stickyIndex:-1})},[n==null?void 0:n.columns,t]),E=I.useMemo(()=>x.filter(M=>M.sticky).length,[x]),_=I.useCallback(M=>P=>{g.current[M]=P},[]);I.useLayoutEffect(()=>{if(E===0){p([]);return}const M=()=>{var V;const F=[];let W=0;for(let J=0;J<E;J++)F.push(W),W+=((V=g.current[J])==null?void 0:V.offsetWidth)??0;p(F)};if(M(),typeof ResizeObserver>"u")return;const P=new ResizeObserver(M);for(let F=0;F<E;F++){const W=g.current[F];W&&P.observe(W)}return()=>P.disconnect()},[E,x,a]);const S=M=>{o===M?c==="asc"?d("desc"):c==="desc"?(u(null),d(null)):d("asc"):(u(M),d("asc"))},w=I.useMemo(()=>!o||!c?e:[...e].sort((M,P)=>{const F=M[o],W=P[o];if(F==null)return 1;if(W==null)return-1;let V=0;return typeof F=="number"&&typeof W=="number"?V=F-W:V=String(F).localeCompare(String(W)),c==="asc"?V:-V}),[e,o,c]),T=I.useMemo(()=>{const M=x.filter(F=>F.summary);if(M.length===0)return null;const P={};for(const F of M){const W=e.map(V=>V[F.field]).filter(V=>typeof V=="number");if(F.summary==="count"){P[F.field]=e.filter(V=>V[F.field]!=null).length;continue}if(W.length===0){P[F.field]=null;continue}switch(F.summary){case"sum":P[F.field]=W.reduce((V,J)=>V+J,0);break;case"avg":P[F.field]=W.reduce((V,J)=>V+J,0)/W.length;break;case"min":P[F.field]=Math.min(...W);break;case"max":P[F.field]=Math.max(...W);break}}return P},[e,x]),C=((j=n==null?void 0:n.summary)==null?void 0:j.label)??"Total",O=x.findIndex(M=>!M.summary);if(a)return m.jsx("div",{className:"h-full flex items-center justify-center",children:m.jsx("div",{className:"animate-pulse bg-gray-100 w-full h-full rounded"})});const L=typeof r=="number"?`${r}px`:r,B=(M,P)=>M.sticky?{position:"sticky",left:`${f[M.stickyIndex]??0}px`,zIndex:P?3:1}:{},k=M=>M.sticky&&M.stickyIndex===E-1?"shadow-[2px_0_4px_rgba(0,0,0,0.08)]":"";return m.jsxs("div",{className:"h-full overflow-auto",style:{maxHeight:L},children:[m.jsxs("table",{className:"w-full text-sm",children:[m.jsx("thead",{className:"sticky top-0 z-[2] bg-gray-50 border-b border-gray-200",children:m.jsx("tr",{children:x.map((M,P)=>m.jsx("th",{ref:M.sticky?_(M.stickyIndex):void 0,className:`px-4 py-3 text-left font-medium text-gray-600 cursor-pointer hover:bg-gray-100 select-none bg-gray-50 ${k(M)}`,style:B(M,!0),onClick:()=>S(M.field),children:m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx("span",{children:M.label}),m.jsx("span",{className:`w-4 text-center text-gray-400 ${o===M.field?"visible":"invisible"}`,children:o===M.field&&c==="asc"?"↑":"↓"})]})},M.field))})}),m.jsx("tbody",{children:w.map((M,P)=>m.jsx("tr",{className:"border-b border-gray-100 hover:bg-gray-50",children:x.map(F=>m.jsx("td",{className:`px-4 py-3 text-gray-700 bg-white ${k(F)}`,style:B(F,!1),children:Gy(M[F.field],F.format)},F.field))},P))}),T&&m.jsx("tfoot",{className:"sticky bottom-0 z-[2]",children:m.jsx("tr",{className:"border-t-2 border-gray-300 bg-gray-50 font-medium",children:x.map((M,P)=>{const F=T[M.field],W=O>=0&&P===O;return m.jsx("td",{className:`px-4 py-3 text-gray-700 bg-gray-50 ${k(M)}`,style:B(M,!1),children:W?C:F!=null?Gy(F,M.format):""},M.field)})})})]}),w.length===0&&m.jsx("div",{className:"text-center py-8 text-gray-400",children:"No data"})]})}function nN(e,t){return t!=null&&t.includes("$")?`$${e.toLocaleString()}`:t!=null&&t.includes("%")?`${e.toFixed(1)}%`:e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function rN({data:e,yAxis:t,loading:n=!1,title:r}){if(n)return m.jsx("div",{className:"h-full flex items-center justify-center",children:m.jsx("div",{className:"animate-pulse bg-gray-200 h-16 w-32 rounded"})});if(!e||e.length===0)return m.jsx("div",{className:"h-full flex items-center justify-center text-gray-400",children:"No data"});const a=e[0],o=a==null?void 0:a[t.field],u=typeof o=="number"?o:parseFloat(String(o))||0,c=nN(u,t.format),d=t.label||t.field;return m.jsxs("div",{className:"h-full flex flex-col items-center justify-center p-4",children:[m.jsx("div",{className:"text-4xl font-bold text-gray-900 tabular-nums",children:c}),(r||d)&&m.jsx("div",{className:"text-sm text-gray-500 mt-2 text-center",children:r||d})]})}const pE=I.forwardRef(function({data:t,xAxis:n,chartConfig:r,theme:a,height:o=400,loading:u=!1,onCrossFilter:c,onDrillDown:d},f){var k,N,R,j,M,P;const p=os(),x=(r==null?void 0:r.series)&&"field"in r.series?ed(t,n):Xu(t,n),E=n.type==="temporal"?Zc(t,n):x,_=I.useMemo(()=>{const F={};return c&&(F.click=W=>{const V=W;if(V.componentType!=="series")return;const J=V.name;J==null||J===""||c(n.field,String(J))}),d&&(F.contextmenu=(W,V)=>{var ee,D,ue,ae,U,Ee,De;const J=W;if(J.componentType!=="series")return;const K=J.name;if(K==null||K==="")return;(D=(ee=J.event)==null?void 0:ee.event)==null||D.preventDefault(),(ue=V==null?void 0:V.dispatchAction)==null||ue.call(V,{type:"hideTip"});const Z=((U=(ae=J.event)==null?void 0:ae.event)==null?void 0:U.clientX)??0,G=((De=(Ee=J.event)==null?void 0:Ee.event)==null?void 0:De.clientY)??0;d(n.field,String(K),{x:Z,y:G})}),Object.keys(F).length>0?F:void 0},[c,d,n.field]),S=Jc(t,{series:r.series},a),w=(k=r.axes)==null?void 0:k.left,T=(N=r.axes)==null?void 0:N.right,C=[];C.push({type:(w==null?void 0:w.scale)==="log"?"log":"value",name:w==null?void 0:w.label,nameLocation:"middle",nameGap:80,nameTextStyle:{color:p.textColor,fontSize:12},axisLabel:{color:p.textColor,fontSize:12,formatter:F=>ya(F,w==null?void 0:w.format)},axisLine:{show:!1},splitLine:{lineStyle:{color:p.splitLineColor,type:"dashed"}}}),T&&C.push({type:T.scale==="log"?"log":"value",name:T.label,nameLocation:"middle",nameGap:60,nameTextStyle:{color:p.textColor,fontSize:12},axisLabel:{color:p.textColor,fontSize:12,formatter:F=>ya(F,T.format)},axisLine:{show:!1},splitLine:{show:!1}});const O=Ds(a),L=S.map(F=>{const W=td(F.color,F.gradient??r.gradient),V=F.chartType??"bar",J={name:F.name,data:F.data,yAxisIndex:F.yAxisIndex??0,itemStyle:{color:W??F.color},...F.opacity!==void 0?{opacity:F.opacity}:{}};return V==="line"?{...J,type:"line",smooth:O.smooth,symbol:"circle",symbolSize:6,lineStyle:{width:2,color:F.color,type:F.style==="dashed"?"dashed":F.style==="dotted"?"dotted":"solid"}}:V==="area"?{...J,type:"line",smooth:O.smooth,symbol:"none",lineStyle:{width:2,color:F.color},areaStyle:{color:W??F.color}}:{...J,type:"bar",barWidth:"60%",itemStyle:{color:W??F.color,borderRadius:O.barBorderRadius}}}),B={tooltip:{trigger:"axis",axisPointer:{type:"cross"},formatter:F=>{const W=F;if(!Array.isArray(W)||W.length===0)return"";let J=`<div style="padding: 8px;"><div style="font-weight: 600; margin-bottom: 4px;">${E[W[0].dataIndex]??W[0].name}</div>`;for(const K of W){const Z=S.find(ee=>ee.name===K.seriesName),G=(Z==null?void 0:Z.yAxisIndex)===1?T:w;J+=`<div>${K.marker} ${K.seriesName}: ${ya(K.value,G==null?void 0:G.format)}</div>`}return J+="</div>",J}},legend:{show:((R=r.legend)==null?void 0:R.show)!==!1,...((j=r.legend)==null?void 0:j.position)==="top"?{top:0}:((M=r.legend)==null?void 0:M.position)==="left"?{left:0,orient:"vertical"}:((P=r.legend)==null?void 0:P.position)==="right"?{right:0,orient:"vertical"}:{bottom:0},textStyle:{color:p.textColor,fontSize:12}},grid:{left:"3%",right:T?"8%":"4%",bottom:"15%",top:"10%",containLabel:!0},xAxis:{type:"category",data:x,name:n.label,nameLocation:"middle",nameGap:30,nameTextStyle:{color:p.textColor,fontSize:12},axisLabel:{color:p.textColor,fontSize:12,hideOverlap:!0},axisLine:{lineStyle:{color:p.borderColor}},axisTick:{show:!1}},yAxis:C,series:L,animation:!0,animationDuration:300};return m.jsx(Br,{ref:f,option:B,height:o,loading:u,onEvents:_})}),gE=I.forwardRef(function({data:t,chartConfig:n,height:r=400,loading:a=!1},o){const u=I.useMemo(()=>{var C,O;const c=n.x.field,d=n.y.field,f=n.value.field,p=[...new Set(t.map(L=>String(L[c]??"")))],g=[...new Set(t.map(L=>String(L[d]??"")))],x=[];let E=1/0,_=-1/0;for(const L of t){const B=String(L[c]??""),k=String(L[d]??""),N=Number(L[f]??0),R=p.indexOf(B),j=g.indexOf(k);R>=0&&j>=0&&(x.push([R,j,N]),N<E&&(E=N),N>_&&(_=N))}E===1/0&&(E=0),_===-1/0&&(_=0);const S=((C=n.color_range)==null?void 0:C.min)??"#EBF5FB",w=((O=n.color_range)==null?void 0:O.max)??"#1A5276",T=n.show_values??!0;return{tooltip:{position:"top",formatter:L=>{const B=L,k=p[B.value[0]]??"",N=g[B.value[1]]??"",R=B.value[2],j=n.value.label??f;return`${k}, ${N}<br/>${j}: <b>${R}</b>`}},grid:{left:"3%",right:"8%",bottom:"10%",top:"6%",containLabel:!0},xAxis:{type:"category",data:p,name:n.x.label,splitArea:{show:!0}},yAxis:{type:"category",data:g,name:n.y.label,splitArea:{show:!0}},visualMap:{min:E,max:_,calculable:!0,orient:"horizontal",left:"center",bottom:"0%",inRange:{color:[S,w]}},series:[{type:"heatmap",data:x,label:{show:T},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}},[t,n]);return m.jsx(Br,{ref:o,option:u,height:r,loading:a})}),yE=I.forwardRef(function({data:t,chartConfig:n,theme:r,height:a=400,loading:o=!1},u){const c=os(),d=I.useMemo(()=>{var S;const f=n.stage.field,p=n.value.field,g=n.show_conversion??!0,x=t.map(w=>({name:String(w[f]??""),value:Number(w[p]??0)})),E={};for(let w=1;w<x.length;w++){const T=x[w-1],C=x[w];if(T&&C&&T.value>0){const O=(C.value/T.value*100).toFixed(1);E[C.name]=`${O}% of ${T.name}`}}const _=n.color??((S=r==null?void 0:r.palette)==null?void 0:S[0])??"#3B82F6";return{tooltip:{trigger:"item",formatter:w=>{const T=w;let C=`${T.name}: <b>${T.value.toLocaleString()}</b>`;return g&&E[T.name]&&(C+=`<br/><span style="color:${c.textColor}">${E[T.name]}</span>`),C}},series:[{type:"funnel",left:"10%",top:"10%",bottom:"10%",width:"80%",sort:"descending",gap:2,label:{show:!0,position:"inside",formatter:w=>{const T=w;return`${T.name}
93
- ${T.value.toLocaleString()}`}},itemStyle:{borderColor:c.surfaceColor,borderWidth:1,color:w=>{const C=1-w.dataIndex*.15;return`${_}${Math.round(Math.max(C,.3)*255).toString(16).padStart(2,"0")}`}},data:x}]}},[t,n,r,c]);return m.jsx(Br,{ref:u,option:d,height:a,loading:o})}),bE=I.forwardRef(function({data:t,chartConfig:n,height:r=400,loading:a=!1},o){const u=os(),c=I.useMemo(()=>{var O,L,B;const d=n.category.field,f=n.value.field,p=n.total_field,g=((O=n.colors)==null?void 0:O.increase)??"#22C55E",x=((L=n.colors)==null?void 0:L.decrease)??"#EF4444",E=((B=n.colors)==null?void 0:B.total)??"#3B82F6",_=[],S=[],w=[],T=[];let C=0;for(const k of t){const N=String(k[d]??""),R=Number(k[f]??0),j=p?!!k[p]:!1;_.push(N),j?(S.push(Math.min(0,R)),w.push(Math.abs(R)),T.push(E),C=R):(R>=0?(S.push(C),w.push(R),T.push(g)):(S.push(C+R),w.push(Math.abs(R)),T.push(x)),C+=R)}return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:k=>{var F,W;const N=k;if(!N[0])return"";const R=N[0].dataIndex,j=Number(((F=t[R])==null?void 0:F[f])??0),P=!(p?!!((W=t[R])!=null&&W[p]):!1)&&j>=0?"+":"";return`${N[0].name}<br/><b>${P}${j.toLocaleString()}</b>`}},grid:{left:"3%",right:"4%",bottom:"10%",containLabel:!0},xAxis:{type:"category",data:_,axisLabel:{color:u.textColor,rotate:_.length>6?30:0},axisLine:{lineStyle:{color:u.borderColor}}},yAxis:{type:"value",axisLabel:{color:u.textColor},splitLine:{lineStyle:{color:u.splitLineColor,type:"dashed"}}},series:[{type:"bar",stack:"waterfall",data:S,itemStyle:{color:"transparent",borderColor:"transparent"},emphasis:{itemStyle:{color:"transparent",borderColor:"transparent"}},tooltip:{show:!1}},{type:"bar",stack:"waterfall",data:w.map((k,N)=>({value:k,itemStyle:{color:T[N]}})),label:{show:!0,position:"top",formatter:k=>{var P,F;const N=k,R=Number(((P=t[N.dataIndex])==null?void 0:P[f])??0);return(p?!!((F=t[N.dataIndex])!=null&&F[p]):!1)?R.toLocaleString():`${R>=0?"+":""}${R.toLocaleString()}`}}}]}},[t,n,u]);return m.jsx(Br,{ref:o,option:c,height:r,loading:a})}),xE=I.forwardRef(function({data:t,chartConfig:n,theme:r,height:a=400,loading:o=!1},u){const c=os(),d=I.useMemo(()=>{var w;const f=n.value.field,p=n.min??0,g=n.max??100,x=n.format??"",E=t[0]?Number(t[0][f]??0):0,_=Math.min(Math.max(E,p),g);let S;if(n.thresholds&&n.thresholds.length>0){const T=g-p||1;S=n.thresholds.map(C=>[(C.value-p)/T,C.color])}else S=[[1,((w=r==null?void 0:r.palette)==null?void 0:w[0])??"#3B82F6"]];return{series:[{type:"gauge",min:p,max:g,progress:{show:!0,width:18},axisLine:{lineStyle:{width:18,color:S}},axisTick:{show:!1},splitLine:{length:10,lineStyle:{width:2,color:c.textColor}},axisLabel:{distance:25,color:c.textColor,fontSize:12},pointer:{itemStyle:{color:"auto"}},anchor:{show:!0,showAbove:!0,size:20,itemStyle:{borderWidth:8}},title:{show:!1},detail:{valueAnimation:!0,fontSize:28,offsetCenter:[0,"70%"],formatter:`{value}${x}`},data:[{value:_}]}]}},[t,n,r,c]);return m.jsx(Br,{ref:u,option:d,height:a,loading:o})});function EE({onRefresh:e,onExportCSV:t,onExportPNG:n,onExportSVG:r,onExportPDF:a,isRefreshing:o=!1,hideImageExport:u=!1}){const[c,d]=I.useState(!1),f=I.useRef(null);return I.useEffect(()=>{const p=g=>{f.current&&!f.current.contains(g.target)&&d(!1)};return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]),m.jsxs("div",{className:"relative",ref:f,children:[m.jsx("button",{onClick:()=>d(!c),className:"p-1.5 hover:bg-black/5 rounded transition-colors",style:{color:"var(--yc-color-text-muted)"},title:"Chart actions",children:m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})})}),c&&m.jsxs("div",{className:"absolute right-0 top-full mt-1 w-40 rounded-md shadow-lg z-50 py-1",style:{backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[m.jsxs("button",{onClick:()=>{e(),d(!1)},disabled:o,className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2 disabled:opacity-50",style:{color:"var(--yc-color-text-secondary)"},children:[m.jsx("svg",{className:`w-4 h-4 ${o?"animate-spin":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]}),m.jsx("div",{className:"border-t my-1",style:{borderColor:"var(--yc-color-border)"}}),m.jsxs("button",{onClick:()=>{t(),d(!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text-secondary)"},children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Export CSV"]}),!u&&m.jsxs(m.Fragment,{children:[m.jsxs("button",{onClick:()=>{n(),d(!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text-secondary)"},children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Export PNG"]}),m.jsxs("button",{onClick:()=>{r(),d(!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text-secondary)"},children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})}),"Export SVG"]}),a&&m.jsxs("button",{onClick:()=>{a(),d(!1)},className:"w-full text-left px-3 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text-secondary)"},children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),"Export PDF"]})]})]})]})}function vE({x:e,y:t,targetChartTitle:n,onDrillDown:r,onClose:a}){const o=I.useRef(null);I.useEffect(()=>{const p=x=>{o.current&&!o.current.contains(x.target)&&a()},g=x=>{x.key==="Escape"&&a()};return document.addEventListener("mousedown",p),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",g)}},[a]);const u=200,c=48,d=Math.min(e,window.innerWidth-u-8),f=Math.min(t,window.innerHeight-c-8);return m.jsx("div",{ref:o,className:"fixed z-[9999] rounded-lg shadow-lg py-1 min-w-[200px]",style:{left:d,top:f,backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:m.jsxs("button",{className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},onClick:r,children:["Drill down to ",n]})})}const sN={connection_error:{title:"Database connection failed",hint:"Check your connection configuration"},timeout:{title:"Query timed out",hint:"Try adding filters or optimizing your SQL"},not_found:{title:"Not found",hint:"Check that the chart and model exist"},validation_error:{title:"Configuration error",hint:"Check your chart YAML configuration"}};function jc({isLoading:e,error:t,data:n,hasActiveFilters:r,onRetry:a,children:o}){if(t){const u=t.errorType?sN[t.errorType]:void 0;return m.jsx("div",{className:"h-full flex items-center justify-center p-6",children:m.jsxs("div",{className:"text-center max-w-sm",children:[m.jsx("div",{className:"w-10 h-10 mx-auto mb-3 rounded-full flex items-center justify-center",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-danger) 10%, transparent)"},children:m.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"var(--yc-color-danger)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),m.jsx("p",{className:"text-sm font-medium",style:{color:"var(--yc-color-text)"},children:(u==null?void 0:u.title)??"Failed to load chart"}),m.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-secondary)"},children:t.message}),(u==null?void 0:u.hint)&&m.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:u.hint}),a&&m.jsx("button",{onClick:a,className:"mt-3 px-3 py-1.5 text-xs font-medium rounded transition-colors hover:opacity-80",style:{color:"var(--yc-color-primary)"},"aria-label":"Retry",children:"Retry"})]})})}return e&&!n?m.jsx("div",{className:"h-full animate-pulse rounded",style:{backgroundColor:"var(--yc-color-surface-hover)"}}):n&&n.length===0?m.jsx("div",{className:"h-full flex items-center justify-center p-6",children:m.jsxs("div",{className:"text-center",children:[m.jsx("div",{className:"w-10 h-10 mx-auto mb-3 rounded-full flex items-center justify-center",style:{backgroundColor:"var(--yc-color-surface-hover)"},children:m.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:"var(--yc-color-text-muted)"},children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})})}),m.jsx("p",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"No data matches your filters"}),r&&m.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:"Try adjusting your filters"})]})}):m.jsx(m.Fragment,{children:o})}const aN={day:{label:"Date",format:"%b %d, %Y"},week:{label:"Week Starting",format:"%b %d"},month:{label:"Month",format:"%b '%y"},quarter:{label:"Quarter",format:"quarter"},year:{label:"Year",format:"%Y"}};function ph(e,t){if(!t)return e.toLocaleString();const n=t.decimals??0;switch(t.type){case"currency":return new Intl.NumberFormat("en-US",{style:"currency",currency:t.currency||"USD",minimumFractionDigits:n,maximumFractionDigits:n}).format(e);case"percent":return new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:n,maximumFractionDigits:n}).format(e/100);default:return e.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n})}}function iN(e,t){const n=e>=0?"+":"";return t==="percent_change"?`${n}${e.toFixed(1)}%`:`${n}${e.toLocaleString()}`}function oN({chartName:e,drillParams:t}){var K,Z,G,ee;const{data:n,isLoading:r}=sx(e),{data:a,isLoading:o,error:u}=ix(e),{data:c}=ii(),d=F0(),f=Qe(D=>D.getEffectiveFilters),p=I.useRef(null),[g,x]=I.useState("chart"),[E,_]=I.useState(!1),S=(()=>{try{const D=sessionStorage.getItem("yamchart-last-dashboard");if(D)return JSON.parse(D)}catch{}return null})(),w=t==null?void 0:t._from,T=t?Object.fromEntries(Object.entries(t).filter(([D])=>!D.startsWith("_"))):{},C=Object.keys(T).length>0,O=Object.entries(T).map(([D,ue])=>`${D}: ${ue}`).join(", "),B=f(e).granularity,k=B?aN[B]:void 0,[N,R]=I.useState(null),j=I.useCallback((D,ue,ae)=>{var U;(U=n==null?void 0:n.drillDown)!=null&&U.chart&&R({x:ae.x,y:ae.y,field:D,value:ue})},[(K=n==null?void 0:n.drillDown)==null?void 0:K.chart]),M=I.useCallback(()=>{var ae,U;if(!N||!((ae=n==null?void 0:n.drillDown)!=null&&ae.chart))return;const D=n.drillDown.field??((U=n.chart.x)==null?void 0:U.field)??N.field,ue=new URLSearchParams({[D]:N.value,_from:e});window.location.hash=`/charts/${n.drillDown.chart}?${ue.toString()}`,R(null)},[N,n,e]),P=()=>{!a||!n||Kc(a.rows,a.columns,n.name||e)},F=()=>{var ue;const D=(ue=p.current)==null?void 0:ue.getDataURL("png");D&&n&&Fc(D,`${n.name||e}.png`)};if(r)return m.jsx("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"Loading chart..."});if(!n)return m.jsxs("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:["Chart not found: ",e]});const W=(Z=n.drillDown)!=null&&Z.chart?j:void 0,V=k?{...n.chart.x,label:k.label,format:k.format}:n.chart.x,J=()=>{var D,ue;if(!a)return m.jsx("div",{className:"h-full animate-pulse",style:{background:"var(--yc-color-background)"}});if(g==="table"&&a)return m.jsx(c0,{data:a.rows,columns:a.columns,height:"100%",loading:o});switch(n.chart.type){case"line":return n.chart.x&&(n.chart.y||n.chart.series)?m.jsx(lE,{ref:p,data:a.rows,columns:a.columns,xAxis:V,yAxis:n.chart.y,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o,onDrillDown:W}):null;case"bar":return n.chart.x&&(n.chart.y||n.chart.series)?m.jsx(cE,{ref:p,data:a.rows,xAxis:V,yAxis:n.chart.y,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o,onDrillDown:W}):null;case"area":return n.chart.x&&(n.chart.y||n.chart.series)?m.jsx(dE,{ref:p,data:a.rows,xAxis:V,yAxis:n.chart.y,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o,onDrillDown:W}):null;case"pie":return n.chart.x&&n.chart.y?m.jsx(fE,{ref:p,data:a.rows,xAxis:n.chart.x,yAxis:n.chart.y,theme:c==null?void 0:c.theme,loading:o,onDrillDown:W}):null;case"donut":return n.chart.x&&n.chart.y?m.jsx(hE,{ref:p,data:a.rows,xAxis:n.chart.x,yAxis:n.chart.y,centerValue:n.chart.centerValue,theme:c==null?void 0:c.theme,loading:o,onDrillDown:W}):null;case"scatter":return n.chart.x&&n.chart.y?m.jsx(mE,{ref:p,data:a.rows,xAxis:n.chart.x,yAxis:n.chart.y,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o}):null;case"combo":return n.chart.x?m.jsx(pE,{ref:p,data:a.rows,xAxis:V,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o,onDrillDown:W}):null;case"heatmap":return m.jsx(gE,{ref:p,data:a.rows,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o});case"funnel":return m.jsx(yE,{ref:p,data:a.rows,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o});case"waterfall":return m.jsx(bE,{ref:p,data:a.rows,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o});case"gauge":return m.jsx(xE,{ref:p,data:a.rows,chartConfig:n.chart,theme:c==null?void 0:c.theme,loading:o});case"table":return m.jsx(c0,{data:a.rows,columns:a.columns,chartConfig:n.chart,height:"100%",loading:o});case"kpi":{const ae=n.chart;if(!((D=ae.value)!=null&&D.field)||!a.rows[0])return m.jsx("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:"No data available"});const U=a.rows[0],Ee=U[ae.value.field],De=ph(Ee,ae.format);let ve=null,ze="percent_change",Ue,Le,Ge;if(a.comparison)ve=a.comparison.change,ze=a.comparison.changeType,Ue=a.comparison.currentPeriodLabel,Le=a.comparison.previousPeriodLabel,Ge=ph(a.comparison.previousValue,ae.format);else if((ue=ae.comparison)!=null&&ue.enabled&&ae.comparison.field){const Fe=U[ae.comparison.field];ze=ae.comparison.type,Fe&&Fe!==0&&(ve=ze==="percent_change"?(Ee-Fe)/Fe*100:Ee-Fe,Ge=ph(Fe,ae.format))}return m.jsxs("div",{className:"h-full flex flex-col items-center justify-center p-8",children:[m.jsxs("div",{className:"text-6xl font-bold tabular-nums",style:{color:"var(--yc-color-text)"},children:[De,ae.unit&&m.jsx("span",{className:"text-3xl font-normal ml-2",style:{color:"var(--yc-color-text-secondary)"},children:ae.unit})]}),Ue&&m.jsx("div",{className:"text-sm mt-2",style:{color:"var(--yc-color-text-secondary)"},children:Ue}),ve!==null&&m.jsxs("div",{className:"mt-4 flex items-center gap-3",children:[m.jsx("span",{className:"text-sm font-medium px-2 py-0.5 rounded",style:ve>=0?{backgroundColor:"color-mix(in srgb, var(--yc-color-success) 15%, transparent)",color:"var(--yc-color-success)"}:{backgroundColor:"color-mix(in srgb, var(--yc-color-danger) 15%, transparent)",color:"var(--yc-color-danger)"},children:iN(ve,ze)}),Ge&&m.jsxs("span",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:["vs ",Ge]}),Le&&m.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["(",Le,")"]})]})]})}default:return m.jsxs("div",{className:"h-full flex items-center justify-center",style:{color:"var(--yc-color-text-secondary)"},children:['Chart type "',n.chart.type,'" not yet implemented']})}};return m.jsx(tm,{fallback:(D,ue)=>m.jsx("div",{className:"flex items-center justify-center h-full p-8",children:m.jsxs("div",{className:"text-center",children:[m.jsx("p",{className:"text-sm font-medium",style:{color:"var(--yc-color-danger)"},children:"Failed to render chart"}),m.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-secondary)"},children:D.message}),m.jsx("button",{onClick:ue,className:"mt-2 text-xs hover:opacity-80",style:{color:"var(--yc-color-primary)"},children:"Retry"})]})}),resetKey:e,children:m.jsxs("div",{className:"h-full flex flex-col",children:[m.jsxs("div",{className:"px-6 pt-4 pb-3 space-y-3",children:[!w&&S&&m.jsxs("div",{className:"flex items-center gap-1.5 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),m.jsx("a",{href:`#/dashboards/${S.name}`,className:"hover:underline",style:{color:"var(--yc-color-primary)"},children:S.title})]}),w&&m.jsxs("div",{className:"flex items-center gap-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[m.jsx("button",{onClick:()=>{window.location.hash=`/charts/${w}`},className:"hover:underline",style:{color:"var(--yc-color-primary)"},children:w}),m.jsx("span",{children:"/"}),m.jsx("span",{style:{color:"var(--yc-color-text)"},className:"font-medium",children:n.title}),O&&m.jsxs("span",{children:["(",O,")"]})]}),m.jsxs("div",{className:"flex items-start justify-between gap-4",children:[m.jsxs("div",{children:[m.jsx("h1",{className:"text-xl font-semibold",style:{color:"var(--yc-color-text)",fontFamily:"var(--yc-font-heading)"},children:n.title}),n.description&&m.jsx("p",{className:"text-sm mt-1",style:{color:"var(--yc-color-text-secondary)"},children:n.description})]}),m.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[m.jsx("button",{onClick:()=>d(e),className:"p-2 rounded hover:bg-black/5 transition-colors",style:{color:"var(--yc-color-text-secondary)"},title:"Refresh",children:m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),m.jsx(I3,{resourceType:"chart",resourceName:e})]})]}),n.parameters.length>0&&m.jsx(iE,{parameters:n.parameters,chartName:e}),C&&m.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[m.jsx("span",{className:"text-xs font-medium",style:{color:"var(--yc-color-text-secondary)"},children:"Filtered:"}),Object.entries(T).map(([D,ue])=>m.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs rounded-full",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"},children:[D,": ",ue]},D))]})]}),m.jsx("div",{className:"flex-1 min-h-0 px-6",children:m.jsx("div",{className:"h-full rounded-lg overflow-hidden",style:{background:"var(--yc-color-surface)",border:"var(--yc-card-border)",boxShadow:"var(--yc-shadow)",borderRadius:"var(--yc-radius)"},children:m.jsx(jc,{isLoading:o,error:u,data:a==null?void 0:a.rows,onRetry:()=>d(e),children:J()})})}),m.jsx("div",{className:"px-6 pb-2",children:m.jsx(R3,{rowCount:a==null?void 0:a.meta.rowCount,durationMs:a==null?void 0:a.meta.durationMs,cached:a==null?void 0:a.meta.cached,view:g,onToggleView:x,onExportCSV:P,onExportPNG:F,onShowSql:()=>_(!E)})}),C&&a&&m.jsx("div",{className:"px-6 pb-4",children:m.jsx(z3,{data:a.rows,columns:a.columns,drillDownColumns:(G=n.drillDown)==null?void 0:G.columns,filterDisplay:O,chartName:e})}),N&&((ee=n.drillDown)==null?void 0:ee.chart)&&m.jsx(vE,{x:N.x,y:N.y,targetChartTitle:n.drillDown.chart,onDrillDown:M,onClose:()=>R(null)}),m.jsx(F3,{isOpen:E,onClose:()=>_(!1),compiledSql:a==null?void 0:a.meta.compiledSql,modelName:e,durationMs:a==null?void 0:a.meta.durationMs,rowCount:a==null?void 0:a.meta.rowCount,cached:a==null?void 0:a.meta.cached})]})})}function uN(e=50){const t=[],n=[];return{push(r){t.push(r),t.length>e&&t.shift(),n.length=0},undo(){if(t.length===0)return null;const r=t.pop();return n.push(r),r},redo(){if(n.length===0)return null;const r=n.pop();return t.push(r),r},canUndo(){return t.length>0},canRedo(){return n.length>0},clear(){t.length=0,n.length=0}}}const TE=I.createContext(null);function lN({children:e}){const[t,n]=I.useState(!1),[r,a]=I.useState(null),[o,u]=I.useState(null),[c,d]=I.useState(null),f=I.useRef(uN()),[p,g]=I.useState(!1),[x,E]=I.useState(!1),_=r!==null,S=I.useMemo(()=>r||o,[r,o]),w=I.useCallback(N=>{u(N)},[]),T=I.useCallback(N=>{if(N===null){a(null);return}const R=r||o;R&&f.current.push(R),a(N),g(f.current.canUndo()),E(f.current.canRedo())},[r,o]),C=I.useCallback(()=>{const N=f.current.undo();N&&(a(N),g(f.current.canUndo()),E(f.current.canRedo()))},[]),O=I.useCallback(()=>{const N=f.current.redo();N&&(a(N),g(f.current.canUndo()),E(f.current.canRedo()))},[]);I.useEffect(()=>{f.current.clear(),g(!1),E(!1),d(null)},[t]),I.useEffect(()=>{if(!t)return;const N=R=>{const j=R.metaKey||R.ctrlKey;j&&R.key==="z"&&!R.shiftKey&&(R.preventDefault(),C()),j&&R.key==="z"&&R.shiftKey&&(R.preventDefault(),O())};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[t,C,O]);const L=I.useCallback(N=>{var V;const R=r||o;if(!R)return;const M=N.type==="chart"&&((V=N.ref)==null?void 0:V.toLowerCase().includes("kpi"))?3:6,F={height:100,widgets:[{...N,cols:M}]},W={...R,rows:[...R.rows,F]};T(W)},[r,o,T]),B=I.useCallback((N,R)=>{const j=r||o;if(!j)return;const M=j.rows.map((F,W)=>{if(W!==N)return F;const V=F.widgets.filter((J,K)=>K!==R);return{...F,widgets:V}}).filter(F=>F.widgets.length>0),P={...j,rows:M};T(P)},[r,o,T]),k=I.useCallback((N,R,j)=>{const M=r||o;if(!M)return;const P=M.rows.map((W,V)=>{if(V!==N)return W;const J=W.widgets.map((K,Z)=>Z!==R?K:{...K,...j});return{...W,widgets:J}}),F={...M,rows:P};T(F)},[r,o,T]);return m.jsx(TE.Provider,{value:{isEditing:t,setIsEditing:n,pendingLayout:r,setPendingLayout:T,hasChanges:_,originalLayout:o,setOriginalLayout:w,currentLayout:S,addWidget:L,removeWidget:B,updateWidget:k,pendingFilters:c,setPendingFilters:d,undo:C,redo:O,canUndo:p,canRedo:x},children:e})}function mo(){const e=I.useContext(TE);if(!e)throw new Error("useEditMode must be used within EditModeProvider");return e}function po(e){const{margin:t,containerPadding:n,containerWidth:r,cols:a}=e;return(r-t[0]*(a-1)-n[0]*2)/a}function io(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function iu(e,t,n,r,a,o,u){const{margin:c,containerPadding:d,rowHeight:f}=e,p=po(e);let g,x,E,_;if(u?(g=Math.round(u.width),x=Math.round(u.height)):(g=io(r,p,c[0]),x=io(a,f,c[1])),o?(E=Math.round(o.top),_=Math.round(o.left)):u?(E=Math.round(u.top),_=Math.round(u.left)):(E=Math.round((f+c[1])*n+d[1]),_=Math.round((p+c[0])*t+d[0])),!o&&!u){if(Number.isFinite(r)){const w=Math.round((p+c[0])*(t+r)+d[0])-_-g;w!==c[0]&&(g+=w-c[0])}if(Number.isFinite(a)){const w=Math.round((f+c[1])*(n+a)+d[1])-E-x;w!==c[1]&&(x+=w-c[1])}}return{top:E,left:_,width:g,height:x}}function cN(e,t,n,r,a){const{margin:o,containerPadding:u,cols:c,rowHeight:d,maxRows:f}=e,p=po(e);let g=Math.round((n-u[0])/(p+o[0])),x=Math.round((t-u[1])/(d+o[1]));return g=Bc(g,0,c-r),x=Bc(x,0,f-a),{x:g,y:x}}function gc(e,t,n){const{margin:r,containerPadding:a,rowHeight:o}=e,u=po(e),c=Math.round((n-a[0])/(u+r[0])),d=Math.round((t-a[1])/(o+r[1]));return{x:c,y:d}}function dN(e,t,n){const{margin:r,rowHeight:a}=e,o=po(e),u=Math.max(1,Math.round((t+r[0])/(o+r[0]))),c=Math.max(1,Math.round((n+r[1])/(a+r[1])));return{w:u,h:c}}function Bc(e,t,n){return Math.max(Math.min(e,n),t)}function nm(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function Ka(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0&&nm(r,t))return r}}function wE(e,t){return e.filter(n=>nm(n,t))}function fN(e,t){return t==="horizontal"?SE(e):t==="vertical"||t==="wrap"?d0(e):[...e]}function d0(e){return[...e].sort((t,n)=>t.y!==n.y?t.y-n.y:t.x-n.x)}function SE(e){return[...e].sort((t,n)=>t.x!==n.x?t.x-n.x:t.y-n.y)}function nd(e){let t=0;for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0){const a=r.y+r.h;a>t&&(t=a)}}return t}function Pa(e,t){for(let n=0;n<e.length;n++){const r=e[n];if(r!==void 0&&r.i===t)return r}}function rd(e){return e.filter(t=>t.static===!0)}function ri(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function ba(e){const t=new Array(e.length);for(let n=0;n<e.length;n++){const r=e[n];r!==void 0&&(t[n]=ri(r))}return t}function hN(e,t){const n=new Array(e.length);for(let r=0;r<e.length;r++){const a=e[r];a!==void 0&&(t.i===a.i?n[r]=t:n[r]=a)}return n}function mN(e,t,n){let r=Pa(e,t);return r?(r=n(ri(r)),[hN(e,r),r]):[[...e],null]}function rm(e,t){const n=rd(e);for(let r=0;r<e.length;r++){const a=e[r];if(a!==void 0)if(a.x+a.w>t.cols&&(a.x=t.cols-a.w),a.x<0&&(a.x=0,a.w=t.cols),!a.static)n.push(a);else for(;Ka(n,a);)a.y++}return e}function Ha(e,t,n,r,a,o,u,c,d){if(t.static&&t.isDraggable!==!0)return[...e];if(t.y===r&&t.x===n)return[...e];const f=t.x,p=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let g=fN(e,u);(u==="vertical"&&typeof r=="number"?p>=r:u==="horizontal"&&typeof n=="number"?f>=n:!1)&&(g=g.reverse());const E=wE(g,t),_=E.length>0;if(_&&d)return ba(e);if(_&&o)return t.x=f,t.y=p,t.moved=!1,e;let S=[...e];for(let w=0;w<E.length;w++){const T=E[w];T!==void 0&&(T.moved||(T.static?S=Xy(S,T,t,a,u):S=Xy(S,t,T,a,u)))}return S}function Xy(e,t,n,r,a,o){const u=a==="horizontal",c=a==="vertical",d=t.static;if(r){r=!1;const g={x:u?Math.max(t.x-n.w,0):n.x,y:c?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},x=Ka(e,g),E=x!==void 0&&x.y+x.h>t.y,_=x!==void 0&&t.x+t.w>x.x;if(!x)return Ha(e,n,u?g.x:void 0,c?g.y:void 0,r,d,a);if(E&&c)return Ha(e,n,void 0,n.y+1,r,d,a);if(E&&a===null)return t.y=n.y,n.y=n.y+n.h,[...e];if(_&&u)return Ha(e,t,n.x,void 0,r,d,a)}const f=u?n.x+1:void 0,p=c?n.y+1:void 0;return f===void 0&&p===void 0?[...e]:Ha(e,n,f,p,r,d,a)}function ma(e,t,n){return Math.max(t,Math.min(n,e))}var pN={name:"gridBounds",constrainPosition(e,t,n,{cols:r,maxRows:a}){return{x:ma(t,0,Math.max(0,r-e.w)),y:ma(n,0,Math.max(0,a-e.h))}},constrainSize(e,t,n,r,{cols:a,maxRows:o}){const u=r==="w"||r==="nw"||r==="sw"?e.x+e.w:a-e.x,c=r==="n"||r==="nw"||r==="ne"?e.y+e.h:o-e.y;return{w:ma(t,1,Math.max(1,u)),h:ma(n,1,Math.max(1,c))}}},gN={name:"minMaxSize",constrainSize(e,t,n){return{w:ma(t,e.minW??1,e.maxW??1/0),h:ma(n,e.minH??1,e.maxH??1/0)}}},yN={name:"containerBounds",constrainPosition(e,t,n,{cols:r,maxRows:a,containerHeight:o,rowHeight:u,margin:c}){const d=o>0?Math.floor((o+c[1])/(u+c[1])):a;return{x:ma(t,0,Math.max(0,r-e.w)),y:ma(n,0,Math.max(0,d-e.h))}}},Hc=[pN,gN];function yc(e,t,n,r,a){let o={x:n,y:r};for(const u of e)u.constrainPosition&&(o=u.constrainPosition(t,o.x,o.y,a));if(t.constraints)for(const u of t.constraints)u.constrainPosition&&(o=u.constrainPosition(t,o.x,o.y,a));return o}function bN(e,t,n,r,a,o){let u={w:n,h:r};for(const c of e)c.constrainSize&&(u=c.constrainSize(t,u.w,u.h,a,o));if(t.constraints)for(const c of t.constraints)c.constrainSize&&(u=c.constrainSize(t,u.w,u.h,a,o));return u}function sm({top:e,left:t,width:n,height:r}){const a=`translate(${t}px,${e}px)`;return{transform:a,WebkitTransform:a,MozTransform:a,msTransform:a,OTransform:a,width:`${n}px`,height:`${r}px`,position:"absolute"}}function CE({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:"absolute"}}function Ky(e){return e*100+"%"}function xN(e,t,n,r){return e+n>r?t:n}function kE(e,t,n){return e<0?t:n}function EN(e){return Math.max(0,e)}function Uc(e){return Math.max(0,e)}var am=(e,t,n)=>{const{left:r,height:a,width:o}=t,u=e.top-(a-e.height);return{left:r,width:o,height:kE(u,e.height,a),top:Uc(u)}},im=(e,t,n)=>{const{top:r,left:a,height:o,width:u}=t;return{top:r,height:o,width:xN(e.left,e.width,u,n),left:EN(a)}},om=(e,t,n)=>{const{top:r,height:a,width:o}=t,u=e.left+e.width-o;return u<0?{height:a,width:e.left+e.width,top:Uc(r),left:0}:{height:a,width:o,top:Uc(r),left:u}},um=(e,t,n)=>{const{top:r,left:a,height:o,width:u}=t;return{width:u,left:a,height:kE(r,e.height,o),top:Uc(r)}},vN=(e,t,n)=>am(e,im(e,t,n)),TN=(e,t,n)=>am(e,om(e,t)),wN=(e,t,n)=>um(e,im(e,t,n)),SN=(e,t,n)=>um(e,om(e,t)),CN={n:am,ne:vN,e:im,se:wN,s:um,sw:SN,w:om,nw:TN};function kN(e,t,n,r){const a=CN[e];return a?a(t,{...t,...n},r):n}var lm={type:"transform",scale:1,calcStyle(e){return sm(e)}},_E={type:"absolute",scale:1,calcStyle(e){return CE(e)}};function NE(e){return{type:"transform",scale:e,calcStyle(t){return sm(t)},calcDragPosition(t,n,r,a){return{left:(t-r)/e,top:(n-a)/e}}}}var _N=lm,NN={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},ON={enabled:!0,bounded:!1,threshold:3},DN={enabled:!0,handles:["se"]},AN={enabled:!1,defaultItem:{w:1,h:1}};function cm(e,t,n,r,a){const o=r==="x"?"w":"h";t[r]+=1;const u=e.findIndex(d=>d.i===t.i),c=a??rd(e).length>0;for(let d=u+1;d<e.length;d++){const f=e[d];if(f!==void 0&&!f.static){if(!c&&f.y>t.y+t.h)break;nm(t,f)&&cm(e,f,n+t[o],r,c)}}t[r]=n}function IN(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!Ka(e,t);)t.y--;let a;for(;(a=Ka(e,t))!==void 0;)cm(n,t,a.y+a.h,"y");return t.y=Math.max(t.y,0),t}function RN(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!Ka(e,t);)t.x--;let a;for(;(a=Ka(e,t))!==void 0;)if(cm(r,t,a.x+a.w,"x"),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!Ka(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var OE={type:"vertical",allowOverlap:!1,compact(e,t){const n=rd(e);let r=nd(n);const a=d0(e),o=new Array(e.length);for(let u=0;u<a.length;u++){const c=a[u];if(c===void 0)continue;let d=ri(c);d.static||(d=IN(n,d,a,r),r=Math.max(r,d.y+d.h),n.push(d));const f=e.indexOf(c);o[f]=d,d.moved=!1}return o}},DE={type:"horizontal",allowOverlap:!1,compact(e,t){const n=rd(e),r=SE(e),a=new Array(e.length);for(let o=0;o<r.length;o++){const u=r[o];if(u===void 0)continue;let c=ri(u);c.static||(c=RN(n,c,t,r),n.push(c));const d=e.indexOf(u);a[d]=c,c.moved=!1}return a}},AE={type:null,allowOverlap:!1,compact(e,t){return ba(e)}},LN={...OE,allowOverlap:!0,compact(e,t){return ba(e)}},MN={...DE,allowOverlap:!0,compact(e,t){return ba(e)}},PN={...AE,allowOverlap:!0};function Ku(e,t=!1,n=!1){let r;return t?e==="vertical"?r=LN:e==="horizontal"?r=MN:r=PN:e==="vertical"?r=OE:e==="horizontal"?r=DE:r=AE,n?{...r,preventCollision:n}:r}function IE(e){return Object.keys(e).sort((n,r)=>e[n]-e[r])}function Jy(e,t){const n=IE(e);let r=n[0];if(r===void 0)throw new Error("No breakpoints defined");for(let a=1;a<n.length;a++){const o=n[a];if(o===void 0)continue;const u=e[o];t>u&&(r=o)}return r}function Zy(e,t){const n=t[e];if(n===void 0)throw new Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function gh(e,t,n,r,a,o){const u=e[n];if(u)return ba(u);let c=e[r];const d=IE(t),f=d.slice(d.indexOf(n));for(let E=0;E<f.length;E++){const _=f[E];if(_===void 0)continue;const S=e[_];if(S){c=S;break}}const p=ba(c||[]),g=rm(p,{cols:a});return(typeof o=="object"&&o!==null?o:Ku(o)).compact(g,a)}function bc(e,t){if(Array.isArray(e))return e;const n=e,r=n[t];if(r!==void 0)return r;const a=Object.keys(n);for(const o of a){const u=n[o];if(u!==void 0)return u}return[10,10]}var ou={exports:{}},yh={},bh={exports:{}},xh,e1;function FN(){if(e1)return xh;e1=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return xh=e,xh}var Eh,t1;function jN(){if(t1)return Eh;t1=1;var e=FN();function t(){}function n(){}return n.resetWarningCache=t,Eh=function(){function r(u,c,d,f,p,g){if(g!==e){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Eh}var n1;function sd(){return n1||(n1=1,bh.exports=jN()()),bh.exports}var xc={exports:{}},r1;function BN(){if(r1)return xc.exports;r1=1;function e(n){var r,a,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var u=n.length;for(r=0;r<u;r++)n[r]&&(a=e(n[r]))&&(o&&(o+=" "),o+=a)}else for(a in n)n[a]&&(o&&(o+=" "),o+=a);return o}function t(){for(var n,r,a=0,o="",u=arguments.length;a<u;a++)(n=arguments[a])&&(r=e(n))&&(o&&(o+=" "),o+=r);return o}return xc.exports=t,xc.exports.clsx=t,xc.exports}var tn={},Js={},s1;function ad(){if(s1)return Js;s1=1,Object.defineProperty(Js,"__esModule",{value:!0}),Js.dontSetMe=a,Js.findInArray=e,Js.int=r,Js.isFunction=t,Js.isNum=n;function e(o,u){for(let c=0,d=o.length;c<d;c++)if(u.apply(u,[o[c],c,o]))return o[c]}function t(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Function]"}function n(o){return typeof o=="number"&&!isNaN(o)}function r(o){return parseInt(o,10)}function a(o,u,c){if(o[u])return new Error(`Invalid prop ${u} passed to ${c} - do not set this, set it on the child.`)}return Js}var Zs={},a1;function HN(){if(a1)return Zs;a1=1,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.browserPrefixToKey=n,Zs.browserPrefixToStyle=r,Zs.default=void 0,Zs.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var c,d;let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const u=(d=(c=window.document)==null?void 0:c.documentElement)==null?void 0:d.style;if(!u||o in u)return"";for(let f=0;f<e.length;f++)if(n(o,e[f])in u)return e[f];return""}function n(o,u){return u?`${u}${a(o)}`:o}function r(o,u){return u?`-${u.toLowerCase()}-${o}`:o}function a(o){let u="",c=!0;for(let d=0;d<o.length;d++)c?(u+=o[d].toUpperCase(),c=!1):o[d]==="-"?c=!0:u+=o[d];return u}return Zs.default=t(),Zs}var i1;function dm(){if(i1)return tn;i1=1,Object.defineProperty(tn,"__esModule",{value:!0}),tn.addClassName=B,tn.addEvent=u,tn.addUserSelectStyles=C,tn.createCSSTransform=E,tn.createSVGTransform=_,tn.getTouch=w,tn.getTouchIdentifier=T,tn.getTranslation=S,tn.innerHeight=p,tn.innerWidth=g,tn.matchesSelector=a,tn.matchesSelectorAndParentsTo=o,tn.offsetXYFromParent=x,tn.outerHeight=d,tn.outerWidth=f,tn.removeClassName=k,tn.removeEvent=c,tn.scheduleRemoveUserSelectStyles=O;var e=ad(),t=n(HN());function n(N,R){if(typeof WeakMap=="function")var j=new WeakMap,M=new WeakMap;return(n=function(P,F){if(!F&&P&&P.__esModule)return P;var W,V,J={__proto__:null,default:P};if(P===null||typeof P!="object"&&typeof P!="function")return J;if(W=F?M:j){if(W.has(P))return W.get(P);W.set(P,J)}for(const K in P)K!=="default"&&{}.hasOwnProperty.call(P,K)&&((V=(W=Object.defineProperty)&&Object.getOwnPropertyDescriptor(P,K))&&(V.get||V.set)?W(J,K,V):J[K]=P[K]);return J})(N,R)}let r="";function a(N,R){return r||(r=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(j){return(0,e.isFunction)(N[j])})),(0,e.isFunction)(N[r])?N[r](R):!1}function o(N,R,j){let M=N;do{if(a(M,R))return!0;if(M===j)return!1;M=M.parentNode}while(M);return!1}function u(N,R,j,M){if(!N)return;const P={capture:!0,...M};N.addEventListener?N.addEventListener(R,j,P):N.attachEvent?N.attachEvent("on"+R,j):N["on"+R]=j}function c(N,R,j,M){if(!N)return;const P={capture:!0,...M};N.removeEventListener?N.removeEventListener(R,j,P):N.detachEvent?N.detachEvent("on"+R,j):N["on"+R]=null}function d(N){let R=N.clientHeight;const j=N.ownerDocument.defaultView.getComputedStyle(N);return R+=(0,e.int)(j.borderTopWidth),R+=(0,e.int)(j.borderBottomWidth),R}function f(N){let R=N.clientWidth;const j=N.ownerDocument.defaultView.getComputedStyle(N);return R+=(0,e.int)(j.borderLeftWidth),R+=(0,e.int)(j.borderRightWidth),R}function p(N){let R=N.clientHeight;const j=N.ownerDocument.defaultView.getComputedStyle(N);return R-=(0,e.int)(j.paddingTop),R-=(0,e.int)(j.paddingBottom),R}function g(N){let R=N.clientWidth;const j=N.ownerDocument.defaultView.getComputedStyle(N);return R-=(0,e.int)(j.paddingLeft),R-=(0,e.int)(j.paddingRight),R}function x(N,R,j){const P=R===R.ownerDocument.body?{left:0,top:0}:R.getBoundingClientRect(),F=(N.clientX+R.scrollLeft-P.left)/j,W=(N.clientY+R.scrollTop-P.top)/j;return{x:F,y:W}}function E(N,R){const j=S(N,R,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:j}}function _(N,R){return S(N,R,"")}function S(N,R,j){let{x:M,y:P}=N,F=`translate(${M}${j},${P}${j})`;if(R){const W=`${typeof R.x=="string"?R.x:R.x+j}`,V=`${typeof R.y=="string"?R.y:R.y+j}`;F=`translate(${W}, ${V})`+F}return F}function w(N,R){return N.targetTouches&&(0,e.findInArray)(N.targetTouches,j=>R===j.identifier)||N.changedTouches&&(0,e.findInArray)(N.changedTouches,j=>R===j.identifier)}function T(N){if(N.targetTouches&&N.targetTouches[0])return N.targetTouches[0].identifier;if(N.changedTouches&&N.changedTouches[0])return N.changedTouches[0].identifier}function C(N){if(!N)return;let R=N.getElementById("react-draggable-style-el");R||(R=N.createElement("style"),R.type="text/css",R.id="react-draggable-style-el",R.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
94
- `,R.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
95
- `,N.getElementsByTagName("head")[0].appendChild(R)),N.body&&B(N.body,"react-draggable-transparent-selection")}function O(N){window.requestAnimationFrame?window.requestAnimationFrame(()=>{L(N)}):L(N)}function L(N){if(N)try{if(N.body&&k(N.body,"react-draggable-transparent-selection"),N.selection)N.selection.empty();else{const R=(N.defaultView||window).getSelection();R&&R.type!=="Caret"&&R.removeAllRanges()}}catch{}}function B(N,R){N.classList?N.classList.add(R):N.className.match(new RegExp(`(?:^|\\s)${R}(?!\\S)`))||(N.className+=` ${R}`)}function k(N,R){N.classList?N.classList.remove(R):N.className=N.className.replace(new RegExp(`(?:^|\\s)${R}(?!\\S)`,"g"),"")}return tn}var Vr={},o1;function RE(){if(o1)return Vr;o1=1,Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.canDragX=a,Vr.canDragY=o,Vr.createCoreData=c,Vr.createDraggableData=d,Vr.getBoundPosition=n,Vr.getControlPosition=u,Vr.snapToGrid=r;var e=ad(),t=dm();function n(g,x,E){if(!g.props.bounds)return[x,E];let{bounds:_}=g.props;_=typeof _=="string"?_:f(_);const S=p(g);if(typeof _=="string"){const{ownerDocument:w}=S,T=w.defaultView;let C;if(_==="parent"?C=S.parentNode:C=S.getRootNode().querySelector(_),!(C instanceof T.HTMLElement))throw new Error('Bounds selector "'+_+'" could not find an element.');const O=C,L=T.getComputedStyle(S),B=T.getComputedStyle(O);_={left:-S.offsetLeft+(0,e.int)(B.paddingLeft)+(0,e.int)(L.marginLeft),top:-S.offsetTop+(0,e.int)(B.paddingTop)+(0,e.int)(L.marginTop),right:(0,t.innerWidth)(O)-(0,t.outerWidth)(S)-S.offsetLeft+(0,e.int)(B.paddingRight)-(0,e.int)(L.marginRight),bottom:(0,t.innerHeight)(O)-(0,t.outerHeight)(S)-S.offsetTop+(0,e.int)(B.paddingBottom)-(0,e.int)(L.marginBottom)}}return(0,e.isNum)(_.right)&&(x=Math.min(x,_.right)),(0,e.isNum)(_.bottom)&&(E=Math.min(E,_.bottom)),(0,e.isNum)(_.left)&&(x=Math.max(x,_.left)),(0,e.isNum)(_.top)&&(E=Math.max(E,_.top)),[x,E]}function r(g,x,E){const _=Math.round(x/g[0])*g[0],S=Math.round(E/g[1])*g[1];return[_,S]}function a(g){return g.props.axis==="both"||g.props.axis==="x"}function o(g){return g.props.axis==="both"||g.props.axis==="y"}function u(g,x,E){const _=typeof x=="number"?(0,t.getTouch)(g,x):null;if(typeof x=="number"&&!_)return null;const S=p(E),w=E.props.offsetParent||S.offsetParent||S.ownerDocument.body;return(0,t.offsetXYFromParent)(_||g,w,E.props.scale)}function c(g,x,E){const _=!(0,e.isNum)(g.lastX),S=p(g);return _?{node:S,deltaX:0,deltaY:0,lastX:x,lastY:E,x,y:E}:{node:S,deltaX:x-g.lastX,deltaY:E-g.lastY,lastX:g.lastX,lastY:g.lastY,x,y:E}}function d(g,x){const E=g.props.scale;return{node:x.node,x:g.state.x+x.deltaX/E,y:g.state.y+x.deltaY/E,deltaX:x.deltaX/E,deltaY:x.deltaY/E,lastX:g.state.x,lastY:g.state.y}}function f(g){return{left:g.left,top:g.top,right:g.right,bottom:g.bottom}}function p(g){const x=g.findDOMNode();if(!x)throw new Error("<DraggableCore>: Unmounted during event!");return x}return Vr}var uu={},Ec={},u1;function LE(){if(u1)return Ec;u1=1,Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.default=e;function e(){}return Ec}var l1;function UN(){if(l1)return uu;l1=1,Object.defineProperty(uu,"__esModule",{value:!0}),uu.default=void 0;var e=d(si()),t=c(sd()),n=c($c()),r=dm(),a=RE(),o=ad(),u=c(LE());function c(S){return S&&S.__esModule?S:{default:S}}function d(S,w){if(typeof WeakMap=="function")var T=new WeakMap,C=new WeakMap;return(d=function(O,L){if(!L&&O&&O.__esModule)return O;var B,k,N={__proto__:null,default:O};if(O===null||typeof O!="object"&&typeof O!="function")return N;if(B=L?C:T){if(B.has(O))return B.get(O);B.set(O,N)}for(const R in O)R!=="default"&&{}.hasOwnProperty.call(O,R)&&((k=(B=Object.defineProperty)&&Object.getOwnPropertyDescriptor(O,R))&&(k.get||k.set)?B(N,R,k):N[R]=O[R]);return N})(S,w)}function f(S,w,T){return(w=p(w))in S?Object.defineProperty(S,w,{value:T,enumerable:!0,configurable:!0,writable:!0}):S[w]=T,S}function p(S){var w=g(S,"string");return typeof w=="symbol"?w:w+""}function g(S,w){if(typeof S!="object"||!S)return S;var T=S[Symbol.toPrimitive];if(T!==void 0){var C=T.call(S,w);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(S)}const x={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let E=x.mouse,_=class extends e.Component{constructor(){super(...arguments),f(this,"dragging",!1),f(this,"lastX",NaN),f(this,"lastY",NaN),f(this,"touchIdentifier",null),f(this,"mounted",!1),f(this,"handleDragStart",w=>{if(this.props.onMouseDown(w),!this.props.allowAnyClick&&typeof w.button=="number"&&w.button!==0)return!1;const T=this.findDOMNode();if(!T||!T.ownerDocument||!T.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:C}=T;if(this.props.disabled||!(w.target instanceof C.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(w.target,this.props.handle,T)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(w.target,this.props.cancel,T))return;w.type==="touchstart"&&!this.props.allowMobileScroll&&w.preventDefault();const O=(0,r.getTouchIdentifier)(w);this.touchIdentifier=O;const L=(0,a.getControlPosition)(w,O,this);if(L==null)return;const{x:B,y:k}=L,N=(0,a.createCoreData)(this,B,k);(0,u.default)("DraggableCore: handleDragStart: %j",N),(0,u.default)("calling",this.props.onStart),!(this.props.onStart(w,N)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(C),this.dragging=!0,this.lastX=B,this.lastY=k,(0,r.addEvent)(C,E.move,this.handleDrag),(0,r.addEvent)(C,E.stop,this.handleDragStop))}),f(this,"handleDrag",w=>{const T=(0,a.getControlPosition)(w,this.touchIdentifier,this);if(T==null)return;let{x:C,y:O}=T;if(Array.isArray(this.props.grid)){let k=C-this.lastX,N=O-this.lastY;if([k,N]=(0,a.snapToGrid)(this.props.grid,k,N),!k&&!N)return;C=this.lastX+k,O=this.lastY+N}const L=(0,a.createCoreData)(this,C,O);if((0,u.default)("DraggableCore: handleDrag: %j",L),this.props.onDrag(w,L)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const N=document.createEvent("MouseEvents");N.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(N)}return}this.lastX=C,this.lastY=O}),f(this,"handleDragStop",w=>{if(!this.dragging)return;const T=(0,a.getControlPosition)(w,this.touchIdentifier,this);if(T==null)return;let{x:C,y:O}=T;if(Array.isArray(this.props.grid)){let N=C-this.lastX||0,R=O-this.lastY||0;[N,R]=(0,a.snapToGrid)(this.props.grid,N,R),C=this.lastX+N,O=this.lastY+R}const L=(0,a.createCoreData)(this,C,O);if(this.props.onStop(w,L)===!1||this.mounted===!1)return!1;const k=this.findDOMNode();k&&this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(k.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",L),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,k&&((0,u.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(k.ownerDocument,E.move,this.handleDrag),(0,r.removeEvent)(k.ownerDocument,E.stop,this.handleDragStop))}),f(this,"onMouseDown",w=>(E=x.mouse,this.handleDragStart(w))),f(this,"onMouseUp",w=>(E=x.mouse,this.handleDragStop(w))),f(this,"onTouchStart",w=>(E=x.touch,this.handleDragStart(w))),f(this,"onTouchEnd",w=>(E=x.touch,this.handleDragStop(w)))}componentDidMount(){this.mounted=!0;const w=this.findDOMNode();w&&(0,r.addEvent)(w,x.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const w=this.findDOMNode();if(w){const{ownerDocument:T}=w;(0,r.removeEvent)(T,x.mouse.move,this.handleDrag),(0,r.removeEvent)(T,x.touch.move,this.handleDrag),(0,r.removeEvent)(T,x.mouse.stop,this.handleDragStop),(0,r.removeEvent)(T,x.touch.stop,this.handleDragStop),(0,r.removeEvent)(w,x.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.scheduleRemoveUserSelectStyles)(T)}}findDOMNode(){var w,T,C;return(w=this.props)!=null&&w.nodeRef?(C=(T=this.props)==null?void 0:T.nodeRef)==null?void 0:C.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return uu.default=_,f(_,"displayName","DraggableCore"),f(_,"propTypes",{allowAnyClick:t.default.bool,allowMobileScroll:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(S,w){if(S[w]&&S[w].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),f(_,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),uu}var c1;function zN(){return c1||(c1=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return d.default}}),e.default=void 0;var t=g(si()),n=p(sd()),r=p($c()),a=BN(),o=dm(),u=RE(),c=ad(),d=p(UN()),f=p(LE());function p(T){return T&&T.__esModule?T:{default:T}}function g(T,C){if(typeof WeakMap=="function")var O=new WeakMap,L=new WeakMap;return(g=function(B,k){if(!k&&B&&B.__esModule)return B;var N,R,j={__proto__:null,default:B};if(B===null||typeof B!="object"&&typeof B!="function")return j;if(N=k?L:O){if(N.has(B))return N.get(B);N.set(B,j)}for(const M in B)M!=="default"&&{}.hasOwnProperty.call(B,M)&&((R=(N=Object.defineProperty)&&Object.getOwnPropertyDescriptor(B,M))&&(R.get||R.set)?N(j,M,R):j[M]=B[M]);return j})(T,C)}function x(){return x=Object.assign?Object.assign.bind():function(T){for(var C=1;C<arguments.length;C++){var O=arguments[C];for(var L in O)({}).hasOwnProperty.call(O,L)&&(T[L]=O[L])}return T},x.apply(null,arguments)}function E(T,C,O){return(C=_(C))in T?Object.defineProperty(T,C,{value:O,enumerable:!0,configurable:!0,writable:!0}):T[C]=O,T}function _(T){var C=S(T,"string");return typeof C=="symbol"?C:C+""}function S(T,C){if(typeof T!="object"||!T)return T;var O=T[Symbol.toPrimitive];if(O!==void 0){var L=O.call(T,C);if(typeof L!="object")return L;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(T)}class w extends t.Component{static getDerivedStateFromProps(C,O){let{position:L}=C,{prevPropsPosition:B}=O;return L&&(!B||L.x!==B.x||L.y!==B.y)?((0,f.default)("Draggable: getDerivedStateFromProps %j",{position:L,prevPropsPosition:B}),{x:L.x,y:L.y,prevPropsPosition:{...L}}):null}constructor(C){super(C),E(this,"onDragStart",(O,L)=>{if((0,f.default)("Draggable: onDragStart: %j",L),this.props.onStart(O,(0,u.createDraggableData)(this,L))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),E(this,"onDrag",(O,L)=>{if(!this.state.dragging)return!1;(0,f.default)("Draggable: onDrag: %j",L);const B=(0,u.createDraggableData)(this,L),k={x:B.x,y:B.y,slackX:0,slackY:0};if(this.props.bounds){const{x:R,y:j}=k;k.x+=this.state.slackX,k.y+=this.state.slackY;const[M,P]=(0,u.getBoundPosition)(this,k.x,k.y);k.x=M,k.y=P,k.slackX=this.state.slackX+(R-k.x),k.slackY=this.state.slackY+(j-k.y),B.x=k.x,B.y=k.y,B.deltaX=k.x-this.state.x,B.deltaY=k.y-this.state.y}if(this.props.onDrag(O,B)===!1)return!1;this.setState(k)}),E(this,"onDragStop",(O,L)=>{if(!this.state.dragging||this.props.onStop(O,(0,u.createDraggableData)(this,L))===!1)return!1;(0,f.default)("Draggable: onDragStop: %j",L);const k={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:R,y:j}=this.props.position;k.x=R,k.y=j}this.setState(k)}),this.state={dragging:!1,dragged:!1,x:C.position?C.position.x:C.defaultPosition.x,y:C.position?C.position.y:C.defaultPosition.y,prevPropsPosition:{...C.position},slackX:0,slackY:0,isElementSVG:!1},C.position&&!(C.onDrag||C.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var C,O;return((O=(C=this.props)==null?void 0:C.nodeRef)==null?void 0:O.current)??r.default.findDOMNode(this)}render(){const{axis:C,bounds:O,children:L,defaultPosition:B,defaultClassName:k,defaultClassNameDragging:N,defaultClassNameDragged:R,position:j,positionOffset:M,scale:P,...F}=this.props;let W={},V=null;const K=!!!j||this.state.dragging,Z=j||B,G={x:(0,u.canDragX)(this)&&K?this.state.x:Z.x,y:(0,u.canDragY)(this)&&K?this.state.y:Z.y};this.state.isElementSVG?V=(0,o.createSVGTransform)(G,M):W=(0,o.createCSSTransform)(G,M);const ee=(0,a.clsx)(L.props.className||"",k,{[N]:this.state.dragging,[R]:this.state.dragged});return t.createElement(d.default,x({},F,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(L),{className:ee,style:{...L.props.style,...W},transform:V}))}}e.default=w,E(w,"displayName","Draggable"),E(w,"propTypes",{...d.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:c.dontSetMe,style:c.dontSetMe,transform:c.dontSetMe}),E(w,"defaultProps",{...d.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(yh)),yh}var d1;function fm(){if(d1)return ou.exports;d1=1;const{default:e,DraggableCore:t}=zN();return ou.exports=e,ou.exports.default=e,ou.exports.DraggableCore=t,ou.exports}var WN=fm(),lu={exports:{}},cu={},vc={},f1;function YN(){if(f1)return vc;f1=1,vc.__esModule=!0,vc.cloneElement=c;var e=t(si());function t(d){return d&&d.__esModule?d:{default:d}}function n(d,f){var p=Object.keys(d);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(d);f&&(g=g.filter(function(x){return Object.getOwnPropertyDescriptor(d,x).enumerable})),p.push.apply(p,g)}return p}function r(d){for(var f=1;f<arguments.length;f++){var p=arguments[f]!=null?arguments[f]:{};f%2?n(Object(p),!0).forEach(function(g){a(d,g,p[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(p)):n(Object(p)).forEach(function(g){Object.defineProperty(d,g,Object.getOwnPropertyDescriptor(p,g))})}return d}function a(d,f,p){return(f=o(f))in d?Object.defineProperty(d,f,{value:p,enumerable:!0,configurable:!0,writable:!0}):d[f]=p,d}function o(d){var f=u(d,"string");return typeof f=="symbol"?f:f+""}function u(d,f){if(typeof d!="object"||!d)return d;var p=d[Symbol.toPrimitive];if(p!==void 0){var g=p.call(d,f);if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(d)}function c(d,f){return f.style&&d.props.style&&(f.style=r(r({},d.props.style),f.style)),f.className&&d.props.className&&(f.className=`${d.props.className} ${f.className}`),e.default.cloneElement(d,f)}return vc}var du={},h1;function ME(){if(h1)return du;h1=1,du.__esModule=!0,du.resizableProps=void 0;var e=t(sd());fm();function t(n){return n&&n.__esModule?n:{default:n}}return du.resizableProps={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:typeof Element<"u"?e.default.instanceOf(Element):e.default.any,grid:e.default.arrayOf(e.default.number),handle:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number}),height:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];const[o]=r;return o.axis==="both"||o.axis==="y"?e.default.number.isRequired(...r):e.default.number(...r)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];const[o]=r;return o.axis==="both"||o.axis==="x"?e.default.number.isRequired(...r):e.default.number(...r)}},du}var m1;function PE(){if(m1)return cu;m1=1,cu.__esModule=!0,cu.default=void 0;var e=o(si()),t=fm(),n=YN(),r=ME();const a=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function o(S,w){if(typeof WeakMap=="function")var T=new WeakMap,C=new WeakMap;return(o=function(O,L){if(!L&&O&&O.__esModule)return O;var B,k,N={__proto__:null,default:O};if(O===null||typeof O!="object"&&typeof O!="function")return N;if(B=L?C:T){if(B.has(O))return B.get(O);B.set(O,N)}for(const R in O)R!=="default"&&{}.hasOwnProperty.call(O,R)&&((k=(B=Object.defineProperty)&&Object.getOwnPropertyDescriptor(O,R))&&(k.get||k.set)?B(N,R,k):N[R]=O[R]);return N})(S,w)}function u(){return u=Object.assign?Object.assign.bind():function(S){for(var w=1;w<arguments.length;w++){var T=arguments[w];for(var C in T)({}).hasOwnProperty.call(T,C)&&(S[C]=T[C])}return S},u.apply(null,arguments)}function c(S,w){if(S==null)return{};var T,C,O=d(S,w);if(Object.getOwnPropertySymbols){var L=Object.getOwnPropertySymbols(S);for(C=0;C<L.length;C++)T=L[C],w.indexOf(T)===-1&&{}.propertyIsEnumerable.call(S,T)&&(O[T]=S[T])}return O}function d(S,w){if(S==null)return{};var T={};for(var C in S)if({}.hasOwnProperty.call(S,C)){if(w.indexOf(C)!==-1)continue;T[C]=S[C]}return T}function f(S,w){var T=Object.keys(S);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(S);w&&(C=C.filter(function(O){return Object.getOwnPropertyDescriptor(S,O).enumerable})),T.push.apply(T,C)}return T}function p(S){for(var w=1;w<arguments.length;w++){var T=arguments[w]!=null?arguments[w]:{};w%2?f(Object(T),!0).forEach(function(C){g(S,C,T[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(S,Object.getOwnPropertyDescriptors(T)):f(Object(T)).forEach(function(C){Object.defineProperty(S,C,Object.getOwnPropertyDescriptor(T,C))})}return S}function g(S,w,T){return(w=x(w))in S?Object.defineProperty(S,w,{value:T,enumerable:!0,configurable:!0,writable:!0}):S[w]=T,S}function x(S){var w=E(S,"string");return typeof w=="symbol"?w:w+""}function E(S,w){if(typeof S!="object"||!S)return S;var T=S[Symbol.toPrimitive];if(T!==void 0){var C=T.call(S,w);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(w==="string"?String:Number)(S)}let _=class extends e.Component{constructor(){super(...arguments),this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints(w,T){const{minConstraints:C,maxConstraints:O,lockAspectRatio:L}=this.props;if(!C&&!O&&!L)return[w,T];if(L){const j=this.props.width/this.props.height,M=w-this.props.width,P=T-this.props.height;Math.abs(M)>Math.abs(P*j)?T=w/j:w=T*j}const[B,k]=[w,T];let[N,R]=this.slack||[0,0];return w+=N,T+=R,C&&(w=Math.max(C[0],w),T=Math.max(C[1],T)),O&&(w=Math.min(O[0],w),T=Math.min(O[1],T)),this.slack=[N+(B-w),R+(k-T)],[w,T]}resizeHandler(w,T){return(C,O)=>{var Z;let{node:L,deltaX:B,deltaY:k}=O;w==="onResizeStart"&&this.resetData();const N=(this.props.axis==="both"||this.props.axis==="x")&&T!=="n"&&T!=="s",R=(this.props.axis==="both"||this.props.axis==="y")&&T!=="e"&&T!=="w";if(!N&&!R)return;const j=T[0],M=T[T.length-1],P=L.getBoundingClientRect();if(this.lastHandleRect!=null){if(M==="w"){const G=P.left-this.lastHandleRect.left;B+=G}if(j==="n"){const G=P.top-this.lastHandleRect.top;k+=G}}this.lastHandleRect=P,M==="w"&&(B=-B),j==="n"&&(k=-k);let F=this.props.width+(N?B/this.props.transformScale:0),W=this.props.height+(R?k/this.props.transformScale:0);[F,W]=this.runConstraints(F,W),w==="onResizeStop"&&this.lastSize&&({width:F,height:W}=this.lastSize);const V=F!==this.props.width||W!==this.props.height;w!=="onResizeStop"&&(this.lastSize={width:F,height:W});const J=typeof this.props[w]=="function"?this.props[w]:null;J&&!(w==="onResize"&&!V)&&((Z=C.persist)==null||Z.call(C),J(C,{node:L,size:{width:F,height:W},handle:T})),w==="onResizeStop"&&this.resetData()}}renderResizeHandle(w,T){const{handle:C}=this.props;if(!C)return e.createElement("span",{className:`react-resizable-handle react-resizable-handle-${w}`,ref:T});if(typeof C=="function")return C(w,T);const O=typeof C.type=="string",L=p({ref:T},O?{}:{handleAxis:w});return e.cloneElement(C,L)}render(){const w=this.props,{children:T,className:C,draggableOpts:O,width:L,height:B,handle:k,handleSize:N,lockAspectRatio:R,axis:j,minConstraints:M,maxConstraints:P,onResize:F,onResizeStop:W,onResizeStart:V,resizeHandles:J,transformScale:K}=w,Z=c(w,a);return(0,n.cloneElement)(T,p(p({},Z),{},{className:`${C?`${C} `:""}react-resizable`,children:[...e.Children.toArray(T.props.children),...J.map(G=>{const ee=this.handleRefs[G]??(this.handleRefs[G]=e.createRef());return e.createElement(t.DraggableCore,u({},O,{nodeRef:ee,key:`resizableHandle-${G}`,onStop:this.resizeHandler("onResizeStop",G),onStart:this.resizeHandler("onResizeStart",G),onDrag:this.resizeHandler("onResize",G)}),this.renderResizeHandle(G,ee))})]}))}};return cu.default=_,_.propTypes=r.resizableProps,_.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},cu}var fu={},p1;function qN(){if(p1)return fu;p1=1,fu.__esModule=!0,fu.default=void 0;var e=u(si()),t=o(sd()),n=o(PE()),r=ME();const a=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function o(w){return w&&w.__esModule?w:{default:w}}function u(w,T){if(typeof WeakMap=="function")var C=new WeakMap,O=new WeakMap;return(u=function(L,B){if(!B&&L&&L.__esModule)return L;var k,N,R={__proto__:null,default:L};if(L===null||typeof L!="object"&&typeof L!="function")return R;if(k=B?O:C){if(k.has(L))return k.get(L);k.set(L,R)}for(const j in L)j!=="default"&&{}.hasOwnProperty.call(L,j)&&((N=(k=Object.defineProperty)&&Object.getOwnPropertyDescriptor(L,j))&&(N.get||N.set)?k(R,j,N):R[j]=L[j]);return R})(w,T)}function c(){return c=Object.assign?Object.assign.bind():function(w){for(var T=1;T<arguments.length;T++){var C=arguments[T];for(var O in C)({}).hasOwnProperty.call(C,O)&&(w[O]=C[O])}return w},c.apply(null,arguments)}function d(w,T){var C=Object.keys(w);if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(w);T&&(O=O.filter(function(L){return Object.getOwnPropertyDescriptor(w,L).enumerable})),C.push.apply(C,O)}return C}function f(w){for(var T=1;T<arguments.length;T++){var C=arguments[T]!=null?arguments[T]:{};T%2?d(Object(C),!0).forEach(function(O){p(w,O,C[O])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(C)):d(Object(C)).forEach(function(O){Object.defineProperty(w,O,Object.getOwnPropertyDescriptor(C,O))})}return w}function p(w,T,C){return(T=g(T))in w?Object.defineProperty(w,T,{value:C,enumerable:!0,configurable:!0,writable:!0}):w[T]=C,w}function g(w){var T=x(w,"string");return typeof T=="symbol"?T:T+""}function x(w,T){if(typeof w!="object"||!w)return w;var C=w[Symbol.toPrimitive];if(C!==void 0){var O=C.call(w,T);if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(w)}function E(w,T){if(w==null)return{};var C,O,L=_(w,T);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(w);for(O=0;O<B.length;O++)C=B[O],T.indexOf(C)===-1&&{}.propertyIsEnumerable.call(w,C)&&(L[C]=w[C])}return L}function _(w,T){if(w==null)return{};var C={};for(var O in w)if({}.hasOwnProperty.call(w,O)){if(T.indexOf(O)!==-1)continue;C[O]=w[O]}return C}let S=class extends e.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(T,C)=>{var L;const{size:O}=C;this.props.onResize?((L=T.persist)==null||L.call(T),this.setState(O,()=>this.props.onResize&&this.props.onResize(T,C))):this.setState(O)}}static getDerivedStateFromProps(T,C){return C.propsWidth!==T.width||C.propsHeight!==T.height?{width:T.width,height:T.height,propsWidth:T.width,propsHeight:T.height}:null}render(){const T=this.props,{handle:C,handleSize:O,onResize:L,onResizeStart:B,onResizeStop:k,draggableOpts:N,minConstraints:R,maxConstraints:j,lockAspectRatio:M,axis:P,width:F,height:W,resizeHandles:V,style:J,transformScale:K}=T,Z=E(T,a);return e.createElement(n.default,{axis:P,draggableOpts:N,handle:C,handleSize:O,height:this.state.height,lockAspectRatio:M,maxConstraints:j,minConstraints:R,onResizeStart:B,onResize:this.onResize,onResizeStop:k,resizeHandles:V,transformScale:K,width:this.state.width},e.createElement("div",c({},Z,{style:f(f({},J),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return fu.default=S,S.propTypes=f(f({},r.resizableProps),{},{children:t.default.element}),fu}var g1;function $N(){return g1||(g1=1,lu.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},lu.exports.Resizable=PE().default,lu.exports.ResizableBox=qN().default),lu.exports}var VN=$N();function FE(e){return function(n,r,a,o,u,c,d){return e(n,r,d)}}function id(e){return function(n,r,a,o){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,a,o);var u=o.get(n),c=o.get(r);if(u&&c)return u===r&&c===n;o.set(n,r),o.set(r,n);var d=e(n,r,a,o);return o.delete(n),o.delete(r),d}}function jE(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function y1(e){return e.constructor===Object||e.constructor==null}function b1(e){return typeof e.then=="function"}function od(e,t){return e===t||e!==e&&t!==t}var QN="[object Arguments]",GN="[object Boolean]",XN="[object Date]",KN="[object RegExp]",JN="[object Map]",ZN="[object Number]",eO="[object Object]",tO="[object Set]",nO="[object String]",x1=Object.prototype.toString;function ud(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,a=e.areObjectsEqual,o=e.areRegExpsEqual,u=e.areSetsEqual,c=e.createIsNestedEqual,d=c(f);function f(p,g,x){if(p===g)return!0;if(!p||!g||typeof p!="object"||typeof g!="object")return p!==p&&g!==g;if(y1(p)&&y1(g))return a(p,g,d,x);var E=Array.isArray(p),_=Array.isArray(g);if(E||_)return E===_&&t(p,g,d,x);var S=x1.call(p);return S!==x1.call(g)?!1:S===XN?n(p,g,d,x):S===KN?o(p,g,d,x):S===JN?r(p,g,d,x):S===tO?u(p,g,d,x):S===eO||S===QN?b1(p)||b1(g)?!1:a(p,g,d,x):S===GN||S===ZN||S===nO?od(p.valueOf(),g.valueOf()):!1}return f}function BE(e,t,n,r){var a=e.length;if(t.length!==a)return!1;for(;a-- >0;)if(!n(e[a],t[a],a,a,e,t,r))return!1;return!0}var rO=id(BE);function HE(e,t){return od(e.valueOf(),t.valueOf())}function UE(e,t,n,r){var a=e.size===t.size;if(!a)return!1;if(!e.size)return!0;var o={},u=0;return e.forEach(function(c,d){if(a){var f=!1,p=0;t.forEach(function(g,x){!f&&!o[p]&&(f=n(d,x,u,p,e,t,r)&&n(c,g,d,x,e,t,r))&&(o[p]=!0),p++}),u++,a=f}}),a}var sO=id(UE),aO="_owner",iO=Object.prototype.hasOwnProperty;function zE(e,t,n,r){var a=Object.keys(e),o=a.length;if(Object.keys(t).length!==o)return!1;for(var u;o-- >0;){if(u=a[o],u===aO){var c=!!e.$$typeof,d=!!t.$$typeof;if((c||d)&&c!==d)return!1}if(!iO.call(t,u)||!n(e[u],t[u],u,u,e,t,r))return!1}return!0}var oO=id(zE);function WE(e,t){return e.source===t.source&&e.flags===t.flags}function YE(e,t,n,r){var a=e.size===t.size;if(!a)return!1;if(!e.size)return!0;var o={};return e.forEach(function(u,c){if(a){var d=!1,f=0;t.forEach(function(p,g){!d&&!o[f]&&(d=n(u,p,c,g,e,t,r))&&(o[f]=!0),f++}),a=d}}),a}var uO=id(YE),qE=Object.freeze({areArraysEqual:BE,areDatesEqual:HE,areMapsEqual:UE,areObjectsEqual:zE,areRegExpsEqual:WE,areSetsEqual:YE,createIsNestedEqual:FE}),$E=Object.freeze({areArraysEqual:rO,areDatesEqual:HE,areMapsEqual:sO,areObjectsEqual:oO,areRegExpsEqual:WE,areSetsEqual:uO,createIsNestedEqual:FE}),lO=ud(qE);function Es(e,t){return lO(e,t,void 0)}ud(jE(qE,{createIsNestedEqual:function(){return od}}));ud($E);ud(jE($E,{createIsNestedEqual:function(){return od}}));function E1(e){const{children:t,cols:n,containerWidth:r,margin:a,containerPadding:o,rowHeight:u,maxRows:c,isDraggable:d,isResizable:f,isBounded:p,static:g,useCSSTransforms:x=!0,usePercentages:E=!1,transformScale:_=1,positionStrategy:S,dragThreshold:w=0,droppingPosition:T,className:C="",style:O,handle:L="",cancel:B="",x:k,y:N,w:R,h:j,minW:M=1,maxW:P=1/0,minH:F=1,maxH:W=1/0,i:V,resizeHandles:J,resizeHandle:K,constraints:Z=Hc,layoutItem:G,layout:ee=[],onDragStart:D,onDrag:ue,onDragStop:ae,onResizeStart:U,onResize:Ee,onResizeStop:De}=e,[ve,ze]=I.useState(!1),[Ue,Le]=I.useState(!1),Ge=I.useRef(null),Fe=I.useRef({left:0,top:0}),Rt=I.useRef({top:0,left:0,width:0,height:0}),Et=I.useRef(void 0),Cn=I.useRef(ee);Cn.current=ee;const $t=I.useRef(null),gt=I.useRef(null),Lt=I.useRef(!1),er=I.useRef({x:0,y:0}),it=I.useRef(!1),nt=I.useMemo(()=>({cols:n,containerPadding:o,containerWidth:r,margin:a,maxRows:c,rowHeight:u}),[n,o,r,a,c,u]),vt=I.useMemo(()=>({cols:n,maxRows:c,containerWidth:r,containerHeight:0,rowHeight:u,margin:a,layout:[]}),[n,c,r,u,a]),Dt=I.useCallback(()=>({...vt,layout:Cn.current}),[vt]),ln=I.useMemo(()=>G??{i:V,x:k,y:N,w:R,h:j,minW:M,maxW:P,minH:F,maxH:W},[G,V,k,N,R,j,M,P,F,W]),tr=I.useCallback(be=>{if(S!=null&&S.calcStyle)return S.calcStyle(be);if(x)return sm(be);const ke=CE(be);return E?{...ke,left:Ky(be.left/r),width:Ky(be.width/r)}:ke},[S,x,E,r]),cn=I.useCallback((be,{node:ke})=>{if(!D)return;const{offsetParent:et}=ke;if(!et)return;const _e=et.getBoundingClientRect(),Pt=ke.getBoundingClientRect(),Qt=Pt.left/_,Gt=_e.left/_,Ft=Pt.top/_,Xt=_e.top/_;let _n;if(S!=null&&S.calcDragPosition){const Ve=be;_n=S.calcDragPosition(Ve.clientX,Ve.clientY,Ve.clientX-Pt.left,Ve.clientY-Pt.top)}else _n={left:Qt-Gt+et.scrollLeft,top:Ft-Xt+et.scrollTop};if(Fe.current=_n,w>0){const Ve=be;er.current={x:Ve.clientX,y:Ve.clientY},Lt.current=!0,it.current=!1,ze(!0);return}ze(!0);const Un=gc(nt,_n.top,_n.left),{x:Ur,y:Ne}=yc(Z,ln,Un.x,Un.y,Dt());D(V,Ur,Ne,{e:be,node:ke,newPosition:_n})},[D,_,nt,S,w,Z,ln,Dt,V]),oe=I.useCallback((be,{node:ke,deltaX:et,deltaY:_e})=>{if(!ue||!ve)return;const Pt=be;if(Lt.current&&!it.current){const Ur=Pt.clientX-er.current.x,Ne=Pt.clientY-er.current.y;if(Math.hypot(Ur,Ne)<w)return;if(it.current=!0,Lt.current=!1,D){const je=gc(nt,Fe.current.top,Fe.current.left),{x:rt,y:dt}=yc(Z,ln,je.x,je.y,Dt());D(V,rt,dt,{e:be,node:ke,newPosition:Fe.current})}}let Qt=Fe.current.top+_e,Gt=Fe.current.left+et;if(p){const{offsetParent:Ur}=ke;if(Ur){const Ne=Ur.clientHeight-io(j,u,a[1]);Qt=Bc(Qt,0,Ne);const Ve=po(nt),je=r-io(R,Ve,a[0]);Gt=Bc(Gt,0,je)}}const Ft={top:Qt,left:Gt};Fe.current=Ft;const Xt=gc(nt,Qt,Gt),{x:_n,y:Un}=yc(Z,ln,Xt.x,Xt.y,Dt());ue(V,_n,Un,{e:be,node:ke,newPosition:Ft})},[ue,D,ve,w,p,j,u,a,nt,r,R,V,Z,ln,Dt]),me=I.useCallback((be,{node:ke})=>{if(!ae||!ve)return;const et=Lt.current;if(Lt.current=!1,it.current=!1,er.current={x:0,y:0},et){ze(!1),Fe.current={left:0,top:0};return}const{left:_e,top:Pt}=Fe.current,Qt={top:Pt,left:_e};ze(!1),Fe.current={left:0,top:0};const Gt=gc(nt,Pt,_e),{x:Ft,y:Xt}=yc(Z,ln,Gt.x,Gt.y,Dt());ae(V,Ft,Xt,{e:be,node:ke,newPosition:Qt})},[ae,ve,nt,Z,ln,Dt,V]);$t.current=cn,gt.current=oe;const Ae=I.useCallback((be,{node:ke,size:et,handle:_e},Pt,Qt)=>{const Gt=Qt==="onResizeStart"?U:Qt==="onResize"?Ee:De;if(!Gt)return;let Ft;ke?Ft=kN(_e,Pt,et,r):Ft={...et,top:Pt.top,left:Pt.left},Rt.current=Ft;const Xt=dN(nt,Ft.width,Ft.height),{w:_n,h:Un}=bN(Z,ln,Xt.w,Xt.h,_e,Dt());Gt(V,_n,Un,{e:be.nativeEvent,node:ke,size:Ft,handle:_e})},[U,Ee,De,r,nt,V,Z,ln,Dt]),Ye=I.useCallback((be,ke)=>{Le(!0);const et=iu(nt,k,N,R,j),_e={...ke,handle:ke.handle};Ae(be,_e,et,"onResizeStart")},[Ae,nt,k,N,R,j]),Xe=I.useCallback((be,ke)=>{const et=iu(nt,k,N,R,j),_e={...ke,handle:ke.handle};Ae(be,_e,et,"onResize")},[Ae,nt,k,N,R,j]),yt=I.useCallback((be,ke)=>{Le(!1),Rt.current={top:0,left:0,width:0,height:0};const et=iu(nt,k,N,R,j),_e={...ke,handle:ke.handle};Ae(be,_e,et,"onResizeStop")},[Ae,nt,k,N,R,j]);I.useEffect(()=>{var _e,Pt;if(!T)return;const be=Ge.current;if(!be)return;const ke=Et.current||{left:0,top:0},et=ve&&(T.left!==ke.left||T.top!==ke.top);if(ve){if(et){const Qt=T.left-Fe.current.left,Gt=T.top-Fe.current.top,Ft={node:be,deltaX:Qt,deltaY:Gt,lastX:Fe.current.left,lastY:Fe.current.top,x:T.left,y:T.top};(Pt=gt.current)==null||Pt.call(gt,T.e,Ft)}}else{const Qt={node:be,deltaX:T.left,deltaY:T.top,lastX:0,lastY:0,x:T.left,y:T.top};(_e=$t.current)==null||_e.call($t,T.e,Qt)}Et.current=T},[T,ve,V]);const Vt=iu(nt,k,N,R,j,ve?Fe.current:null,Ue?Rt.current:null),an=xe.Children.only(t),kn=iu(nt,0,0,1,1),Hn=[kn.width,kn.height],Mt=[1/0,1/0],bt=an.props,dn=bt.className,Cr=bt.style;let Pe=xe.cloneElement(an,{ref:Ge,className:Sr("react-grid-item",dn,C,{static:g,resizing:Ue,"react-draggable":d,"react-draggable-dragging":ve,dropping:!!T,cssTransforms:x}),style:{...O,...Cr,...tr(Vt)}});const Ke=K;return Pe=m.jsx(VN.Resizable,{draggableOpts:{disabled:!f},className:f?void 0:"react-resizable-hide",width:Vt.width,height:Vt.height,minConstraints:Hn,maxConstraints:Mt,onResizeStart:Ye,onResize:Xe,onResizeStop:yt,transformScale:_,resizeHandles:J,handle:Ke,children:Pe}),Pe=m.jsx(WN.DraggableCore,{disabled:!d,onStart:cn,onDrag:oe,onStop:me,handle:L,cancel:".react-resizable-handle"+(B?","+B:""),scale:_,nodeRef:Ge,children:Pe}),Pe}var bs=()=>{},v1="react-grid-layout",VE=!1;try{VE=/firefox/i.test(navigator.userAgent)}catch{}function cO(e,t){const n=xe.Children.toArray(e),r=xe.Children.toArray(t);if(n.length!==r.length)return!1;for(let a=0;a<n.length;a++){const o=n[a],u=r[a];if((o==null?void 0:o.key)!==(u==null?void 0:u.key))return!1}return!0}function T1(e,t,n,r){const a=[],o=new Set;xe.Children.forEach(t,c=>{if(!xe.isValidElement(c)||c.key===null)return;const d=String(c.key);o.add(d);const f=e.find(p=>p.i===d);if(f)a.push(ri(f));else{const g=c.props["data-grid"];g?a.push({i:d,x:g.x??0,y:g.y??0,w:g.w??1,h:g.h??1,minW:g.minW,maxW:g.maxW,minH:g.minH,maxH:g.maxH,static:g.static,isDraggable:g.isDraggable,isResizable:g.isResizable,resizeHandles:g.resizeHandles,isBounded:g.isBounded}):a.push({i:d,x:0,y:nd(a),w:1,h:1})}});const u=rm(a,{cols:n});return r.compact(u,n)}function QE(e){const{children:t,width:n,gridConfig:r,dragConfig:a,resizeConfig:o,dropConfig:u,positionStrategy:c=_N,compactor:d,constraints:f=Hc,layout:p=[],droppingItem:g,autoSize:x=!0,className:E="",style:_={},innerRef:S,onLayoutChange:w=bs,onDragStart:T=bs,onDrag:C=bs,onDragStop:O=bs,onResizeStart:L=bs,onResize:B=bs,onResizeStop:k=bs,onDrop:N=bs,onDropDragOver:R=bs}=e,j=I.useMemo(()=>({...NN,...r}),[r]),M=I.useMemo(()=>({...ON,...a}),[a]),P=I.useMemo(()=>({...DN,...o}),[o]),F=I.useMemo(()=>({...AN,...u}),[u]),{cols:W,rowHeight:V,maxRows:J,margin:K,containerPadding:Z}=j,{enabled:G,bounded:ee,handle:D,cancel:ue,threshold:ae}=M,{enabled:U,handles:Ee,handleComponent:De}=P,{enabled:ve,defaultItem:ze,onDragOver:Ue}=F,Le=d??Ku("vertical"),Ge=Le.type,Fe=Le.allowOverlap,Rt=Le.preventCollision??!1,Et=I.useMemo(()=>g??{i:"__dropping-elem__",...ze},[g,ze]),Cn=c.type==="transform",$t=c.scale,gt=Z??K,[Lt,er]=I.useState(!1),[it,nt]=I.useState(()=>T1(p,t,W,Le)),[vt,Dt]=I.useState(null),[ln,tr]=I.useState(!1),[cn,oe]=I.useState(null),[me,Ae]=I.useState(),Ye=I.useRef(null),Xe=I.useRef(null),yt=I.useRef(null),Vt=I.useRef(0),an=I.useRef(it),kn=I.useRef(p),Hn=I.useRef(t),Mt=I.useRef(Ge),bt=I.useRef(it);bt.current=it,I.useEffect(()=>{er(!0),Es(it,p)||w(it)},[]),I.useEffect(()=>{if(vt||cn)return;const Ne=!Es(p,kn.current),Ve=!cO(t,Hn.current),je=Ge!==Mt.current;if(Ne||Ve||je){const dt=T1(Ne?p:it,t,W,Le);Es(dt,it)||nt(dt)}kn.current=p,Hn.current=t,Mt.current=Ge},[p,t,W,Ge,Le,vt,cn,it]),I.useEffect(()=>{if(!vt&&!Es(it,an.current)){an.current=it;const Ne=it.filter(Ve=>Ve.i!==Et.i);w(Ne)}},[it,vt,w,Et.i]);const dn=I.useMemo(()=>{if(!x)return;const Ne=nd(it),Ve=gt[1];return Ne*V+(Ne-1)*K[1]+Ve*2+"px"},[x,it,V,K,gt]),Cr=I.useCallback((Ne,Ve,je,rt)=>{const dt=bt.current,ot=Pa(dt,Ne);if(!ot)return;const Tt={w:ot.w,h:ot.h,x:ot.x,y:ot.y,i:Ne};Ye.current=ri(ot),yt.current=dt,Dt(Tt),T(dt,ot,ot,null,rt.e,rt.node)},[T]),Pe=I.useCallback((Ne,Ve,je,rt)=>{const dt=bt.current,ot=Ye.current,Tt=Pa(dt,Ne);if(!Tt)return;const wt={w:Tt.w,h:Tt.h,x:Tt.x,y:Tt.y,i:Ne},xt=Ha(dt,Tt,Ve,je,!0,Rt,Ge,W,Fe);C(xt,ot,Tt,wt,rt.e,rt.node),nt(Le.compact(xt,W)),Dt(wt)},[Rt,Ge,W,Fe,Le,C]),Ke=I.useCallback((Ne,Ve,je,rt)=>{if(!vt)return;const dt=bt.current,ot=Ye.current,Tt=Pa(dt,Ne);if(!Tt)return;const wt=Ha(dt,Tt,Ve,je,!0,Rt,Ge,W,Fe),xt=Le.compact(wt,W);O(xt,ot,Tt,null,rt.e,rt.node);const fn=yt.current;Ye.current=null,yt.current=null,Dt(null),nt(xt),fn&&!Es(fn,xt)&&w(xt)},[vt,Rt,Ge,W,Fe,Le,O,w]),be=I.useCallback((Ne,Ve,je,rt)=>{const dt=bt.current,ot=Pa(dt,Ne);ot&&(Xe.current=ri(ot),yt.current=dt,tr(!0),L(dt,ot,ot,null,rt.e,rt.node))},[L]),ke=I.useCallback((Ne,Ve,je,rt)=>{const dt=bt.current,ot=Xe.current,{handle:Tt}=rt;let wt=!1,xt,fn;const[di,dr]=mN(dt,Ne,St=>(xt=St.x,fn=St.y,["sw","w","nw","n","ne"].includes(Tt)&&(["sw","nw","w"].includes(Tt)&&(xt=St.x+(St.w-Ve),Ve=St.x!==xt&&xt<0?St.w:Ve,xt=xt<0?0:xt),["ne","n","nw"].includes(Tt)&&(fn=St.y+(St.h-je),je=St.y!==fn&&fn<0?St.h:je,fn=fn<0?0:fn),wt=!0),Rt&&!Fe&&wE(dt,{...St,w:Ve,h:je,x:xt??St.x,y:fn??St.y}).filter(fi=>fi.i!==St.i).length>0&&(fn=St.y,je=St.h,xt=St.x,Ve=St.w,wt=!1),St.w=Ve,St.h=je,St));if(!dr)return;let As=di;wt&&xt!==void 0&&fn!==void 0&&(As=Ha(di,dr,xt,fn,!0,Rt,Ge,W,Fe));const va={w:dr.w,h:dr.h,x:dr.x,y:dr.y,i:Ne,static:!0};B(As,ot,dr,va,rt.e,rt.node),nt(Le.compact(As,W)),Dt(va)},[Rt,Ge,W,Fe,Le,B]),et=I.useCallback((Ne,Ve,je,rt)=>{const dt=bt.current,ot=Xe.current,Tt=Pa(dt,Ne),wt=Le.compact(dt,W);k(wt,ot,Tt??null,null,rt.e,rt.node);const xt=yt.current;Xe.current=null,yt.current=null,Dt(null),tr(!1),nt(wt),xt&&!Es(xt,wt)&&w(wt)},[W,Le,k,w]),_e=I.useCallback(()=>{const Ne=bt.current;if(!Ne.some(rt=>rt.i===Et.i)){oe(null),Dt(null),Ae(void 0);return}const je=Le.compact(Ne.filter(rt=>rt.i!==Et.i),W);nt(je),oe(null),Dt(null),Ae(void 0)},[Et.i,W,Le]),Pt=I.useCallback(Ne=>{var rl;if(Ne.preventDefault(),Ne.stopPropagation(),VE&&!((rl=Ne.nativeEvent.target)!=null&&rl.classList.contains(v1)))return!1;const Ve=Ue?Ue(Ne.nativeEvent):R(Ne);if(Ve===!1)return cn&&_e(),!1;const{dragOffsetX:je=0,dragOffsetY:rt=0,...dt}=Ve??{},ot={...Et,...dt},Tt=Ne.currentTarget.getBoundingClientRect(),wt={cols:W,margin:K,maxRows:J,rowHeight:V,containerWidth:n,containerPadding:gt},xt=po(wt),fn=io(ot.w,xt,K[0]),di=io(ot.h,V,K[1]),dr=fn/2,As=di/2,va=Ne.clientX-Tt.left+je-dr,St=Ne.clientY-Tt.top+rt-As,vo=Math.max(0,va),fi=Math.max(0,St),Ct={left:vo/$t,top:fi/$t,e:Ne.nativeEvent};if(cn)me&&(me.left!==Ct.left||me.top!==Ct.top)&&Ae(Ct);else{const Ta=cN(wt,fi,vo,ot.w,ot.h);oe(m.jsx("div",{},ot.i)),Ae(Ct),nt([...bt.current,{...ot,x:Ta.x,y:Ta.y,static:!1,isDraggable:!0}])}},[cn,me,Et,Ue,R,_e,$t,W,K,J,V,n,gt]),Qt=I.useCallback(Ne=>{Ne.preventDefault(),Ne.stopPropagation(),Vt.current--,Vt.current<0&&(Vt.current=0),Vt.current===0&&_e()},[_e]),Gt=I.useCallback(Ne=>{Ne.preventDefault(),Ne.stopPropagation(),Vt.current++},[]),Ft=I.useCallback(Ne=>{Ne.preventDefault(),Ne.stopPropagation();const Ve=bt.current,je=Ve.find(rt=>rt.i===Et.i);Vt.current=0,_e(),N(Ve,je,Ne.nativeEvent)},[Et.i,_e,N]),Xt=I.useCallback((Ne,Ve)=>{if(!Ne||!Ne.key)return null;const je=Pa(it,String(Ne.key));if(!je)return null;const rt=typeof je.isDraggable=="boolean"?je.isDraggable:!je.static&&G,dt=typeof je.isResizable=="boolean"?je.isResizable:!je.static&&U,ot=je.resizeHandles||[...Ee],Tt=rt&&ee&&je.isBounded!==!1,wt=De;return m.jsx(E1,{containerWidth:n,cols:W,margin:K,containerPadding:gt,maxRows:J,rowHeight:V,cancel:ue,handle:D,onDragStart:Cr,onDrag:Pe,onDragStop:Ke,onResizeStart:be,onResize:ke,onResizeStop:et,isDraggable:rt,isResizable:dt,isBounded:Tt,useCSSTransforms:Cn&&Lt,usePercentages:!Lt,transformScale:$t,positionStrategy:c,dragThreshold:ae,w:je.w,h:je.h,x:je.x,y:je.y,i:je.i,minH:je.minH,minW:je.minW,maxH:je.maxH,maxW:je.maxW,static:je.static,droppingPosition:Ve?me:void 0,resizeHandles:ot,resizeHandle:wt,constraints:f,layoutItem:je,layout:it,children:Ne},je.i)},[it,n,W,K,gt,J,V,ue,D,Cr,Pe,Ke,be,ke,et,G,U,ee,Cn,Lt,$t,c,ae,me,Ee,De,f]),_n=()=>vt?m.jsx(E1,{w:vt.w,h:vt.h,x:vt.x,y:vt.y,i:vt.i,className:`react-grid-placeholder ${ln?"placeholder-resizing":""}`,containerWidth:n,cols:W,margin:K,containerPadding:gt,maxRows:J,rowHeight:V,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:Cn,transformScale:$t,constraints:f,layout:it,children:m.jsx("div",{})}):null,Un=Sr(v1,E),Ur={height:dn,..._};return m.jsxs("div",{ref:S,className:Un,style:Ur,onDrop:ve?Ft:void 0,onDragLeave:ve?Qt:void 0,onDragEnter:ve?Gt:void 0,onDragOver:ve?Pt:void 0,children:[xe.Children.map(t,Ne=>xe.isValidElement(Ne)?Xt(Ne):null),ve&&cn&&Xt(cn,!0),_n()]})}var dO={lg:1200,md:996,sm:768,xs:480,xxs:0},fO={lg:12,md:10,sm:6,xs:4,xxs:2},vh=()=>{};function hO(e,t,n,r){const a=[];xe.Children.forEach(t,u=>{if(!xe.isValidElement(u)||u.key===null)return;const c=String(u.key),d=e.find(f=>f.i===c);if(d)a.push({...d,i:c});else{const p=u.props["data-grid"];p?a.push({i:c,x:p.x??0,y:p.y??0,w:p.w??1,h:p.h??1,minW:p.minW,maxW:p.maxW,minH:p.minH,maxH:p.maxH,static:p.static,isDraggable:p.isDraggable,isResizable:p.isResizable,resizeHandles:p.resizeHandles,isBounded:p.isBounded}):a.push({i:c,x:0,y:nd(a),w:1,h:1})}});const o=rm(a,{cols:n});return r.compact(o,n)}function mO(e){const{children:t,width:n,breakpoint:r,breakpoints:a=dO,cols:o=fO,layouts:u={},rowHeight:c=150,maxRows:d=1/0,margin:f=[10,10],containerPadding:p=null,compactor:g,onBreakpointChange:x=vh,onLayoutChange:E=vh,onWidthChange:_=vh,...S}=e,w=g??Ku("vertical"),T=w.type,C=w.allowOverlap,O=I.useMemo(()=>r??Jy(a,n),[]),L=I.useMemo(()=>Zy(O,o),[O,o]),B=I.useMemo(()=>gh(u,a,O,O,L,T),[]),[k,N]=I.useState(O),[R,j]=I.useState(L),[M,P]=I.useState(B),[F,W]=I.useState(u),V=I.useRef(n),J=I.useRef(r),K=I.useRef(a),Z=I.useRef(o),G=I.useRef(u),ee=I.useRef(T),D=I.useRef(F);I.useEffect(()=>{D.current=F},[F]);const ue=I.useMemo(()=>Es(u,G.current)?null:gh(u,a,k,k,R,w),[u,a,k,R,w]),ae=ue??M;I.useEffect(()=>{ue!==null&&(P(ue),W(u),D.current=u,G.current=u)},[ue,u]),I.useEffect(()=>{if(T!==ee.current){const ze=w.compact(ba(ae),R),Ue={...D.current,[k]:ze};P(ze),W(Ue),D.current=Ue,E(ze,Ue),ee.current=T}},[T,w,ae,R,C,k,E]),I.useEffect(()=>{const ze=n!==V.current,Ue=r!==J.current,Le=!Es(a,K.current),Ge=!Es(o,Z.current);if(ze||Ue||Le||Ge){const Fe=r??Jy(a,n),Rt=Zy(Fe,o),Et=k;if(Et!==Fe||Le||Ge){const gt={...D.current};gt[Et]||(gt[Et]=ba(M));let Lt=gh(gt,a,Fe,Et,Rt,w);Lt=hO(Lt,t,Rt,w),gt[Fe]=Lt,N(Fe),j(Rt),P(Lt),W(gt),D.current=gt,x(Fe,Rt),E(Lt,gt)}const Cn=bc(f,Fe),$t=p?bc(p,Fe):null;_(n,Cn,Rt,$t),V.current=n,J.current=r,K.current=a,Z.current=o}},[n,r,a,o,k,R,M,t,w,T,C,f,p,x,E,_]);const U=I.useCallback(ze=>{const Le={...D.current,[k]:ze};P(ze),W(Le),D.current=Le,E(ze,Le)},[k,E]),Ee=I.useMemo(()=>bc(f,k),[f,k]),De=I.useMemo(()=>p===null?null:bc(p,k),[p,k]),ve=I.useMemo(()=>({cols:R,rowHeight:c,maxRows:d,margin:Ee,containerPadding:De}),[R,c,d,Ee,De]);return m.jsx(QE,{...S,width:n,gridConfig:ve,compactor:w,onLayoutChange:U,layout:ae,children:t})}function GE(e){const{children:t,width:n,cols:r=12,rowHeight:a=150,maxRows:o=1/0,margin:u=[10,10],containerPadding:c=null,layout:d,droppingItem:f,compactType:p,preventCollision:g=!1,allowOverlap:x=!1,verticalCompact:E,isDraggable:_=!0,isBounded:S=!1,draggableHandle:w,draggableCancel:T,isResizable:C=!0,resizeHandles:O=["se"],resizeHandle:L,isDroppable:B=!1,useCSSTransforms:k=!0,transformScale:N=1,autoSize:R,className:j,style:M,innerRef:P,onLayoutChange:F,onDragStart:W,onDrag:V,onDragStop:J,onResizeStart:K,onResize:Z,onResizeStop:G,onDrop:ee,onDropDragOver:D}=e;let ue=p===void 0?"vertical":p;E===!1&&(ue=null);const ae={cols:r,rowHeight:a,maxRows:o,margin:u,containerPadding:c},U={enabled:_,bounded:S,handle:w,cancel:T,threshold:0},Ee={enabled:C,handles:O,handleComponent:L},De={enabled:B};let ve;k?N!==1?ve=NE(N):ve=lm:ve=_E;const ze=Ku(ue,x,g),Ue=S?[...Hc,yN]:Hc;return m.jsx(QE,{width:n,gridConfig:ae,dragConfig:U,resizeConfig:Ee,dropConfig:De,positionStrategy:ve,compactor:ze,constraints:Ue,layout:d,droppingItem:f,autoSize:R,className:j,style:M,innerRef:P,onLayoutChange:F,onDragStart:W,onDrag:V,onDragStop:J,onResizeStart:K,onResize:Z,onResizeStop:G,onDrop:ee,onDropDragOver:D,children:t})}GE.displayName="ReactGridLayout";var pO=GE;function XE(e){const{children:t,width:n,breakpoint:r,breakpoints:a,cols:o,layouts:u,onBreakpointChange:c,onLayoutChange:d,onWidthChange:f,rowHeight:p,maxRows:g,margin:x,containerPadding:E,droppingItem:_,compactType:S,preventCollision:w=!1,allowOverlap:T=!1,verticalCompact:C,isDraggable:O=!0,isBounded:L=!1,draggableHandle:B,draggableCancel:k,isResizable:N=!0,resizeHandles:R=["se"],resizeHandle:j,isDroppable:M=!1,useCSSTransforms:P=!0,transformScale:F=1,autoSize:W,className:V,style:J,innerRef:K,onDragStart:Z,onDrag:G,onDragStop:ee,onResizeStart:D,onResize:ue,onResizeStop:ae,onDrop:U,onDropDragOver:Ee}=e;let De=S===void 0?"vertical":S;C===!1&&(De=null);const ve={enabled:O,bounded:L,handle:B,cancel:k},ze={enabled:N,handles:R,handleComponent:j},Ue={enabled:M};let Le;P?F!==1?Le=NE(F):Le=lm:Le=_E;const Ge=Ku(De,T,w);return m.jsx(mO,{width:n,breakpoint:r,breakpoints:a,cols:o,layouts:u,rowHeight:p,maxRows:g,margin:x,containerPadding:E,compactor:Ge,dragConfig:ve,resizeConfig:ze,dropConfig:Ue,positionStrategy:Le,droppingItem:_,autoSize:W,className:V,style:J,innerRef:K,onBreakpointChange:c,onLayoutChange:d,onWidthChange:f,onDragStart:Z,onDrag:G,onDragStop:ee,onResizeStart:D,onResize:ue,onResizeStop:ae,onDrop:U,onDropDragOver:Ee,children:t})}XE.displayName="ResponsiveReactGridLayout";var gO=XE;function yO(e){const t=e,n=[...e].sort((f,p)=>f.y-p.y||f.x-p.x),r=[];let a=0,o=0,u=0;for(const f of n){const p=Math.min(f.w,6);o+p>6&&(a+=u,o=0,u=0),r.push({...f,x:o,y:a,w:p}),o+=p,u=Math.max(u,f.h)}const c=[];let d=0;for(const f of n)c.push({...f,x:0,y:d,w:1}),d+=f.h;return{lg:t,md:r,sm:c}}function Th(e,t){if(!t)return e.toLocaleString();const n=t.decimals??0;switch(t.type){case"currency":return new Intl.NumberFormat("en-US",{style:"currency",currency:t.currency||"USD",minimumFractionDigits:n,maximumFractionDigits:n}).format(e);case"percent":return new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:n,maximumFractionDigits:n}).format(e/100);default:return e.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n})}}function bO(e,t){const n=e>=0?"+":"";return t==="percent_change"?`${n}${e.toFixed(1)}%`:`${n}${e.toLocaleString()}`}function xO({chartRef:e}){var C,O,L,B;const{data:t}=sx(e),{data:n,isLoading:r,error:a,isFetching:o}=ix(e),u=F0(),c=()=>{u(e)},d=()=>{if(!n||!t)return;const k=t.name||e;Kc(n.rows,n.columns,k)};if(r)return m.jsx("div",{className:"h-full flex items-center justify-center",children:m.jsx("div",{className:"animate-pulse h-12 w-24 rounded",style:{backgroundColor:"var(--yc-color-surface-hover)"}})});if(a)return m.jsx(jc,{isLoading:!1,error:a,data:void 0,onRetry:c,children:m.jsx("div",{})});if(!((C=n==null?void 0:n.rows)!=null&&C[0]))return m.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"No data available"});const f=n.rows[0],p=t==null?void 0:t.chart;if(!((O=p==null?void 0:p.value)!=null&&O.field))return m.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Invalid KPI config"});const g=f[p.value.field],x=Th(g,p.format);let E=null,_="percent_change",S,w,T;if(n.comparison)E=n.comparison.change,_=n.comparison.changeType,S=n.comparison.currentPeriodLabel,w=n.comparison.previousPeriodLabel,T=Th(n.comparison.previousValue,p.format);else if((L=p.comparison)!=null&&L.enabled&&p.comparison.field){const k=f[p.comparison.field];_=p.comparison.type,k&&k!==0&&(_==="percent_change"?E=(g-k)/k*100:E=g-k,T=Th(k,p.format))}return m.jsxs("div",{className:"h-full flex flex-col p-4 group relative",style:{containerType:"size"},children:[m.jsx("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:m.jsx(EE,{onRefresh:c,onExportCSV:d,onExportPNG:d,onExportSVG:d,isRefreshing:o,hideImageExport:!0})}),m.jsxs("div",{className:"flex-1 flex flex-col justify-center min-h-0",children:[m.jsxs("div",{className:"font-bold leading-tight",style:{color:"var(--yc-color-text)",fontSize:"clamp(1.125rem, min(14cqh, 8cqw), 2rem)"},children:[x,p.unit&&m.jsx("span",{className:"font-normal ml-1",style:{fontSize:"0.6em",color:"var(--yc-color-text-muted)"},children:p.unit})]}),S&&m.jsx("div",{className:"text-xs mt-0.5 truncate",style:{color:"var(--yc-color-text-muted)"},children:S}),m.jsx("a",{href:`#/charts/${e}`,className:"text-sm mt-1 hover:underline line-clamp-2",style:{color:"var(--yc-color-text-secondary)"},children:t==null?void 0:t.title}),E!==null&&m.jsxs("div",{className:"mt-1.5 flex items-center gap-2 flex-wrap relative group/comparison",children:[m.jsx("span",{className:"text-sm font-medium px-2 py-0.5 rounded",style:E>=0?{backgroundColor:"color-mix(in srgb, var(--yc-color-success) 15%, transparent)",color:"var(--yc-color-success)"}:{backgroundColor:"color-mix(in srgb, var(--yc-color-danger) 15%, transparent)",color:"var(--yc-color-danger)"},children:bO(E,_)}),T&&m.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:["vs ",T]}),!T&&((B=p.comparison)==null?void 0:B.label)&&m.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:p.comparison.label}),w&&m.jsx("div",{className:"absolute bottom-full left-0 mb-1.5 hidden group-hover/comparison:block z-10 pointer-events-none",children:m.jsxs("div",{className:"bg-gray-800 text-white text-xs rounded-md px-3 py-2 shadow-lg whitespace-nowrap",children:[m.jsx("div",{className:"font-medium",children:w}),T&&m.jsxs("div",{className:"text-gray-300 mt-0.5",children:["Previous: ",T]})]})})]})]})]})}function EO({chartRef:e}){var Z,G,ee,D,ue;const{data:t,isLoading:n,isFetching:r,error:a}=Kw(e),{data:o}=ii(),u=t==null?void 0:t.config,c=t,d=F0(),f=I.useRef(null),[p,g]=I.useState(!1),x=Qe(ae=>ae.chartFilters),E=Qe(ae=>ae.resetChartFilters),_=Qe(ae=>ae.crossFilters),S=Qe(ae=>ae.setCrossFilter),w=x[e]&&Object.keys(x[e]).length>0,T=I.useCallback((ae,U)=>{S(ae,U,e)},[S,e]),C=I.useMemo(()=>{for(const ae of Object.values(_))if(ae.sourceChart===e)return{field:ae.field,value:ae.value};return null},[_,e]),[O,L]=I.useState(null),B=I.useCallback((ae,U,Ee)=>{var De;(De=u==null?void 0:u.drillDown)!=null&&De.chart&&L({x:Ee.x,y:Ee.y,field:ae,value:U})},[(Z=u==null?void 0:u.drillDown)==null?void 0:Z.chart]),k=I.useCallback(()=>{var Ee,De;if(!O||!((Ee=u==null?void 0:u.drillDown)!=null&&Ee.chart))return;const ae=u.drillDown.field??((De=u.chart.x)==null?void 0:De.field)??O.field,U=new URLSearchParams({[ae]:O.value,_from:e});window.location.hash=`/charts/${u.drillDown.chart}?${U.toString()}`,L(null)},[O,u,e]),N=()=>{d(e)},R=()=>{E(e),g(!1)},j=()=>{if(!c||!u)return;const ae=u.name||e;Kc(c.rows,c.columns,ae)},M=()=>{var U;const ae=(U=f.current)==null?void 0:U.getDataURL("png");ae&&u&&Fc(ae,`${u.name||e}.png`)},P=()=>{var U;const ae=(U=f.current)==null?void 0:U.getDataURL("svg");ae&&u&&Fc(ae,`${u.name||e}.svg`)},F=async()=>{var U;const ae=(U=f.current)==null?void 0:U.getDataURL("png");ae&&u&&await H3(ae,u.name||e,u.title)};if(!u&&a)return m.jsx(jc,{isLoading:!1,error:a,data:void 0,onRetry:()=>d(e),children:m.jsx("div",{})});if(!u||!c)return n?m.jsx("div",{className:"h-full flex items-center justify-center",children:m.jsx("div",{className:"animate-pulse w-full h-full rounded",style:{backgroundColor:"var(--yc-color-surface-hover)"}})}):m.jsxs("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:["Chart not found: ",e]});if(((G=u.chart)==null?void 0:G.type)==="kpi")return m.jsx(xO,{chartRef:e});const W=["line","bar","area","pie","donut","scatter","combo","heatmap","funnel","waterfall","gauge"].includes(u.chart.type),V=(ee=u==null?void 0:u.drillDown)!=null&&ee.chart?B:void 0,J=()=>{switch(u.chart.type){case"line":return!u.chart.x||!u.chart.y&&!u.chart.series?m.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):m.jsx(lE,{ref:f,data:c.rows,columns:c.columns,xAxis:u.chart.x,yAxis:u.chart.y,chartConfig:u.chart,theme:o==null?void 0:o.theme,height:"100%",loading:r,onCrossFilter:T,activeCrossFilter:C,onDrillDown:V});case"bar":return!u.chart.x||!u.chart.y&&!u.chart.series?m.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):m.jsx(cE,{ref:f,data:c.rows,xAxis:u.chart.x,yAxis:u.chart.y,chartConfig:u.chart,theme:o==null?void 0:o.theme,height:"100%",loading:r,onCrossFilter:T,activeCrossFilter:C,onDrillDown:V});case"area":return!u.chart.x||!u.chart.y&&!u.chart.series?m.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):m.jsx(dE,{ref:f,data:c.rows,xAxis:u.chart.x,yAxis:u.chart.y,chartConfig:u.chart,theme:o==null?void 0:o.theme,height:"100%",loading:r,onCrossFilter:T,activeCrossFilter:C,onDrillDown:V});case"pie":return!u.chart.x||!u.chart.y?m.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):m.jsx(fE,{ref:f,data:c.rows,xAxis:u.chart.x,yAxis:u.chart.y,chartConfig:u.chart,theme:o==null?void 0:o.theme,height:"100%",loading:r,onCrossFilter:T,activeCrossFilter:C,onDrillDown:V});case"donut":return!u.chart.x||!u.chart.y?m.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):m.jsx(hE,{ref:f,data:c.rows,xAxis:u.chart.x,yAxis:u.chart.y,centerValue:u.chart.centerValue,chartConfig:u.chart,theme:o==null?void 0:o.theme,height:"100%",loading:r,onCrossFilter:T,activeCrossFilter:C,onDrillDown:V});case"scatter":return!u.chart.x||!u.chart.y?m.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):m.jsx(mE,{ref:f,data:c.rows,xAxis:u.chart.x,yAxis:u.chart.y,chartConfig:u.chart,theme:o==null?void 0:o.theme,height:"100%",loading:r});case"table":return m.jsx(c0,{data:c.rows,columns:c.columns,chartConfig:u.chart,height:"100%",loading:r});case"metric":return u.chart.y?m.jsx(rN,{data:c.rows,yAxis:u.chart.y,title:u.title,loading:r}):m.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing value configuration"});case"combo":return u.chart.x?m.jsx(pE,{ref:f,data:c.rows,xAxis:u.chart.x,chartConfig:u.chart,theme:o==null?void 0:o.theme,height:"100%",loading:r,onCrossFilter:T,activeCrossFilter:C,onDrillDown:V}):m.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"});case"heatmap":return!u.chart.x||!u.chart.y?m.jsx("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-muted)"},children:"Missing axis configuration"}):m.jsx(gE,{ref:f,data:c.rows,chartConfig:u.chart,height:"100%",loading:r});case"funnel":return m.jsx(yE,{ref:f,data:c.rows,chartConfig:u.chart,height:"100%",loading:r});case"waterfall":return m.jsx(bE,{ref:f,data:c.rows,chartConfig:u.chart,height:"100%",loading:r});case"gauge":return m.jsx(xE,{ref:f,data:c.rows,chartConfig:u.chart,height:"100%",loading:r});default:return m.jsxs("div",{className:"h-full flex items-center justify-center text-sm",style:{color:"var(--yc-color-text-secondary)"},children:['Chart type "',u.chart.type,'" not yet implemented']})}},K=u.parameters&&u.parameters.length>0;return m.jsx(tm,{fallback:(ae,U)=>m.jsx("div",{className:"h-full flex items-center justify-center p-4",children:m.jsxs("div",{className:"text-center",children:[m.jsx("p",{className:"text-sm font-medium",style:{color:"var(--yc-color-danger)"},children:"Failed to render chart"}),m.jsx("p",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-secondary)"},children:ae.message}),m.jsx("button",{onClick:U,className:"mt-2 text-xs text-blue-600 hover:text-blue-700",children:"Retry"})]})}),resetKey:e,children:m.jsxs("div",{className:"h-full p-2 flex flex-col group",children:[m.jsxs("div",{className:"flex items-center justify-between mb-2 px-2 flex-shrink-0",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("a",{href:`#/charts/${e}`,className:"text-sm font-medium hover:underline",style:{color:"var(--yc-color-text)"},children:u.title}),((D=u==null?void 0:u.drillDown)==null?void 0:D.chart)&&m.jsxs("svg",{className:"w-3.5 h-3.5 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:[m.jsx("title",{children:"Right-click to drill down"}),m.jsx("path",{fillRule:"evenodd",d:"M5.22 14.78a.75.75 0 001.06 0l7.22-7.22v5.69a.75.75 0 001.5 0v-7.5a.75.75 0 00-.75-.75h-7.5a.75.75 0 000 1.5h5.69l-7.22 7.22a.75.75 0 000 1.06z",clipRule:"evenodd"})]}),w&&m.jsx("span",{className:"text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded",children:"Filtered"})]}),m.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity",children:[K&&m.jsx("button",{onClick:()=>g(!p),className:`p-1.5 rounded hover:bg-black/5 ${p?"bg-black/5":""}`,title:p?"Hide filters":"Override filters",children:m.jsx("svg",{className:"w-4 h-4",style:{color:"var(--yc-color-text-secondary)"},fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z"})})}),m.jsx(EE,{onRefresh:N,onExportCSV:j,onExportPNG:W?M:j,onExportSVG:W?P:j,onExportPDF:W?F:void 0,isRefreshing:r})]})]}),p&&K&&m.jsx("div",{className:"mb-2 px-2 flex-shrink-0",children:m.jsxs("div",{className:"flex items-end gap-2 flex-wrap",children:[m.jsx(iE,{parameters:u.parameters,chartName:e}),w&&m.jsx("button",{onClick:R,className:"px-2 py-1.5 text-xs hover:bg-black/5 rounded",style:{color:"var(--yc-color-text-secondary)"},children:"Reset to dashboard"})]})}),m.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:m.jsx(jc,{isLoading:n,error:a,data:c==null?void 0:c.rows,onRetry:()=>d(e),children:J()})}),O&&((ue=u==null?void 0:u.drillDown)==null?void 0:ue.chart)&&m.jsx(vE,{x:O.x,y:O.y,targetChartTitle:u.drillDown.chart,onDrillDown:k,onClose:()=>L(null)})]})})}var KE=$c();function w1(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const u=n.slice(a,r).trim();(u||!o)&&t.push(u),a=r+1,r=n.indexOf(",",a)}return t}function JE(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const vO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,TO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wO={};function S1(e,t){return(wO.jsx?TO:vO).test(e)}const SO=/[ \t\n\f\r]/g;function CO(e){return typeof e=="object"?e.type==="text"?C1(e.value):!1:C1(e)}function C1(e){return e.replace(SO,"")===""}class Ju{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ju.prototype.normal={};Ju.prototype.property={};Ju.prototype.space=void 0;function ZE(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Ju(n,r,t)}function Lu(e){return e.toLowerCase()}class Zn{constructor(t,n){this.attribute=n,this.property=t}}Zn.prototype.attribute="";Zn.prototype.booleanish=!1;Zn.prototype.boolean=!1;Zn.prototype.commaOrSpaceSeparated=!1;Zn.prototype.commaSeparated=!1;Zn.prototype.defined=!1;Zn.prototype.mustUseProperty=!1;Zn.prototype.number=!1;Zn.prototype.overloadedBoolean=!1;Zn.prototype.property="";Zn.prototype.spaceSeparated=!1;Zn.prototype.space=void 0;let kO=0;const Je=li(),un=li(),f0=li(),pe=li(),Nt=li(),Hi=li(),ir=li();function li(){return 2**++kO}const h0=Object.freeze(Object.defineProperty({__proto__:null,boolean:Je,booleanish:un,commaOrSpaceSeparated:ir,commaSeparated:Hi,number:pe,overloadedBoolean:f0,spaceSeparated:Nt},Symbol.toStringTag,{value:"Module"})),wh=Object.keys(h0);class hm extends Zn{constructor(t,n,r,a){let o=-1;if(super(t,n),k1(this,"space",a),typeof r=="number")for(;++o<wh.length;){const u=wh[o];k1(this,wh[o],(r&h0[u])===h0[u])}}}hm.prototype.defined=!0;function k1(e,t,n){n&&(e[t]=n)}function go(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const o=new hm(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Lu(r)]=r,n[Lu(o.attribute)]=r}return new Ju(t,n,e.space)}const e2=go({properties:{ariaActiveDescendant:null,ariaAtomic:un,ariaAutoComplete:null,ariaBusy:un,ariaChecked:un,ariaColCount:pe,ariaColIndex:pe,ariaColSpan:pe,ariaControls:Nt,ariaCurrent:null,ariaDescribedBy:Nt,ariaDetails:null,ariaDisabled:un,ariaDropEffect:Nt,ariaErrorMessage:null,ariaExpanded:un,ariaFlowTo:Nt,ariaGrabbed:un,ariaHasPopup:null,ariaHidden:un,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Nt,ariaLevel:pe,ariaLive:null,ariaModal:un,ariaMultiLine:un,ariaMultiSelectable:un,ariaOrientation:null,ariaOwns:Nt,ariaPlaceholder:null,ariaPosInSet:pe,ariaPressed:un,ariaReadOnly:un,ariaRelevant:null,ariaRequired:un,ariaRoleDescription:Nt,ariaRowCount:pe,ariaRowIndex:pe,ariaRowSpan:pe,ariaSelected:un,ariaSetSize:pe,ariaSort:null,ariaValueMax:pe,ariaValueMin:pe,ariaValueNow:pe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function t2(e,t){return t in e?e[t]:t}function n2(e,t){return t2(e,t.toLowerCase())}const _O=go({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Hi,acceptCharset:Nt,accessKey:Nt,action:null,allow:null,allowFullScreen:Je,allowPaymentRequest:Je,allowUserMedia:Je,alt:null,as:null,async:Je,autoCapitalize:null,autoComplete:Nt,autoFocus:Je,autoPlay:Je,blocking:Nt,capture:null,charSet:null,checked:Je,cite:null,className:Nt,cols:pe,colSpan:null,content:null,contentEditable:un,controls:Je,controlsList:Nt,coords:pe|Hi,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Je,defer:Je,dir:null,dirName:null,disabled:Je,download:f0,draggable:un,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Je,formTarget:null,headers:Nt,height:pe,hidden:f0,high:pe,href:null,hrefLang:null,htmlFor:Nt,httpEquiv:Nt,id:null,imageSizes:null,imageSrcSet:null,inert:Je,inputMode:null,integrity:null,is:null,isMap:Je,itemId:null,itemProp:Nt,itemRef:Nt,itemScope:Je,itemType:Nt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Je,low:pe,manifest:null,max:null,maxLength:pe,media:null,method:null,min:null,minLength:pe,multiple:Je,muted:Je,name:null,nonce:null,noModule:Je,noValidate:Je,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:Je,optimum:pe,pattern:null,ping:Nt,placeholder:null,playsInline:Je,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Je,referrerPolicy:null,rel:Nt,required:Je,reversed:Je,rows:pe,rowSpan:pe,sandbox:Nt,scope:null,scoped:Je,seamless:Je,selected:Je,shadowRootClonable:Je,shadowRootDelegatesFocus:Je,shadowRootMode:null,shape:null,size:pe,sizes:null,slot:null,span:pe,spellCheck:un,src:null,srcDoc:null,srcLang:null,srcSet:null,start:pe,step:null,style:null,tabIndex:pe,target:null,title:null,translate:null,type:null,typeMustMatch:Je,useMap:null,value:un,width:pe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Nt,axis:null,background:null,bgColor:null,border:pe,borderColor:null,bottomMargin:pe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Je,declare:Je,event:null,face:null,frame:null,frameBorder:null,hSpace:pe,leftMargin:pe,link:null,longDesc:null,lowSrc:null,marginHeight:pe,marginWidth:pe,noResize:Je,noHref:Je,noShade:Je,noWrap:Je,object:null,profile:null,prompt:null,rev:null,rightMargin:pe,rules:null,scheme:null,scrolling:un,standby:null,summary:null,text:null,topMargin:pe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:pe,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Je,disableRemotePlayback:Je,prefix:null,property:null,results:pe,security:null,unselectable:null},space:"html",transform:n2}),NO=go({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ir,accentHeight:pe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:pe,amplitude:pe,arabicForm:null,ascent:pe,attributeName:null,attributeType:null,azimuth:pe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:pe,by:null,calcMode:null,capHeight:pe,className:Nt,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:pe,diffuseConstant:pe,direction:null,display:null,dur:null,divisor:pe,dominantBaseline:null,download:Je,dx:null,dy:null,edgeMode:null,editable:null,elevation:pe,enableBackground:null,end:null,event:null,exponent:pe,externalResourcesRequired:null,fill:null,fillOpacity:pe,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:Hi,g2:Hi,glyphName:Hi,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:pe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:pe,horizOriginX:pe,horizOriginY:pe,id:null,ideographic:pe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:pe,k:pe,k1:pe,k2:pe,k3:pe,k4:pe,kernelMatrix:ir,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:pe,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:pe,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:pe,overlineThickness:pe,paintOrder:null,panose1:null,path:null,pathLength:pe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Nt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:pe,pointsAtY:pe,pointsAtZ:pe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ir,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ir,rev:ir,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ir,requiredFeatures:ir,requiredFonts:ir,requiredFormats:ir,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:pe,specularExponent:pe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:pe,strikethroughThickness:pe,string:null,stroke:null,strokeDashArray:ir,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:pe,strokeOpacity:pe,strokeWidth:null,style:null,surfaceScale:pe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ir,tabIndex:pe,tableValues:null,target:null,targetX:pe,targetY:pe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ir,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:pe,underlineThickness:pe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:pe,values:null,vAlphabetic:pe,vMathematical:pe,vectorEffect:null,vHanging:pe,vIdeographic:pe,version:null,vertAdvY:pe,vertOriginX:pe,vertOriginY:pe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:pe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:t2}),r2=go({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()}}),s2=go({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:n2}),a2=go({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),OO={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"},DO=/[A-Z]/g,_1=/-[a-z]/g,AO=/^data[-\w.:]+$/i;function ld(e,t){const n=Lu(t);let r=t,a=Zn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&AO.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(_1,RO);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!_1.test(o)){let u=o.replace(DO,IO);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}a=hm}return new a(r,t)}function IO(e){return"-"+e.toLowerCase()}function RO(e){return e.charAt(1).toUpperCase()}const Zu=ZE([e2,_O,r2,s2,a2],"html"),xa=ZE([e2,NO,r2,s2,a2],"svg");function N1(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function i2(e){return e.join(" ").trim()}var Fi={},Sh,O1;function LO(){if(O1)return Sh;O1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
96
- `,f="/",p="*",g="",x="comment",E="declaration";function _(w,T){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];T=T||{};var C=1,O=1;function L(V){var J=V.match(t);J&&(C+=J.length);var K=V.lastIndexOf(d);O=~K?V.length-K:O+V.length}function B(){var V={line:C,column:O};return function(J){return J.position=new k(V),j(),J}}function k(V){this.start=V,this.end={line:C,column:O},this.source=T.source}k.prototype.content=w;function N(V){var J=new Error(T.source+":"+C+":"+O+": "+V);if(J.reason=V,J.filename=T.source,J.line=C,J.column=O,J.source=w,!T.silent)throw J}function R(V){var J=V.exec(w);if(J){var K=J[0];return L(K),w=w.slice(K.length),J}}function j(){R(n)}function M(V){var J;for(V=V||[];J=P();)J!==!1&&V.push(J);return V}function P(){var V=B();if(!(f!=w.charAt(0)||p!=w.charAt(1))){for(var J=2;g!=w.charAt(J)&&(p!=w.charAt(J)||f!=w.charAt(J+1));)++J;if(J+=2,g===w.charAt(J-1))return N("End of comment missing");var K=w.slice(2,J-2);return O+=2,L(K),w=w.slice(J),O+=2,V({type:x,comment:K})}}function F(){var V=B(),J=R(r);if(J){if(P(),!R(a))return N("property missing ':'");var K=R(o),Z=V({type:E,property:S(J[0].replace(e,g)),value:K?S(K[0].replace(e,g)):g});return R(u),Z}}function W(){var V=[];M(V);for(var J;J=F();)J!==!1&&(V.push(J),M(V));return V}return j(),W()}function S(w){return w?w.replace(c,g):g}return Sh=_,Sh}var D1;function MO(){if(D1)return Fi;D1=1;var e=Fi&&Fi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.default=n;const t=e(LO());function n(r,a){let o=null;if(!r||typeof r!="string")return o;const u=(0,t.default)(r),c=typeof a=="function";return u.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;c?a(f,p,d):p&&(o=o||{},o[f]=p)}),o}return Fi}var hu={},A1;function PO(){if(A1)return hu;A1=1,Object.defineProperty(hu,"__esModule",{value:!0}),hu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(f){return!f||n.test(f)||e.test(f)},u=function(f,p){return p.toUpperCase()},c=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),o(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(a,c):f=f.replace(r,c),f.replace(t,u))};return hu.camelCase=d,hu}var mu,I1;function FO(){if(I1)return mu;I1=1;var e=mu&&mu.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(MO()),n=PO();function r(a,o){var u={};return!a||typeof a!="string"||(0,t.default)(a,function(c,d){c&&d&&(u[(0,n.camelCase)(c,o)]=d)}),u}return r.default=r,mu=r,mu}var jO=FO();const BO=Hb(jO),cd=o2("end"),ls=o2("start");function o2(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 HO(e){const t=ls(e),n=cd(e);if(t&&n)return{start:t,end:n}}function wu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?R1(e.position):"start"in e||"end"in e?R1(e):"line"in e||"column"in e?m0(e):""}function m0(e){return L1(e&&e.line)+":"+L1(e&&e.column)}function R1(e){return m0(e&&e.start)+"-"+m0(e&&e.end)}function L1(e){return e&&typeof e=="number"?e:1}class Mn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",o={},u=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?a=t:!o.cause&&t&&(u=!0,a=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?o.ruleId=r:(o.source=r.slice(0,d),o.ruleId=r.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const c=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=c?c.line:void 0,this.name=wu(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Mn.prototype.file="";Mn.prototype.name="";Mn.prototype.reason="";Mn.prototype.message="";Mn.prototype.stack="";Mn.prototype.column=void 0;Mn.prototype.line=void 0;Mn.prototype.ancestors=void 0;Mn.prototype.cause=void 0;Mn.prototype.fatal=void 0;Mn.prototype.place=void 0;Mn.prototype.ruleId=void 0;Mn.prototype.source=void 0;const mm={}.hasOwnProperty,UO=new Map,zO=/[A-Z]/g,WO=new Set(["table","tbody","thead","tfoot","tr"]),YO=new Set(["td","th"]),u2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function qO(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=ZO(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=JO(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?xa:Zu,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=l2(a,e,void 0);return o&&typeof o!="string"?o:a.create(e,a.Fragment,{children:o||void 0},void 0)}function l2(e,t,n){if(t.type==="element")return $O(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return VO(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return GO(e,t,n);if(t.type==="mdxjsEsm")return QO(e,t);if(t.type==="root")return XO(e,t,n);if(t.type==="text")return KO(e,t)}function $O(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=xa,e.schema=a),e.ancestors.push(t);const o=d2(e,t.tagName,!1),u=e4(e,t);let c=gm(e,t);return WO.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!CO(d):!0})),c2(e,u,o,t),pm(u,c),e.ancestors.pop(),e.schema=r,e.create(t,o,u,n)}function VO(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)}Mu(e,t.position)}function QO(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Mu(e,t.position)}function GO(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=xa,e.schema=a),e.ancestors.push(t);const o=t.name===null?e.Fragment:d2(e,t.name,!0),u=t4(e,t),c=gm(e,t);return c2(e,u,o,t),pm(u,c),e.ancestors.pop(),e.schema=r,e.create(t,o,u,n)}function XO(e,t,n){const r={};return pm(r,gm(e,t)),e.create(t,e.Fragment,r,n)}function KO(e,t){return t.value}function c2(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function pm(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function JO(e,t,n){return r;function r(a,o,u,c){const f=Array.isArray(u.children)?n:t;return c?f(o,u,c):f(o,u)}}function ZO(e,t){return n;function n(r,a,o,u){const c=Array.isArray(o.children),d=ls(r);return t(a,o,u,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function e4(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&mm.call(t.properties,a)){const o=n4(e,a,t.properties[a]);if(o){const[u,c]=o;e.tableCellAlignToStyle&&u==="align"&&typeof c=="string"&&YO.has(t.tagName)?r=c:n[u]=c}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function t4(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const u=o.expression;u.type;const c=u.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Mu(e,t.position);else{const a=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,o=e.evaluater.evaluateExpression(c.expression)}else Mu(e,t.position);else o=r.value===null?!0:r.value;n[a]=o}return n}function gm(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:UO;for(;++r<t.children.length;){const o=t.children[r];let u;if(e.passKeys){const d=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(d){const f=a.get(d)||0;u=d+"-"+f,a.set(d,f+1)}}const c=l2(e,o,u);c!==void 0&&n.push(c)}return n}function n4(e,t,n){const r=ld(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?JE(n):i2(n)),r.property==="style"){let a=typeof n=="object"?n:r4(e,String(n));return e.stylePropertyNameCase==="css"&&(a=s4(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?OO[r.property]||r.property:r.attribute,n]}}function r4(e,t){try{return BO(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new Mn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=u2+"#cannot-parse-style-attribute",a}}function d2(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let o=-1,u;for(;++o<a.length;){const c=S1(a[o])?{type:"Identifier",name:a[o]}:{type:"Literal",value:a[o]};u=u?{type:"MemberExpression",object:u,property:c,computed:!!(o&&c.type==="Literal"),optional:!1}:c}r=u}else r=S1(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return mm.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Mu(e)}function Mu(e,t){const n=new Mn("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=u2+"#cannot-handle-mdx-estrees-without-createevaluater",n}function s4(e){const t={};let n;for(n in e)mm.call(e,n)&&(t[a4(n)]=e[n]);return t}function a4(e){let t=e.replace(zO,i4);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function i4(e){return"-"+e.toLowerCase()}const Ch={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"]},o4={};function u4(e,t){const n=o4,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return f2(e,r,a)}function f2(e,t,n){if(l4(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 M1(e.children,t,n)}return Array.isArray(e)?M1(e,t,n):""}function M1(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=f2(e[a],t,n);return r.join("")}function l4(e){return!!(e&&typeof e=="object")}const P1=document.createElement("i");function ym(e){const t="&"+e+";";P1.innerHTML=t;const n=P1.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function as(e,t,n,r){const a=e.length;let o=0,u;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)u=Array.from(r),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);o<r.length;)u=r.slice(o,o+1e4),u.unshift(t,0),e.splice(...u),o+=1e4,t+=1e4}function Tr(e,t){return e.length>0?(as(e,e.length,0,t),e):t}const F1={}.hasOwnProperty;function c4(e){const t={};let n=-1;for(;++n<e.length;)d4(t,e[n]);return t}function d4(e,t){let n;for(n in t){const a=(F1.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let u;if(o)for(u in o){F1.call(a,u)||(a[u]=[]);const c=o[u];f4(a[u],Array.isArray(c)?c:c?[c]:[])}}}function f4(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);as(e,0,0,r)}function h2(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 Ui(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ns=Ea(/[A-Za-z]/),lr=Ea(/[\dA-Za-z]/),h4=Ea(/[#-'*+\--9=?A-Z^-~]/);function p0(e){return e!==null&&(e<32||e===127)}const g0=Ea(/\d/),m4=Ea(/[\dA-Fa-f]/),p4=Ea(/[!-/:-@[-`{-~]/);function $e(e){return e!==null&&e<-2}function Jn(e){return e!==null&&(e<0||e===32)}function lt(e){return e===-2||e===-1||e===32}const g4=Ea(new RegExp("\\p{P}|\\p{S}","u")),y4=Ea(/\s/);function Ea(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,a=0;for(;++n<e.length;){const o=e.charCodeAt(n);let u="";if(o===37&&lr(e.charCodeAt(n+1))&&lr(e.charCodeAt(n+2)))a=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const c=e.charCodeAt(n+1);o<56320&&c>56319&&c<57344?(u=String.fromCharCode(o,c),a=1):u="�"}else u=String.fromCharCode(o);u&&(t.push(e.slice(r,n),encodeURIComponent(u)),r=n+a+1,u=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function Ot(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(d){return lt(d)?(e.enter(n),c(d)):t(d)}function c(d){return lt(d)&&o++<a?(e.consume(d),c):(e.exit(n),t(d))}}const b4={tokenize:x4};function x4(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Ot(e,t,"linePrefix")}function a(c){return e.enter("paragraph"),o(c)}function o(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,u(c)}function u(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return $e(c)?(e.consume(c),e.exit("chunkText"),o):(e.consume(c),u)}}const E4={tokenize:v4},j1={tokenize:T4};function v4(e){const t=this,n=[];let r=0,a,o,u;return c;function c(O){if(r<n.length){const L=n[r];return t.containerState=L[1],e.attempt(L[0].continuation,d,f)(O)}return f(O)}function d(O){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&C();const L=t.events.length;let B=L,k;for(;B--;)if(t.events[B][0]==="exit"&&t.events[B][1].type==="chunkFlow"){k=t.events[B][1].end;break}T(r);let N=L;for(;N<t.events.length;)t.events[N][1].end={...k},N++;return as(t.events,B+1,0,t.events.slice(L)),t.events.length=N,f(O)}return c(O)}function f(O){if(r===n.length){if(!a)return x(O);if(a.currentConstruct&&a.currentConstruct.concrete)return _(O);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(j1,p,g)(O)}function p(O){return a&&C(),T(r),x(O)}function g(O){return t.parser.lazy[t.now().line]=r!==n.length,u=t.now().offset,_(O)}function x(O){return t.containerState={},e.attempt(j1,E,_)(O)}function E(O){return r++,n.push([t.currentConstruct,t.containerState]),x(O)}function _(O){if(O===null){a&&C(),T(0),e.consume(O);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:o}),S(O)}function S(O){if(O===null){w(e.exit("chunkFlow"),!0),T(0),e.consume(O);return}return $e(O)?(e.consume(O),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(O),S)}function w(O,L){const B=t.sliceStream(O);if(L&&B.push(null),O.previous=o,o&&(o.next=O),o=O,a.defineSkip(O.start),a.write(B),t.parser.lazy[O.start.line]){let k=a.events.length;for(;k--;)if(a.events[k][1].start.offset<u&&(!a.events[k][1].end||a.events[k][1].end.offset>u))return;const N=t.events.length;let R=N,j,M;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if(j){M=t.events[R][1].end;break}j=!0}for(T(r),k=N;k<t.events.length;)t.events[k][1].end={...M},k++;as(t.events,R+1,0,t.events.slice(N)),t.events.length=k}}function T(O){let L=n.length;for(;L-- >O;){const B=n[L];t.containerState=B[1],B[0].exit.call(t,e)}n.length=O}function C(){a.write([null]),o=void 0,a=void 0,t.containerState._closeFlow=void 0}}function T4(e,t,n){return Ot(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function B1(e){if(e===null||Jn(e)||y4(e))return 1;if(g4(e))return 2}function bm(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const o=e[a].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const y0={name:"attention",resolveAll:w4,tokenize:S4};function w4(e,t){let n=-1,r,a,o,u,c,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[r][1].end},x={...e[n][1].start};H1(g,-d),H1(x,d),u={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:x},o={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:d>1?"strong":"emphasis",start:{...u.start},end:{...c.end}},e[r][1].end={...u.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Tr(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Tr(f,[["enter",a,t],["enter",u,t],["exit",u,t],["enter",o,t]]),f=Tr(f,bm(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Tr(f,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=Tr(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,as(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function S4(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=B1(r);let o;return u;function u(d){return o=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===o)return e.consume(d),c;const f=e.exit("attentionSequence"),p=B1(d),g=!p||p===2&&a||n.includes(d),x=!a||a===2&&p||n.includes(r);return f._open=!!(o===42?g:g&&(a||!x)),f._close=!!(o===42?x:x&&(p||!g)),t(d)}}function H1(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const C4={name:"autolink",tokenize:k4};function k4(e,t,n){let r=0;return a;function a(E){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(E){return ns(E)?(e.consume(E),u):E===64?n(E):f(E)}function u(E){return E===43||E===45||E===46||lr(E)?(r=1,c(E)):f(E)}function c(E){return E===58?(e.consume(E),r=0,d):(E===43||E===45||E===46||lr(E))&&r++<32?(e.consume(E),c):(r=0,f(E))}function d(E){return E===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.exit("autolink"),t):E===null||E===32||E===60||p0(E)?n(E):(e.consume(E),d)}function f(E){return E===64?(e.consume(E),p):h4(E)?(e.consume(E),f):n(E)}function p(E){return lr(E)?g(E):n(E)}function g(E){return E===46?(e.consume(E),r=0,p):E===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(E),e.exit("autolinkMarker"),e.exit("autolink"),t):x(E)}function x(E){if((E===45||lr(E))&&r++<63){const _=E===45?x:g;return e.consume(E),_}return n(E)}}const dd={partial:!0,tokenize:_4};function _4(e,t,n){return r;function r(o){return lt(o)?Ot(e,a,"linePrefix")(o):a(o)}function a(o){return o===null||$e(o)?t(o):n(o)}}const m2={continuation:{tokenize:O4},exit:D4,name:"blockQuote",tokenize:N4};function N4(e,t,n){const r=this;return a;function a(u){if(u===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return n(u)}function o(u){return lt(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function O4(e,t,n){const r=this;return a;function a(u){return lt(u)?Ot(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(m2,t,n)(u)}}function D4(e){e.exit("blockQuote")}const p2={name:"characterEscape",tokenize:A4};function A4(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),a}function a(o){return p4(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const g2={name:"characterReference",tokenize:I4};function I4(e,t,n){const r=this;let a=0,o,u;return c;function c(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),d}function d(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),o=31,u=lr,p(g))}function f(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=m4,p):(e.enter("characterReferenceValue"),o=7,u=g0,p(g))}function p(g){if(g===59&&a){const x=e.exit("characterReferenceValue");return u===lr&&!ym(r.sliceSerialize(x))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(g)&&a++<o?(e.consume(g),p):n(g)}}const U1={partial:!0,tokenize:L4},z1={concrete:!0,name:"codeFenced",tokenize:R4};function R4(e,t,n){const r=this,a={partial:!0,tokenize:B};let o=0,u=0,c;return d;function d(k){return f(k)}function f(k){const N=r.events[r.events.length-1];return o=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,c=k,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(k)}function p(k){return k===c?(u++,e.consume(k),p):u<3?n(k):(e.exit("codeFencedFenceSequence"),lt(k)?Ot(e,g,"whitespace")(k):g(k))}function g(k){return k===null||$e(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(U1,S,L)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(k))}function x(k){return k===null||$e(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(k)):lt(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ot(e,E,"whitespace")(k)):k===96&&k===c?n(k):(e.consume(k),x)}function E(k){return k===null||$e(k)?g(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),_(k))}function _(k){return k===null||$e(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(k)):k===96&&k===c?n(k):(e.consume(k),_)}function S(k){return e.attempt(a,L,w)(k)}function w(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),T}function T(k){return o>0&&lt(k)?Ot(e,C,"linePrefix",o+1)(k):C(k)}function C(k){return k===null||$e(k)?e.check(U1,S,L)(k):(e.enter("codeFlowValue"),O(k))}function O(k){return k===null||$e(k)?(e.exit("codeFlowValue"),C(k)):(e.consume(k),O)}function L(k){return e.exit("codeFenced"),t(k)}function B(k,N,R){let j=0;return M;function M(J){return k.enter("lineEnding"),k.consume(J),k.exit("lineEnding"),P}function P(J){return k.enter("codeFencedFence"),lt(J)?Ot(k,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(J):F(J)}function F(J){return J===c?(k.enter("codeFencedFenceSequence"),W(J)):R(J)}function W(J){return J===c?(j++,k.consume(J),W):j>=u?(k.exit("codeFencedFenceSequence"),lt(J)?Ot(k,V,"whitespace")(J):V(J)):R(J)}function V(J){return J===null||$e(J)?(k.exit("codeFencedFence"),N(J)):R(J)}}}function L4(e,t,n){const r=this;return a;function a(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}const kh={name:"codeIndented",tokenize:P4},M4={partial:!0,tokenize:F4};function P4(e,t,n){const r=this;return a;function a(f){return e.enter("codeIndented"),Ot(e,o,"linePrefix",5)(f)}function o(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?u(f):n(f)}function u(f){return f===null?d(f):$e(f)?e.attempt(M4,u,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||$e(f)?(e.exit("codeFlowValue"),u(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function F4(e,t,n){const r=this;return a;function a(u){return r.parser.lazy[r.now().line]?n(u):$e(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):Ot(e,o,"linePrefix",5)(u)}function o(u){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(u):$e(u)?a(u):n(u)}}const j4={name:"codeText",previous:H4,resolve:B4,tokenize:U4};function B4(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function H4(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function U4(e,t,n){let r=0,a,o;return u;function u(g){return e.enter("codeText"),e.enter("codeTextSequence"),c(g)}function c(g){return g===96?(e.consume(g),r++,c):(e.exit("codeTextSequence"),d(g))}function d(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),d):g===96?(o=e.enter("codeTextSequence"),a=0,p(g)):$e(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(g))}function f(g){return g===null||g===32||g===96||$e(g)?(e.exit("codeTextData"),d(g)):(e.consume(g),f)}function p(g){return g===96?(e.consume(g),a++,p):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",f(g))}}class z4{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&pu(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),pu(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),pu(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);pu(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);pu(this.left,n.reverse())}}}function pu(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 y2(e){const t={};let n=-1,r,a,o,u,c,d,f;const p=new z4(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,o=0,o<d.length&&d[o][1].type==="lineEndingBlank"&&(o+=2),o<d.length&&d[o][1].type==="content"))for(;++o<d.length&&d[o][1].type!=="content";)d[o][1].type==="chunkText"&&(d[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,W4(p,n)),n=t[n],f=!0);else if(r[1]._container){for(o=n,a=void 0;o--;)if(u=p.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(a&&(p.get(a)[1].type="lineEndingBlank"),u[1].type="lineEnding",a=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;a&&(r[1].end={...p.get(a)[1].start},c=p.slice(a,n),c.unshift(r),p.splice(a,n-a+1,c))}}return as(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function W4(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const o=[];let u=n._tokenizer;u||(u=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const c=u.events,d=[],f={};let p,g,x=-1,E=n,_=0,S=0;const w=[S];for(;E;){for(;e.get(++a)[1]!==E;);o.push(a),E._tokenizer||(p=r.sliceStream(E),E.next||p.push(null),g&&u.defineSkip(E.start),E._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(p),E._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),g=E,E=E.next}for(E=n;++x<c.length;)c[x][0]==="exit"&&c[x-1][0]==="enter"&&c[x][1].type===c[x-1][1].type&&c[x][1].start.line!==c[x][1].end.line&&(S=x+1,w.push(S),E._tokenizer=void 0,E.previous=void 0,E=E.next);for(u.events=[],E?(E._tokenizer=void 0,E.previous=void 0):w.pop(),x=w.length;x--;){const T=c.slice(w[x],w[x+1]),C=o.pop();d.push([C,C+T.length-1]),e.splice(C,2,T)}for(d.reverse(),x=-1;++x<d.length;)f[_+d[x][0]]=_+d[x][1],_+=d[x][1]-d[x][0]-1;return f}const Y4={resolve:$4,tokenize:V4},q4={partial:!0,tokenize:Q4};function $4(e){return y2(e),e}function V4(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(c)}function a(c){return c===null?o(c):$e(c)?e.check(q4,u,o)(c):(e.consume(c),a)}function o(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function u(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function Q4(e,t,n){const r=this;return a;function a(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Ot(e,o,"linePrefix")}function o(u){if(u===null||$e(u))return n(u);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(u):e.interrupt(r.parser.constructs.flow,n,t)(u)}}function b2(e,t,n,r,a,o,u,c,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return g;function g(T){return T===60?(e.enter(r),e.enter(a),e.enter(o),e.consume(T),e.exit(o),x):T===null||T===32||T===41||p0(T)?n(T):(e.enter(r),e.enter(u),e.enter(c),e.enter("chunkString",{contentType:"string"}),S(T))}function x(T){return T===62?(e.enter(o),e.consume(T),e.exit(o),e.exit(a),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),E(T))}function E(T){return T===62?(e.exit("chunkString"),e.exit(c),x(T)):T===null||T===60||$e(T)?n(T):(e.consume(T),T===92?_:E)}function _(T){return T===60||T===62||T===92?(e.consume(T),E):E(T)}function S(T){return!p&&(T===null||T===41||Jn(T))?(e.exit("chunkString"),e.exit(c),e.exit(u),e.exit(r),t(T)):p<f&&T===40?(e.consume(T),p++,S):T===41?(e.consume(T),p--,S):T===null||T===32||T===40||p0(T)?n(T):(e.consume(T),T===92?w:S)}function w(T){return T===40||T===41||T===92?(e.consume(T),S):S(T)}}function x2(e,t,n,r,a,o){const u=this;let c=0,d;return f;function f(E){return e.enter(r),e.enter(a),e.consume(E),e.exit(a),e.enter(o),p}function p(E){return c>999||E===null||E===91||E===93&&!d||E===94&&!c&&"_hiddenFootnoteSupport"in u.parser.constructs?n(E):E===93?(e.exit(o),e.enter(a),e.consume(E),e.exit(a),e.exit(r),t):$e(E)?(e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===null||E===91||E===93||$e(E)||c++>999?(e.exit("chunkString"),p(E)):(e.consume(E),d||(d=!lt(E)),E===92?x:g)}function x(E){return E===91||E===92||E===93?(e.consume(E),c++,g):g(E)}}function E2(e,t,n,r,a,o){let u;return c;function c(x){return x===34||x===39||x===40?(e.enter(r),e.enter(a),e.consume(x),e.exit(a),u=x===40?41:x,d):n(x)}function d(x){return x===u?(e.enter(a),e.consume(x),e.exit(a),e.exit(r),t):(e.enter(o),f(x))}function f(x){return x===u?(e.exit(o),d(u)):x===null?n(x):$e(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Ot(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===u||x===null||$e(x)?(e.exit("chunkString"),f(x)):(e.consume(x),x===92?g:p)}function g(x){return x===u||x===92?(e.consume(x),p):p(x)}}function Su(e,t){let n;return r;function r(a){return $e(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):lt(a)?Ot(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const G4={name:"definition",tokenize:K4},X4={partial:!0,tokenize:J4};function K4(e,t,n){const r=this;let a;return o;function o(E){return e.enter("definition"),u(E)}function u(E){return x2.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(E)}function c(E){return a=Ui(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),d):n(E)}function d(E){return Jn(E)?Su(e,f)(E):f(E)}function f(E){return b2(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(E)}function p(E){return e.attempt(X4,g,g)(E)}function g(E){return lt(E)?Ot(e,x,"whitespace")(E):x(E)}function x(E){return E===null||$e(E)?(e.exit("definition"),r.parser.defined.push(a),t(E)):n(E)}}function J4(e,t,n){return r;function r(c){return Jn(c)?Su(e,a)(c):n(c)}function a(c){return E2(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return lt(c)?Ot(e,u,"whitespace")(c):u(c)}function u(c){return c===null||$e(c)?t(c):n(c)}}const Z4={name:"hardBreakEscape",tokenize:eD};function eD(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),a}function a(o){return $e(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const tD={name:"headingAtx",resolve:nD,tokenize:rD};function nD(e,t){let n=e.length-2,r=3,a,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},as(e,r,n-r+1,[["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t]])),e}function rD(e,t,n){let r=0;return a;function a(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),u(p)}function u(p){return p===35&&r++<6?(e.consume(p),u):p===null||Jn(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||$e(p)?(e.exit("atxHeading"),t(p)):lt(p)?Ot(e,c,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||Jn(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const sD=["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"],W1=["pre","script","style","textarea"],aD={concrete:!0,name:"htmlFlow",resolveTo:uD,tokenize:lD},iD={partial:!0,tokenize:dD},oD={partial:!0,tokenize:cD};function uD(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 lD(e,t,n){const r=this;let a,o,u,c,d;return f;function f(U){return p(U)}function p(U){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(U),g}function g(U){return U===33?(e.consume(U),x):U===47?(e.consume(U),o=!0,S):U===63?(e.consume(U),a=3,r.interrupt?t:D):ns(U)?(e.consume(U),u=String.fromCharCode(U),w):n(U)}function x(U){return U===45?(e.consume(U),a=2,E):U===91?(e.consume(U),a=5,c=0,_):ns(U)?(e.consume(U),a=4,r.interrupt?t:D):n(U)}function E(U){return U===45?(e.consume(U),r.interrupt?t:D):n(U)}function _(U){const Ee="CDATA[";return U===Ee.charCodeAt(c++)?(e.consume(U),c===Ee.length?r.interrupt?t:F:_):n(U)}function S(U){return ns(U)?(e.consume(U),u=String.fromCharCode(U),w):n(U)}function w(U){if(U===null||U===47||U===62||Jn(U)){const Ee=U===47,De=u.toLowerCase();return!Ee&&!o&&W1.includes(De)?(a=1,r.interrupt?t(U):F(U)):sD.includes(u.toLowerCase())?(a=6,Ee?(e.consume(U),T):r.interrupt?t(U):F(U)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(U):o?C(U):O(U))}return U===45||lr(U)?(e.consume(U),u+=String.fromCharCode(U),w):n(U)}function T(U){return U===62?(e.consume(U),r.interrupt?t:F):n(U)}function C(U){return lt(U)?(e.consume(U),C):M(U)}function O(U){return U===47?(e.consume(U),M):U===58||U===95||ns(U)?(e.consume(U),L):lt(U)?(e.consume(U),O):M(U)}function L(U){return U===45||U===46||U===58||U===95||lr(U)?(e.consume(U),L):B(U)}function B(U){return U===61?(e.consume(U),k):lt(U)?(e.consume(U),B):O(U)}function k(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),d=U,N):lt(U)?(e.consume(U),k):R(U)}function N(U){return U===d?(e.consume(U),d=null,j):U===null||$e(U)?n(U):(e.consume(U),N)}function R(U){return U===null||U===34||U===39||U===47||U===60||U===61||U===62||U===96||Jn(U)?B(U):(e.consume(U),R)}function j(U){return U===47||U===62||lt(U)?O(U):n(U)}function M(U){return U===62?(e.consume(U),P):n(U)}function P(U){return U===null||$e(U)?F(U):lt(U)?(e.consume(U),P):n(U)}function F(U){return U===45&&a===2?(e.consume(U),K):U===60&&a===1?(e.consume(U),Z):U===62&&a===4?(e.consume(U),ue):U===63&&a===3?(e.consume(U),D):U===93&&a===5?(e.consume(U),ee):$e(U)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(iD,ae,W)(U)):U===null||$e(U)?(e.exit("htmlFlowData"),W(U)):(e.consume(U),F)}function W(U){return e.check(oD,V,ae)(U)}function V(U){return e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),J}function J(U){return U===null||$e(U)?W(U):(e.enter("htmlFlowData"),F(U))}function K(U){return U===45?(e.consume(U),D):F(U)}function Z(U){return U===47?(e.consume(U),u="",G):F(U)}function G(U){if(U===62){const Ee=u.toLowerCase();return W1.includes(Ee)?(e.consume(U),ue):F(U)}return ns(U)&&u.length<8?(e.consume(U),u+=String.fromCharCode(U),G):F(U)}function ee(U){return U===93?(e.consume(U),D):F(U)}function D(U){return U===62?(e.consume(U),ue):U===45&&a===2?(e.consume(U),D):F(U)}function ue(U){return U===null||$e(U)?(e.exit("htmlFlowData"),ae(U)):(e.consume(U),ue)}function ae(U){return e.exit("htmlFlow"),t(U)}}function cD(e,t,n){const r=this;return a;function a(u){return $e(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):n(u)}function o(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}function dD(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(dd,t,n)}}const fD={name:"htmlText",tokenize:hD};function hD(e,t,n){const r=this;let a,o,u;return c;function c(D){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(D),d}function d(D){return D===33?(e.consume(D),f):D===47?(e.consume(D),B):D===63?(e.consume(D),O):ns(D)?(e.consume(D),R):n(D)}function f(D){return D===45?(e.consume(D),p):D===91?(e.consume(D),o=0,_):ns(D)?(e.consume(D),C):n(D)}function p(D){return D===45?(e.consume(D),E):n(D)}function g(D){return D===null?n(D):D===45?(e.consume(D),x):$e(D)?(u=g,Z(D)):(e.consume(D),g)}function x(D){return D===45?(e.consume(D),E):g(D)}function E(D){return D===62?K(D):D===45?x(D):g(D)}function _(D){const ue="CDATA[";return D===ue.charCodeAt(o++)?(e.consume(D),o===ue.length?S:_):n(D)}function S(D){return D===null?n(D):D===93?(e.consume(D),w):$e(D)?(u=S,Z(D)):(e.consume(D),S)}function w(D){return D===93?(e.consume(D),T):S(D)}function T(D){return D===62?K(D):D===93?(e.consume(D),T):S(D)}function C(D){return D===null||D===62?K(D):$e(D)?(u=C,Z(D)):(e.consume(D),C)}function O(D){return D===null?n(D):D===63?(e.consume(D),L):$e(D)?(u=O,Z(D)):(e.consume(D),O)}function L(D){return D===62?K(D):O(D)}function B(D){return ns(D)?(e.consume(D),k):n(D)}function k(D){return D===45||lr(D)?(e.consume(D),k):N(D)}function N(D){return $e(D)?(u=N,Z(D)):lt(D)?(e.consume(D),N):K(D)}function R(D){return D===45||lr(D)?(e.consume(D),R):D===47||D===62||Jn(D)?j(D):n(D)}function j(D){return D===47?(e.consume(D),K):D===58||D===95||ns(D)?(e.consume(D),M):$e(D)?(u=j,Z(D)):lt(D)?(e.consume(D),j):K(D)}function M(D){return D===45||D===46||D===58||D===95||lr(D)?(e.consume(D),M):P(D)}function P(D){return D===61?(e.consume(D),F):$e(D)?(u=P,Z(D)):lt(D)?(e.consume(D),P):j(D)}function F(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),a=D,W):$e(D)?(u=F,Z(D)):lt(D)?(e.consume(D),F):(e.consume(D),V)}function W(D){return D===a?(e.consume(D),a=void 0,J):D===null?n(D):$e(D)?(u=W,Z(D)):(e.consume(D),W)}function V(D){return D===null||D===34||D===39||D===60||D===61||D===96?n(D):D===47||D===62||Jn(D)?j(D):(e.consume(D),V)}function J(D){return D===47||D===62||Jn(D)?j(D):n(D)}function K(D){return D===62?(e.consume(D),e.exit("htmlTextData"),e.exit("htmlText"),t):n(D)}function Z(D){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),G}function G(D){return lt(D)?Ot(e,ee,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):ee(D)}function ee(D){return e.enter("htmlTextData"),u(D)}}const xm={name:"labelEnd",resolveAll:yD,resolveTo:bD,tokenize:xD},mD={tokenize:ED},pD={tokenize:vD},gD={tokenize:TD};function yD(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&as(e,0,e.length,n),e}function bD(e,t){let n=e.length,r=0,a,o,u,c;for(;n--;)if(a=e[n][1],o){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(o=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(u=n);const d={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},p={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[u-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=Tr(c,e.slice(o+1,o+r+3)),c=Tr(c,[["enter",p,t]]),c=Tr(c,bm(t.parser.constructs.insideSpan.null,e.slice(o+r+4,u-3),t)),c=Tr(c,[["exit",p,t],e[u-2],e[u-1],["exit",f,t]]),c=Tr(c,e.slice(u+1)),c=Tr(c,[["exit",d,t]]),as(e,o,e.length,c),e}function xD(e,t,n){const r=this;let a=r.events.length,o,u;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){o=r.events[a][1];break}return c;function c(x){return o?o._inactive?g(x):(u=r.parser.defined.includes(Ui(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),d):n(x)}function d(x){return x===40?e.attempt(mD,p,u?p:g)(x):x===91?e.attempt(pD,p,u?f:g)(x):u?p(x):g(x)}function f(x){return e.attempt(gD,p,g)(x)}function p(x){return t(x)}function g(x){return o._balanced=!0,n(x)}}function ED(e,t,n){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),a}function a(g){return Jn(g)?Su(e,o)(g):o(g)}function o(g){return g===41?p(g):b2(e,u,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return Jn(g)?Su(e,d)(g):p(g)}function c(g){return n(g)}function d(g){return g===34||g===39||g===40?E2(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):p(g)}function f(g){return Jn(g)?Su(e,p)(g):p(g)}function p(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function vD(e,t,n){const r=this;return a;function a(c){return x2.call(r,e,o,u,"reference","referenceMarker","referenceString")(c)}function o(c){return r.parser.defined.includes(Ui(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function u(c){return n(c)}}function TD(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),a}function a(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const wD={name:"labelStartImage",resolveAll:xm.resolveAll,tokenize:SD};function SD(e,t,n){const r=this;return a;function a(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),o}function o(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),u):n(c)}function u(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const CD={name:"labelStartLink",resolveAll:xm.resolveAll,tokenize:kD};function kD(e,t,n){const r=this;return a;function a(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const _h={name:"lineEnding",tokenize:_D};function _D(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ot(e,t,"linePrefix")}}const Nc={name:"thematicBreak",tokenize:ND};function ND(e,t,n){let r=0,a;return o;function o(f){return e.enter("thematicBreak"),u(f)}function u(f){return a=f,c(f)}function c(f){return f===a?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||$e(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===a?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),lt(f)?Ot(e,c,"whitespace")(f):c(f))}}const Gn={continuation:{tokenize:ID},exit:LD,name:"list",tokenize:AD},OD={partial:!0,tokenize:MD},DD={partial:!0,tokenize:RD};function AD(e,t,n){const r=this,a=r.events[r.events.length-1];let o=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,u=0;return c;function c(E){const _=r.containerState.type||(E===42||E===43||E===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!r.containerState.marker||E===r.containerState.marker:g0(E)){if(r.containerState.type||(r.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),E===42||E===45?e.check(Nc,n,f)(E):f(E);if(!r.interrupt||E===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(E)}return n(E)}function d(E){return g0(E)&&++u<10?(e.consume(E),d):(!r.interrupt||u<2)&&(r.containerState.marker?E===r.containerState.marker:E===41||E===46)?(e.exit("listItemValue"),f(E)):n(E)}function f(E){return e.enter("listItemMarker"),e.consume(E),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||E,e.check(dd,r.interrupt?n:p,e.attempt(OD,x,g))}function p(E){return r.containerState.initialBlankLine=!0,o++,x(E)}function g(E){return lt(E)?(e.enter("listItemPrefixWhitespace"),e.consume(E),e.exit("listItemPrefixWhitespace"),x):n(E)}function x(E){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(E)}}function ID(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(dd,a,o);function a(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ot(e,t,"listItemIndent",r.containerState.size+1)(c)}function o(c){return r.containerState.furtherBlankLines||!lt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,u(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(DD,t,u)(c))}function u(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ot(e,e.attempt(Gn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function RD(e,t,n){const r=this;return Ot(e,a,"listItemIndent",r.containerState.size+1);function a(o){const u=r.events[r.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===r.containerState.size?t(o):n(o)}}function LD(e){e.exit(this.containerState.type)}function MD(e,t,n){const r=this;return Ot(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(o){const u=r.events[r.events.length-1];return!lt(o)&&u&&u[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Y1={name:"setextUnderline",resolveTo:PD,tokenize:FD};function PD(e,t){let n=e.length,r,a,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const u={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",o?(e.splice(a,0,["enter",u,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=u,e.push(["exit",u,t]),e}function FD(e,t,n){const r=this;let a;return o;function o(f){let p=r.events.length,g;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){g=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),a=f,u(f)):n(f)}function u(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===a?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),lt(f)?Ot(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||$e(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const jD={tokenize:BD};function BD(e){const t=this,n=e.attempt(dd,r,e.attempt(this.parser.constructs.flowInitial,a,Ot(e,e.attempt(this.parser.constructs.flow,a,e.attempt(Y4,a)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const HD={resolveAll:T2()},UD=v2("string"),zD=v2("text");function v2(e){return{resolveAll:T2(e==="text"?WD:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],o=n.attempt(a,u,c);return u;function u(p){return f(p)?o(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),o(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const g=a[p];let x=-1;if(g)for(;++x<g.length;){const E=g[x];if(!E.previous||E.previous.call(r,r.previous))return!0}return!1}}}function T2(e){return t;function t(n,r){let a=-1,o;for(;++a<=n.length;)o===void 0?n[a]&&n[a][1].type==="data"&&(o=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==o+2&&(n[o][1].end=n[a-1][1].end,n.splice(o+2,a-o-2),a=o+2),o=void 0);return e?e(n,r):n}}function WD(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let o=a.length,u=-1,c=0,d;for(;o--;){const f=a[o];if(typeof f=="string"){for(u=f.length;f.charCodeAt(u-1)===32;)c++,u--;if(u)break;u=-1}else if(f===-2)d=!0,c++;else if(f!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:r.start._bufferIndex+u,_index:r.start._index+o,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const YD={42:Gn,43:Gn,45:Gn,48:Gn,49:Gn,50:Gn,51:Gn,52:Gn,53:Gn,54:Gn,55:Gn,56:Gn,57:Gn,62:m2},qD={91:G4},$D={[-2]:kh,[-1]:kh,32:kh},VD={35:tD,42:Nc,45:[Y1,Nc],60:aD,61:Y1,95:Nc,96:z1,126:z1},QD={38:g2,92:p2},GD={[-5]:_h,[-4]:_h,[-3]:_h,33:wD,38:g2,42:y0,60:[C4,fD],91:CD,92:[Z4,p2],93:xm,95:y0,96:j4},XD={null:[y0,HD]},KD={null:[42,95]},JD={null:[]},ZD=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:KD,contentInitial:qD,disable:JD,document:YD,flow:VD,flowInitial:$D,insideSpan:XD,string:QD,text:GD},Symbol.toStringTag,{value:"Module"}));function e6(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},o=[];let u=[],c=[];const d={attempt:N(B),check:N(k),consume:C,enter:O,exit:L,interrupt:N(k,{interrupt:!0})},f={code:null,containerState:{},defineSkip:S,events:[],now:_,parser:e,previous:null,sliceSerialize:x,sliceStream:E,write:g};let p=t.tokenize.call(f,d);return t.resolveAll&&o.push(t),f;function g(P){return u=Tr(u,P),w(),u[u.length-1]!==null?[]:(R(t,0),f.events=bm(o,f.events,f),f.events)}function x(P,F){return n6(E(P),F)}function E(P){return t6(u,P)}function _(){const{_bufferIndex:P,_index:F,line:W,column:V,offset:J}=r;return{_bufferIndex:P,_index:F,line:W,column:V,offset:J}}function S(P){a[P.line]=P.column,M()}function w(){let P;for(;r._index<u.length;){const F=u[r._index];if(typeof F=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<F.length;)T(F.charCodeAt(r._bufferIndex));else T(F)}}function T(P){p=p(P)}function C(P){$e(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,M()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===u[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=P}function O(P,F){const W=F||{};return W.type=P,W.start=_(),f.events.push(["enter",W,f]),c.push(W),W}function L(P){const F=c.pop();return F.end=_(),f.events.push(["exit",F,f]),F}function B(P,F){R(P,F.from)}function k(P,F){F.restore()}function N(P,F){return W;function W(V,J,K){let Z,G,ee,D;return Array.isArray(V)?ae(V):"tokenize"in V?ae([V]):ue(V);function ue(ve){return ze;function ze(Ue){const Le=Ue!==null&&ve[Ue],Ge=Ue!==null&&ve.null,Fe=[...Array.isArray(Le)?Le:Le?[Le]:[],...Array.isArray(Ge)?Ge:Ge?[Ge]:[]];return ae(Fe)(Ue)}}function ae(ve){return Z=ve,G=0,ve.length===0?K:U(ve[G])}function U(ve){return ze;function ze(Ue){return D=j(),ee=ve,ve.partial||(f.currentConstruct=ve),ve.name&&f.parser.constructs.disable.null.includes(ve.name)?De():ve.tokenize.call(F?Object.assign(Object.create(f),F):f,d,Ee,De)(Ue)}}function Ee(ve){return P(ee,D),J}function De(ve){return D.restore(),++G<Z.length?U(Z[G]):K}}}function R(P,F){P.resolveAll&&!o.includes(P)&&o.push(P),P.resolve&&as(f.events,F,f.events.length-F,P.resolve(f.events.slice(F),f)),P.resolveTo&&(f.events=P.resolveTo(f.events,f))}function j(){const P=_(),F=f.previous,W=f.currentConstruct,V=f.events.length,J=Array.from(c);return{from:V,restore:K};function K(){r=P,f.previous=F,f.currentConstruct=W,f.events.length=V,c=J,M()}}function M(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function t6(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,o=t.end._bufferIndex;let u;if(n===a)u=[e[n].slice(r,o)];else{if(u=e.slice(n,a),r>-1){const c=u[0];typeof c=="string"?u[0]=c.slice(r):u.shift()}o>0&&u.push(e[a].slice(0,o))}return u}function n6(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const o=e[n];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
97
- `;break}case-3:{u=`\r
98
- `;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&a)continue;u=" ";break}default:u=String.fromCharCode(o)}a=o===-2,r.push(u)}return r.join("")}function r6(e){const r={constructs:c4([ZD,...(e||{}).extensions||[]]),content:a(b4),defined:[],document:a(E4),flow:a(jD),lazy:{},string:a(UD),text:a(zD)};return r;function a(o){return u;function u(c){return e6(r,o,c)}}}function s6(e){for(;!y2(e););return e}const q1=/[\0\t\n\r]/g;function a6(){let e=1,t="",n=!0,r;return a;function a(o,u,c){const d=[];let f,p,g,x,E;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(q1.lastIndex=g,f=q1.exec(o),x=f&&f.index!==void 0?f.index:o.length,E=o.charCodeAt(x),!f){t=o.slice(g);break}if(E===10&&g===x&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),g<x&&(d.push(o.slice(g,x)),e+=x-g),E){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}g=x+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const i6=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function o6(e){return e.replace(i6,u6)}function u6(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),o=a===120||a===88;return h2(n.slice(o?2:1),o?16:10)}return ym(n)||e}const w2={}.hasOwnProperty;function l6(e,t,n){return typeof t!="string"&&(n=t,t=void 0),c6(n)(s6(r6(n).document().write(a6()(e,t,!0))))}function c6(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(it),autolinkProtocol:j,autolinkEmail:j,atxHeading:o($t),blockQuote:o(Ge),characterEscape:j,characterReference:j,codeFenced:o(Fe),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(Fe,u),codeText:o(Rt,u),codeTextData:j,data:j,codeFlowValue:j,definition:o(Et),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(Cn),hardBreakEscape:o(gt),hardBreakTrailing:o(gt),htmlFlow:o(Lt,u),htmlFlowData:j,htmlText:o(Lt,u),htmlTextData:j,image:o(er),label:u,link:o(it),listItem:o(vt),listItemValue:x,listOrdered:o(nt,g),listUnordered:o(nt),paragraph:o(Dt),reference:U,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o($t),strong:o(ln),thematicBreak:o(cn)},exit:{atxHeading:d(),atxHeadingSequence:B,autolink:d(),autolinkEmail:Le,autolinkProtocol:Ue,blockQuote:d(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:De,characterReferenceMarkerNumeric:De,characterReferenceValue:ve,characterReference:ze,codeFenced:d(w),codeFencedFence:S,codeFencedFenceInfo:E,codeFencedFenceMeta:_,codeFlowValue:M,codeIndented:d(T),codeText:d(J),codeTextData:M,data:M,definition:d(),definitionDestinationString:L,definitionLabelString:C,definitionTitleString:O,emphasis:d(),hardBreakEscape:d(F),hardBreakTrailing:d(F),htmlFlow:d(W),htmlFlowData:M,htmlText:d(V),htmlTextData:M,image:d(Z),label:ee,labelText:G,lineEnding:P,link:d(K),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:Ee,resourceDestinationString:D,resourceTitleString:ue,resource:ae,setextHeading:d(R),setextHeadingLineSequence:N,setextHeadingText:k,strong:d(),thematicBreak:d()}};S2(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(oe){let me={type:"root",children:[]};const Ae={stack:[me],tokenStack:[],config:t,enter:c,exit:f,buffer:u,resume:p,data:n},Ye=[];let Xe=-1;for(;++Xe<oe.length;)if(oe[Xe][1].type==="listOrdered"||oe[Xe][1].type==="listUnordered")if(oe[Xe][0]==="enter")Ye.push(Xe);else{const yt=Ye.pop();Xe=a(oe,yt,Xe)}for(Xe=-1;++Xe<oe.length;){const yt=t[oe[Xe][0]];w2.call(yt,oe[Xe][1].type)&&yt[oe[Xe][1].type].call(Object.assign({sliceSerialize:oe[Xe][2].sliceSerialize},Ae),oe[Xe][1])}if(Ae.tokenStack.length>0){const yt=Ae.tokenStack[Ae.tokenStack.length-1];(yt[1]||$1).call(Ae,void 0,yt[0])}for(me.position={start:ea(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:ea(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},Xe=-1;++Xe<t.transforms.length;)me=t.transforms[Xe](me)||me;return me}function a(oe,me,Ae){let Ye=me-1,Xe=-1,yt=!1,Vt,an,kn,Hn;for(;++Ye<=Ae;){const Mt=oe[Ye];switch(Mt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Mt[0]==="enter"?Xe++:Xe--,Hn=void 0;break}case"lineEndingBlank":{Mt[0]==="enter"&&(Vt&&!Hn&&!Xe&&!kn&&(kn=Ye),Hn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Hn=void 0}if(!Xe&&Mt[0]==="enter"&&Mt[1].type==="listItemPrefix"||Xe===-1&&Mt[0]==="exit"&&(Mt[1].type==="listUnordered"||Mt[1].type==="listOrdered")){if(Vt){let bt=Ye;for(an=void 0;bt--;){const dn=oe[bt];if(dn[1].type==="lineEnding"||dn[1].type==="lineEndingBlank"){if(dn[0]==="exit")continue;an&&(oe[an][1].type="lineEndingBlank",yt=!0),dn[1].type="lineEnding",an=bt}else if(!(dn[1].type==="linePrefix"||dn[1].type==="blockQuotePrefix"||dn[1].type==="blockQuotePrefixWhitespace"||dn[1].type==="blockQuoteMarker"||dn[1].type==="listItemIndent"))break}kn&&(!an||kn<an)&&(Vt._spread=!0),Vt.end=Object.assign({},an?oe[an][1].start:Mt[1].end),oe.splice(an||Ye,0,["exit",Vt,Mt[2]]),Ye++,Ae++}if(Mt[1].type==="listItemPrefix"){const bt={type:"listItem",_spread:!1,start:Object.assign({},Mt[1].start),end:void 0};Vt=bt,oe.splice(Ye,0,["enter",bt,Mt[2]]),Ye++,Ae++,kn=void 0,Hn=!0}}}return oe[me][1]._spread=yt,Ae}function o(oe,me){return Ae;function Ae(Ye){c.call(this,oe(Ye),Ye),me&&me.call(this,Ye)}}function u(){this.stack.push({type:"fragment",children:[]})}function c(oe,me,Ae){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([me,Ae||void 0]),oe.position={start:ea(me.start),end:void 0}}function d(oe){return me;function me(Ae){oe&&oe.call(this,Ae),f.call(this,Ae)}}function f(oe,me){const Ae=this.stack.pop(),Ye=this.tokenStack.pop();if(Ye)Ye[0].type!==oe.type&&(me?me.call(this,oe,Ye[0]):(Ye[1]||$1).call(this,oe,Ye[0]));else throw new Error("Cannot close `"+oe.type+"` ("+wu({start:oe.start,end:oe.end})+"): it’s not open");Ae.position.end=ea(oe.end)}function p(){return u4(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(oe){if(this.data.expectingFirstListItemValue){const me=this.stack[this.stack.length-2];me.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function E(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.lang=oe}function _(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.meta=oe}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function T(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe.replace(/(\r?\n|\r)$/g,"")}function C(oe){const me=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=me,Ae.identifier=Ui(this.sliceSerialize(oe)).toLowerCase()}function O(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.title=oe}function L(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.url=oe}function B(oe){const me=this.stack[this.stack.length-1];if(!me.depth){const Ae=this.sliceSerialize(oe).length;me.depth=Ae}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function N(oe){const me=this.stack[this.stack.length-1];me.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function j(oe){const Ae=this.stack[this.stack.length-1].children;let Ye=Ae[Ae.length-1];(!Ye||Ye.type!=="text")&&(Ye=tr(),Ye.position={start:ea(oe.start),end:void 0},Ae.push(Ye)),this.stack.push(Ye)}function M(oe){const me=this.stack.pop();me.value+=this.sliceSerialize(oe),me.position.end=ea(oe.end)}function P(oe){const me=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ae=me.children[me.children.length-1];Ae.position.end=ea(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(me.type)&&(j.call(this,oe),M.call(this,oe))}function F(){this.data.atHardBreak=!0}function W(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe}function V(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe}function J(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.value=oe}function K(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=me,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function Z(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const me=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=me,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function G(oe){const me=this.sliceSerialize(oe),Ae=this.stack[this.stack.length-2];Ae.label=o6(me),Ae.identifier=Ui(me).toLowerCase()}function ee(){const oe=this.stack[this.stack.length-1],me=this.resume(),Ae=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ae.type==="link"){const Ye=oe.children;Ae.children=Ye}else Ae.alt=me}function D(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.url=oe}function ue(){const oe=this.resume(),me=this.stack[this.stack.length-1];me.title=oe}function ae(){this.data.inReference=void 0}function U(){this.data.referenceType="collapsed"}function Ee(oe){const me=this.resume(),Ae=this.stack[this.stack.length-1];Ae.label=me,Ae.identifier=Ui(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function De(oe){this.data.characterReferenceType=oe.type}function ve(oe){const me=this.sliceSerialize(oe),Ae=this.data.characterReferenceType;let Ye;Ae?(Ye=h2(me,Ae==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ye=ym(me);const Xe=this.stack[this.stack.length-1];Xe.value+=Ye}function ze(oe){const me=this.stack.pop();me.position.end=ea(oe.end)}function Ue(oe){M.call(this,oe);const me=this.stack[this.stack.length-1];me.url=this.sliceSerialize(oe)}function Le(oe){M.call(this,oe);const me=this.stack[this.stack.length-1];me.url="mailto:"+this.sliceSerialize(oe)}function Ge(){return{type:"blockquote",children:[]}}function Fe(){return{type:"code",lang:null,meta:null,value:""}}function Rt(){return{type:"inlineCode",value:""}}function Et(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Cn(){return{type:"emphasis",children:[]}}function $t(){return{type:"heading",depth:0,children:[]}}function gt(){return{type:"break"}}function Lt(){return{type:"html",value:""}}function er(){return{type:"image",title:null,url:"",alt:null}}function it(){return{type:"link",title:null,url:"",children:[]}}function nt(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function vt(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function Dt(){return{type:"paragraph",children:[]}}function ln(){return{type:"strong",children:[]}}function tr(){return{type:"text",value:""}}function cn(){return{type:"thematicBreak"}}}function ea(e){return{line:e.line,column:e.column,offset:e.offset}}function S2(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?S2(e,r):d6(e,r)}}function d6(e,t){let n;for(n in t)if(w2.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 $1(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+wu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+wu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+wu({start:t.start,end:t.end})+") is still open")}function f6(e){const t=this;t.parser=n;function n(r){return l6(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function h6(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 m6(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
99
- `}]}function p6(e,t){const n=t.value?t.value+`
100
- `:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function g6(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function y6(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function b6(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=yo(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let u,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),u=e.footnoteOrder.length):u=o+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function x6(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 E6(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function C2(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),o=a[0];o&&o.type==="text"?o.value="["+o.value:a.unshift({type:"text",value:"["});const u=a[a.length-1];return u&&u.type==="text"?u.value+=r:a.push({type:"text",value:r}),a}function v6(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return C2(e,t);const a={src:yo(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,o),e.applyData(t,o)}function T6(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 w6(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 S6(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return C2(e,t);const a={href:yo(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function C6(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 k6(e,t,n){const r=e.all(t),a=n?_6(n):k2(t),o={},u=[];if(typeof t.checked=="boolean"){const p=r[0];let g;p&&p.type==="element"&&p.tagName==="p"?g=p:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(a||c!==0||p.type!=="element"||p.tagName!=="p")&&u.push({type:"text",value:`
101
- `}),p.type==="element"&&p.tagName==="p"&&!a?u.push(...p.children):u.push(p)}const d=r[r.length-1];d&&(a||d.type!=="element"||d.tagName!=="p")&&u.push({type:"text",value:`
102
- `});const f={type:"element",tagName:"li",properties:o,children:u};return e.patch(t,f),e.applyData(t,f)}function _6(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=k2(n[r])}return t}function k2(e){const t=e.spread;return t??e.children.length>1}function N6(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const u=r[a];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function O6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function D6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function A6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function I6(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],u),a.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=ls(t.children[1]),d=cd(t.children[t.children.length-1]);c&&d&&(u.position={start:c,end:d}),a.push(u)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function R6(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,c=u?u.length:t.children.length;let d=-1;const f=[];for(;++d<c;){const g=t.children[d],x={},E=u?u[d]:void 0;E&&(x.align=E);let _={type:"element",tagName:o,properties:x,children:[]};g&&(_.children=e.all(g),e.patch(g,_),_=e.applyData(g,_)),f.push(_)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function L6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const V1=9,Q1=32;function M6(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const o=[];for(;r;)o.push(G1(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return o.push(G1(t.slice(a),a>0,!1)),o.join("")}function G1(e,t,n){let r=0,a=e.length;if(t){let o=e.codePointAt(r);for(;o===V1||o===Q1;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(a-1);for(;o===V1||o===Q1;)a--,o=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function P6(e,t){const n={type:"text",value:M6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function F6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const j6={blockquote:h6,break:m6,code:p6,delete:g6,emphasis:y6,footnoteReference:b6,heading:x6,html:E6,imageReference:v6,image:T6,inlineCode:w6,linkReference:S6,link:C6,listItem:k6,list:N6,paragraph:O6,root:D6,strong:A6,table:I6,tableCell:L6,tableRow:R6,text:P6,thematicBreak:F6,toml:Tc,yaml:Tc,definition:Tc,footnoteDefinition:Tc};function Tc(){}const _2=-1,fd=0,Cu=1,zc=2,Em=3,vm=4,Tm=5,wm=6,N2=7,O2=8,X1=typeof self=="object"?self:globalThis,B6=(e,t)=>{const n=(a,o)=>(e.set(o,a),a),r=a=>{if(e.has(a))return e.get(a);const[o,u]=t[a];switch(o){case fd:case _2:return n(u,a);case Cu:{const c=n([],a);for(const d of u)c.push(r(d));return c}case zc:{const c=n({},a);for(const[d,f]of u)c[r(d)]=r(f);return c}case Em:return n(new Date(u),a);case vm:{const{source:c,flags:d}=u;return n(new RegExp(c,d),a)}case Tm:{const c=n(new Map,a);for(const[d,f]of u)c.set(r(d),r(f));return c}case wm:{const c=n(new Set,a);for(const d of u)c.add(r(d));return c}case N2:{const{name:c,message:d}=u;return n(new X1[c](d),a)}case O2:return n(BigInt(u),a);case"BigInt":return n(Object(BigInt(u)),a);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:c}=new Uint8Array(u);return n(new DataView(c),u)}}return n(new X1[o](u),a)};return r},K1=e=>B6(new Map,e)(0),ji="",{toString:H6}={},{keys:U6}=Object,gu=e=>{const t=typeof e;if(t!=="object"||!e)return[fd,t];const n=H6.call(e).slice(8,-1);switch(n){case"Array":return[Cu,ji];case"Object":return[zc,ji];case"Date":return[Em,ji];case"RegExp":return[vm,ji];case"Map":return[Tm,ji];case"Set":return[wm,ji];case"DataView":return[Cu,n]}return n.includes("Array")?[Cu,n]:n.includes("Error")?[N2,n]:[zc,n]},wc=([e,t])=>e===fd&&(t==="function"||t==="symbol"),z6=(e,t,n,r)=>{const a=(u,c)=>{const d=r.push(u)-1;return n.set(c,d),d},o=u=>{if(n.has(u))return n.get(u);let[c,d]=gu(u);switch(c){case fd:{let p=u;switch(d){case"bigint":c=O2,p=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return a([_2],u)}return a([c,p],u)}case Cu:{if(d){let x=u;return d==="DataView"?x=new Uint8Array(u.buffer):d==="ArrayBuffer"&&(x=new Uint8Array(u)),a([d,[...x]],u)}const p=[],g=a([c,p],u);for(const x of u)p.push(o(x));return g}case zc:{if(d)switch(d){case"BigInt":return a([d,u.toString()],u);case"Boolean":case"Number":case"String":return a([d,u.valueOf()],u)}if(t&&"toJSON"in u)return o(u.toJSON());const p=[],g=a([c,p],u);for(const x of U6(u))(e||!wc(gu(u[x])))&&p.push([o(x),o(u[x])]);return g}case Em:return a([c,u.toISOString()],u);case vm:{const{source:p,flags:g}=u;return a([c,{source:p,flags:g}],u)}case Tm:{const p=[],g=a([c,p],u);for(const[x,E]of u)(e||!(wc(gu(x))||wc(gu(E))))&&p.push([o(x),o(E)]);return g}case wm:{const p=[],g=a([c,p],u);for(const x of u)(e||!wc(gu(x)))&&p.push(o(x));return g}}const{message:f}=u;return a([c,{name:d,message:f}],u)};return o},J1=(e,{json:t,lossy:n}={})=>{const r=[];return z6(!(t||n),!!t,new Map,r)(e),r},oo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?K1(J1(e,t)):structuredClone(e):(e,t)=>K1(J1(e,t));function W6(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 Y6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function q6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||W6,r=e.options.footnoteBackLabel||Y6,a=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const p=e.all(f),g=String(f.identifier).toUpperCase(),x=yo(g.toLowerCase());let E=0;const _=[],S=e.footnoteCounts.get(g);for(;S!==void 0&&++E<=S;){_.length>0&&_.push({type:"text",value:" "});let C=typeof n=="string"?n:n(d,E);typeof C=="string"&&(C={type:"text",value:C}),_.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+x+(E>1?"-"+E:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,E),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const w=p[p.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const C=w.children[w.children.length-1];C&&C.type==="text"?C.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(..._)}else p.push(..._);const T={type:"element",tagName:"li",properties:{id:t+"fn-"+x},children:e.wrap(p,!0)};e.patch(f,T),c.push(T)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...oo(u),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
103
- `},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
104
- `}]}}const D2=(function(e){if(e==null)return G6;if(typeof e=="function")return hd(e);if(typeof e=="object")return Array.isArray(e)?$6(e):V6(e);if(typeof e=="string")return Q6(e);throw new Error("Expected function, string, or object as test")});function $6(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=D2(e[n]);return hd(r);function r(...a){let o=-1;for(;++o<t.length;)if(t[o].apply(this,a))return!0;return!1}}function V6(e){const t=e;return hd(n);function n(r){const a=r;let o;for(o in e)if(a[o]!==t[o])return!1;return!0}}function Q6(e){return hd(t);function t(n){return n&&n.type===e}}function hd(e){return t;function t(n,r,a){return!!(X6(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function G6(){return!0}function X6(e){return e!==null&&typeof e=="object"&&"type"in e}const A2=[],K6=!0,Z1=!1,J6="skip";function Z6(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const o=D2(a),u=r?-1:1;c(e,void 0,[])();function c(d,f,p){const g=d&&typeof d=="object"?d:{};if(typeof g.type=="string"){const E=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(d.type+(E?"<"+E+">":""))+")"})}return x;function x(){let E=A2,_,S,w;if((!t||o(d,f,p[p.length-1]||void 0))&&(E=eA(n(d,p)),E[0]===Z1))return E;if("children"in d&&d.children){const T=d;if(T.children&&E[0]!==J6)for(S=(r?T.children.length:-1)+u,w=p.concat(T);S>-1&&S<T.children.length;){const C=T.children[S];if(_=c(C,S,w)(),_[0]===Z1)return _;S=typeof _[1]=="number"?_[1]:S+u}}return E}}}function eA(e){return Array.isArray(e)?e:typeof e=="number"?[K6,e]:e==null?A2:[e]}function Sm(e,t,n,r){let a,o,u;typeof t=="function"&&typeof n!="function"?(o=void 0,u=t,a=n):(o=t,u=n,a=r),Z6(e,o,c,a);function c(d,f){const p=f[f.length-1],g=p?p.children.indexOf(d):void 0;return u(d,g,p)}}const b0={}.hasOwnProperty,tA={};function nA(e,t){const n=t||tA,r=new Map,a=new Map,o=new Map,u={...j6,...n.handlers},c={all:f,applyData:sA,definitionById:r,footnoteById:a,footnoteCounts:o,footnoteOrder:[],handlers:u,one:d,options:n,patch:rA,wrap:iA};return Sm(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const g=p.type==="definition"?r:a,x=String(p.identifier).toUpperCase();g.has(x)||g.set(x,p)}}),c;function d(p,g){const x=p.type,E=c.handlers[x];if(b0.call(c.handlers,x)&&E)return E(c,p,g);if(c.options.passThrough&&c.options.passThrough.includes(x)){if("children"in p){const{children:S,...w}=p,T=oo(w);return T.children=c.all(p),T}return oo(p)}return(c.options.unknownHandler||aA)(c,p,g)}function f(p){const g=[];if("children"in p){const x=p.children;let E=-1;for(;++E<x.length;){const _=c.one(x[E],p);if(_){if(E&&x[E-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=eb(_.value)),!Array.isArray(_)&&_.type==="element")){const S=_.children[0];S&&S.type==="text"&&(S.value=eb(S.value))}Array.isArray(_)?g.push(..._):g.push(_)}}}return g}}function rA(e,t){e.position&&(t.position=HO(e))}function sA(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const u="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:u}}n.type==="element"&&o&&Object.assign(n.properties,oo(o)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function aA(e,t){const n=t.data||{},r="value"in t&&!(b0.call(n,"hProperties")||b0.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 iA(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
105
- `});++r<e.length;)r&&n.push({type:"text",value:`
106
- `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
107
- `}),n}function eb(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function tb(e,t){const n=nA(e,t),r=n.one(e,void 0),a=q6(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&o.children.push({type:"text",value:`
108
- `},a),o}function oA(e,t){return e&&"run"in e?async function(n,r){const a=tb(n,{file:r,...t});await e.run(a,r)}:function(n,r){return tb(n,{file:r,...e||t})}}function nb(e){if(e)throw e}var Nh,rb;function uA(){if(rb)return Nh;rb=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},o=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),g=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!g)return!1;var x;for(x in f);return typeof x>"u"||e.call(f,x)},u=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},c=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Nh=function d(){var f,p,g,x,E,_,S=arguments[0],w=1,T=arguments.length,C=!1;for(typeof S=="boolean"&&(C=S,S=arguments[1]||{},w=2),(S==null||typeof S!="object"&&typeof S!="function")&&(S={});w<T;++w)if(f=arguments[w],f!=null)for(p in f)g=c(S,p),x=c(f,p),S!==x&&(C&&x&&(o(x)||(E=a(x)))?(E?(E=!1,_=g&&a(g)?g:[]):_=g&&o(g)?g:{},u(S,{name:p,newValue:d(C,_,x)})):typeof x<"u"&&u(S,{name:p,newValue:x}));return S},Nh}var lA=uA();const Oh=Hb(lA);function x0(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 cA(){const e=[],t={run:n,use:r};return t;function n(...a){let o=-1;const u=a.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);c(null,...a);function c(d,...f){const p=e[++o];let g=-1;if(d){u(d);return}for(;++g<a.length;)(f[g]===null||f[g]===void 0)&&(f[g]=a[g]);a=f,p?dA(p,c)(...f):u(null,...f)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function dA(e,t){let n;return r;function r(...u){const c=e.length>u.length;let d;c&&u.push(a);try{d=e.apply(this,u)}catch(f){const p=f;if(c&&n)throw p;return a(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(o,a):d instanceof Error?a(d):o(d))}function a(u,...c){n||(n=!0,t(u,...c))}function o(u){a(null,u)}}const Gr={basename:fA,dirname:hA,extname:mA,join:pA,sep:"/"};function fA(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');el(e);let n=0,r=-1,a=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else r<0&&(o=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let u=-1,c=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else u<0&&(o=!0,u=a+1),c>-1&&(e.codePointAt(a)===t.codePointAt(c--)?c<0&&(r=a):(c=-1,r=u));return n===r?r=u:r<0&&(r=e.length),e.slice(n,r)}function hA(e){if(el(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 mA(e){el(e);let t=e.length,n=-1,r=0,a=-1,o=0,u;for(;t--;){const c=e.codePointAt(t);if(c===47){if(u){r=t+1;break}continue}n<0&&(u=!0,n=t+1),c===46?a<0?a=t:o!==1&&(o=1):a>-1&&(o=-1)}return a<0||n<0||o===0||o===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function pA(...e){let t=-1,n;for(;++t<e.length;)el(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":gA(n)}function gA(e){el(e);const t=e.codePointAt(0)===47;let n=yA(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function yA(e,t){let n="",r=0,a=-1,o=0,u=-1,c,d;for(;++u<=e.length;){if(u<e.length)c=e.codePointAt(u);else{if(c===47)break;c=47}if(c===47){if(!(a===u-1||o===1))if(a!==u-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),a=u,o=0;continue}}else if(n.length>0){n="",r=0,a=u,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,u):n=e.slice(a+1,u),r=u-a-1;a=u,o=0}else c===46&&o>-1?o++:o=-1}return n}function el(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const bA={cwd:xA};function xA(){return"/"}function E0(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function EA(e){if(typeof e=="string")e=new URL(e);else if(!E0(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 vA(e)}function vA(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Dh=["history","path","basename","stem","extname","dirname"];class I2{constructor(t){let n;t?E0(t)?n={path:t}:typeof t=="string"||TA(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":bA.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Dh.length;){const o=Dh[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let a;for(a in n)Dh.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Gr.basename(this.path):void 0}set basename(t){Ih(t,"basename"),Ah(t,"basename"),this.path=Gr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Gr.dirname(this.path):void 0}set dirname(t){sb(this.basename,"dirname"),this.path=Gr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Gr.extname(this.path):void 0}set extname(t){if(Ah(t,"extname"),sb(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=Gr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){E0(t)&&(t=EA(t)),Ih(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Gr.basename(this.path,this.extname):void 0}set stem(t){Ih(t,"stem"),Ah(t,"stem"),this.path=Gr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new Mn(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Ah(e,t){if(e&&e.includes(Gr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Gr.sep+"`")}function Ih(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function sb(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function TA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const wA=(function(e){const r=this.constructor.prototype,a=r[e],o=function(){return a.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),SA={}.hasOwnProperty;class Cm extends wA{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=cA()}copy(){const t=new Cm;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Oh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Mh("data",this.frozen),this.namespace[t]=n,this):SA.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Mh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Sc(t),r=this.parser||this.Parser;return Rh("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Rh("process",this.parser||this.Parser),Lh("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(o,u){const c=Sc(t),d=r.parse(c);r.run(d,c,function(p,g,x){if(p||!g||!x)return f(p);const E=g,_=r.stringify(E,x);_A(_)?x.value=_:x.result=_,f(p,x)});function f(p,g){p||!g?u(p):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,r;return this.freeze(),Rh("processSync",this.parser||this.Parser),Lh("processSync",this.compiler||this.Compiler),this.process(t,a),ib("processSync","process",n),r;function a(o,u){n=!0,nb(o),r=u}}run(t,n,r){ab(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(u,c){const d=Sc(n);a.run(t,d,f);function f(p,g,x){const E=g||t;p?c(p):u?u(E):r(void 0,E,x)}}}runSync(t,n){let r=!1,a;return this.run(t,n,o),ib("runSync","run",r),a;function o(u,c){nb(u),a=c,r=!0}}stringify(t,n){this.freeze();const r=Sc(n),a=this.compiler||this.Compiler;return Lh("stringify",a),ab(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Mh("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...g]=f;d(p,g)}else u(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function u(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(a.settings=Oh(!0,a.settings,f.settings))}function c(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const g=f[p];o(g)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let g=-1,x=-1;for(;++g<r.length;)if(r[g][0]===f){x=g;break}if(x===-1)r.push([f,...p]);else if(p.length>0){let[E,..._]=p;const S=r[x][1];x0(S)&&x0(E)&&(E=Oh(!0,S,E)),r[x]=[f,E,..._]}}}}const CA=new Cm().freeze();function Rh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Lh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Mh(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 ab(e){if(!x0(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ib(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Sc(e){return kA(e)?e:new I2(e)}function kA(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function _A(e){return typeof e=="string"||NA(e)}function NA(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const OA="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ob=[],ub={allowDangerousHtml:!0},DA=/^(https?|ircs?|mailto|xmpp)$/i,AA=[{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 IA(e){const t=RA(e),n=LA(e);return MA(t.runSync(t.parse(n),n),e)}function RA(e){const t=e.rehypePlugins||ob,n=e.remarkPlugins||ob,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ub}:ub;return CA().use(f6).use(n).use(oA,r).use(t)}function LA(e){const t=e.children||"",n=new I2;return typeof t=="string"&&(n.value=t),n}function MA(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,o=t.disallowedElements,u=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||PA;for(const p of AA)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+OA+p.id,void 0);return Sm(e,f),qO(e,{Fragment:m.Fragment,components:a,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function f(p,g,x){if(p.type==="raw"&&x&&typeof g=="number")return u?x.children.splice(g,1):x.children[g]={type:"text",value:p.value},g;if(p.type==="element"){let E;for(E in Ch)if(Object.hasOwn(Ch,E)&&Object.hasOwn(p.properties,E)){const _=p.properties[E],S=Ch[E];(S===null||S.includes(p.tagName))&&(p.properties[E]=d(String(_||""),E,p))}}if(p.type==="element"){let E=n?!n.includes(p.tagName):o?o.includes(p.tagName):!1;if(!E&&r&&typeof g=="number"&&(E=!r(p,g,x)),E&&x&&typeof g=="number")return c&&p.children?x.children.splice(g,1,...p.children):x.children.splice(g,1),g}}}function PA(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||DA.test(e.slice(0,t))?e:""}const lb=/[#.]/g;function FA(e,t){const n=e||"",r={};let a=0,o,u;for(;a<n.length;){lb.lastIndex=a;const c=lb.exec(n),d=n.slice(a,c?c.index:n.length);d&&(o?o==="#"?r.id=d:Array.isArray(r.className)?r.className.push(d):r.className=[d]:u=d,a+=d.length),c&&(o=c[0],a++)}return{type:"element",tagName:u||t||"div",properties:r,children:[]}}function R2(e,t,n){const r=n?UA(n):void 0;function a(o,u,...c){let d;if(o==null){d={type:"root",children:[]};const f=u;c.unshift(f)}else{d=FA(o,t);const f=d.tagName.toLowerCase(),p=r?r.get(f):void 0;if(d.tagName=p||f,jA(u))c.unshift(u);else for(const[g,x]of Object.entries(u))BA(e,d.properties,g,x)}for(const f of c)v0(d.children,f);return d.type==="element"&&d.tagName==="template"&&(d.content={type:"root",children:d.children},d.children=[]),d}return a}function jA(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const a=t[r];if(a&&typeof a=="object"){if(!Array.isArray(a))return!0;const o=a;for(const u of o)if(typeof u!="number"&&typeof u!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function BA(e,t,n,r){const a=ld(e,n);let o;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;o=r}else typeof r=="boolean"?o=r:typeof r=="string"?a.spaceSeparated?o=N1(r):a.commaSeparated?o=w1(r):a.commaOrSpaceSeparated?o=N1(w1(r).join(" ")):o=cb(a,a.property,r):Array.isArray(r)?o=[...r]:o=a.property==="style"?HA(r):String(r);if(Array.isArray(o)){const u=[];for(const c of o)u.push(cb(a,a.property,c));o=u}a.property==="className"&&Array.isArray(t.className)&&(o=t.className.concat(o)),t[a.property]=o}}function v0(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)v0(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?v0(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function cb(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Lu(n)===Lu(t)))return!0}return n}function HA(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function UA(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const zA=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],WA=R2(Zu,"div"),YA=R2(xa,"g",zA);function qA(e){const t=String(e),n=[];return{toOffset:a,toPoint:r};function r(o){if(typeof o=="number"&&o>-1&&o<=t.length){let u=0;for(;;){let c=n[u];if(c===void 0){const d=db(t,n[u-1]);c=d===-1?t.length+1:d+1,n[u]=c}if(c>o)return{line:u+1,column:o-(u>0?n[u-1]:0)+1,offset:o};u++}}}function a(o){if(o&&typeof o.line=="number"&&typeof o.column=="number"&&!Number.isNaN(o.line)&&!Number.isNaN(o.column)){for(;n.length<o.line;){const c=n[n.length-1],d=db(t,c),f=d===-1?t.length+1:d+1;if(c===f)break;n.push(f)}const u=(o.line>1?n[o.line-2]:0)+o.column-1;if(u<n[o.line-1])return u}}}function db(e,t){const n=e.indexOf("\r",t),r=e.indexOf(`
109
- `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}const Ua={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},L2={}.hasOwnProperty,$A=Object.prototype;function VA(e,t){const n=t||{};return km({file:n.file||void 0,location:!1,schema:n.space==="svg"?xa:Zu,verbose:n.verbose||!1},e)}function km(e,t){let n;switch(t.nodeName){case"#comment":{const r=t;return n={type:"comment",value:r.data},Oc(e,r,n),n}case"#document":case"#document-fragment":{const r=t,a="mode"in r?r.mode==="quirks"||r.mode==="limited-quirks":!1;if(n={type:"root",children:M2(e,t.childNodes),data:{quirksMode:a}},e.file&&e.location){const o=String(e.file),u=qA(o),c=u.toPoint(0),d=u.toPoint(o.length);n.position={start:c,end:d}}return n}case"#documentType":{const r=t;return n={type:"doctype"},Oc(e,r,n),n}case"#text":{const r=t;return n={type:"text",value:r.value},Oc(e,r,n),n}default:return n=QA(e,t),n}}function M2(e,t){let n=-1;const r=[];for(;++n<t.length;){const a=km(e,t[n]);r.push(a)}return r}function QA(e,t){const n=e.schema;e.schema=t.namespaceURI===Ua.svg?xa:Zu;let r=-1;const a={};for(;++r<t.attrs.length;){const c=t.attrs[r],d=(c.prefix?c.prefix+":":"")+c.name;L2.call($A,d)||(a[d]=c.value)}const u=(e.schema.space==="svg"?YA:WA)(t.tagName,a,M2(e,t.childNodes));if(Oc(e,t,u),u.tagName==="template"){const c=t,d=c.sourceCodeLocation,f=d&&d.startTag&&Bi(d.startTag),p=d&&d.endTag&&Bi(d.endTag),g=km(e,c.content);f&&p&&e.file&&(g.position={start:f.end,end:p.start}),u.content=g}return e.schema=n,u}function Oc(e,t,n){if("sourceCodeLocation"in t&&t.sourceCodeLocation&&e.file){const r=GA(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function GA(e,t,n){const r=Bi(n);if(t.type==="element"){const a=t.children[t.children.length-1];if(r&&!n.endTag&&a&&a.position&&a.position.end&&(r.end=Object.assign({},a.position.end)),e.verbose){const o={};let u;if(n.attrs)for(u in n.attrs)L2.call(n.attrs,u)&&(o[ld(e.schema,u).property]=Bi(n.attrs[u]));n.startTag;const c=Bi(n.startTag),d=n.endTag?Bi(n.endTag):void 0,f={opening:c};d&&(f.closing=d),f.properties=o,t.data={position:f}}}return r}function Bi(e){const t=fb({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=fb({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function fb(e){return e.line&&e.column?e:void 0}const hb={}.hasOwnProperty;function P2(e,t){const n=t||{};function r(a,...o){let u=r.invalid;const c=r.handlers;if(a&&hb.call(a,e)){const d=String(a[e]);u=hb.call(c,d)?c[d]:r.unknown}if(u)return u.call(this,a,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const XA={},KA={}.hasOwnProperty,F2=P2("type",{handlers:{root:ZA,element:sI,text:nI,comment:rI,doctype:tI}});function JA(e,t){const r=(t||XA).space;return F2(e,r==="svg"?xa:Zu)}function ZA(e,t){const n={nodeName:"#document",mode:(e.data||{}).quirksMode?"quirks":"no-quirks",childNodes:[]};return n.childNodes=_m(e.children,n,t),bo(e,n),n}function eI(e,t){const n={nodeName:"#document-fragment",childNodes:[]};return n.childNodes=_m(e.children,n,t),bo(e,n),n}function tI(e){const t={nodeName:"#documentType",name:"html",publicId:"",systemId:"",parentNode:null};return bo(e,t),t}function nI(e){const t={nodeName:"#text",value:e.value,parentNode:null};return bo(e,t),t}function rI(e){const t={nodeName:"#comment",data:e.value,parentNode:null};return bo(e,t),t}function sI(e,t){const n=t;let r=n;e.type==="element"&&e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(r=xa);const a=[];let o;if(e.properties){for(o in e.properties)if(o!=="children"&&KA.call(e.properties,o)){const d=aI(r,o,e.properties[o]);d&&a.push(d)}}const u=r.space,c={nodeName:e.tagName,tagName:e.tagName,attrs:a,namespaceURI:Ua[u],childNodes:[],parentNode:null};return c.childNodes=_m(e.children,c,r),bo(e,c),e.tagName==="template"&&e.content&&(c.content=eI(e.content,r)),c}function aI(e,t,n){const r=ld(e,t);if(n===!1||n===null||n===void 0||typeof n=="number"&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?JE(n):i2(n));const a={name:r.attribute,value:n===!0?"":String(n)};if(r.space&&r.space!=="html"&&r.space!=="svg"){const o=a.name.indexOf(":");o<0?a.prefix="":(a.name=a.name.slice(o+1),a.prefix=r.attribute.slice(0,o)),a.namespace=Ua[r.space]}return a}function _m(e,t,n){let r=-1;const a=[];if(e)for(;++r<e.length;){const o=F2(e[r],n);o.parentNode=t,a.push(o)}return a}function bo(e,t){const n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}const iI=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],oI=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Bt="�";var H;(function(e){e[e.EOF=-1]="EOF",e[e.NULL=0]="NULL",e[e.TABULATION=9]="TABULATION",e[e.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",e[e.LINE_FEED=10]="LINE_FEED",e[e.FORM_FEED=12]="FORM_FEED",e[e.SPACE=32]="SPACE",e[e.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",e[e.QUOTATION_MARK=34]="QUOTATION_MARK",e[e.AMPERSAND=38]="AMPERSAND",e[e.APOSTROPHE=39]="APOSTROPHE",e[e.HYPHEN_MINUS=45]="HYPHEN_MINUS",e[e.SOLIDUS=47]="SOLIDUS",e[e.DIGIT_0=48]="DIGIT_0",e[e.DIGIT_9=57]="DIGIT_9",e[e.SEMICOLON=59]="SEMICOLON",e[e.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",e[e.EQUALS_SIGN=61]="EQUALS_SIGN",e[e.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",e[e.QUESTION_MARK=63]="QUESTION_MARK",e[e.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",e[e.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",e[e.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",e[e.GRAVE_ACCENT=96]="GRAVE_ACCENT",e[e.LATIN_SMALL_A=97]="LATIN_SMALL_A",e[e.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(H||(H={}));const Qn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function j2(e){return e>=55296&&e<=57343}function uI(e){return e>=56320&&e<=57343}function lI(e,t){return(e-55296)*1024+9216+t}function B2(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function H2(e){return e>=64976&&e<=65007||oI.has(e)}var ie;(function(e){e.controlCharacterInInputStream="control-character-in-input-stream",e.noncharacterInInputStream="noncharacter-in-input-stream",e.surrogateInInputStream="surrogate-in-input-stream",e.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",e.endTagWithAttributes="end-tag-with-attributes",e.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",e.unexpectedSolidusInTag="unexpected-solidus-in-tag",e.unexpectedNullCharacter="unexpected-null-character",e.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",e.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",e.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",e.missingEndTagName="missing-end-tag-name",e.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",e.unknownNamedCharacterReference="unknown-named-character-reference",e.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",e.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",e.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",e.eofBeforeTagName="eof-before-tag-name",e.eofInTag="eof-in-tag",e.missingAttributeValue="missing-attribute-value",e.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",e.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",e.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",e.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",e.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",e.missingDoctypePublicIdentifier="missing-doctype-public-identifier",e.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",e.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",e.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",e.cdataInHtmlContent="cdata-in-html-content",e.incorrectlyOpenedComment="incorrectly-opened-comment",e.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",e.eofInDoctype="eof-in-doctype",e.nestedComment="nested-comment",e.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",e.eofInComment="eof-in-comment",e.incorrectlyClosedComment="incorrectly-closed-comment",e.eofInCdata="eof-in-cdata",e.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",e.nullCharacterReference="null-character-reference",e.surrogateCharacterReference="surrogate-character-reference",e.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",e.controlCharacterReference="control-character-reference",e.noncharacterCharacterReference="noncharacter-character-reference",e.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",e.missingDoctypeName="missing-doctype-name",e.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",e.duplicateAttribute="duplicate-attribute",e.nonConformingDoctype="non-conforming-doctype",e.missingDoctype="missing-doctype",e.misplacedDoctype="misplaced-doctype",e.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",e.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",e.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",e.openElementsLeftAfterEof="open-elements-left-after-eof",e.abandonedHeadElementChild="abandoned-head-element-child",e.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",e.nestedNoscriptInHead="nested-noscript-in-head",e.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ie||(ie={}));const cI=65536;class dI{constructor(t){this.handler=t,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=cI,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(t,n){const{line:r,col:a,offset:o}=this,u=a+n,c=o+n;return{code:t,startLine:r,endLine:r,startCol:u,endCol:u,startOffset:c,endOffset:c}}_err(t){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(t,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(t){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(uI(n))return this.pos++,this._addGap(),lI(t,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,H.EOF;return this._err(ie.surrogateInInputStream),t}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(t,n){this.html.length>0?this.html+=t:this.html=t,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(t){this.html=this.html.substring(0,this.pos+1)+t+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(t,n){if(this.pos+t.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(t,this.pos);for(let r=0;r<t.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==t.charCodeAt(r))return!1;return!0}peek(t){const n=this.pos+t;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,H.EOF;const r=this.html.charCodeAt(n);return r===H.CARRIAGE_RETURN?H.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,H.EOF;let t=this.html.charCodeAt(this.pos);return t===H.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,H.LINE_FEED):t===H.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,j2(t)&&(t=this._processSurrogate(t)),this.handler.onParseError===null||t>31&&t<127||t===H.LINE_FEED||t===H.CARRIAGE_RETURN||t>159&&t<64976||this._checkForProblematicCharacters(t),t)}_checkForProblematicCharacters(t){B2(t)?this._err(ie.controlCharacterInInputStream):H2(t)&&this._err(ie.noncharacterInInputStream)}retreat(t){for(this.pos-=t;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var tt;(function(e){e[e.CHARACTER=0]="CHARACTER",e[e.NULL_CHARACTER=1]="NULL_CHARACTER",e[e.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",e[e.START_TAG=3]="START_TAG",e[e.END_TAG=4]="END_TAG",e[e.COMMENT=5]="COMMENT",e[e.DOCTYPE=6]="DOCTYPE",e[e.EOF=7]="EOF",e[e.HIBERNATION=8]="HIBERNATION"})(tt||(tt={}));function U2(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}const fI=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),hI=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function mI(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=hI.get(e))!==null&&t!==void 0?t:e}var vn;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(vn||(vn={}));const pI=32;var pa;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(pa||(pa={}));function T0(e){return e>=vn.ZERO&&e<=vn.NINE}function gI(e){return e>=vn.UPPER_A&&e<=vn.UPPER_F||e>=vn.LOWER_A&&e<=vn.LOWER_F}function yI(e){return e>=vn.UPPER_A&&e<=vn.UPPER_Z||e>=vn.LOWER_A&&e<=vn.LOWER_Z||T0(e)}function bI(e){return e===vn.EQUALS||yI(e)}var xn;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(xn||(xn={}));var Cs;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Cs||(Cs={}));class xI{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=xn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Cs.Strict}startEntity(t){this.decodeMode=t,this.state=xn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case xn.EntityStart:return t.charCodeAt(n)===vn.NUM?(this.state=xn.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=xn.NamedEntity,this.stateNamedEntity(t,n));case xn.NumericStart:return this.stateNumericStart(t,n);case xn.NumericDecimal:return this.stateNumericDecimal(t,n);case xn.NumericHex:return this.stateNumericHex(t,n);case xn.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|pI)===vn.LOWER_X?(this.state=xn.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=xn.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,a){if(n!==r){const o=r-n;this.result=this.result*Math.pow(a,o)+Number.parseInt(t.substr(n,o),a),this.consumed+=o}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const a=t.charCodeAt(n);if(T0(a)||gI(a))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(a,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const a=t.charCodeAt(n);if(T0(a))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(a,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===vn.SEMI)this.consumed+=1;else if(this.decodeMode===Cs.Strict)return 0;return this.emitCodePoint(mI(this.result),this.consumed),this.errors&&(t!==vn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let a=r[this.treeIndex],o=(a&pa.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const u=t.charCodeAt(n);if(this.treeIndex=EI(r,a,this.treeIndex+Math.max(1,o),u),this.treeIndex<0)return this.result===0||this.decodeMode===Cs.Attribute&&(o===0||bI(u))?0:this.emitNotTerminatedNamedEntity();if(a=r[this.treeIndex],o=(a&pa.VALUE_LENGTH)>>14,o!==0){if(u===vn.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Cs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,a=(r[n]&pa.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,a,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:a}=this;return this.emitCodePoint(n===1?a[t]&~pa.VALUE_LENGTH:a[t+1],r),n===3&&this.emitCodePoint(a[t+2],r),r}end(){var t;switch(this.state){case xn.NamedEntity:return this.result!==0&&(this.decodeMode!==Cs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case xn.NumericDecimal:return this.emitNumericEntity(0,2);case xn.NumericHex:return this.emitNumericEntity(0,3);case xn.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case xn.EntityStart:return 0}}}function EI(e,t,n,r){const a=(t&pa.BRANCH_LENGTH)>>7,o=t&pa.JUMP_TABLE;if(a===0)return o!==0&&r===o?n:-1;if(o){const d=r-o;return d<0||d>=a?-1:e[n+d]-1}let u=n,c=u+a-1;for(;u<=c;){const d=u+c>>>1,f=e[d];if(f<r)u=d+1;else if(f>r)c=d-1;else return e[d+a]}return-1}var ce;(function(e){e.HTML="http://www.w3.org/1999/xhtml",e.MATHML="http://www.w3.org/1998/Math/MathML",e.SVG="http://www.w3.org/2000/svg",e.XLINK="http://www.w3.org/1999/xlink",e.XML="http://www.w3.org/XML/1998/namespace",e.XMLNS="http://www.w3.org/2000/xmlns/"})(ce||(ce={}));var Ja;(function(e){e.TYPE="type",e.ACTION="action",e.ENCODING="encoding",e.PROMPT="prompt",e.NAME="name",e.COLOR="color",e.FACE="face",e.SIZE="size"})(Ja||(Ja={}));var wr;(function(e){e.NO_QUIRKS="no-quirks",e.QUIRKS="quirks",e.LIMITED_QUIRKS="limited-quirks"})(wr||(wr={}));var ne;(function(e){e.A="a",e.ADDRESS="address",e.ANNOTATION_XML="annotation-xml",e.APPLET="applet",e.AREA="area",e.ARTICLE="article",e.ASIDE="aside",e.B="b",e.BASE="base",e.BASEFONT="basefont",e.BGSOUND="bgsound",e.BIG="big",e.BLOCKQUOTE="blockquote",e.BODY="body",e.BR="br",e.BUTTON="button",e.CAPTION="caption",e.CENTER="center",e.CODE="code",e.COL="col",e.COLGROUP="colgroup",e.DD="dd",e.DESC="desc",e.DETAILS="details",e.DIALOG="dialog",e.DIR="dir",e.DIV="div",e.DL="dl",e.DT="dt",e.EM="em",e.EMBED="embed",e.FIELDSET="fieldset",e.FIGCAPTION="figcaption",e.FIGURE="figure",e.FONT="font",e.FOOTER="footer",e.FOREIGN_OBJECT="foreignObject",e.FORM="form",e.FRAME="frame",e.FRAMESET="frameset",e.H1="h1",e.H2="h2",e.H3="h3",e.H4="h4",e.H5="h5",e.H6="h6",e.HEAD="head",e.HEADER="header",e.HGROUP="hgroup",e.HR="hr",e.HTML="html",e.I="i",e.IMG="img",e.IMAGE="image",e.INPUT="input",e.IFRAME="iframe",e.KEYGEN="keygen",e.LABEL="label",e.LI="li",e.LINK="link",e.LISTING="listing",e.MAIN="main",e.MALIGNMARK="malignmark",e.MARQUEE="marquee",e.MATH="math",e.MENU="menu",e.META="meta",e.MGLYPH="mglyph",e.MI="mi",e.MO="mo",e.MN="mn",e.MS="ms",e.MTEXT="mtext",e.NAV="nav",e.NOBR="nobr",e.NOFRAMES="noframes",e.NOEMBED="noembed",e.NOSCRIPT="noscript",e.OBJECT="object",e.OL="ol",e.OPTGROUP="optgroup",e.OPTION="option",e.P="p",e.PARAM="param",e.PLAINTEXT="plaintext",e.PRE="pre",e.RB="rb",e.RP="rp",e.RT="rt",e.RTC="rtc",e.RUBY="ruby",e.S="s",e.SCRIPT="script",e.SEARCH="search",e.SECTION="section",e.SELECT="select",e.SOURCE="source",e.SMALL="small",e.SPAN="span",e.STRIKE="strike",e.STRONG="strong",e.STYLE="style",e.SUB="sub",e.SUMMARY="summary",e.SUP="sup",e.TABLE="table",e.TBODY="tbody",e.TEMPLATE="template",e.TEXTAREA="textarea",e.TFOOT="tfoot",e.TD="td",e.TH="th",e.THEAD="thead",e.TITLE="title",e.TR="tr",e.TRACK="track",e.TT="tt",e.U="u",e.UL="ul",e.SVG="svg",e.VAR="var",e.WBR="wbr",e.XMP="xmp"})(ne||(ne={}));var y;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.A=1]="A",e[e.ADDRESS=2]="ADDRESS",e[e.ANNOTATION_XML=3]="ANNOTATION_XML",e[e.APPLET=4]="APPLET",e[e.AREA=5]="AREA",e[e.ARTICLE=6]="ARTICLE",e[e.ASIDE=7]="ASIDE",e[e.B=8]="B",e[e.BASE=9]="BASE",e[e.BASEFONT=10]="BASEFONT",e[e.BGSOUND=11]="BGSOUND",e[e.BIG=12]="BIG",e[e.BLOCKQUOTE=13]="BLOCKQUOTE",e[e.BODY=14]="BODY",e[e.BR=15]="BR",e[e.BUTTON=16]="BUTTON",e[e.CAPTION=17]="CAPTION",e[e.CENTER=18]="CENTER",e[e.CODE=19]="CODE",e[e.COL=20]="COL",e[e.COLGROUP=21]="COLGROUP",e[e.DD=22]="DD",e[e.DESC=23]="DESC",e[e.DETAILS=24]="DETAILS",e[e.DIALOG=25]="DIALOG",e[e.DIR=26]="DIR",e[e.DIV=27]="DIV",e[e.DL=28]="DL",e[e.DT=29]="DT",e[e.EM=30]="EM",e[e.EMBED=31]="EMBED",e[e.FIELDSET=32]="FIELDSET",e[e.FIGCAPTION=33]="FIGCAPTION",e[e.FIGURE=34]="FIGURE",e[e.FONT=35]="FONT",e[e.FOOTER=36]="FOOTER",e[e.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",e[e.FORM=38]="FORM",e[e.FRAME=39]="FRAME",e[e.FRAMESET=40]="FRAMESET",e[e.H1=41]="H1",e[e.H2=42]="H2",e[e.H3=43]="H3",e[e.H4=44]="H4",e[e.H5=45]="H5",e[e.H6=46]="H6",e[e.HEAD=47]="HEAD",e[e.HEADER=48]="HEADER",e[e.HGROUP=49]="HGROUP",e[e.HR=50]="HR",e[e.HTML=51]="HTML",e[e.I=52]="I",e[e.IMG=53]="IMG",e[e.IMAGE=54]="IMAGE",e[e.INPUT=55]="INPUT",e[e.IFRAME=56]="IFRAME",e[e.KEYGEN=57]="KEYGEN",e[e.LABEL=58]="LABEL",e[e.LI=59]="LI",e[e.LINK=60]="LINK",e[e.LISTING=61]="LISTING",e[e.MAIN=62]="MAIN",e[e.MALIGNMARK=63]="MALIGNMARK",e[e.MARQUEE=64]="MARQUEE",e[e.MATH=65]="MATH",e[e.MENU=66]="MENU",e[e.META=67]="META",e[e.MGLYPH=68]="MGLYPH",e[e.MI=69]="MI",e[e.MO=70]="MO",e[e.MN=71]="MN",e[e.MS=72]="MS",e[e.MTEXT=73]="MTEXT",e[e.NAV=74]="NAV",e[e.NOBR=75]="NOBR",e[e.NOFRAMES=76]="NOFRAMES",e[e.NOEMBED=77]="NOEMBED",e[e.NOSCRIPT=78]="NOSCRIPT",e[e.OBJECT=79]="OBJECT",e[e.OL=80]="OL",e[e.OPTGROUP=81]="OPTGROUP",e[e.OPTION=82]="OPTION",e[e.P=83]="P",e[e.PARAM=84]="PARAM",e[e.PLAINTEXT=85]="PLAINTEXT",e[e.PRE=86]="PRE",e[e.RB=87]="RB",e[e.RP=88]="RP",e[e.RT=89]="RT",e[e.RTC=90]="RTC",e[e.RUBY=91]="RUBY",e[e.S=92]="S",e[e.SCRIPT=93]="SCRIPT",e[e.SEARCH=94]="SEARCH",e[e.SECTION=95]="SECTION",e[e.SELECT=96]="SELECT",e[e.SOURCE=97]="SOURCE",e[e.SMALL=98]="SMALL",e[e.SPAN=99]="SPAN",e[e.STRIKE=100]="STRIKE",e[e.STRONG=101]="STRONG",e[e.STYLE=102]="STYLE",e[e.SUB=103]="SUB",e[e.SUMMARY=104]="SUMMARY",e[e.SUP=105]="SUP",e[e.TABLE=106]="TABLE",e[e.TBODY=107]="TBODY",e[e.TEMPLATE=108]="TEMPLATE",e[e.TEXTAREA=109]="TEXTAREA",e[e.TFOOT=110]="TFOOT",e[e.TD=111]="TD",e[e.TH=112]="TH",e[e.THEAD=113]="THEAD",e[e.TITLE=114]="TITLE",e[e.TR=115]="TR",e[e.TRACK=116]="TRACK",e[e.TT=117]="TT",e[e.U=118]="U",e[e.UL=119]="UL",e[e.SVG=120]="SVG",e[e.VAR=121]="VAR",e[e.WBR=122]="WBR",e[e.XMP=123]="XMP"})(y||(y={}));const vI=new Map([[ne.A,y.A],[ne.ADDRESS,y.ADDRESS],[ne.ANNOTATION_XML,y.ANNOTATION_XML],[ne.APPLET,y.APPLET],[ne.AREA,y.AREA],[ne.ARTICLE,y.ARTICLE],[ne.ASIDE,y.ASIDE],[ne.B,y.B],[ne.BASE,y.BASE],[ne.BASEFONT,y.BASEFONT],[ne.BGSOUND,y.BGSOUND],[ne.BIG,y.BIG],[ne.BLOCKQUOTE,y.BLOCKQUOTE],[ne.BODY,y.BODY],[ne.BR,y.BR],[ne.BUTTON,y.BUTTON],[ne.CAPTION,y.CAPTION],[ne.CENTER,y.CENTER],[ne.CODE,y.CODE],[ne.COL,y.COL],[ne.COLGROUP,y.COLGROUP],[ne.DD,y.DD],[ne.DESC,y.DESC],[ne.DETAILS,y.DETAILS],[ne.DIALOG,y.DIALOG],[ne.DIR,y.DIR],[ne.DIV,y.DIV],[ne.DL,y.DL],[ne.DT,y.DT],[ne.EM,y.EM],[ne.EMBED,y.EMBED],[ne.FIELDSET,y.FIELDSET],[ne.FIGCAPTION,y.FIGCAPTION],[ne.FIGURE,y.FIGURE],[ne.FONT,y.FONT],[ne.FOOTER,y.FOOTER],[ne.FOREIGN_OBJECT,y.FOREIGN_OBJECT],[ne.FORM,y.FORM],[ne.FRAME,y.FRAME],[ne.FRAMESET,y.FRAMESET],[ne.H1,y.H1],[ne.H2,y.H2],[ne.H3,y.H3],[ne.H4,y.H4],[ne.H5,y.H5],[ne.H6,y.H6],[ne.HEAD,y.HEAD],[ne.HEADER,y.HEADER],[ne.HGROUP,y.HGROUP],[ne.HR,y.HR],[ne.HTML,y.HTML],[ne.I,y.I],[ne.IMG,y.IMG],[ne.IMAGE,y.IMAGE],[ne.INPUT,y.INPUT],[ne.IFRAME,y.IFRAME],[ne.KEYGEN,y.KEYGEN],[ne.LABEL,y.LABEL],[ne.LI,y.LI],[ne.LINK,y.LINK],[ne.LISTING,y.LISTING],[ne.MAIN,y.MAIN],[ne.MALIGNMARK,y.MALIGNMARK],[ne.MARQUEE,y.MARQUEE],[ne.MATH,y.MATH],[ne.MENU,y.MENU],[ne.META,y.META],[ne.MGLYPH,y.MGLYPH],[ne.MI,y.MI],[ne.MO,y.MO],[ne.MN,y.MN],[ne.MS,y.MS],[ne.MTEXT,y.MTEXT],[ne.NAV,y.NAV],[ne.NOBR,y.NOBR],[ne.NOFRAMES,y.NOFRAMES],[ne.NOEMBED,y.NOEMBED],[ne.NOSCRIPT,y.NOSCRIPT],[ne.OBJECT,y.OBJECT],[ne.OL,y.OL],[ne.OPTGROUP,y.OPTGROUP],[ne.OPTION,y.OPTION],[ne.P,y.P],[ne.PARAM,y.PARAM],[ne.PLAINTEXT,y.PLAINTEXT],[ne.PRE,y.PRE],[ne.RB,y.RB],[ne.RP,y.RP],[ne.RT,y.RT],[ne.RTC,y.RTC],[ne.RUBY,y.RUBY],[ne.S,y.S],[ne.SCRIPT,y.SCRIPT],[ne.SEARCH,y.SEARCH],[ne.SECTION,y.SECTION],[ne.SELECT,y.SELECT],[ne.SOURCE,y.SOURCE],[ne.SMALL,y.SMALL],[ne.SPAN,y.SPAN],[ne.STRIKE,y.STRIKE],[ne.STRONG,y.STRONG],[ne.STYLE,y.STYLE],[ne.SUB,y.SUB],[ne.SUMMARY,y.SUMMARY],[ne.SUP,y.SUP],[ne.TABLE,y.TABLE],[ne.TBODY,y.TBODY],[ne.TEMPLATE,y.TEMPLATE],[ne.TEXTAREA,y.TEXTAREA],[ne.TFOOT,y.TFOOT],[ne.TD,y.TD],[ne.TH,y.TH],[ne.THEAD,y.THEAD],[ne.TITLE,y.TITLE],[ne.TR,y.TR],[ne.TRACK,y.TRACK],[ne.TT,y.TT],[ne.U,y.U],[ne.UL,y.UL],[ne.SVG,y.SVG],[ne.VAR,y.VAR],[ne.WBR,y.WBR],[ne.XMP,y.XMP]]);function xo(e){var t;return(t=vI.get(e))!==null&&t!==void 0?t:y.UNKNOWN}const he=y,TI={[ce.HTML]:new Set([he.ADDRESS,he.APPLET,he.AREA,he.ARTICLE,he.ASIDE,he.BASE,he.BASEFONT,he.BGSOUND,he.BLOCKQUOTE,he.BODY,he.BR,he.BUTTON,he.CAPTION,he.CENTER,he.COL,he.COLGROUP,he.DD,he.DETAILS,he.DIR,he.DIV,he.DL,he.DT,he.EMBED,he.FIELDSET,he.FIGCAPTION,he.FIGURE,he.FOOTER,he.FORM,he.FRAME,he.FRAMESET,he.H1,he.H2,he.H3,he.H4,he.H5,he.H6,he.HEAD,he.HEADER,he.HGROUP,he.HR,he.HTML,he.IFRAME,he.IMG,he.INPUT,he.LI,he.LINK,he.LISTING,he.MAIN,he.MARQUEE,he.MENU,he.META,he.NAV,he.NOEMBED,he.NOFRAMES,he.NOSCRIPT,he.OBJECT,he.OL,he.P,he.PARAM,he.PLAINTEXT,he.PRE,he.SCRIPT,he.SECTION,he.SELECT,he.SOURCE,he.STYLE,he.SUMMARY,he.TABLE,he.TBODY,he.TD,he.TEMPLATE,he.TEXTAREA,he.TFOOT,he.TH,he.THEAD,he.TITLE,he.TR,he.TRACK,he.UL,he.WBR,he.XMP]),[ce.MATHML]:new Set([he.MI,he.MO,he.MN,he.MS,he.MTEXT,he.ANNOTATION_XML]),[ce.SVG]:new Set([he.TITLE,he.FOREIGN_OBJECT,he.DESC]),[ce.XLINK]:new Set,[ce.XML]:new Set,[ce.XMLNS]:new Set},w0=new Set([he.H1,he.H2,he.H3,he.H4,he.H5,he.H6]);ne.STYLE,ne.SCRIPT,ne.XMP,ne.IFRAME,ne.NOEMBED,ne.NOFRAMES,ne.PLAINTEXT;var z;(function(e){e[e.DATA=0]="DATA",e[e.RCDATA=1]="RCDATA",e[e.RAWTEXT=2]="RAWTEXT",e[e.SCRIPT_DATA=3]="SCRIPT_DATA",e[e.PLAINTEXT=4]="PLAINTEXT",e[e.TAG_OPEN=5]="TAG_OPEN",e[e.END_TAG_OPEN=6]="END_TAG_OPEN",e[e.TAG_NAME=7]="TAG_NAME",e[e.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",e[e.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",e[e.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",e[e.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",e[e.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",e[e.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",e[e.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",e[e.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",e[e.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",e[e.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",e[e.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",e[e.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",e[e.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",e[e.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",e[e.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",e[e.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",e[e.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",e[e.BOGUS_COMMENT=40]="BOGUS_COMMENT",e[e.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",e[e.COMMENT_START=42]="COMMENT_START",e[e.COMMENT_START_DASH=43]="COMMENT_START_DASH",e[e.COMMENT=44]="COMMENT",e[e.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",e[e.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",e[e.COMMENT_END_DASH=49]="COMMENT_END_DASH",e[e.COMMENT_END=50]="COMMENT_END",e[e.COMMENT_END_BANG=51]="COMMENT_END_BANG",e[e.DOCTYPE=52]="DOCTYPE",e[e.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",e[e.DOCTYPE_NAME=54]="DOCTYPE_NAME",e[e.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",e[e.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",e[e.CDATA_SECTION=68]="CDATA_SECTION",e[e.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",e[e.CDATA_SECTION_END=70]="CDATA_SECTION_END",e[e.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",e[e.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(z||(z={}));const nn={DATA:z.DATA,RCDATA:z.RCDATA,RAWTEXT:z.RAWTEXT,SCRIPT_DATA:z.SCRIPT_DATA,PLAINTEXT:z.PLAINTEXT,CDATA_SECTION:z.CDATA_SECTION};function wI(e){return e>=H.DIGIT_0&&e<=H.DIGIT_9}function Tu(e){return e>=H.LATIN_CAPITAL_A&&e<=H.LATIN_CAPITAL_Z}function SI(e){return e>=H.LATIN_SMALL_A&&e<=H.LATIN_SMALL_Z}function na(e){return SI(e)||Tu(e)}function mb(e){return na(e)||wI(e)}function Cc(e){return e+32}function z2(e){return e===H.SPACE||e===H.LINE_FEED||e===H.TABULATION||e===H.FORM_FEED}function pb(e){return z2(e)||e===H.SOLIDUS||e===H.GREATER_THAN_SIGN}function CI(e){return e===H.NULL?ie.nullCharacterReference:e>1114111?ie.characterReferenceOutsideUnicodeRange:j2(e)?ie.surrogateCharacterReference:H2(e)?ie.noncharacterCharacterReference:B2(e)||e===H.CARRIAGE_RETURN?ie.controlCharacterReference:null}class kI{constructor(t,n){this.options=t,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=z.DATA,this.returnState=z.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new dI(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new xI(fI,(r,a)=>{this.preprocessor.pos=this.entityStartPos+a-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ie.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ie.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const a=CI(r);a&&this._err(a,1)}}:void 0)}_err(t,n=0){var r,a;(a=(r=this.handler).onParseError)===null||a===void 0||a.call(r,this.preprocessor.getError(t,n))}getCurrentLocation(t){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-t,startOffset:this.preprocessor.offset-t,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const t=this._consume();this._ensureHibernation()||this._callState(t)}this.inLoop=!1}}pause(){this.paused=!0}resume(t){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||t==null||t())}write(t,n,r){this.active=!0,this.preprocessor.write(t,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(t){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(t),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(t){this.consumedAfterSnapshot+=t;for(let n=0;n<t;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(t,n){return this.preprocessor.startsWith(t,n)?(this._advanceBy(t.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:tt.START_TAG,tagName:"",tagID:y.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:tt.END_TAG,tagName:"",tagID:y.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(t){this.currentToken={type:tt.COMMENT,data:"",location:this.getCurrentLocation(t)}}_createDoctypeToken(t){this.currentToken={type:tt.DOCTYPE,name:t,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(t,n){this.currentCharacterToken={type:t,chars:n,location:this.currentLocation}}_createAttr(t){this.currentAttr={name:t,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var t,n;const r=this.currentToken;if(U2(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const a=(t=(n=r.location).attrs)!==null&&t!==void 0?t:n.attrs=Object.create(null);a[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ie.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(t){this._emitCurrentCharacterToken(t.location),this.currentToken=null,t.location&&(t.location.endLine=this.preprocessor.line,t.location.endCol=this.preprocessor.col+1,t.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const t=this.currentToken;this.prepareToken(t),t.tagID=xo(t.tagName),t.type===tt.START_TAG?(this.lastStartTagName=t.tagName,this.handler.onStartTag(t)):(t.attrs.length>0&&this._err(ie.endTagWithAttributes),t.selfClosing&&this._err(ie.endTagWithTrailingSolidus),this.handler.onEndTag(t)),this.preprocessor.dropParsedChunk()}emitCurrentComment(t){this.prepareToken(t),this.handler.onComment(t),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(t){this.prepareToken(t),this.handler.onDoctype(t),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(t){if(this.currentCharacterToken){switch(t&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=t.startLine,this.currentCharacterToken.location.endCol=t.startCol,this.currentCharacterToken.location.endOffset=t.startOffset),this.currentCharacterToken.type){case tt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case tt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case tt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const t=this.getCurrentLocation(0);t&&(t.endLine=t.startLine,t.endCol=t.startCol,t.endOffset=t.startOffset),this._emitCurrentCharacterToken(t),this.handler.onEof({type:tt.EOF,location:t}),this.active=!1}_appendCharToCurrentCharacterToken(t,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===t){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(t,n)}_emitCodePoint(t){const n=z2(t)?tt.WHITESPACE_CHARACTER:t===H.NULL?tt.NULL_CHARACTER:tt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(t))}_emitChars(t){this._appendCharToCurrentCharacterToken(tt.CHARACTER,t)}_startCharacterReference(){this.returnState=this.state,this.state=z.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Cs.Attribute:Cs.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===z.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===z.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===z.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(t){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(t):this._emitCodePoint(t)}_callState(t){switch(this.state){case z.DATA:{this._stateData(t);break}case z.RCDATA:{this._stateRcdata(t);break}case z.RAWTEXT:{this._stateRawtext(t);break}case z.SCRIPT_DATA:{this._stateScriptData(t);break}case z.PLAINTEXT:{this._statePlaintext(t);break}case z.TAG_OPEN:{this._stateTagOpen(t);break}case z.END_TAG_OPEN:{this._stateEndTagOpen(t);break}case z.TAG_NAME:{this._stateTagName(t);break}case z.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(t);break}case z.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(t);break}case z.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(t);break}case z.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(t);break}case z.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(t);break}case z.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(t);break}case z.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(t);break}case z.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(t);break}case z.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(t);break}case z.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(t);break}case z.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(t);break}case z.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(t);break}case z.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(t);break}case z.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(t);break}case z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(t);break}case z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(t);break}case z.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(t);break}case z.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(t);break}case z.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(t);break}case z.ATTRIBUTE_NAME:{this._stateAttributeName(t);break}case z.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(t);break}case z.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(t);break}case z.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(t);break}case z.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(t);break}case z.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(t);break}case z.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(t);break}case z.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(t);break}case z.BOGUS_COMMENT:{this._stateBogusComment(t);break}case z.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(t);break}case z.COMMENT_START:{this._stateCommentStart(t);break}case z.COMMENT_START_DASH:{this._stateCommentStartDash(t);break}case z.COMMENT:{this._stateComment(t);break}case z.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(t);break}case z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(t);break}case z.COMMENT_END_DASH:{this._stateCommentEndDash(t);break}case z.COMMENT_END:{this._stateCommentEnd(t);break}case z.COMMENT_END_BANG:{this._stateCommentEndBang(t);break}case z.DOCTYPE:{this._stateDoctype(t);break}case z.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(t);break}case z.DOCTYPE_NAME:{this._stateDoctypeName(t);break}case z.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(t);break}case z.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(t);break}case z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(t);break}case z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(t);break}case z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(t);break}case z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(t);break}case z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(t);break}case z.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(t);break}case z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(t);break}case z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(t);break}case z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(t);break}case z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(t);break}case z.BOGUS_DOCTYPE:{this._stateBogusDoctype(t);break}case z.CDATA_SECTION:{this._stateCdataSection(t);break}case z.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(t);break}case z.CDATA_SECTION_END:{this._stateCdataSectionEnd(t);break}case z.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case z.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(t);break}default:throw new Error("Unknown state")}}_stateData(t){switch(t){case H.LESS_THAN_SIGN:{this.state=z.TAG_OPEN;break}case H.AMPERSAND:{this._startCharacterReference();break}case H.NULL:{this._err(ie.unexpectedNullCharacter),this._emitCodePoint(t);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRcdata(t){switch(t){case H.AMPERSAND:{this._startCharacterReference();break}case H.LESS_THAN_SIGN:{this.state=z.RCDATA_LESS_THAN_SIGN;break}case H.NULL:{this._err(ie.unexpectedNullCharacter),this._emitChars(Bt);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateRawtext(t){switch(t){case H.LESS_THAN_SIGN:{this.state=z.RAWTEXT_LESS_THAN_SIGN;break}case H.NULL:{this._err(ie.unexpectedNullCharacter),this._emitChars(Bt);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptData(t){switch(t){case H.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_LESS_THAN_SIGN;break}case H.NULL:{this._err(ie.unexpectedNullCharacter),this._emitChars(Bt);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_statePlaintext(t){switch(t){case H.NULL:{this._err(ie.unexpectedNullCharacter),this._emitChars(Bt);break}case H.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateTagOpen(t){if(na(t))this._createStartTagToken(),this.state=z.TAG_NAME,this._stateTagName(t);else switch(t){case H.EXCLAMATION_MARK:{this.state=z.MARKUP_DECLARATION_OPEN;break}case H.SOLIDUS:{this.state=z.END_TAG_OPEN;break}case H.QUESTION_MARK:{this._err(ie.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t);break}case H.EOF:{this._err(ie.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ie.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=z.DATA,this._stateData(t)}}_stateEndTagOpen(t){if(na(t))this._createEndTagToken(),this.state=z.TAG_NAME,this._stateTagName(t);else switch(t){case H.GREATER_THAN_SIGN:{this._err(ie.missingEndTagName),this.state=z.DATA;break}case H.EOF:{this._err(ie.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ie.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t)}}_stateTagName(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=z.BEFORE_ATTRIBUTE_NAME;break}case H.SOLIDUS:{this.state=z.SELF_CLOSING_START_TAG;break}case H.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentTagToken();break}case H.NULL:{this._err(ie.unexpectedNullCharacter),n.tagName+=Bt;break}case H.EOF:{this._err(ie.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(Tu(t)?Cc(t):t)}}_stateRcdataLessThanSign(t){t===H.SOLIDUS?this.state=z.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=z.RCDATA,this._stateRcdata(t))}_stateRcdataEndTagOpen(t){na(t)?(this.state=z.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(t)):(this._emitChars("</"),this.state=z.RCDATA,this._stateRcdata(t))}handleSpecialEndTag(t){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=z.BEFORE_ATTRIBUTE_NAME,!1;case H.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=z.SELF_CLOSING_START_TAG,!1;case H.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=z.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=z.RCDATA,this._stateRcdata(t))}_stateRawtextLessThanSign(t){t===H.SOLIDUS?this.state=z.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=z.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagOpen(t){na(t)?(this.state=z.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(t)):(this._emitChars("</"),this.state=z.RAWTEXT,this._stateRawtext(t))}_stateRawtextEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=z.RAWTEXT,this._stateRawtext(t))}_stateScriptDataLessThanSign(t){switch(t){case H.SOLIDUS:{this.state=z.SCRIPT_DATA_END_TAG_OPEN;break}case H.EXCLAMATION_MARK:{this.state=z.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=z.SCRIPT_DATA,this._stateScriptData(t)}}_stateScriptDataEndTagOpen(t){na(t)?(this.state=z.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(t)):(this._emitChars("</"),this.state=z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStart(t){t===H.HYPHEN_MINUS?(this.state=z.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscapeStartDash(t){t===H.HYPHEN_MINUS?(this.state=z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=z.SCRIPT_DATA,this._stateScriptData(t))}_stateScriptDataEscaped(t){switch(t){case H.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case H.NULL:{this._err(ie.unexpectedNullCharacter),this._emitChars(Bt);break}case H.EOF:{this._err(ie.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataEscapedDash(t){switch(t){case H.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case H.NULL:{this._err(ie.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_ESCAPED,this._emitChars(Bt);break}case H.EOF:{this._err(ie.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedDashDash(t){switch(t){case H.HYPHEN_MINUS:{this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case H.GREATER_THAN_SIGN:{this.state=z.SCRIPT_DATA,this._emitChars(">");break}case H.NULL:{this._err(ie.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_ESCAPED,this._emitChars(Bt);break}case H.EOF:{this._err(ie.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataEscapedLessThanSign(t){t===H.SOLIDUS?this.state=z.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:na(t)?(this._emitChars("<"),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(t)):(this._emitChars("<"),this.state=z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagOpen(t){na(t)?(this.state=z.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(t)):(this._emitChars("</"),this.state=z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataEscapedEndTagName(t){this.handleSpecialEndTag(t)&&(this._emitChars("</"),this.state=z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscapeStart(t){if(this.preprocessor.startsWith(Qn.SCRIPT,!1)&&pb(this.preprocessor.peek(Qn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Qn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=z.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(t))}_stateScriptDataDoubleEscaped(t){switch(t){case H.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case H.NULL:{this._err(ie.unexpectedNullCharacter),this._emitChars(Bt);break}case H.EOF:{this._err(ie.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDash(t){switch(t){case H.HYPHEN_MINUS:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case H.NULL:{this._err(ie.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Bt);break}case H.EOF:{this._err(ie.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedDashDash(t){switch(t){case H.HYPHEN_MINUS:{this._emitChars("-");break}case H.LESS_THAN_SIGN:{this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case H.GREATER_THAN_SIGN:{this.state=z.SCRIPT_DATA,this._emitChars(">");break}case H.NULL:{this._err(ie.unexpectedNullCharacter),this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Bt);break}case H.EOF:{this._err(ie.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(t)}}_stateScriptDataDoubleEscapedLessThanSign(t){t===H.SOLIDUS?(this.state=z.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateScriptDataDoubleEscapeEnd(t){if(this.preprocessor.startsWith(Qn.SCRIPT,!1)&&pb(this.preprocessor.peek(Qn.SCRIPT.length))){this._emitCodePoint(t);for(let n=0;n<Qn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=z.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=z.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(t))}_stateBeforeAttributeName(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.SOLIDUS:case H.GREATER_THAN_SIGN:case H.EOF:{this.state=z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case H.EQUALS_SIGN:{this._err(ie.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=z.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=z.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateAttributeName(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:case H.SOLIDUS:case H.GREATER_THAN_SIGN:case H.EOF:{this._leaveAttrName(),this.state=z.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(t);break}case H.EQUALS_SIGN:{this._leaveAttrName(),this.state=z.BEFORE_ATTRIBUTE_VALUE;break}case H.QUOTATION_MARK:case H.APOSTROPHE:case H.LESS_THAN_SIGN:{this._err(ie.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(t);break}case H.NULL:{this._err(ie.unexpectedNullCharacter),this.currentAttr.name+=Bt;break}default:this.currentAttr.name+=String.fromCodePoint(Tu(t)?Cc(t):t)}}_stateAfterAttributeName(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.SOLIDUS:{this.state=z.SELF_CLOSING_START_TAG;break}case H.EQUALS_SIGN:{this.state=z.BEFORE_ATTRIBUTE_VALUE;break}case H.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentTagToken();break}case H.EOF:{this._err(ie.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=z.ATTRIBUTE_NAME,this._stateAttributeName(t)}}_stateBeforeAttributeValue(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.QUOTATION_MARK:{this.state=z.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case H.APOSTROPHE:{this.state=z.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case H.GREATER_THAN_SIGN:{this._err(ie.missingAttributeValue),this.state=z.DATA,this.emitCurrentTagToken();break}default:this.state=z.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(t)}}_stateAttributeValueDoubleQuoted(t){switch(t){case H.QUOTATION_MARK:{this.state=z.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case H.AMPERSAND:{this._startCharacterReference();break}case H.NULL:{this._err(ie.unexpectedNullCharacter),this.currentAttr.value+=Bt;break}case H.EOF:{this._err(ie.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueSingleQuoted(t){switch(t){case H.APOSTROPHE:{this.state=z.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case H.AMPERSAND:{this._startCharacterReference();break}case H.NULL:{this._err(ie.unexpectedNullCharacter),this.currentAttr.value+=Bt;break}case H.EOF:{this._err(ie.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAttributeValueUnquoted(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this._leaveAttrValue(),this.state=z.BEFORE_ATTRIBUTE_NAME;break}case H.AMPERSAND:{this._startCharacterReference();break}case H.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=z.DATA,this.emitCurrentTagToken();break}case H.NULL:{this._err(ie.unexpectedNullCharacter),this.currentAttr.value+=Bt;break}case H.QUOTATION_MARK:case H.APOSTROPHE:case H.LESS_THAN_SIGN:case H.EQUALS_SIGN:case H.GRAVE_ACCENT:{this._err(ie.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(t);break}case H.EOF:{this._err(ie.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(t)}}_stateAfterAttributeValueQuoted(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this._leaveAttrValue(),this.state=z.BEFORE_ATTRIBUTE_NAME;break}case H.SOLIDUS:{this._leaveAttrValue(),this.state=z.SELF_CLOSING_START_TAG;break}case H.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=z.DATA,this.emitCurrentTagToken();break}case H.EOF:{this._err(ie.eofInTag),this._emitEOFToken();break}default:this._err(ie.missingWhitespaceBetweenAttributes),this.state=z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateSelfClosingStartTag(t){switch(t){case H.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=z.DATA,this.emitCurrentTagToken();break}case H.EOF:{this._err(ie.eofInTag),this._emitEOFToken();break}default:this._err(ie.unexpectedSolidusInTag),this.state=z.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(t)}}_stateBogusComment(t){const n=this.currentToken;switch(t){case H.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentComment(n);break}case H.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case H.NULL:{this._err(ie.unexpectedNullCharacter),n.data+=Bt;break}default:n.data+=String.fromCodePoint(t)}}_stateMarkupDeclarationOpen(t){this._consumeSequenceIfMatch(Qn.DASH_DASH,!0)?(this._createCommentToken(Qn.DASH_DASH.length+1),this.state=z.COMMENT_START):this._consumeSequenceIfMatch(Qn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Qn.DOCTYPE.length+1),this.state=z.DOCTYPE):this._consumeSequenceIfMatch(Qn.CDATA_START,!0)?this.inForeignNode?this.state=z.CDATA_SECTION:(this._err(ie.cdataInHtmlContent),this._createCommentToken(Qn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=z.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ie.incorrectlyOpenedComment),this._createCommentToken(2),this.state=z.BOGUS_COMMENT,this._stateBogusComment(t))}_stateCommentStart(t){switch(t){case H.HYPHEN_MINUS:{this.state=z.COMMENT_START_DASH;break}case H.GREATER_THAN_SIGN:{this._err(ie.abruptClosingOfEmptyComment),this.state=z.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=z.COMMENT,this._stateComment(t)}}_stateCommentStartDash(t){const n=this.currentToken;switch(t){case H.HYPHEN_MINUS:{this.state=z.COMMENT_END;break}case H.GREATER_THAN_SIGN:{this._err(ie.abruptClosingOfEmptyComment),this.state=z.DATA,this.emitCurrentComment(n);break}case H.EOF:{this._err(ie.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=z.COMMENT,this._stateComment(t)}}_stateComment(t){const n=this.currentToken;switch(t){case H.HYPHEN_MINUS:{this.state=z.COMMENT_END_DASH;break}case H.LESS_THAN_SIGN:{n.data+="<",this.state=z.COMMENT_LESS_THAN_SIGN;break}case H.NULL:{this._err(ie.unexpectedNullCharacter),n.data+=Bt;break}case H.EOF:{this._err(ie.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(t)}}_stateCommentLessThanSign(t){const n=this.currentToken;switch(t){case H.EXCLAMATION_MARK:{n.data+="!",this.state=z.COMMENT_LESS_THAN_SIGN_BANG;break}case H.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=z.COMMENT,this._stateComment(t)}}_stateCommentLessThanSignBang(t){t===H.HYPHEN_MINUS?this.state=z.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=z.COMMENT,this._stateComment(t))}_stateCommentLessThanSignBangDash(t){t===H.HYPHEN_MINUS?this.state=z.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=z.COMMENT_END_DASH,this._stateCommentEndDash(t))}_stateCommentLessThanSignBangDashDash(t){t!==H.GREATER_THAN_SIGN&&t!==H.EOF&&this._err(ie.nestedComment),this.state=z.COMMENT_END,this._stateCommentEnd(t)}_stateCommentEndDash(t){const n=this.currentToken;switch(t){case H.HYPHEN_MINUS:{this.state=z.COMMENT_END;break}case H.EOF:{this._err(ie.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=z.COMMENT,this._stateComment(t)}}_stateCommentEnd(t){const n=this.currentToken;switch(t){case H.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentComment(n);break}case H.EXCLAMATION_MARK:{this.state=z.COMMENT_END_BANG;break}case H.HYPHEN_MINUS:{n.data+="-";break}case H.EOF:{this._err(ie.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=z.COMMENT,this._stateComment(t)}}_stateCommentEndBang(t){const n=this.currentToken;switch(t){case H.HYPHEN_MINUS:{n.data+="--!",this.state=z.COMMENT_END_DASH;break}case H.GREATER_THAN_SIGN:{this._err(ie.incorrectlyClosedComment),this.state=z.DATA,this.emitCurrentComment(n);break}case H.EOF:{this._err(ie.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=z.COMMENT,this._stateComment(t)}}_stateDoctype(t){switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=z.BEFORE_DOCTYPE_NAME;break}case H.GREATER_THAN_SIGN:{this.state=z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t);break}case H.EOF:{this._err(ie.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ie.missingWhitespaceBeforeDoctypeName),this.state=z.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(t)}}_stateBeforeDoctypeName(t){if(Tu(t))this._createDoctypeToken(String.fromCharCode(Cc(t))),this.state=z.DOCTYPE_NAME;else switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.NULL:{this._err(ie.unexpectedNullCharacter),this._createDoctypeToken(Bt),this.state=z.DOCTYPE_NAME;break}case H.GREATER_THAN_SIGN:{this._err(ie.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case H.EOF:{this._err(ie.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(t)),this.state=z.DOCTYPE_NAME}}_stateDoctypeName(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=z.AFTER_DOCTYPE_NAME;break}case H.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentDoctype(n);break}case H.NULL:{this._err(ie.unexpectedNullCharacter),n.name+=Bt;break}case H.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(Tu(t)?Cc(t):t)}}_stateAfterDoctypeName(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentDoctype(n);break}case H.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Qn.PUBLIC,!1)?this.state=z.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Qn.SYSTEM,!1)?this.state=z.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ie.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t))}}_stateAfterDoctypePublicKeyword(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=z.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case H.QUOTATION_MARK:{this._err(ie.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{this._err(ie.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case H.GREATER_THAN_SIGN:{this._err(ie.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case H.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ie.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.QUOTATION_MARK:{n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{n.publicId="",this.state=z.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case H.GREATER_THAN_SIGN:{this._err(ie.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case H.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ie.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypePublicIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case H.QUOTATION_MARK:{this.state=z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case H.NULL:{this._err(ie.unexpectedNullCharacter),n.publicId+=Bt;break}case H.GREATER_THAN_SIGN:{this._err(ie.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case H.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateDoctypePublicIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case H.APOSTROPHE:{this.state=z.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case H.NULL:{this._err(ie.unexpectedNullCharacter),n.publicId+=Bt;break}case H.GREATER_THAN_SIGN:{this._err(ie.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case H.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(t)}}_stateAfterDoctypePublicIdentifier(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=z.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case H.GREATER_THAN_SIGN:{this.state=z.DATA,this.emitCurrentDoctype(n);break}case H.QUOTATION_MARK:{this._err(ie.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{this._err(ie.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case H.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ie.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBetweenDoctypePublicAndSystemIdentifiers(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=z.DATA;break}case H.QUOTATION_MARK:{n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case H.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ie.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateAfterDoctypeSystemKeyword(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:{this.state=z.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case H.QUOTATION_MARK:{this._err(ie.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{this._err(ie.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case H.GREATER_THAN_SIGN:{this._err(ie.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case H.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ie.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBeforeDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.QUOTATION_MARK:{n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case H.APOSTROPHE:{n.systemId="",this.state=z.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case H.GREATER_THAN_SIGN:{this._err(ie.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.DATA,this.emitCurrentDoctype(n);break}case H.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ie.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateDoctypeSystemIdentifierDoubleQuoted(t){const n=this.currentToken;switch(t){case H.QUOTATION_MARK:{this.state=z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case H.NULL:{this._err(ie.unexpectedNullCharacter),n.systemId+=Bt;break}case H.GREATER_THAN_SIGN:{this._err(ie.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case H.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateDoctypeSystemIdentifierSingleQuoted(t){const n=this.currentToken;switch(t){case H.APOSTROPHE:{this.state=z.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case H.NULL:{this._err(ie.unexpectedNullCharacter),n.systemId+=Bt;break}case H.GREATER_THAN_SIGN:{this._err(ie.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=z.DATA;break}case H.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(t)}}_stateAfterDoctypeSystemIdentifier(t){const n=this.currentToken;switch(t){case H.SPACE:case H.LINE_FEED:case H.TABULATION:case H.FORM_FEED:break;case H.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=z.DATA;break}case H.EOF:{this._err(ie.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ie.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=z.BOGUS_DOCTYPE,this._stateBogusDoctype(t)}}_stateBogusDoctype(t){const n=this.currentToken;switch(t){case H.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=z.DATA;break}case H.NULL:{this._err(ie.unexpectedNullCharacter);break}case H.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(t){switch(t){case H.RIGHT_SQUARE_BRACKET:{this.state=z.CDATA_SECTION_BRACKET;break}case H.EOF:{this._err(ie.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(t)}}_stateCdataSectionBracket(t){t===H.RIGHT_SQUARE_BRACKET?this.state=z.CDATA_SECTION_END:(this._emitChars("]"),this.state=z.CDATA_SECTION,this._stateCdataSection(t))}_stateCdataSectionEnd(t){switch(t){case H.GREATER_THAN_SIGN:{this.state=z.DATA;break}case H.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=z.CDATA_SECTION,this._stateCdataSection(t)}}_stateCharacterReference(){let t=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(t<0)if(this.preprocessor.lastChunkWritten)t=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}t===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(H.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&mb(this.preprocessor.peek(1))?z.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(t){mb(t)?this._flushCodePointConsumedAsCharacterReference(t):(t===H.SEMICOLON&&this._err(ie.unknownNamedCharacterReference),this.state=this.returnState,this._callState(t))}}const W2=new Set([y.DD,y.DT,y.LI,y.OPTGROUP,y.OPTION,y.P,y.RB,y.RP,y.RT,y.RTC]),gb=new Set([...W2,y.CAPTION,y.COLGROUP,y.TBODY,y.TD,y.TFOOT,y.TH,y.THEAD,y.TR]),Wc=new Set([y.APPLET,y.CAPTION,y.HTML,y.MARQUEE,y.OBJECT,y.TABLE,y.TD,y.TEMPLATE,y.TH]),_I=new Set([...Wc,y.OL,y.UL]),NI=new Set([...Wc,y.BUTTON]),yb=new Set([y.ANNOTATION_XML,y.MI,y.MN,y.MO,y.MS,y.MTEXT]),bb=new Set([y.DESC,y.FOREIGN_OBJECT,y.TITLE]),OI=new Set([y.TR,y.TEMPLATE,y.HTML]),DI=new Set([y.TBODY,y.TFOOT,y.THEAD,y.TEMPLATE,y.HTML]),AI=new Set([y.TABLE,y.TEMPLATE,y.HTML]),II=new Set([y.TD,y.TH]);class RI{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(t,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=y.UNKNOWN,this.current=t}_indexOf(t){return this.items.lastIndexOf(t,this.stackTop)}_isInTemplate(){return this.currentTagId===y.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ce.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(t,n){this.stackTop++,this.items[this.stackTop]=t,this.current=t,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(t,n,!0)}pop(){const t=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!0)}replace(t,n){const r=this._indexOf(t);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(t,n,r){const a=this._indexOf(t)+1;this.items.splice(a,0,n),this.tagIDs.splice(a,0,r),this.stackTop++,a===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,a===this.stackTop)}popUntilTagNamePopped(t){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(t,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==ce.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(t){for(;this.stackTop>=t;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<t)}}popUntilElementPopped(t){const n=this._indexOf(t);this.shortenToLength(Math.max(n,0))}popUntilPopped(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(w0,ce.HTML)}popUntilTableCellPopped(){this.popUntilPopped(II,ce.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(t,n){for(let r=this.stackTop;r>=0;r--)if(t.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(t,n){const r=this._indexOfTagNames(t,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(AI,ce.HTML)}clearBackToTableBodyContext(){this.clearBackTo(DI,ce.HTML)}clearBackToTableRowContext(){this.clearBackTo(OI,ce.HTML)}remove(t){const n=this._indexOf(t);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===y.BODY?this.items[1]:null}contains(t){return this._indexOf(t)>-1}getCommonAncestor(t){const n=this._indexOf(t)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===y.HTML}hasInDynamicScope(t,n){for(let r=this.stackTop;r>=0;r--){const a=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ce.HTML:{if(a===t)return!0;if(n.has(a))return!1;break}case ce.SVG:{if(bb.has(a))return!1;break}case ce.MATHML:{if(yb.has(a))return!1;break}}}return!0}hasInScope(t){return this.hasInDynamicScope(t,Wc)}hasInListItemScope(t){return this.hasInDynamicScope(t,_I)}hasInButtonScope(t){return this.hasInDynamicScope(t,NI)}hasNumberedHeaderInScope(){for(let t=this.stackTop;t>=0;t--){const n=this.tagIDs[t];switch(this.treeAdapter.getNamespaceURI(this.items[t])){case ce.HTML:{if(w0.has(n))return!0;if(Wc.has(n))return!1;break}case ce.SVG:{if(bb.has(n))return!1;break}case ce.MATHML:{if(yb.has(n))return!1;break}}}return!0}hasInTableScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ce.HTML)switch(this.tagIDs[n]){case t:return!0;case y.TABLE:case y.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===ce.HTML)switch(this.tagIDs[t]){case y.TBODY:case y.THEAD:case y.TFOOT:return!0;case y.TABLE:case y.HTML:return!1}return!0}hasInSelectScope(t){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ce.HTML)switch(this.tagIDs[n]){case t:return!0;case y.OPTION:case y.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&W2.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&gb.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(t){for(;this.currentTagId!==void 0&&this.currentTagId!==t&&gb.has(this.currentTagId);)this.pop()}}const Ph=3;var Zr;(function(e){e[e.Marker=0]="Marker",e[e.Element=1]="Element"})(Zr||(Zr={}));const xb={type:Zr.Marker};class LI{constructor(t){this.treeAdapter=t,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(t,n){const r=[],a=n.length,o=this.treeAdapter.getTagName(t),u=this.treeAdapter.getNamespaceURI(t);for(let c=0;c<this.entries.length;c++){const d=this.entries[c];if(d.type===Zr.Marker)break;const{element:f}=d;if(this.treeAdapter.getTagName(f)===o&&this.treeAdapter.getNamespaceURI(f)===u){const p=this.treeAdapter.getAttrList(f);p.length===a&&r.push({idx:c,attrs:p})}}return r}_ensureNoahArkCondition(t){if(this.entries.length<Ph)return;const n=this.treeAdapter.getAttrList(t),r=this._getNoahArkConditionCandidates(t,n);if(r.length<Ph)return;const a=new Map(n.map(u=>[u.name,u.value]));let o=0;for(let u=0;u<r.length;u++){const c=r[u];c.attrs.every(d=>a.get(d.name)===d.value)&&(o+=1,o>=Ph&&this.entries.splice(c.idx,1))}}insertMarker(){this.entries.unshift(xb)}pushElement(t,n){this._ensureNoahArkCondition(t),this.entries.unshift({type:Zr.Element,element:t,token:n})}insertElementAfterBookmark(t,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Zr.Element,element:t,token:n})}removeEntry(t){const n=this.entries.indexOf(t);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const t=this.entries.indexOf(xb);t===-1?this.entries.length=0:this.entries.splice(0,t+1)}getElementEntryInScopeWithTagName(t){const n=this.entries.find(r=>r.type===Zr.Marker||this.treeAdapter.getTagName(r.element)===t);return n&&n.type===Zr.Element?n:null}getElementEntry(t){return this.entries.find(n=>n.type===Zr.Element&&n.element===t)}}const ra={createDocument(){return{nodeName:"#document",mode:wr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:"#comment",data:e,parentNode:null}},createTextNode(e){return{nodeName:"#text",value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){const r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){const a=e.childNodes.find(o=>o.nodeName==="#documentType");if(a)a.name=t,a.publicId=n,a.systemId=r;else{const o={nodeName:"#documentType",name:t,publicId:n,systemId:r,parentNode:null};ra.appendChild(e,o)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){const n=e.childNodes[e.childNodes.length-1];if(ra.isTextNode(n)){n.value+=t;return}}ra.appendChild(e,ra.createTextNode(t))},insertTextBefore(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&ra.isTextNode(r)?r.value+=t:ra.insertBefore(e,ra.createTextNode(t),n)},adoptAttributes(e,t){const n=new Set(e.attrs.map(r=>r.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName==="#text"},isCommentNode(e){return e.nodeName==="#comment"},isDocumentTypeNode(e){return e.nodeName==="#documentType"},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,"tagName")},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},Y2="html",MI="about:legacy-compat",PI="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",q2=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],FI=[...q2,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],jI=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),$2=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],BI=[...$2,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function Eb(e,t){return t.some(n=>e.startsWith(n))}function HI(e){return e.name===Y2&&e.publicId===null&&(e.systemId===null||e.systemId===MI)}function UI(e){if(e.name!==Y2)return wr.QUIRKS;const{systemId:t}=e;if(t&&t.toLowerCase()===PI)return wr.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),jI.has(n))return wr.QUIRKS;let r=t===null?FI:q2;if(Eb(n,r))return wr.QUIRKS;if(r=t===null?$2:BI,Eb(n,r))return wr.LIMITED_QUIRKS}return wr.NO_QUIRKS}const vb={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},zI="definitionurl",WI="definitionURL",YI=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(e=>[e.toLowerCase(),e])),qI=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ce.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ce.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ce.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ce.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ce.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ce.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ce.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ce.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ce.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ce.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ce.XMLNS}]]),$I=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(e=>[e.toLowerCase(),e])),VI=new Set([y.B,y.BIG,y.BLOCKQUOTE,y.BODY,y.BR,y.CENTER,y.CODE,y.DD,y.DIV,y.DL,y.DT,y.EM,y.EMBED,y.H1,y.H2,y.H3,y.H4,y.H5,y.H6,y.HEAD,y.HR,y.I,y.IMG,y.LI,y.LISTING,y.MENU,y.META,y.NOBR,y.OL,y.P,y.PRE,y.RUBY,y.S,y.SMALL,y.SPAN,y.STRONG,y.STRIKE,y.SUB,y.SUP,y.TABLE,y.TT,y.U,y.UL,y.VAR]);function QI(e){const t=e.tagID;return t===y.FONT&&e.attrs.some(({name:r})=>r===Ja.COLOR||r===Ja.SIZE||r===Ja.FACE)||VI.has(t)}function V2(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===zI){e.attrs[t].name=WI;break}}function Q2(e){for(let t=0;t<e.attrs.length;t++){const n=YI.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function Nm(e){for(let t=0;t<e.attrs.length;t++){const n=qI.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function GI(e){const t=$I.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=xo(e.tagName))}function XI(e,t){return t===ce.MATHML&&(e===y.MI||e===y.MO||e===y.MN||e===y.MS||e===y.MTEXT)}function KI(e,t,n){if(t===ce.MATHML&&e===y.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Ja.ENCODING){const a=n[r].value.toLowerCase();return a===vb.TEXT_HTML||a===vb.APPLICATION_XML}}return t===ce.SVG&&(e===y.FOREIGN_OBJECT||e===y.DESC||e===y.TITLE)}function JI(e,t,n,r){return(!r||r===ce.HTML)&&KI(e,t,n)||(!r||r===ce.MATHML)&&XI(e,t)}const ZI="hidden",eR=8,tR=3;var $;(function(e){e[e.INITIAL=0]="INITIAL",e[e.BEFORE_HTML=1]="BEFORE_HTML",e[e.BEFORE_HEAD=2]="BEFORE_HEAD",e[e.IN_HEAD=3]="IN_HEAD",e[e.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",e[e.AFTER_HEAD=5]="AFTER_HEAD",e[e.IN_BODY=6]="IN_BODY",e[e.TEXT=7]="TEXT",e[e.IN_TABLE=8]="IN_TABLE",e[e.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",e[e.IN_CAPTION=10]="IN_CAPTION",e[e.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",e[e.IN_TABLE_BODY=12]="IN_TABLE_BODY",e[e.IN_ROW=13]="IN_ROW",e[e.IN_CELL=14]="IN_CELL",e[e.IN_SELECT=15]="IN_SELECT",e[e.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",e[e.IN_TEMPLATE=17]="IN_TEMPLATE",e[e.AFTER_BODY=18]="AFTER_BODY",e[e.IN_FRAMESET=19]="IN_FRAMESET",e[e.AFTER_FRAMESET=20]="AFTER_FRAMESET",e[e.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",e[e.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})($||($={}));const nR={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},G2=new Set([y.TABLE,y.TBODY,y.TFOOT,y.THEAD,y.TR]),Tb={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:ra,onParseError:null};class wb{constructor(t,n,r=null,a=null){this.fragmentContext=r,this.scriptHandler=a,this.currentToken=null,this.stopped=!1,this.insertionMode=$.INITIAL,this.originalInsertionMode=$.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...Tb,...t},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new kI(this.options,this),this.activeFormattingElements=new LI(this.treeAdapter),this.fragmentContextID=r?xo(this.treeAdapter.getTagName(r)):y.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new RI(this.document,this.treeAdapter,this)}static parse(t,n){const r=new this(n);return r.tokenizer.write(t,!0),r.document}static getFragmentParser(t,n){const r={...Tb,...n};t??(t=r.treeAdapter.createElement(ne.TEMPLATE,ce.HTML,[]));const a=r.treeAdapter.createElement("documentmock",ce.HTML,[]),o=new this(r,a,t);return o.fragmentContextID===y.TEMPLATE&&o.tmplInsertionModeStack.unshift($.IN_TEMPLATE),o._initTokenizerForFragmentParsing(),o._insertFakeRootElement(),o._resetInsertionMode(),o._findFormInFragmentContext(),o}getFragment(){const t=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(t,n),n}_err(t,n,r){var a;if(!this.onParseError)return;const o=(a=t.location)!==null&&a!==void 0?a:nR,u={code:n,startLine:o.startLine,startCol:o.startCol,startOffset:o.startOffset,endLine:r?o.startLine:o.endLine,endCol:r?o.startCol:o.endCol,endOffset:r?o.startOffset:o.endOffset};this.onParseError(u)}onItemPush(t,n,r){var a,o;(o=(a=this.treeAdapter).onItemPush)===null||o===void 0||o.call(a,t),r&&this.openElements.stackTop>0&&this._setContextModes(t,n)}onItemPop(t,n){var r,a;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(t,this.currentToken),(a=(r=this.treeAdapter).onItemPop)===null||a===void 0||a.call(r,t,this.openElements.current),n){let o,u;this.openElements.stackTop===0&&this.fragmentContext?(o=this.fragmentContext,u=this.fragmentContextID):{current:o,currentTagId:u}=this.openElements,this._setContextModes(o,u)}}_setContextModes(t,n){const r=t===this.document||t&&this.treeAdapter.getNamespaceURI(t)===ce.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&t!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,t)}_switchToTextParsing(t,n){this._insertElement(t,ce.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=$.TEXT}switchToPlaintextParsing(){this.insertionMode=$.TEXT,this.originalInsertionMode=$.IN_BODY,this.tokenizer.state=nn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let t=this.fragmentContext;for(;t;){if(this.treeAdapter.getTagName(t)===ne.FORM){this.formElement=t;break}t=this.treeAdapter.getParentNode(t)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ce.HTML))switch(this.fragmentContextID){case y.TITLE:case y.TEXTAREA:{this.tokenizer.state=nn.RCDATA;break}case y.STYLE:case y.XMP:case y.IFRAME:case y.NOEMBED:case y.NOFRAMES:case y.NOSCRIPT:{this.tokenizer.state=nn.RAWTEXT;break}case y.SCRIPT:{this.tokenizer.state=nn.SCRIPT_DATA;break}case y.PLAINTEXT:{this.tokenizer.state=nn.PLAINTEXT;break}}}_setDocumentType(t){const n=t.name||"",r=t.publicId||"",a=t.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,a),t.location){const u=this.treeAdapter.getChildNodes(this.document).find(c=>this.treeAdapter.isDocumentTypeNode(c));u&&this.treeAdapter.setNodeSourceCodeLocation(u,t.location)}}_attachElementToTree(t,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(t,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(t);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,t)}}_appendElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location)}_insertElement(t,n){const r=this.treeAdapter.createElement(t.tagName,n,t.attrs);this._attachElementToTree(r,t.location),this.openElements.push(r,t.tagID)}_insertFakeElement(t,n){const r=this.treeAdapter.createElement(t,ce.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(t){const n=this.treeAdapter.createElement(t.tagName,ce.HTML,t.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,t.location),this.openElements.push(n,t.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const t=this.treeAdapter.createElement(ne.HTML,ce.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(t,null),this.treeAdapter.appendChild(this.openElements.current,t),this.openElements.push(t,y.HTML)}_appendCommentNode(t,n){const r=this.treeAdapter.createCommentNode(t.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,t.location)}_insertCharacters(t){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,t.chars,r):this.treeAdapter.insertText(n,t.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,t.chars)),!t.location)return;const a=this.treeAdapter.getChildNodes(n),o=r?a.lastIndexOf(r):a.length,u=a[o-1];if(this.treeAdapter.getNodeSourceCodeLocation(u)){const{endLine:d,endCol:f,endOffset:p}=t.location;this.treeAdapter.updateNodeSourceCodeLocation(u,{endLine:d,endCol:f,endOffset:p})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(u,t.location)}_adoptNodes(t,n){for(let r=this.treeAdapter.getFirstChild(t);r;r=this.treeAdapter.getFirstChild(t))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(t,n){if(this.treeAdapter.getNodeSourceCodeLocation(t)&&n.location){const r=n.location,a=this.treeAdapter.getTagName(t),o=n.type===tt.END_TAG&&a===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(t,o)}}shouldProcessStartTagTokenInForeignContent(t){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,t.tagID===y.SVG&&this.treeAdapter.getTagName(n)===ne.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ce.MATHML?!1:this.tokenizer.inForeignNode||(t.tagID===y.MGLYPH||t.tagID===y.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ce.HTML)}_processToken(t){switch(t.type){case tt.CHARACTER:{this.onCharacter(t);break}case tt.NULL_CHARACTER:{this.onNullCharacter(t);break}case tt.COMMENT:{this.onComment(t);break}case tt.DOCTYPE:{this.onDoctype(t);break}case tt.START_TAG:{this._processStartTag(t);break}case tt.END_TAG:{this.onEndTag(t);break}case tt.EOF:{this.onEof(t);break}case tt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(t);break}}}_isIntegrationPoint(t,n,r){const a=this.treeAdapter.getNamespaceURI(n),o=this.treeAdapter.getAttrList(n);return JI(t,a,o,r)}_reconstructActiveFormattingElements(){const t=this.activeFormattingElements.entries.length;if(t){const n=this.activeFormattingElements.entries.findIndex(a=>a.type===Zr.Marker||this.openElements.contains(a.element)),r=n===-1?t-1:n-1;for(let a=r;a>=0;a--){const o=this.activeFormattingElements.entries[a];this._insertElement(o.token,this.treeAdapter.getNamespaceURI(o.element)),o.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=$.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(y.P),this.openElements.popUntilTagNamePopped(y.P)}_resetInsertionMode(){for(let t=this.openElements.stackTop;t>=0;t--)switch(t===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[t]){case y.TR:{this.insertionMode=$.IN_ROW;return}case y.TBODY:case y.THEAD:case y.TFOOT:{this.insertionMode=$.IN_TABLE_BODY;return}case y.CAPTION:{this.insertionMode=$.IN_CAPTION;return}case y.COLGROUP:{this.insertionMode=$.IN_COLUMN_GROUP;return}case y.TABLE:{this.insertionMode=$.IN_TABLE;return}case y.BODY:{this.insertionMode=$.IN_BODY;return}case y.FRAMESET:{this.insertionMode=$.IN_FRAMESET;return}case y.SELECT:{this._resetInsertionModeForSelect(t);return}case y.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case y.HTML:{this.insertionMode=this.headElement?$.AFTER_HEAD:$.BEFORE_HEAD;return}case y.TD:case y.TH:{if(t>0){this.insertionMode=$.IN_CELL;return}break}case y.HEAD:{if(t>0){this.insertionMode=$.IN_HEAD;return}break}}this.insertionMode=$.IN_BODY}_resetInsertionModeForSelect(t){if(t>0)for(let n=t-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===y.TEMPLATE)break;if(r===y.TABLE){this.insertionMode=$.IN_SELECT_IN_TABLE;return}}this.insertionMode=$.IN_SELECT}_isElementCausesFosterParenting(t){return G2.has(t)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t];switch(this.openElements.tagIDs[t]){case y.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===ce.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case y.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[t-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(t){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,t,n.beforeElement):this.treeAdapter.appendChild(n.parent,t)}_isSpecialElement(t,n){const r=this.treeAdapter.getNamespaceURI(t);return TI[r].has(n)}onCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){IL(this,t);return}switch(this.insertionMode){case $.INITIAL:{yu(this,t);break}case $.BEFORE_HTML:{ku(this,t);break}case $.BEFORE_HEAD:{_u(this,t);break}case $.IN_HEAD:{Nu(this,t);break}case $.IN_HEAD_NO_SCRIPT:{Ou(this,t);break}case $.AFTER_HEAD:{Du(this,t);break}case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:{K2(this,t);break}case $.TEXT:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:{this._insertCharacters(t);break}case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:{Fh(this,t);break}case $.IN_TABLE_TEXT:{rv(this,t);break}case $.IN_COLUMN_GROUP:{Yc(this,t);break}case $.AFTER_BODY:{qc(this,t);break}case $.AFTER_AFTER_BODY:{Dc(this,t);break}}}onNullCharacter(t){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){AL(this,t);return}switch(this.insertionMode){case $.INITIAL:{yu(this,t);break}case $.BEFORE_HTML:{ku(this,t);break}case $.BEFORE_HEAD:{_u(this,t);break}case $.IN_HEAD:{Nu(this,t);break}case $.IN_HEAD_NO_SCRIPT:{Ou(this,t);break}case $.AFTER_HEAD:{Du(this,t);break}case $.TEXT:{this._insertCharacters(t);break}case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:{Fh(this,t);break}case $.IN_COLUMN_GROUP:{Yc(this,t);break}case $.AFTER_BODY:{qc(this,t);break}case $.AFTER_AFTER_BODY:{Dc(this,t);break}}}onComment(t){if(this.skipNextNewLine=!1,this.currentNotInHTML){S0(this,t);return}switch(this.insertionMode){case $.INITIAL:case $.BEFORE_HTML:case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:case $.IN_BODY:case $.IN_TABLE:case $.IN_CAPTION:case $.IN_COLUMN_GROUP:case $.IN_TABLE_BODY:case $.IN_ROW:case $.IN_CELL:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:case $.IN_TEMPLATE:case $.IN_FRAMESET:case $.AFTER_FRAMESET:{S0(this,t);break}case $.IN_TABLE_TEXT:{bu(this,t);break}case $.AFTER_BODY:{lR(this,t);break}case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:{cR(this,t);break}}}onDoctype(t){switch(this.skipNextNewLine=!1,this.insertionMode){case $.INITIAL:{dR(this,t);break}case $.BEFORE_HEAD:case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:{this._err(t,ie.misplacedDoctype);break}case $.IN_TABLE_TEXT:{bu(this,t);break}}}onStartTag(t){this.skipNextNewLine=!1,this.currentToken=t,this._processStartTag(t),t.selfClosing&&!t.ackSelfClosing&&this._err(t,ie.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(t){this.shouldProcessStartTagTokenInForeignContent(t)?RL(this,t):this._startTagOutsideForeignContent(t)}_startTagOutsideForeignContent(t){switch(this.insertionMode){case $.INITIAL:{yu(this,t);break}case $.BEFORE_HTML:{fR(this,t);break}case $.BEFORE_HEAD:{mR(this,t);break}case $.IN_HEAD:{Hr(this,t);break}case $.IN_HEAD_NO_SCRIPT:{yR(this,t);break}case $.AFTER_HEAD:{xR(this,t);break}case $.IN_BODY:{Pn(this,t);break}case $.IN_TABLE:{uo(this,t);break}case $.IN_TABLE_TEXT:{bu(this,t);break}case $.IN_CAPTION:{pL(this,t);break}case $.IN_COLUMN_GROUP:{Am(this,t);break}case $.IN_TABLE_BODY:{gd(this,t);break}case $.IN_ROW:{yd(this,t);break}case $.IN_CELL:{bL(this,t);break}case $.IN_SELECT:{iv(this,t);break}case $.IN_SELECT_IN_TABLE:{EL(this,t);break}case $.IN_TEMPLATE:{TL(this,t);break}case $.AFTER_BODY:{SL(this,t);break}case $.IN_FRAMESET:{CL(this,t);break}case $.AFTER_FRAMESET:{_L(this,t);break}case $.AFTER_AFTER_BODY:{OL(this,t);break}case $.AFTER_AFTER_FRAMESET:{DL(this,t);break}}}onEndTag(t){this.skipNextNewLine=!1,this.currentToken=t,this.currentNotInHTML?LL(this,t):this._endTagOutsideForeignContent(t)}_endTagOutsideForeignContent(t){switch(this.insertionMode){case $.INITIAL:{yu(this,t);break}case $.BEFORE_HTML:{hR(this,t);break}case $.BEFORE_HEAD:{pR(this,t);break}case $.IN_HEAD:{gR(this,t);break}case $.IN_HEAD_NO_SCRIPT:{bR(this,t);break}case $.AFTER_HEAD:{ER(this,t);break}case $.IN_BODY:{pd(this,t);break}case $.TEXT:{aL(this,t);break}case $.IN_TABLE:{Pu(this,t);break}case $.IN_TABLE_TEXT:{bu(this,t);break}case $.IN_CAPTION:{gL(this,t);break}case $.IN_COLUMN_GROUP:{yL(this,t);break}case $.IN_TABLE_BODY:{C0(this,t);break}case $.IN_ROW:{av(this,t);break}case $.IN_CELL:{xL(this,t);break}case $.IN_SELECT:{ov(this,t);break}case $.IN_SELECT_IN_TABLE:{vL(this,t);break}case $.IN_TEMPLATE:{wL(this,t);break}case $.AFTER_BODY:{lv(this,t);break}case $.IN_FRAMESET:{kL(this,t);break}case $.AFTER_FRAMESET:{NL(this,t);break}case $.AFTER_AFTER_BODY:{Dc(this,t);break}}}onEof(t){switch(this.insertionMode){case $.INITIAL:{yu(this,t);break}case $.BEFORE_HTML:{ku(this,t);break}case $.BEFORE_HEAD:{_u(this,t);break}case $.IN_HEAD:{Nu(this,t);break}case $.IN_HEAD_NO_SCRIPT:{Ou(this,t);break}case $.AFTER_HEAD:{Du(this,t);break}case $.IN_BODY:case $.IN_TABLE:case $.IN_CAPTION:case $.IN_COLUMN_GROUP:case $.IN_TABLE_BODY:case $.IN_ROW:case $.IN_CELL:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:{tv(this,t);break}case $.TEXT:{iL(this,t);break}case $.IN_TABLE_TEXT:{bu(this,t);break}case $.IN_TEMPLATE:{uv(this,t);break}case $.AFTER_BODY:case $.IN_FRAMESET:case $.AFTER_FRAMESET:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:{Dm(this,t);break}}}onWhitespaceCharacter(t){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.chars.charCodeAt(0)===H.LINE_FEED)){if(t.chars.length===1)return;t.chars=t.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(t);return}switch(this.insertionMode){case $.IN_HEAD:case $.IN_HEAD_NO_SCRIPT:case $.AFTER_HEAD:case $.TEXT:case $.IN_COLUMN_GROUP:case $.IN_SELECT:case $.IN_SELECT_IN_TABLE:case $.IN_FRAMESET:case $.AFTER_FRAMESET:{this._insertCharacters(t);break}case $.IN_BODY:case $.IN_CAPTION:case $.IN_CELL:case $.IN_TEMPLATE:case $.AFTER_BODY:case $.AFTER_AFTER_BODY:case $.AFTER_AFTER_FRAMESET:{X2(this,t);break}case $.IN_TABLE:case $.IN_TABLE_BODY:case $.IN_ROW:{Fh(this,t);break}case $.IN_TABLE_TEXT:{nv(this,t);break}}}}function rR(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):ev(e,t),n}function sR(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){const a=e.openElements.items[r];if(a===t.element)break;e._isSpecialElement(a,e.openElements.tagIDs[r])&&(n=a)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function aR(e,t,n){let r=t,a=e.openElements.getCommonAncestor(t);for(let o=0,u=a;u!==n;o++,u=a){a=e.openElements.getCommonAncestor(u);const c=e.activeFormattingElements.getElementEntry(u),d=c&&o>=tR;!c||d?(d&&e.activeFormattingElements.removeEntry(c),e.openElements.remove(u)):(u=iR(e,c),r===t&&(e.activeFormattingElements.bookmark=c),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(u,r),r=u)}return r}function iR(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function oR(e,t,n){const r=e.treeAdapter.getTagName(t),a=xo(r);if(e._isElementCausesFosterParenting(a))e._fosterParentElement(n);else{const o=e.treeAdapter.getNamespaceURI(t);a===y.TEMPLATE&&o===ce.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function uR(e,t,n){const r=e.treeAdapter.getNamespaceURI(n.element),{token:a}=n,o=e.treeAdapter.createElement(a.tagName,r,a.attrs);e._adoptNodes(t,o),e.treeAdapter.appendChild(t,o),e.activeFormattingElements.insertElementAfterBookmark(o,a),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,o,a.tagID)}function Om(e,t){for(let n=0;n<eR;n++){const r=rR(e,t);if(!r)break;const a=sR(e,r);if(!a)break;e.activeFormattingElements.bookmark=r;const o=aR(e,a,r.element),u=e.openElements.getCommonAncestor(r.element);e.treeAdapter.detachNode(o),u&&oR(e,u,o),uR(e,a,r)}}function S0(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function lR(e,t){e._appendCommentNode(t,e.openElements.items[0])}function cR(e,t){e._appendCommentNode(t,e.document)}function Dm(e,t){if(e.stopped=!0,t.location){const n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){const r=e.openElements.items[0],a=e.treeAdapter.getNodeSourceCodeLocation(r);if(a&&!a.endTag&&(e._setEndLocation(r,t),e.openElements.stackTop>=1)){const o=e.openElements.items[1],u=e.treeAdapter.getNodeSourceCodeLocation(o);u&&!u.endTag&&e._setEndLocation(o,t)}}}}function dR(e,t){e._setDocumentType(t);const n=t.forceQuirks?wr.QUIRKS:UI(t);HI(t)||e._err(t,ie.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=$.BEFORE_HTML}function yu(e,t){e._err(t,ie.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,wr.QUIRKS),e.insertionMode=$.BEFORE_HTML,e._processToken(t)}function fR(e,t){t.tagID===y.HTML?(e._insertElement(t,ce.HTML),e.insertionMode=$.BEFORE_HEAD):ku(e,t)}function hR(e,t){const n=t.tagID;(n===y.HTML||n===y.HEAD||n===y.BODY||n===y.BR)&&ku(e,t)}function ku(e,t){e._insertFakeRootElement(),e.insertionMode=$.BEFORE_HEAD,e._processToken(t)}function mR(e,t){switch(t.tagID){case y.HTML:{Pn(e,t);break}case y.HEAD:{e._insertElement(t,ce.HTML),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD;break}default:_u(e,t)}}function pR(e,t){const n=t.tagID;n===y.HEAD||n===y.BODY||n===y.HTML||n===y.BR?_u(e,t):e._err(t,ie.endTagWithoutMatchingOpenElement)}function _u(e,t){e._insertFakeElement(ne.HEAD,y.HEAD),e.headElement=e.openElements.current,e.insertionMode=$.IN_HEAD,e._processToken(t)}function Hr(e,t){switch(t.tagID){case y.HTML:{Pn(e,t);break}case y.BASE:case y.BASEFONT:case y.BGSOUND:case y.LINK:case y.META:{e._appendElement(t,ce.HTML),t.ackSelfClosing=!0;break}case y.TITLE:{e._switchToTextParsing(t,nn.RCDATA);break}case y.NOSCRIPT:{e.options.scriptingEnabled?e._switchToTextParsing(t,nn.RAWTEXT):(e._insertElement(t,ce.HTML),e.insertionMode=$.IN_HEAD_NO_SCRIPT);break}case y.NOFRAMES:case y.STYLE:{e._switchToTextParsing(t,nn.RAWTEXT);break}case y.SCRIPT:{e._switchToTextParsing(t,nn.SCRIPT_DATA);break}case y.TEMPLATE:{e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=$.IN_TEMPLATE,e.tmplInsertionModeStack.unshift($.IN_TEMPLATE);break}case y.HEAD:{e._err(t,ie.misplacedStartTagForHeadElement);break}default:Nu(e,t)}}function gR(e,t){switch(t.tagID){case y.HEAD:{e.openElements.pop(),e.insertionMode=$.AFTER_HEAD;break}case y.BODY:case y.BR:case y.HTML:{Nu(e,t);break}case y.TEMPLATE:{ci(e,t);break}default:e._err(t,ie.endTagWithoutMatchingOpenElement)}}function ci(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==y.TEMPLATE&&e._err(t,ie.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,ie.endTagWithoutMatchingOpenElement)}function Nu(e,t){e.openElements.pop(),e.insertionMode=$.AFTER_HEAD,e._processToken(t)}function yR(e,t){switch(t.tagID){case y.HTML:{Pn(e,t);break}case y.BASEFONT:case y.BGSOUND:case y.HEAD:case y.LINK:case y.META:case y.NOFRAMES:case y.STYLE:{Hr(e,t);break}case y.NOSCRIPT:{e._err(t,ie.nestedNoscriptInHead);break}default:Ou(e,t)}}function bR(e,t){switch(t.tagID){case y.NOSCRIPT:{e.openElements.pop(),e.insertionMode=$.IN_HEAD;break}case y.BR:{Ou(e,t);break}default:e._err(t,ie.endTagWithoutMatchingOpenElement)}}function Ou(e,t){const n=t.type===tt.EOF?ie.openElementsLeftAfterEof:ie.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=$.IN_HEAD,e._processToken(t)}function xR(e,t){switch(t.tagID){case y.HTML:{Pn(e,t);break}case y.BODY:{e._insertElement(t,ce.HTML),e.framesetOk=!1,e.insertionMode=$.IN_BODY;break}case y.FRAMESET:{e._insertElement(t,ce.HTML),e.insertionMode=$.IN_FRAMESET;break}case y.BASE:case y.BASEFONT:case y.BGSOUND:case y.LINK:case y.META:case y.NOFRAMES:case y.SCRIPT:case y.STYLE:case y.TEMPLATE:case y.TITLE:{e._err(t,ie.abandonedHeadElementChild),e.openElements.push(e.headElement,y.HEAD),Hr(e,t),e.openElements.remove(e.headElement);break}case y.HEAD:{e._err(t,ie.misplacedStartTagForHeadElement);break}default:Du(e,t)}}function ER(e,t){switch(t.tagID){case y.BODY:case y.HTML:case y.BR:{Du(e,t);break}case y.TEMPLATE:{ci(e,t);break}default:e._err(t,ie.endTagWithoutMatchingOpenElement)}}function Du(e,t){e._insertFakeElement(ne.BODY,y.BODY),e.insertionMode=$.IN_BODY,md(e,t)}function md(e,t){switch(t.type){case tt.CHARACTER:{K2(e,t);break}case tt.WHITESPACE_CHARACTER:{X2(e,t);break}case tt.COMMENT:{S0(e,t);break}case tt.START_TAG:{Pn(e,t);break}case tt.END_TAG:{pd(e,t);break}case tt.EOF:{tv(e,t);break}}}function X2(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function K2(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function vR(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function TR(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function wR(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,ce.HTML),e.insertionMode=$.IN_FRAMESET)}function SR(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,ce.HTML)}function CR(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&w0.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,ce.HTML)}function kR(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,ce.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function _R(e,t){const n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,ce.HTML),n||(e.formElement=e.openElements.current))}function NR(e,t){e.framesetOk=!1;const n=t.tagID;for(let r=e.openElements.stackTop;r>=0;r--){const a=e.openElements.tagIDs[r];if(n===y.LI&&a===y.LI||(n===y.DD||n===y.DT)&&(a===y.DD||a===y.DT)){e.openElements.generateImpliedEndTagsWithExclusion(a),e.openElements.popUntilTagNamePopped(a);break}if(a!==y.ADDRESS&&a!==y.DIV&&a!==y.P&&e._isSpecialElement(e.openElements.items[r],a))break}e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,ce.HTML)}function OR(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,ce.HTML),e.tokenizer.state=nn.PLAINTEXT}function DR(e,t){e.openElements.hasInScope(y.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(y.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML),e.framesetOk=!1}function AR(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(ne.A);n&&(Om(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function IR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function RR(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(y.NOBR)&&(Om(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,ce.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function LR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function MR(e,t){e.treeAdapter.getDocumentMode(e.document)!==wr.QUIRKS&&e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._insertElement(t,ce.HTML),e.framesetOk=!1,e.insertionMode=$.IN_TABLE}function J2(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ce.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function Z2(e){const t=U2(e,Ja.TYPE);return t!=null&&t.toLowerCase()===ZI}function PR(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,ce.HTML),Z2(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function FR(e,t){e._appendElement(t,ce.HTML),t.ackSelfClosing=!0}function jR(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._appendElement(t,ce.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function BR(e,t){t.tagName=ne.IMG,t.tagID=y.IMG,J2(e,t)}function HR(e,t){e._insertElement(t,ce.HTML),e.skipNextNewLine=!0,e.tokenizer.state=nn.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=$.TEXT}function UR(e,t){e.openElements.hasInButtonScope(y.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,nn.RAWTEXT)}function zR(e,t){e.framesetOk=!1,e._switchToTextParsing(t,nn.RAWTEXT)}function Sb(e,t){e._switchToTextParsing(t,nn.RAWTEXT)}function WR(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===$.IN_TABLE||e.insertionMode===$.IN_CAPTION||e.insertionMode===$.IN_TABLE_BODY||e.insertionMode===$.IN_ROW||e.insertionMode===$.IN_CELL?$.IN_SELECT_IN_TABLE:$.IN_SELECT}function YR(e,t){e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML)}function qR(e,t){e.openElements.hasInScope(y.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,ce.HTML)}function $R(e,t){e.openElements.hasInScope(y.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(y.RTC),e._insertElement(t,ce.HTML)}function VR(e,t){e._reconstructActiveFormattingElements(),V2(t),Nm(t),t.selfClosing?e._appendElement(t,ce.MATHML):e._insertElement(t,ce.MATHML),t.ackSelfClosing=!0}function QR(e,t){e._reconstructActiveFormattingElements(),Q2(t),Nm(t),t.selfClosing?e._appendElement(t,ce.SVG):e._insertElement(t,ce.SVG),t.ackSelfClosing=!0}function Cb(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,ce.HTML)}function Pn(e,t){switch(t.tagID){case y.I:case y.S:case y.B:case y.U:case y.EM:case y.TT:case y.BIG:case y.CODE:case y.FONT:case y.SMALL:case y.STRIKE:case y.STRONG:{IR(e,t);break}case y.A:{AR(e,t);break}case y.H1:case y.H2:case y.H3:case y.H4:case y.H5:case y.H6:{CR(e,t);break}case y.P:case y.DL:case y.OL:case y.UL:case y.DIV:case y.DIR:case y.NAV:case y.MAIN:case y.MENU:case y.ASIDE:case y.CENTER:case y.FIGURE:case y.FOOTER:case y.HEADER:case y.HGROUP:case y.DIALOG:case y.DETAILS:case y.ADDRESS:case y.ARTICLE:case y.SEARCH:case y.SECTION:case y.SUMMARY:case y.FIELDSET:case y.BLOCKQUOTE:case y.FIGCAPTION:{SR(e,t);break}case y.LI:case y.DD:case y.DT:{NR(e,t);break}case y.BR:case y.IMG:case y.WBR:case y.AREA:case y.EMBED:case y.KEYGEN:{J2(e,t);break}case y.HR:{jR(e,t);break}case y.RB:case y.RTC:{qR(e,t);break}case y.RT:case y.RP:{$R(e,t);break}case y.PRE:case y.LISTING:{kR(e,t);break}case y.XMP:{UR(e,t);break}case y.SVG:{QR(e,t);break}case y.HTML:{vR(e,t);break}case y.BASE:case y.LINK:case y.META:case y.STYLE:case y.TITLE:case y.SCRIPT:case y.BGSOUND:case y.BASEFONT:case y.TEMPLATE:{Hr(e,t);break}case y.BODY:{TR(e,t);break}case y.FORM:{_R(e,t);break}case y.NOBR:{RR(e,t);break}case y.MATH:{VR(e,t);break}case y.TABLE:{MR(e,t);break}case y.INPUT:{PR(e,t);break}case y.PARAM:case y.TRACK:case y.SOURCE:{FR(e,t);break}case y.IMAGE:{BR(e,t);break}case y.BUTTON:{DR(e,t);break}case y.APPLET:case y.OBJECT:case y.MARQUEE:{LR(e,t);break}case y.IFRAME:{zR(e,t);break}case y.SELECT:{WR(e,t);break}case y.OPTION:case y.OPTGROUP:{YR(e,t);break}case y.NOEMBED:case y.NOFRAMES:{Sb(e,t);break}case y.FRAMESET:{wR(e,t);break}case y.TEXTAREA:{HR(e,t);break}case y.NOSCRIPT:{e.options.scriptingEnabled?Sb(e,t):Cb(e,t);break}case y.PLAINTEXT:{OR(e,t);break}case y.COL:case y.TH:case y.TD:case y.TR:case y.HEAD:case y.FRAME:case y.TBODY:case y.TFOOT:case y.THEAD:case y.CAPTION:case y.COLGROUP:break;default:Cb(e,t)}}function GR(e,t){if(e.openElements.hasInScope(y.BODY)&&(e.insertionMode=$.AFTER_BODY,e.options.sourceCodeLocationInfo)){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function XR(e,t){e.openElements.hasInScope(y.BODY)&&(e.insertionMode=$.AFTER_BODY,lv(e,t))}function KR(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function JR(e){const t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(y.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(y.FORM):n&&e.openElements.remove(n))}function ZR(e){e.openElements.hasInButtonScope(y.P)||e._insertFakeElement(ne.P,y.P),e._closePElement()}function eL(e){e.openElements.hasInListItemScope(y.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(y.LI),e.openElements.popUntilTagNamePopped(y.LI))}function tL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function nL(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function rL(e,t){const n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function sL(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(ne.BR,y.BR),e.openElements.pop(),e.framesetOk=!1}function ev(e,t){const n=t.tagName,r=t.tagID;for(let a=e.openElements.stackTop;a>0;a--){const o=e.openElements.items[a],u=e.openElements.tagIDs[a];if(r===u&&(r!==y.UNKNOWN||e.treeAdapter.getTagName(o)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=a&&e.openElements.shortenToLength(a);break}if(e._isSpecialElement(o,u))break}}function pd(e,t){switch(t.tagID){case y.A:case y.B:case y.I:case y.S:case y.U:case y.EM:case y.TT:case y.BIG:case y.CODE:case y.FONT:case y.NOBR:case y.SMALL:case y.STRIKE:case y.STRONG:{Om(e,t);break}case y.P:{ZR(e);break}case y.DL:case y.UL:case y.OL:case y.DIR:case y.DIV:case y.NAV:case y.PRE:case y.MAIN:case y.MENU:case y.ASIDE:case y.BUTTON:case y.CENTER:case y.FIGURE:case y.FOOTER:case y.HEADER:case y.HGROUP:case y.DIALOG:case y.ADDRESS:case y.ARTICLE:case y.DETAILS:case y.SEARCH:case y.SECTION:case y.SUMMARY:case y.LISTING:case y.FIELDSET:case y.BLOCKQUOTE:case y.FIGCAPTION:{KR(e,t);break}case y.LI:{eL(e);break}case y.DD:case y.DT:{tL(e,t);break}case y.H1:case y.H2:case y.H3:case y.H4:case y.H5:case y.H6:{nL(e);break}case y.BR:{sL(e);break}case y.BODY:{GR(e,t);break}case y.HTML:{XR(e,t);break}case y.FORM:{JR(e);break}case y.APPLET:case y.OBJECT:case y.MARQUEE:{rL(e,t);break}case y.TEMPLATE:{ci(e,t);break}default:ev(e,t)}}function tv(e,t){e.tmplInsertionModeStack.length>0?uv(e,t):Dm(e,t)}function aL(e,t){var n;t.tagID===y.SCRIPT&&((n=e.scriptHandler)===null||n===void 0||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function iL(e,t){e._err(t,ie.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function Fh(e,t){if(e.openElements.currentTagId!==void 0&&G2.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=$.IN_TABLE_TEXT,t.type){case tt.CHARACTER:{rv(e,t);break}case tt.WHITESPACE_CHARACTER:{nv(e,t);break}}else tl(e,t)}function oL(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,ce.HTML),e.insertionMode=$.IN_CAPTION}function uL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ce.HTML),e.insertionMode=$.IN_COLUMN_GROUP}function lL(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ne.COLGROUP,y.COLGROUP),e.insertionMode=$.IN_COLUMN_GROUP,Am(e,t)}function cL(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,ce.HTML),e.insertionMode=$.IN_TABLE_BODY}function dL(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(ne.TBODY,y.TBODY),e.insertionMode=$.IN_TABLE_BODY,gd(e,t)}function fL(e,t){e.openElements.hasInTableScope(y.TABLE)&&(e.openElements.popUntilTagNamePopped(y.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function hL(e,t){Z2(t)?e._appendElement(t,ce.HTML):tl(e,t),t.ackSelfClosing=!0}function mL(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,ce.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function uo(e,t){switch(t.tagID){case y.TD:case y.TH:case y.TR:{dL(e,t);break}case y.STYLE:case y.SCRIPT:case y.TEMPLATE:{Hr(e,t);break}case y.COL:{lL(e,t);break}case y.FORM:{mL(e,t);break}case y.TABLE:{fL(e,t);break}case y.TBODY:case y.TFOOT:case y.THEAD:{cL(e,t);break}case y.INPUT:{hL(e,t);break}case y.CAPTION:{oL(e,t);break}case y.COLGROUP:{uL(e,t);break}default:tl(e,t)}}function Pu(e,t){switch(t.tagID){case y.TABLE:{e.openElements.hasInTableScope(y.TABLE)&&(e.openElements.popUntilTagNamePopped(y.TABLE),e._resetInsertionMode());break}case y.TEMPLATE:{ci(e,t);break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:case y.TBODY:case y.TD:case y.TFOOT:case y.TH:case y.THEAD:case y.TR:break;default:tl(e,t)}}function tl(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,md(e,t),e.fosterParentingEnabled=n}function nv(e,t){e.pendingCharacterTokens.push(t)}function rv(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function bu(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)tl(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}const sv=new Set([y.CAPTION,y.COL,y.COLGROUP,y.TBODY,y.TD,y.TFOOT,y.TH,y.THEAD,y.TR]);function pL(e,t){const n=t.tagID;sv.has(n)?e.openElements.hasInTableScope(y.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(y.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,uo(e,t)):Pn(e,t)}function gL(e,t){const n=t.tagID;switch(n){case y.CAPTION:case y.TABLE:{e.openElements.hasInTableScope(y.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(y.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_TABLE,n===y.TABLE&&Pu(e,t));break}case y.BODY:case y.COL:case y.COLGROUP:case y.HTML:case y.TBODY:case y.TD:case y.TFOOT:case y.TH:case y.THEAD:case y.TR:break;default:pd(e,t)}}function Am(e,t){switch(t.tagID){case y.HTML:{Pn(e,t);break}case y.COL:{e._appendElement(t,ce.HTML),t.ackSelfClosing=!0;break}case y.TEMPLATE:{Hr(e,t);break}default:Yc(e,t)}}function yL(e,t){switch(t.tagID){case y.COLGROUP:{e.openElements.currentTagId===y.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE);break}case y.TEMPLATE:{ci(e,t);break}case y.COL:break;default:Yc(e,t)}}function Yc(e,t){e.openElements.currentTagId===y.COLGROUP&&(e.openElements.pop(),e.insertionMode=$.IN_TABLE,e._processToken(t))}function gd(e,t){switch(t.tagID){case y.TR:{e.openElements.clearBackToTableBodyContext(),e._insertElement(t,ce.HTML),e.insertionMode=$.IN_ROW;break}case y.TH:case y.TD:{e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(ne.TR,y.TR),e.insertionMode=$.IN_ROW,yd(e,t);break}case y.CAPTION:case y.COL:case y.COLGROUP:case y.TBODY:case y.TFOOT:case y.THEAD:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,uo(e,t));break}default:uo(e,t)}}function C0(e,t){const n=t.tagID;switch(t.tagID){case y.TBODY:case y.TFOOT:case y.THEAD:{e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE);break}case y.TABLE:{e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE,Pu(e,t));break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:case y.TD:case y.TH:case y.TR:break;default:Pu(e,t)}}function yd(e,t){switch(t.tagID){case y.TH:case y.TD:{e.openElements.clearBackToTableRowContext(),e._insertElement(t,ce.HTML),e.insertionMode=$.IN_CELL,e.activeFormattingElements.insertMarker();break}case y.CAPTION:case y.COL:case y.COLGROUP:case y.TBODY:case y.TFOOT:case y.THEAD:case y.TR:{e.openElements.hasInTableScope(y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,gd(e,t));break}default:uo(e,t)}}function av(e,t){switch(t.tagID){case y.TR:{e.openElements.hasInTableScope(y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY);break}case y.TABLE:{e.openElements.hasInTableScope(y.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,C0(e,t));break}case y.TBODY:case y.TFOOT:case y.THEAD:{(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(y.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=$.IN_TABLE_BODY,C0(e,t));break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:case y.TD:case y.TH:break;default:Pu(e,t)}}function bL(e,t){const n=t.tagID;sv.has(n)?(e.openElements.hasInTableScope(y.TD)||e.openElements.hasInTableScope(y.TH))&&(e._closeTableCell(),yd(e,t)):Pn(e,t)}function xL(e,t){const n=t.tagID;switch(n){case y.TD:case y.TH:{e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=$.IN_ROW);break}case y.TABLE:case y.TBODY:case y.TFOOT:case y.THEAD:case y.TR:{e.openElements.hasInTableScope(n)&&(e._closeTableCell(),av(e,t));break}case y.BODY:case y.CAPTION:case y.COL:case y.COLGROUP:case y.HTML:break;default:pd(e,t)}}function iv(e,t){switch(t.tagID){case y.HTML:{Pn(e,t);break}case y.OPTION:{e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e._insertElement(t,ce.HTML);break}case y.OPTGROUP:{e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e.openElements.currentTagId===y.OPTGROUP&&e.openElements.pop(),e._insertElement(t,ce.HTML);break}case y.HR:{e.openElements.currentTagId===y.OPTION&&e.openElements.pop(),e.openElements.currentTagId===y.OPTGROUP&&e.openElements.pop(),e._appendElement(t,ce.HTML),t.ackSelfClosing=!0;break}case y.INPUT:case y.KEYGEN:case y.TEXTAREA:case y.SELECT:{e.openElements.hasInSelectScope(y.SELECT)&&(e.openElements.popUntilTagNamePopped(y.SELECT),e._resetInsertionMode(),t.tagID!==y.SELECT&&e._processStartTag(t));break}case y.SCRIPT:case y.TEMPLATE:{Hr(e,t);break}}}function ov(e,t){switch(t.tagID){case y.OPTGROUP:{e.openElements.stackTop>0&&e.openElements.currentTagId===y.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===y.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===y.OPTGROUP&&e.openElements.pop();break}case y.OPTION:{e.openElements.currentTagId===y.OPTION&&e.openElements.pop();break}case y.SELECT:{e.openElements.hasInSelectScope(y.SELECT)&&(e.openElements.popUntilTagNamePopped(y.SELECT),e._resetInsertionMode());break}case y.TEMPLATE:{ci(e,t);break}}}function EL(e,t){const n=t.tagID;n===y.CAPTION||n===y.TABLE||n===y.TBODY||n===y.TFOOT||n===y.THEAD||n===y.TR||n===y.TD||n===y.TH?(e.openElements.popUntilTagNamePopped(y.SELECT),e._resetInsertionMode(),e._processStartTag(t)):iv(e,t)}function vL(e,t){const n=t.tagID;n===y.CAPTION||n===y.TABLE||n===y.TBODY||n===y.TFOOT||n===y.THEAD||n===y.TR||n===y.TD||n===y.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(y.SELECT),e._resetInsertionMode(),e.onEndTag(t)):ov(e,t)}function TL(e,t){switch(t.tagID){case y.BASE:case y.BASEFONT:case y.BGSOUND:case y.LINK:case y.META:case y.NOFRAMES:case y.SCRIPT:case y.STYLE:case y.TEMPLATE:case y.TITLE:{Hr(e,t);break}case y.CAPTION:case y.COLGROUP:case y.TBODY:case y.TFOOT:case y.THEAD:{e.tmplInsertionModeStack[0]=$.IN_TABLE,e.insertionMode=$.IN_TABLE,uo(e,t);break}case y.COL:{e.tmplInsertionModeStack[0]=$.IN_COLUMN_GROUP,e.insertionMode=$.IN_COLUMN_GROUP,Am(e,t);break}case y.TR:{e.tmplInsertionModeStack[0]=$.IN_TABLE_BODY,e.insertionMode=$.IN_TABLE_BODY,gd(e,t);break}case y.TD:case y.TH:{e.tmplInsertionModeStack[0]=$.IN_ROW,e.insertionMode=$.IN_ROW,yd(e,t);break}default:e.tmplInsertionModeStack[0]=$.IN_BODY,e.insertionMode=$.IN_BODY,Pn(e,t)}}function wL(e,t){t.tagID===y.TEMPLATE&&ci(e,t)}function uv(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(y.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Dm(e,t)}function SL(e,t){t.tagID===y.HTML?Pn(e,t):qc(e,t)}function lv(e,t){var n;if(t.tagID===y.HTML){if(e.fragmentContext||(e.insertionMode=$.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===y.HTML){e._setEndLocation(e.openElements.items[0],t);const r=e.openElements.items[1];r&&!(!((n=e.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&e._setEndLocation(r,t)}}else qc(e,t)}function qc(e,t){e.insertionMode=$.IN_BODY,md(e,t)}function CL(e,t){switch(t.tagID){case y.HTML:{Pn(e,t);break}case y.FRAMESET:{e._insertElement(t,ce.HTML);break}case y.FRAME:{e._appendElement(t,ce.HTML),t.ackSelfClosing=!0;break}case y.NOFRAMES:{Hr(e,t);break}}}function kL(e,t){t.tagID===y.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==y.FRAMESET&&(e.insertionMode=$.AFTER_FRAMESET))}function _L(e,t){switch(t.tagID){case y.HTML:{Pn(e,t);break}case y.NOFRAMES:{Hr(e,t);break}}}function NL(e,t){t.tagID===y.HTML&&(e.insertionMode=$.AFTER_AFTER_FRAMESET)}function OL(e,t){t.tagID===y.HTML?Pn(e,t):Dc(e,t)}function Dc(e,t){e.insertionMode=$.IN_BODY,md(e,t)}function DL(e,t){switch(t.tagID){case y.HTML:{Pn(e,t);break}case y.NOFRAMES:{Hr(e,t);break}}}function AL(e,t){t.chars=Bt,e._insertCharacters(t)}function IL(e,t){e._insertCharacters(t),e.framesetOk=!1}function cv(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==ce.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function RL(e,t){if(QI(t))cv(e),e._startTagOutsideForeignContent(t);else{const n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===ce.MATHML?V2(t):r===ce.SVG&&(GI(t),Q2(t)),Nm(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function LL(e,t){if(t.tagID===y.P||t.tagID===y.BR){cv(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){const r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===ce.HTML){e._endTagOutsideForeignContent(t);break}const a=e.treeAdapter.getTagName(r);if(a.toLowerCase()===t.tagName){t.tagName=a,e.openElements.shortenToLength(n);break}}}ne.AREA,ne.BASE,ne.BASEFONT,ne.BGSOUND,ne.BR,ne.COL,ne.EMBED,ne.FRAME,ne.HR,ne.IMG,ne.INPUT,ne.KEYGEN,ne.LINK,ne.META,ne.PARAM,ne.SOURCE,ne.TRACK,ne.WBR;const ML=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,PL=new Set(["mdxFlowExpression","mdxJsxFlowElement","mdxJsxTextElement","mdxTextExpression","mdxjsEsm"]),kb={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function dv(e,t){const n=$L(e),r=P2("type",{handlers:{root:FL,element:jL,text:BL,comment:hv,doctype:HL,raw:zL},unknown:WL}),a={parser:n?new wb(kb):wb.getFragmentParser(void 0,kb),handle(c){r(c,a)},stitches:!1,options:t||{}};r(e,a),Eo(a,ls());const o=n?a.parser.document:a.parser.getFragment(),u=VA(o,{file:a.options.file});return a.stitches&&Sm(u,"comment",function(c,d,f){const p=c;if(p.value.stitch&&f&&d!==void 0){const g=f.children;return g[d]=p.value.stitch,d}}),u.type==="root"&&u.children.length===1&&u.children[0].type===e.type?u.children[0]:u}function fv(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function FL(e,t){fv(e.children,t)}function jL(e,t){YL(e,t),fv(e.children,t),qL(e,t)}function BL(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);const n={type:tt.CHARACTER,chars:e.value,location:nl(e)};Eo(t,ls(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function HL(e,t){const n={type:tt.DOCTYPE,name:"html",forceQuirks:!1,publicId:"",systemId:"",location:nl(e)};Eo(t,ls(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function UL(e,t){t.stitches=!0;const n=VL(e);if("children"in e&&"children"in n){const r=dv({type:"root",children:e.children},t.options);n.children=r.children}hv({type:"comment",value:{stitch:n}},t)}function hv(e,t){const n=e.value,r={type:tt.COMMENT,data:n,location:nl(e)};Eo(t,ls(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function zL(e,t){if(t.parser.tokenizer.preprocessor.html="",t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,mv(t,ls(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(ML,"&lt;$1$2"):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;const n=t.parser.tokenizer._consume();t.parser.tokenizer._callState(n)}}function WL(e,t){const n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))UL(n,t);else{let r="";throw PL.has(n.type)&&(r=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),new Error("Cannot compile `"+n.type+"` node"+r)}}function Eo(e,t){mv(e,t);const n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=nn.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:"",value:""}}function mv(e,t){if(t&&t.offset!==void 0){const n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function YL(e,t){const n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===nn.PLAINTEXT)return;Eo(t,ls(e));const r=t.parser.openElements.current;let a="namespaceURI"in r?r.namespaceURI:Ua.html;a===Ua.html&&n==="svg"&&(a=Ua.svg);const o=JA({...e,children:[]},{space:a===Ua.svg?"svg":"html"}),u={type:tt.START_TAG,tagName:n,tagID:xo(n),selfClosing:!1,ackSelfClosing:!1,attrs:"attrs"in o?o.attrs:[],location:nl(e)};t.parser.currentToken=u,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function qL(e,t){const n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&iI.includes(n)||t.parser.tokenizer.state===nn.PLAINTEXT)return;Eo(t,cd(e));const r={type:tt.END_TAG,tagName:n,tagID:xo(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:nl(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===nn.RCDATA||t.parser.tokenizer.state===nn.RAWTEXT||t.parser.tokenizer.state===nn.SCRIPT_DATA)&&(t.parser.tokenizer.state=nn.DATA)}function $L(e){const t=e.type==="root"?e.children[0]:e;return!!(t&&(t.type==="doctype"||t.type==="element"&&t.tagName.toLowerCase()==="html"))}function nl(e){const t=ls(e)||{line:void 0,column:void 0,offset:void 0},n=cd(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function VL(e){return"children"in e?oo({...e,children:[]}):oo(e)}function QL(e){return function(t,n){return dv(t,{...e,file:n})}}function GL({chartName:e,chartTitle:t,displayValue:n,field:r,change:a,previousValue:o,lockedPreset:u,lockedRange:c,format:d}){const[f,p]=I.useState(!1),[g,x]=I.useState({top:0,left:0,placement:"below"}),E=I.useRef(null),_=I.useRef(null);I.useEffect(()=>{if(!f||!_.current)return;const C=()=>{var W,V;if(!_.current)return;const O=_.current.getBoundingClientRect(),L=((W=E.current)==null?void 0:W.offsetHeight)||180,k=window.innerHeight-O.bottom,N=O.top,R=8;let j="below",M;k<L+R&&N>k?(j="above",M=O.top+window.scrollY-L-R):M=O.bottom+window.scrollY+R;let P=O.left+window.scrollX;const F=((V=E.current)==null?void 0:V.offsetWidth)||220;P+F>window.innerWidth-R&&(P=window.innerWidth-F-R),P<R&&(P=R),x({top:M,left:P,placement:j})};C(),requestAnimationFrame(C)},[f]),I.useEffect(()=>{if(!f)return;function C(O){E.current&&!E.current.contains(O.target)&&_.current&&!_.current.contains(O.target)&&p(!1)}return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[f]),I.useEffect(()=>{if(!f)return;function C(O){O.key==="Escape"&&p(!1)}return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[f]);const S=u?u.replace(/_/g," ").replace(/\b\w/g,C=>C.toUpperCase()):c?c.replace(".."," to "):null,w=a!==void 0?`${a>=0?"+":""}${a.toFixed(1)}%`:null,T=a!==void 0?a>=0?"var(--yc-color-success)":"var(--yc-color-danger)":void 0;return m.jsxs(m.Fragment,{children:[m.jsx("span",{ref:_,onClick:()=>p(!f),className:"font-semibold border-b border-dashed cursor-pointer px-0.5 rounded transition-colors hover:opacity-80",style:{color:"var(--yc-color-primary)",borderColor:"color-mix(in srgb, var(--yc-color-primary) 50%, transparent)"},children:n}),f&&KE.createPortal(m.jsxs("div",{ref:E,className:"fixed z-[9999] rounded-lg shadow-xl p-3 min-w-[220px] text-sm",style:{top:g.top,left:g.left,backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[m.jsx("div",{className:"font-medium mb-2",style:{color:"var(--yc-color-text)"},children:t}),m.jsxs("div",{className:"flex items-baseline gap-2 mb-2",children:[m.jsx("span",{className:"text-2xl font-bold",style:{color:"var(--yc-color-text)"},children:n}),r&&r!=="value"&&r!=="formatted"&&m.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["(",r,")"]})]}),w&&m.jsxs("div",{className:"text-sm mb-2",style:T?{color:T}:void 0,children:[w," vs previous period",o!==void 0&&m.jsxs("span",{className:"ml-1",style:{color:"var(--yc-color-text-secondary)"},children:["(",(d==null?void 0:d.type)==="currency"?"$":"",o.toLocaleString(),")"]})]}),m.jsx("div",{className:"border-t my-2",style:{borderColor:"var(--yc-color-border)"}}),m.jsxs("div",{className:"flex items-center gap-2 text-xs",style:{color:"var(--yc-color-text-secondary)"},children:[m.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),S?m.jsx("span",{children:S}):m.jsx("span",{className:"italic",children:"Follows dashboard filter"})]}),m.jsxs("div",{className:"flex items-center gap-2 text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:[m.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),m.jsx("span",{children:e})]})]}),document.body)]})}function XL(e){const t=/\{\{([a-zA-Z0-9_-]+)(?:\.([a-zA-Z0-9_]+))?(?:@([a-zA-Z0-9_-]+|\d{4}-\d{2}-\d{2}\.\.\d{4}-\d{2}-\d{2}))?\}\}/g,n=new Map;let r;for(;(r=t.exec(e))!==null;){const a=r[1],o=r[2],u=r[3];if(!a)continue;let c;if(u){const f=u.match(/^(\d{4}-\d{2}-\d{2})\.\.(\d{4}-\d{2}-\d{2})$/);f?c={startDate:f[1],endDate:f[2]}:c={preset:u}}const d=`${a}:${o||""}:${u||""}`;n.has(d)||n.set(d,{chartName:a,field:o,locked:c})}return Array.from(n.values())}function KL(e){return Array.from(new Set(e.map(t=>t.chartName)))}function JL(e,t){if(!t)return e.toLocaleString();const n=t.decimals??0;switch(t.type){case"currency":return new Intl.NumberFormat("en-US",{style:"currency",currency:t.currency||"USD",minimumFractionDigits:n,maximumFractionDigits:n}).format(e);case"percent":return new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:n,maximumFractionDigits:n}).format(e/100);default:return e.toLocaleString(void 0,{minimumFractionDigits:n,maximumFractionDigits:n})}}function ZL(e,t){if(e.locked){if(e.locked.preset)return{date_range:e.locked.preset};if(e.locked.startDate&&e.locked.endDate)return{date_range:{type:"custom",start:e.locked.startDate,end:e.locked.endDate}}}return t}function k0(e){const t=e.locked?e.locked.preset||`${e.locked.startDate}..${e.locked.endDate}`:"current";return`${e.chartName}:${e.field||"value"}:${t}`}function eM(e,t){const n=KL(e),r=I.useMemo(()=>{const p=new Map;return e.forEach(g=>{const x=ZL(g,t),E=`${g.chartName}:${JSON.stringify(x)}`;p.has(E)||p.set(E,{chartName:g.chartName,params:x,refs:[]}),p.get(E).refs.push(g)}),Array.from(p.values())},[e,t]),a=Ty({queries:r.map(p=>({queryKey:["chartData",p.chartName,p.params],queryFn:()=>Ht.queryChart(p.chartName,p.params),enabled:r.length>0}))}),o=Ty({queries:n.map(p=>({queryKey:["chart",p],queryFn:()=>Ht.getChart(p),enabled:n.length>0}))}),u=I.useMemo(()=>{const p={};return n.forEach((g,x)=>{const E=o[x];E!=null&&E.data&&(p[g]=E.data)}),p},[n,o]),c=I.useMemo(()=>{const p={};return r.forEach((g,x)=>{var w,T,C;const E=a[x],_=(w=u[g.chartName])==null?void 0:w.chart;if(!((C=(T=E==null?void 0:E.data)==null?void 0:T.rows)!=null&&C[0])||!_)return;const S=E.data.rows[0];g.refs.forEach(O=>{var B,k;const L=k0(O);if(_.type==="kpi"&&((B=_.value)!=null&&B.field)){const N=_.value.field,R=S[N]??0,j={value:R,formatted:JL(R,_.format),fields:{}};if(Object.entries(S).forEach(([M,P])=>{typeof P=="number"&&(j.fields[M]=P)}),(k=_.comparison)!=null&&k.enabled&&_.comparison.field){const M=S[_.comparison.field];M&&M!==0&&(_.comparison.type==="percent_change"?j.change=(R-M)/M*100:j.change=R-M)}p[L]=j}})}),p},[r,a,u]),d=a.some(p=>p.isLoading)||o.some(p=>p.isLoading),f=I.useMemo(()=>{const p={};return n.forEach((g,x)=>{var _;const E=o[x];(_=E==null?void 0:E.data)!=null&&_.title&&(p[g]=E.data.title)}),p},[n,o]);return{values:c,isLoading:d,getRefKey:k0,chartTitles:f}}function tM(e,t,n){const r={};let a=0;return{content:e.replace(/\{\{([a-zA-Z0-9_-]+)(?:\.([a-zA-Z0-9_]+))?(?:@([a-zA-Z0-9_-]+|\d{4}-\d{2}-\d{2}\.\.\d{4}-\d{2}-\d{2}))?\}\}/g,(u,c,d,f)=>{let p,g,x;if(f){const C=f.match(/^(\d{4}-\d{2}-\d{2})\.\.(\d{4}-\d{2}-\d{2})$/);C?(p={startDate:C[1],endDate:C[2]},x=f):(p={preset:f},g=f)}const _=k0({chartName:c,field:d,locked:p}),S=t[_];if(!S)return u;let w;if(d)if(d==="formatted"||d==="value")w=S.formatted;else if(d==="change"&&S.change!==void 0)w=`${S.change>=0?"+":""}${S.change.toFixed(1)}%`;else if(S.fields[d]!==void 0)w=S.fields[d].toLocaleString();else return u;else w=S.formatted;const T=`kpi-ref-${a++}`;return r[T]={chartName:c,chartTitle:n[c]||c,displayValue:w,field:d,change:S.change,previousValue:S.fields.previous_value,lockedPreset:g,lockedRange:x},`<kpi-ref data-ref-id="${T}">${w}</kpi-ref>`}),refData:r}}function nM({filter:e,kpiCharts:t,selectedIndex:n,position:r,onSelect:a,onClose:o}){const u=I.useRef(null),c=I.useMemo(()=>{const d=e.toLowerCase();return t.filter(f=>f.name.toLowerCase().includes(d)||f.title.toLowerCase().includes(d))},[e,t]);return I.useEffect(()=>{function d(f){u.current&&!u.current.contains(f.target)&&o()}return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[o]),I.useEffect(()=>{var f;const d=(f=u.current)==null?void 0:f.querySelector('[data-selected="true"]');d==null||d.scrollIntoView({block:"nearest"})},[n]),c.length===0?null:KE.createPortal(m.jsx("div",{ref:u,className:"fixed z-[9999] rounded-lg shadow-xl py-1 max-h-48 overflow-y-auto min-w-[200px]",style:{top:r.top,left:r.left,backgroundColor:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:c.map((d,f)=>m.jsxs("button",{"data-selected":f===n,onMouseDown:p=>{p.preventDefault(),a(d.name)},className:"w-full text-left px-3 py-1.5 text-sm flex flex-col",style:f===n?{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)"}:{color:"var(--yc-color-text-secondary)"},children:[m.jsx("span",{className:"font-medium truncate",children:d.title}),m.jsx("span",{className:"text-xs font-mono truncate",style:{color:"var(--yc-color-text-muted)"},children:`{{${d.name}}}`})]},d.name))}),document.body)}function rM({content:e,onUpdate:t,isContentEditing:n,onEditStart:r,onEditEnd:a}){const{isEditing:o}=mo(),[u,c]=I.useState(e),d=I.useRef(null),[f,p]=I.useState(null),[g,x]=I.useState({top:0,left:0}),E=I.useRef(null),_=Qe(K=>K.globalFilters),{data:S}=is({queryKey:["config"],queryFn:()=>Ht.getConfig()}),w=I.useMemo(()=>(S==null?void 0:S.charts.filter(K=>K.type==="kpi"))||[],[S]),T=I.useMemo(()=>XL(e),[e]),{values:C,isLoading:O,chartTitles:L}=eM(T,_),{content:B,refData:k}=I.useMemo(()=>O||Object.keys(C).length===0?{content:e,refData:{}}:tM(e,C,L),[e,C,O,L]),N=I.useMemo(()=>({"kpi-ref":({children:K,...Z})=>{const G=Z["data-ref-id"],ee=G?k[G]:null;return ee?m.jsx(GL,{chartName:ee.chartName,chartTitle:ee.chartTitle,displayValue:ee.displayValue,field:ee.field,change:ee.change,previousValue:ee.previousValue,lockedPreset:ee.lockedPreset,lockedRange:ee.lockedRange}):m.jsx("span",{children:K})}}),[k]);I.useEffect(()=>{n||c(e)},[e,n]),I.useEffect(()=>{n&&d.current&&d.current.focus()},[n]);const R=()=>{t==null||t(u),p(null),a==null||a()},j=()=>{c(e),p(null),a==null||a()},M=()=>{const K=d.current,Z=E.current;if(!K||!Z)return;const G=K.selectionStart,ee=K.value.substring(0,G);Z.textContent=ee;const D=K.getBoundingClientRect(),ue=Z.offsetWidth,ae=parseFloat(getComputedStyle(K).lineHeight)||18,U=K.clientWidth-16,Ee=ee.split(`
110
- `),De=Ee[Ee.length-1]||"";Z.textContent=De;const ve=Math.min(Z.offsetWidth,U),Ue=(Ee.length-1+Math.floor(ue/U))*ae;x({top:D.top+Ue+ae+4-K.scrollTop,left:D.left+ve+8})},P=I.useMemo(()=>{if(!(f!=null&&f.active))return[];const K=f.filter.toLowerCase();return w.filter(Z=>Z.name.toLowerCase().includes(K)||Z.title.toLowerCase().includes(K))},[f,w]),F=K=>{if(!f||!d.current)return;const Z=d.current,G=u.substring(0,f.startPos),ee=u.substring(Z.selectionStart),D=`{{${K}}}`,ue=G+D+ee;c(ue),p(null);const ae=G.length+D.length;setTimeout(()=>{Z.selectionStart=Z.selectionEnd=ae,Z.focus()},0)},W=K=>{if(f!=null&&f.active){if(K.key==="ArrowDown"){K.preventDefault(),p(De=>De?{...De,selectedIndex:Math.min(De.selectedIndex+1,P.length-1)}:null);return}if(K.key==="ArrowUp"){K.preventDefault(),p(De=>De?{...De,selectedIndex:Math.max(De.selectedIndex-1,0)}:null);return}if(K.key==="Enter"||K.key==="Tab"){K.preventDefault();const De=P[f.selectedIndex];De&&F(De.name);return}if(K.key==="Escape"){K.preventDefault(),p(null);return}}if(K.key==="Escape"){K.preventDefault(),j();return}if(K.key!=="Enter")return;const Z=K.currentTarget,{selectionStart:G,value:ee}=Z,D=ee.substring(0,G),ue=D.lastIndexOf(`
111
- `)+1,ae=D.substring(ue),U=ae.match(/^(\s*)([-*])\s(.*)$/);if(U){const De=U[1]??"",ve=U[2]??"-";if(!(U[3]??"").trim()){K.preventDefault();const Ge=ee.substring(0,ue)+ee.substring(G);c(Ge),setTimeout(()=>{Z.selectionStart=Z.selectionEnd=ue},0);return}K.preventDefault();const Ue=`
112
- ${De}${ve} `,Le=ee.substring(0,G)+Ue+ee.substring(G);c(Le),setTimeout(()=>{Z.selectionStart=Z.selectionEnd=G+Ue.length},0);return}const Ee=ae.match(/^(\s*)(\d+)\.\s(.*)$/);if(Ee){const De=Ee[1]??"",ve=Ee[2]??"1";if(!(Ee[3]??"").trim()){K.preventDefault();const Fe=ee.substring(0,ue)+ee.substring(G);c(Fe),setTimeout(()=>{Z.selectionStart=Z.selectionEnd=ue},0);return}K.preventDefault();const Ue=parseInt(ve,10)+1,Le=`
113
- ${De}${Ue}. `,Ge=ee.substring(0,G)+Le+ee.substring(G);c(Ge),setTimeout(()=>{Z.selectionStart=Z.selectionEnd=G+Le.length},0);return}},V=K=>{const Z=K.target.value,G=K.target.selectionStart;c(Z);const ee=Z.substring(0,G),D=ee.lastIndexOf("{");if(D>=0){const ue=ee.substring(D+1);if(!ue.includes("}")&&!ue.includes(`
114
- `)){const ae=ue.replace(/^\{/,"");p({active:!0,startPos:D,filter:ae,selectedIndex:0}),setTimeout(M,0);return}}p(null)},J=K=>{const Z=K.relatedTarget;Z!=null&&Z.closest("[data-kpi-autocomplete]")||R()};return n?m.jsxs("div",{className:"h-full relative",children:[m.jsx("textarea",{ref:d,value:u,onChange:V,onKeyDown:W,onBlur:J,className:"h-full w-full p-4 resize-none font-mono text-sm focus:outline-none bg-transparent",placeholder:"Type markdown here... Use {{ to insert KPI references"}),m.jsx("span",{ref:E,className:"invisible fixed top-0 left-0 font-mono text-sm whitespace-pre","aria-hidden":"true"}),(f==null?void 0:f.active)&&P.length>0&&m.jsx(nM,{filter:f.filter,kpiCharts:w,selectedIndex:f.selectedIndex,position:g,onSelect:F,onClose:()=>p(null)})]}):m.jsxs("div",{className:"h-full p-4 overflow-auto",children:[m.jsx("div",{className:"prose prose-sm max-w-none prose-headings:mt-2 prose-headings:mb-2 prose-p:my-1 prose-ul:my-1 prose-ol:my-1 prose-li:my-0",children:m.jsx(IA,{rehypePlugins:[QL],components:N,children:B})}),o&&t&&!e&&m.jsx("div",{className:"text-sm italic",style:{color:"var(--yc-color-text-muted)"},children:"Double-click to edit"})]})}function sM({children:e,onRemove:t,widgetType:n,onDoubleClick:r,isContentEditing:a}){const{isEditing:o}=mo();return m.jsxs("div",{className:Sr("h-full relative",o&&"ring-2 ring-blue-200",o&&!a&&"select-none"),style:{background:"var(--yc-color-surface)",borderRadius:"var(--yc-radius)",boxShadow:"var(--yc-shadow)",border:"var(--yc-card-border)"},children:[o&&m.jsxs(m.Fragment,{children:[!(n==="text"&&a)&&m.jsx("div",{className:"absolute inset-0 z-[5] cursor-grab active:cursor-grabbing",style:{pointerEvents:"all"},onMouseDown:u=>u.preventDefault(),onDoubleClick:u=>{r&&(u.stopPropagation(),r())}}),t&&m.jsx("div",{className:"absolute top-1 right-1 z-10",children:m.jsx("button",{onClick:u=>{u.stopPropagation(),t()},className:"w-5 h-5 bg-white/70 hover:bg-red-100 rounded flex items-center justify-center transition-colors",title:"Remove widget",children:m.jsx("svg",{className:"w-3 h-3 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})})]}),m.jsx("div",{className:"h-full",children:e})]})}const xu=38,pv=12,aM={lg:1024,md:768,sm:0},iM={lg:12,md:6,sm:1};function oM(e){return e.type==="chart"&&e.ref?`chart-${e.ref}`:e.type==="text"?`text-${(e.content||"empty").slice(0,50).replace(/[^a-zA-Z0-9]/g,"_").replace(/_+/g,"_")}`:"widget-unknown"}const uM=40;function lM(e){const t=[];for(let n=0;n<e;n++)for(let r=0;r<pv;r++)t.push({i:`bg-${n}-${r}`,x:r,y:n,w:1,h:1,static:!0});return t}const gv=lM(uM),cM=gv.map(e=>m.jsx("div",{style:{boxSizing:"border-box",background:"rgba(59, 130, 246, 0.04)",borderRadius:4,border:"1px solid rgba(59, 130, 246, 0.06)"}},e.i));function dM({layout:e,onLayoutChange:t}){const{isEditing:n,setPendingLayout:r,setOriginalLayout:a,currentLayout:o,removeWidget:u,updateWidget:c}=mo(),d=M0(),f=I.useRef(""),p=I.useRef(""),g=I.useRef(null),[x,E]=I.useState(0),[_,S]=I.useState(null);I.useEffect(()=>{const j=g.current;if(!j)return;const M=new ResizeObserver(P=>{var W;const F=(W=P[0])==null?void 0:W.contentRect.width;F&&F>0&&E(Math.floor(F))});return M.observe(j),()=>M.disconnect()},[]),I.useEffect(()=>{const j=JSON.stringify(e);j!==f.current&&(f.current=j,a(e))},[e,a]),I.useEffect(()=>{n||S(null)},[n]);const w=o||e,T=w.gap??16,{gridLayout:C,widgetMap:O,widgetList:L}=I.useMemo(()=>{const j=[],M=new Map,P=[];let F=0;const W=new Set;return w.rows.forEach((V,J)=>{let K=0,Z=0;V.widgets.forEach((G,ee)=>{let D=oM(G);if(W.has(D)){let Ee=2;for(;W.has(`${D}-${Ee}`);)Ee++;D=`${D}-${Ee}`}W.add(D);const ue=G.height??V.height,ae=Math.ceil(ue/xu),U={i:D,x:G.x??K,y:G.y??F,w:G.cols,h:ae,minW:1,minH:1,static:!n||_===D};j.push(U),M.set(D,{widget:G,rowIndex:J,widgetIndex:ee}),P.push({id:D,widget:G,rowIndex:J,widgetIndex:ee}),K+=G.cols,Z=Math.max(Z,ae)}),F+=Z}),{gridLayout:j,widgetMap:M,widgetList:P}},[w,n,_]),B=I.useMemo(()=>yO(C),[C]),k=I.useCallback(j=>{if(!n)return;const P=[...j.filter(Z=>O.has(Z.i))].sort((Z,G)=>Z.y-G.y||Z.x-G.x),F=P.map(Z=>`${Z.i}:${Z.x},${Z.y},${Z.w},${Z.h}`).join("|");if(F===p.current)return;p.current=F;const W=new Map;P.forEach(Z=>{const G=O.get(Z.i);if(!G)return;let ee=W.get(Z.y);ee||(ee={items:[]},W.set(Z.y,ee));const D=Z.h*xu;ee.items.push({item:Z,widget:{...G.widget,cols:Z.w,height:D,x:Z.x,y:Z.y}})});const V=[],J=[...W.keys()].sort((Z,G)=>Z-G);for(const Z of J){const G=W.get(Z),ee=Math.max(...G.items.map(D=>D.item.h));V.push({height:ee*xu,widgets:G.items.map(D=>D.widget)})}const K={gap:w.gap,rows:V};r(K),t==null||t(K)},[n,O,w.gap,r,t]),N=I.useCallback((j,M)=>{u(j,M)},[u]),R=I.useCallback((j,M,P)=>{c(j,M,{content:P})},[c]);return m.jsxs(m.Fragment,{children:[!n&&m.jsx("style",{children:".react-resizable-handle { display: none !important; }"}),n&&m.jsx("style",{children:`
115
- .react-grid-placeholder {
116
- background: rgba(59, 130, 246, 0.15) !important;
117
- border: 2px dashed rgba(59, 130, 246, 0.4) !important;
118
- border-radius: var(--yc-radius) !important;
119
- opacity: 1 !important;
120
- }
121
- .yc-edit-grid .react-grid-item {
122
- transition: all 200ms ease !important;
123
- }
124
- .yc-edit-grid .react-grid-item.react-draggable-dragging {
125
- transition: none !important;
126
- z-index: 100;
127
- box-shadow: 0 8px 25px rgba(0,0,0,0.15);
128
- }
129
- .yc-edit-grid .react-resizable-handle {
130
- background: none !important;
131
- width: 24px !important;
132
- height: 24px !important;
133
- z-index: 10 !important;
134
- }
135
- .yc-edit-grid .react-resizable-handle::after {
136
- content: '' !important;
137
- position: absolute !important;
138
- right: 4px !important;
139
- bottom: 4px !important;
140
- width: 10px !important;
141
- height: 10px !important;
142
- border-right: 2px solid rgba(59,130,246,0.4) !important;
143
- border-bottom: 2px solid rgba(59,130,246,0.4) !important;
144
- border-radius: 0 0 2px 0 !important;
145
- }
146
- .yc-edit-grid .react-resizable-handle:hover::after {
147
- border-color: rgba(59,130,246,0.8) !important;
148
- }
149
- .yc-bg-grid {
150
- position: absolute !important;
151
- inset: 0 !important;
152
- pointer-events: none !important;
153
- z-index: 0 !important;
154
- overflow: hidden !important;
155
- }
156
- .yc-bg-grid .react-grid-item {
157
- transition: none !important;
158
- }
159
- .yc-edit-grid {
160
- position: relative;
161
- }
162
- .yc-edit-grid > .react-grid-item {
163
- z-index: 1;
164
- }
165
- `}),m.jsxs("div",{ref:g,style:{position:"relative"},children:[x>0&&n&&d==="lg"&&m.jsx(pO,{className:"yc-bg-grid",layout:gv,cols:pv,rowHeight:xu,width:x,margin:[T,T],useCSSTransforms:!0,compactType:null,isDraggable:!1,isResizable:!1,autoSize:!1,children:cM}),x>0&&m.jsx(gO,{className:n?"layout yc-edit-grid":"layout",layouts:B,breakpoints:aM,cols:iM,rowHeight:xu,width:x,margin:[T,T],isDraggable:n&&d==="lg",isResizable:n&&d==="lg",onLayoutChange:(j,M)=>{M.lg&&k(M.lg)},compactType:"vertical",autoSize:!0,useCSSTransforms:!0,children:L.map(({id:j,widget:M,rowIndex:P,widgetIndex:F})=>m.jsx("div",{className:"h-full",children:m.jsxs(sM,{onRemove:()=>N(P,F),widgetType:M.type,isContentEditing:_===j,onDoubleClick:M.type==="text"?()=>S(j):void 0,children:[M.type==="chart"&&M.ref&&m.jsx(EO,{chartRef:M.ref}),M.type==="text"&&m.jsx(rM,{content:M.content||"",onUpdate:W=>R(P,F,W),isContentEditing:_===j,onEditStart:()=>S(j),onEditEnd:()=>S(null)})]})},j))})]})]})}function fM({isOpen:e,onClose:t,onAdd:n,existingCharts:r}){const{data:a}=ii(),[o,u]=I.useState(""),c=I.useRef(null);if(I.useEffect(()=>{const g=E=>{E.key==="Escape"&&t()},x=E=>{c.current&&!c.current.contains(E.target)&&t()};return e&&(document.addEventListener("keydown",g),document.addEventListener("mousedown",x)),()=>{document.removeEventListener("keydown",g),document.removeEventListener("mousedown",x)}},[e,t]),!e)return null;const f=((a==null?void 0:a.charts)||[]).filter(g=>g.title.toLowerCase().includes(o.toLowerCase())||g.name.toLowerCase().includes(o.toLowerCase())),p=g=>{n({type:"chart",ref:g,cols:6}),t()};return m.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:m.jsxs("div",{ref:c,className:"rounded-lg shadow-xl w-full max-w-md mx-4",style:{backgroundColor:"var(--yc-color-surface)"},children:[m.jsxs("div",{className:"p-4 border-b",style:{borderColor:"var(--yc-color-border)"},children:[m.jsxs("div",{className:"flex items-center justify-between mb-3",children:[m.jsx("h2",{className:"text-lg font-semibold",style:{color:"var(--yc-color-text)"},children:"Add Chart"}),m.jsx("button",{onClick:t,className:"p-1 hover:opacity-80",style:{color:"var(--yc-color-text-muted)"},children:m.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),m.jsx("input",{type:"text",placeholder:"Search charts...",value:o,onChange:g=>u(g.target.value),className:"w-full px-3 py-2 border rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent",style:{backgroundColor:"var(--yc-color-input-bg)",color:"var(--yc-color-text)",borderColor:"var(--yc-color-border)"},autoFocus:!0})]}),m.jsx("div",{className:"max-h-80 overflow-y-auto",children:f.length===0?m.jsx("div",{className:"p-4 text-center text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"No charts found"}):m.jsx("div",{className:"p-2",children:f.map(g=>{const x=r.includes(g.name);return m.jsxs("button",{onClick:()=>p(g.name),disabled:x,className:"w-full text-left px-3 py-3 rounded-md hover:bg-black/5 disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-between group",children:[m.jsxs("div",{children:[m.jsx("div",{className:"font-medium",style:{color:"var(--yc-color-text)"},children:g.title}),m.jsx("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:g.name}),g.description&&m.jsx("div",{className:"text-xs mt-1",style:{color:"var(--yc-color-text-muted)"},children:g.description})]}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"text-xs px-2 py-1 rounded",style:{color:"var(--yc-color-text-muted)",backgroundColor:"var(--yc-color-surface-hover)"},children:g.type}),x?m.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-success)"},children:"Added"}):m.jsx("svg",{className:"w-5 h-5 opacity-0 group-hover:opacity-100",style:{color:"var(--yc-color-text-muted)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})]})]},g.name)})})})]})})}function hM(e){const t=Math.floor((Date.now()-e)/1e3);if(t<10)return"just now";if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:new Date(e).toLocaleDateString()}function mM({dashboardId:e,title:t,description:n,contentRef:r,activeTab:a}){const{isEditing:o,setIsEditing:u,pendingLayout:c,setPendingLayout:d,setOriginalLayout:f,hasChanges:p,addWidget:g,currentLayout:x,undo:E,redo:_,canUndo:S,canRedo:w}=mo(),T=M0(),C=eS(e),O=tS(),L=zw({queryKey:["chartData"]}),B=jr(),k=(()=>{const D=B.getQueryCache();let ue=0;for(const ae of D.getAll()){const U=ae.queryKey[0];(U==="chartData"||U==="chartWithData")&&ae.state.dataUpdatedAt>ue&&(ue=ae.state.dataUpdatedAt)}return ue>0?ue:null})(),[N,R]=I.useState(!1),[j,M]=I.useState(!1),[P,F]=I.useState(!1),[W,V]=I.useState(!1),J=(x==null?void 0:x.rows.flatMap(D=>D.widgets.filter(ue=>ue.type==="chart"&&ue.ref).map(ue=>ue.ref)))||[],K=()=>{O()},Z=async D=>{if(r.current){V(!0),R(!1);try{D==="pdf"?await B3(r.current,`${e}-dashboard`,t):await j3(r.current,`${e}-dashboard`,D)}finally{V(!1)}}},G=async()=>{if(c)try{await C.mutateAsync({layout:c,tab:a}),f(c),d(null),u(!1)}catch(D){console.error("Failed to save:",D)}},ee=()=>{d(null),u(!1)};return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"border-b",style:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-surface)"},children:[m.jsxs("div",{className:"flex items-center justify-between p-4",children:[m.jsx("div",{children:m.jsx("h1",{className:"text-xl font-semibold",style:{color:"var(--yc-color-text)"},children:t})}),m.jsx("div",{className:"flex items-center gap-2",children:o?m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"relative",children:[m.jsxs("button",{onClick:()=>F(!P),className:"flex items-center gap-2 px-3 py-2 text-sm font-medium text-blue-600 bg-blue-50 rounded-md hover:bg-blue-100",children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})}),"Add Widget",m.jsx("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),P&&m.jsxs("div",{className:"absolute left-0 top-full mt-1 w-40 rounded-md shadow-lg border z-50 py-1",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[m.jsxs("button",{onClick:()=>{F(!1),M(!0)},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})}),"Chart"]}),m.jsxs("button",{onClick:()=>{F(!1),g({type:"text",content:"",cols:6})},className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h7"})}),"Text"]})]})]}),m.jsxs("div",{className:"flex items-center",children:[m.jsx("button",{onClick:E,disabled:!S,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--yc-color-text-secondary)"},title:"Undo (Cmd+Z)",children:m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 10h10a5 5 0 015 5v2M3 10l4-4m-4 4l4 4"})})}),m.jsx("button",{onClick:_,disabled:!w,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--yc-color-text-secondary)"},title:"Redo (Cmd+Shift+Z)",children:m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 10H11a5 5 0 00-5 5v2m15-7l-4-4m4 4l-4 4"})})})]}),m.jsx("div",{className:"w-px h-6 mx-2",style:{backgroundColor:"var(--yc-color-border)"}}),m.jsx("button",{onClick:ee,className:"px-4 py-2 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"Cancel"}),m.jsx("button",{onClick:G,disabled:!p||C.isPending,className:Sr("px-4 py-2 text-sm font-medium rounded-md",p?"bg-blue-600 text-white hover:bg-blue-700":"cursor-not-allowed"),style:p?void 0:{backgroundColor:"var(--yc-color-surface-hover)",color:"var(--yc-color-text-muted)"},children:C.isPending?"Saving...":"Save & Push"})]}):m.jsxs(m.Fragment,{children:[k&&L===0&&m.jsxs("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},title:new Date(k).toLocaleString(),children:["Updated ",hM(k)]}),m.jsx("button",{onClick:K,disabled:L>0,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-50",style:{color:"var(--yc-color-text-secondary)"},title:"Refresh all charts",children:m.jsx("svg",{className:Sr("w-5 h-5",L>0&&"animate-spin"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})})}),m.jsxs("div",{className:"relative",children:[m.jsx("button",{onClick:()=>R(!N),disabled:W,className:"p-2 hover:bg-black/5 rounded-md disabled:opacity-50",style:{color:"var(--yc-color-text-secondary)"},title:"Export dashboard",children:W?m.jsxs("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[m.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),m.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):m.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})})}),N&&m.jsxs("div",{className:"absolute right-0 top-full mt-1 w-40 rounded-md shadow-lg border z-50 py-1",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:[m.jsxs("button",{onClick:()=>Z("png"),className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Export PNG"]}),m.jsxs("button",{onClick:()=>Z("jpeg"),className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),"Export JPEG"]}),m.jsxs("button",{onClick:()=>Z("pdf"),className:"w-full text-left px-4 py-2 text-sm hover:bg-black/5 flex items-center gap-2",style:{color:"var(--yc-color-text)"},children:[m.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})}),"Export PDF"]})]})]}),T==="lg"?m.jsx("button",{onClick:()=>u(!0),className:"p-2 hover:bg-black/5 rounded-md",style:{color:"var(--yc-color-text-secondary)"},title:"Edit layout",children:m.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}):m.jsx("button",{disabled:!0,className:"p-2 rounded-md",style:{opacity:.5,cursor:"not-allowed",color:"var(--yc-color-text-muted)"},title:"Editing requires a desktop browser",children:m.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})})]})})]}),n&&m.jsx("p",{className:"px-4 pb-3 text-sm",style:{color:"var(--yc-color-text-secondary)"},children:n})]}),m.jsx(fM,{isOpen:j,onClose:()=>M(!1),onAdd:g,existingCharts:J})]})}function pM({filters:e,isEditing:t,onReorder:n,onRename:r}){const[a,o]=I.useState(null),[u,c]=I.useState(null);if(e.length===0)return null;function d(x,E){o(E),x.dataTransfer.effectAllowed="move"}function f(x,E){x.preventDefault(),x.dataTransfer.dropEffect="move",c(E)}function p(x,E){if(x.preventDefault(),a===null||a===E)return;const _=[...e],S=_.splice(a,1)[0];_.splice(E,0,S),n==null||n(_),o(null),c(null)}function g(){o(null),c(null)}return t?m.jsx("div",{className:"flex flex-wrap items-end gap-3",children:e.map((x,E)=>{const _=x.label||Ru(x.name),S=u===E?"border-blue-400":"",w=a===E?"opacity-50":"";return m.jsxs("div",{draggable:!0,onDragStart:T=>d(T,E),onDragOver:T=>f(T,E),onDrop:T=>p(T,E),onDragEnd:g,className:`flex items-center gap-2 px-3 py-2 rounded-md border cursor-grab active:cursor-grabbing transition-all ${S} ${w}`,style:u===E?{borderColor:"var(--yc-color-primary)",backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)"}:{borderColor:"var(--yc-color-border)",backgroundColor:"var(--yc-color-input-bg)"},children:[m.jsx("svg",{className:"w-3 h-3 flex-shrink-0",style:{color:"var(--yc-color-text-muted)"},fill:"currentColor",viewBox:"0 0 20 20",children:m.jsx("path",{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14zm6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6zm0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8zm0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14z"})}),m.jsx(gM,{value:_,onChange:T=>r==null?void 0:r(E,T)}),m.jsx("span",{className:"text-xs",style:{color:"var(--yc-color-text-muted)"},children:x.type.replace("_"," ")})]},x.name)})}):m.jsx("div",{className:"flex flex-wrap items-center gap-2",children:e.map(x=>{const E=x.label||Ru(x.name),_=typeof x.default=="string"?x.default:void 0;switch(x.type){case"date_range":return m.jsx(Kx,{name:x.name,label:E,defaultValue:_},x.name);case"select":{const S=(x.options||[]).map(w=>typeof w=="string"?{value:w,label:w}:w);return m.jsx(Pc,{name:x.name,label:E,options:S,defaultValue:_},x.name)}case"dynamic_select":return x.source?m.jsx(Pc,{name:x.name,label:E,source:x.source,defaultValue:_},x.name):m.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[E,": dynamic_select requires source"]},x.name);case"multi_select":{const S=(x.options||[]).map(w=>typeof w=="string"?{value:w,label:w}:w);return m.jsx(Jx,{name:x.name,label:E,options:S,defaultValue:Array.isArray(x.default)?x.default:void 0,source:x.source},x.name)}case"text":return m.jsx(tE,{name:x.name,label:E,defaultValue:_},x.name);case"number":return m.jsx(sE,{name:x.name,label:E,defaultValue:typeof x.default=="number"?x.default:void 0},x.name);case"boolean":return m.jsx(aE,{name:x.name,label:E},x.name);default:return m.jsxs("div",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:[E,": ",x.type," (not supported)"]},x.name)}})})}function gM({value:e,onChange:t}){const[n,r]=I.useState(!1),[a,o]=I.useState(e);if(!n)return m.jsx("span",{className:"text-sm font-medium cursor-text hover:text-blue-600 hover:underline",style:{color:"var(--yc-color-text)"},onClick:c=>{c.stopPropagation(),r(!0),o(e)},title:"Click to rename",children:e});function u(){a.trim()&&a!==e&&t(a.trim()),r(!1)}return m.jsx("input",{autoFocus:!0,value:a,onChange:c=>o(c.target.value),onBlur:u,onKeyDown:c=>{c.key==="Enter"&&u(),c.key==="Escape"&&r(!1)},className:"text-sm font-medium border border-blue-300 rounded px-1 py-0 outline-none w-32",style:{color:"var(--yc-color-text)",backgroundColor:"var(--yc-color-surface)"},onClick:c=>c.stopPropagation()})}function yM({tabs:e,activeTab:t,onTabChange:n}){const{isEditing:r}=mo();return m.jsx("div",{className:"flex border-b mb-4 mt-2",style:{borderColor:"var(--yc-color-border)"},children:e.map(a=>m.jsx("button",{onClick:()=>n(a.name),disabled:r&&a.name!==t,className:Sr("px-4 py-2 text-sm font-medium border-b-2 transition-colors",a.name===t?"border-blue-500 text-blue-600":"border-transparent hover:border-gray-300",r&&a.name!==t&&"opacity-50 cursor-not-allowed hover:border-transparent"),style:a.name!==t?{color:"var(--yc-color-text-secondary)"}:void 0,children:a.label},a.name))})}function bM(){const e=Qe(a=>a.crossFilters),t=Qe(a=>a.clearCrossFilter),n=Qe(a=>a.clearAllCrossFilters),r=Object.values(e);return r.length===0?null:m.jsxs("div",{className:"flex flex-wrap items-center gap-2 px-4 py-2 mb-4",children:[m.jsx("span",{className:"text-xs font-medium",style:{color:"var(--yc-color-text-secondary)"},children:"Filtered by:"}),r.map(a=>m.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-xs rounded-md",style:{backgroundColor:"color-mix(in srgb, var(--yc-color-primary) 10%, transparent)",color:"var(--yc-color-primary)",border:"1px solid color-mix(in srgb, var(--yc-color-primary) 30%, transparent)"},children:[a.field,": ",a.value,m.jsx("button",{onClick:()=>t(a.field),className:"ml-0.5 hover:opacity-80","aria-label":`Clear ${a.field} filter`,children:m.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:m.jsx("path",{d:"M3 3l6 6M9 3l-6 6"})})})]},a.field)),r.length>1&&m.jsx("button",{onClick:n,className:"text-xs underline hover:opacity-80",style:{color:"var(--yc-color-text-secondary)"},children:"Clear all"})]})}function xM({dashboardId:e,title:t,description:n,contentRef:r,tabs:a,activeTab:o,onTabChange:u,filters:c}){const{isEditing:d,pendingFilters:f,setPendingFilters:p}=mo();I.useEffect(()=>{d&&!f&&p([...c])},[d]);const g=d&&f?f:c;return m.jsxs(m.Fragment,{children:[m.jsx(mM,{dashboardId:e,title:t,description:n,contentRef:r,activeTab:a?o:void 0}),a&&o&&u&&m.jsx(yM,{tabs:a,activeTab:o,onTabChange:u}),g.length>0&&m.jsx("div",{className:"yc-filter-bar sticky top-0 z-10 border-b px-6 py-3",style:{backgroundColor:"var(--yc-color-surface)",borderColor:"var(--yc-color-border)"},children:m.jsx(pM,{filters:g,isEditing:d,onReorder:x=>p(x),onRename:(x,E)=>{const _=[...g];_[x]={..._[x],label:E},p(_)}})}),!d&&m.jsx(bM,{})]})}function EM({dashboardId:e,branch:t,initialTab:n}){const{data:r,isLoading:a,error:o}=Zw(e,t),u=I.useRef(null),c=jr(),d=Qe(_=>_.globalFilters),[f,p]=I.useState(n||"");I.useEffect(()=>{r&&sessionStorage.setItem("yamchart-last-dashboard",JSON.stringify({name:r.name,title:r.title}))},[r==null?void 0:r.name,r==null?void 0:r.title]),I.useEffect(()=>{if(!(r!=null&&r.tabs))return;const _=r.tabs.map(w=>w.name);if(f&&_.includes(f))return;const S=n&&_.includes(n)?n:_[0];S&&p(S)},[r==null?void 0:r.tabs,n]);const g=I.useCallback(_=>{var w;p(_);const S=`#/dashboards/${e}`;if(window.history.replaceState(null,"",`${S}?tab=${encodeURIComponent(_)}`),r!=null&&r.name){const T=Object.fromEntries(Object.entries(d).filter(([O,L])=>L!=null));Ht.warmDashboardCache(r.name,T,_).catch(()=>{});const C=(w=r.tabs)==null?void 0:w.find(O=>O.name===_);if(C)for(const O of C.layout.rows)for(const L of O.widgets)L.type==="chart"&&L.ref&&c.prefetchQuery({queryKey:["chartWithData",L.ref,T],queryFn:()=>Ht.queryChart(L.ref,T,{includeConfig:!0}),staleTime:1e3*60*5})}},[e,r==null?void 0:r.name,r==null?void 0:r.tabs,d,c]),x=I.useMemo(()=>{if(r){if(r.tabs){const _=r.tabs.find(S=>S.name===f);return _==null?void 0:_.layout}return r.layout}},[r,f]),E=I.useMemo(()=>{if(!r)return[];const _=r.filters||[];if(r.tabs){const S=r.tabs.find(T=>T.name===f),w=(S==null?void 0:S.filters)||[];return[..._,...w]}return _},[r,f]);return a?m.jsx("div",{className:"flex items-center justify-center h-64",children:m.jsx("div",{style:{color:"var(--yc-color-text-secondary)"},children:"Loading dashboard..."})}):o||!r?m.jsx("div",{className:"flex items-center justify-center h-64",children:m.jsxs("div",{style:{color:"var(--yc-color-danger)"},children:["Failed to load dashboard: ",(o==null?void 0:o.message)||"Unknown error"]})}):x?m.jsx(lN,{children:m.jsxs("div",{style:{backgroundColor:"var(--yc-color-background)"},children:[m.jsx(xM,{dashboardId:e,title:r.title,description:r.description,contentRef:u,tabs:r.tabs,activeTab:f,onTabChange:r.tabs?g:void 0,filters:E}),m.jsx("div",{ref:u,className:"p-6",children:m.jsx(dM,{layout:x})})]})}):m.jsx("div",{className:"flex items-center justify-center h-64",children:m.jsx("div",{style:{color:"var(--yc-color-text-secondary)"},children:"No layout available"})})}const vM=I.lazy(()=>Os(()=>import("./LoginPage-BrI0Po1-.js"),__vite__mapDeps([0,1])).then(e=>({default:e.LoginPage}))),TM=I.lazy(()=>Os(()=>import("./SetupWizard-DR7B3Vpm.js"),__vite__mapDeps([2,1])).then(e=>({default:e.SetupWizard}))),wM=I.lazy(()=>Os(()=>import("./UserManagement-D8OUccL0.js"),__vite__mapDeps([3,1])).then(e=>({default:e.UserManagement}))),SM=I.lazy(()=>Os(()=>import("./ShareManagement-DyIWeXEC.js"),__vite__mapDeps([4,1])).then(e=>({default:e.ShareManagement}))),CM=I.lazy(()=>Os(()=>import("./PublicViewer-DNmvz77v.js"),__vite__mapDeps([5,1])).then(e=>({default:e.PublicViewer}))),kc=()=>m.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:m.jsx("div",{className:"text-gray-500",children:"Loading..."})});function _b(e){const t=e.replace(/^#?/,""),n=t.match(/^\/settings\/(.+)$/);if(n&&n[1])return{type:"settings",name:n[1],params:{}};const[r,a]=t.split("?"),o=r==null?void 0:r.match(/^\/public\/(charts|dashboards)\/(.+)$/);if(o&&o[1]&&o[2]){const p={};if(a)for(const[g,x]of new URLSearchParams(a).entries())p[g]=x;return{type:o[1]==="dashboards"?"public_dashboard":"public_chart",name:decodeURIComponent(o[2]),params:p}}const[u,c]=t.split("?"),d=u==null?void 0:u.match(/^\/(dashboards|charts)\/(.+)$/);if(!d||!d[1]||!d[2])return null;const f={};if(c)for(const[p,g]of new URLSearchParams(c).entries())f[p]=g;return{type:d[1]==="dashboards"?"dashboard":"chart",name:decodeURIComponent(d[2]),params:f}}function kM(e,t){return m.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:m.jsxs("div",{className:"text-center max-w-md p-8",children:[m.jsx("div",{className:"w-12 h-12 mx-auto mb-4 rounded-full bg-red-50 flex items-center justify-center",children:m.jsx("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:m.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),m.jsx("h1",{className:"text-lg font-semibold text-gray-900",children:"Something went wrong"}),m.jsx("p",{className:"text-sm text-gray-500 mt-2",children:e.message}),m.jsx("button",{onClick:()=>window.location.reload(),className:"mt-4 px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-lg transition-colors",children:"Reload page"})]})})}function _M(){nS();const e=ro(E=>E.auth),t=ro(E=>E.checkAuth);I.useEffect(()=>{t()},[t]);const{data:n,isLoading:r}=ii(),{data:a,isLoading:o}=ox(),u=Qe(E=>E.clearAllCrossFilters),[c,d]=I.useState(()=>window.location.hash.replace(/^#/,"")||"");I.useEffect(()=>{const E=()=>{d(window.location.hash.replace(/^#/,"")||""),u()};return window.addEventListener("hashchange",E),()=>window.removeEventListener("hashchange",E)},[u]);const f=I.useCallback(E=>{window.location.hash=E,d(E),u()},[u]);I.useEffect(()=>{r||o||c||(a&&a.length>0&&a[0]?f(`/dashboards/${a[0].name}`):n!=null&&n.charts&&n.charts.length>0&&n.charts[0]&&f(`/charts/${n.charts[0].name}`))},[r,o,a,n,c,f]);const p=_b(c);if(p&&(p.type==="public_chart"||p.type==="public_dashboard"))return m.jsx(I.Suspense,{fallback:m.jsx(kc,{}),children:m.jsx(CM,{parsed:{type:p.type,name:p.name,params:p.params}})});if(e.status==="loading")return m.jsx(kc,{});if(e.status==="needs_setup")return m.jsx(I.Suspense,{fallback:m.jsx(kc,{}),children:m.jsx(TM,{})});if(e.status==="unauthenticated")return m.jsx(I.Suspense,{fallback:m.jsx(kc,{}),children:m.jsx(vM,{})});if(r||o)return m.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center",children:m.jsx("div",{className:"text-gray-500",children:"Loading..."})});const g=_b(c),x=()=>g?g.type==="settings"&&g.name==="users"?m.jsx(I.Suspense,{fallback:m.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:m.jsx(wM,{})}):g.type==="settings"&&g.name==="shares"?m.jsx(I.Suspense,{fallback:m.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Loading..."}),children:m.jsx(SM,{})}):g.type==="dashboard"?m.jsx(EM,{dashboardId:g.name,initialTab:g.params.tab}):m.jsx(oN,{chartName:g.name,drillParams:g.params}):m.jsx("div",{className:"flex items-center justify-center h-full text-gray-500",children:"Select a dashboard or chart from the sidebar"});return m.jsx(tm,{fallback:kM,children:m.jsx(dS,{children:m.jsx(bS,{currentPath:c,onNavigate:f,onNavigateToUsers:()=>f("/settings/users"),onNavigateToShares:()=>f("/settings/shares"),children:x()})})})}fw.createRoot(document.getElementById("root")).render(m.jsx(I.StrictMode,{children:m.jsx(Yw,{children:m.jsx(_M,{})})}));export{$u as A,cE as B,jc as C,z3 as D,iE as F,xE as G,gE as H,lE as L,fE as P,I3 as S,c0 as T,bE as W,Os as _,Ht as a,sx as b,Sr as c,ix as d,ii as e,F0 as f,Qe as g,vE as h,yE as i,m as j,pE as k,mE as l,hE as m,dE as n,EM as o,ro as u};