react-semaphor 0.0.166 → 0.0.168

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,384 @@
1
+ "use strict";var p4=Object.defineProperty;var g4=(e,t,n)=>t in e?p4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var De=(e,t,n)=>(g4(e,typeof t!="symbol"?t+"":t,n),n),xv=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var J=(e,t,n)=>(xv(e,t,"read from private field"),n?n.call(e):t.get(e)),He=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Ie=(e,t,n,r)=>(xv(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Jf=(e,t,n,r)=>({set _(o){Ie(e,t,o,n)},get _(){return J(e,t,r)}}),vt=(e,t,n)=>(xv(e,t,"access private method"),n);const m=require("react"),ti=require("react-dom");function zO(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const fe=zO(m),m4=zO(ti);var as=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function By(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Jb={exports:{}},Kc={};/**
2
+ * @license React
3
+ * react-jsx-runtime.development.js
4
+ *
5
+ * Copyright (c) Facebook, Inc. and its affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var ZS;function v4(){return ZS||(ZS=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),v=Symbol.iterator,y="@@iterator";function x(P){if(P===null||typeof P!="object")return null;var K=v&&P[v]||P[y];return typeof K=="function"?K:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(P){{for(var K=arguments.length,ae=new Array(K>1?K-1:0),Se=1;Se<K;Se++)ae[Se-1]=arguments[Se];S("error",P,ae)}}function S(P,K,ae){{var Se=w.ReactDebugCurrentFrame,je=Se.getStackAddendum();je!==""&&(K+="%s",ae=ae.concat([je]));var Ve=ae.map(function(Ae){return String(Ae)});Ve.unshift("Warning: "+K),Function.prototype.apply.call(console[P],console,Ve)}}var R=!1,E=!1,O=!1,k=!1,T=!1,M;M=Symbol.for("react.module.reference");function F(P){return!!(typeof P=="string"||typeof P=="function"||P===r||P===i||T||P===o||P===c||P===u||k||P===p||R||E||O||typeof P=="object"&&P!==null&&(P.$$typeof===g||P.$$typeof===f||P.$$typeof===s||P.$$typeof===a||P.$$typeof===l||P.$$typeof===M||P.getModuleId!==void 0))}function z(P,K,ae){var Se=P.displayName;if(Se)return Se;var je=K.displayName||K.name||"";return je!==""?ae+"("+je+")":ae}function B(P){return P.displayName||"Context"}function Y(P){if(P==null)return null;if(typeof P.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof P=="function")return P.displayName||P.name||null;if(typeof P=="string")return P;switch(P){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof P=="object")switch(P.$$typeof){case a:var K=P;return B(K)+".Consumer";case s:var ae=P;return B(ae._context)+".Provider";case l:return z(P,P.render,"ForwardRef");case f:var Se=P.displayName||null;return Se!==null?Se:Y(P.type)||"Memo";case g:{var je=P,Ve=je._payload,Ae=je._init;try{return Y(Ae(Ve))}catch{return null}}}return null}var G=Object.assign,j=0,ee,q,X,re,$,H,ne;function I(){}I.__reactDisabledLog=!0;function ce(){{if(j===0){ee=console.log,q=console.info,X=console.warn,re=console.error,$=console.group,H=console.groupCollapsed,ne=console.groupEnd;var P={configurable:!0,enumerable:!0,value:I,writable:!0};Object.defineProperties(console,{info:P,log:P,warn:P,error:P,group:P,groupCollapsed:P,groupEnd:P})}j++}}function ge(){{if(j--,j===0){var P={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:G({},P,{value:ee}),info:G({},P,{value:q}),warn:G({},P,{value:X}),error:G({},P,{value:re}),group:G({},P,{value:$}),groupCollapsed:G({},P,{value:H}),groupEnd:G({},P,{value:ne})})}j<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var he=w.ReactCurrentDispatcher,de;function oe(P,K,ae){{if(de===void 0)try{throw Error()}catch(je){var Se=je.stack.trim().match(/\n( *(at )?)/);de=Se&&Se[1]||""}return`
10
+ `+de+P}}var Z=!1,ie;{var ye=typeof WeakMap=="function"?WeakMap:Map;ie=new ye}function W(P,K){if(!P||Z)return"";{var ae=ie.get(P);if(ae!==void 0)return ae}var Se;Z=!0;var je=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ve;Ve=he.current,he.current=null,ce();try{if(K){var Ae=function(){throw Error()};if(Object.defineProperty(Ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ae,[])}catch(tn){Se=tn}Reflect.construct(P,[],Ae)}else{try{Ae.call()}catch(tn){Se=tn}P.call(Ae.prototype)}}else{try{throw Error()}catch(tn){Se=tn}P()}}catch(tn){if(tn&&Se&&typeof tn.stack=="string"){for(var ke=tn.stack.split(`
11
+ `),Et=Se.stack.split(`
12
+ `),et=ke.length-1,rt=Et.length-1;et>=1&&rt>=0&&ke[et]!==Et[rt];)rt--;for(;et>=1&&rt>=0;et--,rt--)if(ke[et]!==Et[rt]){if(et!==1||rt!==1)do if(et--,rt--,rt<0||ke[et]!==Et[rt]){var jt=`
13
+ `+ke[et].replace(" at new "," at ");return P.displayName&&jt.includes("<anonymous>")&&(jt=jt.replace("<anonymous>",P.displayName)),typeof P=="function"&&ie.set(P,jt),jt}while(et>=1&&rt>=0);break}}}finally{Z=!1,he.current=Ve,ge(),Error.prepareStackTrace=je}var Rn=P?P.displayName||P.name:"",Hs=Rn?oe(Rn):"";return typeof P=="function"&&ie.set(P,Hs),Hs}function me(P,K,ae){return W(P,!1)}function _e(P){var K=P.prototype;return!!(K&&K.isReactComponent)}function Pe(P,K,ae){if(P==null)return"";if(typeof P=="function")return W(P,_e(P));if(typeof P=="string")return oe(P);switch(P){case c:return oe("Suspense");case u:return oe("SuspenseList")}if(typeof P=="object")switch(P.$$typeof){case l:return me(P.render);case f:return Pe(P.type,K,ae);case g:{var Se=P,je=Se._payload,Ve=Se._init;try{return Pe(Ve(je),K,ae)}catch{}}}return""}var $e=Object.prototype.hasOwnProperty,Ue={},ze=w.ReactDebugCurrentFrame;function Ne(P){if(P){var K=P._owner,ae=Pe(P.type,P._source,K?K.type:null);ze.setExtraStackFrame(ae)}else ze.setExtraStackFrame(null)}function Xe(P,K,ae,Se,je){{var Ve=Function.call.bind($e);for(var Ae in P)if(Ve(P,Ae)){var ke=void 0;try{if(typeof P[Ae]!="function"){var Et=Error((Se||"React class")+": "+ae+" type `"+Ae+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof P[Ae]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Et.name="Invariant Violation",Et}ke=P[Ae](K,Ae,Se,ae,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(et){ke=et}ke&&!(ke instanceof Error)&&(Ne(je),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Se||"React class",ae,Ae,typeof ke),Ne(null)),ke instanceof Error&&!(ke.message in Ue)&&(Ue[ke.message]=!0,Ne(je),_("Failed %s type: %s",ae,ke.message),Ne(null))}}}var gt=Array.isArray;function It(P){return gt(P)}function zt(P){{var K=typeof Symbol=="function"&&Symbol.toStringTag,ae=K&&P[Symbol.toStringTag]||P.constructor.name||"Object";return ae}}function ln(P){try{return le(P),!1}catch{return!0}}function le(P){return""+P}function Ce(P){if(ln(P))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",zt(P)),le(P)}var Le=w.ReactCurrentOwner,qe={key:!0,ref:!0,__self:!0,__source:!0},dt,rn,on;on={};function fn(P){if($e.call(P,"ref")){var K=Object.getOwnPropertyDescriptor(P,"ref").get;if(K&&K.isReactWarning)return!1}return P.ref!==void 0}function zn(P){if($e.call(P,"key")){var K=Object.getOwnPropertyDescriptor(P,"key").get;if(K&&K.isReactWarning)return!1}return P.key!==void 0}function wr(P,K){if(typeof P.ref=="string"&&Le.current&&K&&Le.current.stateNode!==K){var ae=Y(Le.current.type);on[ae]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',Y(Le.current.type),P.ref),on[ae]=!0)}}function hn(P,K){{var ae=function(){dt||(dt=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",K))};ae.isReactWarning=!0,Object.defineProperty(P,"key",{get:ae,configurable:!0})}}function nr(P,K){{var ae=function(){rn||(rn=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",K))};ae.isReactWarning=!0,Object.defineProperty(P,"ref",{get:ae,configurable:!0})}}var Tn=function(P,K,ae,Se,je,Ve,Ae){var ke={$$typeof:t,type:P,key:K,ref:ae,props:Ae,_owner:Ve};return ke._store={},Object.defineProperty(ke._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ke,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Se}),Object.defineProperty(ke,"_source",{configurable:!1,enumerable:!1,writable:!1,value:je}),Object.freeze&&(Object.freeze(ke.props),Object.freeze(ke)),ke};function Oc(P,K,ae,Se,je){{var Ve,Ae={},ke=null,Et=null;ae!==void 0&&(Ce(ae),ke=""+ae),zn(K)&&(Ce(K.key),ke=""+K.key),fn(K)&&(Et=K.ref,wr(K,je));for(Ve in K)$e.call(K,Ve)&&!qe.hasOwnProperty(Ve)&&(Ae[Ve]=K[Ve]);if(P&&P.defaultProps){var et=P.defaultProps;for(Ve in et)Ae[Ve]===void 0&&(Ae[Ve]=et[Ve])}if(ke||Et){var rt=typeof P=="function"?P.displayName||P.name||"Unknown":P;ke&&hn(Ae,rt),Et&&nr(Ae,rt)}return Tn(P,ke,Et,je,Se,Le.current,Ae)}}var ai=w.ReactCurrentOwner,Is=w.ReactDebugCurrentFrame;function jn(P){if(P){var K=P._owner,ae=Pe(P.type,P._source,K?K.type:null);Is.setExtraStackFrame(ae)}else Is.setExtraStackFrame(null)}var ko;ko=!1;function li(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function Ns(){{if(ai.current){var P=Y(ai.current.type);if(P)return`
14
+
15
+ Check the render method of \``+P+"`."}return""}}function $c(P){{if(P!==void 0){var K=P.fileName.replace(/^.*[\\\/]/,""),ae=P.lineNumber;return`
16
+
17
+ Check your code at `+K+":"+ae+"."}return""}}var Ls={};function Za(P){{var K=Ns();if(!K){var ae=typeof P=="string"?P:P.displayName||P.name;ae&&(K=`
18
+
19
+ Check the top-level render call using <`+ae+">.")}return K}}function Fs(P,K){{if(!P._store||P._store.validated||P.key!=null)return;P._store.validated=!0;var ae=Za(K);if(Ls[ae])return;Ls[ae]=!0;var Se="";P&&P._owner&&P._owner!==ai.current&&(Se=" It was passed a child from "+Y(P._owner.type)+"."),jn(P),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ae,Se),jn(null)}}function zs(P,K){{if(typeof P!="object")return;if(It(P))for(var ae=0;ae<P.length;ae++){var Se=P[ae];li(Se)&&Fs(Se,K)}else if(li(P))P._store&&(P._store.validated=!0);else if(P){var je=x(P);if(typeof je=="function"&&je!==P.entries)for(var Ve=je.call(P),Ae;!(Ae=Ve.next()).done;)li(Ae.value)&&Fs(Ae.value,K)}}}function Dc(P){{var K=P.type;if(K==null||typeof K=="string")return;var ae;if(typeof K=="function")ae=K.propTypes;else if(typeof K=="object"&&(K.$$typeof===l||K.$$typeof===f))ae=K.propTypes;else return;if(ae){var Se=Y(K);Xe(ae,P.props,"prop",Se,P)}else if(K.PropTypes!==void 0&&!ko){ko=!0;var je=Y(K);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",je||"Unknown")}typeof K.getDefaultProps=="function"&&!K.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function js(P){{for(var K=Object.keys(P.props),ae=0;ae<K.length;ae++){var Se=K[ae];if(Se!=="children"&&Se!=="key"){jn(P),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Se),jn(null);break}}P.ref!==null&&(jn(P),_("Invalid attribute `ref` supplied to `React.Fragment`."),jn(null))}}function Bs(P,K,ae,Se,je,Ve){{var Ae=F(P);if(!Ae){var ke="";(P===void 0||typeof P=="object"&&P!==null&&Object.keys(P).length===0)&&(ke+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Et=$c(je);Et?ke+=Et:ke+=Ns();var et;P===null?et="null":It(P)?et="array":P!==void 0&&P.$$typeof===t?(et="<"+(Y(P.type)||"Unknown")+" />",ke=" Did you accidentally export a JSX literal instead of a component?"):et=typeof P,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",et,ke)}var rt=Oc(P,K,ae,je,Ve);if(rt==null)return rt;if(Ae){var jt=K.children;if(jt!==void 0)if(Se)if(It(jt)){for(var Rn=0;Rn<jt.length;Rn++)zs(jt[Rn],P);Object.freeze&&Object.freeze(jt)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else zs(jt,P)}return P===r?js(rt):Dc(rt),rt}}function Vs(P,K,ae){return Bs(P,K,ae,!0)}function Tc(P,K,ae){return Bs(P,K,ae,!1)}var kc=Tc,Mc=Vs;Kc.Fragment=r,Kc.jsx=kc,Kc.jsxs=Mc}()),Kc}var Xc={};/**
20
+ * @license React
21
+ * react-jsx-runtime.production.min.js
22
+ *
23
+ * Copyright (c) Facebook, Inc. and its affiliates.
24
+ *
25
+ * This source code is licensed under the MIT license found in the
26
+ * LICENSE file in the root directory of this source tree.
27
+ */var eC;function b4(){if(eC)return Xc;eC=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,f={},g=null,p=null;c!==void 0&&(g=""+c),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:g,ref:p,props:f,_owner:o.current}}return Xc.Fragment=n,Xc.jsx=s,Xc.jsxs=s,Xc}process.env.NODE_ENV==="production"?Jb.exports=b4():Jb.exports=v4();var N=Jb.exports;function jO(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=jO(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function hp(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=jO(e))&&(r&&(r+=" "),r+=t);return r}const y4=Object.freeze(Object.defineProperty({__proto__:null,clsx:hp,default:hp},Symbol.toStringTag,{value:"Module"})),Vy="-";function x4(e){const t=_4(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(Vy);return a[0]===""&&a.length!==1&&a.shift(),BO(a,t)||w4(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function BO(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?BO(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(Vy);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const tC=/^\[(.+)\]$/;function w4(e){if(tC.test(e)){const t=tC.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function _4(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return C4(Object.entries(e.classGroups),n).forEach(([i,s])=>{Zb(s,r,i,t)}),r}function Zb(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:nC(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(S4(o)){Zb(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Zb(s,nC(t,i),n,r)})})}function nC(e,t){let n=e;return t.split(Vy).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function S4(e){return e.isThemeGetter}function C4(e,t){return t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e}function E4(e){if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;function o(i,s){n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)}return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}}const VO="!";function R4(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,c=0,u;for(let y=0;y<s.length;y++){let x=s[y];if(l===0){if(x===r&&(n||s.slice(y,y+o)===t)){a.push(s.slice(c,y)),c=y+o;continue}if(x==="/"){u=y;continue}}x==="["?l++:x==="]"&&l--}const f=a.length===0?s:s.substring(c),g=f.startsWith(VO),p=g?f.substring(1):f,v=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:g,baseClassName:p,maybePostfixModifierPosition:v}}}function P4(e){if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t}function O4(e){return{cache:E4(e.cacheSize),splitModifiers:R4(e),...x4(e)}}const $4=/\s+/;function D4(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split($4).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let f=r(u?c.substring(0,u):c),g=!!u;if(!f){if(!u)return{isTailwindClass:!1,originalClassName:s};if(f=r(c),!f)return{isTailwindClass:!1,originalClassName:s};g=!1}const p=P4(a).join(":");return{isTailwindClass:!0,modifierId:l?p+VO:p,classGroupId:f,originalClassName:s,hasPostfixModifier:g}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(f=>i.add(a+f)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function T4(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=HO(t))&&(r&&(r+=" "),r+=n);return r}function HO(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=HO(e[r]))&&(n&&(n+=" "),n+=t);return n}function k4(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,f)=>f(u),e());return n=O4(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=D4(l,n);return o(l,u),u}return function(){return i(T4.apply(null,arguments))}}function Yt(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const WO=/^\[(?:([a-z-]+):)?(.+)\]$/i,M4=/^\d+\/\d+$/,A4=new Set(["px","full","screen"]),I4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,N4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,L4=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,F4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function xo(e){return fa(e)||A4.has(e)||M4.test(e)}function Qi(e){return bc(e,"length",q4)}function fa(e){return!!e&&!Number.isNaN(Number(e))}function Zf(e){return bc(e,"number",fa)}function Qc(e){return!!e&&Number.isInteger(Number(e))}function z4(e){return e.endsWith("%")&&fa(e.slice(0,-1))}function ht(e){return WO.test(e)}function Ji(e){return I4.test(e)}const j4=new Set(["length","size","percentage"]);function B4(e){return bc(e,j4,UO)}function V4(e){return bc(e,"position",UO)}const H4=new Set(["image","url"]);function W4(e){return bc(e,H4,Y4)}function U4(e){return bc(e,"",G4)}function Jc(){return!0}function bc(e,t,n){const r=WO.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function q4(e){return N4.test(e)}function UO(){return!1}function G4(e){return L4.test(e)}function Y4(e){return F4.test(e)}function K4(){const e=Yt("colors"),t=Yt("spacing"),n=Yt("blur"),r=Yt("brightness"),o=Yt("borderColor"),i=Yt("borderRadius"),s=Yt("borderSpacing"),a=Yt("borderWidth"),l=Yt("contrast"),c=Yt("grayscale"),u=Yt("hueRotate"),f=Yt("invert"),g=Yt("gap"),p=Yt("gradientColorStops"),v=Yt("gradientColorStopPositions"),y=Yt("inset"),x=Yt("margin"),w=Yt("opacity"),_=Yt("padding"),S=Yt("saturate"),R=Yt("scale"),E=Yt("sepia"),O=Yt("skew"),k=Yt("space"),T=Yt("translate"),M=()=>["auto","contain","none"],F=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto",ht,t],B=()=>[ht,t],Y=()=>["",xo,Qi],G=()=>["auto",fa,ht],j=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ee=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],X=()=>["start","end","center","between","around","evenly","stretch"],re=()=>["","0",ht],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[fa,Zf],ne=()=>[fa,ht];return{cacheSize:500,separator:":",theme:{colors:[Jc],spacing:[xo,Qi],blur:["none","",Ji,ht],brightness:H(),borderColor:[e],borderRadius:["none","","full",Ji,ht],borderSpacing:B(),borderWidth:Y(),contrast:H(),grayscale:re(),hueRotate:ne(),invert:re(),gap:B(),gradientColorStops:[e],gradientColorStopPositions:[z4,Qi],inset:z(),margin:z(),opacity:H(),padding:B(),saturate:H(),scale:H(),sepia:re(),skew:ne(),space:B(),translate:B()},classGroups:{aspect:[{aspect:["auto","square","video",ht]}],container:["container"],columns:[{columns:[Ji]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...j(),ht]}],overflow:[{overflow:F()}],"overflow-x":[{"overflow-x":F()}],"overflow-y":[{"overflow-y":F()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Qc,ht]}],basis:[{basis:z()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ht]}],grow:[{grow:re()}],shrink:[{shrink:re()}],order:[{order:["first","last","none",Qc,ht]}],"grid-cols":[{"grid-cols":[Jc]}],"col-start-end":[{col:["auto",{span:["full",Qc,ht]},ht]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[Jc]}],"row-start-end":[{row:["auto",{span:[Qc,ht]},ht]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ht]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ht]}],gap:[{gap:[g]}],"gap-x":[{"gap-x":[g]}],"gap-y":[{"gap-y":[g]}],"justify-content":[{justify:["normal",...X()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...X(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...X(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",ht,t]}],"min-w":[{"min-w":["min","max","fit",ht,xo]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Ji]},Ji,ht]}],h:[{h:[ht,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",xo,ht]}],"max-h":[{"max-h":[ht,t,"min","max","fit"]}],"font-size":[{text:["base",Ji,Qi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Zf]}],"font-family":[{font:[Jc]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ht]}],"line-clamp":[{"line-clamp":["none",fa,Zf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",xo,ht]}],"list-image":[{"list-image":["none",ht]}],"list-style-type":[{list:["none","disc","decimal",ht]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",xo,Qi]}],"underline-offset":[{"underline-offset":["auto",xo,ht]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ht]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ht]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...j(),V4]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",B4]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},W4]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...ee(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:ee()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...ee()]}],"outline-offset":[{"outline-offset":[xo,ht]}],"outline-w":[{outline:[xo,Qi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[xo,Qi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ji,U4]}],"shadow-color":[{shadow:[Jc]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":q()}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ji,ht]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[S]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ht]}],duration:[{duration:ne()}],ease:[{ease:["linear","in","out","in-out",ht]}],delay:[{delay:ne()}],animate:[{animate:["none","spin","ping","pulse","bounce",ht]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[Qc,ht]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ht]}],accent:[{accent:["auto",e]}],appearance:["appearance-none"],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ht]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ht]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[xo,Qi,Zf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const X4=k4(K4);class Q4 extends Error{}Q4.prototype.name="InvalidTokenError";function Oe(...e){return X4(hp(e))}async function J4(e,t,n={}){try{const r=new URLSearchParams(n).toString(),o=`${e}?${r}`,i=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});if(!i.ok){const a=await i.json();throw new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)}return await i.json()}catch(r){throw console.error("Error during fetch:",r),r}}async function Fd(e,t,n={}){try{const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(n)});return r.ok?await r.json():r.json().then(i=>{throw console.log(i.detail||"Unknown error occurred"),new Error((i==null?void 0:i.error)||`HTTP error! status: ${r.status}`)})}catch(r){throw console.error("Error during fetch:",r),r}}function Z4(e){var t;if(navigator.clipboard&&e.current)navigator.clipboard.writeText(e.current.innerText).then(()=>console.log("Content copied to clipboard")).catch(n=>console.error("Failed to copy: ",n));else{const n=document.createElement("textarea");n.value=((t=e==null?void 0:e.current)==null?void 0:t.innerText)??"",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),console.log("Content copied to clipboard")}}function qO(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(o,i)=>e9(i,t))}function e9(e,t){const n=t==null?void 0:t.find(r=>r.name===e);return n?`(${n.sql}) as ${n.name}`:(console.log(e),`'${e}_table'`)}function t9(e){return e.charAt(0).toUpperCase()+e.slice(1)}const n9="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";var r9={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const rC=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const f=t;t=c??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(g=>g(t,f))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(r9?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,a),a},o9=e=>e?rC(e):rC;var e0={exports:{}},wv={},eh={exports:{}},_v={};/**
28
+ * @license React
29
+ * use-sync-external-store-shim.development.js
30
+ *
31
+ * Copyright (c) Facebook, Inc. and its affiliates.
32
+ *
33
+ * This source code is licensed under the MIT license found in the
34
+ * LICENSE file in the root directory of this source tree.
35
+ */var oC;function i9(){return oC||(oC=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=m,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(S){{for(var R=arguments.length,E=new Array(R>1?R-1:0),O=1;O<R;O++)E[O-1]=arguments[O];r("error",S,E)}}function r(S,R,E){{var O=t.ReactDebugCurrentFrame,k=O.getStackAddendum();k!==""&&(R+="%s",E=E.concat([k]));var T=E.map(function(M){return String(M)});T.unshift("Warning: "+R),Function.prototype.apply.call(console[S],console,T)}}function o(S,R){return S===R&&(S!==0||1/S===1/R)||S!==S&&R!==R}var i=typeof Object.is=="function"?Object.is:o,s=e.useState,a=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue,u=!1,f=!1;function g(S,R,E){u||e.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var O=R();if(!f){var k=R();i(O,k)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var T=s({inst:{value:O,getSnapshot:R}}),M=T[0].inst,F=T[1];return l(function(){M.value=O,M.getSnapshot=R,p(M)&&F({inst:M})},[S,O,R]),a(function(){p(M)&&F({inst:M});var z=function(){p(M)&&F({inst:M})};return S(z)},[S]),c(O),O}function p(S){var R=S.getSnapshot,E=S.value;try{var O=R();return!i(E,O)}catch{return!0}}function v(S,R,E){return R()}var y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",x=!y,w=x?v:g,_=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w;_v.useSyncExternalStore=_,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),_v}var Sv={};/**
36
+ * @license React
37
+ * use-sync-external-store-shim.production.min.js
38
+ *
39
+ * Copyright (c) Facebook, Inc. and its affiliates.
40
+ *
41
+ * This source code is licensed under the MIT license found in the
42
+ * LICENSE file in the root directory of this source tree.
43
+ */var iC;function s9(){if(iC)return Sv;iC=1;var e=m;function t(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(f,g){var p=g(),v=r({inst:{value:p,getSnapshot:g}}),y=v[0].inst,x=v[1];return i(function(){y.value=p,y.getSnapshot=g,l(y)&&x({inst:y})},[f,p,g]),o(function(){return l(y)&&x({inst:y}),f(function(){l(y)&&x({inst:y})})},[f]),s(p),p}function l(f){var g=f.getSnapshot;f=f.value;try{var p=g();return!n(f,p)}catch{return!0}}function c(f,g){return g()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Sv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,Sv}var sC;function Hy(){return sC||(sC=1,process.env.NODE_ENV==="production"?eh.exports=s9():eh.exports=i9()),eh.exports}/**
44
+ * @license React
45
+ * use-sync-external-store-shim/with-selector.development.js
46
+ *
47
+ * Copyright (c) Facebook, Inc. and its affiliates.
48
+ *
49
+ * This source code is licensed under the MIT license found in the
50
+ * LICENSE file in the root directory of this source tree.
51
+ */var aC;function a9(){return aC||(aC=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=m,t=Hy();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;function c(u,f,g,p,v){var y=i(null),x;y.current===null?(x={hasValue:!1,value:null},y.current=x):x=y.current;var w=a(function(){var E=!1,O,k,T=function(B){if(!E){E=!0,O=B;var Y=p(B);if(v!==void 0&&x.hasValue){var G=x.value;if(v(G,Y))return k=G,G}return k=Y,Y}var j=O,ee=k;if(r(j,B))return ee;var q=p(B);return v!==void 0&&v(ee,q)?ee:(O=B,k=q,q)},M=g===void 0?null:g,F=function(){return T(f())},z=M===null?void 0:function(){return T(M())};return[F,z]},[f,g,p,v]),_=w[0],S=w[1],R=o(u,_,S);return s(function(){x.hasValue=!0,x.value=R},[R]),l(R),R}wv.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),wv}var Cv={};/**
52
+ * @license React
53
+ * use-sync-external-store-shim/with-selector.production.min.js
54
+ *
55
+ * Copyright (c) Facebook, Inc. and its affiliates.
56
+ *
57
+ * This source code is licensed under the MIT license found in the
58
+ * LICENSE file in the root directory of this source tree.
59
+ */var lC;function l9(){if(lC)return Cv;lC=1;var e=m,t=Hy();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Cv.useSyncExternalStoreWithSelector=function(c,u,f,g,p){var v=i(null);if(v.current===null){var y={hasValue:!1,value:null};v.current=y}else y=v.current;v=a(function(){function w(O){if(!_){if(_=!0,S=O,O=g(O),p!==void 0&&y.hasValue){var k=y.value;if(p(k,O))return R=k}return R=O}if(k=R,r(S,O))return k;var T=g(O);return p!==void 0&&p(k,T)?k:(S=O,R=T)}var _=!1,S,R,E=f===void 0?null:f;return[function(){return w(u())},E===null?void 0:function(){return w(E())}]},[u,f,g,p]);var x=o(c,v[0],v[1]);return s(function(){y.hasValue=!0,y.value=x},[x]),l(x),x},Cv}process.env.NODE_ENV==="production"?e0.exports=l9():e0.exports=a9();var c9=e0.exports;const u9=vc(c9);var GO={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:d9}=m,{useSyncExternalStoreWithSelector:f9}=u9;let cC=!1;function h9(e,t=e.getState,n){(GO?"production":void 0)!=="production"&&n&&!cC&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),cC=!0);const r=f9(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return d9(r),r}const uC=e=>{(GO?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?o9(e):e,n=(r,o)=>h9(t,r,o);return Object.assign(n,t),n},YO=e=>e?uC(e):uC;var KO=Symbol.for("immer-nothing"),dC=Symbol.for("immer-draftable"),Vr=Symbol.for("immer-state"),p9=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function pr(e,...t){if(process.env.NODE_ENV!=="production"){const n=p9[e],r=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var tc=Object.getPrototypeOf;function nc(e){return!!e&&!!e[Vr]}function Ta(e){var t;return e?XO(e)||Array.isArray(e)||!!e[dC]||!!((t=e.constructor)!=null&&t[dC])||ng(e)||rg(e):!1}var g9=Object.prototype.constructor.toString();function XO(e){if(!e||typeof e!="object")return!1;const t=tc(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===g9}function Fu(e,t){tg(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function tg(e){const t=e[Vr];return t?t.type_:Array.isArray(e)?1:ng(e)?2:rg(e)?3:0}function t0(e,t){return tg(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function QO(e,t,n){const r=tg(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function m9(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ng(e){return e instanceof Map}function rg(e){return e instanceof Set}function sa(e){return e.copy_||e.base_}function n0(e,t){if(ng(e))return new Map(e);if(rg(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&XO(e))return tc(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[Vr];let r=Reflect.ownKeys(n);for(let o=0;o<r.length;o++){const i=r[o],s=n[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(n[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[i]})}return Object.create(tc(e),n)}function Wy(e,t=!1){return og(e)||nc(e)||!Ta(e)||(tg(e)>1&&(e.set=e.add=e.clear=e.delete=v9),Object.freeze(e),t&&Fu(e,(n,r)=>Wy(r,!0))),e}function v9(){pr(2)}function og(e){return Object.isFrozen(e)}var b9={};function ka(e){const t=b9[e];return t||pr(0,e),t}var zu;function JO(){return zu}function y9(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function fC(e,t){t&&(ka("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function r0(e){o0(e),e.drafts_.forEach(x9),e.drafts_=null}function o0(e){e===zu&&(zu=e.parent_)}function hC(e){return zu=y9(zu,e)}function x9(e){const t=e[Vr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function pC(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Vr].modified_&&(r0(t),pr(4)),Ta(e)&&(e=pp(t,e),t.parent_||gp(t,e)),t.patches_&&ka("Patches").generateReplacementPatches_(n[Vr].base_,e,t.patches_,t.inversePatches_)):e=pp(t,n,[]),r0(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==KO?e:void 0}function pp(e,t,n){if(og(t))return t;const r=t[Vr];if(!r)return Fu(t,(o,i)=>gC(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return gp(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const o=r.copy_;let i=o,s=!1;r.type_===3&&(i=new Set(o),o.clear(),s=!0),Fu(i,(a,l)=>gC(e,r,o,a,l,n,s)),gp(e,o,!1),n&&e.patches_&&ka("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function gC(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&pr(5),nc(o)){const a=i&&t&&t.type_!==3&&!t0(t.assigned_,r)?i.concat(r):void 0,l=pp(e,o,a);if(QO(n,r,l),nc(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(Ta(o)&&!og(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;pp(e,o),(!t||!t.scope_.parent_)&&gp(e,o)}}function gp(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Wy(t,n)}function w9(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:JO(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Uy;n&&(o=[r],i=ju);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var Uy={get(e,t){if(t===Vr)return e;const n=sa(e);if(!t0(n,t))return _9(e,n,t);const r=n[t];return e.finalized_||!Ta(r)?r:r===Ev(e.base_,t)?(Rv(e),e.copy_[t]=s0(r,e)):r},has(e,t){return t in sa(e)},ownKeys(e){return Reflect.ownKeys(sa(e))},set(e,t,n){const r=ZO(sa(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=Ev(sa(e),t),i=o==null?void 0:o[Vr];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(m9(n,o)&&(n!==void 0||t0(e.base_,t)))return!0;Rv(e),i0(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Ev(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Rv(e),i0(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=sa(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){pr(11)},getPrototypeOf(e){return tc(e.base_)},setPrototypeOf(){pr(12)}},ju={};Fu(Uy,(e,t)=>{ju[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ju.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&pr(13),ju.set.call(this,e,t,void 0)};ju.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&pr(14),Uy.set.call(this,e[0],t,n,e[0])};function Ev(e,t){const n=e[Vr];return(n?sa(n):e)[t]}function _9(e,t,n){var o;const r=ZO(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function ZO(e,t){if(!(t in e))return;let n=tc(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=tc(n)}}function i0(e){e.modified_||(e.modified_=!0,e.parent_&&i0(e.parent_))}function Rv(e){e.copy_||(e.copy_=n0(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var S9=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&pr(6),r!==void 0&&typeof r!="function"&&pr(7);let o;if(Ta(t)){const i=hC(this),s=s0(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?r0(i):o0(i)}return fC(i,r),pC(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===KO&&(o=void 0),this.autoFreeze_&&Wy(o,!0),r){const i=[],s=[];ka("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else pr(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,o;return[this.produce(t,n,(s,a)=>{r=s,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ta(e)||pr(8),nc(e)&&(e=C9(e));const t=hC(this),n=s0(e,void 0);return n[Vr].isManual_=!0,o0(t),n}finishDraft(e,t){const n=e&&e[Vr];(!n||!n.isManual_)&&pr(9);const{scope_:r}=n;return fC(r,t),pC(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));const r=ka("Patches").applyPatches_;return nc(e)?r(e,t):this.produce(e,o=>r(o,t))}};function s0(e,t){const n=ng(e)?ka("MapSet").proxyMap_(e,t):rg(e)?ka("MapSet").proxySet_(e,t):w9(e,t);return(t?t.scope_:JO()).drafts_.push(n),n}function C9(e){return nc(e)||pr(10,e),e$(e)}function e$(e){if(!Ta(e)||og(e))return e;const t=e[Vr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=n0(e,t.scope_.immer_.useStrictShallowCopy_)}else n=n0(e,!0);return Fu(n,(r,o)=>{QO(n,r,e$(o))}),t&&(t.finalized_=!1),n}var Hr=new S9,E9=Hr.produce;Hr.produceWithPatches.bind(Hr);Hr.setAutoFreeze.bind(Hr);Hr.setUseStrictShallowCopy.bind(Hr);Hr.applyPatches.bind(Hr);Hr.createDraft.bind(Hr);Hr.finishDraft.bind(Hr);const R9=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?E9(o):o;return t(a,i,...s)},e(r.setState,n,r)),t$=R9;var a0,th=ti;if(process.env.NODE_ENV==="production")a0=th.createRoot,th.hydrateRoot;else{var mC=th.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;a0=function(e,t){mC.usingClientEntryPoint=!0;try{return th.createRoot(e,t)}finally{mC.usingClientEntryPoint=!1}}}var n$={},r$={},qy={exports:{}},Kt=String,o$=function(){return{isColorSupported:!1,reset:Kt,bold:Kt,dim:Kt,italic:Kt,underline:Kt,inverse:Kt,hidden:Kt,strikethrough:Kt,black:Kt,red:Kt,green:Kt,yellow:Kt,blue:Kt,magenta:Kt,cyan:Kt,white:Kt,gray:Kt,bgBlack:Kt,bgRed:Kt,bgGreen:Kt,bgYellow:Kt,bgBlue:Kt,bgMagenta:Kt,bgCyan:Kt,bgWhite:Kt}};qy.exports=o$();qy.exports.createColors=o$;var P9=qy.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(P9);function r(l){return l&&l.__esModule?l:{default:l}}let o=new Set;function i(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&o.has(u)||(u&&o.add(u),console.warn(""),c.forEach(f=>console.warn(l,"-",f)))}function s(l){return n.default.dim(l)}const a={info(l,c){i(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){i(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){i(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(r$);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(r$);function n(i){return i&&i.__esModule?i:{default:i}}function r({version:i,from:s,to:a}){t.default.warn(`${s}-color-renamed`,[`As of Tailwind CSS ${i}, \`${s}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const o={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(n$);let Pv=n$;var O9=(Pv.__esModule?Pv:{default:Pv}).default;const Ht=vc(O9),i$=`import pandas as pd
60
+ df = pd.DataFrame(data) # 'data' contains the query result
61
+ result = df.to_dict('records') # must return 'result' as [dict] type
62
+ `,s$=["lg","md","sm","xs","xxs"],l0={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[Ht.blue[500],Ht.teal[500],Ht.amber[500],Ht.red[500],Ht.indigo[500],Ht.green[500]],borderColor:[Ht.blue[500],Ht.teal[500],Ht.amber[500],Ht.red[500],Ht.indigo[500],Ht.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:vC},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4},legend:{position:"top",align:"center",maxHeight:0}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:2,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[Ht.blue[500],Ht.teal[500],Ht.amber[500],Ht.red[500],Ht.indigo[500],Ht.green[500]],borderColor:[Ht.blue[500],Ht.teal[500],Ht.amber[500],Ht.red[500],Ht.indigo[500],Ht.green[500]],datalables:{color:vC}},options:{plugins:{tooltip:{backgroundColor:"#000",bodyColor:"#fff",borderWidth:.25,titleColor:"#fff",borderColor:"rgb(128,131,139)",cornerRadius:2,boxPadding:4}},datalabels:{display:!1},scales:{x:{grid:{display:!0,color:Ht.slate[800]}},y:{grid:{display:!0,color:Ht.slate[800]}}}}}}};function vC(e){var r,o,i,s,a,l;const t=(a=(s=(i=(o=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:o._config)==null?void 0:i.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=mp()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=mp()),vp(n)}function mp(){return Te.getState().theme==="dark"?"#000000":"#FFFFFF"}function vp(e){let t=0,n=0,r=0,o=0;const i=u=>{const f=u.replace("#",""),g=parseInt(f.substring(0,2),16),p=parseInt(f.substring(2,4),16),v=parseInt(f.substring(4,6),16);t+=g,n+=p,r+=v,o++};Array.isArray(e)?e.forEach(u=>{i(u)}):i(e);const s=t/o,a=n/o,l=r/o;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const ig=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],rc=["number","integer","int","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8"],zd=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],Gy=["boolean"];function Yy(e){return e.match(/[A-Z]/)?`"${e}"`:e}function $9(e,t,n){const{measures:r,dimensions:o}=e,i=r==null?void 0:r.map(c=>`${c.calc}(${c.name}) as ${c.calc}_${c.name.replace(/"/g,"")}`).join(", "),s=(o==null?void 0:o.join(", "))||"";let a="";const l=a$(t,n);if(i&&s)return a=`SELECT ${s}, COUNT(*), ${i} FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC LIMIT 100`,a;if(!i&&s)return a=`SELECT ${s}, COUNT(*) FROM ${l} GROUP BY ${s} ORDER BY ${s} DESC LIMIT 100`,a;if(i&&!s)return a=`SELECT ${i} FROM ${l}`,a}function D9(e,t,n="AVG"){var i,s,a,l;let r={};const o=Yy(e.column_name);return ig.includes(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),rc.includes(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===o&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===o&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function bp(e){return ig.includes(e.dataType)?"string":rc.includes(e.dataType)?"number":zd.includes(e.dataType)?"date":Gy.includes(e.dataType)?"boolean":"string"}function T9(e){let t;const n=e.data_type.toLowerCase();return ig.includes(n)?t="T":rc.includes(n)?t="#":zd.includes(n)?t="D":Gy.includes(n)?t="B":t="?",t}function k9(e,t){const{dimensions:n,measures:r}=t,o=n==null?void 0:n.includes(e.column_name),i=r==null?void 0:r.some(s=>s.name===e.column_name);return o||i}function a$(e,t){return t==="api"||e===Yy("NA")||e==="public"?t:e?`${e}.${t}`:`${t}`}const M9=e=>{const t=new Date(e);return!isNaN(t.getTime())},A9=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),Bu=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?M9(e)?t="date":A9(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function I9({get:e,dataPoint:t,card:n}){var g;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValue:i,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,f={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(g=n.preferences)==null?void 0:g.filterOnClickField,valueType:Bu(u),operation:"=",values:[u]};if(l!=null&&l.find(p=>p.id===n.id)){const p=n.id;if(u==null){a(n),i(p);return}else s(f)}o(n),r(f)}var yp={exports:{}};/**
63
+ * @license
64
+ * Lodash <https://lodash.com/>
65
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
66
+ * Released under MIT license <https://lodash.com/license>
67
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
68
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
69
+ */yp.exports;(function(e,t){(function(){var n,r="4.17.21",o=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",f=1,g=2,p=4,v=1,y=2,x=1,w=2,_=4,S=8,R=16,E=32,O=64,k=128,T=256,M=512,F=30,z="...",B=800,Y=16,G=1,j=2,ee=3,q=1/0,X=9007199254740991,re=17976931348623157e292,$=NaN,H=4294967295,ne=H-1,I=H>>>1,ce=[["ary",k],["bind",x],["bindKey",w],["curry",S],["curryRight",R],["flip",M],["partial",E],["partialRight",O],["rearg",T]],ge="[object Arguments]",he="[object Array]",de="[object AsyncFunction]",oe="[object Boolean]",Z="[object Date]",ie="[object DOMException]",ye="[object Error]",W="[object Function]",me="[object GeneratorFunction]",_e="[object Map]",Pe="[object Number]",$e="[object Null]",Ue="[object Object]",ze="[object Promise]",Ne="[object Proxy]",Xe="[object RegExp]",gt="[object Set]",It="[object String]",zt="[object Symbol]",ln="[object Undefined]",le="[object WeakMap]",Ce="[object WeakSet]",Le="[object ArrayBuffer]",qe="[object DataView]",dt="[object Float32Array]",rn="[object Float64Array]",on="[object Int8Array]",fn="[object Int16Array]",zn="[object Int32Array]",wr="[object Uint8Array]",hn="[object Uint8ClampedArray]",nr="[object Uint16Array]",Tn="[object Uint32Array]",Oc=/\b__p \+= '';/g,ai=/\b(__p \+=) '' \+/g,Is=/(__e\(.*?\)|\b__t\)) \+\n'';/g,jn=/&(?:amp|lt|gt|quot|#39);/g,ko=/[&<>"']/g,li=RegExp(jn.source),Ns=RegExp(ko.source),$c=/<%-([\s\S]+?)%>/g,Ls=/<%([\s\S]+?)%>/g,Za=/<%=([\s\S]+?)%>/g,Fs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,zs=/^\w*$/,Dc=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,js=/[\\^$.*+?()[\]{}|]/g,Bs=RegExp(js.source),Vs=/^\s+/,Tc=/\s/,kc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Mc=/\{\n\/\* \[wrapped with (.+)\] \*/,P=/,? & /,K=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ae=/[()=,{}\[\]\/\s]/,Se=/\\(\\)?/g,je=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ve=/\w*$/,Ae=/^[-+]0x[0-9a-f]+$/i,ke=/^0b[01]+$/i,Et=/^\[object .+?Constructor\]$/,et=/^0o[0-7]+$/i,rt=/^(?:0|[1-9]\d*)$/,jt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Rn=/($^)/,Hs=/['\n\r\u2028\u2029\\]/g,tn="\\ud800-\\udfff",a5="\\u0300-\\u036f",l5="\\ufe20-\\ufe2f",c5="\\u20d0-\\u20ff",O1=a5+l5+c5,$1="\\u2700-\\u27bf",D1="a-z\\xdf-\\xf6\\xf8-\\xff",u5="\\xac\\xb1\\xd7\\xf7",d5="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",f5="\\u2000-\\u206f",h5=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",T1="A-Z\\xc0-\\xd6\\xd8-\\xde",k1="\\ufe0e\\ufe0f",M1=u5+d5+f5+h5,um="['’]",p5="["+tn+"]",A1="["+M1+"]",ff="["+O1+"]",I1="\\d+",g5="["+$1+"]",N1="["+D1+"]",L1="[^"+tn+M1+I1+$1+D1+T1+"]",dm="\\ud83c[\\udffb-\\udfff]",m5="(?:"+ff+"|"+dm+")",F1="[^"+tn+"]",fm="(?:\\ud83c[\\udde6-\\uddff]){2}",hm="[\\ud800-\\udbff][\\udc00-\\udfff]",el="["+T1+"]",z1="\\u200d",j1="(?:"+N1+"|"+L1+")",v5="(?:"+el+"|"+L1+")",B1="(?:"+um+"(?:d|ll|m|re|s|t|ve))?",V1="(?:"+um+"(?:D|LL|M|RE|S|T|VE))?",H1=m5+"?",W1="["+k1+"]?",b5="(?:"+z1+"(?:"+[F1,fm,hm].join("|")+")"+W1+H1+")*",y5="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",x5="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",U1=W1+H1+b5,w5="(?:"+[g5,fm,hm].join("|")+")"+U1,_5="(?:"+[F1+ff+"?",ff,fm,hm,p5].join("|")+")",S5=RegExp(um,"g"),C5=RegExp(ff,"g"),pm=RegExp(dm+"(?="+dm+")|"+_5+U1,"g"),E5=RegExp([el+"?"+N1+"+"+B1+"(?="+[A1,el,"$"].join("|")+")",v5+"+"+V1+"(?="+[A1,el+j1,"$"].join("|")+")",el+"?"+j1+"+"+B1,el+"+"+V1,x5,y5,I1,w5].join("|"),"g"),R5=RegExp("["+z1+tn+O1+k1+"]"),P5=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,O5=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$5=-1,Gt={};Gt[dt]=Gt[rn]=Gt[on]=Gt[fn]=Gt[zn]=Gt[wr]=Gt[hn]=Gt[nr]=Gt[Tn]=!0,Gt[ge]=Gt[he]=Gt[Le]=Gt[oe]=Gt[qe]=Gt[Z]=Gt[ye]=Gt[W]=Gt[_e]=Gt[Pe]=Gt[Ue]=Gt[Xe]=Gt[gt]=Gt[It]=Gt[le]=!1;var Vt={};Vt[ge]=Vt[he]=Vt[Le]=Vt[qe]=Vt[oe]=Vt[Z]=Vt[dt]=Vt[rn]=Vt[on]=Vt[fn]=Vt[zn]=Vt[_e]=Vt[Pe]=Vt[Ue]=Vt[Xe]=Vt[gt]=Vt[It]=Vt[zt]=Vt[wr]=Vt[hn]=Vt[nr]=Vt[Tn]=!0,Vt[ye]=Vt[W]=Vt[le]=!1;var D5={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},T5={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},k5={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},M5={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},A5=parseFloat,I5=parseInt,q1=typeof as=="object"&&as&&as.Object===Object&&as,N5=typeof self=="object"&&self&&self.Object===Object&&self,kn=q1||N5||Function("return this")(),gm=t&&!t.nodeType&&t,Ws=gm&&!0&&e&&!e.nodeType&&e,G1=Ws&&Ws.exports===gm,mm=G1&&q1.process,Gr=function(){try{var Q=Ws&&Ws.require&&Ws.require("util").types;return Q||mm&&mm.binding&&mm.binding("util")}catch{}}(),Y1=Gr&&Gr.isArrayBuffer,K1=Gr&&Gr.isDate,X1=Gr&&Gr.isMap,Q1=Gr&&Gr.isRegExp,J1=Gr&&Gr.isSet,Z1=Gr&&Gr.isTypedArray;function _r(Q,pe,ue){switch(ue.length){case 0:return Q.call(pe);case 1:return Q.call(pe,ue[0]);case 2:return Q.call(pe,ue[0],ue[1]);case 3:return Q.call(pe,ue[0],ue[1],ue[2])}return Q.apply(pe,ue)}function L5(Q,pe,ue,Fe){for(var nt=-1,Ot=Q==null?0:Q.length;++nt<Ot;){var xn=Q[nt];pe(Fe,xn,ue(xn),Q)}return Fe}function Yr(Q,pe){for(var ue=-1,Fe=Q==null?0:Q.length;++ue<Fe&&pe(Q[ue],ue,Q)!==!1;);return Q}function F5(Q,pe){for(var ue=Q==null?0:Q.length;ue--&&pe(Q[ue],ue,Q)!==!1;);return Q}function e_(Q,pe){for(var ue=-1,Fe=Q==null?0:Q.length;++ue<Fe;)if(!pe(Q[ue],ue,Q))return!1;return!0}function Vi(Q,pe){for(var ue=-1,Fe=Q==null?0:Q.length,nt=0,Ot=[];++ue<Fe;){var xn=Q[ue];pe(xn,ue,Q)&&(Ot[nt++]=xn)}return Ot}function hf(Q,pe){var ue=Q==null?0:Q.length;return!!ue&&tl(Q,pe,0)>-1}function vm(Q,pe,ue){for(var Fe=-1,nt=Q==null?0:Q.length;++Fe<nt;)if(ue(pe,Q[Fe]))return!0;return!1}function nn(Q,pe){for(var ue=-1,Fe=Q==null?0:Q.length,nt=Array(Fe);++ue<Fe;)nt[ue]=pe(Q[ue],ue,Q);return nt}function Hi(Q,pe){for(var ue=-1,Fe=pe.length,nt=Q.length;++ue<Fe;)Q[nt+ue]=pe[ue];return Q}function bm(Q,pe,ue,Fe){var nt=-1,Ot=Q==null?0:Q.length;for(Fe&&Ot&&(ue=Q[++nt]);++nt<Ot;)ue=pe(ue,Q[nt],nt,Q);return ue}function z5(Q,pe,ue,Fe){var nt=Q==null?0:Q.length;for(Fe&&nt&&(ue=Q[--nt]);nt--;)ue=pe(ue,Q[nt],nt,Q);return ue}function ym(Q,pe){for(var ue=-1,Fe=Q==null?0:Q.length;++ue<Fe;)if(pe(Q[ue],ue,Q))return!0;return!1}var j5=xm("length");function B5(Q){return Q.split("")}function V5(Q){return Q.match(K)||[]}function t_(Q,pe,ue){var Fe;return ue(Q,function(nt,Ot,xn){if(pe(nt,Ot,xn))return Fe=Ot,!1}),Fe}function pf(Q,pe,ue,Fe){for(var nt=Q.length,Ot=ue+(Fe?1:-1);Fe?Ot--:++Ot<nt;)if(pe(Q[Ot],Ot,Q))return Ot;return-1}function tl(Q,pe,ue){return pe===pe?eN(Q,pe,ue):pf(Q,n_,ue)}function H5(Q,pe,ue,Fe){for(var nt=ue-1,Ot=Q.length;++nt<Ot;)if(Fe(Q[nt],pe))return nt;return-1}function n_(Q){return Q!==Q}function r_(Q,pe){var ue=Q==null?0:Q.length;return ue?_m(Q,pe)/ue:$}function xm(Q){return function(pe){return pe==null?n:pe[Q]}}function wm(Q){return function(pe){return Q==null?n:Q[pe]}}function o_(Q,pe,ue,Fe,nt){return nt(Q,function(Ot,xn,Bt){ue=Fe?(Fe=!1,Ot):pe(ue,Ot,xn,Bt)}),ue}function W5(Q,pe){var ue=Q.length;for(Q.sort(pe);ue--;)Q[ue]=Q[ue].value;return Q}function _m(Q,pe){for(var ue,Fe=-1,nt=Q.length;++Fe<nt;){var Ot=pe(Q[Fe]);Ot!==n&&(ue=ue===n?Ot:ue+Ot)}return ue}function Sm(Q,pe){for(var ue=-1,Fe=Array(Q);++ue<Q;)Fe[ue]=pe(ue);return Fe}function U5(Q,pe){return nn(pe,function(ue){return[ue,Q[ue]]})}function i_(Q){return Q&&Q.slice(0,c_(Q)+1).replace(Vs,"")}function Sr(Q){return function(pe){return Q(pe)}}function Cm(Q,pe){return nn(pe,function(ue){return Q[ue]})}function Ac(Q,pe){return Q.has(pe)}function s_(Q,pe){for(var ue=-1,Fe=Q.length;++ue<Fe&&tl(pe,Q[ue],0)>-1;);return ue}function a_(Q,pe){for(var ue=Q.length;ue--&&tl(pe,Q[ue],0)>-1;);return ue}function q5(Q,pe){for(var ue=Q.length,Fe=0;ue--;)Q[ue]===pe&&++Fe;return Fe}var G5=wm(D5),Y5=wm(T5);function K5(Q){return"\\"+M5[Q]}function X5(Q,pe){return Q==null?n:Q[pe]}function nl(Q){return R5.test(Q)}function Q5(Q){return P5.test(Q)}function J5(Q){for(var pe,ue=[];!(pe=Q.next()).done;)ue.push(pe.value);return ue}function Em(Q){var pe=-1,ue=Array(Q.size);return Q.forEach(function(Fe,nt){ue[++pe]=[nt,Fe]}),ue}function l_(Q,pe){return function(ue){return Q(pe(ue))}}function Wi(Q,pe){for(var ue=-1,Fe=Q.length,nt=0,Ot=[];++ue<Fe;){var xn=Q[ue];(xn===pe||xn===u)&&(Q[ue]=u,Ot[nt++]=ue)}return Ot}function gf(Q){var pe=-1,ue=Array(Q.size);return Q.forEach(function(Fe){ue[++pe]=Fe}),ue}function Z5(Q){var pe=-1,ue=Array(Q.size);return Q.forEach(function(Fe){ue[++pe]=[Fe,Fe]}),ue}function eN(Q,pe,ue){for(var Fe=ue-1,nt=Q.length;++Fe<nt;)if(Q[Fe]===pe)return Fe;return-1}function tN(Q,pe,ue){for(var Fe=ue+1;Fe--;)if(Q[Fe]===pe)return Fe;return Fe}function rl(Q){return nl(Q)?rN(Q):j5(Q)}function mo(Q){return nl(Q)?oN(Q):B5(Q)}function c_(Q){for(var pe=Q.length;pe--&&Tc.test(Q.charAt(pe)););return pe}var nN=wm(k5);function rN(Q){for(var pe=pm.lastIndex=0;pm.test(Q);)++pe;return pe}function oN(Q){return Q.match(pm)||[]}function iN(Q){return Q.match(E5)||[]}var sN=function Q(pe){pe=pe==null?kn:ol.defaults(kn.Object(),pe,ol.pick(kn,O5));var ue=pe.Array,Fe=pe.Date,nt=pe.Error,Ot=pe.Function,xn=pe.Math,Bt=pe.Object,Rm=pe.RegExp,aN=pe.String,Kr=pe.TypeError,mf=ue.prototype,lN=Ot.prototype,il=Bt.prototype,vf=pe["__core-js_shared__"],bf=lN.toString,Nt=il.hasOwnProperty,cN=0,u_=function(){var d=/[^.]+$/.exec(vf&&vf.keys&&vf.keys.IE_PROTO||"");return d?"Symbol(src)_1."+d:""}(),yf=il.toString,uN=bf.call(Bt),dN=kn._,fN=Rm("^"+bf.call(Nt).replace(js,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),xf=G1?pe.Buffer:n,Ui=pe.Symbol,wf=pe.Uint8Array,d_=xf?xf.allocUnsafe:n,_f=l_(Bt.getPrototypeOf,Bt),f_=Bt.create,h_=il.propertyIsEnumerable,Sf=mf.splice,p_=Ui?Ui.isConcatSpreadable:n,Ic=Ui?Ui.iterator:n,Us=Ui?Ui.toStringTag:n,Cf=function(){try{var d=Xs(Bt,"defineProperty");return d({},"",{}),d}catch{}}(),hN=pe.clearTimeout!==kn.clearTimeout&&pe.clearTimeout,pN=Fe&&Fe.now!==kn.Date.now&&Fe.now,gN=pe.setTimeout!==kn.setTimeout&&pe.setTimeout,Ef=xn.ceil,Rf=xn.floor,Pm=Bt.getOwnPropertySymbols,mN=xf?xf.isBuffer:n,g_=pe.isFinite,vN=mf.join,bN=l_(Bt.keys,Bt),wn=xn.max,Bn=xn.min,yN=Fe.now,xN=pe.parseInt,m_=xn.random,wN=mf.reverse,Om=Xs(pe,"DataView"),Nc=Xs(pe,"Map"),$m=Xs(pe,"Promise"),sl=Xs(pe,"Set"),Lc=Xs(pe,"WeakMap"),Fc=Xs(Bt,"create"),Pf=Lc&&new Lc,al={},_N=Qs(Om),SN=Qs(Nc),CN=Qs($m),EN=Qs(sl),RN=Qs(Lc),Of=Ui?Ui.prototype:n,zc=Of?Of.valueOf:n,v_=Of?Of.toString:n;function A(d){if(cn(d)&&!ot(d)&&!(d instanceof St)){if(d instanceof Xr)return d;if(Nt.call(d,"__wrapped__"))return bS(d)}return new Xr(d)}var ll=function(){function d(){}return function(h){if(!sn(h))return{};if(f_)return f_(h);d.prototype=h;var b=new d;return d.prototype=n,b}}();function $f(){}function Xr(d,h){this.__wrapped__=d,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=n}A.templateSettings={escape:$c,evaluate:Ls,interpolate:Za,variable:"",imports:{_:A}},A.prototype=$f.prototype,A.prototype.constructor=A,Xr.prototype=ll($f.prototype),Xr.prototype.constructor=Xr;function St(d){this.__wrapped__=d,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=H,this.__views__=[]}function PN(){var d=new St(this.__wrapped__);return d.__actions__=rr(this.__actions__),d.__dir__=this.__dir__,d.__filtered__=this.__filtered__,d.__iteratees__=rr(this.__iteratees__),d.__takeCount__=this.__takeCount__,d.__views__=rr(this.__views__),d}function ON(){if(this.__filtered__){var d=new St(this);d.__dir__=-1,d.__filtered__=!0}else d=this.clone(),d.__dir__*=-1;return d}function $N(){var d=this.__wrapped__.value(),h=this.__dir__,b=ot(d),C=h<0,D=b?d.length:0,L=B3(0,D,this.__views__),V=L.start,U=L.end,te=U-V,ve=C?U:V-1,be=this.__iteratees__,we=be.length,Me=0,Be=Bn(te,this.__takeCount__);if(!b||!C&&D==te&&Be==te)return B_(d,this.__actions__);var Ye=[];e:for(;te--&&Me<Be;){ve+=h;for(var ft=-1,Ke=d[ve];++ft<we;){var wt=be[ft],Ct=wt.iteratee,Rr=wt.type,Jn=Ct(Ke);if(Rr==j)Ke=Jn;else if(!Jn){if(Rr==G)continue e;break e}}Ye[Me++]=Ke}return Ye}St.prototype=ll($f.prototype),St.prototype.constructor=St;function qs(d){var h=-1,b=d==null?0:d.length;for(this.clear();++h<b;){var C=d[h];this.set(C[0],C[1])}}function DN(){this.__data__=Fc?Fc(null):{},this.size=0}function TN(d){var h=this.has(d)&&delete this.__data__[d];return this.size-=h?1:0,h}function kN(d){var h=this.__data__;if(Fc){var b=h[d];return b===l?n:b}return Nt.call(h,d)?h[d]:n}function MN(d){var h=this.__data__;return Fc?h[d]!==n:Nt.call(h,d)}function AN(d,h){var b=this.__data__;return this.size+=this.has(d)?0:1,b[d]=Fc&&h===n?l:h,this}qs.prototype.clear=DN,qs.prototype.delete=TN,qs.prototype.get=kN,qs.prototype.has=MN,qs.prototype.set=AN;function ci(d){var h=-1,b=d==null?0:d.length;for(this.clear();++h<b;){var C=d[h];this.set(C[0],C[1])}}function IN(){this.__data__=[],this.size=0}function NN(d){var h=this.__data__,b=Df(h,d);if(b<0)return!1;var C=h.length-1;return b==C?h.pop():Sf.call(h,b,1),--this.size,!0}function LN(d){var h=this.__data__,b=Df(h,d);return b<0?n:h[b][1]}function FN(d){return Df(this.__data__,d)>-1}function zN(d,h){var b=this.__data__,C=Df(b,d);return C<0?(++this.size,b.push([d,h])):b[C][1]=h,this}ci.prototype.clear=IN,ci.prototype.delete=NN,ci.prototype.get=LN,ci.prototype.has=FN,ci.prototype.set=zN;function ui(d){var h=-1,b=d==null?0:d.length;for(this.clear();++h<b;){var C=d[h];this.set(C[0],C[1])}}function jN(){this.size=0,this.__data__={hash:new qs,map:new(Nc||ci),string:new qs}}function BN(d){var h=Vf(this,d).delete(d);return this.size-=h?1:0,h}function VN(d){return Vf(this,d).get(d)}function HN(d){return Vf(this,d).has(d)}function WN(d,h){var b=Vf(this,d),C=b.size;return b.set(d,h),this.size+=b.size==C?0:1,this}ui.prototype.clear=jN,ui.prototype.delete=BN,ui.prototype.get=VN,ui.prototype.has=HN,ui.prototype.set=WN;function Gs(d){var h=-1,b=d==null?0:d.length;for(this.__data__=new ui;++h<b;)this.add(d[h])}function UN(d){return this.__data__.set(d,l),this}function qN(d){return this.__data__.has(d)}Gs.prototype.add=Gs.prototype.push=UN,Gs.prototype.has=qN;function vo(d){var h=this.__data__=new ci(d);this.size=h.size}function GN(){this.__data__=new ci,this.size=0}function YN(d){var h=this.__data__,b=h.delete(d);return this.size=h.size,b}function KN(d){return this.__data__.get(d)}function XN(d){return this.__data__.has(d)}function QN(d,h){var b=this.__data__;if(b instanceof ci){var C=b.__data__;if(!Nc||C.length<o-1)return C.push([d,h]),this.size=++b.size,this;b=this.__data__=new ui(C)}return b.set(d,h),this.size=b.size,this}vo.prototype.clear=GN,vo.prototype.delete=YN,vo.prototype.get=KN,vo.prototype.has=XN,vo.prototype.set=QN;function b_(d,h){var b=ot(d),C=!b&&Js(d),D=!b&&!C&&Xi(d),L=!b&&!C&&!D&&fl(d),V=b||C||D||L,U=V?Sm(d.length,aN):[],te=U.length;for(var ve in d)(h||Nt.call(d,ve))&&!(V&&(ve=="length"||D&&(ve=="offset"||ve=="parent")||L&&(ve=="buffer"||ve=="byteLength"||ve=="byteOffset")||pi(ve,te)))&&U.push(ve);return U}function y_(d){var h=d.length;return h?d[jm(0,h-1)]:n}function JN(d,h){return Hf(rr(d),Ys(h,0,d.length))}function ZN(d){return Hf(rr(d))}function Dm(d,h,b){(b!==n&&!bo(d[h],b)||b===n&&!(h in d))&&di(d,h,b)}function jc(d,h,b){var C=d[h];(!(Nt.call(d,h)&&bo(C,b))||b===n&&!(h in d))&&di(d,h,b)}function Df(d,h){for(var b=d.length;b--;)if(bo(d[b][0],h))return b;return-1}function e3(d,h,b,C){return qi(d,function(D,L,V){h(C,D,b(D),V)}),C}function x_(d,h){return d&&Ao(h,Pn(h),d)}function t3(d,h){return d&&Ao(h,ir(h),d)}function di(d,h,b){h=="__proto__"&&Cf?Cf(d,h,{configurable:!0,enumerable:!0,value:b,writable:!0}):d[h]=b}function Tm(d,h){for(var b=-1,C=h.length,D=ue(C),L=d==null;++b<C;)D[b]=L?n:dv(d,h[b]);return D}function Ys(d,h,b){return d===d&&(b!==n&&(d=d<=b?d:b),h!==n&&(d=d>=h?d:h)),d}function Qr(d,h,b,C,D,L){var V,U=h&f,te=h&g,ve=h&p;if(b&&(V=D?b(d,C,D,L):b(d)),V!==n)return V;if(!sn(d))return d;var be=ot(d);if(be){if(V=H3(d),!U)return rr(d,V)}else{var we=Vn(d),Me=we==W||we==me;if(Xi(d))return W_(d,U);if(we==Ue||we==ge||Me&&!D){if(V=te||Me?{}:cS(d),!U)return te?k3(d,t3(V,d)):T3(d,x_(V,d))}else{if(!Vt[we])return D?d:{};V=W3(d,we,U)}}L||(L=new vo);var Be=L.get(d);if(Be)return Be;L.set(d,V),FS(d)?d.forEach(function(Ke){V.add(Qr(Ke,h,b,Ke,d,L))}):NS(d)&&d.forEach(function(Ke,wt){V.set(wt,Qr(Ke,h,b,wt,d,L))});var Ye=ve?te?Qm:Xm:te?ir:Pn,ft=be?n:Ye(d);return Yr(ft||d,function(Ke,wt){ft&&(wt=Ke,Ke=d[wt]),jc(V,wt,Qr(Ke,h,b,wt,d,L))}),V}function n3(d){var h=Pn(d);return function(b){return w_(b,d,h)}}function w_(d,h,b){var C=b.length;if(d==null)return!C;for(d=Bt(d);C--;){var D=b[C],L=h[D],V=d[D];if(V===n&&!(D in d)||!L(V))return!1}return!0}function __(d,h,b){if(typeof d!="function")throw new Kr(s);return Gc(function(){d.apply(n,b)},h)}function Bc(d,h,b,C){var D=-1,L=hf,V=!0,U=d.length,te=[],ve=h.length;if(!U)return te;b&&(h=nn(h,Sr(b))),C?(L=vm,V=!1):h.length>=o&&(L=Ac,V=!1,h=new Gs(h));e:for(;++D<U;){var be=d[D],we=b==null?be:b(be);if(be=C||be!==0?be:0,V&&we===we){for(var Me=ve;Me--;)if(h[Me]===we)continue e;te.push(be)}else L(h,we,C)||te.push(be)}return te}var qi=K_(Mo),S_=K_(Mm,!0);function r3(d,h){var b=!0;return qi(d,function(C,D,L){return b=!!h(C,D,L),b}),b}function Tf(d,h,b){for(var C=-1,D=d.length;++C<D;){var L=d[C],V=h(L);if(V!=null&&(U===n?V===V&&!Er(V):b(V,U)))var U=V,te=L}return te}function o3(d,h,b,C){var D=d.length;for(b=at(b),b<0&&(b=-b>D?0:D+b),C=C===n||C>D?D:at(C),C<0&&(C+=D),C=b>C?0:jS(C);b<C;)d[b++]=h;return d}function C_(d,h){var b=[];return qi(d,function(C,D,L){h(C,D,L)&&b.push(C)}),b}function Mn(d,h,b,C,D){var L=-1,V=d.length;for(b||(b=q3),D||(D=[]);++L<V;){var U=d[L];h>0&&b(U)?h>1?Mn(U,h-1,b,C,D):Hi(D,U):C||(D[D.length]=U)}return D}var km=X_(),E_=X_(!0);function Mo(d,h){return d&&km(d,h,Pn)}function Mm(d,h){return d&&E_(d,h,Pn)}function kf(d,h){return Vi(h,function(b){return gi(d[b])})}function Ks(d,h){h=Yi(h,d);for(var b=0,C=h.length;d!=null&&b<C;)d=d[Io(h[b++])];return b&&b==C?d:n}function R_(d,h,b){var C=h(d);return ot(d)?C:Hi(C,b(d))}function Xn(d){return d==null?d===n?ln:$e:Us&&Us in Bt(d)?j3(d):Z3(d)}function Am(d,h){return d>h}function i3(d,h){return d!=null&&Nt.call(d,h)}function s3(d,h){return d!=null&&h in Bt(d)}function a3(d,h,b){return d>=Bn(h,b)&&d<wn(h,b)}function Im(d,h,b){for(var C=b?vm:hf,D=d[0].length,L=d.length,V=L,U=ue(L),te=1/0,ve=[];V--;){var be=d[V];V&&h&&(be=nn(be,Sr(h))),te=Bn(be.length,te),U[V]=!b&&(h||D>=120&&be.length>=120)?new Gs(V&&be):n}be=d[0];var we=-1,Me=U[0];e:for(;++we<D&&ve.length<te;){var Be=be[we],Ye=h?h(Be):Be;if(Be=b||Be!==0?Be:0,!(Me?Ac(Me,Ye):C(ve,Ye,b))){for(V=L;--V;){var ft=U[V];if(!(ft?Ac(ft,Ye):C(d[V],Ye,b)))continue e}Me&&Me.push(Ye),ve.push(Be)}}return ve}function l3(d,h,b,C){return Mo(d,function(D,L,V){h(C,b(D),L,V)}),C}function Vc(d,h,b){h=Yi(h,d),d=hS(d,h);var C=d==null?d:d[Io(Zr(h))];return C==null?n:_r(C,d,b)}function P_(d){return cn(d)&&Xn(d)==ge}function c3(d){return cn(d)&&Xn(d)==Le}function u3(d){return cn(d)&&Xn(d)==Z}function Hc(d,h,b,C,D){return d===h?!0:d==null||h==null||!cn(d)&&!cn(h)?d!==d&&h!==h:d3(d,h,b,C,Hc,D)}function d3(d,h,b,C,D,L){var V=ot(d),U=ot(h),te=V?he:Vn(d),ve=U?he:Vn(h);te=te==ge?Ue:te,ve=ve==ge?Ue:ve;var be=te==Ue,we=ve==Ue,Me=te==ve;if(Me&&Xi(d)){if(!Xi(h))return!1;V=!0,be=!1}if(Me&&!be)return L||(L=new vo),V||fl(d)?sS(d,h,b,C,D,L):F3(d,h,te,b,C,D,L);if(!(b&v)){var Be=be&&Nt.call(d,"__wrapped__"),Ye=we&&Nt.call(h,"__wrapped__");if(Be||Ye){var ft=Be?d.value():d,Ke=Ye?h.value():h;return L||(L=new vo),D(ft,Ke,b,C,L)}}return Me?(L||(L=new vo),z3(d,h,b,C,D,L)):!1}function f3(d){return cn(d)&&Vn(d)==_e}function Nm(d,h,b,C){var D=b.length,L=D,V=!C;if(d==null)return!L;for(d=Bt(d);D--;){var U=b[D];if(V&&U[2]?U[1]!==d[U[0]]:!(U[0]in d))return!1}for(;++D<L;){U=b[D];var te=U[0],ve=d[te],be=U[1];if(V&&U[2]){if(ve===n&&!(te in d))return!1}else{var we=new vo;if(C)var Me=C(ve,be,te,d,h,we);if(!(Me===n?Hc(be,ve,v|y,C,we):Me))return!1}}return!0}function O_(d){if(!sn(d)||Y3(d))return!1;var h=gi(d)?fN:Et;return h.test(Qs(d))}function h3(d){return cn(d)&&Xn(d)==Xe}function p3(d){return cn(d)&&Vn(d)==gt}function g3(d){return cn(d)&&Kf(d.length)&&!!Gt[Xn(d)]}function $_(d){return typeof d=="function"?d:d==null?sr:typeof d=="object"?ot(d)?k_(d[0],d[1]):T_(d):QS(d)}function Lm(d){if(!qc(d))return bN(d);var h=[];for(var b in Bt(d))Nt.call(d,b)&&b!="constructor"&&h.push(b);return h}function m3(d){if(!sn(d))return J3(d);var h=qc(d),b=[];for(var C in d)C=="constructor"&&(h||!Nt.call(d,C))||b.push(C);return b}function Fm(d,h){return d<h}function D_(d,h){var b=-1,C=or(d)?ue(d.length):[];return qi(d,function(D,L,V){C[++b]=h(D,L,V)}),C}function T_(d){var h=Zm(d);return h.length==1&&h[0][2]?dS(h[0][0],h[0][1]):function(b){return b===d||Nm(b,d,h)}}function k_(d,h){return tv(d)&&uS(h)?dS(Io(d),h):function(b){var C=dv(b,d);return C===n&&C===h?fv(b,d):Hc(h,C,v|y)}}function Mf(d,h,b,C,D){d!==h&&km(h,function(L,V){if(D||(D=new vo),sn(L))v3(d,h,V,b,Mf,C,D);else{var U=C?C(rv(d,V),L,V+"",d,h,D):n;U===n&&(U=L),Dm(d,V,U)}},ir)}function v3(d,h,b,C,D,L,V){var U=rv(d,b),te=rv(h,b),ve=V.get(te);if(ve){Dm(d,b,ve);return}var be=L?L(U,te,b+"",d,h,V):n,we=be===n;if(we){var Me=ot(te),Be=!Me&&Xi(te),Ye=!Me&&!Be&&fl(te);be=te,Me||Be||Ye?ot(U)?be=U:pn(U)?be=rr(U):Be?(we=!1,be=W_(te,!0)):Ye?(we=!1,be=U_(te,!0)):be=[]:Yc(te)||Js(te)?(be=U,Js(U)?be=BS(U):(!sn(U)||gi(U))&&(be=cS(te))):we=!1}we&&(V.set(te,be),D(be,te,C,L,V),V.delete(te)),Dm(d,b,be)}function M_(d,h){var b=d.length;if(b)return h+=h<0?b:0,pi(h,b)?d[h]:n}function A_(d,h,b){h.length?h=nn(h,function(L){return ot(L)?function(V){return Ks(V,L.length===1?L[0]:L)}:L}):h=[sr];var C=-1;h=nn(h,Sr(Ge()));var D=D_(d,function(L,V,U){var te=nn(h,function(ve){return ve(L)});return{criteria:te,index:++C,value:L}});return W5(D,function(L,V){return D3(L,V,b)})}function b3(d,h){return I_(d,h,function(b,C){return fv(d,C)})}function I_(d,h,b){for(var C=-1,D=h.length,L={};++C<D;){var V=h[C],U=Ks(d,V);b(U,V)&&Wc(L,Yi(V,d),U)}return L}function y3(d){return function(h){return Ks(h,d)}}function zm(d,h,b,C){var D=C?H5:tl,L=-1,V=h.length,U=d;for(d===h&&(h=rr(h)),b&&(U=nn(d,Sr(b)));++L<V;)for(var te=0,ve=h[L],be=b?b(ve):ve;(te=D(U,be,te,C))>-1;)U!==d&&Sf.call(U,te,1),Sf.call(d,te,1);return d}function N_(d,h){for(var b=d?h.length:0,C=b-1;b--;){var D=h[b];if(b==C||D!==L){var L=D;pi(D)?Sf.call(d,D,1):Hm(d,D)}}return d}function jm(d,h){return d+Rf(m_()*(h-d+1))}function x3(d,h,b,C){for(var D=-1,L=wn(Ef((h-d)/(b||1)),0),V=ue(L);L--;)V[C?L:++D]=d,d+=b;return V}function Bm(d,h){var b="";if(!d||h<1||h>X)return b;do h%2&&(b+=d),h=Rf(h/2),h&&(d+=d);while(h);return b}function mt(d,h){return ov(fS(d,h,sr),d+"")}function w3(d){return y_(hl(d))}function _3(d,h){var b=hl(d);return Hf(b,Ys(h,0,b.length))}function Wc(d,h,b,C){if(!sn(d))return d;h=Yi(h,d);for(var D=-1,L=h.length,V=L-1,U=d;U!=null&&++D<L;){var te=Io(h[D]),ve=b;if(te==="__proto__"||te==="constructor"||te==="prototype")return d;if(D!=V){var be=U[te];ve=C?C(be,te,U):n,ve===n&&(ve=sn(be)?be:pi(h[D+1])?[]:{})}jc(U,te,ve),U=U[te]}return d}var L_=Pf?function(d,h){return Pf.set(d,h),d}:sr,S3=Cf?function(d,h){return Cf(d,"toString",{configurable:!0,enumerable:!1,value:pv(h),writable:!0})}:sr;function C3(d){return Hf(hl(d))}function Jr(d,h,b){var C=-1,D=d.length;h<0&&(h=-h>D?0:D+h),b=b>D?D:b,b<0&&(b+=D),D=h>b?0:b-h>>>0,h>>>=0;for(var L=ue(D);++C<D;)L[C]=d[C+h];return L}function E3(d,h){var b;return qi(d,function(C,D,L){return b=h(C,D,L),!b}),!!b}function Af(d,h,b){var C=0,D=d==null?C:d.length;if(typeof h=="number"&&h===h&&D<=I){for(;C<D;){var L=C+D>>>1,V=d[L];V!==null&&!Er(V)&&(b?V<=h:V<h)?C=L+1:D=L}return D}return Vm(d,h,sr,b)}function Vm(d,h,b,C){var D=0,L=d==null?0:d.length;if(L===0)return 0;h=b(h);for(var V=h!==h,U=h===null,te=Er(h),ve=h===n;D<L;){var be=Rf((D+L)/2),we=b(d[be]),Me=we!==n,Be=we===null,Ye=we===we,ft=Er(we);if(V)var Ke=C||Ye;else ve?Ke=Ye&&(C||Me):U?Ke=Ye&&Me&&(C||!Be):te?Ke=Ye&&Me&&!Be&&(C||!ft):Be||ft?Ke=!1:Ke=C?we<=h:we<h;Ke?D=be+1:L=be}return Bn(L,ne)}function F_(d,h){for(var b=-1,C=d.length,D=0,L=[];++b<C;){var V=d[b],U=h?h(V):V;if(!b||!bo(U,te)){var te=U;L[D++]=V===0?0:V}}return L}function z_(d){return typeof d=="number"?d:Er(d)?$:+d}function Cr(d){if(typeof d=="string")return d;if(ot(d))return nn(d,Cr)+"";if(Er(d))return v_?v_.call(d):"";var h=d+"";return h=="0"&&1/d==-q?"-0":h}function Gi(d,h,b){var C=-1,D=hf,L=d.length,V=!0,U=[],te=U;if(b)V=!1,D=vm;else if(L>=o){var ve=h?null:N3(d);if(ve)return gf(ve);V=!1,D=Ac,te=new Gs}else te=h?[]:U;e:for(;++C<L;){var be=d[C],we=h?h(be):be;if(be=b||be!==0?be:0,V&&we===we){for(var Me=te.length;Me--;)if(te[Me]===we)continue e;h&&te.push(we),U.push(be)}else D(te,we,b)||(te!==U&&te.push(we),U.push(be))}return U}function Hm(d,h){return h=Yi(h,d),d=hS(d,h),d==null||delete d[Io(Zr(h))]}function j_(d,h,b,C){return Wc(d,h,b(Ks(d,h)),C)}function If(d,h,b,C){for(var D=d.length,L=C?D:-1;(C?L--:++L<D)&&h(d[L],L,d););return b?Jr(d,C?0:L,C?L+1:D):Jr(d,C?L+1:0,C?D:L)}function B_(d,h){var b=d;return b instanceof St&&(b=b.value()),bm(h,function(C,D){return D.func.apply(D.thisArg,Hi([C],D.args))},b)}function Wm(d,h,b){var C=d.length;if(C<2)return C?Gi(d[0]):[];for(var D=-1,L=ue(C);++D<C;)for(var V=d[D],U=-1;++U<C;)U!=D&&(L[D]=Bc(L[D]||V,d[U],h,b));return Gi(Mn(L,1),h,b)}function V_(d,h,b){for(var C=-1,D=d.length,L=h.length,V={};++C<D;){var U=C<L?h[C]:n;b(V,d[C],U)}return V}function Um(d){return pn(d)?d:[]}function qm(d){return typeof d=="function"?d:sr}function Yi(d,h){return ot(d)?d:tv(d,h)?[d]:vS(Tt(d))}var R3=mt;function Ki(d,h,b){var C=d.length;return b=b===n?C:b,!h&&b>=C?d:Jr(d,h,b)}var H_=hN||function(d){return kn.clearTimeout(d)};function W_(d,h){if(h)return d.slice();var b=d.length,C=d_?d_(b):new d.constructor(b);return d.copy(C),C}function Gm(d){var h=new d.constructor(d.byteLength);return new wf(h).set(new wf(d)),h}function P3(d,h){var b=h?Gm(d.buffer):d.buffer;return new d.constructor(b,d.byteOffset,d.byteLength)}function O3(d){var h=new d.constructor(d.source,Ve.exec(d));return h.lastIndex=d.lastIndex,h}function $3(d){return zc?Bt(zc.call(d)):{}}function U_(d,h){var b=h?Gm(d.buffer):d.buffer;return new d.constructor(b,d.byteOffset,d.length)}function q_(d,h){if(d!==h){var b=d!==n,C=d===null,D=d===d,L=Er(d),V=h!==n,U=h===null,te=h===h,ve=Er(h);if(!U&&!ve&&!L&&d>h||L&&V&&te&&!U&&!ve||C&&V&&te||!b&&te||!D)return 1;if(!C&&!L&&!ve&&d<h||ve&&b&&D&&!C&&!L||U&&b&&D||!V&&D||!te)return-1}return 0}function D3(d,h,b){for(var C=-1,D=d.criteria,L=h.criteria,V=D.length,U=b.length;++C<V;){var te=q_(D[C],L[C]);if(te){if(C>=U)return te;var ve=b[C];return te*(ve=="desc"?-1:1)}}return d.index-h.index}function G_(d,h,b,C){for(var D=-1,L=d.length,V=b.length,U=-1,te=h.length,ve=wn(L-V,0),be=ue(te+ve),we=!C;++U<te;)be[U]=h[U];for(;++D<V;)(we||D<L)&&(be[b[D]]=d[D]);for(;ve--;)be[U++]=d[D++];return be}function Y_(d,h,b,C){for(var D=-1,L=d.length,V=-1,U=b.length,te=-1,ve=h.length,be=wn(L-U,0),we=ue(be+ve),Me=!C;++D<be;)we[D]=d[D];for(var Be=D;++te<ve;)we[Be+te]=h[te];for(;++V<U;)(Me||D<L)&&(we[Be+b[V]]=d[D++]);return we}function rr(d,h){var b=-1,C=d.length;for(h||(h=ue(C));++b<C;)h[b]=d[b];return h}function Ao(d,h,b,C){var D=!b;b||(b={});for(var L=-1,V=h.length;++L<V;){var U=h[L],te=C?C(b[U],d[U],U,b,d):n;te===n&&(te=d[U]),D?di(b,U,te):jc(b,U,te)}return b}function T3(d,h){return Ao(d,ev(d),h)}function k3(d,h){return Ao(d,aS(d),h)}function Nf(d,h){return function(b,C){var D=ot(b)?L5:e3,L=h?h():{};return D(b,d,Ge(C,2),L)}}function cl(d){return mt(function(h,b){var C=-1,D=b.length,L=D>1?b[D-1]:n,V=D>2?b[2]:n;for(L=d.length>3&&typeof L=="function"?(D--,L):n,V&&Qn(b[0],b[1],V)&&(L=D<3?n:L,D=1),h=Bt(h);++C<D;){var U=b[C];U&&d(h,U,C,L)}return h})}function K_(d,h){return function(b,C){if(b==null)return b;if(!or(b))return d(b,C);for(var D=b.length,L=h?D:-1,V=Bt(b);(h?L--:++L<D)&&C(V[L],L,V)!==!1;);return b}}function X_(d){return function(h,b,C){for(var D=-1,L=Bt(h),V=C(h),U=V.length;U--;){var te=V[d?U:++D];if(b(L[te],te,L)===!1)break}return h}}function M3(d,h,b){var C=h&x,D=Uc(d);function L(){var V=this&&this!==kn&&this instanceof L?D:d;return V.apply(C?b:this,arguments)}return L}function Q_(d){return function(h){h=Tt(h);var b=nl(h)?mo(h):n,C=b?b[0]:h.charAt(0),D=b?Ki(b,1).join(""):h.slice(1);return C[d]()+D}}function ul(d){return function(h){return bm(KS(YS(h).replace(S5,"")),d,"")}}function Uc(d){return function(){var h=arguments;switch(h.length){case 0:return new d;case 1:return new d(h[0]);case 2:return new d(h[0],h[1]);case 3:return new d(h[0],h[1],h[2]);case 4:return new d(h[0],h[1],h[2],h[3]);case 5:return new d(h[0],h[1],h[2],h[3],h[4]);case 6:return new d(h[0],h[1],h[2],h[3],h[4],h[5]);case 7:return new d(h[0],h[1],h[2],h[3],h[4],h[5],h[6])}var b=ll(d.prototype),C=d.apply(b,h);return sn(C)?C:b}}function A3(d,h,b){var C=Uc(d);function D(){for(var L=arguments.length,V=ue(L),U=L,te=dl(D);U--;)V[U]=arguments[U];var ve=L<3&&V[0]!==te&&V[L-1]!==te?[]:Wi(V,te);if(L-=ve.length,L<b)return nS(d,h,Lf,D.placeholder,n,V,ve,n,n,b-L);var be=this&&this!==kn&&this instanceof D?C:d;return _r(be,this,V)}return D}function J_(d){return function(h,b,C){var D=Bt(h);if(!or(h)){var L=Ge(b,3);h=Pn(h),b=function(U){return L(D[U],U,D)}}var V=d(h,b,C);return V>-1?D[L?h[V]:V]:n}}function Z_(d){return hi(function(h){var b=h.length,C=b,D=Xr.prototype.thru;for(d&&h.reverse();C--;){var L=h[C];if(typeof L!="function")throw new Kr(s);if(D&&!V&&Bf(L)=="wrapper")var V=new Xr([],!0)}for(C=V?C:b;++C<b;){L=h[C];var U=Bf(L),te=U=="wrapper"?Jm(L):n;te&&nv(te[0])&&te[1]==(k|S|E|T)&&!te[4].length&&te[9]==1?V=V[Bf(te[0])].apply(V,te[3]):V=L.length==1&&nv(L)?V[U]():V.thru(L)}return function(){var ve=arguments,be=ve[0];if(V&&ve.length==1&&ot(be))return V.plant(be).value();for(var we=0,Me=b?h[we].apply(this,ve):be;++we<b;)Me=h[we].call(this,Me);return Me}})}function Lf(d,h,b,C,D,L,V,U,te,ve){var be=h&k,we=h&x,Me=h&w,Be=h&(S|R),Ye=h&M,ft=Me?n:Uc(d);function Ke(){for(var wt=arguments.length,Ct=ue(wt),Rr=wt;Rr--;)Ct[Rr]=arguments[Rr];if(Be)var Jn=dl(Ke),Pr=q5(Ct,Jn);if(C&&(Ct=G_(Ct,C,D,Be)),L&&(Ct=Y_(Ct,L,V,Be)),wt-=Pr,Be&&wt<ve){var gn=Wi(Ct,Jn);return nS(d,h,Lf,Ke.placeholder,b,Ct,gn,U,te,ve-wt)}var yo=we?b:this,vi=Me?yo[d]:d;return wt=Ct.length,U?Ct=eL(Ct,U):Ye&&wt>1&&Ct.reverse(),be&&te<wt&&(Ct.length=te),this&&this!==kn&&this instanceof Ke&&(vi=ft||Uc(vi)),vi.apply(yo,Ct)}return Ke}function eS(d,h){return function(b,C){return l3(b,d,h(C),{})}}function Ff(d,h){return function(b,C){var D;if(b===n&&C===n)return h;if(b!==n&&(D=b),C!==n){if(D===n)return C;typeof b=="string"||typeof C=="string"?(b=Cr(b),C=Cr(C)):(b=z_(b),C=z_(C)),D=d(b,C)}return D}}function Ym(d){return hi(function(h){return h=nn(h,Sr(Ge())),mt(function(b){var C=this;return d(h,function(D){return _r(D,C,b)})})})}function zf(d,h){h=h===n?" ":Cr(h);var b=h.length;if(b<2)return b?Bm(h,d):h;var C=Bm(h,Ef(d/rl(h)));return nl(h)?Ki(mo(C),0,d).join(""):C.slice(0,d)}function I3(d,h,b,C){var D=h&x,L=Uc(d);function V(){for(var U=-1,te=arguments.length,ve=-1,be=C.length,we=ue(be+te),Me=this&&this!==kn&&this instanceof V?L:d;++ve<be;)we[ve]=C[ve];for(;te--;)we[ve++]=arguments[++U];return _r(Me,D?b:this,we)}return V}function tS(d){return function(h,b,C){return C&&typeof C!="number"&&Qn(h,b,C)&&(b=C=n),h=mi(h),b===n?(b=h,h=0):b=mi(b),C=C===n?h<b?1:-1:mi(C),x3(h,b,C,d)}}function jf(d){return function(h,b){return typeof h=="string"&&typeof b=="string"||(h=eo(h),b=eo(b)),d(h,b)}}function nS(d,h,b,C,D,L,V,U,te,ve){var be=h&S,we=be?V:n,Me=be?n:V,Be=be?L:n,Ye=be?n:L;h|=be?E:O,h&=~(be?O:E),h&_||(h&=~(x|w));var ft=[d,h,D,Be,we,Ye,Me,U,te,ve],Ke=b.apply(n,ft);return nv(d)&&pS(Ke,ft),Ke.placeholder=C,gS(Ke,d,h)}function Km(d){var h=xn[d];return function(b,C){if(b=eo(b),C=C==null?0:Bn(at(C),292),C&&g_(b)){var D=(Tt(b)+"e").split("e"),L=h(D[0]+"e"+(+D[1]+C));return D=(Tt(L)+"e").split("e"),+(D[0]+"e"+(+D[1]-C))}return h(b)}}var N3=sl&&1/gf(new sl([,-0]))[1]==q?function(d){return new sl(d)}:vv;function rS(d){return function(h){var b=Vn(h);return b==_e?Em(h):b==gt?Z5(h):U5(h,d(h))}}function fi(d,h,b,C,D,L,V,U){var te=h&w;if(!te&&typeof d!="function")throw new Kr(s);var ve=C?C.length:0;if(ve||(h&=~(E|O),C=D=n),V=V===n?V:wn(at(V),0),U=U===n?U:at(U),ve-=D?D.length:0,h&O){var be=C,we=D;C=D=n}var Me=te?n:Jm(d),Be=[d,h,b,C,D,be,we,L,V,U];if(Me&&Q3(Be,Me),d=Be[0],h=Be[1],b=Be[2],C=Be[3],D=Be[4],U=Be[9]=Be[9]===n?te?0:d.length:wn(Be[9]-ve,0),!U&&h&(S|R)&&(h&=~(S|R)),!h||h==x)var Ye=M3(d,h,b);else h==S||h==R?Ye=A3(d,h,U):(h==E||h==(x|E))&&!D.length?Ye=I3(d,h,b,C):Ye=Lf.apply(n,Be);var ft=Me?L_:pS;return gS(ft(Ye,Be),d,h)}function oS(d,h,b,C){return d===n||bo(d,il[b])&&!Nt.call(C,b)?h:d}function iS(d,h,b,C,D,L){return sn(d)&&sn(h)&&(L.set(h,d),Mf(d,h,n,iS,L),L.delete(h)),d}function L3(d){return Yc(d)?n:d}function sS(d,h,b,C,D,L){var V=b&v,U=d.length,te=h.length;if(U!=te&&!(V&&te>U))return!1;var ve=L.get(d),be=L.get(h);if(ve&&be)return ve==h&&be==d;var we=-1,Me=!0,Be=b&y?new Gs:n;for(L.set(d,h),L.set(h,d);++we<U;){var Ye=d[we],ft=h[we];if(C)var Ke=V?C(ft,Ye,we,h,d,L):C(Ye,ft,we,d,h,L);if(Ke!==n){if(Ke)continue;Me=!1;break}if(Be){if(!ym(h,function(wt,Ct){if(!Ac(Be,Ct)&&(Ye===wt||D(Ye,wt,b,C,L)))return Be.push(Ct)})){Me=!1;break}}else if(!(Ye===ft||D(Ye,ft,b,C,L))){Me=!1;break}}return L.delete(d),L.delete(h),Me}function F3(d,h,b,C,D,L,V){switch(b){case qe:if(d.byteLength!=h.byteLength||d.byteOffset!=h.byteOffset)return!1;d=d.buffer,h=h.buffer;case Le:return!(d.byteLength!=h.byteLength||!L(new wf(d),new wf(h)));case oe:case Z:case Pe:return bo(+d,+h);case ye:return d.name==h.name&&d.message==h.message;case Xe:case It:return d==h+"";case _e:var U=Em;case gt:var te=C&v;if(U||(U=gf),d.size!=h.size&&!te)return!1;var ve=V.get(d);if(ve)return ve==h;C|=y,V.set(d,h);var be=sS(U(d),U(h),C,D,L,V);return V.delete(d),be;case zt:if(zc)return zc.call(d)==zc.call(h)}return!1}function z3(d,h,b,C,D,L){var V=b&v,U=Xm(d),te=U.length,ve=Xm(h),be=ve.length;if(te!=be&&!V)return!1;for(var we=te;we--;){var Me=U[we];if(!(V?Me in h:Nt.call(h,Me)))return!1}var Be=L.get(d),Ye=L.get(h);if(Be&&Ye)return Be==h&&Ye==d;var ft=!0;L.set(d,h),L.set(h,d);for(var Ke=V;++we<te;){Me=U[we];var wt=d[Me],Ct=h[Me];if(C)var Rr=V?C(Ct,wt,Me,h,d,L):C(wt,Ct,Me,d,h,L);if(!(Rr===n?wt===Ct||D(wt,Ct,b,C,L):Rr)){ft=!1;break}Ke||(Ke=Me=="constructor")}if(ft&&!Ke){var Jn=d.constructor,Pr=h.constructor;Jn!=Pr&&"constructor"in d&&"constructor"in h&&!(typeof Jn=="function"&&Jn instanceof Jn&&typeof Pr=="function"&&Pr instanceof Pr)&&(ft=!1)}return L.delete(d),L.delete(h),ft}function hi(d){return ov(fS(d,n,wS),d+"")}function Xm(d){return R_(d,Pn,ev)}function Qm(d){return R_(d,ir,aS)}var Jm=Pf?function(d){return Pf.get(d)}:vv;function Bf(d){for(var h=d.name+"",b=al[h],C=Nt.call(al,h)?b.length:0;C--;){var D=b[C],L=D.func;if(L==null||L==d)return D.name}return h}function dl(d){var h=Nt.call(A,"placeholder")?A:d;return h.placeholder}function Ge(){var d=A.iteratee||gv;return d=d===gv?$_:d,arguments.length?d(arguments[0],arguments[1]):d}function Vf(d,h){var b=d.__data__;return G3(h)?b[typeof h=="string"?"string":"hash"]:b.map}function Zm(d){for(var h=Pn(d),b=h.length;b--;){var C=h[b],D=d[C];h[b]=[C,D,uS(D)]}return h}function Xs(d,h){var b=X5(d,h);return O_(b)?b:n}function j3(d){var h=Nt.call(d,Us),b=d[Us];try{d[Us]=n;var C=!0}catch{}var D=yf.call(d);return C&&(h?d[Us]=b:delete d[Us]),D}var ev=Pm?function(d){return d==null?[]:(d=Bt(d),Vi(Pm(d),function(h){return h_.call(d,h)}))}:bv,aS=Pm?function(d){for(var h=[];d;)Hi(h,ev(d)),d=_f(d);return h}:bv,Vn=Xn;(Om&&Vn(new Om(new ArrayBuffer(1)))!=qe||Nc&&Vn(new Nc)!=_e||$m&&Vn($m.resolve())!=ze||sl&&Vn(new sl)!=gt||Lc&&Vn(new Lc)!=le)&&(Vn=function(d){var h=Xn(d),b=h==Ue?d.constructor:n,C=b?Qs(b):"";if(C)switch(C){case _N:return qe;case SN:return _e;case CN:return ze;case EN:return gt;case RN:return le}return h});function B3(d,h,b){for(var C=-1,D=b.length;++C<D;){var L=b[C],V=L.size;switch(L.type){case"drop":d+=V;break;case"dropRight":h-=V;break;case"take":h=Bn(h,d+V);break;case"takeRight":d=wn(d,h-V);break}}return{start:d,end:h}}function V3(d){var h=d.match(Mc);return h?h[1].split(P):[]}function lS(d,h,b){h=Yi(h,d);for(var C=-1,D=h.length,L=!1;++C<D;){var V=Io(h[C]);if(!(L=d!=null&&b(d,V)))break;d=d[V]}return L||++C!=D?L:(D=d==null?0:d.length,!!D&&Kf(D)&&pi(V,D)&&(ot(d)||Js(d)))}function H3(d){var h=d.length,b=new d.constructor(h);return h&&typeof d[0]=="string"&&Nt.call(d,"index")&&(b.index=d.index,b.input=d.input),b}function cS(d){return typeof d.constructor=="function"&&!qc(d)?ll(_f(d)):{}}function W3(d,h,b){var C=d.constructor;switch(h){case Le:return Gm(d);case oe:case Z:return new C(+d);case qe:return P3(d,b);case dt:case rn:case on:case fn:case zn:case wr:case hn:case nr:case Tn:return U_(d,b);case _e:return new C;case Pe:case It:return new C(d);case Xe:return O3(d);case gt:return new C;case zt:return $3(d)}}function U3(d,h){var b=h.length;if(!b)return d;var C=b-1;return h[C]=(b>1?"& ":"")+h[C],h=h.join(b>2?", ":" "),d.replace(kc,`{
70
+ /* [wrapped with `+h+`] */
71
+ `)}function q3(d){return ot(d)||Js(d)||!!(p_&&d&&d[p_])}function pi(d,h){var b=typeof d;return h=h??X,!!h&&(b=="number"||b!="symbol"&&rt.test(d))&&d>-1&&d%1==0&&d<h}function Qn(d,h,b){if(!sn(b))return!1;var C=typeof h;return(C=="number"?or(b)&&pi(h,b.length):C=="string"&&h in b)?bo(b[h],d):!1}function tv(d,h){if(ot(d))return!1;var b=typeof d;return b=="number"||b=="symbol"||b=="boolean"||d==null||Er(d)?!0:zs.test(d)||!Fs.test(d)||h!=null&&d in Bt(h)}function G3(d){var h=typeof d;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?d!=="__proto__":d===null}function nv(d){var h=Bf(d),b=A[h];if(typeof b!="function"||!(h in St.prototype))return!1;if(d===b)return!0;var C=Jm(b);return!!C&&d===C[0]}function Y3(d){return!!u_&&u_ in d}var K3=vf?gi:yv;function qc(d){var h=d&&d.constructor,b=typeof h=="function"&&h.prototype||il;return d===b}function uS(d){return d===d&&!sn(d)}function dS(d,h){return function(b){return b==null?!1:b[d]===h&&(h!==n||d in Bt(b))}}function X3(d){var h=Gf(d,function(C){return b.size===c&&b.clear(),C}),b=h.cache;return h}function Q3(d,h){var b=d[1],C=h[1],D=b|C,L=D<(x|w|k),V=C==k&&b==S||C==k&&b==T&&d[7].length<=h[8]||C==(k|T)&&h[7].length<=h[8]&&b==S;if(!(L||V))return d;C&x&&(d[2]=h[2],D|=b&x?0:_);var U=h[3];if(U){var te=d[3];d[3]=te?G_(te,U,h[4]):U,d[4]=te?Wi(d[3],u):h[4]}return U=h[5],U&&(te=d[5],d[5]=te?Y_(te,U,h[6]):U,d[6]=te?Wi(d[5],u):h[6]),U=h[7],U&&(d[7]=U),C&k&&(d[8]=d[8]==null?h[8]:Bn(d[8],h[8])),d[9]==null&&(d[9]=h[9]),d[0]=h[0],d[1]=D,d}function J3(d){var h=[];if(d!=null)for(var b in Bt(d))h.push(b);return h}function Z3(d){return yf.call(d)}function fS(d,h,b){return h=wn(h===n?d.length-1:h,0),function(){for(var C=arguments,D=-1,L=wn(C.length-h,0),V=ue(L);++D<L;)V[D]=C[h+D];D=-1;for(var U=ue(h+1);++D<h;)U[D]=C[D];return U[h]=b(V),_r(d,this,U)}}function hS(d,h){return h.length<2?d:Ks(d,Jr(h,0,-1))}function eL(d,h){for(var b=d.length,C=Bn(h.length,b),D=rr(d);C--;){var L=h[C];d[C]=pi(L,b)?D[L]:n}return d}function rv(d,h){if(!(h==="constructor"&&typeof d[h]=="function")&&h!="__proto__")return d[h]}var pS=mS(L_),Gc=gN||function(d,h){return kn.setTimeout(d,h)},ov=mS(S3);function gS(d,h,b){var C=h+"";return ov(d,U3(C,tL(V3(C),b)))}function mS(d){var h=0,b=0;return function(){var C=yN(),D=Y-(C-b);if(b=C,D>0){if(++h>=B)return arguments[0]}else h=0;return d.apply(n,arguments)}}function Hf(d,h){var b=-1,C=d.length,D=C-1;for(h=h===n?C:h;++b<h;){var L=jm(b,D),V=d[L];d[L]=d[b],d[b]=V}return d.length=h,d}var vS=X3(function(d){var h=[];return d.charCodeAt(0)===46&&h.push(""),d.replace(Dc,function(b,C,D,L){h.push(D?L.replace(Se,"$1"):C||b)}),h});function Io(d){if(typeof d=="string"||Er(d))return d;var h=d+"";return h=="0"&&1/d==-q?"-0":h}function Qs(d){if(d!=null){try{return bf.call(d)}catch{}try{return d+""}catch{}}return""}function tL(d,h){return Yr(ce,function(b){var C="_."+b[0];h&b[1]&&!hf(d,C)&&d.push(C)}),d.sort()}function bS(d){if(d instanceof St)return d.clone();var h=new Xr(d.__wrapped__,d.__chain__);return h.__actions__=rr(d.__actions__),h.__index__=d.__index__,h.__values__=d.__values__,h}function nL(d,h,b){(b?Qn(d,h,b):h===n)?h=1:h=wn(at(h),0);var C=d==null?0:d.length;if(!C||h<1)return[];for(var D=0,L=0,V=ue(Ef(C/h));D<C;)V[L++]=Jr(d,D,D+=h);return V}function rL(d){for(var h=-1,b=d==null?0:d.length,C=0,D=[];++h<b;){var L=d[h];L&&(D[C++]=L)}return D}function oL(){var d=arguments.length;if(!d)return[];for(var h=ue(d-1),b=arguments[0],C=d;C--;)h[C-1]=arguments[C];return Hi(ot(b)?rr(b):[b],Mn(h,1))}var iL=mt(function(d,h){return pn(d)?Bc(d,Mn(h,1,pn,!0)):[]}),sL=mt(function(d,h){var b=Zr(h);return pn(b)&&(b=n),pn(d)?Bc(d,Mn(h,1,pn,!0),Ge(b,2)):[]}),aL=mt(function(d,h){var b=Zr(h);return pn(b)&&(b=n),pn(d)?Bc(d,Mn(h,1,pn,!0),n,b):[]});function lL(d,h,b){var C=d==null?0:d.length;return C?(h=b||h===n?1:at(h),Jr(d,h<0?0:h,C)):[]}function cL(d,h,b){var C=d==null?0:d.length;return C?(h=b||h===n?1:at(h),h=C-h,Jr(d,0,h<0?0:h)):[]}function uL(d,h){return d&&d.length?If(d,Ge(h,3),!0,!0):[]}function dL(d,h){return d&&d.length?If(d,Ge(h,3),!0):[]}function fL(d,h,b,C){var D=d==null?0:d.length;return D?(b&&typeof b!="number"&&Qn(d,h,b)&&(b=0,C=D),o3(d,h,b,C)):[]}function yS(d,h,b){var C=d==null?0:d.length;if(!C)return-1;var D=b==null?0:at(b);return D<0&&(D=wn(C+D,0)),pf(d,Ge(h,3),D)}function xS(d,h,b){var C=d==null?0:d.length;if(!C)return-1;var D=C-1;return b!==n&&(D=at(b),D=b<0?wn(C+D,0):Bn(D,C-1)),pf(d,Ge(h,3),D,!0)}function wS(d){var h=d==null?0:d.length;return h?Mn(d,1):[]}function hL(d){var h=d==null?0:d.length;return h?Mn(d,q):[]}function pL(d,h){var b=d==null?0:d.length;return b?(h=h===n?1:at(h),Mn(d,h)):[]}function gL(d){for(var h=-1,b=d==null?0:d.length,C={};++h<b;){var D=d[h];C[D[0]]=D[1]}return C}function _S(d){return d&&d.length?d[0]:n}function mL(d,h,b){var C=d==null?0:d.length;if(!C)return-1;var D=b==null?0:at(b);return D<0&&(D=wn(C+D,0)),tl(d,h,D)}function vL(d){var h=d==null?0:d.length;return h?Jr(d,0,-1):[]}var bL=mt(function(d){var h=nn(d,Um);return h.length&&h[0]===d[0]?Im(h):[]}),yL=mt(function(d){var h=Zr(d),b=nn(d,Um);return h===Zr(b)?h=n:b.pop(),b.length&&b[0]===d[0]?Im(b,Ge(h,2)):[]}),xL=mt(function(d){var h=Zr(d),b=nn(d,Um);return h=typeof h=="function"?h:n,h&&b.pop(),b.length&&b[0]===d[0]?Im(b,n,h):[]});function wL(d,h){return d==null?"":vN.call(d,h)}function Zr(d){var h=d==null?0:d.length;return h?d[h-1]:n}function _L(d,h,b){var C=d==null?0:d.length;if(!C)return-1;var D=C;return b!==n&&(D=at(b),D=D<0?wn(C+D,0):Bn(D,C-1)),h===h?tN(d,h,D):pf(d,n_,D,!0)}function SL(d,h){return d&&d.length?M_(d,at(h)):n}var CL=mt(SS);function SS(d,h){return d&&d.length&&h&&h.length?zm(d,h):d}function EL(d,h,b){return d&&d.length&&h&&h.length?zm(d,h,Ge(b,2)):d}function RL(d,h,b){return d&&d.length&&h&&h.length?zm(d,h,n,b):d}var PL=hi(function(d,h){var b=d==null?0:d.length,C=Tm(d,h);return N_(d,nn(h,function(D){return pi(D,b)?+D:D}).sort(q_)),C});function OL(d,h){var b=[];if(!(d&&d.length))return b;var C=-1,D=[],L=d.length;for(h=Ge(h,3);++C<L;){var V=d[C];h(V,C,d)&&(b.push(V),D.push(C))}return N_(d,D),b}function iv(d){return d==null?d:wN.call(d)}function $L(d,h,b){var C=d==null?0:d.length;return C?(b&&typeof b!="number"&&Qn(d,h,b)?(h=0,b=C):(h=h==null?0:at(h),b=b===n?C:at(b)),Jr(d,h,b)):[]}function DL(d,h){return Af(d,h)}function TL(d,h,b){return Vm(d,h,Ge(b,2))}function kL(d,h){var b=d==null?0:d.length;if(b){var C=Af(d,h);if(C<b&&bo(d[C],h))return C}return-1}function ML(d,h){return Af(d,h,!0)}function AL(d,h,b){return Vm(d,h,Ge(b,2),!0)}function IL(d,h){var b=d==null?0:d.length;if(b){var C=Af(d,h,!0)-1;if(bo(d[C],h))return C}return-1}function NL(d){return d&&d.length?F_(d):[]}function LL(d,h){return d&&d.length?F_(d,Ge(h,2)):[]}function FL(d){var h=d==null?0:d.length;return h?Jr(d,1,h):[]}function zL(d,h,b){return d&&d.length?(h=b||h===n?1:at(h),Jr(d,0,h<0?0:h)):[]}function jL(d,h,b){var C=d==null?0:d.length;return C?(h=b||h===n?1:at(h),h=C-h,Jr(d,h<0?0:h,C)):[]}function BL(d,h){return d&&d.length?If(d,Ge(h,3),!1,!0):[]}function VL(d,h){return d&&d.length?If(d,Ge(h,3)):[]}var HL=mt(function(d){return Gi(Mn(d,1,pn,!0))}),WL=mt(function(d){var h=Zr(d);return pn(h)&&(h=n),Gi(Mn(d,1,pn,!0),Ge(h,2))}),UL=mt(function(d){var h=Zr(d);return h=typeof h=="function"?h:n,Gi(Mn(d,1,pn,!0),n,h)});function qL(d){return d&&d.length?Gi(d):[]}function GL(d,h){return d&&d.length?Gi(d,Ge(h,2)):[]}function YL(d,h){return h=typeof h=="function"?h:n,d&&d.length?Gi(d,n,h):[]}function sv(d){if(!(d&&d.length))return[];var h=0;return d=Vi(d,function(b){if(pn(b))return h=wn(b.length,h),!0}),Sm(h,function(b){return nn(d,xm(b))})}function CS(d,h){if(!(d&&d.length))return[];var b=sv(d);return h==null?b:nn(b,function(C){return _r(h,n,C)})}var KL=mt(function(d,h){return pn(d)?Bc(d,h):[]}),XL=mt(function(d){return Wm(Vi(d,pn))}),QL=mt(function(d){var h=Zr(d);return pn(h)&&(h=n),Wm(Vi(d,pn),Ge(h,2))}),JL=mt(function(d){var h=Zr(d);return h=typeof h=="function"?h:n,Wm(Vi(d,pn),n,h)}),ZL=mt(sv);function e7(d,h){return V_(d||[],h||[],jc)}function t7(d,h){return V_(d||[],h||[],Wc)}var n7=mt(function(d){var h=d.length,b=h>1?d[h-1]:n;return b=typeof b=="function"?(d.pop(),b):n,CS(d,b)});function ES(d){var h=A(d);return h.__chain__=!0,h}function r7(d,h){return h(d),d}function Wf(d,h){return h(d)}var o7=hi(function(d){var h=d.length,b=h?d[0]:0,C=this.__wrapped__,D=function(L){return Tm(L,d)};return h>1||this.__actions__.length||!(C instanceof St)||!pi(b)?this.thru(D):(C=C.slice(b,+b+(h?1:0)),C.__actions__.push({func:Wf,args:[D],thisArg:n}),new Xr(C,this.__chain__).thru(function(L){return h&&!L.length&&L.push(n),L}))});function i7(){return ES(this)}function s7(){return new Xr(this.value(),this.__chain__)}function a7(){this.__values__===n&&(this.__values__=zS(this.value()));var d=this.__index__>=this.__values__.length,h=d?n:this.__values__[this.__index__++];return{done:d,value:h}}function l7(){return this}function c7(d){for(var h,b=this;b instanceof $f;){var C=bS(b);C.__index__=0,C.__values__=n,h?D.__wrapped__=C:h=C;var D=C;b=b.__wrapped__}return D.__wrapped__=d,h}function u7(){var d=this.__wrapped__;if(d instanceof St){var h=d;return this.__actions__.length&&(h=new St(this)),h=h.reverse(),h.__actions__.push({func:Wf,args:[iv],thisArg:n}),new Xr(h,this.__chain__)}return this.thru(iv)}function d7(){return B_(this.__wrapped__,this.__actions__)}var f7=Nf(function(d,h,b){Nt.call(d,b)?++d[b]:di(d,b,1)});function h7(d,h,b){var C=ot(d)?e_:r3;return b&&Qn(d,h,b)&&(h=n),C(d,Ge(h,3))}function p7(d,h){var b=ot(d)?Vi:C_;return b(d,Ge(h,3))}var g7=J_(yS),m7=J_(xS);function v7(d,h){return Mn(Uf(d,h),1)}function b7(d,h){return Mn(Uf(d,h),q)}function y7(d,h,b){return b=b===n?1:at(b),Mn(Uf(d,h),b)}function RS(d,h){var b=ot(d)?Yr:qi;return b(d,Ge(h,3))}function PS(d,h){var b=ot(d)?F5:S_;return b(d,Ge(h,3))}var x7=Nf(function(d,h,b){Nt.call(d,b)?d[b].push(h):di(d,b,[h])});function w7(d,h,b,C){d=or(d)?d:hl(d),b=b&&!C?at(b):0;var D=d.length;return b<0&&(b=wn(D+b,0)),Xf(d)?b<=D&&d.indexOf(h,b)>-1:!!D&&tl(d,h,b)>-1}var _7=mt(function(d,h,b){var C=-1,D=typeof h=="function",L=or(d)?ue(d.length):[];return qi(d,function(V){L[++C]=D?_r(h,V,b):Vc(V,h,b)}),L}),S7=Nf(function(d,h,b){di(d,b,h)});function Uf(d,h){var b=ot(d)?nn:D_;return b(d,Ge(h,3))}function C7(d,h,b,C){return d==null?[]:(ot(h)||(h=h==null?[]:[h]),b=C?n:b,ot(b)||(b=b==null?[]:[b]),A_(d,h,b))}var E7=Nf(function(d,h,b){d[b?0:1].push(h)},function(){return[[],[]]});function R7(d,h,b){var C=ot(d)?bm:o_,D=arguments.length<3;return C(d,Ge(h,4),b,D,qi)}function P7(d,h,b){var C=ot(d)?z5:o_,D=arguments.length<3;return C(d,Ge(h,4),b,D,S_)}function O7(d,h){var b=ot(d)?Vi:C_;return b(d,Yf(Ge(h,3)))}function $7(d){var h=ot(d)?y_:w3;return h(d)}function D7(d,h,b){(b?Qn(d,h,b):h===n)?h=1:h=at(h);var C=ot(d)?JN:_3;return C(d,h)}function T7(d){var h=ot(d)?ZN:C3;return h(d)}function k7(d){if(d==null)return 0;if(or(d))return Xf(d)?rl(d):d.length;var h=Vn(d);return h==_e||h==gt?d.size:Lm(d).length}function M7(d,h,b){var C=ot(d)?ym:E3;return b&&Qn(d,h,b)&&(h=n),C(d,Ge(h,3))}var A7=mt(function(d,h){if(d==null)return[];var b=h.length;return b>1&&Qn(d,h[0],h[1])?h=[]:b>2&&Qn(h[0],h[1],h[2])&&(h=[h[0]]),A_(d,Mn(h,1),[])}),qf=pN||function(){return kn.Date.now()};function I7(d,h){if(typeof h!="function")throw new Kr(s);return d=at(d),function(){if(--d<1)return h.apply(this,arguments)}}function OS(d,h,b){return h=b?n:h,h=d&&h==null?d.length:h,fi(d,k,n,n,n,n,h)}function $S(d,h){var b;if(typeof h!="function")throw new Kr(s);return d=at(d),function(){return--d>0&&(b=h.apply(this,arguments)),d<=1&&(h=n),b}}var av=mt(function(d,h,b){var C=x;if(b.length){var D=Wi(b,dl(av));C|=E}return fi(d,C,h,b,D)}),DS=mt(function(d,h,b){var C=x|w;if(b.length){var D=Wi(b,dl(DS));C|=E}return fi(h,C,d,b,D)});function TS(d,h,b){h=b?n:h;var C=fi(d,S,n,n,n,n,n,h);return C.placeholder=TS.placeholder,C}function kS(d,h,b){h=b?n:h;var C=fi(d,R,n,n,n,n,n,h);return C.placeholder=kS.placeholder,C}function MS(d,h,b){var C,D,L,V,U,te,ve=0,be=!1,we=!1,Me=!0;if(typeof d!="function")throw new Kr(s);h=eo(h)||0,sn(b)&&(be=!!b.leading,we="maxWait"in b,L=we?wn(eo(b.maxWait)||0,h):L,Me="trailing"in b?!!b.trailing:Me);function Be(gn){var yo=C,vi=D;return C=D=n,ve=gn,V=d.apply(vi,yo),V}function Ye(gn){return ve=gn,U=Gc(wt,h),be?Be(gn):V}function ft(gn){var yo=gn-te,vi=gn-ve,JS=h-yo;return we?Bn(JS,L-vi):JS}function Ke(gn){var yo=gn-te,vi=gn-ve;return te===n||yo>=h||yo<0||we&&vi>=L}function wt(){var gn=qf();if(Ke(gn))return Ct(gn);U=Gc(wt,ft(gn))}function Ct(gn){return U=n,Me&&C?Be(gn):(C=D=n,V)}function Rr(){U!==n&&H_(U),ve=0,C=te=D=U=n}function Jn(){return U===n?V:Ct(qf())}function Pr(){var gn=qf(),yo=Ke(gn);if(C=arguments,D=this,te=gn,yo){if(U===n)return Ye(te);if(we)return H_(U),U=Gc(wt,h),Be(te)}return U===n&&(U=Gc(wt,h)),V}return Pr.cancel=Rr,Pr.flush=Jn,Pr}var N7=mt(function(d,h){return __(d,1,h)}),L7=mt(function(d,h,b){return __(d,eo(h)||0,b)});function F7(d){return fi(d,M)}function Gf(d,h){if(typeof d!="function"||h!=null&&typeof h!="function")throw new Kr(s);var b=function(){var C=arguments,D=h?h.apply(this,C):C[0],L=b.cache;if(L.has(D))return L.get(D);var V=d.apply(this,C);return b.cache=L.set(D,V)||L,V};return b.cache=new(Gf.Cache||ui),b}Gf.Cache=ui;function Yf(d){if(typeof d!="function")throw new Kr(s);return function(){var h=arguments;switch(h.length){case 0:return!d.call(this);case 1:return!d.call(this,h[0]);case 2:return!d.call(this,h[0],h[1]);case 3:return!d.call(this,h[0],h[1],h[2])}return!d.apply(this,h)}}function z7(d){return $S(2,d)}var j7=R3(function(d,h){h=h.length==1&&ot(h[0])?nn(h[0],Sr(Ge())):nn(Mn(h,1),Sr(Ge()));var b=h.length;return mt(function(C){for(var D=-1,L=Bn(C.length,b);++D<L;)C[D]=h[D].call(this,C[D]);return _r(d,this,C)})}),lv=mt(function(d,h){var b=Wi(h,dl(lv));return fi(d,E,n,h,b)}),AS=mt(function(d,h){var b=Wi(h,dl(AS));return fi(d,O,n,h,b)}),B7=hi(function(d,h){return fi(d,T,n,n,n,h)});function V7(d,h){if(typeof d!="function")throw new Kr(s);return h=h===n?h:at(h),mt(d,h)}function H7(d,h){if(typeof d!="function")throw new Kr(s);return h=h==null?0:wn(at(h),0),mt(function(b){var C=b[h],D=Ki(b,0,h);return C&&Hi(D,C),_r(d,this,D)})}function W7(d,h,b){var C=!0,D=!0;if(typeof d!="function")throw new Kr(s);return sn(b)&&(C="leading"in b?!!b.leading:C,D="trailing"in b?!!b.trailing:D),MS(d,h,{leading:C,maxWait:h,trailing:D})}function U7(d){return OS(d,1)}function q7(d,h){return lv(qm(h),d)}function G7(){if(!arguments.length)return[];var d=arguments[0];return ot(d)?d:[d]}function Y7(d){return Qr(d,p)}function K7(d,h){return h=typeof h=="function"?h:n,Qr(d,p,h)}function X7(d){return Qr(d,f|p)}function Q7(d,h){return h=typeof h=="function"?h:n,Qr(d,f|p,h)}function J7(d,h){return h==null||w_(d,h,Pn(h))}function bo(d,h){return d===h||d!==d&&h!==h}var Z7=jf(Am),eF=jf(function(d,h){return d>=h}),Js=P_(function(){return arguments}())?P_:function(d){return cn(d)&&Nt.call(d,"callee")&&!h_.call(d,"callee")},ot=ue.isArray,tF=Y1?Sr(Y1):c3;function or(d){return d!=null&&Kf(d.length)&&!gi(d)}function pn(d){return cn(d)&&or(d)}function nF(d){return d===!0||d===!1||cn(d)&&Xn(d)==oe}var Xi=mN||yv,rF=K1?Sr(K1):u3;function oF(d){return cn(d)&&d.nodeType===1&&!Yc(d)}function iF(d){if(d==null)return!0;if(or(d)&&(ot(d)||typeof d=="string"||typeof d.splice=="function"||Xi(d)||fl(d)||Js(d)))return!d.length;var h=Vn(d);if(h==_e||h==gt)return!d.size;if(qc(d))return!Lm(d).length;for(var b in d)if(Nt.call(d,b))return!1;return!0}function sF(d,h){return Hc(d,h)}function aF(d,h,b){b=typeof b=="function"?b:n;var C=b?b(d,h):n;return C===n?Hc(d,h,n,b):!!C}function cv(d){if(!cn(d))return!1;var h=Xn(d);return h==ye||h==ie||typeof d.message=="string"&&typeof d.name=="string"&&!Yc(d)}function lF(d){return typeof d=="number"&&g_(d)}function gi(d){if(!sn(d))return!1;var h=Xn(d);return h==W||h==me||h==de||h==Ne}function IS(d){return typeof d=="number"&&d==at(d)}function Kf(d){return typeof d=="number"&&d>-1&&d%1==0&&d<=X}function sn(d){var h=typeof d;return d!=null&&(h=="object"||h=="function")}function cn(d){return d!=null&&typeof d=="object"}var NS=X1?Sr(X1):f3;function cF(d,h){return d===h||Nm(d,h,Zm(h))}function uF(d,h,b){return b=typeof b=="function"?b:n,Nm(d,h,Zm(h),b)}function dF(d){return LS(d)&&d!=+d}function fF(d){if(K3(d))throw new nt(i);return O_(d)}function hF(d){return d===null}function pF(d){return d==null}function LS(d){return typeof d=="number"||cn(d)&&Xn(d)==Pe}function Yc(d){if(!cn(d)||Xn(d)!=Ue)return!1;var h=_f(d);if(h===null)return!0;var b=Nt.call(h,"constructor")&&h.constructor;return typeof b=="function"&&b instanceof b&&bf.call(b)==uN}var uv=Q1?Sr(Q1):h3;function gF(d){return IS(d)&&d>=-X&&d<=X}var FS=J1?Sr(J1):p3;function Xf(d){return typeof d=="string"||!ot(d)&&cn(d)&&Xn(d)==It}function Er(d){return typeof d=="symbol"||cn(d)&&Xn(d)==zt}var fl=Z1?Sr(Z1):g3;function mF(d){return d===n}function vF(d){return cn(d)&&Vn(d)==le}function bF(d){return cn(d)&&Xn(d)==Ce}var yF=jf(Fm),xF=jf(function(d,h){return d<=h});function zS(d){if(!d)return[];if(or(d))return Xf(d)?mo(d):rr(d);if(Ic&&d[Ic])return J5(d[Ic]());var h=Vn(d),b=h==_e?Em:h==gt?gf:hl;return b(d)}function mi(d){if(!d)return d===0?d:0;if(d=eo(d),d===q||d===-q){var h=d<0?-1:1;return h*re}return d===d?d:0}function at(d){var h=mi(d),b=h%1;return h===h?b?h-b:h:0}function jS(d){return d?Ys(at(d),0,H):0}function eo(d){if(typeof d=="number")return d;if(Er(d))return $;if(sn(d)){var h=typeof d.valueOf=="function"?d.valueOf():d;d=sn(h)?h+"":h}if(typeof d!="string")return d===0?d:+d;d=i_(d);var b=ke.test(d);return b||et.test(d)?I5(d.slice(2),b?2:8):Ae.test(d)?$:+d}function BS(d){return Ao(d,ir(d))}function wF(d){return d?Ys(at(d),-X,X):d===0?d:0}function Tt(d){return d==null?"":Cr(d)}var _F=cl(function(d,h){if(qc(h)||or(h)){Ao(h,Pn(h),d);return}for(var b in h)Nt.call(h,b)&&jc(d,b,h[b])}),VS=cl(function(d,h){Ao(h,ir(h),d)}),Qf=cl(function(d,h,b,C){Ao(h,ir(h),d,C)}),SF=cl(function(d,h,b,C){Ao(h,Pn(h),d,C)}),CF=hi(Tm);function EF(d,h){var b=ll(d);return h==null?b:x_(b,h)}var RF=mt(function(d,h){d=Bt(d);var b=-1,C=h.length,D=C>2?h[2]:n;for(D&&Qn(h[0],h[1],D)&&(C=1);++b<C;)for(var L=h[b],V=ir(L),U=-1,te=V.length;++U<te;){var ve=V[U],be=d[ve];(be===n||bo(be,il[ve])&&!Nt.call(d,ve))&&(d[ve]=L[ve])}return d}),PF=mt(function(d){return d.push(n,iS),_r(HS,n,d)});function OF(d,h){return t_(d,Ge(h,3),Mo)}function $F(d,h){return t_(d,Ge(h,3),Mm)}function DF(d,h){return d==null?d:km(d,Ge(h,3),ir)}function TF(d,h){return d==null?d:E_(d,Ge(h,3),ir)}function kF(d,h){return d&&Mo(d,Ge(h,3))}function MF(d,h){return d&&Mm(d,Ge(h,3))}function AF(d){return d==null?[]:kf(d,Pn(d))}function IF(d){return d==null?[]:kf(d,ir(d))}function dv(d,h,b){var C=d==null?n:Ks(d,h);return C===n?b:C}function NF(d,h){return d!=null&&lS(d,h,i3)}function fv(d,h){return d!=null&&lS(d,h,s3)}var LF=eS(function(d,h,b){h!=null&&typeof h.toString!="function"&&(h=yf.call(h)),d[h]=b},pv(sr)),FF=eS(function(d,h,b){h!=null&&typeof h.toString!="function"&&(h=yf.call(h)),Nt.call(d,h)?d[h].push(b):d[h]=[b]},Ge),zF=mt(Vc);function Pn(d){return or(d)?b_(d):Lm(d)}function ir(d){return or(d)?b_(d,!0):m3(d)}function jF(d,h){var b={};return h=Ge(h,3),Mo(d,function(C,D,L){di(b,h(C,D,L),C)}),b}function BF(d,h){var b={};return h=Ge(h,3),Mo(d,function(C,D,L){di(b,D,h(C,D,L))}),b}var VF=cl(function(d,h,b){Mf(d,h,b)}),HS=cl(function(d,h,b,C){Mf(d,h,b,C)}),HF=hi(function(d,h){var b={};if(d==null)return b;var C=!1;h=nn(h,function(L){return L=Yi(L,d),C||(C=L.length>1),L}),Ao(d,Qm(d),b),C&&(b=Qr(b,f|g|p,L3));for(var D=h.length;D--;)Hm(b,h[D]);return b});function WF(d,h){return WS(d,Yf(Ge(h)))}var UF=hi(function(d,h){return d==null?{}:b3(d,h)});function WS(d,h){if(d==null)return{};var b=nn(Qm(d),function(C){return[C]});return h=Ge(h),I_(d,b,function(C,D){return h(C,D[0])})}function qF(d,h,b){h=Yi(h,d);var C=-1,D=h.length;for(D||(D=1,d=n);++C<D;){var L=d==null?n:d[Io(h[C])];L===n&&(C=D,L=b),d=gi(L)?L.call(d):L}return d}function GF(d,h,b){return d==null?d:Wc(d,h,b)}function YF(d,h,b,C){return C=typeof C=="function"?C:n,d==null?d:Wc(d,h,b,C)}var US=rS(Pn),qS=rS(ir);function KF(d,h,b){var C=ot(d),D=C||Xi(d)||fl(d);if(h=Ge(h,4),b==null){var L=d&&d.constructor;D?b=C?new L:[]:sn(d)?b=gi(L)?ll(_f(d)):{}:b={}}return(D?Yr:Mo)(d,function(V,U,te){return h(b,V,U,te)}),b}function XF(d,h){return d==null?!0:Hm(d,h)}function QF(d,h,b){return d==null?d:j_(d,h,qm(b))}function JF(d,h,b,C){return C=typeof C=="function"?C:n,d==null?d:j_(d,h,qm(b),C)}function hl(d){return d==null?[]:Cm(d,Pn(d))}function ZF(d){return d==null?[]:Cm(d,ir(d))}function e6(d,h,b){return b===n&&(b=h,h=n),b!==n&&(b=eo(b),b=b===b?b:0),h!==n&&(h=eo(h),h=h===h?h:0),Ys(eo(d),h,b)}function t6(d,h,b){return h=mi(h),b===n?(b=h,h=0):b=mi(b),d=eo(d),a3(d,h,b)}function n6(d,h,b){if(b&&typeof b!="boolean"&&Qn(d,h,b)&&(h=b=n),b===n&&(typeof h=="boolean"?(b=h,h=n):typeof d=="boolean"&&(b=d,d=n)),d===n&&h===n?(d=0,h=1):(d=mi(d),h===n?(h=d,d=0):h=mi(h)),d>h){var C=d;d=h,h=C}if(b||d%1||h%1){var D=m_();return Bn(d+D*(h-d+A5("1e-"+((D+"").length-1))),h)}return jm(d,h)}var r6=ul(function(d,h,b){return h=h.toLowerCase(),d+(b?GS(h):h)});function GS(d){return hv(Tt(d).toLowerCase())}function YS(d){return d=Tt(d),d&&d.replace(jt,G5).replace(C5,"")}function o6(d,h,b){d=Tt(d),h=Cr(h);var C=d.length;b=b===n?C:Ys(at(b),0,C);var D=b;return b-=h.length,b>=0&&d.slice(b,D)==h}function i6(d){return d=Tt(d),d&&Ns.test(d)?d.replace(ko,Y5):d}function s6(d){return d=Tt(d),d&&Bs.test(d)?d.replace(js,"\\$&"):d}var a6=ul(function(d,h,b){return d+(b?"-":"")+h.toLowerCase()}),l6=ul(function(d,h,b){return d+(b?" ":"")+h.toLowerCase()}),c6=Q_("toLowerCase");function u6(d,h,b){d=Tt(d),h=at(h);var C=h?rl(d):0;if(!h||C>=h)return d;var D=(h-C)/2;return zf(Rf(D),b)+d+zf(Ef(D),b)}function d6(d,h,b){d=Tt(d),h=at(h);var C=h?rl(d):0;return h&&C<h?d+zf(h-C,b):d}function f6(d,h,b){d=Tt(d),h=at(h);var C=h?rl(d):0;return h&&C<h?zf(h-C,b)+d:d}function h6(d,h,b){return b||h==null?h=0:h&&(h=+h),xN(Tt(d).replace(Vs,""),h||0)}function p6(d,h,b){return(b?Qn(d,h,b):h===n)?h=1:h=at(h),Bm(Tt(d),h)}function g6(){var d=arguments,h=Tt(d[0]);return d.length<3?h:h.replace(d[1],d[2])}var m6=ul(function(d,h,b){return d+(b?"_":"")+h.toLowerCase()});function v6(d,h,b){return b&&typeof b!="number"&&Qn(d,h,b)&&(h=b=n),b=b===n?H:b>>>0,b?(d=Tt(d),d&&(typeof h=="string"||h!=null&&!uv(h))&&(h=Cr(h),!h&&nl(d))?Ki(mo(d),0,b):d.split(h,b)):[]}var b6=ul(function(d,h,b){return d+(b?" ":"")+hv(h)});function y6(d,h,b){return d=Tt(d),b=b==null?0:Ys(at(b),0,d.length),h=Cr(h),d.slice(b,b+h.length)==h}function x6(d,h,b){var C=A.templateSettings;b&&Qn(d,h,b)&&(h=n),d=Tt(d),h=Qf({},h,C,oS);var D=Qf({},h.imports,C.imports,oS),L=Pn(D),V=Cm(D,L),U,te,ve=0,be=h.interpolate||Rn,we="__p += '",Me=Rm((h.escape||Rn).source+"|"+be.source+"|"+(be===Za?je:Rn).source+"|"+(h.evaluate||Rn).source+"|$","g"),Be="//# sourceURL="+(Nt.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$5+"]")+`
72
+ `;d.replace(Me,function(Ke,wt,Ct,Rr,Jn,Pr){return Ct||(Ct=Rr),we+=d.slice(ve,Pr).replace(Hs,K5),wt&&(U=!0,we+=`' +
73
+ __e(`+wt+`) +
74
+ '`),Jn&&(te=!0,we+=`';
75
+ `+Jn+`;
76
+ __p += '`),Ct&&(we+=`' +
77
+ ((__t = (`+Ct+`)) == null ? '' : __t) +
78
+ '`),ve=Pr+Ke.length,Ke}),we+=`';
79
+ `;var Ye=Nt.call(h,"variable")&&h.variable;if(!Ye)we=`with (obj) {
80
+ `+we+`
81
+ }
82
+ `;else if(ae.test(Ye))throw new nt(a);we=(te?we.replace(Oc,""):we).replace(ai,"$1").replace(Is,"$1;"),we="function("+(Ye||"obj")+`) {
83
+ `+(Ye?"":`obj || (obj = {});
84
+ `)+"var __t, __p = ''"+(U?", __e = _.escape":"")+(te?`, __j = Array.prototype.join;
85
+ function print() { __p += __j.call(arguments, '') }
86
+ `:`;
87
+ `)+we+`return __p
88
+ }`;var ft=XS(function(){return Ot(L,Be+"return "+we).apply(n,V)});if(ft.source=we,cv(ft))throw ft;return ft}function w6(d){return Tt(d).toLowerCase()}function _6(d){return Tt(d).toUpperCase()}function S6(d,h,b){if(d=Tt(d),d&&(b||h===n))return i_(d);if(!d||!(h=Cr(h)))return d;var C=mo(d),D=mo(h),L=s_(C,D),V=a_(C,D)+1;return Ki(C,L,V).join("")}function C6(d,h,b){if(d=Tt(d),d&&(b||h===n))return d.slice(0,c_(d)+1);if(!d||!(h=Cr(h)))return d;var C=mo(d),D=a_(C,mo(h))+1;return Ki(C,0,D).join("")}function E6(d,h,b){if(d=Tt(d),d&&(b||h===n))return d.replace(Vs,"");if(!d||!(h=Cr(h)))return d;var C=mo(d),D=s_(C,mo(h));return Ki(C,D).join("")}function R6(d,h){var b=F,C=z;if(sn(h)){var D="separator"in h?h.separator:D;b="length"in h?at(h.length):b,C="omission"in h?Cr(h.omission):C}d=Tt(d);var L=d.length;if(nl(d)){var V=mo(d);L=V.length}if(b>=L)return d;var U=b-rl(C);if(U<1)return C;var te=V?Ki(V,0,U).join(""):d.slice(0,U);if(D===n)return te+C;if(V&&(U+=te.length-U),uv(D)){if(d.slice(U).search(D)){var ve,be=te;for(D.global||(D=Rm(D.source,Tt(Ve.exec(D))+"g")),D.lastIndex=0;ve=D.exec(be);)var we=ve.index;te=te.slice(0,we===n?U:we)}}else if(d.indexOf(Cr(D),U)!=U){var Me=te.lastIndexOf(D);Me>-1&&(te=te.slice(0,Me))}return te+C}function P6(d){return d=Tt(d),d&&li.test(d)?d.replace(jn,nN):d}var O6=ul(function(d,h,b){return d+(b?" ":"")+h.toUpperCase()}),hv=Q_("toUpperCase");function KS(d,h,b){return d=Tt(d),h=b?n:h,h===n?Q5(d)?iN(d):V5(d):d.match(h)||[]}var XS=mt(function(d,h){try{return _r(d,n,h)}catch(b){return cv(b)?b:new nt(b)}}),$6=hi(function(d,h){return Yr(h,function(b){b=Io(b),di(d,b,av(d[b],d))}),d});function D6(d){var h=d==null?0:d.length,b=Ge();return d=h?nn(d,function(C){if(typeof C[1]!="function")throw new Kr(s);return[b(C[0]),C[1]]}):[],mt(function(C){for(var D=-1;++D<h;){var L=d[D];if(_r(L[0],this,C))return _r(L[1],this,C)}})}function T6(d){return n3(Qr(d,f))}function pv(d){return function(){return d}}function k6(d,h){return d==null||d!==d?h:d}var M6=Z_(),A6=Z_(!0);function sr(d){return d}function gv(d){return $_(typeof d=="function"?d:Qr(d,f))}function I6(d){return T_(Qr(d,f))}function N6(d,h){return k_(d,Qr(h,f))}var L6=mt(function(d,h){return function(b){return Vc(b,d,h)}}),F6=mt(function(d,h){return function(b){return Vc(d,b,h)}});function mv(d,h,b){var C=Pn(h),D=kf(h,C);b==null&&!(sn(h)&&(D.length||!C.length))&&(b=h,h=d,d=this,D=kf(h,Pn(h)));var L=!(sn(b)&&"chain"in b)||!!b.chain,V=gi(d);return Yr(D,function(U){var te=h[U];d[U]=te,V&&(d.prototype[U]=function(){var ve=this.__chain__;if(L||ve){var be=d(this.__wrapped__),we=be.__actions__=rr(this.__actions__);return we.push({func:te,args:arguments,thisArg:d}),be.__chain__=ve,be}return te.apply(d,Hi([this.value()],arguments))})}),d}function z6(){return kn._===this&&(kn._=dN),this}function vv(){}function j6(d){return d=at(d),mt(function(h){return M_(h,d)})}var B6=Ym(nn),V6=Ym(e_),H6=Ym(ym);function QS(d){return tv(d)?xm(Io(d)):y3(d)}function W6(d){return function(h){return d==null?n:Ks(d,h)}}var U6=tS(),q6=tS(!0);function bv(){return[]}function yv(){return!1}function G6(){return{}}function Y6(){return""}function K6(){return!0}function X6(d,h){if(d=at(d),d<1||d>X)return[];var b=H,C=Bn(d,H);h=Ge(h),d-=H;for(var D=Sm(C,h);++b<d;)h(b);return D}function Q6(d){return ot(d)?nn(d,Io):Er(d)?[d]:rr(vS(Tt(d)))}function J6(d){var h=++cN;return Tt(d)+h}var Z6=Ff(function(d,h){return d+h},0),e4=Km("ceil"),t4=Ff(function(d,h){return d/h},1),n4=Km("floor");function r4(d){return d&&d.length?Tf(d,sr,Am):n}function o4(d,h){return d&&d.length?Tf(d,Ge(h,2),Am):n}function i4(d){return r_(d,sr)}function s4(d,h){return r_(d,Ge(h,2))}function a4(d){return d&&d.length?Tf(d,sr,Fm):n}function l4(d,h){return d&&d.length?Tf(d,Ge(h,2),Fm):n}var c4=Ff(function(d,h){return d*h},1),u4=Km("round"),d4=Ff(function(d,h){return d-h},0);function f4(d){return d&&d.length?_m(d,sr):0}function h4(d,h){return d&&d.length?_m(d,Ge(h,2)):0}return A.after=I7,A.ary=OS,A.assign=_F,A.assignIn=VS,A.assignInWith=Qf,A.assignWith=SF,A.at=CF,A.before=$S,A.bind=av,A.bindAll=$6,A.bindKey=DS,A.castArray=G7,A.chain=ES,A.chunk=nL,A.compact=rL,A.concat=oL,A.cond=D6,A.conforms=T6,A.constant=pv,A.countBy=f7,A.create=EF,A.curry=TS,A.curryRight=kS,A.debounce=MS,A.defaults=RF,A.defaultsDeep=PF,A.defer=N7,A.delay=L7,A.difference=iL,A.differenceBy=sL,A.differenceWith=aL,A.drop=lL,A.dropRight=cL,A.dropRightWhile=uL,A.dropWhile=dL,A.fill=fL,A.filter=p7,A.flatMap=v7,A.flatMapDeep=b7,A.flatMapDepth=y7,A.flatten=wS,A.flattenDeep=hL,A.flattenDepth=pL,A.flip=F7,A.flow=M6,A.flowRight=A6,A.fromPairs=gL,A.functions=AF,A.functionsIn=IF,A.groupBy=x7,A.initial=vL,A.intersection=bL,A.intersectionBy=yL,A.intersectionWith=xL,A.invert=LF,A.invertBy=FF,A.invokeMap=_7,A.iteratee=gv,A.keyBy=S7,A.keys=Pn,A.keysIn=ir,A.map=Uf,A.mapKeys=jF,A.mapValues=BF,A.matches=I6,A.matchesProperty=N6,A.memoize=Gf,A.merge=VF,A.mergeWith=HS,A.method=L6,A.methodOf=F6,A.mixin=mv,A.negate=Yf,A.nthArg=j6,A.omit=HF,A.omitBy=WF,A.once=z7,A.orderBy=C7,A.over=B6,A.overArgs=j7,A.overEvery=V6,A.overSome=H6,A.partial=lv,A.partialRight=AS,A.partition=E7,A.pick=UF,A.pickBy=WS,A.property=QS,A.propertyOf=W6,A.pull=CL,A.pullAll=SS,A.pullAllBy=EL,A.pullAllWith=RL,A.pullAt=PL,A.range=U6,A.rangeRight=q6,A.rearg=B7,A.reject=O7,A.remove=OL,A.rest=V7,A.reverse=iv,A.sampleSize=D7,A.set=GF,A.setWith=YF,A.shuffle=T7,A.slice=$L,A.sortBy=A7,A.sortedUniq=NL,A.sortedUniqBy=LL,A.split=v6,A.spread=H7,A.tail=FL,A.take=zL,A.takeRight=jL,A.takeRightWhile=BL,A.takeWhile=VL,A.tap=r7,A.throttle=W7,A.thru=Wf,A.toArray=zS,A.toPairs=US,A.toPairsIn=qS,A.toPath=Q6,A.toPlainObject=BS,A.transform=KF,A.unary=U7,A.union=HL,A.unionBy=WL,A.unionWith=UL,A.uniq=qL,A.uniqBy=GL,A.uniqWith=YL,A.unset=XF,A.unzip=sv,A.unzipWith=CS,A.update=QF,A.updateWith=JF,A.values=hl,A.valuesIn=ZF,A.without=KL,A.words=KS,A.wrap=q7,A.xor=XL,A.xorBy=QL,A.xorWith=JL,A.zip=ZL,A.zipObject=e7,A.zipObjectDeep=t7,A.zipWith=n7,A.entries=US,A.entriesIn=qS,A.extend=VS,A.extendWith=Qf,mv(A,A),A.add=Z6,A.attempt=XS,A.camelCase=r6,A.capitalize=GS,A.ceil=e4,A.clamp=e6,A.clone=Y7,A.cloneDeep=X7,A.cloneDeepWith=Q7,A.cloneWith=K7,A.conformsTo=J7,A.deburr=YS,A.defaultTo=k6,A.divide=t4,A.endsWith=o6,A.eq=bo,A.escape=i6,A.escapeRegExp=s6,A.every=h7,A.find=g7,A.findIndex=yS,A.findKey=OF,A.findLast=m7,A.findLastIndex=xS,A.findLastKey=$F,A.floor=n4,A.forEach=RS,A.forEachRight=PS,A.forIn=DF,A.forInRight=TF,A.forOwn=kF,A.forOwnRight=MF,A.get=dv,A.gt=Z7,A.gte=eF,A.has=NF,A.hasIn=fv,A.head=_S,A.identity=sr,A.includes=w7,A.indexOf=mL,A.inRange=t6,A.invoke=zF,A.isArguments=Js,A.isArray=ot,A.isArrayBuffer=tF,A.isArrayLike=or,A.isArrayLikeObject=pn,A.isBoolean=nF,A.isBuffer=Xi,A.isDate=rF,A.isElement=oF,A.isEmpty=iF,A.isEqual=sF,A.isEqualWith=aF,A.isError=cv,A.isFinite=lF,A.isFunction=gi,A.isInteger=IS,A.isLength=Kf,A.isMap=NS,A.isMatch=cF,A.isMatchWith=uF,A.isNaN=dF,A.isNative=fF,A.isNil=pF,A.isNull=hF,A.isNumber=LS,A.isObject=sn,A.isObjectLike=cn,A.isPlainObject=Yc,A.isRegExp=uv,A.isSafeInteger=gF,A.isSet=FS,A.isString=Xf,A.isSymbol=Er,A.isTypedArray=fl,A.isUndefined=mF,A.isWeakMap=vF,A.isWeakSet=bF,A.join=wL,A.kebabCase=a6,A.last=Zr,A.lastIndexOf=_L,A.lowerCase=l6,A.lowerFirst=c6,A.lt=yF,A.lte=xF,A.max=r4,A.maxBy=o4,A.mean=i4,A.meanBy=s4,A.min=a4,A.minBy=l4,A.stubArray=bv,A.stubFalse=yv,A.stubObject=G6,A.stubString=Y6,A.stubTrue=K6,A.multiply=c4,A.nth=SL,A.noConflict=z6,A.noop=vv,A.now=qf,A.pad=u6,A.padEnd=d6,A.padStart=f6,A.parseInt=h6,A.random=n6,A.reduce=R7,A.reduceRight=P7,A.repeat=p6,A.replace=g6,A.result=qF,A.round=u4,A.runInContext=Q,A.sample=$7,A.size=k7,A.snakeCase=m6,A.some=M7,A.sortedIndex=DL,A.sortedIndexBy=TL,A.sortedIndexOf=kL,A.sortedLastIndex=ML,A.sortedLastIndexBy=AL,A.sortedLastIndexOf=IL,A.startCase=b6,A.startsWith=y6,A.subtract=d4,A.sum=f4,A.sumBy=h4,A.template=x6,A.times=X6,A.toFinite=mi,A.toInteger=at,A.toLength=jS,A.toLower=w6,A.toNumber=eo,A.toSafeInteger=wF,A.toString=Tt,A.toUpper=_6,A.trim=S6,A.trimEnd=C6,A.trimStart=E6,A.truncate=R6,A.unescape=P6,A.uniqueId=J6,A.upperCase=O6,A.upperFirst=hv,A.each=RS,A.eachRight=PS,A.first=_S,mv(A,function(){var d={};return Mo(A,function(h,b){Nt.call(A.prototype,b)||(d[b]=h)}),d}(),{chain:!1}),A.VERSION=r,Yr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(d){A[d].placeholder=A}),Yr(["drop","take"],function(d,h){St.prototype[d]=function(b){b=b===n?1:wn(at(b),0);var C=this.__filtered__&&!h?new St(this):this.clone();return C.__filtered__?C.__takeCount__=Bn(b,C.__takeCount__):C.__views__.push({size:Bn(b,H),type:d+(C.__dir__<0?"Right":"")}),C},St.prototype[d+"Right"]=function(b){return this.reverse()[d](b).reverse()}}),Yr(["filter","map","takeWhile"],function(d,h){var b=h+1,C=b==G||b==ee;St.prototype[d]=function(D){var L=this.clone();return L.__iteratees__.push({iteratee:Ge(D,3),type:b}),L.__filtered__=L.__filtered__||C,L}}),Yr(["head","last"],function(d,h){var b="take"+(h?"Right":"");St.prototype[d]=function(){return this[b](1).value()[0]}}),Yr(["initial","tail"],function(d,h){var b="drop"+(h?"":"Right");St.prototype[d]=function(){return this.__filtered__?new St(this):this[b](1)}}),St.prototype.compact=function(){return this.filter(sr)},St.prototype.find=function(d){return this.filter(d).head()},St.prototype.findLast=function(d){return this.reverse().find(d)},St.prototype.invokeMap=mt(function(d,h){return typeof d=="function"?new St(this):this.map(function(b){return Vc(b,d,h)})}),St.prototype.reject=function(d){return this.filter(Yf(Ge(d)))},St.prototype.slice=function(d,h){d=at(d);var b=this;return b.__filtered__&&(d>0||h<0)?new St(b):(d<0?b=b.takeRight(-d):d&&(b=b.drop(d)),h!==n&&(h=at(h),b=h<0?b.dropRight(-h):b.take(h-d)),b)},St.prototype.takeRightWhile=function(d){return this.reverse().takeWhile(d).reverse()},St.prototype.toArray=function(){return this.take(H)},Mo(St.prototype,function(d,h){var b=/^(?:filter|find|map|reject)|While$/.test(h),C=/^(?:head|last)$/.test(h),D=A[C?"take"+(h=="last"?"Right":""):h],L=C||/^find/.test(h);D&&(A.prototype[h]=function(){var V=this.__wrapped__,U=C?[1]:arguments,te=V instanceof St,ve=U[0],be=te||ot(V),we=function(wt){var Ct=D.apply(A,Hi([wt],U));return C&&Me?Ct[0]:Ct};be&&b&&typeof ve=="function"&&ve.length!=1&&(te=be=!1);var Me=this.__chain__,Be=!!this.__actions__.length,Ye=L&&!Me,ft=te&&!Be;if(!L&&be){V=ft?V:new St(this);var Ke=d.apply(V,U);return Ke.__actions__.push({func:Wf,args:[we],thisArg:n}),new Xr(Ke,Me)}return Ye&&ft?d.apply(this,U):(Ke=this.thru(we),Ye?C?Ke.value()[0]:Ke.value():Ke)})}),Yr(["pop","push","shift","sort","splice","unshift"],function(d){var h=mf[d],b=/^(?:push|sort|unshift)$/.test(d)?"tap":"thru",C=/^(?:pop|shift)$/.test(d);A.prototype[d]=function(){var D=arguments;if(C&&!this.__chain__){var L=this.value();return h.apply(ot(L)?L:[],D)}return this[b](function(V){return h.apply(ot(V)?V:[],D)})}}),Mo(St.prototype,function(d,h){var b=A[h];if(b){var C=b.name+"";Nt.call(al,C)||(al[C]=[]),al[C].push({name:h,func:b})}}),al[Lf(n,w).name]=[{name:"wrapper",func:n}],St.prototype.clone=PN,St.prototype.reverse=ON,St.prototype.value=$N,A.prototype.at=o7,A.prototype.chain=i7,A.prototype.commit=s7,A.prototype.next=a7,A.prototype.plant=c7,A.prototype.reverse=u7,A.prototype.toJSON=A.prototype.valueOf=A.prototype.value=d7,A.prototype.first=A.prototype.head,Ic&&(A.prototype[Ic]=l7),A},ol=sN();Ws?((Ws.exports=ol)._=ol,gm._=ol):kn._=ol}).call(as)})(yp,yp.exports);var $l=yp.exports;const ki=vc($l);function bC({id:e,layouts:t,initialHeight:n,y:r,w:o,minH:i}){const s={i:e,x:0,y:r??1/0,w:o||20,h:n||35,minW:6,minH:i||10};t||(t={}),s$.forEach(a=>{t!=null&&t[a]||(t={...t,[a]:[]}),t[a].push(s)})}function yC(e,t){t&&s$.forEach(n=>{t!=null&&t[n]&&(t[n]=t[n].filter(r=>r.i!==e))})}const Te=YO()(t$((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:l0},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&$l.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},addFilteringCard:n=>{e(r=>{var o;(o=r.filteringCards)==null||o.push(n)})},removeFilteringCard:n=>{e(r=>{var i,s;const o=(i=r.filteringCards)==null?void 0:i.findIndex(a=>a.id===n.id);o!==void 0&&o>-1&&((s=r.filteringCards)==null||s.splice(o,1))})},setCustomCards:n=>{e(r=>{r.dashboard.customCards=n})},setAuthToken:n=>{e(()=>({authToken:n}))},setThemeStyle:n=>{e(()=>({themeStyle:n}))},setDashboard:n=>e({dashboard:n}),setBookmarkKey:n=>{e(()=>({bookmarkKey:n}))},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&$l.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(g=>g.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&$l.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(f=>f.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&$l.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(g=>g.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(c=s.cards)==null?void 0:c.find(g=>g.id===r);f&&(f.sql=o,(u=i.onUpdateCard)==null||u.call(i,f,n))}})},setFrameCardData:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&$l.forEach(s.frames,c=>{var f;const u=(f=c.cards)==null?void 0:f.find(g=>g.id===r);u&&(u.data=o)})})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n];const o=(s=r.dashboard.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId);bC({id:n.id,layouts:o==null?void 0:o.layouts,y:0,initialHeight:8,minH:7,w:10})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1);const l=(s=r.dashboard.sheets)==null?void 0:s.find(c=>c.id===r.selectedSheetId);yC(n,l==null?void 0:l.layouts)}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,f,g;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(p=>p.id===r);if(a){const p=(f=a.cards)==null?void 0:f.findIndex(v=>v.id===o.id);p>-1&&((g=a.cards)==null||g.splice(p,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r)=>{e(o=>{var s,a,l,c;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(u=>u.id===n);i&&(i.frames||(i.frames=[]),(l=i.frames)==null||l.push(r),bC({id:r.id,layouts:i.layouts,minH:10}),(c=o.onAddFrame)==null||c.call(o,r,n))})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(i){const f=(l=i.frames)==null?void 0:l.findIndex(g=>g.id===r);console.log(f),typeof f=="number"&&f>-1&&((c=i.frames)==null||c.splice(f,1),(u=i.layout)==null||u.splice(f,1),yC(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r))})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(g=>g.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(f=o.onUpdateCard)==null||f.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,f,g;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(f=i.layout)==null||f.splice(s,1),(g=o.onRemoveCard)==null||g.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnUpdateCard:n=>{e(()=>({onUpdateCard:n}))},setOnRemoveCard:n=>{e(()=>({onRemoveCard:n}))},setOnEvent:n=>{e(()=>({onEvent:n}))},getDashboard:()=>t().dashboard,getSelectedSheet:()=>{var n,r;return(r=(n=t().dashboard)==null?void 0:n.sheets)==null?void 0:r.find(o=>o.id===t().selectedSheetId)},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},handleDataPointClickAction:(n,r)=>{I9({card:n,dataPoint:r,set:e,get:t})}}}))),Li=()=>Te(e=>e.actions);var jd=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(){}},oc=typeof window>"u"||"Deno"in window;function io(){}function N9(e,t){return typeof e=="function"?e(t):e}function c0(e){return typeof e=="number"&&e>=0&&e!==1/0}function l$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function xC(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Ky(s,t.options))return!1}else if(!Hu(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function wC(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Vu(t.options.mutationKey)!==Vu(i))return!1}else if(!Hu(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Ky(e,t){return((t==null?void 0:t.queryKeyHashFn)||Vu)(e)}function Vu(e){return JSON.stringify(e,(t,n)=>d0(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Hu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Hu(e[n],t[n])):!1}function c$(e,t){if(e===t)return e;const n=_C(e)&&_C(t);if(n||d0(e)&&d0(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];!n&&e[u]===void 0&&t[u]===void 0&&r.includes(u)?(a[u]=void 0,l++):(a[u]=c$(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function u0(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function _C(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function d0(e){if(!SC(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!SC(n)||!n.hasOwnProperty("isPrototypeOf"))}function SC(e){return Object.prototype.toString.call(e)==="[object Object]"}function L9(e){return new Promise(t=>{setTimeout(t,e)})}function f0(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?c$(e,t):t}function F9(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function z9(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var va,ls,jl,DO,j9=(DO=class extends jd{constructor(){super();He(this,va,void 0);He(this,ls,void 0);He(this,jl,void 0);Ie(this,jl,t=>{if(!oc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){J(this,ls)||this.setEventListener(J(this,jl))}onUnsubscribe(){var t;this.hasListeners()||((t=J(this,ls))==null||t.call(this),Ie(this,ls,void 0))}setEventListener(t){var n;Ie(this,jl,t),(n=J(this,ls))==null||n.call(this),Ie(this,ls,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){J(this,va)!==t&&(Ie(this,va,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof J(this,va)=="boolean"?J(this,va):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},va=new WeakMap,ls=new WeakMap,jl=new WeakMap,DO),xp=new j9,Bl,cs,Vl,TO,B9=(TO=class extends jd{constructor(){super();He(this,Bl,!0);He(this,cs,void 0);He(this,Vl,void 0);Ie(this,Vl,t=>{if(!oc&&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(){J(this,cs)||this.setEventListener(J(this,Vl))}onUnsubscribe(){var t;this.hasListeners()||((t=J(this,cs))==null||t.call(this),Ie(this,cs,void 0))}setEventListener(t){var n;Ie(this,Vl,t),(n=J(this,cs))==null||n.call(this),Ie(this,cs,t(this.setOnline.bind(this)))}setOnline(t){J(this,Bl)!==t&&(Ie(this,Bl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return J(this,Bl)}},Bl=new WeakMap,cs=new WeakMap,Vl=new WeakMap,TO),wp=new B9;function V9(e){return Math.min(1e3*2**e,3e4)}function sg(e){return(e??"online")==="online"?wp.isOnline():!0}var u$=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ov(e){return e instanceof u$}function d$(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((x,w)=>{i=x,s=w}),l=x=>{var w;r||(p(new u$(x)),(w=e.abort)==null||w.call(e))},c=()=>{t=!0},u=()=>{t=!1},f=()=>!xp.isFocused()||e.networkMode!=="always"&&!wp.isOnline(),g=x=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,x),o==null||o(),i(x))},p=x=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,x),o==null||o(),s(x))},v=()=>new Promise(x=>{var w;o=_=>{const S=r||!f();return S&&x(_),S},(w=e.onPause)==null||w.call(e)}).then(()=>{var x;o=void 0,r||(x=e.onContinue)==null||x.call(e)}),y=()=>{if(r)return;let x;try{x=e.fn()}catch(w){x=Promise.reject(w)}Promise.resolve(x).then(g).catch(w=>{var O;if(r)return;const _=e.retry??(oc?0:3),S=e.retryDelay??V9,R=typeof S=="function"?S(n,w):S,E=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,w);if(t||!E){p(w);return}n++,(O=e.onFail)==null||O.call(e,n,w),L9(R).then(()=>{if(f())return v()}).then(()=>{t?p(w):y()})})};return sg(e.networkMode)?y():v().then(y),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:c,continueRetry:u}}function H9(){let e=[],t=0,n=g=>{g()},r=g=>{g()},o=g=>setTimeout(g,0);const i=g=>{o=g},s=g=>{let p;t++;try{p=g()}finally{t--,t||c()}return p},a=g=>{t?e.push(g):o(()=>{n(g)})},l=g=>(...p)=>{a(()=>{g(...p)})},c=()=>{const g=e;e=[],g.length&&o(()=>{r(()=>{g.forEach(p=>{n(p)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:g=>{n=g},setBatchNotifyFunction:g=>{r=g},setScheduler:i}}var Nn=H9(),ba,kO,f$=(kO=class{constructor(){He(this,ba,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),c0(this.gcTime)&&Ie(this,ba,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(oc?1/0:5*60*1e3))}clearGcTimeout(){J(this,ba)&&(clearTimeout(J(this,ba)),Ie(this,ba,void 0))}},ba=new WeakMap,kO),Hl,Wl,no,us,ro,On,Rd,ya,Ul,Zh,_o,wi,MO,W9=(MO=class extends f${constructor(t){super();He(this,Ul);He(this,_o);He(this,Hl,void 0);He(this,Wl,void 0);He(this,no,void 0);He(this,us,void 0);He(this,ro,void 0);He(this,On,void 0);He(this,Rd,void 0);He(this,ya,void 0);Ie(this,ya,!1),Ie(this,Rd,t.defaultOptions),vt(this,Ul,Zh).call(this,t.options),Ie(this,On,[]),Ie(this,no,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ie(this,Hl,t.state||U9(this.options)),this.state=J(this,Hl),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!J(this,On).length&&this.state.fetchStatus==="idle"&&J(this,no).remove(this)}setData(t,n){const r=f0(this.state.data,t,this.options);return vt(this,_o,wi).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){vt(this,_o,wi).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=J(this,us);return(r=J(this,ro))==null||r.cancel(t),n?n.then(io).catch(io):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(J(this,Hl))}isActive(){return J(this,On).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||J(this,On).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!l$(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=J(this,On).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=J(this,ro))==null||n.continue()}onOnline(){var n;const t=J(this,On).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=J(this,ro))==null||n.continue()}addObserver(t){J(this,On).includes(t)||(J(this,On).push(t),this.clearGcTimeout(),J(this,no).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){J(this,On).includes(t)&&(Ie(this,On,J(this,On).filter(n=>n!==t)),J(this,On).length||(J(this,ro)&&(J(this,ya)?J(this,ro).cancel({revert:!0}):J(this,ro).cancelRetry()),this.scheduleGc()),J(this,no).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return J(this,On).length}invalidate(){this.state.isInvalidated||vt(this,_o,wi).call(this,{type:"invalidate"})}fetch(t,n){var c,u,f,g;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(J(this,us))return(c=J(this,ro))==null||c.continueRetry(),J(this,us)}if(t&&vt(this,Ul,Zh).call(this,t),!this.options.queryFn){const p=J(this,On).find(v=>v.options.queryFn);p&&vt(this,Ul,Zh).call(this,p.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const r=new AbortController,o={queryKey:this.queryKey,meta:this.meta},i=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(Ie(this,ya,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Ie(this,ya,!1),this.options.persister?this.options.persister(this.options.queryFn,o,this):this.options.queryFn(o)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(u=this.options.behavior)==null||u.onFetch(a,this),Ie(this,Wl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&vt(this,_o,wi).call(this,{type:"fetch",meta:(g=a.fetchOptions)==null?void 0:g.meta});const l=p=>{var v,y,x,w;Ov(p)&&p.silent||vt(this,_o,wi).call(this,{type:"error",error:p}),Ov(p)||((y=(v=J(this,no).config).onError)==null||y.call(v,p,this),(w=(x=J(this,no).config).onSettled)==null||w.call(x,this.state.data,p,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Ie(this,ro,d$({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var v,y,x,w;if(typeof p>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),l(new Error(`${this.queryHash} data is undefined`));return}this.setData(p),(y=(v=J(this,no).config).onSuccess)==null||y.call(v,p,this),(w=(x=J(this,no).config).onSettled)==null||w.call(x,p,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(p,v)=>{vt(this,_o,wi).call(this,{type:"failed",failureCount:p,error:v})},onPause:()=>{vt(this,_o,wi).call(this,{type:"pause"})},onContinue:()=>{vt(this,_o,wi).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Ie(this,us,J(this,ro).promise),J(this,us)}},Hl=new WeakMap,Wl=new WeakMap,no=new WeakMap,us=new WeakMap,ro=new WeakMap,On=new WeakMap,Rd=new WeakMap,ya=new WeakMap,Ul=new WeakSet,Zh=function(t){this.options={...J(this,Rd),...t},this.updateGcTime(this.options.gcTime)},_o=new WeakSet,wi=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,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:sg(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Ov(o)&&o.revert&&J(this,Wl)?{...J(this,Wl),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Nn.batch(()=>{J(this,On).forEach(r=>{r.onQueryUpdate()}),J(this,no).notify({query:this,type:"updated",action:t})})},MO);function U9(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=typeof t<"u",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 jo,AO,h$=(AO=class extends jd{constructor(t={}){super();He(this,jo,void 0);this.config=t,Ie(this,jo,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Ky(o,n);let s=this.get(i);return s||(s=new W9({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){J(this,jo).has(t.queryHash)||(J(this,jo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=J(this,jo).get(t.queryHash);n&&(t.destroy(),n===t&&J(this,jo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Nn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return J(this,jo).get(t)}getAll(){return[...J(this,jo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>xC(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>xC(t,r)):n}notify(t){Nn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Nn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Nn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},jo=new WeakMap,AO),Bo,Pd,kr,ql,Vo,is,IO,q9=(IO=class extends f${constructor(t){super();He(this,Vo);He(this,Bo,void 0);He(this,Pd,void 0);He(this,kr,void 0);He(this,ql,void 0);this.mutationId=t.mutationId,Ie(this,Pd,t.defaultOptions),Ie(this,kr,t.mutationCache),Ie(this,Bo,[]),this.state=t.state||G9(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...J(this,Pd),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){J(this,Bo).includes(t)||(J(this,Bo).push(t),this.clearGcTimeout(),J(this,kr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ie(this,Bo,J(this,Bo).filter(n=>n!==t)),this.scheduleGc(),J(this,kr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){J(this,Bo).length||(this.state.status==="pending"?this.scheduleGc():J(this,kr).remove(this))}continue(){var t;return((t=J(this,ql))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,f,g,p,v,y,x,w,_,S,R,E,O,k;const n=()=>(Ie(this,ql,d$({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,M)=>{vt(this,Vo,is).call(this,{type:"failed",failureCount:T,error:M})},onPause:()=>{vt(this,Vo,is).call(this,{type:"pause"})},onContinue:()=>{vt(this,Vo,is).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),J(this,ql).promise),r=this.state.status==="pending";try{if(!r){vt(this,Vo,is).call(this,{type:"pending",variables:t}),await((i=(o=J(this,kr).config).onMutate)==null?void 0:i.call(o,t,this));const M=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));M!==this.state.context&&vt(this,Vo,is).call(this,{type:"pending",context:M,variables:t})}const T=await n();return await((c=(l=J(this,kr).config).onSuccess)==null?void 0:c.call(l,T,t,this.state.context,this)),await((f=(u=this.options).onSuccess)==null?void 0:f.call(u,T,t,this.state.context)),await((p=(g=J(this,kr).config).onSettled)==null?void 0:p.call(g,T,null,this.state.variables,this.state.context,this)),await((y=(v=this.options).onSettled)==null?void 0:y.call(v,T,null,t,this.state.context)),vt(this,Vo,is).call(this,{type:"success",data:T}),T}catch(T){try{throw await((w=(x=J(this,kr).config).onError)==null?void 0:w.call(x,T,t,this.state.context,this)),await((S=(_=this.options).onError)==null?void 0:S.call(_,T,t,this.state.context)),await((E=(R=J(this,kr).config).onSettled)==null?void 0:E.call(R,void 0,T,this.state.variables,this.state.context,this)),await((k=(O=this.options).onSettled)==null?void 0:k.call(O,void 0,T,t,this.state.context)),T}finally{vt(this,Vo,is).call(this,{type:"error",error:T})}}}},Bo=new WeakMap,Pd=new WeakMap,kr=new WeakMap,ql=new WeakMap,Vo=new WeakSet,is=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:!sg(this.options.networkMode),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),Nn.batch(()=>{J(this,Bo).forEach(r=>{r.onMutationUpdate(t)}),J(this,kr).notify({mutation:this,type:"updated",action:t})})},IO);function G9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var oo,Od,xa,NO,Y9=(NO=class extends jd{constructor(t={}){super();He(this,oo,void 0);He(this,Od,void 0);He(this,xa,void 0);this.config=t,Ie(this,oo,[]),Ie(this,Od,0)}build(t,n,r){const o=new q9({mutationCache:this,mutationId:++Jf(this,Od)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){J(this,oo).push(t),this.notify({type:"added",mutation:t})}remove(t){Ie(this,oo,J(this,oo).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Nn.batch(()=>{J(this,oo).forEach(t=>{this.remove(t)})})}getAll(){return J(this,oo)}find(t){const n={exact:!0,...t};return J(this,oo).find(r=>wC(n,r))}findAll(t={}){return J(this,oo).filter(n=>wC(t,n))}notify(t){Nn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Ie(this,xa,(J(this,xa)??Promise.resolve()).then(()=>{const t=J(this,oo).filter(n=>n.state.isPaused);return Nn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(io)),Promise.resolve()))}).then(()=>{Ie(this,xa,void 0)})),J(this,xa)}},oo=new WeakMap,Od=new WeakMap,xa=new WeakMap,NO);function K9(e){return{onFetch:(t,n)=>{const r=async()=>{var v,y,x,w,_;const o=t.options,i=(x=(y=(v=t.fetchOptions)==null?void 0:v.meta)==null?void 0:y.fetchMore)==null?void 0:x.direction,s=((w=t.state.data)==null?void 0:w.pages)||[],a=((_=t.state.data)==null?void 0:_.pageParams)||[],l={pages:[],pageParams:[]};let c=!1;const u=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(t.signal.aborted?c=!0:t.signal.addEventListener("abort",()=>{c=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),g=async(S,R,E)=>{if(c)return Promise.reject();if(R==null&&S.pages.length)return Promise.resolve(S);const O={queryKey:t.queryKey,pageParam:R,direction:E?"backward":"forward",meta:t.options.meta};u(O);const k=await f(O),{maxPages:T}=t.options,M=E?z9:F9;return{pages:M(S.pages,k,T),pageParams:M(S.pageParams,R,T)}};let p;if(i&&s.length){const S=i==="backward",R=S?X9:CC,E={pages:s,pageParams:a},O=R(o,E);p=await g(E,O,S)}else{p=await g(l,a[0]??o.initialPageParam);const S=e??s.length;for(let R=1;R<S;R++){const E=CC(o,p);p=await g(p,E)}}return p};t.options.persister?t.fetchFn=()=>{var o,i;return(i=(o=t.options).persister)==null?void 0:i.call(o,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function CC(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function X9(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var _n,ds,fs,Gl,Yl,hs,Kl,Xl,LO,Q9=(LO=class{constructor(e={}){He(this,_n,void 0);He(this,ds,void 0);He(this,fs,void 0);He(this,Gl,void 0);He(this,Yl,void 0);He(this,hs,void 0);He(this,Kl,void 0);He(this,Xl,void 0);Ie(this,_n,e.queryCache||new h$),Ie(this,ds,e.mutationCache||new Y9),Ie(this,fs,e.defaultOptions||{}),Ie(this,Gl,new Map),Ie(this,Yl,new Map),Ie(this,hs,0)}mount(){Jf(this,hs)._++,J(this,hs)===1&&(Ie(this,Kl,xp.subscribe(()=>{xp.isFocused()&&(this.resumePausedMutations(),J(this,_n).onFocus())})),Ie(this,Xl,wp.subscribe(()=>{wp.isOnline()&&(this.resumePausedMutations(),J(this,_n).onOnline())})))}unmount(){var e,t;Jf(this,hs)._--,J(this,hs)===0&&((e=J(this,Kl))==null||e.call(this),Ie(this,Kl,void 0),(t=J(this,Xl))==null||t.call(this),Ie(this,Xl,void 0))}isFetching(e){return J(this,_n).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return J(this,ds).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=J(this,_n).find({queryKey:e}))==null?void 0:t.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(e)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=J(this,_n).find({queryKey:e}),o=r==null?void 0:r.state.data,i=N9(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return J(this,_n).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Nn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=J(this,_n).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=J(this,_n);Nn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=J(this,_n),r={type:"active",...e};return Nn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Nn.batch(()=>J(this,_n).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(io).catch(io)}invalidateQueries(e={},t={}){return Nn.batch(()=>{if(J(this,_n).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Nn.batch(()=>J(this,_n).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(io)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(io)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=J(this,_n).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(io).catch(io)}fetchInfiniteQuery(e){return e.behavior=K9(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(io).catch(io)}resumePausedMutations(){return J(this,ds).resumePausedMutations()}getQueryCache(){return J(this,_n)}getMutationCache(){return J(this,ds)}getDefaultOptions(){return J(this,fs)}setDefaultOptions(e){Ie(this,fs,e)}setQueryDefaults(e,t){J(this,Gl).set(Vu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...J(this,Gl).values()];let n={};return t.forEach(r=>{Hu(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){J(this,Yl).set(Vu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...J(this,Yl).values()];let n={};return t.forEach(r=>{Hu(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...J(this,fs).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ky(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...J(this,fs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){J(this,_n).clear(),J(this,ds).clear()}},_n=new WeakMap,ds=new WeakMap,fs=new WeakMap,Gl=new WeakMap,Yl=new WeakMap,hs=new WeakMap,Kl=new WeakMap,Xl=new WeakMap,LO),fr,Xt,$d,er,wa,Ql,Ho,Dd,Jl,Zl,_a,Sa,ps,ec,Ca,pu,Td,h0,kd,p0,Md,g0,Ad,m0,Id,v0,Nd,b0,Ld,y0,eg,p$,FO,J9=(FO=class extends jd{constructor(t,n){super();He(this,Ca);He(this,Td);He(this,kd);He(this,Md);He(this,Ad);He(this,Id);He(this,Nd);He(this,Ld);He(this,eg);He(this,fr,void 0);He(this,Xt,void 0);He(this,$d,void 0);He(this,er,void 0);He(this,wa,void 0);He(this,Ql,void 0);He(this,Ho,void 0);He(this,Dd,void 0);He(this,Jl,void 0);He(this,Zl,void 0);He(this,_a,void 0);He(this,Sa,void 0);He(this,ps,void 0);He(this,ec,new Set);this.options=n,Ie(this,fr,t),Ie(this,Ho,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(J(this,Xt).addObserver(this),EC(J(this,Xt),this.options)?vt(this,Ca,pu).call(this):this.updateResult(),vt(this,Ad,m0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return x0(J(this,Xt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return x0(J(this,Xt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,vt(this,Id,v0).call(this),vt(this,Nd,b0).call(this),J(this,Xt).removeObserver(this)}setOptions(t,n){const r=this.options,o=J(this,Xt);if(this.options=J(this,fr).defaultQueryOptions(t),u0(r,this.options)||J(this,fr).getQueryCache().notify({type:"observerOptionsUpdated",query:J(this,Xt),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),vt(this,Ld,y0).call(this);const i=this.hasListeners();i&&RC(J(this,Xt),o,this.options,r)&&vt(this,Ca,pu).call(this),this.updateResult(n),i&&(J(this,Xt)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&vt(this,Td,h0).call(this);const s=vt(this,kd,p0).call(this);i&&(J(this,Xt)!==o||this.options.enabled!==r.enabled||s!==J(this,ps))&&vt(this,Md,g0).call(this,s)}getOptimisticResult(t){const n=J(this,fr).getQueryCache().build(J(this,fr),t),r=this.createResult(n,t);return e8(this,r)&&(Ie(this,er,r),Ie(this,Ql,this.options),Ie(this,wa,J(this,Xt).state)),r}getCurrentResult(){return J(this,er)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(J(this,ec).add(r),t[r])})}),n}getCurrentQuery(){return J(this,Xt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=J(this,fr).defaultQueryOptions(t),r=J(this,fr).getQueryCache().build(J(this,fr),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return vt(this,Ca,pu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),J(this,er)))}createResult(t,n){var O;const r=J(this,Xt),o=this.options,i=J(this,er),s=J(this,wa),a=J(this,Ql),c=t!==r?t.state:J(this,$d),{state:u}=t;let{error:f,errorUpdatedAt:g,fetchStatus:p,status:v}=u,y=!1,x;if(n._optimisticResults){const k=this.hasListeners(),T=!k&&EC(t,n),M=k&&RC(t,r,n,o);(T||M)&&(p=sg(t.options.networkMode)?"fetching":"paused",u.dataUpdatedAt||(v="pending")),n._optimisticResults==="isRestoring"&&(p="idle")}if(n.select&&typeof u.data<"u")if(i&&u.data===(s==null?void 0:s.data)&&n.select===J(this,Dd))x=J(this,Jl);else try{Ie(this,Dd,n.select),x=n.select(u.data),x=f0(i==null?void 0:i.data,x,n),Ie(this,Jl,x),Ie(this,Ho,null)}catch(k){Ie(this,Ho,k)}else x=u.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&v==="pending"){let k;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))k=i.data;else if(k=typeof n.placeholderData=="function"?n.placeholderData((O=J(this,Zl))==null?void 0:O.state.data,J(this,Zl)):n.placeholderData,n.select&&typeof k<"u")try{k=n.select(k),Ie(this,Ho,null)}catch(T){Ie(this,Ho,T)}typeof k<"u"&&(v="success",x=f0(i==null?void 0:i.data,k,n),y=!0)}J(this,Ho)&&(f=J(this,Ho),x=J(this,Jl),g=Date.now(),v="error");const w=p==="fetching",_=v==="pending",S=v==="error",R=_&&w;return{status:v,fetchStatus:p,isPending:_,isSuccess:v==="success",isError:S,isInitialLoading:R,isLoading:R,data:x,dataUpdatedAt:u.dataUpdatedAt,error:f,errorUpdatedAt:g,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdateCount:u.errorUpdateCount,isFetched:u.dataUpdateCount>0||u.errorUpdateCount>0,isFetchedAfterMount:u.dataUpdateCount>c.dataUpdateCount||u.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!_,isLoadingError:S&&u.dataUpdatedAt===0,isPaused:p==="paused",isPlaceholderData:y,isRefetchError:S&&u.dataUpdatedAt!==0,isStale:Xy(t,n),refetch:this.refetch}}updateResult(t){const n=J(this,er),r=this.createResult(J(this,Xt),this.options);if(Ie(this,wa,J(this,Xt).state),Ie(this,Ql,this.options),J(this,wa).data!==void 0&&Ie(this,Zl,J(this,Xt)),u0(r,n))return;Ie(this,er,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!J(this,ec).size)return!0;const l=new Set(a??J(this,ec));return this.options.throwOnError&&l.add("error"),Object.keys(J(this,er)).some(c=>{const u=c;return J(this,er)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),vt(this,eg,p$).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&vt(this,Ad,m0).call(this)}},fr=new WeakMap,Xt=new WeakMap,$d=new WeakMap,er=new WeakMap,wa=new WeakMap,Ql=new WeakMap,Ho=new WeakMap,Dd=new WeakMap,Jl=new WeakMap,Zl=new WeakMap,_a=new WeakMap,Sa=new WeakMap,ps=new WeakMap,ec=new WeakMap,Ca=new WeakSet,pu=function(t){vt(this,Ld,y0).call(this);let n=J(this,Xt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(io)),n},Td=new WeakSet,h0=function(){if(vt(this,Id,v0).call(this),oc||J(this,er).isStale||!c0(this.options.staleTime))return;const n=l$(J(this,er).dataUpdatedAt,this.options.staleTime)+1;Ie(this,_a,setTimeout(()=>{J(this,er).isStale||this.updateResult()},n))},kd=new WeakSet,p0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(J(this,Xt)):this.options.refetchInterval)??!1},Md=new WeakSet,g0=function(t){vt(this,Nd,b0).call(this),Ie(this,ps,t),!(oc||this.options.enabled===!1||!c0(J(this,ps))||J(this,ps)===0)&&Ie(this,Sa,setInterval(()=>{(this.options.refetchIntervalInBackground||xp.isFocused())&&vt(this,Ca,pu).call(this)},J(this,ps)))},Ad=new WeakSet,m0=function(){vt(this,Td,h0).call(this),vt(this,Md,g0).call(this,vt(this,kd,p0).call(this))},Id=new WeakSet,v0=function(){J(this,_a)&&(clearTimeout(J(this,_a)),Ie(this,_a,void 0))},Nd=new WeakSet,b0=function(){J(this,Sa)&&(clearInterval(J(this,Sa)),Ie(this,Sa,void 0))},Ld=new WeakSet,y0=function(){const t=J(this,fr).getQueryCache().build(J(this,fr),this.options);if(t===J(this,Xt))return;const n=J(this,Xt);Ie(this,Xt,t),Ie(this,$d,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},eg=new WeakSet,p$=function(t){Nn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(J(this,er))}),J(this,fr).getQueryCache().notify({query:J(this,Xt),type:"observerResultsUpdated"})})},FO);function Z9(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function EC(e,t){return Z9(e,t)||e.state.dataUpdatedAt>0&&x0(e,t,t.refetchOnMount)}function x0(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Xy(e,t)}return!1}function RC(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&Xy(e,n)}function Xy(e,t){return e.isStaleByTime(t.staleTime)}function e8(e,t){return!u0(e.getCurrentResult(),t)}var g$=fe.createContext(void 0),m$=e=>{const t=fe.useContext(g$);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},t8=({client:e,children:t})=>(fe.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),fe.createElement(g$.Provider,{value:e},t)),v$=fe.createContext(!1),n8=()=>fe.useContext(v$);v$.Provider;function r8(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var o8=fe.createContext(r8()),i8=()=>fe.useContext(o8);function s8(e,t){return typeof e=="function"?e(...t):!!e}var a8=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},l8=e=>{fe.useEffect(()=>{e.clearReset()},[e])},c8=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&s8(n,[e.error,r]),u8=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},d8=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,f8=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function h8(e,t,n){if(process.env.NODE_ENV!=="production"&&(typeof e!="object"||Array.isArray(e)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const r=m$(n),o=n8(),i=i8(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",u8(s),a8(s,i),l8(i);const[a]=fe.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(fe.useSyncExternalStore(fe.useCallback(c=>{const u=o?()=>{}:a.subscribe(Nn.batchCalls(c));return a.updateResult(),u},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),fe.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),d8(s,l))throw f8(s,a,i);if(c8({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function Bd(e,t){return h8(e,J9,t)}const p8={theme:"system",setTheme:()=>null},b$=m.createContext(p8);function g8({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=m.useState(()=>localStorage.getItem(n)||t);m.useEffect(()=>{const a=window.document.documentElement;if(a.classList.remove("light","dark"),o==="system"){const l=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";a.classList.add(l);return}a.classList.add(o)},[o]);const s={theme:o,setTheme:a=>{localStorage.setItem(n,a),i(a)}};return N.jsx(b$.Provider,{...r,value:s,children:e})}const y$=()=>{const e=m.useContext(b$);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function m8(e){return await(await fetch("https://semaphor.cloud/api/v1/dashboard",{headers:{Authorization:`Bearer ${e}`}})).json()}function x$(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function PC(e,t){const n=x$(e);return n==="dark"?ki.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function v8({authToken:e,customStyle:t,currentTheme:n,onSave:r,onEvent:o}){const{data:i,refetch:s,isLoading:a,isError:l}=Bd({queryKey:["dashboard",e==null?void 0:e.accessToken],queryFn:()=>m8(e==null?void 0:e.accessToken),enabled:!1}),{theme:c,setTheme:u}=y$(),{setDashboard:f,setSelectedSheetId:g,setStyle:p,setOnSaveFunction:v}=Te(E=>E.actions);Te(E=>E.actions.setCustomCards);const y=Te(E=>E.actions.setFilterValues),x=Te(E=>E.actions.setBookmarkKey),w=Te(E=>E.actions.setAuthToken),_=Te(E=>E.actions.setThemeStyle),S=Te(E=>E.actions.setDashboardTheme),R=Te(E=>E.actions.setOnEvent);return m.useEffect(()=>{if(c){const E=x$(c);S(E)}},[c,S]),m.useEffect(()=>{n&&u(n)},[n,u]),m.useEffect(()=>{const E=ki.cloneDeep(l0);if(t){const O=ki.merge(E,t),k=PC(c,O);_(k),p(O)}else{const O=PC(c,E);_(O),p(l0)}},[c,t,p,_]),m.useEffect(()=>{var M;if(!i||!i.dashboard)return;const E=i.dashboard,O=FA(E.id),k=JSON.parse(localStorage.getItem(O)||"[]"),T=k.find(F=>F.default===!0);if(T)f(T.template),x(T.name),T.filterValues&&y(T.filterValues);else{f(E);const F=k.find(z=>(z==null?void 0:z.name)==="Original");F?F.template=E:k.push({name:"Original",template:E,default:!1}),localStorage.setItem(O,JSON.stringify(k))}g((M=E.sheets)==null?void 0:M[0].id)},[i,f,g,y,x]),m.useEffect(()=>{r&&v(r),o&&R(o)},[r,v,o,R]),m.useEffect(()=>{e&&e.accessToken&&(w(e),s())},[e,s,w]),{isLoading:a,isError:l}}function Qy({className:e,...t}){return N.jsx("div",{className:Oe("animate-pulse rounded-md bg-muted",e),...t})}const Jy=fe.forwardRef(({className:e,...t},n)=>N.jsx("div",{ref:n,className:Oe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Jy.displayName="Card";const ag=fe.forwardRef(({className:e,...t},n)=>N.jsx("div",{ref:n,className:Oe("flex flex-col space-y-1.5 p-6",e),...t}));ag.displayName="CardHeader";const Vd=fe.forwardRef(({className:e,...t},n)=>N.jsx("h3",{ref:n,className:Oe("text-2xl font-semibold leading-none tracking-tight",e),...t}));Vd.displayName="CardTitle";const Zy=fe.forwardRef(({className:e,...t},n)=>N.jsx("p",{ref:n,className:Oe("text-sm text-muted-foreground",e),...t}));Zy.displayName="CardDescription";const lg=fe.forwardRef(({className:e,...t},n)=>N.jsx("div",{ref:n,className:Oe("px-6 pt-0",e),...t}));lg.displayName="CardContent";const ex=fe.forwardRef(({className:e,...t},n)=>N.jsx("div",{ref:n,className:Oe("flex items-center p-6 pt-0",e),...t}));ex.displayName="CardFooter";function w$({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:f,...g}){Te(w=>w.selectedSheetId);const p=Te(w=>w.themeStyle),v=Te(w=>w.isSessionExpired),{isLoading:y,isError:x}=v8({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r});return y||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?N.jsx(o,{message:"loading"}):N.jsx("div",{className:"flex items-center gap-3",children:N.jsx(Qy,{className:"h-1 w-full dark:h-[2px]"})})):x?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),N.jsx(i,{})):N.jsx("div",{children:"Error"})):v?(r==null||r({type:"error",message:"Session Expired"}),N.jsx("div",{className:"flex h-full items-center justify-center",children:N.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[N.jsx(Vd,{children:"Session Expired"}),N.jsx("p",{className:"text-muted-foreground",children:"Your session has expired. Please refresh the page to continue."})]})})):N.jsx("div",{className:Oe("flex h-full grow flex-col justify-between",p==null?void 0:p.dashboardPanel,e),role:"dashboard-panel",...g})}function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},se.apply(this,arguments)}function Ee(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Dn(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function c(f){const{scope:g,children:p,...v}=f,y=(g==null?void 0:g[e][l])||a,x=m.useMemo(()=>v,Object.values(v));return m.createElement(y.Provider,{value:x},p)}function u(f,g){const p=(g==null?void 0:g[e][l])||a,v=m.useContext(p);if(v)return v;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>m.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,b8(o,...t)]}function b8(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function y8(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function cg(...e){return t=>e.forEach(n=>y8(n,t))}function st(...e){return m.useCallback(cg(...e),e)}const Mi=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(x8);if(i){const s=i.props.children,a=o.map(l=>l===i?m.Children.count(s)>1?m.Children.only(null):m.isValidElement(s)?s.props.children:null:l);return m.createElement(w0,se({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(w0,se({},r,{ref:t}),n)});Mi.displayName="Slot";const w0=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...w8(r,n.props),ref:t?cg(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});w0.displayName="SlotClone";const _$=({children:e})=>m.createElement(m.Fragment,null,e);function x8(e){return m.isValidElement(e)&&e.type===_$}function w8(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function ug(e){const t=e+"CollectionProvider",[n,r]=Dn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:v,children:y}=p,x=m.useRef(null),w=m.useRef(new Map).current;return m.createElement(o,{scope:v,itemMap:w,collectionRef:x},y)},a=e+"CollectionSlot",l=m.forwardRef((p,v)=>{const{scope:y,children:x}=p,w=i(a,y),_=st(v,w.collectionRef);return m.createElement(Mi,{ref:_},x)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",f=m.forwardRef((p,v)=>{const{scope:y,children:x,...w}=p,_=m.useRef(null),S=st(v,_),R=i(c,y);return m.useEffect(()=>(R.itemMap.set(_,{ref:_,...w}),()=>void R.itemMap.delete(_))),m.createElement(Mi,{[u]:"",ref:S},x)});function g(p){const v=i(e+"CollectionConsumer",p);return m.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((R,E)=>w.indexOf(R.ref.current)-w.indexOf(E.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},g,r]}const Gn=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},_8=fe.useId||(()=>{});let S8=0;function vr(e){const[t,n]=fe.useState(_8());return Gn(()=>{e||n(r=>r??String(S8++))},[e]),e||(t?`radix-${t}`:"")}const C8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],We=C8.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?Mi:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,se({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function S$(e,t){e&&ti.flushSync(()=>e.dispatchEvent(t))}function Cn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Yn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=E8({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Cn(n),l=m.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else o(c)},[i,e,o,a]);return[s,l]}function E8({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=Cn(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const R8=m.createContext(void 0);function Ba(e){const t=m.useContext(R8);return e||t||"ltr"}const $v="rovingFocusGroup.onEntryFocus",P8={bubbles:!1,cancelable:!0},tx="RovingFocusGroup",[_0,C$,O8]=ug(tx),[$8,yc]=Dn(tx,[O8]),[D8,T8]=$8(tx),k8=m.forwardRef((e,t)=>m.createElement(_0.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(_0.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(M8,se({},e,{ref:t}))))),M8=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,f=m.useRef(null),g=st(t,f),p=Ba(i),[v=null,y]=Yn({prop:s,defaultProp:a,onChange:l}),[x,w]=m.useState(!1),_=Cn(c),S=C$(n),R=m.useRef(!1),[E,O]=m.useState(0);return m.useEffect(()=>{const k=f.current;if(k)return k.addEventListener($v,_),()=>k.removeEventListener($v,_)},[_]),m.createElement(D8,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:v,onItemFocus:m.useCallback(k=>y(k),[y]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>O(k=>k+1),[]),onFocusableItemRemove:m.useCallback(()=>O(k=>k-1),[])},m.createElement(We.div,se({tabIndex:x||E===0?-1:0,"data-orientation":r},u,{ref:g,style:{outline:"none",...e.style},onMouseDown:Ee(e.onMouseDown,()=>{R.current=!0}),onFocus:Ee(e.onFocus,k=>{const T=!R.current;if(k.target===k.currentTarget&&T&&!x){const M=new CustomEvent($v,P8);if(k.currentTarget.dispatchEvent(M),!M.defaultPrevented){const F=S().filter(j=>j.focusable),z=F.find(j=>j.active),B=F.find(j=>j.id===v),G=[z,B,...F].filter(Boolean).map(j=>j.ref.current);E$(G)}}R.current=!1}),onBlur:Ee(e.onBlur,()=>w(!1))})))}),A8="RovingFocusGroupItem",I8=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=vr(),l=i||a,c=T8(A8,n),u=c.currentTabStopId===l,f=C$(n),{onFocusableItemAdd:g,onFocusableItemRemove:p}=c;return m.useEffect(()=>{if(r)return g(),()=>p()},[r,g,p]),m.createElement(_0.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(We.span,se({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Ee(e.onMouseDown,v=>{r?c.onItemFocus(l):v.preventDefault()}),onFocus:Ee(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Ee(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){c.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const y=F8(v,c.orientation,c.dir);if(y!==void 0){v.preventDefault();let w=f().filter(_=>_.focusable).map(_=>_.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const _=w.indexOf(v.currentTarget);w=c.loop?z8(w,_+1):w.slice(_+1)}setTimeout(()=>E$(w))}})})))}),N8={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function L8(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function F8(e,t,n){const r=L8(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return N8[r]}function E$(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function z8(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const nx=k8,rx=I8;function j8(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const yn=e=>{const{present:t,children:n}=e,r=B8(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=st(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};yn.displayName="Presence";function B8(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=j8(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=nh(r.current);i.current=a==="mounted"?c:"none"},[a]),Gn(()=>{const c=r.current,u=o.current;if(u!==e){const g=i.current,p=nh(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&g!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Gn(()=>{if(t){const c=f=>{const p=nh(r.current).includes(f.animationName);f.target===t&&p&&ti.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=nh(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function nh(e){return(e==null?void 0:e.animationName)||"none"}const R$="Tabs",[V8,The]=Dn(R$,[yc]),P$=yc(),[H8,ox]=V8(R$),W8=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Ba(a),[f,g]=Yn({prop:r,onChange:o,defaultProp:i});return m.createElement(H8,{scope:n,baseId:vr(),value:f,onValueChange:g,orientation:s,dir:u,activationMode:l},m.createElement(We.div,se({dir:u,"data-orientation":s},c,{ref:t})))}),U8="TabsList",q8=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=ox(U8,n),s=P$(n);return m.createElement(nx,se({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(We.div,se({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),G8="TabsTrigger",Y8=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=ox(G8,n),a=P$(n),l=O$(s.baseId,r),c=$$(s.baseId,r),u=r===s.value;return m.createElement(rx,se({asChild:!0},a,{focusable:!o,active:u}),m.createElement(We.button,se({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:Ee(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:Ee(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:Ee(e.onFocus,()=>{const f=s.activationMode!=="manual";!u&&!o&&f&&s.onValueChange(r)})})))}),K8="TabsContent",X8=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=ox(K8,n),l=O$(a.baseId,r),c=$$(a.baseId,r),u=r===a.value,f=m.useRef(u);return m.useEffect(()=>{const g=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(g)},[]),m.createElement(yn,{present:o||u},({present:g})=>m.createElement(We.div,se({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!g,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),g&&i))});function O$(e,t){return`${e}-trigger-${t}`}function $$(e,t){return`${e}-content-${t}`}const Q8=W8,D$=q8,T$=Y8,k$=X8,M$=Q8,A$=fe.forwardRef(({className:e,...t},n)=>N.jsx(D$,{ref:n,className:Oe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));A$.displayName=D$.displayName;const I$=fe.forwardRef(({className:e,...t},n)=>N.jsx(T$,{ref:n,className:Oe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));I$.displayName=T$.displayName;const ix=fe.forwardRef(({className:e,...t},n)=>N.jsx(k$,{ref:n,className:Oe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));ix.displayName=k$.displayName;var N$={exports:{}},Hd={},S0={exports:{}};(function(e,t){(function(n,r){r(t)})(as,function(n){function r(oe){return function(ie,ye,W,me,_e,Pe,$e){return oe(ie,ye,$e)}}function o(oe){return function(ie,ye,W,me){if(!ie||!ye||typeof ie!="object"||typeof ye!="object")return oe(ie,ye,W,me);var _e=me.get(ie),Pe=me.get(ye);if(_e&&Pe)return _e===ye&&Pe===ie;me.set(ie,ye),me.set(ye,ie);var $e=oe(ie,ye,W,me);return me.delete(ie),me.delete(ye),$e}}function i(oe,Z){var ie={};for(var ye in oe)ie[ye]=oe[ye];for(var ye in Z)ie[ye]=Z[ye];return ie}function s(oe){return oe.constructor===Object||oe.constructor==null}function a(oe){return typeof oe.then=="function"}function l(oe,Z){return oe===Z||oe!==oe&&Z!==Z}var c="[object Arguments]",u="[object Boolean]",f="[object Date]",g="[object RegExp]",p="[object Map]",v="[object Number]",y="[object Object]",x="[object Set]",w="[object String]",_=Object.prototype.toString;function S(oe){var Z=oe.areArraysEqual,ie=oe.areDatesEqual,ye=oe.areMapsEqual,W=oe.areObjectsEqual,me=oe.areRegExpsEqual,_e=oe.areSetsEqual,Pe=oe.createIsNestedEqual,$e=Pe(Ue);function Ue(ze,Ne,Xe){if(ze===Ne)return!0;if(!ze||!Ne||typeof ze!="object"||typeof Ne!="object")return ze!==ze&&Ne!==Ne;if(s(ze)&&s(Ne))return W(ze,Ne,$e,Xe);var gt=Array.isArray(ze),It=Array.isArray(Ne);if(gt||It)return gt===It&&Z(ze,Ne,$e,Xe);var zt=_.call(ze);return zt!==_.call(Ne)?!1:zt===f?ie(ze,Ne,$e,Xe):zt===g?me(ze,Ne,$e,Xe):zt===p?ye(ze,Ne,$e,Xe):zt===x?_e(ze,Ne,$e,Xe):zt===y||zt===c?a(ze)||a(Ne)?!1:W(ze,Ne,$e,Xe):zt===u||zt===v||zt===w?l(ze.valueOf(),Ne.valueOf()):!1}return Ue}function R(oe,Z,ie,ye){var W=oe.length;if(Z.length!==W)return!1;for(;W-- >0;)if(!ie(oe[W],Z[W],W,W,oe,Z,ye))return!1;return!0}var E=o(R);function O(oe,Z){return l(oe.valueOf(),Z.valueOf())}function k(oe,Z,ie,ye){var W=oe.size===Z.size;if(!W)return!1;if(!oe.size)return!0;var me={},_e=0;return oe.forEach(function(Pe,$e){if(W){var Ue=!1,ze=0;Z.forEach(function(Ne,Xe){!Ue&&!me[ze]&&(Ue=ie($e,Xe,_e,ze,oe,Z,ye)&&ie(Pe,Ne,$e,Xe,oe,Z,ye))&&(me[ze]=!0),ze++}),_e++,W=Ue}}),W}var T=o(k),M="_owner",F=Object.prototype.hasOwnProperty;function z(oe,Z,ie,ye){var W=Object.keys(oe),me=W.length;if(Object.keys(Z).length!==me)return!1;for(var _e;me-- >0;){if(_e=W[me],_e===M){var Pe=!!oe.$$typeof,$e=!!Z.$$typeof;if((Pe||$e)&&Pe!==$e)return!1}if(!F.call(Z,_e)||!ie(oe[_e],Z[_e],_e,_e,oe,Z,ye))return!1}return!0}var B=o(z);function Y(oe,Z){return oe.source===Z.source&&oe.flags===Z.flags}function G(oe,Z,ie,ye){var W=oe.size===Z.size;if(!W)return!1;if(!oe.size)return!0;var me={};return oe.forEach(function(_e,Pe){if(W){var $e=!1,Ue=0;Z.forEach(function(ze,Ne){!$e&&!me[Ue]&&($e=ie(_e,ze,Pe,Ne,oe,Z,ye))&&(me[Ue]=!0),Ue++}),W=$e}}),W}var j=o(G),ee=Object.freeze({areArraysEqual:R,areDatesEqual:O,areMapsEqual:k,areObjectsEqual:z,areRegExpsEqual:Y,areSetsEqual:G,createIsNestedEqual:r}),q=Object.freeze({areArraysEqual:E,areDatesEqual:O,areMapsEqual:T,areObjectsEqual:B,areRegExpsEqual:Y,areSetsEqual:j,createIsNestedEqual:r}),X=S(ee);function re(oe,Z){return X(oe,Z,void 0)}var $=S(i(ee,{createIsNestedEqual:function(){return l}}));function H(oe,Z){return $(oe,Z,void 0)}var ne=S(q);function I(oe,Z){return ne(oe,Z,new WeakMap)}var ce=S(i(q,{createIsNestedEqual:function(){return l}}));function ge(oe,Z){return ce(oe,Z,new WeakMap)}function he(oe){return S(i(ee,oe(ee)))}function de(oe){var Z=S(i(q,oe(q)));return function(ie,ye,W){return W===void 0&&(W=new WeakMap),Z(ie,ye,W)}}n.circularDeepEqual=I,n.circularShallowEqual=ge,n.createCustomCircularEqual=de,n.createCustomEqual=he,n.deepEqual=re,n.sameValueZeroEqual=l,n.shallowEqual=H,Object.defineProperty(n,"__esModule",{value:!0})})})(S0,S0.exports);var sx=S0.exports;const ax=By(y4);var xt={},J8=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)};Object.defineProperty(xt,"__esModule",{value:!0});xt.bottom=lx;xt.childrenEqual=nz;xt.cloneLayout=L$;xt.cloneLayoutItem=Ea;xt.collides=dg;xt.compact=z$;xt.compactItem=j$;xt.compactType=mz;xt.correctBounds=B$;xt.fastPositionEqual=oz;xt.fastRGLPropsEqual=void 0;xt.getAllCollisions=V$;xt.getFirstCollision=ha;xt.getLayoutItem=cx;xt.getStatics=ux;xt.modifyLayout=F$;xt.moveElement=mu;xt.moveElementAwayFromCollision=E0;xt.noop=void 0;xt.perc=sz;xt.resizeItemInDirection=fz;xt.setTopLeft=pz;xt.setTransform=hz;xt.sortLayoutItems=mx;xt.sortLayoutItemsByColRow=G$;xt.sortLayoutItemsByRowCol=q$;xt.synchronizeLayoutWithChildren=gz;xt.validateLayout=Y$;xt.withLayoutItem=tz;var OC=sx,gu=Z8(m);function Z8(e){return e&&e.__esModule?e:{default:e}}const ez=process.env.NODE_ENV==="production";function lx(e){let t=0,n;for(let r=0,o=e.length;r<o;r++)n=e[r].y+e[r].h,n>t&&(t=n);return t}function L$(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Ea(e[n]);return t}function F$(e,t){const n=Array(e.length);for(let r=0,o=e.length;r<o;r++)t.i===e[r].i?n[r]=t:n[r]=e[r];return n}function tz(e,t,n){let r=cx(e,t);return r?(r=n(Ea(r)),e=F$(e,r),[e,r]):[e,null]}function Ea(e){return{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,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,isBounded:e.isBounded}}function nz(e,t){return(0,OC.deepEqual)(gu.default.Children.map(e,n=>n==null?void 0:n.key),gu.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,OC.deepEqual)(gu.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),gu.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const rz=J8;xt.fastRGLPropsEqual=rz;function oz(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function dg(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 z$(e,t,n,r){const o=ux(e),i=mx(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=Ea(i[a]);c.static||(c=j$(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const iz={x:"w",y:"h"};function C0(e,t,n,r){const o=iz[r];t[r]+=1;const i=e.map(s=>s.i).indexOf(t.i);for(let s=i+1;s<e.length;s++){const a=e[s];if(!a.static){if(a.y>t.y+t.h)break;dg(t,a)&&C0(e,a,n+t[o],r)}}t[r]=n}function j$(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(lx(e),t.y);t.y>0&&!ha(e,t);)t.y--;else if(a)for(;t.x>0&&!ha(e,t);)t.x--;let l;for(;(l=ha(e,t))&&!(n===null&&i);)if(a?C0(o,t,l.x+l.w,"x"):C0(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!ha(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function B$(e,t){const n=ux(e);for(let r=0,o=e.length;r<o;r++){const i=e[r];if(i.x+i.w>t.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),!i.static)n.push(i);else for(;ha(n,i);)i.y++}return e}function cx(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function ha(e,t){for(let n=0,r=e.length;n<r;n++)if(dg(e[n],t))return e[n]}function V$(e,t){return e.filter(n=>dg(n,t))}function ux(e){return e.filter(t=>t.static)}function mu(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=mx(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(f=f.reverse());const p=V$(f,t),v=p.length>0;if(v&&l)return L$(e);if(v&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let y=0,x=p.length;y<x;y++){const w=p[y];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(w.i," at [").concat(w.x,",").concat(w.y,"]"),!w.moved&&(w.static?e=E0(e,w,t,o,s):e=E0(e,t,w,o,s))}return e}function E0(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const f={x:s?Math.max(t.x-n.w,0):n.x,y:a?Math.max(t.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},g=ha(e,f),p=g&&g.y+g.h>t.y,v=g&&t.x+t.w>g.x;if(g){if(p&&a)return mu(e,n,void 0,t.y+1,r,l,o);if(p&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(v&&s)return mu(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(f.x,",").concat(f.y,"]."),mu(e,n,s?f.x:void 0,a?f.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:mu(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function sz(e){return e*100+"%"}const H$=(e,t,n,r)=>e+n>r?t:n,W$=(e,t,n)=>e<0?t:n,U$=e=>Math.max(0,e),dx=e=>Math.max(0,e),fx=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:W$(s,e.height,o),top:dx(s)}},hx=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:H$(e.left,e.width,s,n),left:U$(o)}},px=(e,t,n)=>{let{top:r,height:o,width:i}=t;const s=e.left-(i-e.width);return{height:o,width:s<0?e.width:H$(e.left,e.width,i,n),top:dx(r),left:U$(s)}},gx=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:W$(r,e.height,i),top:dx(r)}},az=function(){return fx(arguments.length<=0?void 0:arguments[0],hx(...arguments))},lz=function(){return fx(arguments.length<=0?void 0:arguments[0],px(...arguments))},cz=function(){return gx(arguments.length<=0?void 0:arguments[0],hx(...arguments))},uz=function(){return gx(arguments.length<=0?void 0:arguments[0],px(...arguments))},dz={n:fx,ne:az,e:hx,se:cz,s:gx,sw:uz,w:px,nw:lz};function fz(e,t,n,r){const o=dz[e];return o?o(t,{...t,...n},r):n}function hz(e){let{top:t,left:n,width:r,height:o}=e;const i="translate(".concat(n,"px,").concat(t,"px)");return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function pz(e){let{top:t,left:n,width:r,height:o}=e;return{top:"".concat(t,"px"),left:"".concat(n,"px"),width:"".concat(r,"px"),height:"".concat(o,"px"),position:"absolute"}}function mx(e,t){return t==="horizontal"?G$(e):t==="vertical"?q$(e):e}function q$(e){return e.slice(0).sort(function(t,n){return t.y>n.y||t.y===n.y&&t.x>n.x?1:t.y===n.y&&t.x===n.x?0:-1})}function G$(e){return e.slice(0).sort(function(t,n){return t.x>n.x||t.x===n.x&&t.y>n.y?1:-1})}function gz(e,t,n,r,o){e=e||[];const i=[];gu.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=cx(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(Ea(l)):c?(ez||Y$([c],"ReactGridLayout.children"),i.push(Ea({...c,i:a.key}))):i.push(Ea({w:1,h:1,x:0,y:lx(i),i:String(a.key)}))});const s=B$(i,{cols:n});return o?s:z$(s,r,n)}function Y$(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const n=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(let r=0,o=e.length;r<o;r++){const i=e[r];for(let s=0;s<n.length;s++)if(typeof i[n[s]]!="number")throw new Error("ReactGridLayout: "+t+"["+r+"]."+n[s]+" must be a number!")}}function mz(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const vz=()=>{};xt.noop=vz;var ni={};Object.defineProperty(ni,"__esModule",{value:!0});ni.calcGridColWidth=fg;ni.calcGridItemPosition=bz;ni.calcGridItemWHPx=R0;ni.calcWH=xz;ni.calcXY=yz;ni.clamp=pa;function fg(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function R0(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function bz(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=fg(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=R0(r,c,s[0]),u.height=R0(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function yz(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=fg(e);let u=Math.round((n-i[0])/(c+i[0])),f=Math.round((t-i[1])/(a+i[1]));return u=pa(u,0,s-r),f=pa(f,0,l-o),{x:u,y:f}}function xz(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=fg(e);let f=Math.round((t+s[0])/(u+s[0])),g=Math.round((n+s[1])/(c+s[1])),p=pa(f,0,l-r),v=pa(g,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(p=pa(f,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(v=pa(g,0,a)),{w:p,h:v}}function pa(e,t,n){return Math.max(Math.min(e,n),t)}var hg={},P0={exports:{}},Dv,$C;function vx(){if($C)return Dv;$C=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Dv=e,Dv}var Tv,DC;function wz(){if(DC)return Tv;DC=1;var e=vx();function t(){}function n(){}return n.resetWarningCache=t,Tv=function(){function r(s,a,l,c,u,f){if(f!==e){var g=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 g.name="Invariant Violation",g}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Tv}var rh={exports:{}},kt={};/** @license React v16.13.1
89
+ * react-is.development.js
90
+ *
91
+ * Copyright (c) Facebook, Inc. and its affiliates.
92
+ *
93
+ * This source code is licensed under the MIT license found in the
94
+ * LICENSE file in the root directory of this source tree.
95
+ */var TC;function _z(){return TC||(TC=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,g=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function S(W){return typeof W=="string"||typeof W=="function"||W===r||W===c||W===i||W===o||W===f||W===g||typeof W=="object"&&W!==null&&(W.$$typeof===v||W.$$typeof===p||W.$$typeof===s||W.$$typeof===a||W.$$typeof===u||W.$$typeof===x||W.$$typeof===w||W.$$typeof===_||W.$$typeof===y)}function R(W){if(typeof W=="object"&&W!==null){var me=W.$$typeof;switch(me){case t:var _e=W.type;switch(_e){case l:case c:case r:case i:case o:case f:return _e;default:var Pe=_e&&_e.$$typeof;switch(Pe){case a:case u:case v:case p:case s:return Pe;default:return me}}case n:return me}}}var E=l,O=c,k=a,T=s,M=t,F=u,z=r,B=v,Y=p,G=n,j=i,ee=o,q=f,X=!1;function re(W){return X||(X=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),$(W)||R(W)===l}function $(W){return R(W)===c}function H(W){return R(W)===a}function ne(W){return R(W)===s}function I(W){return typeof W=="object"&&W!==null&&W.$$typeof===t}function ce(W){return R(W)===u}function ge(W){return R(W)===r}function he(W){return R(W)===v}function de(W){return R(W)===p}function oe(W){return R(W)===n}function Z(W){return R(W)===i}function ie(W){return R(W)===o}function ye(W){return R(W)===f}kt.AsyncMode=E,kt.ConcurrentMode=O,kt.ContextConsumer=k,kt.ContextProvider=T,kt.Element=M,kt.ForwardRef=F,kt.Fragment=z,kt.Lazy=B,kt.Memo=Y,kt.Portal=G,kt.Profiler=j,kt.StrictMode=ee,kt.Suspense=q,kt.isAsyncMode=re,kt.isConcurrentMode=$,kt.isContextConsumer=H,kt.isContextProvider=ne,kt.isElement=I,kt.isForwardRef=ce,kt.isFragment=ge,kt.isLazy=he,kt.isMemo=de,kt.isPortal=oe,kt.isProfiler=Z,kt.isStrictMode=ie,kt.isSuspense=ye,kt.isValidElementType=S,kt.typeOf=R}()),kt}var Mt={};/** @license React v16.13.1
96
+ * react-is.production.min.js
97
+ *
98
+ * Copyright (c) Facebook, Inc. and its affiliates.
99
+ *
100
+ * This source code is licensed under the MIT license found in the
101
+ * LICENSE file in the root directory of this source tree.
102
+ */var kC;function Sz(){if(kC)return Mt;kC=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,g=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,v=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function S(E){if(typeof E=="object"&&E!==null){var O=E.$$typeof;switch(O){case t:switch(E=E.type,E){case l:case c:case r:case i:case o:case f:return E;default:switch(E=E&&E.$$typeof,E){case a:case u:case v:case p:case s:return E;default:return O}}case n:return O}}}function R(E){return S(E)===c}return Mt.AsyncMode=l,Mt.ConcurrentMode=c,Mt.ContextConsumer=a,Mt.ContextProvider=s,Mt.Element=t,Mt.ForwardRef=u,Mt.Fragment=r,Mt.Lazy=v,Mt.Memo=p,Mt.Portal=n,Mt.Profiler=i,Mt.StrictMode=o,Mt.Suspense=f,Mt.isAsyncMode=function(E){return R(E)||S(E)===l},Mt.isConcurrentMode=R,Mt.isContextConsumer=function(E){return S(E)===a},Mt.isContextProvider=function(E){return S(E)===s},Mt.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===t},Mt.isForwardRef=function(E){return S(E)===u},Mt.isFragment=function(E){return S(E)===r},Mt.isLazy=function(E){return S(E)===v},Mt.isMemo=function(E){return S(E)===p},Mt.isPortal=function(E){return S(E)===n},Mt.isProfiler=function(E){return S(E)===i},Mt.isStrictMode=function(E){return S(E)===o},Mt.isSuspense=function(E){return S(E)===f},Mt.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===r||E===c||E===i||E===o||E===f||E===g||typeof E=="object"&&E!==null&&(E.$$typeof===v||E.$$typeof===p||E.$$typeof===s||E.$$typeof===a||E.$$typeof===u||E.$$typeof===x||E.$$typeof===w||E.$$typeof===_||E.$$typeof===y)},Mt.typeOf=S,Mt}var MC;function K$(){return MC||(MC=1,process.env.NODE_ENV==="production"?rh.exports=Sz():rh.exports=_z()),rh.exports}/*
103
+ object-assign
104
+ (c) Sindre Sorhus
105
+ @license MIT
106
+ */var kv,AC;function Cz(){if(AC)return kv;AC=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return kv=o()?Object.assign:function(i,s){for(var a,l=r(i),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){c=e(a);for(var g=0;g<c.length;g++)n.call(a,c[g])&&(l[c[g]]=a[c[g]])}}return l},kv}var Mv,IC;function X$(){return IC||(IC=1,Mv=Function.call.bind(Object.prototype.hasOwnProperty)),Mv}var Av,NC;function Ez(){if(NC)return Av;NC=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=vx(),n={},r=X$();e=function(i){var s="Warning: "+i;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function o(i,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var f;try{if(typeof i[u]!="function"){var g=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw g.name="Invariant Violation",g}f=i[u](s,u,l,a,null,t)}catch(v){f=v}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var p=c?c():"";e("Failed "+a+" type: "+f.message+(p??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Av=o,Av}var Iv,LC;function Rz(){if(LC)return Iv;LC=1;var e=K$(),t=Cz(),n=vx(),r=X$(),o=Ez(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return Iv=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f($){var H=$&&(c&&$[c]||$[u]);if(typeof H=="function")return H}var g="<<anonymous>>",p={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:_(),arrayOf:S,element:R(),elementType:E(),instanceOf:O,node:F(),objectOf:T,oneOf:k,oneOfType:M,shape:B,exact:Y};function v($,H){return $===H?$!==0||1/$===1/H:$!==$&&H!==H}function y($,H){this.message=$,this.data=H&&typeof H=="object"?H:{},this.stack=""}y.prototype=Error.prototype;function x($){if(process.env.NODE_ENV!=="production")var H={},ne=0;function I(ge,he,de,oe,Z,ie,ye){if(oe=oe||g,ie=ie||de,ye!==n){if(l){var W=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 W.name="Invariant Violation",W}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var me=oe+":"+de;!H[me]&&ne<3&&(i("You are manually calling a React.PropTypes validation function for the `"+ie+"` prop on `"+oe+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),H[me]=!0,ne++)}}return he[de]==null?ge?he[de]===null?new y("The "+Z+" `"+ie+"` is marked as required "+("in `"+oe+"`, but its value is `null`.")):new y("The "+Z+" `"+ie+"` is marked as required in "+("`"+oe+"`, but its value is `undefined`.")):null:$(he,de,oe,Z,ie)}var ce=I.bind(null,!1);return ce.isRequired=I.bind(null,!0),ce}function w($){function H(ne,I,ce,ge,he,de){var oe=ne[I],Z=ee(oe);if(Z!==$){var ie=q(oe);return new y("Invalid "+ge+" `"+he+"` of type "+("`"+ie+"` supplied to `"+ce+"`, expected ")+("`"+$+"`."),{expectedType:$})}return null}return x(H)}function _(){return x(s)}function S($){function H(ne,I,ce,ge,he){if(typeof $!="function")return new y("Property `"+he+"` of component `"+ce+"` has invalid PropType notation inside arrayOf.");var de=ne[I];if(!Array.isArray(de)){var oe=ee(de);return new y("Invalid "+ge+" `"+he+"` of type "+("`"+oe+"` supplied to `"+ce+"`, expected an array."))}for(var Z=0;Z<de.length;Z++){var ie=$(de,Z,ce,ge,he+"["+Z+"]",n);if(ie instanceof Error)return ie}return null}return x(H)}function R(){function $(H,ne,I,ce,ge){var he=H[ne];if(!a(he)){var de=ee(he);return new y("Invalid "+ce+" `"+ge+"` of type "+("`"+de+"` supplied to `"+I+"`, expected a single ReactElement."))}return null}return x($)}function E(){function $(H,ne,I,ce,ge){var he=H[ne];if(!e.isValidElementType(he)){var de=ee(he);return new y("Invalid "+ce+" `"+ge+"` of type "+("`"+de+"` supplied to `"+I+"`, expected a single ReactElement type."))}return null}return x($)}function O($){function H(ne,I,ce,ge,he){if(!(ne[I]instanceof $)){var de=$.name||g,oe=re(ne[I]);return new y("Invalid "+ge+" `"+he+"` of type "+("`"+oe+"` supplied to `"+ce+"`, expected ")+("instance of `"+de+"`."))}return null}return x(H)}function k($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),s;function H(ne,I,ce,ge,he){for(var de=ne[I],oe=0;oe<$.length;oe++)if(v(de,$[oe]))return null;var Z=JSON.stringify($,function(ye,W){var me=q(W);return me==="symbol"?String(W):W});return new y("Invalid "+ge+" `"+he+"` of value `"+String(de)+"` "+("supplied to `"+ce+"`, expected one of "+Z+"."))}return x(H)}function T($){function H(ne,I,ce,ge,he){if(typeof $!="function")return new y("Property `"+he+"` of component `"+ce+"` has invalid PropType notation inside objectOf.");var de=ne[I],oe=ee(de);if(oe!=="object")return new y("Invalid "+ge+" `"+he+"` of type "+("`"+oe+"` supplied to `"+ce+"`, expected an object."));for(var Z in de)if(r(de,Z)){var ie=$(de,Z,ce,ge,he+"."+Z,n);if(ie instanceof Error)return ie}return null}return x(H)}function M($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var H=0;H<$.length;H++){var ne=$[H];if(typeof ne!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+X(ne)+" at index "+H+"."),s}function I(ce,ge,he,de,oe){for(var Z=[],ie=0;ie<$.length;ie++){var ye=$[ie],W=ye(ce,ge,he,de,oe,n);if(W==null)return null;W.data&&r(W.data,"expectedType")&&Z.push(W.data.expectedType)}var me=Z.length>0?", expected one of type ["+Z.join(", ")+"]":"";return new y("Invalid "+de+" `"+oe+"` supplied to "+("`"+he+"`"+me+"."))}return x(I)}function F(){function $(H,ne,I,ce,ge){return G(H[ne])?null:new y("Invalid "+ce+" `"+ge+"` supplied to "+("`"+I+"`, expected a ReactNode."))}return x($)}function z($,H,ne,I,ce){return new y(($||"React class")+": "+H+" type `"+ne+"."+I+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ce+"`.")}function B($){function H(ne,I,ce,ge,he){var de=ne[I],oe=ee(de);if(oe!=="object")return new y("Invalid "+ge+" `"+he+"` of type `"+oe+"` "+("supplied to `"+ce+"`, expected `object`."));for(var Z in $){var ie=$[Z];if(typeof ie!="function")return z(ce,ge,he,Z,q(ie));var ye=ie(de,Z,ce,ge,he+"."+Z,n);if(ye)return ye}return null}return x(H)}function Y($){function H(ne,I,ce,ge,he){var de=ne[I],oe=ee(de);if(oe!=="object")return new y("Invalid "+ge+" `"+he+"` of type `"+oe+"` "+("supplied to `"+ce+"`, expected `object`."));var Z=t({},ne[I],$);for(var ie in Z){var ye=$[ie];if(r($,ie)&&typeof ye!="function")return z(ce,ge,he,ie,q(ye));if(!ye)return new y("Invalid "+ge+" `"+he+"` key `"+ie+"` supplied to `"+ce+"`.\nBad object: "+JSON.stringify(ne[I],null," ")+`
107
+ Valid keys: `+JSON.stringify(Object.keys($),null," "));var W=ye(de,ie,ce,ge,he+"."+ie,n);if(W)return W}return null}return x(H)}function G($){switch(typeof $){case"number":case"string":case"undefined":return!0;case"boolean":return!$;case"object":if(Array.isArray($))return $.every(G);if($===null||a($))return!0;var H=f($);if(H){var ne=H.call($),I;if(H!==$.entries){for(;!(I=ne.next()).done;)if(!G(I.value))return!1}else for(;!(I=ne.next()).done;){var ce=I.value;if(ce&&!G(ce[1]))return!1}}else return!1;return!0;default:return!1}}function j($,H){return $==="symbol"?!0:H?H["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&H instanceof Symbol:!1}function ee($){var H=typeof $;return Array.isArray($)?"array":$ instanceof RegExp?"object":j(H,$)?"symbol":H}function q($){if(typeof $>"u"||$===null)return""+$;var H=ee($);if(H==="object"){if($ instanceof Date)return"date";if($ instanceof RegExp)return"regexp"}return H}function X($){var H=q($);switch(H){case"array":case"object":return"an "+H;case"boolean":case"date":case"regexp":return"a "+H;default:return H}}function re($){return!$.constructor||!$.constructor.name?g:$.constructor.name}return p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p},Iv}if(process.env.NODE_ENV!=="production"){var Pz=K$(),Oz=!0;P0.exports=Rz()(Pz.isElement,Oz)}else P0.exports=wz()();var Ts=P0.exports,pg={exports:{}},Q$={};function J$(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=J$(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function FC(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=J$(e))&&(r&&(r+=" "),r+=t);return r}const $z=Object.freeze(Object.defineProperty({__proto__:null,clsx:FC,default:FC},Symbol.toStringTag,{value:"Module"})),Dz=By($z);var dn={},ri={};Object.defineProperty(ri,"__esModule",{value:!0});ri.dontSetMe=Iz;ri.findInArray=Tz;ri.int=Az;ri.isFunction=kz;ri.isNum=Mz;function Tz(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function kz(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Mz(e){return typeof e=="number"&&!isNaN(e)}function Az(e){return parseInt(e,10)}function Iz(e,t,n){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(n," - do not set this, set it on the child."))}var Va={};Object.defineProperty(Va,"__esModule",{value:!0});Va.browserPrefixToKey=e2;Va.browserPrefixToStyle=Nz;Va.default=void 0;Va.getPrefix=Z$;const Nv=["Moz","Webkit","O","ms"];function Z$(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const n=(e=window.document)===null||e===void 0||(e=e.documentElement)===null||e===void 0?void 0:e.style;if(!n||t in n)return"";for(let r=0;r<Nv.length;r++)if(e2(t,Nv[r])in n)return Nv[r];return""}function e2(e,t){return t?"".concat(t).concat(Lz(e)):e}function Nz(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function Lz(e){let t="",n=!0;for(let r=0;r<e.length;r++)n?(t+=e[r].toUpperCase(),n=!1):e[r]==="-"?n=!0:t+=e[r];return t}Va.default=Z$();Object.defineProperty(dn,"__esModule",{value:!0});dn.addClassName=r2;dn.addEvent=jz;dn.addUserSelectStyles=Qz;dn.createCSSTransform=Gz;dn.createSVGTransform=Yz;dn.getTouch=Kz;dn.getTouchIdentifier=Xz;dn.getTranslation=bx;dn.innerHeight=Wz;dn.innerWidth=Uz;dn.matchesSelector=n2;dn.matchesSelectorAndParentsTo=zz;dn.offsetXYFromParent=qz;dn.outerHeight=Vz;dn.outerWidth=Hz;dn.removeClassName=o2;dn.removeEvent=Bz;dn.removeUserSelectStyles=Jz;var jr=ri,zC=Fz(Va);function t2(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(t2=function(r){return r?n:t})(e)}function Fz(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=t2(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}let oh="";function n2(e,t){return oh||(oh=(0,jr.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,jr.isFunction)(e[n])})),(0,jr.isFunction)(e[oh])?e[oh](t):!1}function zz(e,t,n){let r=e;do{if(n2(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function jz(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.addEventListener?e.addEventListener(t,n,o):e.attachEvent?e.attachEvent("on"+t,n):e["on"+t]=n}function Bz(e,t,n,r){if(!e)return;const o={capture:!0,...r};e.removeEventListener?e.removeEventListener(t,n,o):e.detachEvent?e.detachEvent("on"+t,n):e["on"+t]=null}function Vz(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,jr.int)(n.borderTopWidth),t+=(0,jr.int)(n.borderBottomWidth),t}function Hz(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,jr.int)(n.borderLeftWidth),t+=(0,jr.int)(n.borderRightWidth),t}function Wz(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,jr.int)(n.paddingTop),t-=(0,jr.int)(n.paddingBottom),t}function Uz(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,jr.int)(n.paddingLeft),t-=(0,jr.int)(n.paddingRight),t}function qz(e,t,n){const o=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-o.left)/n,s=(e.clientY+t.scrollTop-o.top)/n;return{x:i,y:s}}function Gz(e,t){const n=bx(e,t,"px");return{[(0,zC.browserPrefixToKey)("transform",zC.default)]:n}}function Yz(e,t){return bx(e,t,"")}function bx(e,t,n){let{x:r,y:o}=e,i="translate(".concat(r).concat(n,",").concat(o).concat(n,")");if(t){const s="".concat(typeof t.x=="string"?t.x:t.x+n),a="".concat(typeof t.y=="string"?t.y:t.y+n);i="translate(".concat(s,", ").concat(a,")")+i}return i}function Kz(e,t){return e.targetTouches&&(0,jr.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,jr.findInArray)(e.changedTouches,n=>t===n.identifier)}function Xz(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Qz(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
108
+ `,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
109
+ `,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&r2(e.body,"react-draggable-transparent-selection")}function Jz(e){if(e)try{if(e.body&&o2(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&t.type!=="Caret"&&t.removeAllRanges()}}catch{}}function r2(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function o2(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.canDragX=tj;oi.canDragY=nj;oi.createCoreData=oj;oi.createDraggableData=ij;oi.getBoundPosition=Zz;oi.getControlPosition=rj;oi.snapToGrid=ej;var Or=ri,Tl=dn;function Zz(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:sj(r);const o=yx(e);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(o),u=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,Or.int)(u.paddingLeft)+(0,Or.int)(c.marginLeft),top:-o.offsetTop+(0,Or.int)(u.paddingTop)+(0,Or.int)(c.marginTop),right:(0,Tl.innerWidth)(l)-(0,Tl.outerWidth)(o)-o.offsetLeft+(0,Or.int)(u.paddingRight)-(0,Or.int)(c.marginRight),bottom:(0,Tl.innerHeight)(l)-(0,Tl.outerHeight)(o)-o.offsetTop+(0,Or.int)(u.paddingBottom)-(0,Or.int)(c.marginBottom)}}return(0,Or.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Or.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Or.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Or.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function ej(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function tj(e){return e.props.axis==="both"||e.props.axis==="x"}function nj(e){return e.props.axis==="both"||e.props.axis==="y"}function rj(e,t,n){const r=typeof t=="number"?(0,Tl.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=yx(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,Tl.offsetXYFromParent)(r||e,i,n.props.scale)}function oj(e,t,n){const r=!(0,Or.isNum)(e.lastX),o=yx(e);return r?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:o,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function ij(e,t){const n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function sj(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function yx(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var gg={},mg={};Object.defineProperty(mg,"__esModule",{value:!0});mg.default=aj;function aj(){}Object.defineProperty(gg,"__esModule",{value:!0});gg.default=void 0;var Lv=cj(m),ar=xx(Ts),lj=xx(ti),Hn=dn,Zi=oi,Fv=ri,Zc=xx(mg);function xx(e){return e&&e.__esModule?e:{default:e}}function i2(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(i2=function(r){return r?n:t})(e)}function cj(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=i2(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Zn(e,t,n){return t=uj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uj(e){var t=dj(e,"string");return typeof t=="symbol"?t:String(t)}function dj(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const wo={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let es=wo.mouse,vg=class extends Lv.Component{constructor(){super(...arguments),Zn(this,"dragging",!1),Zn(this,"lastX",NaN),Zn(this,"lastY",NaN),Zn(this,"touchIdentifier",null),Zn(this,"mounted",!1),Zn(this,"handleDragStart",t=>{if(this.props.onMouseDown(t),!this.props.allowAnyClick&&typeof t.button=="number"&&t.button!==0)return!1;const n=this.findDOMNode();if(!n||!n.ownerDocument||!n.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:r}=n;if(this.props.disabled||!(t.target instanceof r.defaultView.Node)||this.props.handle&&!(0,Hn.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Hn.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,Hn.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,Zi.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,Zi.createCoreData)(this,s,a);(0,Zc.default)("DraggableCore: handleDragStart: %j",l),(0,Zc.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,Hn.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Hn.addEvent)(r,es.move,this.handleDrag),(0,Hn.addEvent)(r,es.stop,this.handleDragStop))}),Zn(this,"handleDrag",t=>{const n=(0,Zi.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let a=r-this.lastX,l=o-this.lastY;if([a,l]=(0,Zi.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,Zi.createCoreData)(this,r,o);if((0,Zc.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),Zn(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Zi.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,Zi.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,Zi.createCoreData)(this,r,o);if(this.props.onStop(t,i)===!1||this.mounted===!1)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,Hn.removeUserSelectStyles)(a.ownerDocument),(0,Zc.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Zc.default)("DraggableCore: Removing handlers"),(0,Hn.removeEvent)(a.ownerDocument,es.move,this.handleDrag),(0,Hn.removeEvent)(a.ownerDocument,es.stop,this.handleDragStop))}),Zn(this,"onMouseDown",t=>(es=wo.mouse,this.handleDragStart(t))),Zn(this,"onMouseUp",t=>(es=wo.mouse,this.handleDragStop(t))),Zn(this,"onTouchStart",t=>(es=wo.touch,this.handleDragStart(t))),Zn(this,"onTouchEnd",t=>(es=wo.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Hn.addEvent)(t,wo.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Hn.removeEvent)(n,wo.mouse.move,this.handleDrag),(0,Hn.removeEvent)(n,wo.touch.move,this.handleDrag),(0,Hn.removeEvent)(n,wo.mouse.stop,this.handleDragStop),(0,Hn.removeEvent)(n,wo.touch.stop,this.handleDragStop),(0,Hn.removeEvent)(t,wo.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Hn.removeUserSelectStyles)(n)}}findDOMNode(){var t,n;return(t=this.props)!==null&&t!==void 0&&t.nodeRef?(n=this.props)===null||n===void 0||(n=n.nodeRef)===null||n===void 0?void 0:n.current:lj.default.findDOMNode(this)}render(){return Lv.cloneElement(Lv.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};gg.default=vg;Zn(vg,"displayName","DraggableCore");Zn(vg,"propTypes",{allowAnyClick:ar.default.bool,children:ar.default.node.isRequired,disabled:ar.default.bool,enableUserSelectHack:ar.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:ar.default.arrayOf(ar.default.number),handle:ar.default.string,cancel:ar.default.string,nodeRef:ar.default.object,onStart:ar.default.func,onDrag:ar.default.func,onStop:ar.default.func,onMouseDown:ar.default.func,scale:ar.default.number,className:Fv.dontSetMe,style:Fv.dontSetMe,transform:Fv.dontSetMe});Zn(vg,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=g(m),n=u(Ts),r=u(ti),o=u(Dz),i=dn,s=oi,a=ri,l=u(gg),c=u(mg);function u(_){return _&&_.__esModule?_:{default:_}}function f(_){if(typeof WeakMap!="function")return null;var S=new WeakMap,R=new WeakMap;return(f=function(E){return E?R:S})(_)}function g(_,S){if(!S&&_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var R=f(S);if(R&&R.has(_))return R.get(_);var E={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var k in _)if(k!=="default"&&Object.prototype.hasOwnProperty.call(_,k)){var T=O?Object.getOwnPropertyDescriptor(_,k):null;T&&(T.get||T.set)?Object.defineProperty(E,k,T):E[k]=_[k]}return E.default=_,R&&R.set(_,E),E}function p(){return p=Object.assign?Object.assign.bind():function(_){for(var S=1;S<arguments.length;S++){var R=arguments[S];for(var E in R)Object.prototype.hasOwnProperty.call(R,E)&&(_[E]=R[E])}return _},p.apply(this,arguments)}function v(_,S,R){return S=y(S),S in _?Object.defineProperty(_,S,{value:R,enumerable:!0,configurable:!0,writable:!0}):_[S]=R,_}function y(_){var S=x(_,"string");return typeof S=="symbol"?S:String(S)}function x(_,S){if(typeof _!="object"||_===null)return _;var R=_[Symbol.toPrimitive];if(R!==void 0){var E=R.call(_,S||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(_)}class w extends t.Component{static getDerivedStateFromProps(S,R){let{position:E}=S,{prevPropsPosition:O}=R;return E&&(!O||E.x!==O.x||E.y!==O.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:O}),{x:E.x,y:E.y,prevPropsPosition:{...E}}):null}constructor(S){super(S),v(this,"onDragStart",(R,E)=>{if((0,c.default)("Draggable: onDragStart: %j",E),this.props.onStart(R,(0,s.createDraggableData)(this,E))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),v(this,"onDrag",(R,E)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",E);const O=(0,s.createDraggableData)(this,E),k={x:O.x,y:O.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:F}=k;k.x+=this.state.slackX,k.y+=this.state.slackY;const[z,B]=(0,s.getBoundPosition)(this,k.x,k.y);k.x=z,k.y=B,k.slackX=this.state.slackX+(M-k.x),k.slackY=this.state.slackY+(F-k.y),O.x=k.x,O.y=k.y,O.deltaX=k.x-this.state.x,O.deltaY=k.y-this.state.y}if(this.props.onDrag(R,O)===!1)return!1;this.setState(k)}),v(this,"onDragStop",(R,E)=>{if(!this.state.dragging||this.props.onStop(R,(0,s.createDraggableData)(this,E))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",E);const k={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:F}=this.props.position;k.x=M,k.y=F}this.setState(k)}),this.state={dragging:!1,dragged:!1,x:S.position?S.position.x:S.defaultPosition.x,y:S.position?S.position.y:S.defaultPosition.y,prevPropsPosition:{...S.position},slackX:0,slackY:0,isElementSVG:!1},S.position&&!(S.onDrag||S.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.setState({dragging:!1})}findDOMNode(){var S,R;return(S=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&S!==void 0?S:r.default.findDOMNode(this)}render(){const{axis:S,bounds:R,children:E,defaultPosition:O,defaultClassName:k,defaultClassNameDragging:T,defaultClassNameDragged:M,position:F,positionOffset:z,scale:B,...Y}=this.props;let G={},j=null;const q=!!!F||this.state.dragging,X=F||O,re={x:(0,s.canDragX)(this)&&q?this.state.x:X.x,y:(0,s.canDragY)(this)&&q?this.state.y:X.y};this.state.isElementSVG?j=(0,i.createSVGTransform)(re,z):G=(0,i.createCSSTransform)(re,z);const $=(0,o.default)(E.props.className||"",k,{[T]:this.state.dragging,[M]:this.state.dragged});return t.createElement(l.default,p({},Y,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:$,style:{...E.props.style,...G},transform:j}))}}e.default=w,v(w,"displayName","Draggable"),v(w,"propTypes",{...l.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:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),v(w,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(Q$);const{default:s2,DraggableCore:fj}=Q$;pg.exports=s2;pg.exports.default=s2;pg.exports.DraggableCore=fj;var a2=pg.exports,bg={exports:{}},Wd={},wx={};wx.__esModule=!0;wx.cloneElement=bj;var hj=pj(m);function pj(e){return e&&e.__esModule?e:{default:e}}function jC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function BC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jC(Object(n),!0).forEach(function(r){gj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gj(e,t,n){return t=mj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mj(e){var t=vj(e,"string");return typeof t=="symbol"?t:String(t)}function vj(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function bj(e,t){return t.style&&e.props.style&&(t.style=BC(BC({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),hj.default.cloneElement(e,t)}var Ud={};Ud.__esModule=!0;Ud.resizableProps=void 0;var lt=yj(Ts);function yj(e){return e&&e.__esModule?e:{default:e}}var xj={axis:lt.default.oneOf(["both","x","y","none"]),className:lt.default.string,children:lt.default.element.isRequired,draggableOpts:lt.default.shape({allowAnyClick:lt.default.bool,cancel:lt.default.string,children:lt.default.node,disabled:lt.default.bool,enableUserSelectHack:lt.default.bool,offsetParent:lt.default.node,grid:lt.default.arrayOf(lt.default.number),handle:lt.default.string,nodeRef:lt.default.object,onStart:lt.default.func,onDrag:lt.default.func,onStop:lt.default.func,onMouseDown:lt.default.func,scale:lt.default.number}),height:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="y"){var i;return(i=lt.default.number).isRequired.apply(i,n)}return lt.default.number.apply(lt.default,n)},handle:lt.default.oneOfType([lt.default.node,lt.default.func]),handleSize:lt.default.arrayOf(lt.default.number),lockAspectRatio:lt.default.bool,maxConstraints:lt.default.arrayOf(lt.default.number),minConstraints:lt.default.arrayOf(lt.default.number),onResizeStop:lt.default.func,onResizeStart:lt.default.func,onResize:lt.default.func,resizeHandles:lt.default.arrayOf(lt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:lt.default.number,width:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0];if(o.axis==="both"||o.axis==="x"){var i;return(i=lt.default.number).isRequired.apply(i,n)}return lt.default.number.apply(lt.default,n)}};Ud.resizableProps=xj;Wd.__esModule=!0;Wd.default=void 0;var eu=Ej(m),wj=a2,_j=wx,Sj=Ud,Cj=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function l2(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(l2=function(o){return o?n:t})(e)}function Ej(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=l2(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function O0(){return O0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O0.apply(this,arguments)}function Rj(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function VC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function zv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?VC(Object(n),!0).forEach(function(r){Pj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pj(e,t,n){return t=Oj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oj(e){var t=$j(e,"string");return typeof t=="symbol"?t:String(t)}function $j(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dj(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,$0(e,t)}function $0(e,t){return $0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},$0(e,t)}var _x=function(e){Dj(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,f=o-this.props.width,g=i-this.props.height;Math.abs(f)>Math.abs(g*u)?i=o/u:o=i*u}var p=o,v=i,y=this.slack||[0,0],x=y[0],w=y[1];return o+=x,i+=w,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[x+(p-o),w+(v-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,f=l.deltaY;o==="onResizeStart"&&s.resetData();var g=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",p=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!g&&!p)){var v=i[0],y=i[i.length-1],x=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(y==="w"){var w=x.left-s.lastHandleRect.left;u+=w}if(v==="n"){var _=x.top-s.lastHandleRect.top;f+=_}}s.lastHandleRect=x,y==="w"&&(u=-u),v==="n"&&(f=-f);var S=s.props.width+(g?u/s.props.transformScale:0),R=s.props.height+(p?f/s.props.transformScale:0),E=s.runConstraints(S,R);S=E[0],R=E[1];var O=S!==s.props.width||R!==s.props.height,k=typeof s.props[o]=="function"?s.props[o]:null,T=o==="onResize"&&!O;k&&!T&&(a.persist==null||a.persist(),k(a,{node:c,size:{width:S,height:R},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return eu.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+o,ref:i});if(typeof s=="function")return s(o,i);var a=typeof s.type=="string",l=zv({ref:i},a?{}:{handleAxis:o});return eu.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=Rj(i,Cj);return(0,_j.cloneElement)(s,zv(zv({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(f){var g,p=(g=o.handleRefs[f])!=null?g:o.handleRefs[f]=eu.createRef();return eu.createElement(wj.DraggableCore,O0({},l,{nodeRef:p,key:"resizableHandle-"+f,onStop:o.resizeHandler("onResizeStop",f),onStart:o.resizeHandler("onResizeStart",f),onDrag:o.resizeHandler("onResize",f)}),o.renderResizeHandle(f,p))}))}))},t}(eu.Component);Wd.default=_x;_x.propTypes=Sj.resizableProps;_x.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var yg={};yg.__esModule=!0;yg.default=void 0;var jv=Ij(m),Tj=c2(Ts),kj=c2(Wd),Mj=Ud,Aj=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function c2(e){return e&&e.__esModule?e:{default:e}}function u2(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(u2=function(o){return o?n:t})(e)}function Ij(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=u2(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function D0(){return D0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},D0.apply(this,arguments)}function HC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function _p(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HC(Object(n),!0).forEach(function(r){Nj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Nj(e,t,n){return t=Lj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lj(e){var t=Fj(e,"string");return typeof t=="symbol"?t:String(t)}function Fj(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function zj(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function jj(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,T0(e,t)}function T0(e,t){return T0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},T0(e,t)}var d2=function(e){jj(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,f=o.maxConstraints,g=o.lockAspectRatio,p=o.axis;o.width,o.height;var v=o.resizeHandles,y=o.style,x=o.transformScale,w=zj(o,Aj);return jv.createElement(kj.default,{axis:p,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:g,maxConstraints:f,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:v,transformScale:x,width:this.state.width},jv.createElement("div",D0({},w,{style:_p(_p({},y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(jv.Component);yg.default=d2;d2.propTypes=_p(_p({},Mj.resizableProps),{},{children:Tj.default.element});bg.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};bg.exports.Resizable=Wd.default;bg.exports.ResizableBox=yg.default;var Bj=bg.exports,Ti={};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.resizeHandleType=Ti.resizeHandleAxesType=Ti.default=void 0;var pt=f2(Ts),Vj=f2(m);function f2(e){return e&&e.__esModule?e:{default:e}}const h2=pt.default.arrayOf(pt.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));Ti.resizeHandleAxesType=h2;const p2=pt.default.oneOfType([pt.default.node,pt.default.func]);Ti.resizeHandleType=p2;var Hj={className:pt.default.string,style:pt.default.object,width:pt.default.number,autoSize:pt.default.bool,cols:pt.default.number,draggableCancel:pt.default.string,draggableHandle:pt.default.string,verticalCompact:function(e){e.verticalCompact===!1&&process.env.NODE_ENV!=="production"&&console.warn('`verticalCompact` on <ReactGridLayout> is deprecated and will be removed soon. Use `compactType`: "horizontal" | "vertical" | null.')},compactType:pt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&xt.validateLayout(t,"layout")},margin:pt.default.arrayOf(pt.default.number),containerPadding:pt.default.arrayOf(pt.default.number),rowHeight:pt.default.number,maxRows:pt.default.number,isBounded:pt.default.bool,isDraggable:pt.default.bool,isResizable:pt.default.bool,allowOverlap:pt.default.bool,preventCollision:pt.default.bool,useCSSTransforms:pt.default.bool,transformScale:pt.default.number,isDroppable:pt.default.bool,resizeHandles:h2,resizeHandle:p2,onLayoutChange:pt.default.func,onDragStart:pt.default.func,onDrag:pt.default.func,onDragStop:pt.default.func,onResizeStart:pt.default.func,onResize:pt.default.func,onResizeStop:pt.default.func,onDrop:pt.default.func,droppingItem:pt.default.shape({i:pt.default.string.isRequired,w:pt.default.number.isRequired,h:pt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};Vj.default.Children.forEach(n,function(o){if((o==null?void 0:o.key)!=null){if(r[o.key])throw new Error('Duplicate child key "'+o.key+'" found! This will cause problems in ReactGridLayout.');r[o.key]=!0}})},innerRef:pt.default.any};Ti.default=Hj;Object.defineProperty(hg,"__esModule",{value:!0});hg.default=void 0;var pl=Sx(m),$t=Sx(Ts),Wj=a2,Uj=Bj,gl=xt,An=ni,WC=Ti,qj=Sx(ax);function Sx(e){return e&&e.__esModule?e:{default:e}}function Lo(e,t,n){return t=Gj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gj(e){var t=Yj(e,"string");return typeof t=="symbol"?t:String(t)}function Yj(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Cx extends pl.default.Component{constructor(){super(...arguments),Lo(this,"state",{resizing:null,dragging:null,className:""}),Lo(this,"elementRef",pl.default.createRef()),Lo(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,f=l.left/i,g=c.top/i,p=l.top/i;s.left=u-f+a.scrollLeft,s.top=g-p+a.scrollTop,this.setState({dragging:s});const{x:v,y}=(0,An.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,v,y,{e:t,node:r,newPosition:s})}),Lo(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:u,w:f,h:g,containerWidth:p}=this.props,v=this.getPositionParams();if(c){const{offsetParent:_}=r;if(_){const{margin:S,rowHeight:R}=this.props,E=_.clientHeight-(0,An.calcGridItemWHPx)(g,R,S[1]);a=(0,An.clamp)(a,0,E);const O=(0,An.calcGridColWidth)(v),k=p-(0,An.calcGridItemWHPx)(f,O,S[0]);l=(0,An.clamp)(l,0,k)}}const y={top:a,left:l};this.setState({dragging:y});const{x,y:w}=(0,An.calcXY)(v,a,l,f,g);return s.call(this,u,x,w,{e:t,node:r,newPosition:y})}),Lo(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:f,y:g}=(0,An.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,f,g,{e:t,node:r,newPosition:u})}),Lo(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Lo(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Lo(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,An.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,An.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,gl.fastPositionEqual)(r,o)||this.props.useCSSTransforms!==t.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(t){this.moveDroppingItem(t)}moveDroppingItem(t){const{droppingPosition:n}=this.props;if(!n)return;const r=this.elementRef.current;if(!r)return;const o=t.droppingPosition||{left:0,top:0},{dragging:i}=this.state,s=i&&n.left!==o.left||n.top!==o.top;if(!i)this.onDragStart(n.e,{node:r,deltaX:n.left,deltaY:n.top});else if(s){const a=n.left-i.left,l=n.top-i.top;this.onDrag(n.e,{node:r,deltaX:a,deltaY:l})}}getPositionParams(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:t.cols,containerPadding:t.containerPadding,containerWidth:t.containerWidth,margin:t.margin,maxRows:t.maxRows,rowHeight:t.rowHeight}}createStyle(t){const{usePercentages:n,containerWidth:r,useCSSTransforms:o}=this.props;let i;return o?i=(0,gl.setTransform)(t):(i=(0,gl.setTopLeft)(t),n&&(i.left=(0,gl.perc)(t.left/r),i.width=(0,gl.perc)(t.width/r))),i}mixinDraggable(t,n){return pl.default.createElement(Wj.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:f}=this.props,g=this.getPositionParams(),p=(0,An.calcGridItemPosition)(g,0,0,o,0).width,v=(0,An.calcGridItemPosition)(g,0,0,i,s),y=(0,An.calcGridItemPosition)(g,0,0,a,l),x=[v.width,v.height],w=[Math.min(y.width,p),Math.min(y.height,1/0)];return pl.default.createElement(Uj.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:w,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:f},t)}onResizeHandler(t,n,r,o){let{node:i,size:s,handle:a}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:f,maxH:g,minH:p,containerWidth:v}=this.props,{minW:y,maxW:x}=this.props;let w=s;i&&(w=(0,gl.resizeItemInDirection)(a,r,s,v),this.setState({resizing:o==="onResizeStop"?null:w}));let{w:_,h:S}=(0,An.calcWH)(this.getPositionParams(),w.width,w.height,c,u,a);_=(0,An.clamp)(_,Math.max(y,1),x),S=(0,An.clamp)(S,p,g),l.call(this,f,_,S,{e:t,node:i,size:w,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,An.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=pl.default.Children.only(this.props.children);let f=pl.default.cloneElement(u,{ref:this.elementRef,className:(0,qj.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return f=this.mixinResizable(f,c,s),f=this.mixinDraggable(f,i),f}}hg.default=Cx;Lo(Cx,"propTypes",{children:$t.default.element,cols:$t.default.number.isRequired,containerWidth:$t.default.number.isRequired,rowHeight:$t.default.number.isRequired,margin:$t.default.array.isRequired,maxRows:$t.default.number.isRequired,containerPadding:$t.default.array.isRequired,x:$t.default.number.isRequired,y:$t.default.number.isRequired,w:$t.default.number.isRequired,h:$t.default.number.isRequired,minW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minWidth not Number");if(n>e.w||n>e.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxWidth not Number");if(n<e.w||n<e.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("minHeight not Number");if(n>e.h||n>e.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(e,t){const n=e[t];if(typeof n!="number")return new Error("maxHeight not Number");if(n<e.h||n<e.minH)return new Error("maxHeight smaller than item height/minHeight")},i:$t.default.string.isRequired,resizeHandles:WC.resizeHandleAxesType,resizeHandle:WC.resizeHandleType,onDragStop:$t.default.func,onDragStart:$t.default.func,onDrag:$t.default.func,onResizeStop:$t.default.func,onResizeStart:$t.default.func,onResize:$t.default.func,isDraggable:$t.default.bool.isRequired,isResizable:$t.default.bool.isRequired,isBounded:$t.default.bool.isRequired,static:$t.default.bool,useCSSTransforms:$t.default.bool.isRequired,transformScale:$t.default.number,className:$t.default.string,handle:$t.default.string,cancel:$t.default.string,droppingPosition:$t.default.shape({e:$t.default.object.isRequired,left:$t.default.number.isRequired,top:$t.default.number.isRequired})});Lo(Cx,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(Hd,"__esModule",{value:!0});Hd.default=void 0;var Zs=Jj(m),Bv=sx,Kj=Ex(ax),Ze=xt,Xj=ni,UC=Ex(hg),Qj=Ex(Ti);function Ex(e){return e&&e.__esModule?e:{default:e}}function g2(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(g2=function(r){return r?n:t})(e)}function Jj(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=g2(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function Wn(e,t,n){return t=Zj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zj(e){var t=eB(e,"string");return typeof t=="symbol"?t:String(t)}function eB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const qC="react-grid-layout";let m2=!1;try{m2=/firefox/i.test(navigator.userAgent)}catch{}class xg extends Zs.Component{constructor(){super(...arguments),Wn(this,"state",{activeDrag:null,layout:(0,Ze.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,Ze.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Wn(this,"dragEnterCounter",0),Wn(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,Ze.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,Ze.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,i,s)}),Wn(this,"onDrag",(t,n,r,o)=>{let{e:i,node:s}=o;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:f}=this.props,g=(0,Ze.getLayoutItem)(l,t);if(!g)return;const p={w:g.w,h:g.h,x:g.x,y:g.y,placeholder:!0,i:t},v=!0;l=(0,Ze.moveElement)(l,g,n,r,v,f,(0,Ze.compactType)(this.props),c,u),this.props.onDrag(l,a,g,p,i,s),this.setState({layout:u?l:(0,Ze.compact)(l,(0,Ze.compactType)(this.props),c),activeDrag:p})}),Wn(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:s}=o;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:f}=this.props,g=(0,Ze.getLayoutItem)(l,t);if(!g)return;const p=!0;l=(0,Ze.moveElement)(l,g,n,r,p,u,(0,Ze.compactType)(this.props),c,f);const v=f?l:(0,Ze.compact)(l,(0,Ze.compactType)(this.props),c);this.props.onDragStop(v,a,g,null,i,s);const{oldLayout:y}=this.state;this.setState({activeDrag:null,layout:v,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(v,y)}),Wn(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,Ze.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,Ze.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),Wn(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:c}=this.state;let{layout:u}=this.state;const{cols:f,preventCollision:g,allowOverlap:p}=this.props;let v=!1,y,x,w;const[_,S]=(0,Ze.withLayoutItem)(u,t,E=>{let O;return x=E.x,w=E.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=E.x+(E.w-n),n=E.x!==x&&x<0?E.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(w=E.y+(E.h-r),r=E.y!==w&&w<0?E.h:r,w=w<0?0:w),v=!0),g&&!p&&(O=(0,Ze.getAllCollisions)(u,{...E,w:n,h:r,x,y:w}).filter(T=>T.i!==E.i).length>0,O&&(w=E.y,r=E.h,x=E.x,n=E.w,v=!1)),E.w=n,E.h=r,E});if(!S)return;y=_,v&&(y=(0,Ze.moveElement)(_,S,x,w,!0,this.props.preventCollision,(0,Ze.compactType)(this.props),f,p));const R={w:S.w,h:S.h,x:S.x,y:S.y,static:!0,i:t};this.props.onResize(y,c,S,R,i,s),this.setState({layout:p?y:(0,Ze.compact)(y,(0,Ze.compactType)(this.props),f),activeDrag:R})}),Wn(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,f=(0,Ze.getLayoutItem)(a,t),g=u?a:(0,Ze.compact)(a,(0,Ze.compactType)(this.props),c);this.props.onResizeStop(g,l,f,null,i,s);const{oldLayout:p}=this.state;this.setState({activeDrag:null,layout:g,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(g,p)}),Wn(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),m2&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(qC)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:u,transformScale:f}=this.props,g=o==null?void 0:o(t);if(g===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...r,...g},{layout:v}=this.state,{layerX:y,layerY:x}=t.nativeEvent,w={left:y/f,top:x/f,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:S}=this.state.droppingPosition;(_!=y||S!=x)&&this.setState({droppingPosition:w})}}else{const _={cols:s,margin:i,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:u||i},S=(0,Xj.calcXY)(_,x,y,p.w,p.h);this.setState({droppingDOMNode:Zs.createElement("div",{key:p.i}),droppingPosition:w,layout:[...v,{...p,x:S.x,y:S.y,static:!1,isDraggable:!0}]})}}),Wn(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,Ze.compact)(r.filter(i=>i.i!==t.i),(0,Ze.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Wn(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Wn(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Wn(this,"onDrop",t=>{t.preventDefault(),t.stopPropagation();const{droppingItem:n}=this.props,{layout:r}=this.state,o=r.find(i=>i.i===n.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(r,o,t)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(t,n){let r;return n.activeDrag?null:(!(0,Bv.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,Ze.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,Ze.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,Ze.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,Ze.fastRGLPropsEqual)(this.props,t,Bv.deepEqual)||this.state.activeDrag!==n.activeDrag||this.state.mounted!==n.mounted||this.state.droppingPosition!==n.droppingPosition}componentDidUpdate(t,n){if(!this.state.activeDrag){const r=this.state.layout,o=n.layout;this.onLayoutMaybeChanged(r,o)}}containerHeight(){if(!this.props.autoSize)return;const t=(0,Ze.bottom)(this.state.layout),n=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return t*this.props.rowHeight+(t-1)*this.props.margin[1]+n*2+"px"}onLayoutMaybeChanged(t,n){n||(n=this.state.layout),(0,Bv.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return Zs.createElement(UC.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Zs.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,Ze.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:u,isResizable:f,isBounded:g,useCSSTransforms:p,transformScale:v,draggableCancel:y,draggableHandle:x,resizeHandles:w,resizeHandle:_}=this.props,{mounted:S,droppingPosition:R}=this.state,E=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,O=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,k=r.resizeHandles||w,T=E&&g&&r.isBounded!==!1;return Zs.createElement(UC.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:y,handle:x,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:E,isResizable:O,isBounded:T,useCSSTransforms:p&&S,usePercentages:!S,transformScale:v,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:n?R:void 0,resizeHandles:k,resizeHandle:_},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,Kj.default)(qC,t),s={height:this.containerHeight(),...n};return Zs.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:Ze.noop,onDragLeave:r?this.onDragLeave:Ze.noop,onDragEnter:r?this.onDragEnter:Ze.noop,onDragOver:r?this.onDragOver:Ze.noop},Zs.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Hd.default=xg;Wn(xg,"displayName","ReactGridLayout");Wn(xg,"propTypes",Qj.default);Wn(xg,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:Ze.noop,onDragStart:Ze.noop,onDrag:Ze.noop,onDragStop:Ze.noop,onResizeStart:Ze.noop,onResize:Ze.noop,onResizeStop:Ze.noop,onDrop:Ze.noop,onDropDragOver:Ze.noop});var wg={},Ha={};Object.defineProperty(Ha,"__esModule",{value:!0});Ha.findOrGenerateResponsiveLayout=rB;Ha.getBreakpointFromWidth=tB;Ha.getColsFromBreakpoint=nB;Ha.sortBreakpoints=Rx;var ih=xt;function tB(e,t){const n=Rx(e);let r=n[0];for(let o=1,i=n.length;o<i;o++){const s=n[o];t>e[s]&&(r=s)}return r}function nB(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function rB(e,t,n,r,o,i){if(e[n])return(0,ih.cloneLayout)(e[n]);let s=e[r];const a=Rx(t),l=a.slice(a.indexOf(n));for(let c=0,u=l.length;c<u;c++){const f=l[c];if(e[f]){s=e[f];break}}return s=(0,ih.cloneLayout)(s||[]),(0,ih.compact)((0,ih.correctBounds)(s,{cols:o}),i,o)}function Rx(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(wg,"__esModule",{value:!0});wg.default=void 0;var GC=iB(m),lr=v2(Ts),Vv=sx,Il=xt,ea=Ha,oB=v2(Hd);function v2(e){return e&&e.__esModule?e:{default:e}}function b2(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(b2=function(r){return r?n:t})(e)}function iB(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=b2(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function k0(){return k0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},k0.apply(this,arguments)}function Sp(e,t,n){return t=sB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sB(e){var t=aB(e,"string");return typeof t=="symbol"?t:String(t)}function aB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const YC=e=>Object.prototype.toString.call(e);function sh(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class Px extends GC.Component{constructor(){super(...arguments),Sp(this,"state",this.generateInitialState()),Sp(this,"onLayoutChange",t=>{this.props.onLayoutChange(t,{...this.props.layouts,[this.state.breakpoint]:t})})}generateInitialState(){const{width:t,breakpoints:n,layouts:r,cols:o}=this.props,i=(0,ea.getBreakpointFromWidth)(n,t),s=(0,ea.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,ea.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,Vv.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,ea.findOrGenerateResponsiveLayout)(t.layouts,t.breakpoints,r,r,o,t.compactType),layouts:t.layouts}}return null}componentDidUpdate(t){(this.props.width!=t.width||this.props.breakpoint!==t.breakpoint||!(0,Vv.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,Vv.deepEqual)(this.props.cols,t.cols))&&this.onWidthChange(t)}onWidthChange(t){const{breakpoints:n,cols:r,layouts:o,compactType:i}=this.props,s=this.props.breakpoint||(0,ea.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,ea.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,Il.cloneLayout)(this.state.layout));let g=(0,ea.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);g=(0,Il.synchronizeLayoutWithChildren)(g,this.props.children,l,i,this.props.allowOverlap),c[s]=g,this.props.onLayoutChange(g,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:g,cols:l})}const u=sh(this.props.margin,s),f=sh(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,f)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return GC.createElement(oB.default,k0({},u,{margin:sh(i,this.state.breakpoint),containerPadding:sh(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}wg.default=Px;Sp(Px,"propTypes",{breakpoint:lr.default.string,breakpoints:lr.default.object,allowOverlap:lr.default.bool,cols:lr.default.object,margin:lr.default.oneOfType([lr.default.array,lr.default.object]),containerPadding:lr.default.oneOfType([lr.default.array,lr.default.object]),layouts(e,t){if(YC(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+YC(e[t]));Object.keys(e[t]).forEach(n=>{if(!(n in e.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,Il.validateLayout)(e.layouts[n],"layouts."+n)})},width:lr.default.number.isRequired,onBreakpointChange:lr.default.func,onLayoutChange:lr.default.func,onWidthChange:lr.default.func});Sp(Px,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:Il.noop,onLayoutChange:Il.noop,onWidthChange:Il.noop});var Ox={},y2=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(o,i){return o[0]===n?(r=i,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),o=this.__entries__[r];return o&&o[1]},t.prototype.set=function(n,r){var o=e(this.__entries__,n);~o?this.__entries__[o][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,o=e(r,n);~o&&r.splice(o,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var o=0,i=this.__entries__;o<i.length;o++){var s=i[o];n.call(r,s[1],s[0])}},t}()}(),M0=typeof window<"u"&&typeof document<"u"&&window.document===document,Cp=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),lB=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Cp):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),cB=2;function uB(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){lB(i)}function a(){var l=Date.now();if(n){if(l-o<cB)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var dB=20,fB=["top","right","bottom","left","width","height","size","weight"],hB=typeof MutationObserver<"u",pB=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=uB(this.refresh.bind(this),dB)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!M0||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),hB?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!M0||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,o=fB.some(function(i){return!!~r.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),x2=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},ic=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Cp},w2=_g(0,0,0,0);function Ep(e){return parseFloat(e)||0}function KC(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,o){var i=e["border-"+o+"-width"];return r+Ep(i)},0)}function gB(e){for(var t=["top","right","bottom","left"],n={},r=0,o=t;r<o.length;r++){var i=o[r],s=e["padding-"+i];n[i]=Ep(s)}return n}function mB(e){var t=e.getBBox();return _g(0,0,t.width,t.height)}function vB(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return w2;var r=ic(e).getComputedStyle(e),o=gB(r),i=o.left+o.right,s=o.top+o.bottom,a=Ep(r.width),l=Ep(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=KC(r,"left","right")+i),Math.round(l+s)!==n&&(l-=KC(r,"top","bottom")+s)),!yB(e)){var c=Math.round(a+i)-t,u=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return _g(o.left,o.top,a,l)}var bB=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ic(e).SVGGraphicsElement}:function(e){return e instanceof ic(e).SVGElement&&typeof e.getBBox=="function"}}();function yB(e){return e===ic(e).document.documentElement}function xB(e){return M0?bB(e)?mB(e):vB(e):w2}function wB(e){var t=e.x,n=e.y,r=e.width,o=e.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,s=Object.create(i.prototype);return x2(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function _g(e,t,n,r){return{x:e,y:t,width:n,height:r}}var _B=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=_g(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=xB(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),SB=function(){function e(t,n){var r=wB(n);x2(this,{target:t,contentRect:r})}return e}(),CB=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new y2,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ic(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new _B(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ic(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new SB(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),_2=typeof WeakMap<"u"?new WeakMap:new y2,S2=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=pB.getInstance(),r=new CB(t,n,this);_2.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){S2.prototype[e]=function(){var t;return(t=_2.get(this))[e].apply(t,arguments)}});var EB=function(){return typeof Cp.ResizeObserver<"u"?Cp.ResizeObserver:S2}();const RB=Object.freeze(Object.defineProperty({__proto__:null,default:EB},Symbol.toStringTag,{value:"Module"})),PB=By(RB);Object.defineProperty(Ox,"__esModule",{value:!0});Ox.default=IB;var ah=TB(m),OB=$x(Ts),$B=$x(PB),DB=$x(ax);function $x(e){return e&&e.__esModule?e:{default:e}}function C2(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(C2=function(r){return r?n:t})(e)}function TB(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=C2(t);if(n&&n.has(e))return n.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(i!=="default"&&Object.prototype.hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function A0(){return A0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},A0.apply(this,arguments)}function ml(e,t,n){return t=kB(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kB(e){var t=MB(e,"string");return typeof t=="symbol"?t:String(t)}function MB(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const AB="react-grid-layout";function IB(e){var t;return t=class extends ah.Component{constructor(){super(...arguments),ml(this,"state",{width:1280}),ml(this,"elementRef",ah.createRef()),ml(this,"mounted",!1),ml(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new $B.default(o=>{if(this.elementRef.current instanceof HTMLElement){const s=o[0].contentRect.width;this.setState({width:s})}});const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.observe(r)}componentWillUnmount(){this.mounted=!1;const r=this.elementRef.current;r instanceof HTMLElement&&this.resizeObserver.unobserve(r),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:r,...o}=this.props;return r&&!this.mounted?ah.createElement("div",{className:(0,DB.default)(this.props.className,AB),style:this.props.style,ref:this.elementRef}):ah.createElement(e,A0({innerRef:this.elementRef},o,this.state))}},ml(t,"defaultProps",{measureBeforeMount:!1}),ml(t,"propTypes",{measureBeforeMount:OB.default.bool}),t}(function(e){e.exports=Hd.default,e.exports.utils=xt,e.exports.calculateUtils=ni,e.exports.Responsive=wg.default,e.exports.Responsive.utils=Ha,e.exports.WidthProvider=Ox.default})(N$);var XC=N$.exports;function Ma({children:e,className:t,text:n,onSave:r,type:o="input"}){const[i,s]=m.useState(!1),[a,l]=m.useState(n),c=Te(g=>g.isDashboardEditing),u=g=>{g.stopPropagation(),c&&s(!0)};function f(){return o==="textarea"?N.jsx("textarea",{className:Oe(" grow px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:g=>l(g.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:g=>{g.key==="Enter"&&g.shiftKey||(g.key==="Enter"||g.key==="Tab")&&(s(!1),r(a))}}):N.jsx("input",{onMouseDown:g=>g.stopPropagation(),type:"text",className:Oe("px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:g=>l(g.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:g=>{(g.key==="Enter"||g.key==="Tab")&&(s(!1),r(a))}})}return N.jsx("div",{className:"flex",role:"editable",onDoubleClick:u,children:i?f():e})}/*!
110
+ * @kurkle/color v0.3.2
111
+ * https://github.com/kurkle/color#readme
112
+ * (c) 2023 Jukka Kurkela
113
+ * Released under the MIT License
114
+ */function qd(e){return e+.5|0}const gs=(e,t,n)=>Math.max(Math.min(e,n),t);function vu(e){return gs(qd(e*2.55),0,255)}function _s(e){return gs(qd(e*255),0,255)}function Ei(e){return gs(qd(e/2.55)/100,0,1)}function QC(e){return gs(qd(e*100),0,100)}const to={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},I0=[..."0123456789ABCDEF"],NB=e=>I0[e&15],LB=e=>I0[(e&240)>>4]+I0[e&15],lh=e=>(e&240)>>4===(e&15),FB=e=>lh(e.r)&&lh(e.g)&&lh(e.b)&&lh(e.a);function zB(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&to[e[1]]*17,g:255&to[e[2]]*17,b:255&to[e[3]]*17,a:t===5?to[e[4]]*17:255}:(t===7||t===9)&&(n={r:to[e[1]]<<4|to[e[2]],g:to[e[3]]<<4|to[e[4]],b:to[e[5]]<<4|to[e[6]],a:t===9?to[e[7]]<<4|to[e[8]]:255})),n}const jB=(e,t)=>e<255?t(e):"";function BB(e){var t=FB(e)?NB:LB;return e?"#"+t(e.r)+t(e.g)+t(e.b)+jB(e.a,t):void 0}const VB=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function E2(e,t,n){const r=t*Math.min(n,1-n),o=(i,s=(i+e/30)%12)=>n-r*Math.max(Math.min(s-3,9-s,1),-1);return[o(0),o(8),o(4)]}function HB(e,t,n){const r=(o,i=(o+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function WB(e,t,n){const r=E2(e,1,.5);let o;for(t+n>1&&(o=1/(t+n),t*=o,n*=o),o=0;o<3;o++)r[o]*=1-t-n,r[o]+=t;return r}function UB(e,t,n,r,o){return e===o?(t-n)/r+(t<n?6:0):t===o?(n-e)/r+2:(e-t)/r+4}function Dx(e){const n=e.r/255,r=e.g/255,o=e.b/255,i=Math.max(n,r,o),s=Math.min(n,r,o),a=(i+s)/2;let l,c,u;return i!==s&&(u=i-s,c=a>.5?u/(2-i-s):u/(i+s),l=UB(n,r,o,u,i),l=l*60+.5),[l|0,c||0,a]}function Tx(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(_s)}function kx(e,t,n){return Tx(E2,e,t,n)}function qB(e,t,n){return Tx(WB,e,t,n)}function GB(e,t,n){return Tx(HB,e,t,n)}function R2(e){return(e%360+360)%360}function YB(e){const t=VB.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?vu(+t[5]):_s(+t[5]));const o=R2(+t[2]),i=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=qB(o,i,s):t[1]==="hsv"?r=GB(o,i,s):r=kx(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function KB(e,t){var n=Dx(e);n[0]=R2(n[0]+t),n=kx(n),e.r=n[0],e.g=n[1],e.b=n[2]}function XB(e){if(!e)return;const t=Dx(e),n=t[0],r=QC(t[1]),o=QC(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${Ei(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const JC={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},ZC={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function QB(){const e={},t=Object.keys(ZC),n=Object.keys(JC);let r,o,i,s,a;for(r=0;r<t.length;r++){for(s=a=t[r],o=0;o<n.length;o++)i=n[o],a=a.replace(i,JC[i]);i=parseInt(ZC[s],16),e[a]=[i>>16&255,i>>8&255,i&255]}return e}let ch;function JB(e){ch||(ch=QB(),ch.transparent=[0,0,0,0]);const t=ch[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const ZB=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function eV(e){const t=ZB.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?vu(s):gs(s*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?vu(r):gs(r,0,255)),o=255&(t[4]?vu(o):gs(o,0,255)),i=255&(t[6]?vu(i):gs(i,0,255)),{r,g:o,b:i,a:n}}}function tV(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ei(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Hv=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,vl=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function nV(e,t,n){const r=vl(Ei(e.r)),o=vl(Ei(e.g)),i=vl(Ei(e.b));return{r:_s(Hv(r+n*(vl(Ei(t.r))-r))),g:_s(Hv(o+n*(vl(Ei(t.g))-o))),b:_s(Hv(i+n*(vl(Ei(t.b))-i))),a:e.a+n*(t.a-e.a)}}function uh(e,t,n){if(e){let r=Dx(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=kx(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function P2(e,t){return e&&Object.assign(t||{},e)}function eE(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=_s(e[3]))):(t=P2(e,{r:0,g:0,b:0,a:1}),t.a=_s(t.a)),t}function rV(e){return e.charAt(0)==="r"?eV(e):YB(e)}class Wu{constructor(t){if(t instanceof Wu)return t;const n=typeof t;let r;n==="object"?r=eE(t):n==="string"&&(r=zB(t)||JB(t)||rV(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=P2(this._rgb);return t&&(t.a=Ei(t.a)),t}set rgb(t){this._rgb=eE(t)}rgbString(){return this._valid?tV(this._rgb):void 0}hexString(){return this._valid?BB(this._rgb):void 0}hslString(){return this._valid?XB(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,o=t.rgb;let i;const s=n===i?.5:n,a=2*s-1,l=r.a-o.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;i=1-c,r.r=255&c*r.r+i*o.r+.5,r.g=255&c*r.g+i*o.g+.5,r.b=255&c*r.b+i*o.b+.5,r.a=s*r.a+(1-s)*o.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=nV(this._rgb,t._rgb,n)),this}clone(){return new Wu(this.rgb)}alpha(t){return this._rgb.a=_s(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=qd(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return uh(this._rgb,2,t),this}darken(t){return uh(this._rgb,2,-t),this}saturate(t){return uh(this._rgb,1,t),this}desaturate(t){return uh(this._rgb,1,-t),this}rotate(t){return KB(this._rgb,t),this}}/*!
115
+ * Chart.js v4.4.1
116
+ * https://www.chartjs.org
117
+ * (c) 2023 Chart.js Contributors
118
+ * Released under the MIT License
119
+ */function bi(){}const oV=(()=>{let e=0;return()=>e++})();function yt(e){return e===null||typeof e>"u"}function Jt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function _t(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function un(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Tr(e,t){return un(e)?e:t}function it(e,t){return typeof e>"u"?t:e}const iV=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,O2=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Ft(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function At(e,t,n,r){let o,i,s;if(Jt(e))if(i=e.length,r)for(o=i-1;o>=0;o--)t.call(n,e[o],o);else for(o=0;o<i;o++)t.call(n,e[o],o);else if(_t(e))for(s=Object.keys(e),i=s.length,o=0;o<i;o++)t.call(n,e[s[o]],s[o])}function Rp(e,t){let n,r,o,i;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(o=e[n],i=t[n],o.datasetIndex!==i.datasetIndex||o.index!==i.index)return!1;return!0}function Pp(e){if(Jt(e))return e.map(Pp);if(_t(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let o=0;for(;o<r;++o)t[n[o]]=Pp(e[n[o]]);return t}return e}function $2(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function sV(e,t,n,r){if(!$2(e))return;const o=t[e],i=n[e];_t(o)&&_t(i)?Qo(o,i,r):t[e]=Pp(i)}function Qo(e,t,n){const r=Jt(t)?t:[t],o=r.length;if(!_t(e))return e;n=n||{};const i=n.merger||sV;let s;for(let a=0;a<o;++a){if(s=r[a],!_t(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)i(l[c],e,s,n)}return e}function Cu(e,t){return Qo(e,t,{merger:aV})}function aV(e,t,n){if(!$2(e))return;const r=t[e],o=n[e];_t(r)&&_t(o)?Cu(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Pp(o))}const tE={"":e=>e,x:e=>e.x,y:e=>e.y};function lV(e){const t=e.split("."),n=[];let r="";for(const o of t)r+=o,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function cV(e){const t=lV(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Cs(e,t){return(tE[t]||(tE[t]=cV(t)))(e)}function Mx(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Uu=e=>typeof e<"u",Es=e=>typeof e=="function",nE=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function uV(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const en=Math.PI,Zt=2*en,dV=Zt+en,Op=Number.POSITIVE_INFINITY,fV=en/180,mn=en/2,ta=en/4,rE=en*2/3,ms=Math.log10,Yo=Math.sign;function Eu(e,t,n){return Math.abs(e-t)<n}function oE(e){const t=Math.round(e);e=Eu(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(ms(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function hV(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((o,i)=>o-i).pop(),t}function sc(e){return!isNaN(parseFloat(e))&&isFinite(e)}function pV(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function D2(e,t,n){let r,o,i;for(r=0,o=e.length;r<o;r++)i=e[r][n],isNaN(i)||(t.min=Math.min(t.min,i),t.max=Math.max(t.max,i))}function Co(e){return e*(en/180)}function Ax(e){return e*(180/en)}function iE(e){if(!un(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function T2(e,t){const n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);let i=Math.atan2(r,n);return i<-.5*en&&(i+=Zt),{angle:i,distance:o}}function N0(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function gV(e,t){return(e-t+dV)%Zt-en}function Ir(e){return(e%Zt+Zt)%Zt}function qu(e,t,n,r){const o=Ir(e),i=Ir(t),s=Ir(n),a=Ir(i-o),l=Ir(s-o),c=Ir(o-i),u=Ir(o-s);return o===i||o===s||r&&i===s||a>l&&c<u}function $n(e,t,n){return Math.max(t,Math.min(n,e))}function mV(e){return $n(e,-32768,32767)}function Pi(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function Ix(e,t,n){n=n||(s=>e[s]<t);let r=e.length-1,o=0,i;for(;r-o>1;)i=o+r>>1,n(i)?o=i:r=i;return{lo:o,hi:r}}const Oi=(e,t,n,r)=>Ix(e,n,r?o=>{const i=e[o][t];return i<n||i===n&&e[o+1][t]===n}:o=>e[o][t]<n),vV=(e,t,n)=>Ix(e,n,r=>e[r][t]>=n);function bV(e,t,n){let r=0,o=e.length;for(;r<o&&e[r]<t;)r++;for(;o>r&&e[o-1]>n;)o--;return r>0||o<e.length?e.slice(r,o):e}const k2=["push","pop","shift","splice","unshift"];function yV(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),k2.forEach(n=>{const r="_onData"+Mx(n),o=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...i){const s=o.apply(this,i);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...i)}),s}})})}function sE(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,o=r.indexOf(t);o!==-1&&r.splice(o,1),!(r.length>0)&&(k2.forEach(i=>{delete e[i]}),delete e._chartjs)}function M2(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const A2=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function I2(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,A2.call(window,()=>{r=!1,e.apply(t,n)}))}}function xV(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const Nx=e=>e==="start"?"left":e==="end"?"right":"center",Un=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,wV=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function N2(e,t,n){const r=t.length;let o=0,i=r;if(e._sorted){const{iScale:s,_parsed:a}=e,l=s.axis,{min:c,max:u,minDefined:f,maxDefined:g}=s.getUserBounds();f&&(o=$n(Math.min(Oi(a,l,c).lo,n?r:Oi(t,l,s.getPixelForValue(c)).lo),0,r-1)),g?i=$n(Math.max(Oi(a,s.axis,u,!0).hi+1,n?0:Oi(t,l,s.getPixelForValue(u),!0).hi+1),o,r)-o:i=r-o}return{start:o,count:i}}function L2(e){const{xScale:t,yScale:n,_scaleRanges:r}=e,o={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=o,!0;const i=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,o),i}const dh=e=>e===0||e===1,aE=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Zt/n)),lE=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Zt/n)+1,Ru={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*mn)+1,easeOutSine:e=>Math.sin(e*mn),easeInOutSine:e=>-.5*(Math.cos(en*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>dh(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>dh(e)?e:aE(e,.075,.3),easeOutElastic:e=>dh(e)?e:lE(e,.075,.3),easeInOutElastic(e){return dh(e)?e:e<.5?.5*aE(e*2,.1125,.45):.5+.5*lE(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-Ru.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?Ru.easeInBounce(e*2)*.5:Ru.easeOutBounce(e*2-1)*.5+.5};function Lx(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function cE(e){return Lx(e)?e:new Wu(e)}function Wv(e){return Lx(e)?e:new Wu(e).saturate(.5).darken(.1).hexString()}const _V=["x","y","borderWidth","radius","tension"],SV=["color","borderColor","backgroundColor"];function CV(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:SV},numbers:{type:"number",properties:_V}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function EV(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const uE=new Map;function RV(e,t){t=t||{};const n=e+JSON.stringify(t);let r=uE.get(n);return r||(r=new Intl.NumberFormat(e,t),uE.set(n,r)),r}function Gd(e,t,n){return RV(t,n).format(e)}const F2={values(e){return Jt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let o,i=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(o="scientific"),i=PV(e,n)}const s=ms(Math.abs(i)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:o,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Gd(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(ms(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?F2.numeric.call(this,e,t,n):""}};function PV(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Sg={formatters:F2};function OV(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Sg.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Aa=Object.create(null),L0=Object.create(null);function Pu(e,t){if(!t)return e;const n=t.split(".");for(let r=0,o=n.length;r<o;++r){const i=n[r];e=e[i]||(e[i]=Object.create(null))}return e}function Uv(e,t,n){return typeof t=="string"?Qo(Pu(e,t),n):Qo(Pu(e,""),t)}class $V{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,o)=>Wv(o.backgroundColor),this.hoverBorderColor=(r,o)=>Wv(o.borderColor),this.hoverColor=(r,o)=>Wv(o.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Uv(this,t,n)}get(t){return Pu(this,t)}describe(t,n){return Uv(L0,t,n)}override(t,n){return Uv(Aa,t,n)}route(t,n,r,o){const i=Pu(this,t),s=Pu(this,r),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[o];return _t(l)?Object.assign({},c,l):it(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var an=new $V({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[CV,EV,OV]);function DV(e){return!e||yt(e.size)||yt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function $p(e,t,n,r,o){let i=t[o];return i||(i=t[o]=e.measureText(o).width,n.push(o)),i>r&&(r=i),r}function TV(e,t,n,r){r=r||{};let o=r.data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(o=r.data={},i=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=n.length;let l,c,u,f,g;for(l=0;l<a;l++)if(f=n[l],f!=null&&!Jt(f))s=$p(e,o,i,s,f);else if(Jt(f))for(c=0,u=f.length;c<u;c++)g=f[c],g!=null&&!Jt(g)&&(s=$p(e,o,i,s,g));e.restore();const p=i.length/2;if(p>n.length){for(l=0;l<p;l++)delete o[i[l]];i.splice(0,p)}return s}function na(e,t,n){const r=e.currentDevicePixelRatio,o=n!==0?Math.max(n/2,.5):0;return Math.round((t-o)*r)/r+o}function dE(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function F0(e,t,n,r){z2(e,t,n,r,null)}function z2(e,t,n,r,o){let i,s,a,l,c,u,f,g;const p=t.pointStyle,v=t.rotation,y=t.radius;let x=(v||0)*fV;if(p&&typeof p=="object"&&(i=p.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(x),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(y)||y<=0)){switch(e.beginPath(),p){default:o?e.ellipse(n,r,o/2,y,0,0,Zt):e.arc(n,r,y,0,Zt),e.closePath();break;case"triangle":u=o?o/2:y,e.moveTo(n+Math.sin(x)*u,r-Math.cos(x)*y),x+=rE,e.lineTo(n+Math.sin(x)*u,r-Math.cos(x)*y),x+=rE,e.lineTo(n+Math.sin(x)*u,r-Math.cos(x)*y),e.closePath();break;case"rectRounded":c=y*.516,l=y-c,s=Math.cos(x+ta)*l,f=Math.cos(x+ta)*(o?o/2-c:l),a=Math.sin(x+ta)*l,g=Math.sin(x+ta)*(o?o/2-c:l),e.arc(n-f,r-a,c,x-en,x-mn),e.arc(n+g,r-s,c,x-mn,x),e.arc(n+f,r+a,c,x,x+mn),e.arc(n-g,r+s,c,x+mn,x+en),e.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*y,u=o?o/2:l,e.rect(n-u,r-l,2*u,2*l);break}x+=ta;case"rectRot":f=Math.cos(x)*(o?o/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(o?o/2:y),e.moveTo(n-f,r-a),e.lineTo(n+g,r-s),e.lineTo(n+f,r+a),e.lineTo(n-g,r+s),e.closePath();break;case"crossRot":x+=ta;case"cross":f=Math.cos(x)*(o?o/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(o?o/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s);break;case"star":f=Math.cos(x)*(o?o/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(o?o/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s),x+=ta,f=Math.cos(x)*(o?o/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,g=Math.sin(x)*(o?o/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+g,r-s),e.lineTo(n-g,r+s);break;case"line":s=o?o/2:Math.cos(x)*y,a=Math.sin(x)*y,e.moveTo(n-s,r-a),e.lineTo(n+s,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(x)*(o?o/2:y),r+Math.sin(x)*y);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function $i(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function Cg(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Eg(e){e.restore()}function kV(e,t,n,r,o){if(!t)return e.lineTo(n.x,n.y);if(o==="middle"){const i=(t.x+n.x)/2;e.lineTo(i,t.y),e.lineTo(i,n.y)}else o==="after"!=!!r?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function MV(e,t,n,r){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?n.cp2x:n.cp1x,r?n.cp2y:n.cp1y,n.x,n.y)}function AV(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),yt(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function IV(e,t,n,r,o){if(o.strikethrough||o.underline){const i=e.measureText(r),s=t-i.actualBoundingBoxLeft,a=t+i.actualBoundingBoxRight,l=n-i.actualBoundingBoxAscent,c=n+i.actualBoundingBoxDescent,u=o.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=o.decorationWidth||2,e.moveTo(s,u),e.lineTo(a,u),e.stroke()}}function NV(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ia(e,t,n,r,o,i={}){const s=Jt(t)?t:[t],a=i.strokeWidth>0&&i.strokeColor!=="";let l,c;for(e.save(),e.font=o.string,AV(e,i),l=0;l<s.length;++l)c=s[l],i.backdrop&&NV(e,i.backdrop),a&&(i.strokeColor&&(e.strokeStyle=i.strokeColor),yt(i.strokeWidth)||(e.lineWidth=i.strokeWidth),e.strokeText(c,n,r,i.maxWidth)),e.fillText(c,n,r,i.maxWidth),IV(e,n,r,c,i),r+=Number(o.lineHeight);e.restore()}function Gu(e,t){const{x:n,y:r,w:o,h:i,radius:s}=t;e.arc(n+s.topLeft,r+s.topLeft,s.topLeft,1.5*en,en,!0),e.lineTo(n,r+i-s.bottomLeft),e.arc(n+s.bottomLeft,r+i-s.bottomLeft,s.bottomLeft,en,mn,!0),e.lineTo(n+o-s.bottomRight,r+i),e.arc(n+o-s.bottomRight,r+i-s.bottomRight,s.bottomRight,mn,0,!0),e.lineTo(n+o,r+s.topRight),e.arc(n+o-s.topRight,r+s.topRight,s.topRight,0,-mn,!0),e.lineTo(n+s.topLeft,r)}const LV=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,FV=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function zV(e,t){const n=(""+e).match(LV);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const jV=e=>+e||0;function Fx(e,t){const n={},r=_t(t),o=r?Object.keys(t):t,i=_t(e)?r?s=>it(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of o)n[s]=jV(i(s));return n}function j2(e){return Fx(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ra(e){return Fx(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Fn(e){const t=j2(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function bn(e,t){e=e||{},t=t||an.font;let n=it(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=it(e.style,t.style);r&&!(""+r).match(FV)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:it(e.family,t.family),lineHeight:zV(it(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:it(e.weight,t.weight),string:""};return o.string=DV(o),o}function Qt(e,t,n,r){let o=!0,i,s,a;for(i=0,s=e.length;i<s;++i)if(a=e[i],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),o=!1),n!==void 0&&Jt(a)&&(a=a[n%a.length],o=!1),a!==void 0))return r&&!o&&(r.cacheable=!1),a}function BV(e,t,n){const{min:r,max:o}=e,i=O2(t,(o-r)/2),s=(a,l)=>n&&a===0?0:a+l;return{min:s(r,-Math.abs(i)),max:s(o,i)}}function ks(e,t){return Object.assign(Object.create(e),t)}function zx(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=W2("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:a=>zx([a,...e],t,i,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return V2(a,l,()=>KV(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return hE(a).includes(l)},ownKeys(a){return hE(a)},set(a,l,c){const u=a._storage||(a._storage=o());return a[l]=u[l]=c,delete a._keys,!0}})}function ac(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:B2(e,r),setContext:i=>ac(e,i,n,r),override:i=>ac(e.override(i),t,n,r)};return new Proxy(o,{deleteProperty(i,s){return delete i[s],delete e[s],!0},get(i,s,a){return V2(i,s,()=>HV(i,s,a))},getOwnPropertyDescriptor(i,s){return i._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(i,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(i,s,a){return e[s]=a,delete i[s],!0}})}function B2(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:o=t.allKeys}=e;return{allKeys:o,scriptable:n,indexable:r,isScriptable:Es(n)?n:()=>n,isIndexable:Es(r)?r:()=>r}}const VV=(e,t)=>e?e+Mx(t):t,jx=(e,t)=>_t(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function V2(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function HV(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=e;let a=r[t];return Es(a)&&s.isScriptable(t)&&(a=WV(t,a,e,n)),Jt(a)&&a.length&&(a=UV(t,a,e,s.isIndexable)),jx(t,a)&&(a=ac(a,o,i&&i[t],s)),a}function WV(e,t,n,r){const{_proxy:o,_context:i,_subProxy:s,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(i,s||r);return a.delete(e),jx(e,l)&&(l=Bx(o._scopes,o,e,l)),l}function UV(e,t,n,r){const{_proxy:o,_context:i,_subProxy:s,_descriptors:a}=n;if(typeof i.index<"u"&&r(e))return t[i.index%t.length];if(_t(t[0])){const l=t,c=o._scopes.filter(u=>u!==l);t=[];for(const u of l){const f=Bx(c,o,e,u);t.push(ac(f,i,s&&s[e],a))}}return t}function H2(e,t,n){return Es(e)?e(t,n):e}const qV=(e,t)=>e===!0?t:typeof e=="string"?Cs(t,e):void 0;function GV(e,t,n,r,o){for(const i of t){const s=qV(n,i);if(s){e.add(s);const a=H2(s._fallback,n,o);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(s===!1&&typeof r<"u"&&n!==r)return null}return!1}function Bx(e,t,n,r){const o=t._rootScopes,i=H2(t._fallback,n,r),s=[...e,...o],a=new Set;a.add(r);let l=fE(a,s,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=fE(a,s,i,l,r),l===null)?!1:zx(Array.from(a),[""],o,i,()=>YV(t,n,r))}function fE(e,t,n,r,o){for(;n;)n=GV(e,t,n,r,o);return n}function YV(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return Jt(o)&&_t(n)?n:o||{}}function KV(e,t,n,r){let o;for(const i of t)if(o=W2(VV(i,e),n),typeof o<"u")return jx(e,o)?Bx(n,r,e,o):o}function W2(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function hE(e){let t=e._keys;return t||(t=e._keys=XV(e._scopes)),t}function XV(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(o=>!o.startsWith("_")))t.add(r);return Array.from(t)}function U2(e,t,n,r){const{iScale:o}=e,{key:i="r"}=this._parsing,s=new Array(r);let a,l,c,u;for(a=0,l=r;a<l;++a)c=a+n,u=t[c],s[a]={r:o.parse(Cs(u,i),c)};return s}const QV=Number.EPSILON||1e-14,lc=(e,t)=>t<e.length&&!e[t].skip&&e[t],q2=e=>e==="x"?"y":"x";function JV(e,t,n,r){const o=e.skip?t:e,i=t,s=n.skip?t:n,a=N0(i,o),l=N0(s,i);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const f=r*c,g=r*u;return{previous:{x:i.x-f*(s.x-o.x),y:i.y-f*(s.y-o.y)},next:{x:i.x+g*(s.x-o.x),y:i.y+g*(s.y-o.y)}}}function ZV(e,t,n){const r=e.length;let o,i,s,a,l,c=lc(e,0);for(let u=0;u<r-1;++u)if(l=c,c=lc(e,u+1),!(!l||!c)){if(Eu(t[u],0,QV)){n[u]=n[u+1]=0;continue}o=n[u]/t[u],i=n[u+1]/t[u],a=Math.pow(o,2)+Math.pow(i,2),!(a<=9)&&(s=3/Math.sqrt(a),n[u]=o*s*t[u],n[u+1]=i*s*t[u])}}function eH(e,t,n="x"){const r=q2(n),o=e.length;let i,s,a,l=lc(e,0);for(let c=0;c<o;++c){if(s=a,a=l,l=lc(e,c+1),!a)continue;const u=a[n],f=a[r];s&&(i=(u-s[n])/3,a[`cp1${n}`]=u-i,a[`cp1${r}`]=f-i*t[c]),l&&(i=(l[n]-u)/3,a[`cp2${n}`]=u+i,a[`cp2${r}`]=f+i*t[c])}}function tH(e,t="x"){const n=q2(t),r=e.length,o=Array(r).fill(0),i=Array(r);let s,a,l,c=lc(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=lc(e,s+1),!!l){if(c){const u=c[t]-l[t];o[s]=u!==0?(c[n]-l[n])/u:0}i[s]=a?c?Yo(o[s-1])!==Yo(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}ZV(e,o,i),eH(e,i,t)}function fh(e,t,n){return Math.max(Math.min(e,n),t)}function nH(e,t){let n,r,o,i,s,a=$i(e[0],t);for(n=0,r=e.length;n<r;++n)s=i,i=a,a=n<r-1&&$i(e[n+1],t),i&&(o=e[n],s&&(o.cp1x=fh(o.cp1x,t.left,t.right),o.cp1y=fh(o.cp1y,t.top,t.bottom)),a&&(o.cp2x=fh(o.cp2x,t.left,t.right),o.cp2y=fh(o.cp2y,t.top,t.bottom)))}function rH(e,t,n,r,o){let i,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")tH(e,o);else{let c=r?e[e.length-1]:e[0];for(i=0,s=e.length;i<s;++i)a=e[i],l=JV(c,a,e[Math.min(i+1,s-(r?0:1))%s],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&nH(e,n)}function Vx(){return typeof window<"u"&&typeof document<"u"}function Hx(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Dp(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const Rg=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function oH(e,t){return Rg(e).getPropertyValue(t)}const iH=["top","right","bottom","left"];function Pa(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=iH[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const sH=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function aH(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let s=!1,a,l;if(sH(o,i,e.target))a=o,l=i;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:a,y:l,box:s}}function aa(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=Rg(n),i=o.boxSizing==="border-box",s=Pa(o,"padding"),a=Pa(o,"border","width"),{x:l,y:c,box:u}=aH(e,n),f=s.left+(u&&a.left),g=s.top+(u&&a.top);let{width:p,height:v}=t;return i&&(p-=s.width+a.width,v-=s.height+a.height),{x:Math.round((l-f)/p*n.width/r),y:Math.round((c-g)/v*n.height/r)}}function lH(e,t,n){let r,o;if(t===void 0||n===void 0){const i=Hx(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const s=i.getBoundingClientRect(),a=Rg(i),l=Pa(a,"border","width"),c=Pa(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Dp(a.maxWidth,i,"clientWidth"),o=Dp(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||Op,maxHeight:o||Op}}const hh=e=>Math.round(e*10)/10;function cH(e,t,n,r){const o=Rg(e),i=Pa(o,"margin"),s=Dp(o.maxWidth,e,"clientWidth")||Op,a=Dp(o.maxHeight,e,"clientHeight")||Op,l=lH(e,t,n);let{width:c,height:u}=l;if(o.boxSizing==="content-box"){const g=Pa(o,"border","width"),p=Pa(o,"padding");c-=p.width+g.width,u-=p.height+g.height}return c=Math.max(0,c-i.width),u=Math.max(0,r?c/r:u-i.height),c=hh(Math.min(c,s,l.maxWidth)),u=hh(Math.min(u,a,l.maxHeight)),c&&!u&&(u=hh(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=hh(Math.floor(u*r))),{width:c,height:u}}function pE(e,t,n){const r=t||1,o=Math.floor(e.height*r),i=Math.floor(e.width*r);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const s=e.canvas;return s.style&&(n||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==o||s.width!==i?(e.currentDevicePixelRatio=r,s.height=o,s.width=i,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const uH=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Vx()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function gE(e,t){const n=oH(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function la(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function dH(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r==="middle"?n<.5?e.y:t.y:r==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function fH(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},s=la(e,o,n),a=la(o,i,n),l=la(i,t,n),c=la(s,a,n),u=la(a,l,n);return la(c,u,n)}const hH=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},pH=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Nl(e,t,n){return e?hH(t,n):pH()}function G2(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function Y2(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function K2(e){return e==="angle"?{between:qu,compare:gV,normalize:Ir}:{between:Pi,compare:(t,n)=>t-n,normalize:t=>t}}function mE({start:e,end:t,count:n,loop:r,style:o}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:o}}function gH(e,t,n){const{property:r,start:o,end:i}=n,{between:s,normalize:a}=K2(r),l=t.length;let{start:c,end:u,loop:f}=e,g,p;if(f){for(c+=l,u+=l,g=0,p=l;g<p&&s(a(t[c%l][r]),o,i);++g)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:f,style:e.style}}function X2(e,t,n){if(!n)return[e];const{property:r,start:o,end:i}=n,s=t.length,{compare:a,between:l,normalize:c}=K2(r),{start:u,end:f,loop:g,style:p}=gH(e,t,n),v=[];let y=!1,x=null,w,_,S;const R=()=>l(o,S,w)&&a(o,S)!==0,E=()=>a(i,w)===0||l(i,S,w),O=()=>y||R(),k=()=>!y||E();for(let T=u,M=u;T<=f;++T)_=t[T%s],!_.skip&&(w=c(_[r]),w!==S&&(y=l(w,o,i),x===null&&O()&&(x=a(w,o)===0?T:M),x!==null&&k()&&(v.push(mE({start:x,end:T,loop:g,count:s,style:p})),x=null),M=T,S=w));return x!==null&&v.push(mE({start:x,end:f,loop:g,count:s,style:p})),v}function Q2(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const i=X2(r[o],e.points,t);i.length&&n.push(...i)}return n}function mH(e,t,n,r){let o=0,i=t-1;if(n&&!r)for(;o<t&&!e[o].skip;)o++;for(;o<t&&e[o].skip;)o++;for(o%=t,n&&(i+=o);i>o&&e[i%t].skip;)i--;return i%=t,{start:o,end:i}}function vH(e,t,n,r){const o=e.length,i=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%o];c.skip||c.stop?a.skip||(r=!1,i.push({start:t%o,end:(l-1)%o,loop:r}),t=s=c.stop?l:null):(s=l,a.skip&&(t=l)),a=c}return s!==null&&i.push({start:t%o,end:s%o,loop:r}),i}function bH(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:s,end:a}=mH(n,o,i,r);if(r===!0)return vE(e,[{start:s,end:a,loop:i}],n,t);const l=a<s?a+o:a,c=!!e._fullLoop&&s===0&&a===o-1;return vE(e,vH(n,s,l,c),n,t)}function vE(e,t,n,r){return!r||!r.setContext||!n?t:yH(e,t,n,r)}function yH(e,t,n,r){const o=e._chart.getContext(),i=bE(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let u=i,f=t[0].start,g=f;function p(v,y,x,w){const _=a?-1:1;if(v!==y){for(v+=l;n[v%l].skip;)v-=_;for(;n[y%l].skip;)y+=_;v%l!==y%l&&(c.push({start:v%l,end:y%l,loop:x,style:w}),u=w,f=y%l)}}for(const v of t){f=a?f:v.start;let y=n[f%l],x;for(g=f+1;g<=v.end;g++){const w=n[g%l];x=bE(r.setContext(ks(o,{type:"segment",p0:y,p1:w,p0DataIndex:(g-1)%l,p1DataIndex:g%l,datasetIndex:s}))),xH(x,u)&&p(f,g-1,v.loop,u),y=w,u=x}f<g-1&&p(f,g-1,v.loop,u)}return c}function bE(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function xH(e,t){if(!t)return!1;const n=[],r=function(o,i){return Lx(i)?(n.includes(i)||n.push(i),n.indexOf(i)):i};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
120
+ * Chart.js v4.4.1
121
+ * https://www.chartjs.org
122
+ * (c) 2023 Chart.js Contributors
123
+ * Released under the MIT License
124
+ */class wH{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,o){const i=n.listeners[o],s=n.duration;i.forEach(a=>a({chart:t,initial:n.initial,numSteps:s,currentStep:Math.min(r-n.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=A2.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,o)=>{if(!r.running||!r.items.length)return;const i=r.items;let s=i.length-1,a=!1,l;for(;s>=0;--s)l=i[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(i[s]=i[i.length-1],i.pop());a&&(o.draw(),this._notify(o,r,t,"progress")),i.length||(r.running=!1,this._notify(o,r,t,"complete"),r.initial=!1),n+=i.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,o)=>Math.max(r,o._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let o=r.length-1;for(;o>=0;--o)r[o].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var _i=new wH;const yE="transparent",_H={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=cE(e||yE),o=r.valid&&cE(t||yE);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class SH{constructor(t,n,r,o){const i=n[r];o=Qt([t.to,o,i,t.from]);const s=Qt([t.from,i,o]);this._active=!0,this._fn=t.fn||_H[t.type||typeof s],this._easing=Ru[t.easing]||Ru.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=s,this._to=o,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const o=this._target[this._prop],i=r-this._start,s=this._duration-i;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=i,this._loop=!!t.loop,this._to=Qt([t.to,n,o,t.from]),this._from=Qt([t.from,o,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,o=this._prop,i=this._from,s=this._loop,a=this._to;let l;if(this._active=i!==a&&(s||n<r),!this._active){this._target[o]=a,this._notify(!0);return}if(n<0){this._target[o]=i;return}l=n/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[o]=this._fn(i,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let o=0;o<r.length;o++)r[o][n]()}}class J2{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!_t(t))return;const n=Object.keys(an.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const i=t[o];if(!_t(i))return;const s={};for(const a of n)s[a]=i[a];(Jt(i.properties)&&i.properties||[o]).forEach(a=>{(a===o||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,o=EH(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&CH(t.options.$animations,r).then(()=>{t.options=r},()=>{}),i}_createAnimations(t,n){const r=this._properties,o=[],i=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){o.push(...this._animateOptions(t,n));continue}const u=n[c];let f=i[c];const g=r.get(c);if(f)if(g&&f.active()){f.update(g,u,a);continue}else f.cancel();if(!g||!g.duration){t[c]=u;continue}i[c]=f=new SH(g,t,c,u),o.push(f)}return o}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return _i.add(this._chart,r),!0}}function CH(e,t){const n=[],r=Object.keys(t);for(let o=0;o<r.length;o++){const i=e[r[o]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function EH(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function xE(e,t){const n=e&&e.options||{},r=n.reverse,o=n.min===void 0?t:0,i=n.max===void 0?t:0;return{start:r?i:o,end:r?o:i}}function RH(e,t,n){if(n===!1)return!1;const r=xE(e,n),o=xE(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function PH(e){let t,n,r,o;return _t(e)?(t=e.top,n=e.right,r=e.bottom,o=e.left):t=n=r=o=e,{top:t,right:n,bottom:r,left:o,disabled:e===!1}}function Z2(e,t){const n=[],r=e._getSortedDatasetMetas(t);let o,i;for(o=0,i=r.length;o<i;++o)n.push(r[o].index);return n}function wE(e,t,n,r={}){const o=e.keys,i=r.mode==="single";let s,a,l,c;if(t!==null){for(s=0,a=o.length;s<a;++s){if(l=+o[s],l===n){if(r.all)continue;break}c=e.values[l],un(c)&&(i||t===0||Yo(t)===Yo(c))&&(t+=c)}return t}}function OH(e){const t=Object.keys(e),n=new Array(t.length);let r,o,i;for(r=0,o=t.length;r<o;++r)i=t[r],n[r]={x:i,y:e[i]};return n}function _E(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function $H(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function DH(e){const{min:t,max:n,minDefined:r,maxDefined:o}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:o?n:Number.POSITIVE_INFINITY}}function TH(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function SE(e,t,n,r){for(const o of t.getMatchingVisibleMetas(r).reverse()){const i=e[o.index];if(n&&i>0||!n&&i<0)return o.index}return null}function CE(e,t){const{chart:n,_cachedMeta:r}=e,o=n._stacks||(n._stacks={}),{iScale:i,vScale:s,index:a}=r,l=i.axis,c=s.axis,u=$H(i,s,r),f=t.length;let g;for(let p=0;p<f;++p){const v=t[p],{[l]:y,[c]:x}=v,w=v._stacks||(v._stacks={});g=w[c]=TH(o,u,y),g[a]=x,g._top=SE(g,s,!0,r.type),g._bottom=SE(g,s,!1,r.type);const _=g._visualValues||(g._visualValues={});_[a]=x}}function qv(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function kH(e,t){return ks(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function MH(e,t,n){return ks(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function tu(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const o of t){const i=o._stacks;if(!i||i[r]===void 0||i[r][n]===void 0)return;delete i[r][n],i[r]._visualValues!==void 0&&i[r]._visualValues[n]!==void 0&&delete i[r]._visualValues[n]}}}const Gv=e=>e==="reset"||e==="none",EE=(e,t)=>t?e:Object.assign({},e),AH=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Z2(n,!0),values:null};class Eo{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=_E(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&tu(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(f,g,p,v)=>f==="x"?g:f==="r"?v:p,i=n.xAxisID=it(r.xAxisID,qv(t,"x")),s=n.yAxisID=it(r.yAxisID,qv(t,"y")),a=n.rAxisID=it(r.rAxisID,qv(t,"r")),l=n.indexAxis,c=n.iAxisID=o(l,i,s,a),u=n.vAxisID=o(l,s,i,a);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&sE(this._data,this),t._stacked&&tu(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(_t(n))this._data=OH(n);else if(r!==n){if(r){sE(r,this);const o=this._cachedMeta;tu(o),o._parsed=[]}n&&Object.isExtensible(n)&&yV(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let o=!1;this._dataCheck();const i=n._stacked;n._stacked=_E(n.vScale,n),n.stack!==r.stack&&(o=!0,tu(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&CE(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:o}=this,{iScale:i,_stacked:s}=r,a=i.axis;let l=t===0&&n===o.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,f,g;if(this._parsing===!1)r._parsed=o,r._sorted=!0,g=o;else{Jt(o[t])?g=this.parseArrayData(r,o,t,n):_t(o[t])?g=this.parseObjectData(r,o,t,n):g=this.parsePrimitiveData(r,o,t,n);const p=()=>f[a]===null||c&&f[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=f=g[u],l&&(p()&&(l=!1),c=f);r._sorted=l}s&&CE(this,g)}parsePrimitiveData(t,n,r,o){const{iScale:i,vScale:s}=t,a=i.axis,l=s.axis,c=i.getLabels(),u=i===s,f=new Array(o);let g,p,v;for(g=0,p=o;g<p;++g)v=g+r,f[g]={[a]:u||i.parse(c[v],v),[l]:s.parse(n[v],v)};return f}parseArrayData(t,n,r,o){const{xScale:i,yScale:s}=t,a=new Array(o);let l,c,u,f;for(l=0,c=o;l<c;++l)u=l+r,f=n[u],a[l]={x:i.parse(f[0],u),y:s.parse(f[1],u)};return a}parseObjectData(t,n,r,o){const{xScale:i,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(o);let u,f,g,p;for(u=0,f=o;u<f;++u)g=u+r,p=n[g],c[u]={x:i.parse(Cs(p,a),g),y:s.parse(Cs(p,l),g)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const o=this.chart,i=this._cachedMeta,s=n[t.axis],a={keys:Z2(o,!0),values:n._stacks[t.axis]._visualValues};return wE(a,s,i.index,{mode:r})}updateRangeFromParsed(t,n,r,o){const i=r[n.axis];let s=i===null?NaN:i;const a=o&&r._stacks[n.axis];o&&a&&(o.values=a,s=wE(o,i,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,n){const r=this._cachedMeta,o=r._parsed,i=r._sorted&&t===r.iScale,s=o.length,a=this._getOtherScale(t),l=AH(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=DH(a);let g,p;function v(){p=o[g];const y=p[a.axis];return!un(p[t.axis])||u>y||f<y}for(g=0;g<s&&!(!v()&&(this.updateRangeFromParsed(c,t,p,l),i));++g);if(i){for(g=s-1;g>=0;--g)if(!v()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let o,i,s;for(o=0,i=n.length;o<i;++o)s=n[o][t.axis],un(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,o=n.vScale,i=this.getParsed(t);return{label:r?""+r.getLabelForValue(i[r.axis]):"",value:o?""+o.getLabelForValue(i[o.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=PH(it(this.options.clip,RH(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,o=r.data||[],i=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||o.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,i,a,l),u=a;u<a+l;++u){const f=o[u];f.hidden||(f.active&&c?s.push(f):f.draw(t,i))}for(u=0;u<s.length;++u)s[u].draw(t,i)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const o=this.getDataset();let i;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];i=s.$context||(s.$context=MH(this.getContext(),t,s)),i.parsed=this.getParsed(t),i.raw=o.data[t],i.index=i.dataIndex=t}else i=this.$context||(this.$context=kH(this.chart.getContext(),this.index)),i.dataset=o,i.index=i.datasetIndex=this.index;return i.active=!!n,i.mode=r,i}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const o=n==="active",i=this._cachedDataOpts,s=t+"-"+n,a=i[s],l=this.enableOptionSharing&&Uu(r);if(a)return EE(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),f=o?[`${t}Hover`,"hover",t,""]:[t,""],g=c.getOptionScopes(this.getDataset(),u),p=Object.keys(an.elements[t]),v=()=>this.getContext(r,o,n),y=c.resolveNamedOptions(g,p,v,f);return y.$shared&&(y.$shared=l,i[s]=Object.freeze(EE(y,l))),y}_resolveAnimations(t,n,r){const o=this.chart,i=this._cachedDataOpts,s=`animation-${n}`,a=i[s];if(a)return a;let l;if(o.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),g=u.getOptionScopes(this.getDataset(),f);l=u.createResolver(g,this.getContext(t,r,n))}const c=new J2(o,l&&l.animations);return l&&l._cacheable&&(i[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Gv(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),o=this._sharedOptions,i=this.getSharedOptions(r),s=this.includeOptions(n,i)||i!==o;return this.updateSharedOptions(i,n,r),{sharedOptions:i,includeOptions:s}}updateElement(t,n,r,o){Gv(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!Gv(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,o){t.active=o;const i=this.getStyle(n,o);this._resolveAnimations(n,r,o).update(t,{options:!o&&this.getSharedOptions(i)||i})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const o=r.length,i=n.length,s=Math.min(i,o);s&&this.parse(0,s),i>o?this._insertElements(o,i-o,t):i<o&&this._removeElements(i,o-i)}_insertElements(t,n,r=!0){const o=this._cachedMeta,i=o.data,s=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(i),a=t;a<s;++a)i[a]=new this.dataElementType;this._parsing&&l(o._parsed),this.parse(t,n),r&&this.updateElements(i,t,n,"reset")}updateElements(t,n,r,o){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const o=r._parsed.splice(t,n);r._stacked&&tu(r,o)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,o]=t;this[n](r,o)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}De(Eo,"defaults",{}),De(Eo,"datasetElementType",null),De(Eo,"dataElementType",null);function IH(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let o=0,i=n.length;o<i;o++)r=r.concat(n[o].controller.getAllParsedValues(e));e._cache.$bar=M2(r.sort((o,i)=>o-i))}return e._cache.$bar}function NH(e){const t=e.iScale,n=IH(t,e.type);let r=t._length,o,i,s,a;const l=()=>{s===32767||s===-32768||(Uu(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(o=0,i=n.length;o<i;++o)s=t.getPixelForValue(n[o]),l();for(a=void 0,o=0,i=t.ticks.length;o<i;++o)s=t.getPixelForTick(o),l();return r}function LH(e,t,n,r){const o=n.barThickness;let i,s;return yt(o)?(i=t.min*n.categoryPercentage,s=n.barPercentage):(i=o*r,s=1),{chunk:i/r,ratio:s,start:t.pixels[e]-i/2}}function FH(e,t,n,r){const o=t.pixels,i=o[e];let s=e>0?o[e-1]:null,a=e<o.length-1?o[e+1]:null;const l=n.categoryPercentage;s===null&&(s=i-(a===null?t.end-t.start:a-i)),a===null&&(a=i+i-s);const c=i-(i-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function zH(e,t,n,r){const o=n.parse(e[0],r),i=n.parse(e[1],r),s=Math.min(o,i),a=Math.max(o,i);let l=s,c=a;Math.abs(s)>Math.abs(a)&&(l=a,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:o,end:i,min:s,max:a}}function eD(e,t,n,r){return Jt(e)?zH(e,t,n,r):t[n.axis]=n.parse(e,r),t}function RE(e,t,n,r){const o=e.iScale,i=e.vScale,s=o.getLabels(),a=o===i,l=[];let c,u,f,g;for(c=n,u=n+r;c<u;++c)g=t[c],f={},f[o.axis]=a||o.parse(s[c],c),l.push(eD(g,f,i,c));return l}function Yv(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function jH(e,t,n){return e!==0?Yo(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function BH(e){let t,n,r,o,i;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(o="end",i="start"):(o="start",i="end"),{start:n,end:r,reverse:t,top:o,bottom:i}}function VH(e,t,n,r){let o=t.borderSkipped;const i={};if(!o){e.borderSkipped=i;return}if(o===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:c,bottom:u}=BH(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[PE(u,s,a,l)]=!0,o=c)),i[PE(o,s,a,l)]=!0,e.borderSkipped=i}function PE(e,t,n,r){return r?(e=HH(e,t,n),e=OE(e,n,t)):e=OE(e,t,n),e}function HH(e,t,n){return e===t?n:e===n?t:e}function OE(e,t,n){return e==="start"?t:e==="end"?n:e}function WH(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class ep extends Eo{parsePrimitiveData(t,n,r,o){return RE(t,n,r,o)}parseArrayData(t,n,r,o){return RE(t,n,r,o)}parseObjectData(t,n,r,o){const{iScale:i,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=i.axis==="x"?a:l,u=s.axis==="x"?a:l,f=[];let g,p,v,y;for(g=r,p=r+o;g<p;++g)y=n[g],v={},v[i.axis]=i.parse(Cs(y,c),g),f.push(eD(Cs(y,u),v,s,g));return f}updateRangeFromParsed(t,n,r,o){super.updateRangeFromParsed(t,n,r,o);const i=r._custom;i&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,i.min),t.max=Math.max(t.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:o}=n,i=this.getParsed(t),s=i._custom,a=Yv(s)?"["+s.start+", "+s.end+"]":""+o.getLabelForValue(i[o.axis]);return{label:""+r.getLabelForValue(i[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,o){const i=o==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:g}=this._getSharedOptions(n,o);for(let p=n;p<n+r;p++){const v=this.getParsed(p),y=i||yt(v[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),x=this._calculateBarIndexPixels(p,u),w=(v._stacks||{})[a.axis],_={horizontal:c,base:y.base,enableBorderRadius:!w||Yv(v._custom)||s===w._top||s===w._bottom,x:c?y.head:x.center,y:c?x.center:y.head,height:c?x.size:Math.abs(y.size),width:c?Math.abs(y.size):x.size};g&&(_.options=f||this.resolveDataElementOptions(p,t[p].active?"active":o));const S=_.options||t[p].options;VH(_,S,w,s),WH(_,S,u.ratio),this.updateElement(t[p],p,_,o)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,o=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),i=r.options.stacked,s=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(yt(u)||isNaN(u))return!0};for(const l of o)if(!(n!==void 0&&a(l))&&((i===!1||s.indexOf(l.stack)===-1||i===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const o=this._getStacks(t,r),i=n!==void 0?o.indexOf(n):-1;return i===-1?o.length-1:i}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,o=[];let i,s;for(i=0,s=n.data.length;i<s;++i)o.push(r.getPixelForValue(this.getParsed(i)[r.axis],i));const a=t.barThickness;return{min:a||NH(n),pixels:o,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:o},options:{base:i,minBarLength:s}}=this,a=i||0,l=this.getParsed(t),c=l._custom,u=Yv(c);let f=l[n.axis],g=0,p=r?this.applyStack(n,l,r):f,v,y;p!==f&&(g=p-f,p=f),u&&(f=c.barStart,p=c.barEnd-c.barStart,f!==0&&Yo(f)!==Yo(c.barEnd)&&(g=0),g+=f);const x=!yt(i)&&!u?i:g;let w=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?v=n.getPixelForValue(g+p):v=w,y=v-w,Math.abs(y)<s){y=jH(y,n,a)*s,f===a&&(w-=y/2);const _=n.getPixelForDecimal(0),S=n.getPixelForDecimal(1),R=Math.min(_,S),E=Math.max(_,S);w=Math.max(Math.min(w,E),R),v=w+y,r&&!u&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(v)-n.getValueForPixel(w))}if(w===n.getPixelForValue(a)){const _=Yo(y)*n.getLineWidthForValue(a)/2;w+=_,y-=_}return{size:y,base:w,head:v,center:v+y/2}}_calculateBarIndexPixels(t,n){const r=n.scale,o=this.options,i=o.skipNull,s=it(o.maxBarThickness,1/0);let a,l;if(n.grouped){const c=i?this._getStackCount(t):n.stackCount,u=o.barThickness==="flex"?FH(t,n,o,c):LH(t,n,o,c),f=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0);a=u.start+u.chunk*f+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,o=r.length;let i=0;for(;i<o;++i)this.getParsed(i)[n.axis]!==null&&r[i].draw(this._ctx)}}De(ep,"id","bar"),De(ep,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),De(ep,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class tp extends Eo{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,o){const i=super.parsePrimitiveData(t,n,r,o);for(let s=0;s<i.length;s++)i[s]._custom=this.resolveDataElementOptions(s+r).radius;return i}parseArrayData(t,n,r,o){const i=super.parseArrayData(t,n,r,o);for(let s=0;s<i.length;s++){const a=n[r+s];i[s]._custom=it(a[2],this.resolveDataElementOptions(s+r).radius)}return i}parseObjectData(t,n,r,o){const i=super.parseObjectData(t,n,r,o);for(let s=0;s<i.length;s++){const a=n[r+s];i[s]._custom=it(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return i}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:i}=n,s=this.getParsed(t),a=o.getLabelForValue(s.x),l=i.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,o),u=s.axis,f=a.axis;for(let g=n;g<n+r;g++){const p=t[g],v=!i&&this.getParsed(g),y={},x=y[u]=i?s.getPixelForDecimal(.5):s.getPixelForValue(v[u]),w=y[f]=i?a.getBasePixel():a.getPixelForValue(v[f]);y.skip=isNaN(x)||isNaN(w),c&&(y.options=l||this.resolveDataElementOptions(g,p.active?"active":o),i&&(y.options.radius=0)),this.updateElement(p,g,y,o)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let o=super.resolveDataElementOptions(t,n);o.$shared&&(o=Object.assign({},o,{$shared:!1}));const i=o.radius;return n!=="active"&&(o.radius=0),o.radius+=it(r&&r._custom,i),o}}De(tp,"id","bubble"),De(tp,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),De(tp,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function UH(e,t,n){let r=1,o=1,i=0,s=0;if(t<Zt){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),f=Math.cos(l),g=Math.sin(l),p=(S,R,E)=>qu(S,a,l,!0)?1:Math.max(R,R*n,E,E*n),v=(S,R,E)=>qu(S,a,l,!0)?-1:Math.min(R,R*n,E,E*n),y=p(0,c,f),x=p(mn,u,g),w=v(en,c,f),_=v(en+mn,u,g);r=(y-w)/2,o=(x-_)/2,i=-(y+w)/2,s=-(x+_)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:s}}class ga extends Eo{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=r;else{let i=l=>+r[l];if(_t(r[t])){const{key:l="value"}=this._parsing;i=c=>+Cs(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)o._parsed[s]=i(s)}}_getRotation(){return Co(this.options.rotation-90)}_getCircumference(){return Co(this.options.circumference)}_getRotationExtents(){let t=Zt,n=-Zt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const o=this.chart.getDatasetMeta(r).controller,i=o._getRotation(),s=o._getCircumference();t=Math.min(t,i),n=Math.max(n,i+s)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,o=this._cachedMeta,i=o.data,s=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(iV(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:g,ratioY:p,offsetX:v,offsetY:y}=UH(f,u,l),x=(r.width-s)/g,w=(r.height-s)/p,_=Math.max(Math.min(x,w)/2,0),S=O2(this.options.radius,_),R=Math.max(S*l,0),E=(S-R)/this._getVisibleDatasetWeightTotal();this.offsetX=v*S,this.offsetY=y*S,o.total=this.calculateTotal(),this.outerRadius=S-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*c,0),this.updateElements(i,0,i.length,t)}_circumference(t,n){const r=this.options,o=this._cachedMeta,i=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||o._parsed[t]===null||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*i/Zt)}updateElements(t,n,r,o){const i=o==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,u=(a.left+a.right)/2,f=(a.top+a.bottom)/2,g=i&&c.animateScale,p=g?0:this.innerRadius,v=g?0:this.outerRadius,{sharedOptions:y,includeOptions:x}=this._getSharedOptions(n,o);let w=this._getRotation(),_;for(_=0;_<n;++_)w+=this._circumference(_,i);for(_=n;_<n+r;++_){const S=this._circumference(_,i),R=t[_],E={x:u+this.offsetX,y:f+this.offsetY,startAngle:w,endAngle:w+S,circumference:S,outerRadius:v,innerRadius:p};x&&(E.options=y||this.resolveDataElementOptions(_,R.active?"active":o)),w+=S,this.updateElement(R,_,E,o)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,o;for(o=0;o<n.length;o++){const i=t._parsed[o];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(o)&&!n[o].hidden&&(r+=Math.abs(i))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Zt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=Gd(n._parsed[t],r.options.locale);return{label:o[t]||"",value:i}}getMaxBorderWidth(t){let n=0;const r=this.chart;let o,i,s,a,l;if(!t){for(o=0,i=r.data.datasets.length;o<i;++o)if(r.isDatasetVisible(o)){s=r.getDatasetMeta(o),t=s.data,a=s.controller;break}}if(!t)return 0;for(o=0,i=t.length;o<i;++o)l=a.resolveDataElementOptions(o),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,o=t.length;r<o;++r){const i=this.resolveDataElementOptions(r);n=Math.max(n,i.offset||0,i.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(it(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}De(ga,"id","doughnut"),De(ga,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),De(ga,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),De(ga,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=t.legend.options;return n.labels.map((i,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});class np extends Eo{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:r,data:o=[],_dataset:i}=n,s=this.chart._animationsDisabled;let{start:a,count:l}=N2(n,o,s);this._drawStart=a,this._drawCount=l,L2(n)&&(a=0,l=o.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!i._decimated,r.points=o;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(o,a,l,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,o),g=s.axis,p=a.axis,{spanGaps:v,segment:y}=this.options,x=sc(v)?v:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||i||o==="none",_=n+r,S=t.length;let R=n>0&&this.getParsed(n-1);for(let E=0;E<S;++E){const O=t[E],k=w?O:{};if(E<n||E>=_){k.skip=!0;continue}const T=this.getParsed(E),M=yt(T[p]),F=k[g]=s.getPixelForValue(T[g],E),z=k[p]=i||M?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,T,l):T[p],E);k.skip=isNaN(F)||isNaN(z)||M,k.stop=E>0&&Math.abs(T[g]-R[g])>x,y&&(k.parsed=T,k.raw=c.data[E]),f&&(k.options=u||this.resolveDataElementOptions(E,O.active?"active":o)),w||this.updateElement(O,E,k,o),R=T}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,o=t.data||[];if(!o.length)return r;const i=o[0].size(this.resolveDataElementOptions(0)),s=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(r,i,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}De(np,"id","line"),De(np,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),De(np,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ou extends Eo{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=Gd(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return U2.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,o)=>{const i=this.getParsed(o).r;!isNaN(i)&&this.chart.getDataVisibility(o)&&(i<n.min&&(n.min=i),i>n.max&&(n.max=i))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,o=Math.min(n.right-n.left,n.bottom-n.top),i=Math.max(o/2,0),s=Math.max(r.cutoutPercentage?i/100*r.cutoutPercentage:1,0),a=(i-s)/t.getVisibleDatasetCount();this.outerRadius=i-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,o){const i=o==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,f=c.yCenter,g=c.getIndexAngle(0)-.5*en;let p=g,v;const y=360/this.countVisibleElements();for(v=0;v<n;++v)p+=this._computeAngle(v,o,y);for(v=n;v<n+r;v++){const x=t[v];let w=p,_=p+this._computeAngle(v,o,y),S=s.getDataVisibility(v)?c.getDistanceFromCenterForValue(this.getParsed(v).r):0;p=_,i&&(l.animateScale&&(S=0),l.animateRotate&&(w=_=g));const R={x:u,y:f,innerRadius:0,outerRadius:S,startAngle:w,endAngle:_,options:this.resolveDataElementOptions(v,x.active?"active":o)};this.updateElement(x,v,R,o)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((r,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&n++}),n}_computeAngle(t,n,r){return this.chart.getDataVisibility(t)?Co(this.resolveDataElementOptions(t,n).angle||r):0}}De(Ou,"id","polarArea"),De(Ou,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),De(Ou,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color:o}}=t.legend.options;return n.labels.map((i,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:o,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class z0 extends ga{}De(z0,"id","pie"),De(z0,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class rp extends Eo{getLabelAndValue(t){const n=this._cachedMeta.vScale,r=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(r[n.axis])}}parseObjectData(t,n,r,o){return U2.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta,r=n.dataset,o=n.data||[],i=n.iScale.getLabels();if(r.points=o,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:i.length===o.length,options:s};this.updateElement(r,void 0,a,t)}this.updateElements(o,0,o.length,t)}updateElements(t,n,r,o){const i=this._cachedMeta.rScale,s=o==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":o),u=i.getPointPositionForValue(a,this.getParsed(a).r),f=s?i.xCenter:u.x,g=s?i.yCenter:u.y,p={x:f,y:g,angle:u.angle,skip:isNaN(f)||isNaN(g),options:c};this.updateElement(l,a,p,o)}}}De(rp,"id","radar"),De(rp,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),De(rp,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class op extends Eo{getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:i}=n,s=this.getParsed(t),a=o.getLabelForValue(s.x),l=i.getLabelForValue(s.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const n=this._cachedMeta,{data:r=[]}=n,o=this.chart._animationsDisabled;let{start:i,count:s}=N2(n,r,o);if(this._drawStart=i,this._drawCount=s,L2(n)&&(i=0,s=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!o,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,i,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,o),f=this.getSharedOptions(u),g=this.includeOptions(o,f),p=s.axis,v=a.axis,{spanGaps:y,segment:x}=this.options,w=sc(y)?y:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||i||o==="none";let S=n>0&&this.getParsed(n-1);for(let R=n;R<n+r;++R){const E=t[R],O=this.getParsed(R),k=_?E:{},T=yt(O[v]),M=k[p]=s.getPixelForValue(O[p],R),F=k[v]=i||T?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,O,l):O[v],R);k.skip=isNaN(M)||isNaN(F)||T,k.stop=R>0&&Math.abs(O[p]-S[p])>w,x&&(k.parsed=O,k.raw=c.data[R]),g&&(k.options=f||this.resolveDataElementOptions(R,E.active?"active":o)),_||this.updateElement(E,R,k,o),S=O}this.updateSharedOptions(f,o,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,o=r.options&&r.options.borderWidth||0;if(!n.length)return o;const i=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(o,i,s)/2}}De(op,"id","scatter"),De(op,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),De(op,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var qH=Object.freeze({__proto__:null,BarController:ep,BubbleController:tp,DoughnutController:ga,LineController:np,PieController:z0,PolarAreaController:Ou,RadarController:rp,ScatterController:op});function ra(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Wx{constructor(t){De(this,"options");this.options=t||{}}static override(t){Object.assign(Wx.prototype,t)}init(){}formats(){return ra()}parse(){return ra()}format(){return ra()}add(){return ra()}diff(){return ra()}startOf(){return ra()}endOf(){return ra()}}var GH={_date:Wx};function YH(e,t,n,r){const{controller:o,data:i,_sorted:s}=e,a=o._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&s&&i.length){const l=a._reversePixels?vV:Oi;if(r){if(o._sharedOptions){const c=i[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const f=l(i,t,n-u),g=l(i,t,n+u);return{lo:f.lo,hi:g.hi}}}}else return l(i,t,n)}return{lo:0,hi:i.length-1}}function Yd(e,t,n,r,o){const i=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=i.length;a<l;++a){const{index:c,data:u}=i[a],{lo:f,hi:g}=YH(i[a],t,s,o);for(let p=f;p<=g;++p){const v=u[p];v.skip||r(v,c,p)}}}function KH(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,o){const i=t?Math.abs(r.x-o.x):0,s=n?Math.abs(r.y-o.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(s,2))}}function Kv(e,t,n,r,o){const i=[];return!o&&!e.isPointInArea(t)||Yd(e,n,t,function(a,l,c){!o&&!$i(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&i.push({element:a,datasetIndex:l,index:c})},!0),i}function XH(e,t,n,r){let o=[];function i(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:f}=T2(s,{x:t.x,y:t.y});qu(f,c,u)&&o.push({element:s,datasetIndex:a,index:l})}return Yd(e,n,t,i),o}function QH(e,t,n,r,o,i){let s=[];const a=KH(n);let l=Number.POSITIVE_INFINITY;function c(u,f,g){const p=u.inRange(t.x,t.y,o);if(r&&!p)return;const v=u.getCenterPoint(o);if(!(!!i||e.isPointInArea(v))&&!p)return;const x=a(t,v);x<l?(s=[{element:u,datasetIndex:f,index:g}],l=x):x===l&&s.push({element:u,datasetIndex:f,index:g})}return Yd(e,n,t,c),s}function Xv(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?XH(e,t,n,o):QH(e,t,n,r,o,i)}function $E(e,t,n,r,o){const i=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return Yd(e,n,t,(l,c,u)=>{l[s](t[n],o)&&(i.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,o))}),r&&!a?[]:i}var JH={evaluateInteractionItems:Yd,modes:{index(e,t,n,r){const o=aa(t,e),i=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?Kv(e,o,i,r,s):Xv(e,o,i,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,f=c.data[u];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const o=aa(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?Kv(e,o,i,r,s):Xv(e,o,i,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,r){const o=aa(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return Kv(e,o,i,r,s)},nearest(e,t,n,r){const o=aa(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return Xv(e,o,i,n.intersect,r,s)},x(e,t,n,r){const o=aa(t,e);return $E(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=aa(t,e);return $E(e,o,"y",n.intersect,r)}}};const tD=["left","top","right","bottom"];function nu(e,t){return e.filter(n=>n.pos===t)}function DE(e,t){return e.filter(n=>tD.indexOf(n.pos)===-1&&n.box.axis===t)}function ru(e,t){return e.sort((n,r)=>{const o=t?r:n,i=t?n:r;return o.weight===i.weight?o.index-i.index:o.weight-i.weight})}function ZH(e){const t=[];let n,r,o,i,s,a;for(n=0,r=(e||[]).length;n<r;++n)o=e[n],{position:i,options:{stack:s,stackWeight:a=1}}=o,t.push({index:n,box:o,pos:i,horizontal:o.isHorizontal(),weight:o.weight,stack:s&&i+s,stackWeight:a});return t}function eW(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!tD.includes(o))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=i}return t}function tW(e,t){const n=eW(e),{vBoxMaxWidth:r,hBoxMaxHeight:o}=t;let i,s,a;for(i=0,s=e.length;i<s;++i){a=e[i];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&t.availableWidth,a.height=o):(a.width=r,a.height=u?u*o:l&&t.availableHeight)}return n}function nW(e){const t=ZH(e),n=ru(t.filter(c=>c.box.fullSize),!0),r=ru(nu(t,"left"),!0),o=ru(nu(t,"right")),i=ru(nu(t,"top"),!0),s=ru(nu(t,"bottom")),a=DE(t,"x"),l=DE(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:nu(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(s).concat(a)}}function TE(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function nD(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function rW(e,t,n,r){const{pos:o,box:i}=n,s=e.maxPadding;if(!_t(o)){n.size&&(e[o]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?i.height:i.width),n.size=f.size/f.count,e[o]+=n.size}i.getPadding&&nD(s,i.getPadding());const a=Math.max(0,t.outerWidth-TE(s,e,"left","right")),l=Math.max(0,t.outerHeight-TE(s,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function oW(e){const t=e.maxPadding;function n(r){const o=Math.max(t[r]-e[r],0);return e[r]+=o,o}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function iW(e,t){const n=t.maxPadding;function r(o){const i={left:0,top:0,right:0,bottom:0};return o.forEach(s=>{i[s]=Math.max(t[s],n[s])}),i}return r(e?["left","right"]:["top","bottom"])}function bu(e,t,n,r){const o=[];let i,s,a,l,c,u;for(i=0,s=e.length,c=0;i<s;++i){a=e[i],l=a.box,l.update(a.width||t.w,a.height||t.h,iW(a.horizontal,t));const{same:f,other:g}=rW(t,n,a,r);c|=f&&o.length,u=u||g,l.fullSize||o.push(a)}return c&&bu(o,t,n,r)||u}function ph(e,t,n,r,o){e.top=n,e.left=t,e.right=t+r,e.bottom=n+o,e.width=r,e.height=o}function kE(e,t,n,r){const o=n.padding;let{x:i,y:s}=t;for(const a of e){const l=a.box,c=r[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*u,g=c.size||l.height;Uu(c.start)&&(s=c.start),l.fullSize?ph(l,o.left,s,n.outerWidth-o.right-o.left,g):ph(l,t.left+c.placed,s,f,g),c.start=s,c.placed+=f,s=l.bottom}else{const f=t.h*u,g=c.size||l.width;Uu(c.start)&&(i=c.start),l.fullSize?ph(l,i,o.top,g,n.outerHeight-o.bottom-o.top):ph(l,i,t.top+c.placed,g,f),c.start=i,c.placed+=f,i=l.right}}t.x=i,t.y=s}var qn={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const o=Fn(e.options.layout.padding),i=Math.max(t-o.width,0),s=Math.max(n-o.height,0),a=nW(e.boxes),l=a.vertical,c=a.horizontal;At(e.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,x)=>x.box.options&&x.box.options.display===!1?y:y+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:s,vBoxMaxWidth:i/2/u,hBoxMaxHeight:s/2}),g=Object.assign({},o);nD(g,Fn(r));const p=Object.assign({maxPadding:g,w:i,h:s,x:o.left,y:o.top},o),v=tW(l.concat(c),f);bu(a.fullSize,p,f,v),bu(l,p,f,v),bu(c,p,f,v)&&bu(l,p,f,v),oW(p),kE(a.leftAndTop,p,f,v),p.x+=p.w,p.y+=p.h,kE(a.rightAndBottom,p,f,v),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},At(a.chartArea,y=>{const x=y.box;Object.assign(x,e.chartArea),x.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class rD{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,o){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,o?Math.floor(n/o):r)}}isAttached(t){return!0}updateConfig(t){}}class sW extends rD{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ip="$chartjs",aW={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ME=e=>e===null||e==="";function lW(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[ip]={initial:{height:r,width:o,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",ME(o)){const i=gE(e,"width");i!==void 0&&(e.width=i)}if(ME(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=gE(e,"height");i!==void 0&&(e.height=i)}return e}const oD=uH?{passive:!0}:!1;function cW(e,t,n){e.addEventListener(t,n,oD)}function uW(e,t,n){e.canvas.removeEventListener(t,n,oD)}function dW(e,t){const n=aW[e.type]||e.type,{x:r,y:o}=aa(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function Tp(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function fW(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||Tp(a.addedNodes,r),s=s&&!Tp(a.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function hW(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||Tp(a.removedNodes,r),s=s&&!Tp(a.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const Yu=new Map;let AE=0;function iD(){const e=window.devicePixelRatio;e!==AE&&(AE=e,Yu.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function pW(e,t){Yu.size||window.addEventListener("resize",iD),Yu.set(e,t)}function gW(e){Yu.delete(e),Yu.size||window.removeEventListener("resize",iD)}function mW(e,t,n){const r=e.canvas,o=r&&Hx(r);if(!o)return;const i=I2((a,l)=>{const c=o.clientWidth;n(a,l),c<o.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||i(c,u)});return s.observe(o),pW(e,i),s}function Qv(e,t,n){n&&n.disconnect(),t==="resize"&&gW(e)}function vW(e,t,n){const r=e.canvas,o=I2(i=>{e.ctx!==null&&n(dW(i,e))},e);return cW(r,t,o),o}class bW extends rD{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(lW(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[ip])return!1;const r=n[ip].initial;["height","width"].forEach(i=>{const s=r[i];yt(s)?n.removeAttribute(i):n.setAttribute(i,s)});const o=r.style||{};return Object.keys(o).forEach(i=>{n.style[i]=o[i]}),n.width=n.width,delete n[ip],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),s={attach:fW,detach:hW,resize:mW}[n]||vW;o[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:Qv,detach:Qv,resize:Qv}[n]||uW)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return cH(t,n,r,o)}isAttached(t){const n=Hx(t);return!!(n&&n.isConnected)}}function yW(e){return!Vx()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?sW:bW}var Jh;let Fi=(Jh=class{constructor(){De(this,"x");De(this,"y");De(this,"active",!1);De(this,"options");De(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return sc(this.x)&&sc(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const o={};return t.forEach(i=>{o[i]=r[i]&&r[i].active()?r[i]._to:this[i]}),o}},De(Jh,"defaults",{}),De(Jh,"defaultRoutes"),Jh);function xW(e,t){const n=e.options.ticks,r=wW(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?SW(t):[],s=i.length,a=i[0],l=i[s-1],c=[];if(s>o)return CW(t,c,i,s/o),c;const u=_W(i,t,o);if(s>0){let f,g;const p=s>1?Math.round((l-a)/(s-1)):null;for(gh(t,c,u,yt(p)?0:a-p,a),f=0,g=s-1;f<g;f++)gh(t,c,u,i[f],i[f+1]);return gh(t,c,u,l,yt(p)?t.length:l+p),c}return gh(t,c,u),c}function wW(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),o=e._maxLength/n;return Math.floor(Math.min(r,o))}function _W(e,t,n){const r=EW(e),o=t.length/n;if(!r)return Math.max(o,1);const i=hV(r);for(let s=0,a=i.length-1;s<a;s++){const l=i[s];if(l>o)return l}return Math.max(o,1)}function SW(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function CW(e,t,n,r){let o=0,i=n[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===i&&(t.push(e[s]),o++,i=n[o*r])}function gh(e,t,n,r,o){const i=it(r,0),s=Math.min(it(o,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),o&&(l=o-r,n=l/Math.floor(l/n)),u=i;u<0;)a++,u=Math.round(i+a*n);for(c=Math.max(i,0);c<s;c++)c===u&&(t.push(e[c]),a++,u=Math.round(i+a*n))}function EW(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const RW=e=>e==="left"?"right":e==="right"?"left":e,IE=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,NE=(e,t)=>Math.min(t||e,e);function LE(e,t){const n=[],r=e.length/t,o=e.length;let i=0;for(;i<o;i+=r)n.push(e[Math.floor(i)]);return n}function PW(e,t,n){const r=e.ticks.length,o=Math.min(t,r-1),i=e._startPixel,s=e._endPixel,a=1e-6;let l=e.getPixelForTick(o),c;if(!(n&&(r===1?c=Math.max(l-i,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(o-1))/2,l+=o<t?c:-c,l<i-a||l>s+a)))return l}function OW(e,t){At(e,n=>{const r=n.gc,o=r.length/2;let i;if(o>t){for(i=0;i<o;++i)delete n.data[r[i]];r.splice(0,o)}})}function ou(e){return e.drawTicks?e.tickLength:0}function FE(e,t){if(!e.display)return 0;const n=bn(e.font,t),r=Fn(e.padding);return(Jt(e.text)?e.text.length:1)*n.lineHeight+r.height}function $W(e,t){return ks(e,{scale:t,type:"scale"})}function DW(e,t,n){return ks(e,{tick:n,index:t,type:"tick"})}function TW(e,t,n){let r=Nx(e);return(n&&t!=="right"||!n&&t==="right")&&(r=RW(r)),r}function kW(e,t,n,r){const{top:o,left:i,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let f=0,g,p,v;const y=s-o,x=a-i;if(e.isHorizontal()){if(p=Un(r,i,a),_t(n)){const w=Object.keys(n)[0],_=n[w];v=u[w].getPixelForValue(_)+y-t}else n==="center"?v=(c.bottom+c.top)/2+y-t:v=IE(e,n,t);g=a-i}else{if(_t(n)){const w=Object.keys(n)[0],_=n[w];p=u[w].getPixelForValue(_)-x+t}else n==="center"?p=(c.left+c.right)/2-x+t:p=IE(e,n,t);v=Un(r,s,o),f=n==="left"?-mn:mn}return{titleX:p,titleY:v,maxWidth:g,rotation:f}}class Wa extends Fi{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:o}=this;return t=Tr(t,Number.POSITIVE_INFINITY),n=Tr(n,Number.NEGATIVE_INFINITY),r=Tr(r,Number.POSITIVE_INFINITY),o=Tr(o,Number.NEGATIVE_INFINITY),{min:Tr(t,r),max:Tr(n,o),minDefined:un(t),maxDefined:un(n)}}getMinMax(t){let{min:n,max:r,minDefined:o,maxDefined:i}=this.getUserBounds(),s;if(o&&i)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)s=a[l].controller.getMinMax(this,t),o||(n=Math.min(n,s.min)),i||(r=Math.max(r,s.max));return n=i&&n>r?r:n,r=o&&n>r?n:r,{min:Tr(n,Tr(r,n)),max:Tr(r,Tr(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ft(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:o,grace:i,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=BV(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?LE(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=xW(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Ft(this.options.afterUpdate,[this])}beforeSetDimensions(){Ft(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){Ft(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Ft(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ft(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,o,i;for(r=0,o=t.length;r<o;r++)i=t[r],i.label=Ft(n.callback,[i.value,r,t],this)}afterTickToLabelConversion(){Ft(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ft(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=NE(this.ticks.length,t.ticks.maxTicksLimit),o=n.minRotation||0,i=n.maxRotation;let s=o,a,l,c;if(!this._isVisible()||!n.display||o>=i||r<=1||!this.isHorizontal()){this.labelRotation=o;return}const u=this._getLabelSizes(),f=u.widest.width,g=u.highest.height,p=$n(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:p/(r-1),f+6>a&&(a=p/(r-(t.offset?.5:1)),l=this.maxHeight-ou(t.grid)-n.padding-FE(t.title,this.chart.options.font),c=Math.sqrt(f*f+g*g),s=Ax(Math.min(Math.asin($n((u.highest.height+6)/a,-1,1)),Math.asin($n(l/c,-1,1))-Math.asin($n(g/c,-1,1)))),s=Math.max(o,Math.min(i,s))),this.labelRotation=s}afterCalculateLabelRotation(){Ft(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ft(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:o,grid:i}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=FE(o,n.options.font);if(a?(t.width=this.maxWidth,t.height=ou(i)+l):(t.height=this.maxHeight,t.width=ou(i)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:f,highest:g}=this._getLabelSizes(),p=r.padding*2,v=Co(this.labelRotation),y=Math.cos(v),x=Math.sin(v);if(a){const w=r.mirror?0:x*f.width+y*g.height;t.height=Math.min(this.maxHeight,t.height+w+p)}else{const w=r.mirror?0:y*f.width+x*g.height;t.width=Math.min(this.maxWidth,t.width+w+p)}this._calculatePadding(c,u,x,y)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,o){const{ticks:{align:i,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let g=0,p=0;l?c?(g=o*t.width,p=r*n.height):(g=r*t.height,p=o*n.width):i==="start"?p=n.width:i==="end"?g=t.width:i!=="inner"&&(g=t.width/2,p=n.width/2),this.paddingLeft=Math.max((g-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-f+s)*this.width/(this.width-f),0)}else{let u=n.height/2,f=t.height/2;i==="start"?(u=0,f=t.height):i==="end"&&(u=n.height,f=0),this.paddingTop=u+s,this.paddingBottom=f+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){Ft(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)yt(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=LE(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:o,_longestTextCache:i}=this,s=[],a=[],l=Math.floor(n/NE(n,r));let c=0,u=0,f,g,p,v,y,x,w,_,S,R,E;for(f=0;f<n;f+=l){if(v=t[f].label,y=this._resolveTickFontOptions(f),o.font=x=y.string,w=i[x]=i[x]||{data:{},gc:[]},_=y.lineHeight,S=R=0,!yt(v)&&!Jt(v))S=$p(o,w.data,w.gc,S,v),R=_;else if(Jt(v))for(g=0,p=v.length;g<p;++g)E=v[g],!yt(E)&&!Jt(E)&&(S=$p(o,w.data,w.gc,S,E),R+=_);s.push(S),a.push(R),c=Math.max(S,c),u=Math.max(R,u)}OW(i,n);const O=s.indexOf(c),k=a.indexOf(u),T=M=>({width:s[M]||0,height:a[M]||0});return{first:T(0),last:T(n-1),widest:T(O),highest:T(k),widths:s,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return mV(this._alignToPixels?na(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=DW(this.getContext(),t,r))}return this.$context||(this.$context=$W(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Co(this.labelRotation),r=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),i=this._getLabelSizes(),s=t.autoSkipPadding||0,a=i?i.widest.width+s:0,l=i?i.highest.height+s:0;return this.isHorizontal()?l*r>a*o?a/r:l/o:l*o<a*r?l/r:a/o}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,o=this.options,{grid:i,position:s,border:a}=o,l=i.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),g=ou(i),p=[],v=a.setContext(this.getContext()),y=v.display?v.width:0,x=y/2,w=function(ee){return na(r,ee,y)};let _,S,R,E,O,k,T,M,F,z,B,Y;if(s==="top")_=w(this.bottom),k=this.bottom-g,M=_-x,z=w(t.top)+x,Y=t.bottom;else if(s==="bottom")_=w(this.top),z=t.top,Y=w(t.bottom)-x,k=_+x,M=this.top+g;else if(s==="left")_=w(this.right),O=this.right-g,T=_-x,F=w(t.left)+x,B=t.right;else if(s==="right")_=w(this.left),F=t.left,B=w(t.right)-x,O=_+x,T=this.left+g;else if(n==="x"){if(s==="center")_=w((t.top+t.bottom)/2+.5);else if(_t(s)){const ee=Object.keys(s)[0],q=s[ee];_=w(this.chart.scales[ee].getPixelForValue(q))}z=t.top,Y=t.bottom,k=_+x,M=k+g}else if(n==="y"){if(s==="center")_=w((t.left+t.right)/2);else if(_t(s)){const ee=Object.keys(s)[0],q=s[ee];_=w(this.chart.scales[ee].getPixelForValue(q))}O=_-x,T=O-g,F=t.left,B=t.right}const G=it(o.ticks.maxTicksLimit,f),j=Math.max(1,Math.ceil(f/G));for(S=0;S<f;S+=j){const ee=this.getContext(S),q=i.setContext(ee),X=a.setContext(ee),re=q.lineWidth,$=q.color,H=X.dash||[],ne=X.dashOffset,I=q.tickWidth,ce=q.tickColor,ge=q.tickBorderDash||[],he=q.tickBorderDashOffset;R=PW(this,S,l),R!==void 0&&(E=na(r,R,re),c?O=T=F=B=E:k=M=z=Y=E,p.push({tx1:O,ty1:k,tx2:T,ty2:M,x1:F,y1:z,x2:B,y2:Y,width:re,color:$,borderDash:H,borderDashOffset:ne,tickWidth:I,tickColor:ce,tickBorderDash:ge,tickBorderDashOffset:he}))}return this._ticksLength=f,this._borderValue=_,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:o,ticks:i}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:f}=i,g=ou(r.grid),p=g+u,v=f?-u:p,y=-Co(this.labelRotation),x=[];let w,_,S,R,E,O,k,T,M,F,z,B,Y="middle";if(o==="top")O=this.bottom-v,k=this._getXAxisLabelAlignment();else if(o==="bottom")O=this.top+v,k=this._getXAxisLabelAlignment();else if(o==="left"){const j=this._getYAxisLabelAlignment(g);k=j.textAlign,E=j.x}else if(o==="right"){const j=this._getYAxisLabelAlignment(g);k=j.textAlign,E=j.x}else if(n==="x"){if(o==="center")O=(t.top+t.bottom)/2+p;else if(_t(o)){const j=Object.keys(o)[0],ee=o[j];O=this.chart.scales[j].getPixelForValue(ee)+p}k=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")E=(t.left+t.right)/2-p;else if(_t(o)){const j=Object.keys(o)[0],ee=o[j];E=this.chart.scales[j].getPixelForValue(ee)}k=this._getYAxisLabelAlignment(g).textAlign}n==="y"&&(l==="start"?Y="top":l==="end"&&(Y="bottom"));const G=this._getLabelSizes();for(w=0,_=a.length;w<_;++w){S=a[w],R=S.label;const j=i.setContext(this.getContext(w));T=this.getPixelForTick(w)+i.labelOffset,M=this._resolveTickFontOptions(w),F=M.lineHeight,z=Jt(R)?R.length:1;const ee=z/2,q=j.color,X=j.textStrokeColor,re=j.textStrokeWidth;let $=k;s?(E=T,k==="inner"&&(w===_-1?$=this.options.reverse?"left":"right":w===0?$=this.options.reverse?"right":"left":$="center"),o==="top"?c==="near"||y!==0?B=-z*F+F/2:c==="center"?B=-G.highest.height/2-ee*F+F:B=-G.highest.height+F/2:c==="near"||y!==0?B=F/2:c==="center"?B=G.highest.height/2-ee*F:B=G.highest.height-z*F,f&&(B*=-1),y!==0&&!j.showLabelBackdrop&&(E+=F/2*Math.sin(y))):(O=T,B=(1-z)*F/2);let H;if(j.showLabelBackdrop){const ne=Fn(j.backdropPadding),I=G.heights[w],ce=G.widths[w];let ge=B-ne.top,he=0-ne.left;switch(Y){case"middle":ge-=I/2;break;case"bottom":ge-=I;break}switch(k){case"center":he-=ce/2;break;case"right":he-=ce;break;case"inner":w===_-1?he-=ce:w>0&&(he-=ce/2);break}H={left:he,top:ge,width:ce+ne.width,height:I+ne.height,color:j.backdropColor}}x.push({label:R,font:M,textOffset:B,options:{rotation:y,color:q,strokeColor:X,strokeWidth:re,textAlign:$,textBaseline:Y,translation:[E,O],backdrop:H}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Co(this.labelRotation))return t==="top"?"left":"right";let o="center";return n.align==="start"?o="left":n.align==="end"?o="right":n.align==="inner"&&(o="inner"),o}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:o,padding:i}}=this.options,s=this._getLabelSizes(),a=t+i,l=s.widest.width;let c,u;return n==="left"?o?(u=this.right+i,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?o?(u=this.left+i,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:o,width:i,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,o,i,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const o=this.ticks.findIndex(i=>i.value===t);return o>=0?n.setContext(this.getContext(o)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let i,s;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(i=0,s=o.length;i<s;++i){const l=o[i];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:o}}=this,i=r.setContext(this.getContext()),s=r.display?i.width:0;if(!s)return;const a=o.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,f,g;this.isHorizontal()?(c=na(t,this.left,s)-s/2,u=na(t,this.right,a)+a/2,f=g=l):(f=na(t,this.top,s)-s/2,g=na(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(c,f),n.lineTo(u,g),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,o=this._computeLabelArea();o&&Cg(r,o);const i=this.getLabelItems(t);for(const s of i){const a=s.options,l=s.font,c=s.label,u=s.textOffset;Ia(r,c,0,u,l,a)}o&&Eg(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=bn(r.font),s=Fn(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||_t(n)?(l+=s.bottom,Jt(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:f,rotation:g}=kW(this,l,n,a);Ia(t,r.text,0,0,i,{color:r.color,maxWidth:f,rotation:g,textAlign:TW(a,n,o),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=it(t.grid&&t.grid.z,-1),o=it(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Wa.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:r,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:o,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",o=[];let i,s;for(i=0,s=n.length;i<s;++i){const a=n[i];a[r]===this.id&&(!t||a.type===t)&&o.push(a)}return o}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return bn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class mh{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;IW(n)&&(r=this.register(n));const o=this.items,i=t.id,s=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+t);return i in o||(o[i]=t,MW(t,s,r),this.override&&an.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,o=this.scope;r in n&&delete n[r],o&&r in an[o]&&(delete an[o][r],this.override&&delete Aa[r])}}function MW(e,t,n){const r=Qo(Object.create(null),[n?an.get(n):{},an.get(t),e.defaults]);an.set(t,r),e.defaultRoutes&&AW(t,e.defaultRoutes),e.descriptors&&an.describe(t,e.descriptors)}function AW(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),o=r.pop(),i=[e].concat(r).join("."),s=t[n].split("."),a=s.pop(),l=s.join(".");an.route(i,o,l,a)})}function IW(e){return"id"in e&&"defaults"in e}class NW{constructor(){this.controllers=new mh(Eo,"datasets",!0),this.elements=new mh(Fi,"elements"),this.plugins=new mh(Object,"plugins"),this.scales=new mh(Wa,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(o=>{const i=r||this._getRegistryForType(o);r||i.isForType(o)||i===this.plugins&&o.id?this._exec(t,i,o):At(o,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const o=Mx(t);Ft(r["before"+o],[],r),n[t](r),Ft(r["after"+o],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const o=n.get(t);if(o===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return o}}var Fo=new NW;class LW{constructor(){this._init=[]}notify(t,n,r,o){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const i=o?this._descriptors(t).filter(o):this._descriptors(t),s=this._notify(i,t,n,r);return n==="afterDestroy"&&(this._notify(i,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,n,r,o){o=o||{};for(const i of t){const s=i.plugin,a=s[r],l=[n,o,i.options];if(Ft(a,l,s)===!1&&o.cancelable)return!1}return!0}invalidate(){yt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,o=it(r.options&&r.options.plugins,{}),i=FW(r);return o===!1&&!n?[]:jW(t,i,o,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,o=(i,s)=>i.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(o(n,r),t,"stop"),this._notify(o(r,n),t,"start")}}function FW(e){const t={},n=[],r=Object.keys(Fo.plugins.items);for(let i=0;i<r.length;i++)n.push(Fo.getPlugin(r[i]));const o=e.plugins||[];for(let i=0;i<o.length;i++){const s=o[i];n.indexOf(s)===-1&&(n.push(s),t[s.id]=!0)}return{plugins:n,localIds:t}}function zW(e,t){return!t&&e===!1?null:e===!0?{}:e}function jW(e,{plugins:t,localIds:n},r,o){const i=[],s=e.getContext();for(const a of t){const l=a.id,c=zW(r[l],o);c!==null&&i.push({plugin:a,options:BW(e.config,{plugin:a,local:n[l]},c,s)})}return i}function BW(e,{plugin:t,local:n},r,o){const i=e.pluginScopeKeys(t),s=e.getOptionScopes(r,i);return n&&t.defaults&&s.push(t.defaults),e.createResolver(s,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function j0(e,t){const n=an.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function VW(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function HW(e,t){return e===t?"_index_":"_value_"}function zE(e){if(e==="x"||e==="y"||e==="r")return e}function WW(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function B0(e,...t){if(zE(e))return e;for(const n of t){const r=n.axis||WW(n.position)||e.length>1&&zE(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function jE(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function UW(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return jE(e,"x",n[0])||jE(e,"y",n[0])}return{}}function qW(e,t){const n=Aa[e.type]||{scales:{}},r=t.scales||{},o=j0(e.type,t),i=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!_t(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=B0(s,a,UW(s,e),an.scales[a.type]),c=HW(l,o),u=n.scales||{};i[s]=Cu(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||j0(a,t),u=(Aa[a]||{}).scales||{};Object.keys(u).forEach(f=>{const g=VW(f,l),p=s[g+"AxisID"]||g;i[p]=i[p]||Object.create(null),Cu(i[p],[{axis:g},r[p],u[f]])})}),Object.keys(i).forEach(s=>{const a=i[s];Cu(a,[an.scales[a.type],an.scale])}),i}function sD(e){const t=e.options||(e.options={});t.plugins=it(t.plugins,{}),t.scales=qW(e,t)}function aD(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function GW(e){return e=e||{},e.data=aD(e.data),sD(e),e}const BE=new Map,lD=new Set;function vh(e,t){let n=BE.get(e);return n||(n=t(),BE.set(e,n),lD.add(n)),n}const iu=(e,t,n)=>{const r=Cs(t,n);r!==void 0&&e.add(r)};class YW{constructor(t){this._config=GW(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=aD(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),sD(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return vh(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return vh(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return vh(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return vh(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let o=r.get(t);return(!o||n)&&(o=new Map,r.set(t,o)),o}getOptionScopes(t,n,r){const{options:o,type:i}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(f=>iu(l,t,f))),u.forEach(f=>iu(l,o,f)),u.forEach(f=>iu(l,Aa[i]||{},f)),u.forEach(f=>iu(l,an,f)),u.forEach(f=>iu(l,L0,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),lD.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Aa[n]||{},an.datasets[n]||{},{type:n},an,L0]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:a}=VE(this._resolverCache,t,o);let l=s;if(XW(s,n)){i.$shared=!1,r=Es(r)?r():r;const c=this.createResolver(t,r,a);l=ac(s,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(t,n,r=[""],o){const{resolver:i}=VE(this._resolverCache,t,r);return _t(n)?ac(i,n,void 0,o):i}}function VE(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const o=n.join();let i=r.get(o);return i||(i={resolver:zx(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(o,i)),i}const KW=e=>_t(e)&&Object.getOwnPropertyNames(e).some(t=>Es(e[t]));function XW(e,t){const{isScriptable:n,isIndexable:r}=B2(e);for(const o of t){const i=n(o),s=r(o),a=(s||i)&&e[o];if(i&&(Es(a)||KW(a))||s&&Jt(a))return!0}return!1}var QW="4.4.1";const JW=["top","bottom","left","right","chartArea"];function HE(e,t){return e==="top"||e==="bottom"||JW.indexOf(e)===-1&&t==="x"}function WE(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function UE(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Ft(n&&n.onComplete,[e],t)}function ZW(e){const t=e.chart,n=t.options.animation;Ft(n&&n.onProgress,[e],t)}function cD(e){return Vx()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const sp={},qE=e=>{const t=cD(e);return Object.values(sp).filter(n=>n.canvas===t).pop()};function eU(e,t,n){const r=Object.keys(e);for(const o of r){const i=+o;if(i>=t){const s=e[o];delete e[o],(n>0||i>t)&&(e[i+n]=s)}}}function tU(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function bh(e,t,n){return e.options.clip?e[n]:t[n]}function nU(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:bh(n,t,"left"),right:bh(n,t,"right"),top:bh(r,t,"top"),bottom:bh(r,t,"bottom")}:t}class ao{static register(...t){Fo.add(...t),GE()}static unregister(...t){Fo.remove(...t),GE()}constructor(t,n){const r=this.config=new YW(n),o=cD(t),i=qE(o);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||yW(o)),this.platform.updateConfig(r);const a=this.platform.acquireContext(o,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=oV(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new LW,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=xV(f=>this.update(f),s.resizeDelay||0),this._dataChanges=[],sp[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}_i.listen(this,"complete",UE),_i.listen(this,"progress",ZW),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return yt(t)?n&&i?i:o?r/o:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Fo}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():pE(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return dE(this.canvas,this.ctx),this}stop(){return _i.stop(this),this}resize(t,n){_i.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,o=this.canvas,i=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(o,t,n,i),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,pE(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),Ft(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};At(n,(r,o)=>{r.id=o})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,o=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let i=[];n&&(i=i.concat(Object.keys(n).map(s=>{const a=n[s],l=B0(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),At(i,s=>{const a=s.options,l=a.id,c=B0(l,a),u=it(a.type,s.dtype);(a.position===void 0||HE(a.position,c)!==HE(s.dposition))&&(a.position=s.dposition),o[l]=!0;let f=null;if(l in r&&r[l].type===u)f=r[l];else{const g=Fo.getScale(u);f=new g({id:l,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),At(o,(s,a)=>{s||delete r[a]}),At(r,s=>{qn.configure(this,s,s.options),qn.addBox(this,s)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((o,i)=>o.index-i.index),r>n){for(let o=n;o<r;++o)this._destroyDatasetMeta(o);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(WE("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,o)=>{n.filter(i=>i===r._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,o;for(this._removeUnreferencedMetasets(),r=0,o=n.length;r<o;r++){const i=n[r];let s=this.getDatasetMeta(r);const a=i.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=i.indexAxis||j0(a,this.options),s.order=i.order||0,s.index=r,s.label=""+i.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=Fo.getController(a),{datasetElementType:c,dataElementType:u}=an.datasets[a];Object.assign(l,{dataElementType:Fo.getElement(u),datasetElementType:c&&Fo.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){At(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:f}=this.getDatasetMeta(c),g=!o&&i.indexOf(f)===-1;f.buildOrUpdateElements(g),s=Math.max(+f.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),o||At(i,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(WE("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){At(this.scales,t=>{qn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!nE(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:o,count:i}of n){const s=r==="_removeElements"?-i:i;eU(t,o,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=i=>new Set(t.filter(s=>s[0]===i).map((s,a)=>a+","+s.splice(1).join(","))),o=r(0);for(let i=1;i<n;i++)if(!nE(o,r(i)))return;return Array.from(o).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;qn.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],At(this.boxes,o=>{r&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,i)=>{o._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Es(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),o={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(r.controller._update(n),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(_i.has(this)?this.attached&&!_i.running(this)&&_i.start(this):(this.draw(),UE({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:o}=this._resizeBeforeDraw;this._resize(r,o),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let o,i;for(o=0,i=n.length;o<i;++o){const s=n[o];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r=t._clip,o=!r.disabled,i=nU(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(o&&Cg(n,{left:r.left===!1?0:i.left-r.left,right:r.right===!1?this.width:i.right+r.right,top:r.top===!1?0:i.top-r.top,bottom:r.bottom===!1?this.height:i.bottom+r.bottom}),t.controller.draw(),o&&Eg(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return $i(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=JH.modes[n];return typeof i=="function"?i(this,t,r,o):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let o=r.filter(i=>i&&i._dataset===n).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(o)),o}getContext(){return this.$context||(this.$context=ks(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const o=r?"show":"hide",i=this.getDatasetMeta(t),s=i.controller._resolveAnimations(void 0,o);Uu(n)?(i.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(i,{visible:r}),this.update(a=>a.datasetIndex===t?o:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),_i.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),dE(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete sp[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(i,s)=>{n.addEventListener(this,i,s),t[i]=s},o=(i,s,a)=>{i.offsetX=s,i.offsetY=a,this._eventHandler(i)};At(this.options.events,i=>r(i,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},o=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},i=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{o("attach",a),this.attached=!0,this.resize(),r("resize",i),r("detach",s)};s=()=>{this.attached=!1,o("resize",i),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){At(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},At(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const o=r?"set":"remove";let i,s,a,l;for(n==="dataset"&&(i=this.getDatasetMeta(t[0].datasetIndex),i.controller["_"+o+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){s=t[a];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[o+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:i,index:s})=>{const a=this.getDatasetMeta(i);if(!a)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:a.data[s],index:s}});!Rp(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const o=this.options.hover,i=(l,c)=>l.filter(u=>!c.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),s=i(n,t),a=r?t:i(t,n);s.length&&this.updateHoverStyle(s,o.mode,!1),a.length&&o.mode&&this.updateHoverStyle(a,o.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},o=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,o)===!1)return;const i=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,o),(i||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:o=[],options:i}=this,s=n,a=this._getActiveElements(t,o,r,s),l=uV(t),c=tU(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Ft(i.onHover,[t,a,this],this),l&&Ft(i.onClick,[t,a,this],this));const u=!Rp(a,o);return(u||n)&&(this._active=a,this._updateHoverStyles(a,o,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,o){if(t.type==="mouseout")return[];if(!r)return n;const i=this.options.hover;return this.getElementsAtEventForMode(t,i.mode,i,o)}}De(ao,"defaults",an),De(ao,"instances",sp),De(ao,"overrides",Aa),De(ao,"registry",Fo),De(ao,"version",QW),De(ao,"getChart",qE);function GE(){return At(ao.instances,e=>e._plugins.invalidate())}function rU(e,t,n){const{startAngle:r,pixelMargin:o,x:i,y:s,outerRadius:a,innerRadius:l}=t;let c=o/a;e.beginPath(),e.arc(i,s,a,r-c,n+c),l>o?(c=o/l,e.arc(i,s,l,n+c,r-c,!0)):e.arc(i,s,o,n+mn,r-mn),e.closePath(),e.clip()}function oU(e){return Fx(e,["outerStart","outerEnd","innerStart","innerEnd"])}function iU(e,t,n,r){const o=oU(e.options.borderRadius),i=(n-t)/2,s=Math.min(i,r*t/2),a=l=>{const c=(n-Math.min(i,l))*r/2;return $n(l,0,Math.min(i,c))};return{outerStart:a(o.outerStart),outerEnd:a(o.outerEnd),innerStart:$n(o.innerStart,0,s),innerEnd:$n(o.innerEnd,0,s)}}function bl(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function kp(e,t,n,r,o,i){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,f=Math.max(t.outerRadius+r+n-c,0),g=u>0?u+r+n+c:0;let p=0;const v=o-l;if(r){const j=u>0?u-r:0,ee=f>0?f-r:0,q=(j+ee)/2,X=q!==0?v*q/(q+r):v;p=(v-X)/2}const y=Math.max(.001,v*f-n/en)/f,x=(v-y)/2,w=l+x+p,_=o-x-p,{outerStart:S,outerEnd:R,innerStart:E,innerEnd:O}=iU(t,g,f,_-w),k=f-S,T=f-R,M=w+S/k,F=_-R/T,z=g+E,B=g+O,Y=w+E/z,G=_-O/B;if(e.beginPath(),i){const j=(M+F)/2;if(e.arc(s,a,f,M,j),e.arc(s,a,f,j,F),R>0){const re=bl(T,F,s,a);e.arc(re.x,re.y,R,F,_+mn)}const ee=bl(B,_,s,a);if(e.lineTo(ee.x,ee.y),O>0){const re=bl(B,G,s,a);e.arc(re.x,re.y,O,_+mn,G+Math.PI)}const q=(_-O/g+(w+E/g))/2;if(e.arc(s,a,g,_-O/g,q,!0),e.arc(s,a,g,q,w+E/g,!0),E>0){const re=bl(z,Y,s,a);e.arc(re.x,re.y,E,Y+Math.PI,w-mn)}const X=bl(k,w,s,a);if(e.lineTo(X.x,X.y),S>0){const re=bl(k,M,s,a);e.arc(re.x,re.y,S,w-mn,M)}}else{e.moveTo(s,a);const j=Math.cos(M)*f+s,ee=Math.sin(M)*f+a;e.lineTo(j,ee);const q=Math.cos(F)*f+s,X=Math.sin(F)*f+a;e.lineTo(q,X)}e.closePath()}function sU(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a}=t;let l=t.endAngle;if(i){kp(e,t,n,r,l,o);for(let c=0;c<i;++c)e.fill();isNaN(a)||(l=s+(a%Zt||Zt))}return kp(e,t,n,r,l,o),e.fill(),l}function aU(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:f,borderDashOffset:g}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(f||[]),e.lineDashOffset=g,p?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let v=t.endAngle;if(i){kp(e,t,n,r,v,o);for(let y=0;y<i;++y)e.stroke();isNaN(a)||(v=s+(a%Zt||Zt))}p&&rU(e,t,v),i||(kp(e,t,n,r,v,o),e.stroke())}class kl extends Fi{constructor(n){super();De(this,"circumference");De(this,"endAngle");De(this,"fullCircles");De(this,"innerRadius");De(this,"outerRadius");De(this,"pixelMargin");De(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,r,o){const i=this.getProps(["x","y"],o),{angle:s,distance:a}=T2(i,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:f,circumference:g}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),p=(this.options.spacing+this.options.borderWidth)/2,y=it(g,c-l)>=Zt||qu(s,l,c),x=Pi(a,u+p,f+p);return y&&x}getCenterPoint(n){const{x:r,y:o,startAngle:i,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,f=(i+s)/2,g=(a+l+u+c)/2;return{x:r+Math.cos(f)*g,y:o+Math.sin(f)*g}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:o}=this,i=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=o>Zt?Math.floor(o/Zt):0,o===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*i,Math.sin(l)*i);const c=1-Math.sin(Math.min(en,o||0)),u=i*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,sU(n,this,u,s,a),aU(n,this,u,s,a),n.restore()}}De(kl,"id","arc"),De(kl,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),De(kl,"defaultRoutes",{backgroundColor:"backgroundColor"}),De(kl,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function uD(e,t,n=t){e.lineCap=it(n.borderCapStyle,t.borderCapStyle),e.setLineDash(it(n.borderDash,t.borderDash)),e.lineDashOffset=it(n.borderDashOffset,t.borderDashOffset),e.lineJoin=it(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=it(n.borderWidth,t.borderWidth),e.strokeStyle=it(n.borderColor,t.borderColor)}function lU(e,t,n){e.lineTo(n.x,n.y)}function cU(e){return e.stepped?kV:e.tension||e.cubicInterpolationMode==="monotone"?MV:lU}function dD(e,t,n={}){const r=e.length,{start:o=0,end:i=r-1}=n,{start:s,end:a}=t,l=Math.max(o,s),c=Math.min(i,a),u=o<s&&i<s||o>a&&i>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function uU(e,t,n,r){const{points:o,options:i}=t,{count:s,start:a,loop:l,ilen:c}=dD(o,n,r),u=cU(i);let{move:f=!0,reverse:g}=r||{},p,v,y;for(p=0;p<=c;++p)v=o[(a+(g?c-p:p))%s],!v.skip&&(f?(e.moveTo(v.x,v.y),f=!1):u(e,y,v,g,i.stepped),y=v);return l&&(v=o[(a+(g?c:0))%s],u(e,y,v,g,i.stepped)),!!l}function dU(e,t,n,r){const o=t.points,{count:i,start:s,ilen:a}=dD(o,n,r),{move:l=!0,reverse:c}=r||{};let u=0,f=0,g,p,v,y,x,w;const _=R=>(s+(c?a-R:R))%i,S=()=>{y!==x&&(e.lineTo(u,x),e.lineTo(u,y),e.lineTo(u,w))};for(l&&(p=o[_(0)],e.moveTo(p.x,p.y)),g=0;g<=a;++g){if(p=o[_(g)],p.skip)continue;const R=p.x,E=p.y,O=R|0;O===v?(E<y?y=E:E>x&&(x=E),u=(f*u+R)/++f):(S(),e.lineTo(R,E),v=O,f=0,y=x=E),w=E}S()}function V0(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?dU:uU}function fU(e){return e.stepped?dH:e.tension||e.cubicInterpolationMode==="monotone"?fH:la}function hU(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),uD(e,t.options),e.stroke(o)}function pU(e,t,n,r){const{segments:o,options:i}=t,s=V0(t);for(const a of o)uD(e,i,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const gU=typeof Path2D=="function";function mU(e,t,n,r){gU&&!t.options.segment?hU(e,t,n,r):pU(e,t,n,r)}class vs extends Fi{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const o=r.spanGaps?this._loop:this._fullLoop;rH(this._points,r,t,o,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=bH(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,r=t.length;return r&&n[t[r-1].end]}interpolate(t,n){const r=this.options,o=t[n],i=this.points,s=Q2(this,{property:n,start:o,end:o});if(!s.length)return;const a=[],l=fU(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:f,end:g}=s[c],p=i[f],v=i[g];if(p===v){a.push(p);continue}const y=Math.abs((o-p[n])/(v[n]-p[n])),x=l(p,v,y,r.stepped);x[n]=t[n],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,n,r){return V0(this)(t,this,n,r)}path(t,n,r){const o=this.segments,i=V0(this);let s=this._loop;n=n||0,r=r||this.points.length-n;for(const a of o)s&=i(t,this,a,{start:n,end:n+r-1});return!!s}draw(t,n,r,o){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(t.save(),mU(t,this,r,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}De(vs,"id","line"),De(vs,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),De(vs,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),De(vs,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function YE(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class $u extends Fi{constructor(n){super();De(this,"parsed");De(this,"skip");De(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,r,o){const i=this.options,{x:s,y:a}=this.getProps(["x","y"],o);return Math.pow(n-s,2)+Math.pow(r-a,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(n,r){return YE(this,n,"x",r)}inYRange(n,r){return YE(this,n,"y",r)}getCenterPoint(n){const{x:r,y:o}=this.getProps(["x","y"],n);return{x:r,y:o}}size(n){n=n||this.options||{};let r=n.radius||0;r=Math.max(r,r&&n.hoverRadius||0);const o=r&&n.borderWidth||0;return(r+o)*2}draw(n,r){const o=this.options;this.skip||o.radius<.1||!$i(this,r,this.size(o)/2)||(n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.fillStyle=o.backgroundColor,F0(n,o,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}De($u,"id","point"),De($u,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),De($u,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function fD(e,t){const{x:n,y:r,base:o,width:i,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,f;return e.horizontal?(f=s/2,a=Math.min(n,o),l=Math.max(n,o),c=r-f,u=r+f):(f=i/2,a=n-f,l=n+f,c=Math.min(r,o),u=Math.max(r,o)),{left:a,top:c,right:l,bottom:u}}function bs(e,t,n,r){return e?0:$n(t,n,r)}function vU(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=j2(r);return{t:bs(o.top,i.top,0,n),r:bs(o.right,i.right,0,t),b:bs(o.bottom,i.bottom,0,n),l:bs(o.left,i.left,0,t)}}function bU(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=Ra(o),s=Math.min(t,n),a=e.borderSkipped,l=r||_t(o);return{topLeft:bs(!l||a.top||a.left,i.topLeft,0,s),topRight:bs(!l||a.top||a.right,i.topRight,0,s),bottomLeft:bs(!l||a.bottom||a.left,i.bottomLeft,0,s),bottomRight:bs(!l||a.bottom||a.right,i.bottomRight,0,s)}}function yU(e){const t=fD(e),n=t.right-t.left,r=t.bottom-t.top,o=vU(e,n/2,r/2),i=bU(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:i},inner:{x:t.left+o.l,y:t.top+o.t,w:n-o.l-o.r,h:r-o.t-o.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,i.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(o.b,o.r))}}}}function Jv(e,t,n,r){const o=t===null,i=n===null,a=e&&!(o&&i)&&fD(e,r);return a&&(o||Pi(t,a.left,a.right))&&(i||Pi(n,a.top,a.bottom))}function xU(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function wU(e,t){e.rect(t.x,t.y,t.w,t.h)}function Zv(e,t,n={}){const r=e.x!==n.x?-t:0,o=e.y!==n.y?-t:0,i=(e.x+e.w!==n.x+n.w?t:0)-r,s=(e.y+e.h!==n.y+n.h?t:0)-o;return{x:e.x+r,y:e.y+o,w:e.w+i,h:e.h+s,radius:e.radius}}class Du extends Fi{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:o}}=this,{inner:i,outer:s}=yU(this),a=xU(s.radius)?Gu:wU;t.save(),(s.w!==i.w||s.h!==i.h)&&(t.beginPath(),a(t,Zv(s,n,i)),t.clip(),a(t,Zv(i,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Zv(i,n)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,n,r){return Jv(this,t,n,r)}inXRange(t,n){return Jv(this,t,null,n)}inYRange(t,n){return Jv(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:o,horizontal:i}=this.getProps(["x","y","base","horizontal"],t);return{x:i?(n+o)/2:n,y:i?r:(r+o)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}De(Du,"id","bar"),De(Du,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),De(Du,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var _U=Object.freeze({__proto__:null,ArcElement:kl,BarElement:Du,LineElement:vs,PointElement:$u});const H0=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],KE=H0.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function hD(e){return H0[e%H0.length]}function pD(e){return KE[e%KE.length]}function SU(e,t){return e.borderColor=hD(t),e.backgroundColor=pD(t),++t}function CU(e,t){return e.backgroundColor=e.data.map(()=>hD(t++)),t}function EU(e,t){return e.backgroundColor=e.data.map(()=>pD(t++)),t}function RU(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof ga?t=CU(n,t):o instanceof Ou?t=EU(n,t):o&&(t=SU(n,t))}}function XE(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function PU(e){return e&&(e.borderColor||e.backgroundColor)}var OU={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:r},options:o}=e.config,{elements:i}=o;if(!n.forceOverride&&(XE(r)||PU(o)||i&&XE(i)))return;const s=RU(e);r.forEach(s)}};function $U(e,t,n,r,o){const i=o.samples||r;if(i>=n)return e.slice(t,t+n);const s=[],a=(n-2)/(i-2);let l=0;const c=t+n-1;let u=t,f,g,p,v,y;for(s[l++]=e[u],f=0;f<i-2;f++){let x=0,w=0,_;const S=Math.floor((f+1)*a)+1+t,R=Math.min(Math.floor((f+2)*a)+1,n)+t,E=R-S;for(_=S;_<R;_++)x+=e[_].x,w+=e[_].y;x/=E,w/=E;const O=Math.floor(f*a)+1+t,k=Math.min(Math.floor((f+1)*a)+1,n)+t,{x:T,y:M}=e[u];for(p=v=-1,_=O;_<k;_++)v=.5*Math.abs((T-x)*(e[_].y-M)-(T-e[_].x)*(w-M)),v>p&&(p=v,g=e[_],y=_);s[l++]=g,u=y}return s[l++]=e[c],s}function DU(e,t,n,r){let o=0,i=0,s,a,l,c,u,f,g,p,v,y;const x=[],w=t+n-1,_=e[t].x,R=e[w].x-_;for(s=t;s<t+n;++s){a=e[s],l=(a.x-_)/R*r,c=a.y;const E=l|0;if(E===u)c<v?(v=c,f=s):c>y&&(y=c,g=s),o=(i*o+a.x)/++i;else{const O=s-1;if(!yt(f)&&!yt(g)){const k=Math.min(f,g),T=Math.max(f,g);k!==p&&k!==O&&x.push({...e[k],x:o}),T!==p&&T!==O&&x.push({...e[T],x:o})}s>0&&O!==p&&x.push(e[O]),x.push(a),u=E,i=0,v=y=c,f=g=p=s}}return x}function gD(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function QE(e){e.data.datasets.forEach(t=>{gD(t)})}function TU(e,t){const n=t.length;let r=0,o;const{iScale:i}=e,{min:s,max:a,minDefined:l,maxDefined:c}=i.getUserBounds();return l&&(r=$n(Oi(t,i.axis,s).lo,0,n-1)),c?o=$n(Oi(t,i.axis,a).hi+1,r,n)-r:o=n-r,{start:r,count:o}}var kU={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){QE(e);return}const r=e.width;e.data.datasets.forEach((o,i)=>{const{_data:s,indexAxis:a}=o,l=e.getDatasetMeta(i),c=s||o.data;if(Qt([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:f,count:g}=TU(l,c);const p=n.threshold||4*r;if(g<=p){gD(o);return}yt(s)&&(o._data=c,delete o.data,Object.defineProperty(o,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let v;switch(n.algorithm){case"lttb":v=$U(c,f,g,r,n);break;case"min-max":v=DU(c,f,g,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=v})},destroy(e){QE(e)}};function MU(e,t,n){const r=e.segments,o=e.points,i=t.points,s=[];for(const a of r){let{start:l,end:c}=a;c=Ux(l,c,o);const u=W0(n,o[l],o[c],a.loop);if(!t.segments){s.push({source:a,target:u,start:o[l],end:o[c]});continue}const f=Q2(t,u);for(const g of f){const p=W0(n,i[g.start],i[g.end],g.loop),v=X2(a,o,p);for(const y of v)s.push({source:y,target:g,start:{[n]:JE(u,p,"start",Math.max)},end:{[n]:JE(u,p,"end",Math.min)}})}}return s}function W0(e,t,n,r){if(r)return;let o=t[e],i=n[e];return e==="angle"&&(o=Ir(o),i=Ir(i)),{property:e,start:o,end:i}}function AU(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:s,end:a})=>{a=Ux(s,a,o);const l=o[s],c=o[a];r!==null?(i.push({x:l.x,y:r}),i.push({x:c.x,y:r})):n!==null&&(i.push({x:n,y:l.y}),i.push({x:n,y:c.y}))}),i}function Ux(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function JE(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function mD(e,t){let n=[],r=!1;return Jt(e)?(r=!0,n=e):n=AU(e,t),n.length?new vs({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function ZE(e){return e&&e.fill!==!1}function IU(e,t,n){let o=e[t].fill;const i=[t];let s;if(!n)return o;for(;o!==!1&&i.indexOf(o)===-1;){if(!un(o))return o;if(s=e[o],!s)return!1;if(s.visible)return o;i.push(o),o=s.fill}return!1}function NU(e,t,n){const r=jU(e);if(_t(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return un(o)&&Math.floor(o)===o?LU(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function LU(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function FU(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:_t(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function zU(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:_t(e)?r=e.value:r=t.getBaseValue(),r}function jU(e){const t=e.options,n=t.fill;let r=it(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function BU(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,s=r.points,a=VU(t,n);a.push(mD({x:null,y:t.bottom},r));for(let l=0;l<i.length;l++){const c=i[l];for(let u=c.start;u<=c.end;u++)HU(o,s[u],a)}return new vs({points:o,options:{}})}function VU(e,t){const n=[],r=e.getMatchingVisibleMetas("line");for(let o=0;o<r.length;o++){const i=r[o];if(i.index===t)break;i.hidden||n.unshift(i.dataset)}return n}function HU(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:s,last:a,point:l}=WU(i,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function WU(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const o=r[n],i=e.segments,s=e.points;let a=!1,l=!1;for(let c=0;c<i.length;c++){const u=i[c],f=s[u.start][n],g=s[u.end][n];if(Pi(o,f,g)){a=o===f,l=o===g;break}}return{first:a,last:l,point:r}}class vD{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,r){const{x:o,y:i,radius:s}=this;return n=n||{start:0,end:Zt},t.arc(o,i,s,n.end,n.start,!0),!r.bounds}interpolate(t){const{x:n,y:r,radius:o}=this,i=t.angle;return{x:n+Math.cos(i)*o,y:r+Math.sin(i)*o,angle:i}}}function UU(e){const{chart:t,fill:n,line:r}=e;if(un(n))return qU(t,n);if(n==="stack")return BU(e);if(n==="shape")return!0;const o=GU(e);return o instanceof vD?o:mD(o,r)}function qU(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function GU(e){return(e.scale||{}).getPointPositionForValue?KU(e):YU(e)}function YU(e){const{scale:t={},fill:n}=e,r=FU(n,t);if(un(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function KU(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,s=zU(n,t,i),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new vD({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<o;++l)a.push(t.getPointPositionForValue(l,s));return a}function eb(e,t,n){const r=UU(t),{line:o,scale:i,axis:s}=t,a=o.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:f=c}=l||{};r&&o.points.length&&(Cg(e,n),XU(e,{line:o,target:r,above:u,below:f,area:n,scale:i,axis:s}),Eg(e))}function XU(e,t){const{line:n,target:r,above:o,below:i,area:s,scale:a}=t,l=n._loop?"angle":t.axis;e.save(),l==="x"&&i!==o&&(eR(e,r,s.top),tR(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore(),e.save(),eR(e,r,s.bottom)),tR(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore()}function eR(e,t,n){const{segments:r,points:o}=t;let i=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=o[l],f=o[Ux(l,c,o)];i?(e.moveTo(u.x,u.y),i=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),s=!!t.pathSegment(e,a,{move:s}),s?e.closePath():e.lineTo(f.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function tR(e,t){const{line:n,target:r,property:o,color:i,scale:s}=t,a=MU(n,r,o);for(const{source:l,target:c,start:u,end:f}of a){const{style:{backgroundColor:g=i}={}}=l,p=r!==!0;e.save(),e.fillStyle=g,QU(e,s,p&&W0(o,u,f)),e.beginPath();const v=!!n.pathSegment(e,l);let y;if(p){v?e.closePath():nR(e,r,f,o);const x=!!r.pathSegment(e,c,{move:v,reverse:!0});y=v&&x,y||nR(e,r,u,o)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function QU(e,t,n){const{top:r,bottom:o}=t.chart.chartArea,{property:i,start:s,end:a}=n||{};i==="x"&&(e.beginPath(),e.rect(s,r,a-s,o-r),e.clip())}function nR(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var JU={id:"filler",afterDatasetsUpdate(e,t,n){const r=(e.data.datasets||[]).length,o=[];let i,s,a,l;for(s=0;s<r;++s)i=e.getDatasetMeta(s),a=i.dataset,l=null,a&&a.options&&a instanceof vs&&(l={visible:e.isDatasetVisible(s),index:s,fill:NU(a,s,r),chart:e,axis:i.controller.options.indexAxis,scale:i.vScale,line:a}),i.$filler=l,o.push(l);for(s=0;s<r;++s)l=o[s],!(!l||l.fill===!1)&&(l.fill=IU(o,s,n.propagate))},beforeDraw(e,t,n){const r=n.drawTime==="beforeDraw",o=e.getSortedVisibleDatasetMetas(),i=e.chartArea;for(let s=o.length-1;s>=0;--s){const a=o[s].$filler;a&&(a.line.updateControlPoints(i,a.axis),r&&a.fill&&eb(e.ctx,a,i))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let o=r.length-1;o>=0;--o){const i=r[o].$filler;ZE(i)&&eb(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!ZE(r)||n.drawTime!=="beforeDatasetDraw"||eb(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const rR=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},ZU=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class oR extends Fi{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=Ft(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,o)=>t.sort(r,o,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,o=bn(r.font),i=o.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=rR(r,i);let c,u;n.font=o.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,i,a,l)+10):(u=this.maxHeight,c=this._fitCols(s,o,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,o){const{ctx:i,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=o+a;let f=t;i.textAlign="left",i.textBaseline="middle";let g=-1,p=-u;return this.legendItems.forEach((v,y)=>{const x=r+n/2+i.measureText(v.text).width;(y===0||c[c.length-1]+x+2*a>s)&&(f+=u,c[c.length-(y>0?0:1)]=0,p+=u,g++),l[y]={left:0,top:p,row:g,width:x,height:o},c[c.length-1]+=x+a}),f}_fitCols(t,n,r,o){const{ctx:i,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let f=a,g=0,p=0,v=0,y=0;return this.legendItems.forEach((x,w)=>{const{itemWidth:_,itemHeight:S}=eq(r,n,i,x,o);w>0&&p+S+2*a>u&&(f+=g+a,c.push({width:g,height:p}),v+=g+a,y++,g=p=0),l[w]={left:v,top:p,col:y,width:_,height:S},g=Math.max(g,_),p+=S+a}),f+=g,c.push({width:g,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,s=Nl(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=Un(r,this.left+o,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Un(r,this.left+o,this.right-this.lineWidths[a])),c.top+=this.top+t+o,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+o}else{let a=0,l=Un(r,this.top+t+o,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Un(r,this.top+t+o,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+o,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+o}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Cg(t,this),this._draw(),Eg(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=t,a=an.color,l=Nl(t.rtl,this.left,this.width),c=bn(s.font),{padding:u}=s,f=c.size,g=f/2;let p;this.drawTitle(),o.textAlign=l.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=c.string;const{boxWidth:v,boxHeight:y,itemHeight:x}=rR(s,f),w=function(O,k,T){if(isNaN(v)||v<=0||isNaN(y)||y<0)return;o.save();const M=it(T.lineWidth,1);if(o.fillStyle=it(T.fillStyle,a),o.lineCap=it(T.lineCap,"butt"),o.lineDashOffset=it(T.lineDashOffset,0),o.lineJoin=it(T.lineJoin,"miter"),o.lineWidth=M,o.strokeStyle=it(T.strokeStyle,a),o.setLineDash(it(T.lineDash,[])),s.usePointStyle){const F={radius:y*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:M},z=l.xPlus(O,v/2),B=k+g;z2(o,F,z,B,s.pointStyleWidth&&v)}else{const F=k+Math.max((f-y)/2,0),z=l.leftForLtr(O,v),B=Ra(T.borderRadius);o.beginPath(),Object.values(B).some(Y=>Y!==0)?Gu(o,{x:z,y:F,w:v,h:y,radius:B}):o.rect(z,F,v,y),o.fill(),M!==0&&o.stroke()}o.restore()},_=function(O,k,T){Ia(o,T.text,O,k+x/2,c,{strikethrough:T.hidden,textAlign:l.textAlign(T.textAlign)})},S=this.isHorizontal(),R=this._computeTitleHeight();S?p={x:Un(i,this.left+u,this.right-r[0]),y:this.top+u+R,line:0}:p={x:this.left+u,y:Un(i,this.top+R+u,this.bottom-n[0].height),line:0},G2(this.ctx,t.textDirection);const E=x+u;this.legendItems.forEach((O,k)=>{o.strokeStyle=O.fontColor,o.fillStyle=O.fontColor;const T=o.measureText(O.text).width,M=l.textAlign(O.textAlign||(O.textAlign=s.textAlign)),F=v+g+T;let z=p.x,B=p.y;l.setWidth(this.width),S?k>0&&z+F+u>this.right&&(B=p.y+=E,p.line++,z=p.x=Un(i,this.left+u,this.right-r[p.line])):k>0&&B+E>this.bottom&&(z=p.x=z+n[p.line].width+u,p.line++,B=p.y=Un(i,this.top+R+u,this.bottom-n[p.line].height));const Y=l.x(z);if(w(Y,B,O),z=wV(M,z+v+g,S?z+F:this.right,t.rtl),_(l.x(z),B,O),S)p.x+=F+u;else if(typeof O.text!="string"){const G=c.lineHeight;p.y+=bD(O,G)+u}else p.y+=E}),Y2(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=bn(n.font),o=Fn(n.padding);if(!n.display)return;const i=Nl(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=o.top+l;let u,f=this.left,g=this.width;if(this.isHorizontal())g=Math.max(...this.lineWidths),u=this.top+c,f=Un(t.align,f,this.right-g);else{const v=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);u=c+Un(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const p=Un(a,f,f+g);s.textAlign=i.textAlign(Nx(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Ia(s,n.text,p,u,r)}_computeTitleHeight(){const t=this.options.title,n=bn(t.font),r=Fn(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,o,i;if(Pi(t,this.left,this.right)&&Pi(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],Pi(t,o.left,o.left+o.width)&&Pi(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!rq(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=ZU(o,r);o&&!i&&Ft(n.onLeave,[t,o,this],this),this._hoveredItem=r,r&&!i&&Ft(n.onHover,[t,r,this],this)}else r&&Ft(n.onClick,[t,r,this],this)}}function eq(e,t,n,r,o){const i=tq(r,e,t,n),s=nq(o,r,t.lineHeight);return{itemWidth:i,itemHeight:s}}function tq(e,t,n,r){let o=e.text;return o&&typeof o!="string"&&(o=o.reduce((i,s)=>i.length>s.length?i:s)),t+n.size/2+r.measureText(o).width}function nq(e,t,n){let r=e;return typeof t.text!="string"&&(r=bD(t,n)),r}function bD(e,t){const n=e.text?e.text.length:0;return t*n}function rq(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var oq={id:"legend",_element:oR,start(e,t,n){const r=e.legend=new oR({ctx:e.ctx,options:n,chart:e});qn.configure(e,r,n),qn.addBox(e,r)},stop(e){qn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;qn.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,o=n.chart;o.isDatasetVisible(r)?(o.hide(r),t.hidden=!0):(o.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:o,color:i,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Fn(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:o||c.textAlign,borderRadius:s&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class qx extends Fi{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const o=Jt(r.text)?r.text.length:1;this._padding=Fn(r.padding);const i=o*bn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:o,right:i,options:s}=this,a=s.align;let l=0,c,u,f;return this.isHorizontal()?(u=Un(a,r,i),f=n+t,c=i-r):(s.position==="left"?(u=r+t,f=Un(a,o,n),l=en*-.5):(u=i-t,f=Un(a,n,o),l=en*.5),c=o-n),{titleX:u,titleY:f,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=bn(n.font),i=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(i);Ia(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:Nx(n.align),textBaseline:"middle",translation:[s,a]})}}function iq(e,t){const n=new qx({ctx:e.ctx,options:t,chart:e});qn.configure(e,n,t),qn.addBox(e,n),e.titleBlock=n}var sq={id:"title",_element:qx,start(e,t,n){iq(e,n)},stop(e){const t=e.titleBlock;qn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;qn.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const yh=new WeakMap;var aq={id:"subtitle",start(e,t,n){const r=new qx({ctx:e.ctx,options:n,chart:e});qn.configure(e,r,n),qn.addBox(e,r),yh.set(e,r)},stop(e){qn.removeBox(e,yh.get(e)),yh.delete(e)},beforeUpdate(e,t,n){const r=yh.get(e);qn.configure(e,r,n),r.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const yu={average(e){if(!e.length)return!1;let t,n,r=0,o=0,i=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const a=s.tooltipPosition();r+=a.x,o+=a.y,++i}}return{x:r/i,y:o/i}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,o=Number.POSITIVE_INFINITY,i,s,a;for(i=0,s=e.length;i<s;++i){const l=e[i].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=N0(t,c);u<o&&(o=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function No(e,t){return t&&(Jt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Si(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
125
+ `)>-1?e.split(`
126
+ `):e}function lq(e,t){const{element:n,datasetIndex:r,index:o}=t,i=e.getDatasetMeta(r).controller,{label:s,value:a}=i.getLabelAndValue(o);return{chart:e,label:s,parsed:i.getParsed(o),raw:e.data.datasets[r].data[o],formattedValue:a,dataset:i.getDataset(),dataIndex:o,datasetIndex:r,element:n}}function iR(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:s,boxHeight:a}=t,l=bn(t.bodyFont),c=bn(t.titleFont),u=bn(t.footerFont),f=i.length,g=o.length,p=r.length,v=Fn(t.padding);let y=v.height,x=0,w=r.reduce((R,E)=>R+E.before.length+E.lines.length+E.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,f&&(y+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),w){const R=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=p*R+(w-p)*l.lineHeight+(w-1)*t.bodySpacing}g&&(y+=t.footerMarginTop+g*u.lineHeight+(g-1)*t.footerSpacing);let _=0;const S=function(R){x=Math.max(x,n.measureText(R).width+_)};return n.save(),n.font=c.string,At(e.title,S),n.font=l.string,At(e.beforeBody.concat(e.afterBody),S),_=t.displayColors?s+2+t.boxPadding:0,At(r,R=>{At(R.before,S),At(R.lines,S),At(R.after,S)}),_=0,n.font=u.string,At(e.footer,S),n.restore(),x+=v.width,{width:x,height:y}}function cq(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function uq(e,t,n,r){const{x:o,width:i}=r,s=n.caretSize+n.caretPadding;if(e==="left"&&o+i+s>t.width||e==="right"&&o-i-s<0)return!0}function dq(e,t,n,r){const{x:o,width:i}=n,{width:s,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=o<=(a+l)/2?"left":"right":o<=i/2?c="left":o>=s-i/2&&(c="right"),uq(c,e,t,n)&&(c="center"),c}function sR(e,t,n){const r=n.yAlign||t.yAlign||cq(e,n);return{xAlign:n.xAlign||t.xAlign||dq(e,t,n,r),yAlign:r}}function fq(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function hq(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function aR(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=o+i,{topLeft:u,topRight:f,bottomLeft:g,bottomRight:p}=Ra(s);let v=fq(t,a);const y=hq(t,l,c);return l==="center"?a==="left"?v+=c:a==="right"&&(v-=c):a==="left"?v-=Math.max(u,g)+o:a==="right"&&(v+=Math.max(f,p)+o),{x:$n(v,0,r.width-t.width),y:$n(y,0,r.height-t.height)}}function xh(e,t,n){const r=Fn(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function lR(e){return No([],Si(e))}function pq(e,t,n){return ks(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function cR(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const yD={beforeTitle:bi,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:bi,beforeBody:bi,beforeLabel:bi,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return yt(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:bi,afterBody:bi,beforeFooter:bi,footer:bi,afterFooter:bi};function cr(e,t,n,r){const o=e[t].call(n,r);return typeof o>"u"?yD[t].call(n,r):o}var Qb;let uR=(Qb=class extends Fi{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),o=r.enabled&&n.options.animation&&r.animations,i=new J2(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=pq(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=cr(r,"beforeTitle",this,t),i=cr(r,"title",this,t),s=cr(r,"afterTitle",this,t);let a=[];return a=No(a,Si(o)),a=No(a,Si(i)),a=No(a,Si(s)),a}getBeforeBody(t,n){return lR(cr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return At(t,i=>{const s={before:[],lines:[],after:[]},a=cR(r,i);No(s.before,Si(cr(a,"beforeLabel",this,i))),No(s.lines,cr(a,"label",this,i)),No(s.after,Si(cr(a,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(t,n){return lR(cr(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=cr(r,"beforeFooter",this,t),i=cr(r,"footer",this,t),s=cr(r,"afterFooter",this,t);let a=[];return a=No(a,Si(o)),a=No(a,Si(i)),a=No(a,Si(s)),a}_createItems(t){const n=this._active,r=this.chart.data,o=[],i=[],s=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(lq(this.chart,n[l]));return t.filter&&(a=a.filter((u,f,g)=>t.filter(u,f,g,r))),t.itemSort&&(a=a.sort((u,f)=>t.itemSort(u,f,r))),At(a,u=>{const f=cR(t.callbacks,u);o.push(cr(f,"labelColor",this,u)),i.push(cr(f,"labelPointStyle",this,u)),s.push(cr(f,"labelTextColor",this,u))}),this.labelColors=o,this.labelPointStyles=i,this.labelTextColors=s,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),o=this._active;let i,s=[];if(!o.length)this.opacity!==0&&(i={opacity:0});else{const a=yu[r.position].call(this,o,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=iR(this,r),c=Object.assign({},a,l),u=sR(this.chart,r,c),f=aR(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,o){const i=this.getCaretPosition(t,r,o);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(t,n,r){const{xAlign:o,yAlign:i}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:f}=Ra(a),{x:g,y:p}=t,{width:v,height:y}=n;let x,w,_,S,R,E;return i==="center"?(R=p+y/2,o==="left"?(x=g,w=x-s,S=R+s,E=R-s):(x=g+v,w=x+s,S=R-s,E=R+s),_=x):(o==="left"?w=g+Math.max(l,u)+s:o==="right"?w=g+v-Math.max(c,f)-s:w=this.caretX,i==="top"?(S=p,R=S-s,x=w-s,_=w+s):(S=p+y,R=S+s,x=w+s,_=w-s),E=S),{x1:x,x2:w,x3:_,y1:S,y2:R,y3:E}}drawTitle(t,n,r){const o=this.title,i=o.length;let s,a,l;if(i){const c=Nl(r.rtl,this.x,this.width);for(t.x=xh(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=bn(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<i;++l)n.fillText(o[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+a,l+1===i&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,o,i){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=i,u=bn(i.bodyFont),f=xh(this,"left",i),g=o.x(f),p=l<u.lineHeight?(u.lineHeight-l)/2:0,v=n.y+p;if(i.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=o.leftForLtr(g,c)+c/2,w=v+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,F0(t,y,x,w),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,F0(t,y,x,w)}else{t.lineWidth=_t(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const y=o.leftForLtr(g,c),x=o.leftForLtr(o.xPlus(g,1),c-2),w=Ra(s.borderRadius);Object.values(w).some(_=>_!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,Gu(t,{x:y,y:v,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Gu(t,{x,y:v+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(y,v,c,l),t.strokeRect(y,v,c,l),t.fillStyle=s.backgroundColor,t.fillRect(x,v+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:o}=this,{bodySpacing:i,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,f=bn(r.bodyFont);let g=f.lineHeight,p=0;const v=Nl(r.rtl,this.x,this.width),y=function(T){n.fillText(T,v.x(t.x+p),t.y+g/2),t.y+=g+i},x=v.textAlign(s);let w,_,S,R,E,O,k;for(n.textAlign=s,n.textBaseline="middle",n.font=f.string,t.x=xh(this,x,r),n.fillStyle=r.bodyColor,At(this.beforeBody,y),p=a&&x!=="right"?s==="center"?c/2+u:c+2+u:0,R=0,O=o.length;R<O;++R){for(w=o[R],_=this.labelTextColors[R],n.fillStyle=_,At(w.before,y),S=w.lines,a&&S.length&&(this._drawColorBox(n,t,R,v,r),g=Math.max(f.lineHeight,l)),E=0,k=S.length;E<k;++E)y(S[E]),g=f.lineHeight;At(w.after,y)}p=0,g=f.lineHeight,At(this.afterBody,y),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let s,a;if(i){const l=Nl(r.rtl,this.x,this.width);for(t.x=xh(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=bn(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,a=0;a<i;++a)n.fillText(o[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,o){const{xAlign:i,yAlign:s}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:f,topRight:g,bottomLeft:p,bottomRight:v}=Ra(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(a+f,l),s==="top"&&this.drawCaret(t,n,r,o),n.lineTo(a+c-g,l),n.quadraticCurveTo(a+c,l,a+c,l+g),s==="center"&&i==="right"&&this.drawCaret(t,n,r,o),n.lineTo(a+c,l+u-v),n.quadraticCurveTo(a+c,l+u,a+c-v,l+u),s==="bottom"&&this.drawCaret(t,n,r,o),n.lineTo(a+p,l+u),n.quadraticCurveTo(a,l+u,a,l+u-p),s==="center"&&i==="left"&&this.drawCaret(t,n,r,o),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),o.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,o=r&&r.x,i=r&&r.y;if(o||i){const s=yu[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=iR(this,t),l=Object.assign({},s,this._size),c=sR(n,t,l),u=aR(t,l,c,n);(o._to!==u.x||i._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const o={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=Fn(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(i,t,o,n),G2(t,n.textDirection),i.y+=s.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),Y2(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,o=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),i=!Rp(r,o),s=this._positionChanged(o,n);(i||s)&&(this._active=o,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,i=this._active||[],s=this._getActiveElements(t,i,n,r),a=this._positionChanged(s,t),l=n||!Rp(s,i)||a;return l&&(this._active=s,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,o){const i=this.options;if(t.type==="mouseout")return[];if(!o)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,i.mode,i,r);return i.reverse&&s.reverse(),s}_positionChanged(t,n){const{caretX:r,caretY:o,options:i}=this,s=yu[i.position].call(this,t,n);return s!==!1&&(r!==s.x||o!==s.y)}},De(Qb,"positioners",yu),Qb);var gq={id:"tooltip",_element:uR,positioners:yu,afterInit(e,t,n){n&&(e.tooltip=new uR({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:yD},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},mq=Object.freeze({__proto__:null,Colors:OU,Decimation:kU,Filler:JU,Legend:oq,SubTitle:aq,Title:sq,Tooltip:gq});const vq=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function bq(e,t,n,r){const o=e.indexOf(t);if(o===-1)return vq(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const yq=(e,t)=>e===null?null:$n(Math.round(e),0,t);function dR(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class U0 extends Wa{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:o,label:i}of n)r[o]===i&&r.splice(o,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(yt(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:bq(r,t,it(n,t),this._addedLabels),yq(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(o=this.getLabels().length-1)),this.min=r,this.max=o}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,o=[];let i=this.getLabels();i=t===0&&n===i.length-1?i:i.slice(t,n+1),this._valueRange=Math.max(i.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=n;s++)o.push({value:s});return o}getLabelForValue(t){return dR.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}De(U0,"id","category"),De(U0,"defaults",{ticks:{callback:dR}});function xq(e,t){const n=[],{bounds:o,step:i,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:f,includeBounds:g}=e,p=i||1,v=u-1,{min:y,max:x}=t,w=!yt(s),_=!yt(a),S=!yt(c),R=(x-y)/(f+1);let E=oE((x-y)/v/p)*p,O,k,T,M;if(E<1e-14&&!w&&!_)return[{value:y},{value:x}];M=Math.ceil(x/E)-Math.floor(y/E),M>v&&(E=oE(M*E/v/p)*p),yt(l)||(O=Math.pow(10,l),E=Math.ceil(E*O)/O),o==="ticks"?(k=Math.floor(y/E)*E,T=Math.ceil(x/E)*E):(k=y,T=x),w&&_&&i&&pV((a-s)/i,E/1e3)?(M=Math.round(Math.min((a-s)/E,u)),E=(a-s)/M,k=s,T=a):S?(k=w?s:k,T=_?a:T,M=c-1,E=(T-k)/M):(M=(T-k)/E,Eu(M,Math.round(M),E/1e3)?M=Math.round(M):M=Math.ceil(M));const F=Math.max(iE(E),iE(k));O=Math.pow(10,yt(l)?F:l),k=Math.round(k*O)/O,T=Math.round(T*O)/O;let z=0;for(w&&(g&&k!==s?(n.push({value:s}),k<s&&z++,Eu(Math.round((k+z*E)*O)/O,s,fR(s,R,e))&&z++):k<s&&z++);z<M;++z){const B=Math.round((k+z*E)*O)/O;if(_&&B>a)break;n.push({value:B})}return _&&g&&T!==a?n.length&&Eu(n[n.length-1].value,a,fR(a,R,e))?n[n.length-1].value=a:n.push({value:a}):(!_||T===a)&&n.push({value:T}),n}function fR(e,t,{horizontal:n,minRotation:r}){const o=Co(r),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*t*(""+e).length;return Math.min(t/i,s)}class Mp extends Wa{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return yt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:o,max:i}=this;const s=l=>o=n?o:l,a=l=>i=r?i:l;if(t){const l=Yo(o),c=Yo(i);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(o===i){let l=i===0?1:Math.abs(i*.05);a(i+l),t||s(o-l)}this.min=o,this.max=i}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,o;return r?(o=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),n=n||11),n&&(o=Math.min(n,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const o={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,s=xq(o,i);return t.bounds==="ticks"&&D2(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const o=(r-n)/Math.max(t.length-1,1)/2;n-=o,r+=o}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return Gd(t,this.chart.options.locale,this.options.ticks.format)}}class q0 extends Mp{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=un(t)?t:0,this.max=un(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Co(this.options.ticks.minRotation),o=(t?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/o))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}De(q0,"id","linear"),De(q0,"defaults",{ticks:{callback:Sg.formatters.numeric}});const Ku=e=>Math.floor(ms(e)),oa=(e,t)=>Math.pow(10,Ku(e)+t);function hR(e){return e/Math.pow(10,Ku(e))===1}function pR(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function wq(e,t){const n=t-e;let r=Ku(n);for(;pR(e,t,r)>10;)r++;for(;pR(e,t,r)<10;)r--;return Math.min(r,Ku(e))}function _q(e,{min:t,max:n}){t=Tr(e.min,t);const r=[],o=Ku(t);let i=wq(t,n),s=i<0?Math.pow(10,Math.abs(i)):1;const a=Math.pow(10,i),l=o>i?Math.pow(10,o):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((c-u)/Math.pow(10,i)),g=Tr(e.min,Math.round((l+u+f*Math.pow(10,i))*s)/s);for(;g<n;)r.push({value:g,major:hR(g),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(i++,f=2,s=i>=0?1:s),g=Math.round((l+u+f*Math.pow(10,i))*s)/s;const p=Tr(e.max,g);return r.push({value:p,major:hR(p),significand:f}),r}class G0 extends Wa{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Mp.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return un(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=un(t)?Math.max(0,t):null,this.max=un(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!un(this._userMin)&&(this.min=t===oa(this.min,0)?oa(this.min,-1):oa(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let r=this.min,o=this.max;const i=a=>r=t?r:a,s=a=>o=n?o:a;r===o&&(r<=0?(i(1),s(10)):(i(oa(r,-1)),s(oa(o,1)))),r<=0&&i(oa(o,-1)),o<=0&&s(oa(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=_q(n,this);return t.bounds==="ticks"&&D2(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":Gd(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ms(t),this._valueRange=ms(this.max)-ms(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ms(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}De(G0,"id","logarithmic"),De(G0,"defaults",{ticks:{callback:Sg.formatters.logarithmic,major:{enabled:!0}}});function Y0(e){const t=e.ticks;if(t.display&&e.display){const n=Fn(t.backdropPadding);return it(t.font&&t.font.size,an.font.size)+n.height}return 0}function Sq(e,t,n){return n=Jt(n)?n:[n],{w:TV(e,t.string,n),h:n.length*t.lineHeight}}function gR(e,t,n,r,o){return e===r||e===o?{start:t-n/2,end:t+n/2}:e<r||e>o?{start:t-n,end:t}:{start:t,end:t+n}}function Cq(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],o=[],i=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?en/i:0;for(let l=0;l<i;l++){const c=s.setContext(e.getPointLabelContext(l));o[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+o[l],a),f=bn(c.font),g=Sq(e.ctx,f,e._pointLabels[l]);r[l]=g;const p=Ir(e.getIndexAngle(l)+a),v=Math.round(Ax(p)),y=gR(v,u.x,g.w,0,180),x=gR(v,u.y,g.h,90,270);Eq(n,t,p,y,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=Oq(e,r,o)}function Eq(e,t,n,r,o){const i=Math.abs(Math.sin(n)),s=Math.abs(Math.cos(n));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/i,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/i,e.r=Math.max(e.r,t.r+a)),o.start<t.t?(l=(t.t-o.start)/s,e.t=Math.min(e.t,t.t-l)):o.end>t.b&&(l=(o.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function Rq(e,t,n){const r=e.drawingArea,{extra:o,additionalAngle:i,padding:s,size:a}=n,l=e.getPointPosition(t,r+o+s,i),c=Math.round(Ax(Ir(l.angle+mn))),u=Tq(l.y,a.h,c),f=$q(c),g=Dq(l.x,a.w,f);return{visible:!0,x:l.x,y:u,textAlign:f,left:g,top:u,right:g+a.w,bottom:u+a.h}}function Pq(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!($i({x:n,y:r},t)||$i({x:n,y:i},t)||$i({x:o,y:r},t)||$i({x:o,y:i},t))}function Oq(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:s,display:a}=i.pointLabels,l={extra:Y0(i)/2,additionalAngle:s?en/o:0};let c;for(let u=0;u<o;u++){l.padding=n[u],l.size=t[u];const f=Rq(e,u,l);r.push(f),a==="auto"&&(f.visible=Pq(f,c),f.visible&&(c=f))}return r}function $q(e){return e===0||e===180?"center":e<180?"left":"right"}function Dq(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function Tq(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function kq(e,t,n){const{left:r,top:o,right:i,bottom:s}=n,{backdropColor:a}=t;if(!yt(a)){const l=Ra(t.borderRadius),c=Fn(t.backdropPadding);e.fillStyle=a;const u=r-c.left,f=o-c.top,g=i-r+c.width,p=s-o+c.height;Object.values(l).some(v=>v!==0)?(e.beginPath(),Gu(e,{x:u,y:f,w:g,h:p,radius:l}),e.fill()):e.fillRect(u,f,g,p)}}function Mq(e,t){const{ctx:n,options:{pointLabels:r}}=e;for(let o=t-1;o>=0;o--){const i=e._pointLabelItems[o];if(!i.visible)continue;const s=r.setContext(e.getPointLabelContext(o));kq(n,s,i);const a=bn(s.font),{x:l,y:c,textAlign:u}=i;Ia(n,e._pointLabels[o],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function xD(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,Zt);else{let i=e.getPointPosition(0,t);o.moveTo(i.x,i.y);for(let s=1;s<r;s++)i=e.getPointPosition(s,t),o.lineTo(i.x,i.y)}}function Aq(e,t,n,r,o){const i=e.ctx,s=t.circular,{color:a,lineWidth:l}=t;!s&&!r||!a||!l||n<0||(i.save(),i.strokeStyle=a,i.lineWidth=l,i.setLineDash(o.dash),i.lineDashOffset=o.dashOffset,i.beginPath(),xD(e,n,s,r),i.closePath(),i.stroke(),i.restore())}function Iq(e,t,n){return ks(e,{label:n,index:t,type:"pointLabel"})}class xu extends Mp{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Fn(Y0(this.options)/2),n=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(n,r)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=un(t)&&!isNaN(t)?t:0,this.max=un(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Y0(this.options))}generateTickLabels(t){Mp.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const o=Ft(this.options.pointLabels.callback,[n,r],this);return o||o===0?o:""}).filter((n,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?Cq(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,r,o){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((r-o)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,r,o))}getIndexAngle(t){const n=Zt/(this._pointLabels.length||1),r=this.options.startAngle||0;return Ir(t*n+Co(r))}getDistanceFromCenterForValue(t){if(yt(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(yt(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const r=n[t];return Iq(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const o=this.getIndexAngle(t)-mn+r;return{x:Math.cos(o)*n+this.xCenter,y:Math.sin(o)*n+this.yCenter,angle:o}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:r,right:o,bottom:i}=this._pointLabelItems[t];return{left:n,top:r,right:o,bottom:i}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),xD(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:o,border:i}=n,s=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&Mq(this,s),o.display&&this.ticks.forEach((u,f)=>{if(f!==0){l=this.getDistanceFromCenterForValue(u.value);const g=this.getContext(f),p=o.setContext(g),v=i.setContext(g);Aq(this,p,l,s,v)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:g}=u;!g||!f||(t.lineWidth=g,t.strokeStyle=f,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const o=this.getIndexAngle(0);let i,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=bn(c.font);if(i=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const f=Fn(c.backdropPadding);t.fillRect(-s/2-f.left,-i-u.size/2-f.top,s+f.width,u.size+f.height)}Ia(t,a.label,0,-i,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}De(xu,"id","radialLinear"),De(xu,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Sg.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),De(xu,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),De(xu,"descriptors",{angleLines:{_fallback:"grid"}});const Pg={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},gr=Object.keys(Pg);function mR(e,t){return e-t}function vR(e,t){if(yt(t))return null;const n=e._adapter,{parser:r,round:o,isoWeekday:i}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),un(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(o&&(s=o==="week"&&(sc(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function bR(e,t,n,r){const o=gr.length;for(let i=gr.indexOf(e);i<o-1;++i){const s=Pg[gr[i]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return gr[i]}return gr[o-1]}function Nq(e,t,n,r,o){for(let i=gr.length-1;i>=gr.indexOf(n);i--){const s=gr[i];if(Pg[s].common&&e._adapter.diff(o,r,s)>=t-1)return s}return gr[n?gr.indexOf(n):0]}function Lq(e){for(let t=gr.indexOf(e)+1,n=gr.length;t<n;++t)if(Pg[gr[t]].common)return gr[t]}function yR(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=Ix(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function Fq(e,t,n,r){const o=e._adapter,i=+o.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=i;a<=s;a=+o.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function xR(e,t,n){const r=[],o={},i=t.length;let s,a;for(s=0;s<i;++s)a=t[s],o[a]=s,r.push({value:a,major:!1});return i===0||!n?r:Fq(e,r,o,n)}class Xu extends Wa{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),o=this._adapter=new GH._date(t.adapters.date);o.init(n),Cu(r.displayFormats,o.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:vR(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:o,max:i,minDefined:s,maxDefined:a}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(o=Math.min(o,c.min)),!a&&!isNaN(c.max)&&(i=Math.max(i,c.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),o=un(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=un(i)&&!isNaN(i)?i:+n.endOf(Date.now(),r)+1,this.min=Math.min(o,i-1),this.max=Math.max(o+1,i)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,o=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);const i=this.min,s=this.max,a=bV(o,i,s);return this._unit=n.unit||(r.autoSkip?bR(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):Nq(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Lq(this._unit),this.initOffsets(o),t.reverse&&a.reverse(),xR(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,o,i;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?n=1-o:n=(this.getDecimalForValue(t[1])-o)/2,i=this.getDecimalForValue(t[t.length-1]),t.length===1?r=i:r=(i-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;n=$n(n,0,s),r=$n(r,0,s),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,o=this.options,i=o.time,s=i.unit||bR(i.minUnit,n,r,this._getLabelCapacity(n)),a=it(o.ticks.stepSize,1),l=s==="week"?i.isoWeekday:!1,c=sc(l)||l===!0,u={};let f=n,g,p;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const v=o.ticks.source==="data"&&this.getDataTimestamps();for(g=f,p=0;g<r;g=+t.add(g,a,s),p++)yR(u,g,v);return(g===r||o.bounds==="ticks"||p===1)&&yR(u,g,v),Object.keys(u).sort(mR).map(y=>+y)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const o=this.options.time.displayFormats,i=this._unit,s=n||o[i];return this._adapter.format(t,s)}_tickFormatFunction(t,n,r,o){const i=this.options,s=i.ticks.callback;if(s)return Ft(s,[t,n,r],this);const a=i.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],f=c&&a[c],g=r[n],p=c&&f&&g&&g.major;return this._adapter.format(t,o||(p?f:u))}generateTickLabels(t){let n,r,o;for(n=0,r=t.length;n<r;++n)o=t[n],o.label=this._tickFormatFunction(o.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,o=Co(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(o),s=Math.sin(o),a=this._resolveTickFontOptions(0).size;return{w:r*i+a*s,h:r*s+a*i}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,o=r[n.unit]||r.millisecond,i=this._tickFormatFunction(t,0,xR(this,[t],this._majorUnit),o),s=this._getLabelSize(i),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(n=0,r=o.length;n<r;++n)t=t.concat(o[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const o=this.getLabels();for(n=0,r=o.length;n<r;++n)t.push(vR(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return M2(t.sort(mR))}}De(Xu,"id","time"),De(Xu,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function wh(e,t,n){let r=0,o=e.length-1,i,s,a,l;n?(t>=e[r].pos&&t<=e[o].pos&&({lo:r,hi:o}=Oi(e,"pos",t)),{pos:i,time:a}=e[r],{pos:s,time:l}=e[o]):(t>=e[r].time&&t<=e[o].time&&({lo:r,hi:o}=Oi(e,"time",t)),{time:i,pos:a}=e[r],{time:s,pos:l}=e[o]);const c=s-i;return c?a+(l-a)*(t-i)/c:a}class K0 extends Xu{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=wh(n,this.min),this._tableRange=wh(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,o=[],i=[];let s,a,l,c,u;for(s=0,a=t.length;s<a;++s)c=t[s],c>=n&&c<=r&&o.push(c);if(o.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=o.length;s<a;++s)u=o[s+1],l=o[s-1],c=o[s],Math.round((u+l)/2)!==c&&i.push({time:c,pos:s/(a-1)});return i}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((o,i)=>o-i)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(wh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return wh(this._table,r*this._tableRange+this._minPos,!0)}}De(K0,"id","timeseries"),De(K0,"defaults",Xu.defaults);var zq=Object.freeze({__proto__:null,CategoryScale:U0,LinearScale:q0,LogarithmicScale:G0,RadialLinearScale:xu,TimeScale:Xu,TimeSeriesScale:K0});const jq=[qH,_U,mq,zq];/*!
127
+ * chartjs-plugin-datalabels v2.2.0
128
+ * https://chartjs-plugin-datalabels.netlify.app
129
+ * (c) 2017-2022 chartjs-plugin-datalabels contributors
130
+ * Released under the MIT license
131
+ */var wR=function(){if(typeof window<"u"){if(window.devicePixelRatio)return window.devicePixelRatio;var e=window.screen;if(e)return(e.deviceXDPI||1)/(e.logicalXDPI||1)}return 1}(),Tu={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
132
+ `)):Array.isArray(n)?e.push.apply(e,n):yt(e)||t.unshift(""+n);return t},textSize:function(e,t,n){var r=[].concat(t),o=r.length,i=e.font,s=0,a;for(e.font=n.string,a=0;a<o;++a)s=Math.max(e.measureText(r[a]).width,s);return e.font=i,{height:o*n.lineHeight,width:s}},bound:function(e,t,n){return Math.max(e,Math.min(t,n))},arrayDiff:function(e,t){var n=e.slice(),r=[],o,i,s,a;for(o=0,s=t.length;o<s;++o)a=t[o],i=n.indexOf(a),i===-1?r.push([a,1]):n.splice(i,1);for(o=0,s=n.length;o<s;++o)r.push([n[o],-1]);return r},rasterize:function(e){return Math.round(e*wR)/wR}};function tb(e,t){var n=t.x,r=t.y;if(n===null)return{x:0,y:-1};if(r===null)return{x:1,y:0};var o=e.x-n,i=e.y-r,s=Math.sqrt(o*o+i*i);return{x:s?o/s:0,y:s?i/s:-1}}function Bq(e,t,n,r,o){switch(o){case"center":n=r=0;break;case"bottom":n=0,r=1;break;case"right":n=1,r=0;break;case"left":n=-1,r=0;break;case"top":n=0,r=-1;break;case"start":n=-n,r=-r;break;case"end":break;default:o*=Math.PI/180,n=Math.cos(o),r=Math.sin(o);break}return{x:e,y:t,vx:n,vy:r}}var Vq=0,wD=1,_D=2,SD=4,CD=8;function _h(e,t,n){var r=Vq;return e<n.left?r|=wD:e>n.right&&(r|=_D),t<n.top?r|=CD:t>n.bottom&&(r|=SD),r}function Hq(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=_h(n,r,t),a=_h(o,i,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&CD?(c=n+(o-n)*(t.top-r)/(i-r),u=t.top):l&SD?(c=n+(o-n)*(t.bottom-r)/(i-r),u=t.bottom):l&_D?(u=r+(i-r)*(t.right-n)/(o-n),c=t.right):l&wD&&(u=r+(i-r)*(t.left-n)/(o-n),c=t.left),l===s?(n=c,r=u,s=_h(n,r,t)):(o=c,i=u,a=_h(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function Sh(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=Hq(r,t.area)),n==="start"?(o=r.x0,i=r.y0):n==="end"?(o=r.x1,i=r.y1):(o=(r.x0+r.x1)/2,i=(r.y0+r.y1)/2),Bq(o,i,e.vx,e.vy,t.align)}var Ch={arc:function(e,t){var n=(e.startAngle+e.endAngle)/2,r=Math.cos(n),o=Math.sin(n),i=e.innerRadius,s=e.outerRadius;return Sh({x0:e.x+r*i,y0:e.y+o*i,x1:e.x+r*s,y1:e.y+o*s,vx:r,vy:o},t)},point:function(e,t){var n=tb(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return Sh({x0:e.x-r,y0:e.y-o,x1:e.x+r,y1:e.y+o,vx:n.x,vy:n.y},t)},bar:function(e,t){var n=tb(e,t.origin),r=e.x,o=e.y,i=0,s=0;return e.horizontal?(r=Math.min(e.x,e.base),i=Math.abs(e.base-e.x)):(o=Math.min(e.y,e.base),s=Math.abs(e.base-e.y)),Sh({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=tb(e,t.origin);return Sh({x0:e.x,y0:e.y,x1:e.x+(e.width||0),y1:e.y+(e.height||0),vx:n.x,vy:n.y},t)}},Di=Tu.rasterize;function Wq(e){var t=e.borderWidth||0,n=e.padding,r=e.size.height,o=e.size.width,i=-o/2,s=-r/2;return{frame:{x:i-n.left-t,y:s-n.top-t,w:o+n.width+t*2,h:r+n.height+t*2},text:{x:i,y:s,w:o,h:r}}}function Uq(e,t){var n=t.chart.getDatasetMeta(t.datasetIndex).vScale;if(!n)return null;if(n.xCenter!==void 0&&n.yCenter!==void 0)return{x:n.xCenter,y:n.yCenter};var r=n.getBasePixel();return e.horizontal?{x:r,y:null}:{x:null,y:r}}function qq(e){return e instanceof kl?Ch.arc:e instanceof $u?Ch.point:e instanceof Du?Ch.bar:Ch.fallback}function Gq(e,t,n,r,o,i){var s=Math.PI/2;if(i){var a=Math.min(i,o/2,r/2),l=t+a,c=n+a,u=t+r-a,f=n+o-a;e.moveTo(t,c),l<u&&c<f?(e.arc(l,c,a,-Math.PI,-s),e.arc(u,c,a,-s,0),e.arc(u,f,a,0,s),e.arc(l,f,a,s,Math.PI)):l<u?(e.moveTo(l,n),e.arc(u,c,a,-s,s),e.arc(l,c,a,s,Math.PI+s)):c<f?(e.arc(l,c,a,-Math.PI,0),e.arc(l,f,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,o)}function Yq(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),Gq(e,Di(t.x)+i/2,Di(t.y)+i/2,Di(t.w)-i,Di(t.h)-i,n.borderRadius),e.closePath(),r&&(e.fillStyle=r,e.fill()),o&&i&&(e.strokeStyle=o,e.lineWidth=i,e.lineJoin="miter",e.stroke()))}function Kq(e,t,n){var r=n.lineHeight,o=e.w,i=e.x,s=e.y+r/2;return t==="center"?i+=o/2:(t==="end"||t==="right")&&(i+=o),{h:r,w:o,x:i,y:s}}function Xq(e,t,n){var r=e.shadowBlur,o=n.stroked,i=Di(n.x),s=Di(n.y),a=Di(n.w);o&&e.strokeText(t,i,s,a),n.filled&&(r&&o&&(e.shadowBlur=0),e.fillText(t,i,s,a),r&&o&&(e.shadowBlur=r))}function Qq(e,t,n,r){var o=r.textAlign,i=r.color,s=!!i,a=r.font,l=t.length,c=r.textStrokeColor,u=r.textStrokeWidth,f=c&&u,g;if(!(!l||!s&&!f))for(n=Kq(n,o,a),e.font=a.string,e.textAlign=o,e.textBaseline="middle",e.shadowBlur=r.textShadowBlur,e.shadowColor=r.textShadowColor,s&&(e.fillStyle=i),f&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),g=0,l=t.length;g<l;++g)Xq(e,t[g],{stroked:f,filled:s,w:n.w,x:n.x,y:n.y+n.h*g})}var ED=function(e,t,n,r){var o=this;o._config=e,o._index=r,o._model=null,o._rects=null,o._ctx=t,o._el=n};Qo(ED.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=bn(Qt([n.font,{}],r,i)),a=Qt([n.color,an.color],r,i);return{align:Qt([n.align,"center"],r,i),anchor:Qt([n.anchor,"center"],r,i),area:r.chart.chartArea,backgroundColor:Qt([n.backgroundColor,null],r,i),borderColor:Qt([n.borderColor,null],r,i),borderRadius:Qt([n.borderRadius,0],r,i),borderWidth:Qt([n.borderWidth,0],r,i),clamp:Qt([n.clamp,!1],r,i),clip:Qt([n.clip,!1],r,i),color:a,display:e,font:s,lines:t,offset:Qt([n.offset,4],r,i),opacity:Qt([n.opacity,1],r,i),origin:Uq(o._el,r),padding:Fn(Qt([n.padding,4],r,i)),positioner:qq(o._el),rotation:Qt([n.rotation,0],r,i)*(Math.PI/180),size:Tu.textSize(o._ctx,t,s),textAlign:Qt([n.textAlign,"start"],r,i),textShadowBlur:Qt([n.textShadowBlur,0],r,i),textShadowColor:Qt([n.textShadowColor,a],r,i),textStrokeColor:Qt([n.textStrokeColor,a],r,i),textStrokeWidth:Qt([n.textStrokeWidth,0],r,i)}},update:function(e){var t=this,n=null,r=null,o=t._index,i=t._config,s,a,l,c=Qt([i.display,!0],e,o);c&&(s=e.dataset.data[o],a=it(Ft(i.formatter,[s,e]),s),l=yt(a)?[]:Tu.toTextLines(a),l.length&&(n=t._modelize(c,l,i,e),r=Wq(n))),t._model=n,t._rects=r},geometry:function(){return this._rects?this._rects.frame:{}},rotation:function(){return this._model?this._model.rotation:0},visible:function(){return this._model&&this._model.opacity},model:function(){return this._model},draw:function(e,t){var n=this,r=e.ctx,o=n._model,i=n._rects,s;this.visible()&&(r.save(),o.clip&&(s=o.area,r.beginPath(),r.rect(s.left,s.top,s.right-s.left,s.bottom-s.top),r.clip()),r.globalAlpha=Tu.bound(0,o.opacity,1),r.translate(Di(t.x),Di(t.y)),r.rotate(o.rotation),Yq(r,i.frame,o),Qq(r,o.lines,i.text,o),r.restore())}});var Jq=Number.MIN_SAFE_INTEGER||-9007199254740991,Zq=Number.MAX_SAFE_INTEGER||9007199254740991;function su(e,t,n){var r=Math.cos(n),o=Math.sin(n),i=t.x,s=t.y;return{x:i+r*(e.x-i)-o*(e.y-s),y:s+o*(e.x-i)+r*(e.y-s)}}function _R(e,t){var n=Zq,r=Jq,o=t.origin,i,s,a,l,c;for(i=0;i<e.length;++i)s=e[i],a=s.x-o.x,l=s.y-o.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function Eh(e,t){var n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);return{vx:(t.x-e.x)/o,vy:(t.y-e.y)/o,origin:e,ln:o}}var RD=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};Qo(RD.prototype,{center:function(){var e=this._rect;return{x:e.x+e.w/2,y:e.y+e.h/2}},update:function(e,t,n){this._rotation=n,this._rect={x:t.x+e.x,y:t.y+e.y,w:t.w,h:t.h}},contains:function(e){var t=this,n=1,r=t._rect;return e=su(e,t.center(),-t._rotation),!(e.x<r.x-n||e.y<r.y-n||e.x>r.x+r.w+n*2||e.y>r.y+r.h+n*2)},intersects:function(e){var t=this._points(),n=e._points(),r=[Eh(t[0],t[1]),Eh(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(Eh(n[0],n[1]),Eh(n[0],n[3])),o=0;o<r.length;++o)if(i=_R(t,r[o]),s=_R(n,r[o]),i.max<s.min||s.max<i.min)return!1;return!0},_points:function(){var e=this,t=e._rect,n=e._rotation,r=e.center();return[su({x:t.x,y:t.y},r,n),su({x:t.x+t.w,y:t.y},r,n),su({x:t.x+t.w,y:t.y+t.h},r,n),su({x:t.x,y:t.y+t.h},r,n)]}});function PD(e,t,n){var r=t.positioner(e,t),o=r.vx,i=r.vy;if(!o&&!i)return{x:r.x,y:r.y};var s=n.w,a=n.h,l=t.rotation,c=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),u=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),f=1/Math.max(Math.abs(o),Math.abs(i));return c*=o*f,u*=i*f,c+=t.offset*o,u+=t.offset*i,{x:r.x+c,y:r.y+u}}function eG(e,t){var n,r,o,i;for(n=e.length-1;n>=0;--n)for(o=e[n].$layout,r=n-1;r>=0&&o._visible;--r)i=e[r].$layout,i._visible&&o._box.intersects(i._box)&&t(o,i);return e}function tG(e){var t,n,r,o,i,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],o=r.$layout,o._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),i=r.geometry(),s=PD(a,r.model(),i),o._box.update(s,i,r.rotation()));return eG(e,function(l,c){var u=l._hidable,f=c._hidable;u&&f||f?c._visible=!1:u&&(l._visible=!1)})}var ku={prepare:function(e){var t=[],n,r,o,i,s;for(n=0,o=e.length;n<o;++n)for(r=0,i=e[n].length;r<i;++r)s=e[n][r],t.push(s),s.$layout={_box:new RD,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,u=l.$layout;return c._idx===u._idx?u._set-c._set:u._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,o,i,s;for(n=0,r=e.length;n<r;++n)o=e[n],i=o.model(),s=o.$layout,s._hidable=i&&i.display==="auto",s._visible=o.visible(),t|=s._hidable;t&&tG(e)},lookup:function(e,t){var n,r;for(n=e.length-1;n>=0;--n)if(r=e[n].$layout,r&&r._visible&&r._box.contains(t))return e[n];return null},draw:function(e,t){var n,r,o,i,s,a;for(n=0,r=t.length;n<r;++n)o=t[n],i=o.$layout,i._visible&&(s=o.geometry(),a=PD(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},nG=function(e){if(yt(e))return null;var t=e,n,r,o;if(_t(e))if(!yt(e.label))t=e.label;else if(!yt(e.r))t=e.r;else for(t="",n=Object.keys(e),o=0,r=n.length;o<r;++o)t+=(o!==0?", ":"")+n[o]+": "+e[n[o]];return""+t},rG={align:"center",anchor:"center",backgroundColor:null,borderColor:null,borderRadius:0,borderWidth:0,clamp:!1,clip:!1,color:void 0,display:!0,font:{family:void 0,lineHeight:1.2,size:void 0,style:void 0,weight:null},formatter:nG,labels:void 0,listeners:{},offset:4,opacity:1,padding:{top:4,right:4,bottom:4,left:4},rotation:0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,textShadowBlur:0,textShadowColor:void 0},dr="$datalabels",OD="$default";function oG(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=Qo({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(Qo({},[t,i[a],{_key:a}]))}):o.push(t),r=o.reduce(function(a,l){return At(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||OD]=c}),delete l.listeners,a},{}),{labels:o,listeners:r})}function X0(e,t,n,r){if(t){var o=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&Ft(s,[o,r])===!0&&(e[dr]._dirty=!0,n.update(o)))}}function iG(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&X0(e,t.leave,n,o),i&&X0(e,t.enter,r,o))}function sG(e,t){var n=e[dr],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=ku.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,iG(e,r,o,i,t)}}function aG(e,t){var n=e[dr],r=n._listeners.click,o=r&&ku.lookup(n._labels,t);o&&X0(e,r,o,t)}var lG={id:"datalabels",defaults:rG,beforeInit:function(e){e[dr]={_actives:[]}},beforeUpdate:function(e){var t=e[dr];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[dr],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=oG(a,n),c=t.meta.data||[],u=e.ctx,f,g,p,v,y,x,w,_;for(u.save(),f=0,p=c.length;f<p;++f)if(w=c[f],w[dr]=[],s&&w&&e.getDataVisibility(f)&&!w.skip)for(g=0,v=l.labels.length;g<v;++g)y=l.labels[g],x=y._key,_=new ED(y,u,w,f),_.$groups={_set:r,_key:x||OD},_.$context={active:!1,chart:e,dataIndex:f,dataset:a,datasetIndex:r},_.update(_.$context),w[dr].push(_),i.push(_);u.restore(),Qo(o._listeners,l.listeners,{merger:function(S,R,E){R[S]=R[S]||{},R[S][t.index]=E[S],o._listened=!0}})},afterUpdate:function(e){e[dr]._labels=ku.prepare(e[dr]._datasets)},afterDatasetsDraw:function(e){ku.draw(e,e[dr]._labels)},beforeEvent:function(e,t){if(e[dr]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":sG(e,n);break;case"click":aG(e,n);break}}},afterEvent:function(e){var t=e[dr],n=t._actives,r=t._actives=e.getActiveElements(),o=Tu.arrayDiff(n,r),i,s,a,l,c,u,f;for(i=0,s=o.length;i<s;++i)if(c=o[i],c[1])for(f=c[0].element[dr]||[],a=0,l=f.length;a<l;++a)u=f[a],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||o.length)&&(ku.update(t._labels),e.render()),delete t._dirty}};ao.register(...jq);ao.register(lG);function Gx({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,o]=m.useState(),i=Te(l=>l.themeStyle);m.useEffect(()=>{var u,f,g,p;(f=(u=i==null?void 0:i.chart)==null?void 0:u.font)!=null&&f.family&&(ao.defaults.font={...ao.defaults.font,...(g=i==null?void 0:i.chart)==null?void 0:g.font}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const l=(p=n==null?void 0:n.current)==null?void 0:p.getContext("2d");if(!l)return;let c;try{c=new ao(l,e),o(c)}catch(v){console.log("error creating chart",v)}return()=>{c&&c.destroy()}},[(a=i==null?void 0:i.chart)==null?void 0:a.font]);function s(l){var u,f;if(!r)return;const c=r==null?void 0:r.getElementsAtEventForMode(l,"nearest",{intersect:!0},!0);if(c&&c.length>0){const g=c[0].datasetIndex,p=c[0].index,v=(f=(u=c[0].element)==null?void 0:u.$context)==null?void 0:f.raw;t==null||t(r,g,p,v)}}return N.jsx("div",{onClick:s,className:"relative h-[99%]",children:N.jsx("canvas",{ref:n})})}function ho(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var cG=["color"],$D=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ho(e,cG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),uG=["color"],dG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ho(e,uG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),fG=["color"],hG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ho(e,fG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M5 2V1H10V2H5ZM4.75 0C4.33579 0 4 0.335786 4 0.75V1H3.5C2.67157 1 2 1.67157 2 2.5V12.5C2 13.3284 2.67157 14 3.5 14H7V13H3.5C3.22386 13 3 12.7761 3 12.5V2.5C3 2.22386 3.22386 2 3.5 2H4V2.25C4 2.66421 4.33579 3 4.75 3H10.25C10.6642 3 11 2.66421 11 2.25V2H11.5C11.7761 2 12 2.22386 12 2.5V7H13V2.5C13 1.67157 12.3284 1 11.5 1H11V0.75C11 0.335786 10.6642 0 10.25 0H4.75ZM9 8.5C9 8.77614 8.77614 9 8.5 9C8.22386 9 8 8.77614 8 8.5C8 8.22386 8.22386 8 8.5 8C8.77614 8 9 8.22386 9 8.5ZM10.5 9C10.7761 9 11 8.77614 11 8.5C11 8.22386 10.7761 8 10.5 8C10.2239 8 10 8.22386 10 8.5C10 8.77614 10.2239 9 10.5 9ZM13 8.5C13 8.77614 12.7761 9 12.5 9C12.2239 9 12 8.77614 12 8.5C12 8.22386 12.2239 8 12.5 8C12.7761 8 13 8.22386 13 8.5ZM14.5 9C14.7761 9 15 8.77614 15 8.5C15 8.22386 14.7761 8 14.5 8C14.2239 8 14 8.22386 14 8.5C14 8.77614 14.2239 9 14.5 9ZM15 10.5C15 10.7761 14.7761 11 14.5 11C14.2239 11 14 10.7761 14 10.5C14 10.2239 14.2239 10 14.5 10C14.7761 10 15 10.2239 15 10.5ZM14.5 13C14.7761 13 15 12.7761 15 12.5C15 12.2239 14.7761 12 14.5 12C14.2239 12 14 12.2239 14 12.5C14 12.7761 14.2239 13 14.5 13ZM14.5 15C14.7761 15 15 14.7761 15 14.5C15 14.2239 14.7761 14 14.5 14C14.2239 14 14 14.2239 14 14.5C14 14.7761 14.2239 15 14.5 15ZM8.5 11C8.77614 11 9 10.7761 9 10.5C9 10.2239 8.77614 10 8.5 10C8.22386 10 8 10.2239 8 10.5C8 10.7761 8.22386 11 8.5 11ZM9 12.5C9 12.7761 8.77614 13 8.5 13C8.22386 13 8 12.7761 8 12.5C8 12.2239 8.22386 12 8.5 12C8.77614 12 9 12.2239 9 12.5ZM8.5 15C8.77614 15 9 14.7761 9 14.5C9 14.2239 8.77614 14 8.5 14C8.22386 14 8 14.2239 8 14.5C8 14.7761 8.22386 15 8.5 15ZM11 14.5C11 14.7761 10.7761 15 10.5 15C10.2239 15 10 14.7761 10 14.5C10 14.2239 10.2239 14 10.5 14C10.7761 14 11 14.2239 11 14.5ZM12.5 15C12.7761 15 13 14.7761 13 14.5C13 14.2239 12.7761 14 12.5 14C12.2239 14 12 14.2239 12 14.5C12 14.7761 12.2239 15 12.5 15Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),pG=["color"],DD=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ho(e,pG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),gG=["color"],mG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ho(e,gG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M14.7649 6.07596C14.9991 6.22231 15.0703 6.53079 14.9239 6.76495C14.4849 7.46743 13.9632 8.10645 13.3702 8.66305L14.5712 9.86406C14.7664 10.0593 14.7664 10.3759 14.5712 10.5712C14.3759 10.7664 14.0593 10.7664 13.8641 10.5712L12.6011 9.30817C11.805 9.90283 10.9089 10.3621 9.93375 10.651L10.383 12.3277C10.4544 12.5944 10.2961 12.8685 10.0294 12.94C9.76267 13.0115 9.4885 12.8532 9.41704 12.5865L8.95917 10.8775C8.48743 10.958 8.00036 10.9999 7.50001 10.9999C6.99965 10.9999 6.51257 10.958 6.04082 10.8775L5.58299 12.5864C5.51153 12.8532 5.23737 13.0115 4.97064 12.94C4.7039 12.8686 4.5456 12.5944 4.61706 12.3277L5.06625 10.651C4.09111 10.3621 3.19503 9.90282 2.3989 9.30815L1.1359 10.5712C0.940638 10.7664 0.624058 10.7664 0.428798 10.5712C0.233537 10.3759 0.233537 10.0593 0.428798 9.86405L1.62982 8.66303C1.03682 8.10643 0.515113 7.46742 0.0760677 6.76495C-0.0702867 6.53079 0.000898544 6.22231 0.235065 6.07596C0.469231 5.9296 0.777703 6.00079 0.924058 6.23496C1.40354 7.00213 1.989 7.68057 2.66233 8.2427C2.67315 8.25096 2.6837 8.25972 2.69397 8.26898C4.00897 9.35527 5.65537 9.99991 7.50001 9.99991C10.3078 9.99991 12.6564 8.5063 14.076 6.23495C14.2223 6.00079 14.5308 5.9296 14.7649 6.07596Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),vG=["color"],bG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ho(e,vG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),yG=["color"],xG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ho(e,yG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),wG=["color"],_G=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ho(e,wG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M1.20308 1.04312C1.00481 0.954998 0.772341 1.0048 0.627577 1.16641C0.482813 1.32802 0.458794 1.56455 0.568117 1.75196L3.92115 7.50002L0.568117 13.2481C0.458794 13.4355 0.482813 13.672 0.627577 13.8336C0.772341 13.9952 1.00481 14.045 1.20308 13.9569L14.7031 7.95693C14.8836 7.87668 15 7.69762 15 7.50002C15 7.30243 14.8836 7.12337 14.7031 7.04312L1.20308 1.04312ZM4.84553 7.10002L2.21234 2.586L13.2689 7.50002L2.21234 12.414L4.84552 7.90002H9C9.22092 7.90002 9.4 7.72094 9.4 7.50002C9.4 7.27911 9.22092 7.10002 9 7.10002H4.84553Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),SG=["color"],CG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ho(e,SG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),EG=["color"],RG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ho(e,EG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M10.3004 7.49991C10.3004 8.4943 9.49426 9.30041 8.49988 9.30041C7.50549 9.30041 6.69938 8.4943 6.69938 7.49991C6.69938 6.50553 7.50549 5.69942 8.49988 5.69942C9.49426 5.69942 10.3004 6.50553 10.3004 7.49991ZM11.205 8C10.9699 9.28029 9.84816 10.2504 8.49988 10.2504C7.1516 10.2504 6.0299 9.28029 5.79473 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H5.7947C6.0298 5.71962 7.15154 4.74942 8.49988 4.74942C9.84822 4.74942 10.97 5.71962 11.2051 7H14.5C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H11.205Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),PG=["color"],Yx=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ho(e,PG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),OG=["color"],Kx=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ho(e,OG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let Rh;const $G=new Uint8Array(16);function DG(){if(!Rh&&(Rh=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Rh))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Rh($G)}const In=[];for(let e=0;e<256;++e)In.push((e+256).toString(16).slice(1));function TG(e,t=0){return In[e[t+0]]+In[e[t+1]]+In[e[t+2]]+In[e[t+3]]+"-"+In[e[t+4]]+In[e[t+5]]+"-"+In[e[t+6]]+In[e[t+7]]+"-"+In[e[t+8]]+In[e[t+9]]+"-"+In[e[t+10]]+In[e[t+11]]+In[e[t+12]]+In[e[t+13]]+In[e[t+14]]+In[e[t+15]]}const kG=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),SR={randomUUID:kG};function Na(e,t,n){if(SR.randomUUID&&!t&&!e)return SR.randomUUID();e=e||{};const r=e.random||(e.rng||DG)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let o=0;o<16;++o)t[n+o]=r[o];return t}return TG(r)}const so=YO()(t$((e,t)=>({isShowingVisual:!0,runSql:!1,sqlGen:{},sql:"",isSqlRunning:!1,queryResultColumns:[],showFilters:!1,applyFilters:!1,filterValues:[{filterId:"sample-filter-id",valueType:"string",name:"",operation:"in",values:[""]}],card:{id:Na(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:Na(),cards:[],activeCardId:""},actions:{setNumberFormat:(n,r,o,i)=>{e(s=>{var a;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{format:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setQueryError:n=>{e(r=>{r.queryError=n})},setQueryResultColumns:n=>{e(r=>{r.queryResultColumns=n})},setCardPreferences:n=>{e(r=>{r.card.preferences=n})},setFilterOnClickColumnIndex:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClickColumnIndex:n}})},setFilterOnClickField:n=>{e(r=>{r.card.preferences={...r.card.preferences,filterOnClick:!0,filterOnClickField:n}})},setCardRefreshInterval:n=>{e(r=>{r.card.refreshInterval=n})},setIsShowingVisual:n=>{e({isShowingVisual:n})},setRunSql:n=>{e({runSql:n})},setIsSqlRunning:n=>{e({isSqlRunning:n})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{r.card.type=n})},setCardSql:n=>{e(r=>{r.card.sql=n})},setCardPython:n=>{e(r=>{r.card.python=n})},setPythonStdOut:n=>{e(r=>{r.pythonStdOut=n})},setCardCustomCfg:n=>{e(r=>{r.card.customCfg=n})},setCardCfg:n=>{e(r=>{r.card.cfg=n})},setShowFilters:n=>{e(r=>{r.showFilters=n})},setApplyFilters:n=>{e(r=>{r.applyFilters=n})},setFilterValues:n=>{e(r=>{r.filterValues=n})},setSqlGen:n=>{e(r=>{r.sqlGen=n})},setSqlGenMeasure:(n,r)=>{e(o=>{o.sqlGen.measures=[...o.sqlGen.measures||[],{name:n,calc:r}]})},setSqlGenDimension:n=>{e(r=>{r.sqlGen.dimensions=[...r.sqlGen.dimensions||[],n]})},setCardData:n=>{e(r=>{r.card.data=n})},setSelectedConnectionId:n=>{var r,o;e(i=>{i.selectedConnectionId=n,i.card.connectionId=n}),(o=(r=t()).onConnectionChange)==null||o.call(r,n)},setSelectedDatabaseName:n=>{var r,o;e(i=>{i.selectedDatabaseName=n,i.card.lastSelectedDatabase=n}),(o=(r=t()).onDatabaseChange)==null||o.call(r,n)},setSelectedSchemaName:n=>{var r,o;e(i=>{i.selectedSchemaName=n,i.card.lastSelectedSchema=n}),(o=(r=t()).onSchemaChange)==null||o.call(r,n)},setSelectedTableName:n=>{var r,o;e(i=>{i.selectedTableName=n,i.card.lastSelectedTable=n}),(o=(r=t()).onTableChange)==null||o.call(r,n)},setCurrentColumns:n=>{e(r=>{r.currentColumns=n})},setOnConnectionChange:n=>{e({onConnectionChange:n})},setOnDatabaseChange:n=>{e({onDatabaseChange:n})},setOnSchemaChange:n=>{e({onSchemaChange:n})},setOnTableChange:n=>{e({onTableChange:n})},setOnSave:n=>{e({onSave:n})},setOnClose:n=>{e({onClose:n})}}}))),TD=()=>so(e=>e.actions);function MG(e,t,n){var l,c,u,f;const r=n==null?void 0:n.datasetOptions,o=Te.getState().themeStyle,i=(c=(l=o==null?void 0:o.chart)==null?void 0:l.dataset)==null?void 0:c.backgroundColor,s=(f=(u=o==null?void 0:o.chart)==null?void 0:u.dataset)==null?void 0:f.borderColor;return e.map((g,p)=>{var _;const v=r==null?void 0:r.find(S=>S.idx===p),y=i==null?void 0:i[p%i.length],x=s==null?void 0:s[p%s.length];return{label:g.charAt(0).toUpperCase()+g.slice(1),data:t.map(S=>S[g]),...v,datalabels:{...v==null?void 0:v.datalabels,color:AG((_=v==null?void 0:v.datalabels)==null?void 0:_.align,y)},backgroundColor:y,borderColor:x}})}function AG(e,t){return vp(e==="end"||e==="start"?mp():t)}function IG(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=uo(e);let r=[];const o=Te.getState().themeStyle,i=(l=(a=o==null?void 0:o.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(u=(c=o==null?void 0:o.chart)==null?void 0:c.dataset)==null?void 0:u.borderColor;if((n==null?void 0:n.length)===1){const f=e.map(g=>({x:g[t[0]],y:g[t[1]],r:g[t[2]],label:g[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:f}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(g=>g[n==null?void 0:n[1]]))].map((g,p)=>{const v=e.filter(y=>y[n==null?void 0:n[1]]===g);return{label:g,data:v.map(y=>({x:y[t[0]],y:y[t[1]],r:y[t[2]],label:y[n==null?void 0:n[0]]})),backgroundColor:i==null?void 0:i[p%i.length],borderColor:s==null?void 0:s[p%s.length]}})),r}function NG(e,t){var s,a,l,c;const n=Te.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,o=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(u=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(f=>f[u]),backgroundColor:t.map((f,g)=>r==null?void 0:r[g%r.length]),borderColor:t.map((f,g)=>o==null?void 0:o[g%o.length])}))}function LG(e){let t=-1,n=0;return e.forEach((r,o)=>{const i=Object.keys(r).length;i>n&&(t=o,n=i)}),t}function uo(e){if(e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=LG(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,c,u,f,g,p;return!!(typeof((s=e==null?void 0:e[t])==null?void 0:s[i])&&typeof((a=e==null?void 0:e[t])==null?void 0:a[i])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[i])&&typeof((c=e==null?void 0:e[0])==null?void 0:c[i])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[i])&&typeof((f=e==null?void 0:e[1])==null?void 0:f[i])=="string"||typeof((g=e==null?void 0:e[2])==null?void 0:g[i])&&typeof((p=e==null?void 0:e[2])==null?void 0:p[i])=="string")});r.length===0&&r.push(n[0]);const o=n.filter(i=>{var s,a;return((s=e==null?void 0:e[t])==null?void 0:s[i])===+((a=e==null?void 0:e[t])==null?void 0:a[i])});return{keys:n,dimensionKeys:r,metricKeys:o}}function Q0(e,t){var r;const n=(r=t==null?void 0:t.data)==null?void 0:r.datasets;return n&&n.length>0?e.map((i,s)=>({...i,...n[s],data:i.data,label:i.label})):e}function Xx({dataArray:e,groupKey:t,pivotKey:n,valueKey:r}){const o=e.reduce((i,s)=>{const a=s[t],l=s[n],c=s[r];return i[a]||(i[a]={[t]:a}),i[a][l]=c,i},{});return Object.values(o)}function J0(e,t){var s;const n=Te.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=ki.cloneDeep(r);return ki.merge(o,e,t)}function kD(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}function FG({frame:e}){const t=Te(_=>_.isDashboardEditing),n=Te(_=>_.filterValues),r=Te(_=>_.isVisualEditing),o=Te(_=>_.selectedSheetId);Te(_=>_.currentBreakpoint);const{removeFrame:i}=Te(_=>_.actions),s=Te(_=>_.actions.setIsVisualEditing),a=so(_=>_.actions.setFilterValues),l=so(_=>_.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:f}=so(_=>_.actions),g=so(_=>_.actions.setSelectedConnectionId),p=so(_=>_.actions.setSelectedDatabaseName),v=so(_=>_.actions.setSelectedSchemaName),y=so(_=>_.actions.setSelectedTableName),x=e.cards.find(_=>_.id===e.activeCardId);function w(){s(!r),c(x);const{dimensionKeys:_}=uo((x==null?void 0:x.data)||[]);f(_),u(e),x!=null&&x.connectionId&&g(x==null?void 0:x.connectionId),x!=null&&x.lastSelectedDatabase&&p(x==null?void 0:x.lastSelectedDatabase),x!=null&&x.lastSelectedSchema&&v(x==null?void 0:x.lastSelectedSchema),x!=null&&x.lastSelectedTable&&y(x==null?void 0:x.lastSelectedTable),n&&(a(n),l(!0))}return N.jsx("section",{className:"absolute right-2 top-2 z-10",children:t&&N.jsxs("div",{className:"flex items-center gap-2",children:[r?N.jsx(mG,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}):N.jsx(bG,{role:"edit-visual",onClick:w,className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}),N.jsx(DD,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"})]})})}function zG(e,t=globalThis==null?void 0:globalThis.document){const n=Cn(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Z0="dismissableLayer.update",jG="dismissableLayer.pointerDownOutside",BG="dismissableLayer.focusOutside";let CR;const VG=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xc=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,u=m.useContext(VG),[f,g]=m.useState(null),p=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,v]=m.useState({}),y=st(t,T=>g(T)),x=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),_=x.indexOf(w),S=f?x.indexOf(f):-1,R=u.layersWithOutsidePointerEventsDisabled.size>0,E=S>=_,O=HG(T=>{const M=T.target,F=[...u.branches].some(z=>z.contains(M));!E||F||(i==null||i(T),a==null||a(T),T.defaultPrevented||l==null||l())},p),k=WG(T=>{const M=T.target;[...u.branches].some(z=>z.contains(M))||(s==null||s(T),a==null||a(T),T.defaultPrevented||l==null||l())},p);return zG(T=>{S===u.layers.size-1&&(o==null||o(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},p),m.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(CR=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),ER(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=CR)}},[f,p,r,u]),m.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),ER())},[f,u]),m.useEffect(()=>{const T=()=>v({});return document.addEventListener(Z0,T),()=>document.removeEventListener(Z0,T)},[]),m.createElement(We.div,se({},c,{ref:y,style:{pointerEvents:R?E?"auto":"none":void 0,...e.style},onFocusCapture:Ee(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Ee(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Ee(e.onPointerDownCapture,O.onPointerDownCapture)}))});function HG(e,t=globalThis==null?void 0:globalThis.document){const n=Cn(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){MD(jG,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function WG(e,t=globalThis==null?void 0:globalThis.document){const n=Cn(e),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&MD(BG,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ER(){const e=new CustomEvent(Z0);document.dispatchEvent(e)}function MD(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?S$(o,i):o.dispatchEvent(i)}const UG=["top","right","bottom","left"],Rs=Math.min,Lr=Math.max,Ap=Math.round,Ph=Math.floor,Ps=e=>({x:e,y:e}),qG={left:"right",right:"left",bottom:"top",top:"bottom"},GG={start:"end",end:"start"};function ey(e,t,n){return Lr(e,Rs(t,n))}function Ai(e,t){return typeof e=="function"?e(t):e}function Ii(e){return e.split("-")[0]}function wc(e){return e.split("-")[1]}function Qx(e){return e==="x"?"y":"x"}function Jx(e){return e==="y"?"height":"width"}function _c(e){return["top","bottom"].includes(Ii(e))?"y":"x"}function Zx(e){return Qx(_c(e))}function YG(e,t,n){n===void 0&&(n=!1);const r=wc(e),o=Zx(e),i=Jx(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ip(s)),[s,Ip(s)]}function KG(e){const t=Ip(e);return[ty(e),t,ty(t)]}function ty(e){return e.replace(/start|end/g,t=>GG[t])}function XG(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function QG(e,t,n,r){const o=wc(e);let i=XG(Ii(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(ty)))),i}function Ip(e){return e.replace(/left|right|bottom|top/g,t=>qG[t])}function JG(e){return{top:0,right:0,bottom:0,left:0,...e}}function AD(e){return typeof e!="number"?JG(e):{top:e,right:e,bottom:e,left:e}}function Np(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function RR(e,t,n){let{reference:r,floating:o}=e;const i=_c(t),s=Zx(t),a=Jx(s),l=Ii(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,g=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(wc(t)){case"start":p[s]-=g*(n&&c?-1:1);break;case"end":p[s]+=g*(n&&c?-1:1);break}return p}const ZG=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=RR(c,r,l),g=r,p={},v=0;for(let y=0;y<a.length;y++){const{name:x,fn:w}=a[y],{x:_,y:S,data:R,reset:E}=await w({x:u,y:f,initialPlacement:r,placement:g,strategy:o,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});if(u=_??u,f=S??f,p={...p,[x]:{...p[x],...R}},E&&v<=50){v++,typeof E=="object"&&(E.placement&&(g=E.placement),E.rects&&(c=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:u,y:f}=RR(c,g,l)),y=-1;continue}}return{x:u,y:f,placement:g,strategy:o,middlewareData:p}};async function Qu(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:g=!1,padding:p=0}=Ai(t,e),v=AD(p),x=a[g?f==="floating"?"reference":"floating":f],w=Np(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),_=f==="floating"?{...s.floating,x:r,y:o}:s.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),R=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},E=Np(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:S,strategy:l}):_);return{top:(w.top-E.top+v.top)/R.y,bottom:(E.bottom-w.bottom+v.bottom)/R.y,left:(w.left-E.left+v.left)/R.x,right:(E.right-w.right+v.right)/R.x}}const PR=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Ai(e,t)||{};if(c==null)return{};const f=AD(u),g={x:n,y:r},p=Zx(o),v=Jx(p),y=await s.getDimensions(c),x=p==="y",w=x?"top":"left",_=x?"bottom":"right",S=x?"clientHeight":"clientWidth",R=i.reference[v]+i.reference[p]-g[p]-i.floating[v],E=g[p]-i.reference[p],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let k=O?O[S]:0;(!k||!await(s.isElement==null?void 0:s.isElement(O)))&&(k=a.floating[S]||i.floating[v]);const T=R/2-E/2,M=k/2-y[v]/2-1,F=Rs(f[w],M),z=Rs(f[_],M),B=F,Y=k-y[v]-z,G=k/2-y[v]/2+T,j=ey(B,G,Y),ee=!l.arrow&&wc(o)!=null&&G!=j&&i.reference[v]/2-(G<B?F:z)-y[v]/2<0,q=ee?G<B?G-B:G-Y:0;return{[p]:g[p]+q,data:{[p]:j,centerOffset:G-j-q,...ee&&{alignmentOffset:q}},reset:ee}}}),eY=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:y=!0,...x}=Ai(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=Ii(o),_=Ii(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),R=g||(_||!y?[Ip(a)]:KG(a));!g&&v!=="none"&&R.push(...QG(a,y,v,S));const E=[a,...R],O=await Qu(t,x),k=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&k.push(O[w]),f){const B=YG(o,s,S);k.push(O[B[0]],O[B[1]])}if(T=[...T,{placement:o,overflows:k}],!k.every(B=>B<=0)){var M,F;const B=(((M=i.flip)==null?void 0:M.index)||0)+1,Y=E[B];if(Y)return{data:{index:B,overflows:T},reset:{placement:Y}};let G=(F=T.filter(j=>j.overflows[0]<=0).sort((j,ee)=>j.overflows[1]-ee.overflows[1])[0])==null?void 0:F.placement;if(!G)switch(p){case"bestFit":{var z;const j=(z=T.map(ee=>[ee.placement,ee.overflows.filter(q=>q>0).reduce((q,X)=>q+X,0)]).sort((ee,q)=>ee[1]-q[1])[0])==null?void 0:z[0];j&&(G=j);break}case"initialPlacement":G=a;break}if(o!==G)return{reset:{placement:G}}}return{}}}};function OR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function $R(e){return UG.some(t=>e[t]>=0)}const tY=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Ai(e,t);switch(r){case"referenceHidden":{const i=await Qu(t,{...o,elementContext:"reference"}),s=OR(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:$R(s)}}}case"escaped":{const i=await Qu(t,{...o,altBoundary:!0}),s=OR(i,n.floating);return{data:{escapedOffsets:s,escaped:$R(s)}}}default:return{}}}}};async function nY(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ii(n),a=wc(n),l=_c(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,f=Ai(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),l?{x:p*u,y:g*c}:{x:g*c,y:p*u}}const rY=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await nY(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},oY=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:w,y:_}=x;return{x:w,y:_}}},...l}=Ai(e,t),c={x:n,y:r},u=await Qu(t,l),f=_c(Ii(o)),g=Qx(f);let p=c[g],v=c[f];if(i){const x=g==="y"?"top":"left",w=g==="y"?"bottom":"right",_=p+u[x],S=p-u[w];p=ey(_,p,S)}if(s){const x=f==="y"?"top":"left",w=f==="y"?"bottom":"right",_=v+u[x],S=v-u[w];v=ey(_,v,S)}const y=a.fn({...t,[g]:p,[f]:v});return{...y,data:{x:y.x-n,y:y.y-r}}}}},iY=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Ai(e,t),u={x:n,y:r},f=_c(o),g=Qx(f);let p=u[g],v=u[f];const y=Ai(a,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const S=g==="y"?"height":"width",R=i.reference[g]-i.floating[S]+x.mainAxis,E=i.reference[g]+i.reference[S]-x.mainAxis;p<R?p=R:p>E&&(p=E)}if(c){var w,_;const S=g==="y"?"width":"height",R=["top","left"].includes(Ii(o)),E=i.reference[f]-i.floating[S]+(R&&((w=s.offset)==null?void 0:w[f])||0)+(R?0:x.crossAxis),O=i.reference[f]+i.reference[S]+(R?0:((_=s.offset)==null?void 0:_[f])||0)-(R?x.crossAxis:0);v<E?v=E:v>O&&(v=O)}return{[g]:p,[f]:v}}}},sY=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=Ai(e,t),l=await Qu(t,a),c=Ii(n),u=wc(n),f=_c(n)==="y",{width:g,height:p}=r.floating;let v,y;c==="top"||c==="bottom"?(v=c,y=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(y=c,v=u==="end"?"top":"bottom");const x=p-l[v],w=g-l[y],_=!t.middlewareData.shift;let S=x,R=w;if(f){const O=g-l.left-l.right;R=u||_?Rs(w,O):O}else{const O=p-l.top-l.bottom;S=u||_?Rs(x,O):O}if(_&&!u){const O=Lr(l.left,0),k=Lr(l.right,0),T=Lr(l.top,0),M=Lr(l.bottom,0);f?R=g-2*(O!==0||k!==0?O+k:Lr(l.left,l.right)):S=p-2*(T!==0||M!==0?T+M:Lr(l.top,l.bottom))}await s({...t,availableWidth:R,availableHeight:S});const E=await o.getDimensions(i.floating);return g!==E.width||p!==E.height?{reset:{rects:!0}}:{}}}};function Os(e){return ID(e)?(e.nodeName||"").toLowerCase():"#document"}function Br(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zi(e){var t;return(t=(ID(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ID(e){return e instanceof Node||e instanceof Br(e).Node}function Ni(e){return e instanceof Element||e instanceof Br(e).Element}function Jo(e){return e instanceof HTMLElement||e instanceof Br(e).HTMLElement}function DR(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Br(e).ShadowRoot}function Kd(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=fo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function aY(e){return["table","td","th"].includes(Os(e))}function ew(e){const t=tw(),n=fo(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function lY(e){let t=cc(e);for(;Jo(t)&&!Og(t);){if(ew(t))return t;t=cc(t)}return null}function tw(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Og(e){return["html","body","#document"].includes(Os(e))}function fo(e){return Br(e).getComputedStyle(e)}function $g(e){return Ni(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function cc(e){if(Os(e)==="html")return e;const t=e.assignedSlot||e.parentNode||DR(e)&&e.host||zi(e);return DR(t)?t.host:t}function ND(e){const t=cc(e);return Og(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jo(t)&&Kd(t)?t:ND(t)}function Ju(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=ND(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Br(o);return i?t.concat(s,s.visualViewport||[],Kd(o)?o:[],s.frameElement&&n?Ju(s.frameElement):[]):t.concat(o,Ju(o,[],n))}function LD(e){const t=fo(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Jo(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Ap(n)!==i||Ap(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function nw(e){return Ni(e)?e:e.contextElement}function Ll(e){const t=nw(e);if(!Jo(t))return Ps(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=LD(t);let s=(i?Ap(n.width):n.width)/r,a=(i?Ap(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const cY=Ps(0);function FD(e){const t=Br(e);return!tw()||!t.visualViewport?cY:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uY(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Br(e)?!1:t}function La(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=nw(e);let s=Ps(1);t&&(r?Ni(r)&&(s=Ll(r)):s=Ll(e));const a=uY(i,n,r)?FD(i):Ps(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i){const g=Br(i),p=r&&Ni(r)?Br(r):r;let v=g.frameElement;for(;v&&r&&p!==g;){const y=Ll(v),x=v.getBoundingClientRect(),w=fo(v),_=x.left+(v.clientLeft+parseFloat(w.paddingLeft))*y.x,S=x.top+(v.clientTop+parseFloat(w.paddingTop))*y.y;l*=y.x,c*=y.y,u*=y.x,f*=y.y,l+=_,c+=S,v=Br(v).frameElement}}return Np({width:u,height:f,x:l,y:c})}function dY(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Jo(n),i=zi(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=Ps(1);const l=Ps(0);if((o||!o&&r!=="fixed")&&((Os(n)!=="body"||Kd(i))&&(s=$g(n)),Jo(n))){const c=La(n);a=Ll(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}}function fY(e){return Array.from(e.getClientRects())}function zD(e){return La(zi(e)).left+$g(e).scrollLeft}function hY(e){const t=zi(e),n=$g(e),r=e.ownerDocument.body,o=Lr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Lr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+zD(e);const a=-n.scrollTop;return fo(r).direction==="rtl"&&(s+=Lr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function pY(e,t){const n=Br(e),r=zi(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=tw();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function gY(e,t){const n=La(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Jo(e)?Ll(e):Ps(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function TR(e,t,n){let r;if(t==="viewport")r=pY(e,n);else if(t==="document")r=hY(zi(e));else if(Ni(t))r=gY(t,n);else{const o=FD(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Np(r)}function jD(e,t){const n=cc(e);return n===t||!Ni(n)||Og(n)?!1:fo(n).position==="fixed"||jD(n,t)}function mY(e,t){const n=t.get(e);if(n)return n;let r=Ju(e,[],!1).filter(a=>Ni(a)&&Os(a)!=="body"),o=null;const i=fo(e).position==="fixed";let s=i?cc(e):e;for(;Ni(s)&&!Og(s);){const a=fo(s),l=ew(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Kd(s)&&!l&&jD(e,s))?r=r.filter(u=>u!==s):o=a,s=cc(s)}return t.set(e,r),r}function vY(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?mY(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const f=TR(t,u,o);return c.top=Lr(f.top,c.top),c.right=Rs(f.right,c.right),c.bottom=Rs(f.bottom,c.bottom),c.left=Lr(f.left,c.left),c},TR(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function bY(e){return LD(e)}function yY(e,t,n){const r=Jo(t),o=zi(t),i=n==="fixed",s=La(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Ps(0);if(r||!r&&!i)if((Os(t)!=="body"||Kd(o))&&(a=$g(t)),r){const c=La(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=zD(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function kR(e,t){return!Jo(e)||fo(e).position==="fixed"?null:t?t(e):e.offsetParent}function BD(e,t){const n=Br(e);if(!Jo(e))return n;let r=kR(e,t);for(;r&&aY(r)&&fo(r).position==="static";)r=kR(r,t);return r&&(Os(r)==="html"||Os(r)==="body"&&fo(r).position==="static"&&!ew(r))?n:r||lY(e)||n}const xY=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||BD,i=this.getDimensions;return{reference:yY(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function wY(e){return fo(e).direction==="rtl"}const _Y={convertOffsetParentRelativeRectToViewportRelativeRect:dY,getDocumentElement:zi,getClippingRect:vY,getOffsetParent:BD,getElementRects:xY,getClientRects:fY,getDimensions:bY,getScale:Ll,isElement:Ni,isRTL:wY};function SY(e,t){let n=null,r;const o=zi(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:f,height:g}=e.getBoundingClientRect();if(a||t(),!f||!g)return;const p=Ph(u),v=Ph(o.clientWidth-(c+f)),y=Ph(o.clientHeight-(u+g)),x=Ph(c),_={rootMargin:-p+"px "+-v+"px "+-y+"px "+-x+"px",threshold:Lr(0,Rs(1,l))||1};let S=!0;function R(E){const O=E[0].intersectionRatio;if(O!==l){if(!S)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},100)}S=!1}try{n=new IntersectionObserver(R,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,_)}n.observe(e)}return s(!0),i}function CY(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=nw(e),u=o||i?[...c?Ju(c):[],...Ju(t)]:[];u.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const f=c&&a?SY(c,n):null;let g=-1,p=null;s&&(p=new ResizeObserver(w=>{let[_]=w;_&&_.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let v,y=l?La(e):null;l&&x();function x(){const w=La(e);y&&(w.x!==y.x||w.y!==y.y||w.width!==y.width||w.height!==y.height)&&n(),y=w,v=requestAnimationFrame(x)}return n(),()=>{u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f&&f(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(v)}}const EY=(e,t,n)=>{const r=new Map,o={platform:_Y,...n},i={...o.platform,_c:r};return ZG(e,t,{...o,platform:i})},RY=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?PR({element:r.current,padding:o}).fn(n):{}:r?PR({element:r,padding:o}).fn(n):{}}}};var ap=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Lp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Lp(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Lp(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function VD(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function MR(e,t){const n=VD(e);return Math.round(t*n)/n}function AR(e){const t=fe.useRef(e);return ap(()=>{t.current=e}),t}function PY(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=fe.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,p]=fe.useState(r);Lp(g,r)||p(r);const[v,y]=fe.useState(null),[x,w]=fe.useState(null),_=fe.useCallback(ee=>{ee!=O.current&&(O.current=ee,y(ee))},[y]),S=fe.useCallback(ee=>{ee!==k.current&&(k.current=ee,w(ee))},[w]),R=i||v,E=s||x,O=fe.useRef(null),k=fe.useRef(null),T=fe.useRef(u),M=AR(l),F=AR(o),z=fe.useCallback(()=>{if(!O.current||!k.current)return;const ee={placement:t,strategy:n,middleware:g};F.current&&(ee.platform=F.current),EY(O.current,k.current,ee).then(q=>{const X={...q,isPositioned:!0};B.current&&!Lp(T.current,X)&&(T.current=X,m4.flushSync(()=>{f(X)}))})},[g,t,n,F]);ap(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(ee=>({...ee,isPositioned:!1})))},[c]);const B=fe.useRef(!1);ap(()=>(B.current=!0,()=>{B.current=!1}),[]),ap(()=>{if(R&&(O.current=R),E&&(k.current=E),R&&E){if(M.current)return M.current(R,E,z);z()}},[R,E,z,M]);const Y=fe.useMemo(()=>({reference:O,floating:k,setReference:_,setFloating:S}),[_,S]),G=fe.useMemo(()=>({reference:R,floating:E}),[R,E]),j=fe.useMemo(()=>{const ee={position:n,left:0,top:0};if(!G.floating)return ee;const q=MR(G.floating,u.x),X=MR(G.floating,u.y);return a?{...ee,transform:"translate("+q+"px, "+X+"px)",...VD(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:X}},[n,a,G.floating,u.x,u.y]);return fe.useMemo(()=>({...u,update:z,refs:Y,elements:G,floatingStyles:j}),[u,z,Y,G,j])}function Dg(e){const[t,n]=m.useState(void 0);return Gn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const HD="Popper",[WD,ii]=Dn(HD),[OY,UD]=WD(HD),$Y=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return m.createElement(OY,{scope:t,anchor:r,onAnchorChange:o},n)},DY="PopperAnchor",TY=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=UD(DY,n),s=m.useRef(null),a=st(t,s);return m.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.createElement(We.div,se({},o,{ref:a}))}),qD="PopperContent",[kY,Nhe]=WD(qD),MY=m.forwardRef((e,t)=>{var n,r,o,i,s,a,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:g=0,align:p="center",alignOffset:v=0,arrowPadding:y=0,avoidCollisions:x=!0,collisionBoundary:w=[],collisionPadding:_=0,sticky:S="partial",hideWhenDetached:R=!1,updatePositionStrategy:E="optimized",onPlaced:O,...k}=e,T=UD(qD,u),[M,F]=m.useState(null),z=st(t,Pe=>F(Pe)),[B,Y]=m.useState(null),G=Dg(B),j=(n=G==null?void 0:G.width)!==null&&n!==void 0?n:0,ee=(r=G==null?void 0:G.height)!==null&&r!==void 0?r:0,q=f+(p!=="center"?"-"+p:""),X=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},re=Array.isArray(w)?w:[w],$=re.length>0,H={padding:X,boundary:re.filter(AY),altBoundary:$},{refs:ne,floatingStyles:I,placement:ce,isPositioned:ge,middlewareData:he}=PY({strategy:"fixed",placement:q,whileElementsMounted:(...Pe)=>CY(...Pe,{animationFrame:E==="always"}),elements:{reference:T.anchor},middleware:[rY({mainAxis:g+ee,alignmentAxis:v}),x&&oY({mainAxis:!0,crossAxis:!1,limiter:S==="partial"?iY():void 0,...H}),x&&eY({...H}),sY({...H,apply:({elements:Pe,rects:$e,availableWidth:Ue,availableHeight:ze})=>{const{width:Ne,height:Xe}=$e.reference,gt=Pe.floating.style;gt.setProperty("--radix-popper-available-width",`${Ue}px`),gt.setProperty("--radix-popper-available-height",`${ze}px`),gt.setProperty("--radix-popper-anchor-width",`${Ne}px`),gt.setProperty("--radix-popper-anchor-height",`${Xe}px`)}}),B&&RY({element:B,padding:y}),IY({arrowWidth:j,arrowHeight:ee}),R&&tY({strategy:"referenceHidden",...H})]}),[de,oe]=GD(ce),Z=Cn(O);Gn(()=>{ge&&(Z==null||Z())},[ge,Z]);const ie=(o=he.arrow)===null||o===void 0?void 0:o.x,ye=(i=he.arrow)===null||i===void 0?void 0:i.y,W=((s=he.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[me,_e]=m.useState();return Gn(()=>{M&&_e(window.getComputedStyle(M).zIndex)},[M]),m.createElement("div",{ref:ne.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:ge?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(a=he.transformOrigin)===null||a===void 0?void 0:a.x,(l=he.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(kY,{scope:u,placedSide:de,onArrowChange:Y,arrowX:ie,arrowY:ye,shouldHideArrow:W},m.createElement(We.div,se({"data-side":de,"data-align":oe},k,{ref:z,style:{...k.style,animation:ge?void 0:"none",opacity:(c=he.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function AY(e){return e!==null}const IY=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:c}=t,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,g=f?0:e.arrowWidth,p=f?0:e.arrowHeight,[v,y]=GD(a),x={start:"0%",center:"50%",end:"100%"}[y],w=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+g/2,_=((i=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+p/2;let S="",R="";return v==="bottom"?(S=f?x:`${w}px`,R=`${-p}px`):v==="top"?(S=f?x:`${w}px`,R=`${l.floating.height+p}px`):v==="right"?(S=`${-p}px`,R=f?x:`${_}px`):v==="left"&&(S=`${l.floating.width+p}px`,R=f?x:`${_}px`),{data:{x:S,y:R}}}});function GD(e){const[t,n="center"]=e.split("-");return[t,n]}const Xd=$Y,Qd=TY,Jd=MY,Tg=m.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?ti.createPortal(m.createElement(We.div,se({},o,{ref:t})),r):null}),YD=m.forwardRef((e,t)=>m.createElement(We.span,se({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),NY=YD,[kg,Lhe]=Dn("Tooltip",[ii]),rw=ii(),LY="TooltipProvider",FY=700,ny="tooltip.open",[zY,ow]=kg(LY),jY=e=>{const{__scopeTooltip:t,delayDuration:n=FY,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=m.useState(!0),l=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),m.createElement(zY,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(u=>{l.current=u},[]),disableHoverableContent:o},i)},iw="Tooltip",[BY,Mg]=kg(iw),VY=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=ow(iw,e.__scopeTooltip),c=rw(t),[u,f]=m.useState(null),g=vr(),p=m.useRef(0),v=s??l.disableHoverableContent,y=a??l.delayDuration,x=m.useRef(!1),[w=!1,_]=Yn({prop:r,defaultProp:o,onChange:k=>{k?(l.onOpen(),document.dispatchEvent(new CustomEvent(ny))):l.onClose(),i==null||i(k)}}),S=m.useMemo(()=>w?x.current?"delayed-open":"instant-open":"closed",[w]),R=m.useCallback(()=>{window.clearTimeout(p.current),x.current=!1,_(!0)},[_]),E=m.useCallback(()=>{window.clearTimeout(p.current),_(!1)},[_]),O=m.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{x.current=!0,_(!0)},y)},[y,_]);return m.useEffect(()=>()=>window.clearTimeout(p.current),[]),m.createElement(Xd,c,m.createElement(BY,{scope:t,contentId:g,open:w,stateAttribute:S,trigger:u,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?O():R()},[l.isOpenDelayed,O,R]),onTriggerLeave:m.useCallback(()=>{v?E():window.clearTimeout(p.current)},[E,v]),onOpen:R,onClose:E,disableHoverableContent:v},n))},IR="TooltipTrigger",KD=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Mg(IR,n),i=ow(IR,n),s=rw(n),a=m.useRef(null),l=st(t,a,o.onTriggerChange),c=m.useRef(!1),u=m.useRef(!1),f=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.createElement(Qd,se({asChild:!0},s),m.createElement(We.button,se({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:Ee(e.onPointerMove,g=>{g.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:Ee(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:Ee(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Ee(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Ee(e.onBlur,o.onClose),onClick:Ee(e.onClick,o.onClose)})))}),HY="TooltipPortal",[Fhe,WY]=kg(HY,{forceMount:void 0}),Zu="TooltipContent",UY=m.forwardRef((e,t)=>{const n=WY(Zu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=Mg(Zu,e.__scopeTooltip);return m.createElement(yn,{present:r||s.open},s.disableHoverableContent?m.createElement(XD,se({side:o},i,{ref:t})):m.createElement(qY,se({side:o},i,{ref:t})))}),qY=m.forwardRef((e,t)=>{const n=Mg(Zu,e.__scopeTooltip),r=ow(Zu,e.__scopeTooltip),o=m.useRef(null),i=st(t,o),[s,a]=m.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:f}=r,g=m.useCallback(()=>{a(null),f(!1)},[f]),p=m.useCallback((v,y)=>{const x=v.currentTarget,w={x:v.clientX,y:v.clientY},_=YY(w,x.getBoundingClientRect()),S=KY(w,_),R=XY(y.getBoundingClientRect()),E=JY([...S,...R]);a(E),f(!0)},[f]);return m.useEffect(()=>()=>g(),[g]),m.useEffect(()=>{if(l&&u){const v=x=>p(x,u),y=x=>p(x,l);return l.addEventListener("pointerleave",v),u.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",v),u.removeEventListener("pointerleave",y)}}},[l,u,p,g]),m.useEffect(()=>{if(s){const v=y=>{const x=y.target,w={x:y.clientX,y:y.clientY},_=(l==null?void 0:l.contains(x))||(u==null?void 0:u.contains(x)),S=!QY(w,s);_?g():S&&(g(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,u,s,c,g]),m.createElement(XD,se({},e,{ref:i}))}),[GY,zhe]=kg(iw,{isInside:!1}),XD=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Mg(Zu,n),c=rw(n),{onClose:u}=l;return m.useEffect(()=>(document.addEventListener(ny,u),()=>document.removeEventListener(ny,u)),[u]),m.useEffect(()=>{if(l.trigger){const f=g=>{const p=g.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),m.createElement(xc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:u},m.createElement(Jd,se({"data-state":l.stateAttribute},c,a,{ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),m.createElement(_$,null,r),m.createElement(GY,{scope:n,isInside:!0},m.createElement(NY,{id:l.contentId,role:"tooltip"},o||r))))});function YY(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function KY(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function XY(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function QY(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function JY(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),ZY(t)}function ZY(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const eK=jY,tK=VY,nK=KD,QD=UY,rK=eK,JD=tK,ZD=nK,sw=fe.forwardRef(({className:e,sideOffset:t=4,...n},r)=>N.jsx(QD,{ref:r,sideOffset:t,className:Oe("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));sw.displayName=QD.displayName;/**
133
+ * @license lucide-react v0.379.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const oK=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),eT=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
138
+ * @license lucide-react v0.379.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */var iK={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
143
+ * @license lucide-react v0.379.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const sK=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>m.createElement("svg",{ref:l,...iK,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:eT("lucide",o),...a},[...s.map(([c,u])=>m.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
148
+ * @license lucide-react v0.379.0 - ISC
149
+ *
150
+ * This source code is licensed under the ISC license.
151
+ * See the LICENSE file in the root directory of this source tree.
152
+ */const xr=(e,t)=>{const n=m.forwardRef(({className:r,...o},i)=>m.createElement(sK,{ref:i,iconNode:t,className:eT(`lucide-${oK(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
153
+ * @license lucide-react v0.379.0 - ISC
154
+ *
155
+ * This source code is licensed under the ISC license.
156
+ * See the LICENSE file in the root directory of this source tree.
157
+ */const tT=xr("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
158
+ * @license lucide-react v0.379.0 - ISC
159
+ *
160
+ * This source code is licensed under the ISC license.
161
+ * See the LICENSE file in the root directory of this source tree.
162
+ */const Zd=xr("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
163
+ * @license lucide-react v0.379.0 - ISC
164
+ *
165
+ * This source code is licensed under the ISC license.
166
+ * See the LICENSE file in the root directory of this source tree.
167
+ */const Ag=xr("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
168
+ * @license lucide-react v0.379.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */const aK=xr("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
173
+ * @license lucide-react v0.379.0 - ISC
174
+ *
175
+ * This source code is licensed under the ISC license.
176
+ * See the LICENSE file in the root directory of this source tree.
177
+ */const nT=xr("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
178
+ * @license lucide-react v0.379.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */const lK=xr("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
183
+ * @license lucide-react v0.379.0 - ISC
184
+ *
185
+ * This source code is licensed under the ISC license.
186
+ * See the LICENSE file in the root directory of this source tree.
187
+ */const rT=xr("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
188
+ * @license lucide-react v0.379.0 - ISC
189
+ *
190
+ * This source code is licensed under the ISC license.
191
+ * See the LICENSE file in the root directory of this source tree.
192
+ */const cK=xr("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
193
+ * @license lucide-react v0.379.0 - ISC
194
+ *
195
+ * This source code is licensed under the ISC license.
196
+ * See the LICENSE file in the root directory of this source tree.
197
+ */const aw=xr("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
198
+ * @license lucide-react v0.379.0 - ISC
199
+ *
200
+ * This source code is licensed under the ISC license.
201
+ * See the LICENSE file in the root directory of this source tree.
202
+ */const uK=xr("MessageCircleMore",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M8 12h.01",key:"czm47f"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M16 12h.01",key:"1l6xoz"}]]);/**
203
+ * @license lucide-react v0.379.0 - ISC
204
+ *
205
+ * This source code is licensed under the ISC license.
206
+ * See the LICENSE file in the root directory of this source tree.
207
+ */const oT=xr("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
208
+ * @license lucide-react v0.379.0 - ISC
209
+ *
210
+ * This source code is licensed under the ISC license.
211
+ * See the LICENSE file in the root directory of this source tree.
212
+ */const dK=xr("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);/**
213
+ * @license lucide-react v0.379.0 - ISC
214
+ *
215
+ * This source code is licensed under the ISC license.
216
+ * See the LICENSE file in the root directory of this source tree.
217
+ */const lw=xr("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function ry({number:e,format:t,useSuffix:n=!1,customSuffix:r="",currency:o="",locale:i="en-US"}){let s=1,a=r,l=i;const c=t.includes(".")?t.split(".")[1].length:0;n&&!r&&(e>=1e9?(s=1e9,a="B"):e>=1e7&&i==="en-IN"?(s=1e7,a="Cr"):e>=1e5&&i==="en-IN"?(s=1e5,a="L"):e>=1e6?(s=1e6,a="M"):e>=1e3&&(s=1e3,a="K"));const u=e/s,f={maximumFractionDigits:c,minimumFractionDigits:c};if(o){f.style="currency",f.currency=o;try{new Intl.NumberFormat("en-US",f).format(0)}catch{f.currency="USD"}}try{new Intl.NumberFormat(i,f).format(0)}catch{l="en-US"}let p=new Intl.NumberFormat(l,f).format(u);return n&&(p+=a),p}function iT({card:e,isLoading:t}){var x,w,_,S,R,E,O,k,T,M,F,z,B,Y,G,j,ee,q;const n=Te(X=>X.actions.setCardTitle),r=Te(X=>X.actions.setCardDescription),o=Te(X=>X.isVisualEditing),i=so(X=>X.card),s=so(X=>X.actions.setCard);so(X=>X.actions.setNumberFormat);const a=Te(X=>X.selectedSheetId),l=e.data,{metricKeys:c}=uo(l||[]),u=(x=l==null?void 0:l[0])==null?void 0:x[c==null?void 0:c[0]],f=(w=l==null?void 0:l[0])==null?void 0:w[c==null?void 0:c[1]],g=!!e.data&&e.data.length>0;function p(X){o?s({...i,title:X}):n(a,e.id,X)}function v(X){o?s({...i,description:X}):r(a,e.id,X)}const y=f&&f-u!==0?(u-f)/f:null;return N.jsxs("div",{className:"kpi-card flex grow flex-col overflow-scroll",children:[N.jsxs(ag,{className:"grow pb-3",children:[N.jsx(Ma,{text:o?i.title:e.title,onSave:p,children:N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx(Vd,{className:"text-base font-medium text-muted-foreground",children:e.title}),!e.refreshInterval&&t&&N.jsx(aw,{className:"h-4 w-4 animate-spin text-muted-foreground"})]})}),g&&N.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[N.jsx("p",{className:"text-3xl font-semibold",children:ry({number:u,format:((S=(_=e.preferences)==null?void 0:_.formatNumber)==null?void 0:S.format)||"",useSuffix:!!((E=(R=e.preferences)==null?void 0:R.formatNumber)!=null&&E.suffix),customSuffix:"",locale:((k=(O=e.preferences)==null?void 0:O.formatNumber)==null?void 0:k.locale)||"",currency:((M=(T=e.preferences)==null?void 0:T.formatNumber)==null?void 0:M.currency)||""})}),f&&N.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from  ",ry({number:f,format:((z=(F=e.preferences)==null?void 0:F.formatNumber)==null?void 0:z.format)||"",useSuffix:!!((Y=(B=e.preferences)==null?void 0:B.formatNumber)!=null&&Y.suffix),customSuffix:"",locale:((j=(G=e.preferences)==null?void 0:G.formatNumber)==null?void 0:j.locale)||"",currency:((q=(ee=e.preferences)==null?void 0:ee.formatNumber)==null?void 0:q.currency)||""})]})]})]}),y&&N.jsxs(lg,{className:"grow items-start gap-1 pb-4 text-sm",children:[N.jsx(fK,{children:y}),N.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[y>0?"up ":"down ",N.jsx(Ma,{text:e.description||"",onSave:v,children:e.description})]})]})]})}function fK({children:e}){const t=e>0?N.jsx(Kx,{className:"h-4 w-4"}):N.jsx(Yx,{className:"h-4 w-4"}),n=`${Math.abs(e*100).toFixed(0)}%`;return N.jsxs("div",{className:Oe("flex items-center",{"text-green-600":e>0,"text-destructive":e<0}),children:[t,N.jsx("span",{className:"ml-[1px]",children:n})]})}var uc=1e3,dc=uc*60,fc=dc*60,Fa=fc*24,hK=Fa*7,pK=Fa*365.25,gK=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return mK(e);if(n==="number"&&isFinite(e))return t.long?bK(e):vK(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function mK(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*pK;case"weeks":case"week":case"w":return n*hK;case"days":case"day":case"d":return n*Fa;case"hours":case"hour":case"hrs":case"hr":case"h":return n*fc;case"minutes":case"minute":case"mins":case"min":case"m":return n*dc;case"seconds":case"second":case"secs":case"sec":case"s":return n*uc;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function vK(e){var t=Math.abs(e);return t>=Fa?Math.round(e/Fa)+"d":t>=fc?Math.round(e/fc)+"h":t>=dc?Math.round(e/dc)+"m":t>=uc?Math.round(e/uc)+"s":e+"ms"}function bK(e){var t=Math.abs(e);return t>=Fa?Oh(e,t,Fa,"day"):t>=fc?Oh(e,t,fc,"hour"):t>=dc?Oh(e,t,dc,"minute"):t>=uc?Oh(e,t,uc,"second"):e+" ms"}function Oh(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const yK=vc(gK);function sT({children:e}){const{setIsSessionExpired:t}=Li(),n=new Q9({queryCache:new h$({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});return N.jsx(t8,{client:n,children:e})}const xK={id:"",authToken:void 0},aT=m.createContext(xK),lT=({children:e,dashboardProps:t})=>N.jsx(sT,{children:N.jsx(aT.Provider,{value:t,children:e})});function Ua(){const e=m.useContext(aT);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function wK(e){Te(c=>c.bookmarkKey);const t=Te(c=>c.dashboard.baseQueries),{authToken:n}=Ua(),r=Te(c=>c.authToken),o=Te(c=>c.filterValues),i=Te(c=>c.isDashboardEditing),s=yK((e==null?void 0:e.refreshInterval)||"0"),a=qO(e.sql,t);return Bd({queryKey:[e.id,a],queryFn:()=>Fd("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||(r==null?void 0:r.accessToken)||"",{connection_id:e.connectionId,sql:a,python:e.python===i$?"":e.python,active_filters:o}),refetchInterval:s,enabled:!!e.connectionId&&!i})}function yl({data:e,cfg:t,customCfg:n,preferences:r}){var w,_,S,R,E,O,k,T,M;const{dimensionKeys:o,metricKeys:i}=uo(e),s=MG(i,e,r),a=Q0(s,n),l=o[0],c=kD(e,l),u=cT(r),f=_K(r),g={...t==null?void 0:t.options,scales:{...(w=t==null?void 0:t.options)==null?void 0:w.scales,[u]:{...(S=(_=t==null?void 0:t.options)==null?void 0:_.scales)==null?void 0:S[u],ticks:{...(O=(E=(R=t==null?void 0:t.options)==null?void 0:R.scales)==null?void 0:E[u])==null?void 0:O.ticks,callback:F=>{var z,B,Y,G;return ry({number:Number(F),format:((z=r==null?void 0:r.numberAxisFormat)==null?void 0:z.format)||"",useSuffix:!!((B=r==null?void 0:r.numberAxisFormat)!=null&&B.suffix),customSuffix:"",locale:((Y=r==null?void 0:r.numberAxisFormat)==null?void 0:Y.locale)||"",currency:((G=r==null?void 0:r.numberAxisFormat)==null?void 0:G.currency)||""})}}},[f]:{...(M=(T=(k=t==null?void 0:t.options)==null?void 0:k.scales)==null?void 0:T[f])==null?void 0:M.ticks,callback:null}}},p=ki.merge((t==null?void 0:t.options)||{},r==null?void 0:r.chartOptions),v=ki.merge(g,p),y=J0(v,(n==null?void 0:n.options)||{});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:c,datasets:a},options:y}}function cT(e){var n,r;return(n=e==null?void 0:e.chartOptions)!=null&&n.indexAxis?((r=e==null?void 0:e.chartOptions)==null?void 0:r.indexAxis)==="x"?"y":"x":"y"}function _K(e){var n,r;return(n=e==null?void 0:e.chartOptions)!=null&&n.indexAxis?((r=e==null?void 0:e.chartOptions)==null?void 0:r.indexAxis)==="x"?"x":"y":"x"}function SK(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}}}}}function CK(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function EK(e){var n,r,o,i;return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{...(r=(n=e==null?void 0:e.options)==null?void 0:n.scales)==null?void 0:r.x,display:!0,stacked:!0},y:{...(i=(o=e==null?void 0:e.options)==null?void 0:o.scales)==null?void 0:i.y,display:!0,stacked:!0}}}}}function RK(e){return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function PK(e,t){return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}}}}}function OK(e){return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}}}}}function cw({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s}){if(t==="bar"){const a=CK(n);return yl({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="horizontalBar"){const a=SK(n);return yl({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="stackedBar"){const a=EK(n),{dimensionKeys:l,metricKeys:c}=uo(e),u=Xx({dataArray:e,groupKey:l[0],pivotKey:l[1],valueKey:c[0]});return yl({data:u,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="line"){const a=RK(n);return yl({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="pie"||t==="doughnut"||t==="polarArea"){const a=PK(t,n),{dimensionKeys:l,metricKeys:c}=uo(e),u=NG(c,e),f=Q0(u,r),g=l[0],p=kD(e,g),v=J0((a==null?void 0:a.options)||{},(r==null?void 0:r.options)||{});return{type:t,data:{labels:p,datasets:f},options:v}}if(t==="radar"){const a=OK(n);return yl({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:a}=uo(e);if(a.length<3){console.log("Bubble charts require 3 numeric columns");return}const l=IG(e),c=Q0(l,r),u={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:a[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:a[1]},beginAtZero:!0,ticks:{precision:0}}}},f=J0(u,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:c},options:f}}return yl({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}function $K({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const s=Te.getState().theme;if(!o)return;const a=s==="dark"?"rgb(238,238,238,0.2)":"rgb(238,238,238,0.8)";["bar","line","horizontalBar","bubble","scatter"].includes(r)&&TK(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&kK(e,t,o,i,a),r==="stackedBar"&&DK({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function DK(e){var a,l,c,u;const{chart:t,elementIndex:n,datasetIndex:r,cfg:o,apply:i,blurColor:s}=e;i?(l=(a=t==null?void 0:t.data)==null?void 0:a.datasets)==null||l.forEach((f,g)=>{var p,v;typeof f.backgroundColor=="string"&&(f.backgroundColor=new Array(f.data.length).fill(f.backgroundColor),f.borderColor=new Array(f.data.length).fill(f.borderColor)),f.backgroundColor=(p=f==null?void 0:f.backgroundColor)==null?void 0:p.map((y,x)=>x===n&&g===r?y:s),f.borderColor=(v=f==null?void 0:f.borderColor)==null?void 0:v.map((y,x)=>x===n&&g===r?y:s)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((f,g)=>{var p,v,y,x,w,_;f.backgroundColor=new Array(f.data.length).fill((y=(v=(p=o==null?void 0:o.data)==null?void 0:p.datasets)==null?void 0:v[g])==null?void 0:y.backgroundColor),f.borderColor=new Array(f.data.length).fill((_=(w=(x=o==null?void 0:o.data)==null?void 0:x.datasets)==null?void 0:w[g])==null?void 0:_.borderColor)}),t==null||t.update()}function TK(e,t,n,r,o){var i,s,a,l;console.log("clicked index",t),r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,f;typeof c.backgroundColor=="string"&&(c.backgroundColor=new Array(c.data.length).fill(c.backgroundColor),c.borderColor=new Array(c.data.length).fill(c.borderColor)),c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((g,p)=>p===t?g:o),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((g,p)=>p===t?g:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var f,g,p,v,y,x;c.backgroundColor=new Array(c.data.length).fill((p=(g=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:g[u])==null?void 0:p.backgroundColor),c.borderColor=new Array(c.data.length).fill((x=(y=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:y[u])==null?void 0:x.borderColor)}),e==null||e.update()}function kK(e,t,n,r,o){var i,s,a,l;r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,f;c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((g,p)=>p===t?g:o),c.borderColor=(f=c==null?void 0:c.borderColor)==null?void 0:f.map((g,p)=>p===t?g:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var f,g,p,v,y,x,w,_;typeof c.backgroundColor=="string"&&(c.backgroundColor=(p=(g=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:g[u])==null?void 0:p.backgroundColor,c.borderColor=(x=(y=(v=n==null?void 0:n.data)==null?void 0:v.datasets)==null?void 0:y[u])==null?void 0:x.borderColor),c.backgroundColor=(w=c==null?void 0:c.backgroundColor)==null?void 0:w.map((S,R)=>{var E;return(E=n.data.datasets[u].backgroundColor)==null?void 0:E[R]}),c.borderColor=(_=c==null?void 0:c.borderColor)==null?void 0:_.map((S,R)=>{var E;return(E=n.data.datasets[u].borderColor)==null?void 0:E[R]})}),e==null||e.update()}function MK(e,t,n,r){var o,i;try{if(!e||!e.data)return;const{dimensionKeys:s,metricKeys:a}=uo(e.data);if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const l=s[0],c=(o=e.data[n])==null?void 0:o[l];return[{columnName:l,columnValue:c,metric:a[t],value:r}]}if(e.type==="stackedBar"){const l=Xx({dataArray:e.data,groupKey:s[0],pivotKey:s[1],valueKey:a[0]}),c=s[0],u=(i=l[n])==null?void 0:i[c],f=s[1],{metricKeys:g}=uo(l),p=g[t];return[{columnName:c,columnValue:u,metric:a[0],value:r},{columnName:f,columnValue:p,metric:a[0],value:r}]}if(e.type==="bubble"||e.type==="scatter"){const l=s[0],c=r.label;return[{columnName:l,columnValue:c,metric1:a[0],value1:r.x,metric2:a[1],value2:r.y,metric3:a==null?void 0:a[2],value3:r==null?void 0:r.r}]}}catch(s){console.error("Error in getAdhocFilter",s)}}function AK(e){var s,a;const[t]=m.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=Li(),r=n(e),o=uw(r||t),i={...r,data:((s=o==null?void 0:o.data)==null?void 0:s.records)||[]};return{...o,data:((a=o==null?void 0:o.data)==null?void 0:a.records)||[],card:i}}function uw(e){var z,B,Y;const{onChartElementClicked:t}=Ua(),[n,r]=m.useState(0),o=((z=e==null?void 0:e.preferences)==null?void 0:z.filterOnClickColumnIndex)===void 0?0:(B=e.preferences)==null?void 0:B.filterOnClickColumnIndex,i=Te(G=>G.bookmarkKey);Te(G=>G.isVisualEditing);const s=Te(G=>G.filteringCards),a=Te(G=>G.selectedSheetId);Te(G=>G.selectedCardId),Te(G=>G.isDashboardEditing);const l=Te(G=>G.themeStyle),c=Te(G=>G.filterValues),u=(Y=e==null?void 0:e.preferences)==null?void 0:Y.onClickFilter,{addFrame:f,addFilteringCard:g,setFrameCardData:p,getSelectedFrame:v,addOrUpdateFilterValue:y,addOrUpdateFilterValues:x,removeFilterValue:w,removeFilteringCard:_}=Li(),{data:S,isLoading:R,isFetching:E,isError:O,refetch:k}=wK(e),T=s==null?void 0:s.find(G=>G.id===e.id);let M;e.data&&e.data.length>0&&(M=cw({data:e.data,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences})),m.useEffect(()=>{!S||!S.records||p(a,e.id,(S==null?void 0:S.records)||[])},[S,a,e.id,p,c]),m.useEffect(()=>{e.data&&r(n+1)},[e.data,e.type,e.cfg,e.customCfg,e.preferences,l]),m.useEffect(()=>{e.connectionId&&!T&&k()},[c,i]);function F(G,j,ee,q){var $,H;let X=!1;if(!e.data)return;const re=MK(e,j,ee,q);if(t==null||t(e,re),!!((($=e==null?void 0:e.preferences)==null?void 0:$.onClickFilter)??[]).length){if(T){const ne=e.id;w(ne),_(e)}else{if(X=!0,!re)return;const ne=[];re.forEach((I,ce)=>{const ge=u==null?void 0:u.find(de=>de.columnIndex===ce);if(!ge)return;const he={filterId:e.id+"-"+I.columnName,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:I.columnName,expression:ge.expression,valueType:Bu(re[ge.columnIndex].columnValue),operation:"=",values:[re[ge.columnIndex].columnValue]};ne.push(he)}),e.id,e==null||e.connectionId,e.lastSelectedTable,re[o].columnName,(H=e.preferences)==null||H.filterOnClickField,Bu(re[o].columnValue),re[o].columnValue,x(ne),g(e)}$K({chart:G,elementIndex:ee,datasetIndex:j,cardType:e.type,cfg:M,apply:X})}}return{isError:O,isLoading:R,isFetching:E,data:S,visualKey:n,handleDatapointClick:F,cfg:M}}function IK(e,t){const n=Te(u=>u.selectedSheetId),r=Te(u=>u.selectedFrameId),o=Te(u=>u.isDashboardEditing),i=Te(u=>u.isVisualEditing),{addFrame:s,getSelectedFrame:a,setSelectedFrameId:l}=Te(u=>u.actions);m.useEffect(()=>{const u=g=>{if(o&&((g.metaKey||g.ctrlKey)&&g.key==="c"&&navigator.clipboard.writeText(JSON.stringify(a())),(g.ctrlKey||g.metaKey)&&g.key==="v"))try{navigator.clipboard.readText().then(p=>{try{const v=JSON.parse(p);if(v&&v.id){v.id=Na();const y=v.activeCardId;v.cards.forEach(x=>{const w=x.id;x.id=Na(),w===y&&(v.activeCardId=x.id,x.title=`${x.title} (Copy)`)}),s(n,v),l(v.id)}}catch(v){console.error("Failed to parse clipboard contents: ",v)}})}catch(p){console.error("Failed to read clipboard contents: ",p)}},f=t==null?void 0:t.current;return f==null||f.addEventListener("keydown",u),()=>{f==null||f.removeEventListener("keydown",u)}},[o,n,a,s,t,l]),m.useEffect(()=>{r===e.id&&o&&!i&&c()},[r,e.id,o,i]);function c(){const u=t==null?void 0:t.current;u==null||u.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}let nb;const uT="HoverCard",[dT,jhe]=Dn(uT,[ii]),dw=ii(),[NK,fw]=dT(uT),LK=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=dw(t),c=m.useRef(0),u=m.useRef(0),f=m.useRef(!1),g=m.useRef(!1),[p=!1,v]=Yn({prop:r,defaultProp:o,onChange:i}),y=m.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>v(!0),s)},[s,v]),x=m.useCallback(()=>{clearTimeout(c.current),!f.current&&!g.current&&(u.current=window.setTimeout(()=>v(!1),a))},[a,v]),w=m.useCallback(()=>v(!1),[v]);return m.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),m.createElement(NK,{scope:t,open:p,onOpenChange:v,onOpen:y,onClose:x,onDismiss:w,hasSelectionRef:f,isPointerDownOnContentRef:g},m.createElement(Xd,l,n))},FK="HoverCardTrigger",zK=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=fw(FK,n),i=dw(n);return m.createElement(Qd,se({asChild:!0},i),m.createElement(We.a,se({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:Ee(e.onPointerEnter,Fp(o.onOpen)),onPointerLeave:Ee(e.onPointerLeave,Fp(o.onClose)),onFocus:Ee(e.onFocus,o.onOpen),onBlur:Ee(e.onBlur,o.onClose),onTouchStart:Ee(e.onTouchStart,s=>s.preventDefault())})))}),jK="HoverCardPortal",[Bhe,BK]=dT(jK,{forceMount:void 0}),oy="HoverCardContent",VK=m.forwardRef((e,t)=>{const n=BK(oy,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=fw(oy,e.__scopeHoverCard);return m.createElement(yn,{present:r||i.open},m.createElement(HK,se({"data-state":i.open?"open":"closed"},o,{onPointerEnter:Ee(e.onPointerEnter,Fp(i.onOpen)),onPointerLeave:Ee(e.onPointerLeave,Fp(i.onClose)),ref:t})))}),HK=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=fw(oy,n),c=dw(n),u=m.useRef(null),f=st(t,u),[g,p]=m.useState(!1);return m.useEffect(()=>{if(g){const v=document.body;return nb=v.style.userSelect||v.style.webkitUserSelect,v.style.userSelect="none",v.style.webkitUserSelect="none",()=>{v.style.userSelect=nb,v.style.webkitUserSelect=nb}}},[g]),m.useEffect(()=>{if(u.current){const v=()=>{p(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var y;((y=document.getSelection())===null||y===void 0?void 0:y.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",v),()=>{document.removeEventListener("pointerup",v),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),m.useEffect(()=>{u.current&&WK(u.current).forEach(y=>y.setAttribute("tabindex","-1"))}),m.createElement(xc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Ee(i,v=>{v.preventDefault()}),onDismiss:l.onDismiss},m.createElement(Jd,se({},c,a,{onPointerDown:Ee(a.onPointerDown,v=>{v.currentTarget.contains(v.target)&&p(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:f,style:{...a.style,userSelect:g?"text":void 0,WebkitUserSelect:g?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})))});function Fp(e){return t=>t.pointerType==="touch"?void 0:e()}function WK(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}const UK=LK,qK=zK,fT=VK,hT=UK,pT=qK,hw=fe.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>N.jsx(fT,{ref:o,align:t,sideOffset:n,className:Oe("z-50 w-64 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));hw.displayName=fT.displayName;function GK({card:e}){const{setCardInfo:t}=Li();return N.jsxs(hT,{openDelay:0,children:[N.jsx(pT,{children:N.jsx(cK,{className:"size-4 text-muted-foreground/40"})}),N.jsx(hw,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:N.jsx(Ma,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:N.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Add Info"})})})]})}const pw=fe.forwardRef(({className:e,...t},n)=>N.jsx("div",{className:"relative w-full overflow-auto",children:N.jsx("table",{ref:n,className:Oe("w-full caption-bottom text-sm",e),...t})}));pw.displayName="Table";const gw=fe.forwardRef(({className:e,...t},n)=>N.jsx("thead",{ref:n,className:Oe("[&_tr]:border-b",e),...t}));gw.displayName="TableHeader";const mw=fe.forwardRef(({className:e,...t},n)=>N.jsx("tbody",{ref:n,className:Oe("[&_tr:last-child]:border-0",e),...t}));mw.displayName="TableBody";const YK=fe.forwardRef(({className:e,...t},n)=>N.jsx("tfoot",{ref:n,className:Oe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));YK.displayName="TableFooter";const Mu=fe.forwardRef(({className:e,...t},n)=>N.jsx("tr",{ref:n,className:Oe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Mu.displayName="TableRow";const vw=fe.forwardRef(({className:e,...t},n)=>N.jsx("th",{ref:n,className:Oe("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));vw.displayName="TableHead";const zp=fe.forwardRef(({className:e,...t},n)=>N.jsx("td",{ref:n,className:Oe("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));zp.displayName="TableCell";const KK=fe.forwardRef(({className:e,...t},n)=>N.jsx("caption",{ref:n,className:Oe("mt-4 text-sm text-muted-foreground",e),...t}));KK.displayName="TableCaption";/**
218
+ * table-core
219
+ *
220
+ * Copyright (c) TanStack
221
+ *
222
+ * This source code is licensed under the MIT license found in the
223
+ * LICENSE.md file in the root directory of this source tree.
224
+ *
225
+ * @license MIT
226
+ */function ys(e,t){return typeof e=="function"?e(t):e}function Wr(e,t){return n=>{t.setState(r=>({...r,[e]:ys(n,r[e])}))}}function jp(e){return e instanceof Function}function XK(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function QK(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function tt(e,t,n){let r=[],o;return()=>{let i;n.key&&n.debug&&(i=Date.now());const s=e();if(!(s.length!==r.length||s.some((c,u)=>r[u]!==c)))return o;r=s;let l;if(n.key&&n.debug&&(l=Date.now()),o=t(...s),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-i)*100)/100,u=Math.round((Date.now()-l)*100)/100,f=u/16,g=(p,v)=>{for(p=String(p);p.length<v;)p=" "+p;return p};console.info(`%c⏱ ${g(u,5)} /${g(c,5)} ms`,`
227
+ font-size: .6rem;
228
+ font-weight: bold;
229
+ color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function JK(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?l.replace(".","_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=g=>{let p=g;for(const y of l.split(".")){var v;p=(v=p)==null?void 0:v[y],process.env.NODE_ENV!=="production"&&p===void 0&&console.warn(`"${y}" in deeply nested key "${l}" returned undefined.`)}return p}:u=g=>g[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let f={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:tt(()=>[!0],()=>{var g;return[f,...(g=f.columns)==null?void 0:g.flatMap(p=>p.getFlatColumns())]},{key:process.env.NODE_ENV==="production"&&"column.getFlatColumns",debug:()=>{var g;return(g=e.options.debugAll)!=null?g:e.options.debugColumns}}),getLeafColumns:tt(()=>[e._getOrderColumnsFn()],g=>{var p;if((p=f.columns)!=null&&p.length){let v=f.columns.flatMap(y=>y.getLeafColumns());return g(v)}return[f]},{key:process.env.NODE_ENV==="production"&&"column.getLeafColumns",debug:()=>{var g;return(g=e.options.debugAll)!=null?g:e.options.debugColumns}})};for(const g of e._features)g.createColumn==null||g.createColumn(f,e);return f}function NR(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const ZK={createTable:e=>{e.getHeaderGroups=tt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r==null?void 0:r.map(f=>n.find(g=>g.id===f)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(f=>n.find(g=>g.id===f)).filter(Boolean))!=null?s:[],c=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(o!=null&&o.includes(f.id)));return $h(t,[...a,...c,...l],e)},{key:process.env.NODE_ENV==="development"&&"getHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterHeaderGroups=tt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),$h(t,n,e,"center")),{key:process.env.NODE_ENV==="development"&&"getCenterHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftHeaderGroups=tt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return $h(t,i,e,"left")},{key:process.env.NODE_ENV==="development"&&"getLeftHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightHeaderGroups=tt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return $h(t,i,e,"right")},{key:process.env.NODE_ENV==="development"&&"getRightHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getFooterGroups=tt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftFooterGroups=tt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getLeftFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterFooterGroups=tt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getCenterFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightFooterGroups=tt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),{key:process.env.NODE_ENV==="development"&&"getRightFooterGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getFlatHeaders=tt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftFlatHeaders=tt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getLeftFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterFlatHeaders=tt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getCenterFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightFlatHeaders=tt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),{key:process.env.NODE_ENV==="development"&&"getRightFlatHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterLeafHeaders=tt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getCenterLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeftLeafHeaders=tt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getLeftLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getRightLeafHeaders=tt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),{key:process.env.NODE_ENV==="development"&&"getRightLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getLeafHeaders=tt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},{key:process.env.NODE_ENV==="development"&&"getLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})}};function $h(e,t,n,r){var o,i;let s=0;const a=function(g,p){p===void 0&&(p=1),s=Math.max(s,p),g.filter(v=>v.getIsVisible()).forEach(v=>{var y;(y=v.columns)!=null&&y.length&&a(v.columns,p+1)},0)};a(e);let l=[];const c=(g,p)=>{const v={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},y=[];g.forEach(x=>{const w=[...y].reverse()[0],_=x.column.depth===v.depth;let S,R=!1;if(_&&x.column.parent?S=x.column.parent:(S=x.column,R=!0),w&&(w==null?void 0:w.column)===S)w.subHeaders.push(x);else{const E=NR(n,S,{id:[r,p,S.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${y.filter(O=>O.column===S).length}`:void 0,depth:p,index:y.length});E.subHeaders.push(x),y.push(E)}v.headers.push(x),x.headerGroup=v}),l.push(v),p>0&&c(y,p-1)},u=t.map((g,p)=>NR(n,g,{depth:s,index:p}));c(u,s-1),l.reverse();const f=g=>g.filter(v=>v.column.getIsVisible()).map(v=>{let y=0,x=0,w=[0];v.subHeaders&&v.subHeaders.length?(w=[],f(v.subHeaders).forEach(S=>{let{colSpan:R,rowSpan:E}=S;y+=R,w.push(E)})):y=1;const _=Math.min(...w);return x=x+_,v.colSpan=y,v.rowSpan=x,{colSpan:y,rowSpan:x}});return f((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const Dh={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},rb=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),eX={getDefaultColumnDef:()=>Dh,getInitialState:e=>({columnSizing:{},columnSizingInfo:rb(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Wr("columnSizing",e),onColumnSizingInfoChange:Wr("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Dh.minSize,(r=i??e.columnDef.size)!=null?r:Dh.size),(o=e.columnDef.maxSize)!=null?o:Dh.maxSize)},e.getStart=n=>{const r=n?n==="left"?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),o=r.findIndex(i=>i.id===e.id);if(o>0){const i=r[o-1];return i.getStart(n)+i.getSize()}return 0},e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),ob(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],l=ob(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(w,_)=>{typeof _=="number"&&(t.setColumnSizingInfo(S=>{var R,E;const O=t.options.columnResizeDirection==="rtl"?-1:1,k=(_-((R=S==null?void 0:S.startOffset)!=null?R:0))*O,T=Math.max(k/((E=S==null?void 0:S.startSize)!=null?E:0),-.999999);return S.columnSizingStart.forEach(M=>{let[F,z]=M;c[F]=Math.round(Math.max(z+z*T,0)*100)/100}),{...S,deltaOffset:k,deltaPercentage:T}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(S=>({...S,...c})))},f=w=>u("move",w),g=w=>{u("end",w),t.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,v={moveHandler:w=>f(w.clientX),upHandler:w=>{p==null||p.removeEventListener("mousemove",v.moveHandler),p==null||p.removeEventListener("mouseup",v.upHandler),g(w.clientX)}},y={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),f(w.touches[0].clientX),!1),upHandler:w=>{var _;p==null||p.removeEventListener("touchmove",y.moveHandler),p==null||p.removeEventListener("touchend",y.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),g((_=w.touches[0])==null?void 0:_.clientX)}},x=tX()?{passive:!1}:!1;ob(i)?(p==null||p.addEventListener("touchmove",y.moveHandler,x),p==null||p.addEventListener("touchend",y.upHandler,x)):(p==null||p.addEventListener("mousemove",v.moveHandler,x),p==null||p.addEventListener("mouseup",v.upHandler,x)),t.setColumnSizingInfo(w=>({...w,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?rb():(n=e.initialState.columnSizingInfo)!=null?n:rb())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Th=null;function tX(){if(typeof Th=="boolean")return Th;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Th=e,Th}function ob(e){return e.type==="touchstart"}const nX={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Wr("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},gT=(e,t,n)=>{var r;const o=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(o))};gT.autoRemove=e=>Ro(e);const mT=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};mT.autoRemove=e=>Ro(e);const vT=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};vT.autoRemove=e=>Ro(e);const bT=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};bT.autoRemove=e=>Ro(e)||!(e!=null&&e.length);const yT=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});yT.autoRemove=e=>Ro(e)||!(e!=null&&e.length);const xT=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});xT.autoRemove=e=>Ro(e)||!(e!=null&&e.length);const wT=(e,t,n)=>e.getValue(t)===n;wT.autoRemove=e=>Ro(e);const _T=(e,t,n)=>e.getValue(t)==n;_T.autoRemove=e=>Ro(e);const bw=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};bw.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};bw.autoRemove=e=>Ro(e)||Ro(e[0])&&Ro(e[1]);const yi={includesString:gT,includesStringSensitive:mT,equalsString:vT,arrIncludes:bT,arrIncludesAll:yT,arrIncludesSome:xT,equals:wT,weakEquals:_T,inNumberRange:bw};function Ro(e){return e==null||e===""}const rX={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Wr("columnFilters",e),onGlobalFilterChange:Wr("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?yi.includesString:typeof r=="number"?yi.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?yi.equals:Array.isArray(r)?yi.arrIncludes:yi.weakEquals},e.getFilterFn=()=>{var n,r;return jp(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:yi[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(u=>u.id===e.id),s=ys(n,i?i.value:void 0);if(LR(o,s,e)){var a;return(a=r==null?void 0:r.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r==null?void 0:r.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})},e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>yi.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return jp(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:yi[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=ys(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(LR(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};function LR(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const oX=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),iX=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},sX=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},aX=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},lX=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},cX=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!XK(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},uX=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),dX=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,fX=(e,t)=>t.length,ib={sum:oX,min:iX,max:sX,extent:aX,mean:lX,median:cX,unique:uX,uniqueCount:dX,count:fX},hX={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Wr("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r,o,i;return(n=(r=(o=(i=e.columnDef.enableGrouping)!=null?i:!0)!=null?o:t.options.enableGrouping)!=null?r:!0)!=null?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return ib.sum;if(Object.prototype.toString.call(r)==="[object Date]")return ib.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return jp(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:ib[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function pX(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const gX={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Wr("columnOrder",e)}),createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=tt(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return pX(i,n,r)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},iy=0,sy=10,sb=()=>({pageIndex:iy,pageSize:sy}),mX={getInitialState:e=>({...e,pagination:{...sb(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Wr("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>ys(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?sb():(o=e.initialState.pagination)!=null?o:sb())},e.setPageIndex=r=>{e.setPagination(o=>{let i=ys(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?iy:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:iy)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?sy:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:sy)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,ys(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=ys(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=tt(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},{key:process.env.NODE_ENV==="development"&&"getPageOptions",debug:()=>{var r;return(r=e.options.debugAll)!=null?r:e.options.debugTable}}),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}},ab=()=>({left:[],right:[]}),lb=()=>({top:[],bottom:[]}),vX={getInitialState:e=>({columnPinning:ab(),rowPinning:lb(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Wr("columnPinning",e),onRowPinningChange:Wr("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(f=>!(r!=null&&r.includes(f))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(f=>!(r!=null&&r.includes(f))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(f=>!(r!=null&&r.includes(f))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(f=>!(r!=null&&r.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var f,g;return{top:((f=l==null?void 0:l.top)!=null?f:[]).filter(y=>!(a!=null&&a.has(y))),bottom:[...((g=l==null?void 0:l.bottom)!=null?g:[]).filter(y=>!(a!=null&&a.has(y))),...Array.from(a)]}}if(n==="top"){var p,v;return{top:[...((p=l==null?void 0:l.top)!=null?p:[]).filter(y=>!(a!=null&&a.has(y))),...Array.from(a)],bottom:((v=l==null?void 0:l.bottom)!=null?v:[]).filter(y=>!(a!=null&&a.has(y)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(y=>!(a!=null&&a.has(y))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(y=>!(a!=null&&a.has(y)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=t._getPinnedRows(o))==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1},e.getCenterVisibleCells=tt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getLeftVisibleCells=tt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),{key:process.env.NODE_ENV==="development"&&"row.getLeftVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getRightVisibleCells=tt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),{key:process.env.NODE_ENV==="development"&&"row.getRightVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?ab():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:ab())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=tt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getLeftLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.getRightLeafColumns=tt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),{key:process.env.NODE_ENV==="development"&&"getRightLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.getCenterLeafColumns=tt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},{key:process.env.NODE_ENV==="development"&&"getCenterLeafColumns",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugColumns}}),e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?lb():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:lb())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=t=>tt(()=>[e.getRowModel().rows,e.getState().rowPinning[t]],(n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(r??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(r??[]).map(s=>n.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:t}))},{key:process.env.NODE_ENV==="development"&&`row.get${t==="top"?"Top":"Bottom"}Rows`,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}})(),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=tt(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},{key:process.env.NODE_ENV==="development"&&"row.getCenterRows",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugRows}})}},bX={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Wr("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{ay(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=tt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?cb(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="development"&&"getSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getFilteredSelectedRowModel=tt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?cb(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getFilteredSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getGroupedSelectedRowModel=tt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?cb(e,n):{rows:[],flatRows:[],rowsById:{}},{key:process.env.NODE_ENV==="production"&&"getGroupedSelectedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable}}),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return ay(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return yw(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return ly(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return ly(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},ay=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>ay(e,a.id,n,r,o))};function cb(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=yw(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function yw(e,t){var n;return(n=t[e.id])!=null?n:!1}function ly(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(yw(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=ly(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const cy=/([0-9]+)/gm,yX=(e,t,n)=>ST($s(e.getValue(n)).toLowerCase(),$s(t.getValue(n)).toLowerCase()),xX=(e,t,n)=>ST($s(e.getValue(n)),$s(t.getValue(n))),wX=(e,t,n)=>xw($s(e.getValue(n)).toLowerCase(),$s(t.getValue(n)).toLowerCase()),_X=(e,t,n)=>xw($s(e.getValue(n)),$s(t.getValue(n))),SX=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},CX=(e,t,n)=>xw(e.getValue(n),t.getValue(n));function xw(e,t){return e===t?0:e>t?1:-1}function $s(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function ST(e,t){const n=e.split(cy).filter(Boolean),r=t.split(cy).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const au={alphanumeric:yX,alphanumericCaseSensitive:xX,text:wX,textCaseSensitive:_X,datetime:SX,basic:CX},EX={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Wr("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return au.datetime;if(typeof i=="string"&&(r=!0,i.split(cy).length>1))return au.alphanumeric}return r?au.text:au.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return jp(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:au[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(p=>p.id===e.id),l=s==null?void 0:s.findIndex(p=>p.id===e.id);let c=[],u,f=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var g;c=[...s,{id:e.id,desc:f}],c.splice(0,c.length-((g=t.options.maxMultiSortColCount)!=null?g:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(p=>p.id===e.id?{...p,desc:f}:p):u==="remove"?c=s.filter(p=>p.id!==e.id):c=[{id:e.id,desc:f}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},RX={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Wr("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;return(n=(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=tt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),{key:process.env.NODE_ENV==="production"&&"row._getAllVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}}),e.getVisibleCells=tt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],{key:process.env.NODE_ENV==="development"&&"row.getVisibleCells",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugRows}})},createTable:e=>{const t=(n,r)=>tt(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),{key:n,debug:()=>{var o;return(o=e.options.debugAll)!=null?o:e.options.debugColumns}});e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}},FR=[ZK,RX,gX,vX,rX,EX,hX,nX,mX,bX,eX];function PX(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:FR};const r=n._features.reduce((u,f)=>Object.assign(u,f.getDefaultOptions==null?void 0:f.getDefaultOptions(n)),{}),o=u=>n.options.mergeOptions?n.options.mergeOptions(r,u):{...r,...u};let s={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(u=>{var f;s=(f=u.getInitialState==null?void 0:u.getInitialState(s))!=null?f:s});const a=[];let l=!1;const c={_features:FR,options:{...r,...e},initialState:s,_queue:u=>{a.push(u),l||(l=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();l=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{n.setState(n.initialState)},setOptions:u=>{const f=ys(u,n.options);n.options=o(f)},getState:()=>n.options.state,setState:u=>{n.options.onStateChange==null||n.options.onStateChange(u)},_getRowId:(u,f,g)=>{var p;return(p=n.options.getRowId==null?void 0:n.options.getRowId(u,f,g))!=null?p:`${g?[g.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(u,f)=>{let g=(f?n.getPrePaginationRowModel():n.getRowModel()).rowsById[u];if(!g&&(g=n.getCoreRowModel().rowsById[u],!g))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${u}`):new Error;return g},_getDefaultColumnDef:tt(()=>[n.options.defaultColumn],u=>{var f;return u=(f=u)!=null?f:{},{header:g=>{const p=g.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:g=>{var p,v;return(p=(v=g.renderValue())==null||v.toString==null?void 0:v.toString())!=null?p:null},...n._features.reduce((g,p)=>Object.assign(g,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...u}},{debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns},key:process.env.NODE_ENV==="development"&&"getDefaultColumnDef"}),_getColumnDefs:()=>n.options.columns,getAllColumns:tt(()=>[n._getColumnDefs()],u=>{const f=function(g,p,v){return v===void 0&&(v=0),g.map(y=>{const x=JK(n,y,v,p),w=y;return x.columns=w.columns?f(w.columns,x,v+1):[],x})};return f(u)},{key:process.env.NODE_ENV==="development"&&"getAllColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllFlatColumns:tt(()=>[n.getAllColumns()],u=>u.flatMap(f=>f.getFlatColumns()),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),_getAllFlatColumnsById:tt(()=>[n.getAllFlatColumns()],u=>u.reduce((f,g)=>(f[g.id]=g,f),{}),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumnsById",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllLeafColumns:tt(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(u,f)=>{let g=u.flatMap(p=>p.getLeafColumns());return f(g)},{key:process.env.NODE_ENV==="development"&&"getAllLeafColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getColumn:u=>{const f=n._getAllFlatColumnsById()[u];return process.env.NODE_ENV!=="production"&&!f&&console.error(`[Table] Column with id '${u}' does not exist.`),f}};Object.assign(n,c);for(let u=0;u<n._features.length;u++){const f=n._features[u];f==null||f.createTable==null||f.createTable(n)}return n}function OX(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:tt(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),{key:process.env.NODE_ENV==="development"&&"cell.getContext",debug:()=>e.options.debugAll})};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}const $X=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>QK(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:tt(()=>[e.getAllLeafColumns()],l=>l.map(c=>OX(e,a,c,c.id)),{key:process.env.NODE_ENV==="development"&&"row.getAllCells",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}}),_getAllCellsByColumnId:tt(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),{key:process.env.NODE_ENV==="production"&&"row.getAllCellsByColumnId",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}})};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a};function CT(){return e=>tt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=$X(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s==null?void 0:s.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},{key:process.env.NODE_ENV==="development"&&"getRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function ET(){return e=>tt(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,f)=>{for(let p=0;p<i.length;p+=1){var g;const v=i[p],y=s[v.id],x=(g=v==null?void 0:v.desc)!=null?g:!1;let w=0;if(y.sortUndefined){const _=u.getValue(v.id),S=f.getValue(v.id),R=_===void 0,E=S===void 0;(R||E)&&(w=R&&E?0:R?y.sortUndefined:-y.sortUndefined)}if(w===0&&(w=y.sortingFn(u,f,v.id)),w!==0)return x&&(w*=-1),y.invertSorting&&(w*=-1),w}return u.index-f.index}),c.forEach(u=>{var f;o.push(u),(f=u.subRows)!=null&&f.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},{key:process.env.NODE_ENV==="development"&&"getSortedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function DX(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function RT(e){return t=>tt(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=o*i,u=c+o;s=s.slice(c,u);let f;t.options.paginateExpandedRows?f={rows:s,flatRows:a,rowsById:l}:f=DX({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const g=p=>{f.flatRows.push(p),p.subRows.length&&p.subRows.forEach(g)};return f.rows.forEach(g),f},{key:process.env.NODE_ENV==="development"&&"getPaginationRowModel",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugTable}})}/**
230
+ * react-table
231
+ *
232
+ * Copyright (c) TanStack
233
+ *
234
+ * This source code is licensed under the MIT license found in the
235
+ * LICENSE.md file in the root directory of this source tree.
236
+ *
237
+ * @license MIT
238
+ */function uy(e,t){return e?TX(e)?fe.createElement(e,t):e:null}function TX(e){return kX(e)||typeof e=="function"||MX(e)}function kX(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function MX(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function PT(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=fe.useState(()=>({current:PX(t)})),[r,o]=fe.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}function OT({data:e,card:t}){var x,w;const[n,r]=m.useState([]),{keys:o}=uo(e),i=Te(_=>_.filteringCards),s=i==null?void 0:i.find(_=>_.id===t.id),a=(x=t==null?void 0:t.preferences)==null?void 0:x.onClickFilter,{addOrUpdateFilterValues:l,addFilteringCard:c,removeFilterValue:u,removeFilteringCard:f}=Li(),g=o.map(_=>({accessorKey:_,header:({column:S})=>{const R=S.getIsSorted();return N.jsx("div",{className:"flex gap-2",children:N.jsxs("div",{className:"flex cursor-pointer items-center",onClick:()=>S.toggleSorting(S.getIsSorted()==="asc"),children:[_,R==="asc"?N.jsx(Kx,{className:"ml-2 h-5 w-5"}):R==="desc"?N.jsx(Yx,{className:"ml-2 h-5 w-5"}):null]})})}})),p=PT({data:e,columns:g,getCoreRowModel:CT(),getPaginationRowModel:RT(),onSortingChange:r,getSortedRowModel:ET(),manualPagination:!0,state:{sorting:n}}),v=p.getSelectedRowModel().rows;m.useEffect(()=>{if(v.length===0){if(s){const _=t.id;u(_),f(t)}return}if(a){const{dimensionKeys:_}=uo(e),S=a.map(R=>{const E=_==null?void 0:_[R.columnIndex],O=v.map(T=>T.getValue(E));return{filterId:t.id+"-"+E,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:E,expression:R.expression,valueType:Bu(O[0]===void 0?"":O[0]),operation:"in",values:O}});l(S),c(t)}},[c,l,t,e,s,a,u,f,v]);function y(_){_.toggleSelected()}return N.jsxs(pw,{onMouseDown:_=>_.stopPropagation(),children:[N.jsx(gw,{children:p.getHeaderGroups().map(_=>N.jsx(Mu,{children:_.headers.map(S=>N.jsx(vw,{className:"sticky top-0 h-8 border-x bg-muted-foreground px-2 py-1 text-background",children:S.isPlaceholder?null:uy(S.column.columnDef.header,S.getContext())},S.id))},_.id))}),N.jsx(mw,{children:(w=p.getRowModel().rows)!=null&&w.length?p.getRowModel().rows.map(_=>N.jsx(Mu,{onClick:()=>y(_),className:Oe("whitespace-nowrap p-1",{"cursor-pointer":a&&(a==null?void 0:a.length)>0}),"data-state":_.getIsSelected()&&"selected",children:_.getVisibleCells().map(S=>N.jsx(zp,{className:"border px-2 py-1",children:uy(S.column.columnDef.cell,S.getContext())},S.id))},_.id)):N.jsx(Mu,{children:N.jsx(zp,{colSpan:g.length,className:"p-1 text-center",children:"No results."})})})]})}function AX({frame:e,footer:t,className:n,...r}){const{customCards:o}=Ua(),i=m.useRef(null),s=Te(Y=>Y.themeStyle),a=Te(Y=>Y.selectedSheetId),l=Te(Y=>Y.selectedFrameId),c=Te(Y=>Y.isDashboardEditing),u=e.cards.find(Y=>Y.id===e.activeCardId);IK(e,i);const{isError:f,isLoading:g,isFetching:p,cfg:v,visualKey:y,handleDatapointClick:x}=uw(u),{setCardTitle:w,setCardDescription:_,setSelectedFrameId:S}=Li(),{setSelectedConnectionId:R,setSelectedDatabaseName:E,setSelectedSchemaName:O,setSelectedTableName:k}=TD();function T(Y){Y.stopPropagation(),S(e.id),u!=null&&u.connectionId&&R(u==null?void 0:u.connectionId),u!=null&&u.lastSelectedDatabase&&E(u==null?void 0:u.lastSelectedDatabase),u!=null&&u.lastSelectedSchema&&O(u==null?void 0:u.lastSelectedSchema),u!=null&&u.lastSelectedTable&&k(u==null?void 0:u.lastSelectedTable)}function M(){if(o&&o.length>0){const Y=o.find(G=>G.cardId===u.id);if(Y&&Y.replaceDefault){const G=Y.content;if(G)return N.jsx(G,{card:u})}}return u.type==="kpi"?N.jsx(iT,{isLoading:g||p,card:u}):B}function F(){if(f)return N.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(u.type==="table"&&u.data&&u.data.length>0)return N.jsx("div",{className:"relative flex min-h-0 flex-1 grow basis-0",children:N.jsx(OT,{card:u,data:u.data})});if(o&&o.length>0){const Y=o.find(G=>G.cardId===u.id);if(Y&&Y.content){const G=Y.content;return N.jsx(G,{card:u})}}if(v)return N.jsx(Gx,{cfg:v,onDatapointClick:x},y)}function z(){if(o&&o.length>0){const Y=o.find(G=>G.cardId===u.id);if(Y&&Y.footer){const G=Y.footer;if(G)return N.jsx(G,{card:u})}}return t||null}if(!u.id)return null;const B=N.jsxs(N.Fragment,{children:[N.jsxs(ag,{className:"pb-4",children:[N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx(Ma,{text:u.title,onSave:Y=>w(a,u.id,Y),children:N.jsx(Vd,{className:"text-base",children:u.title})}),(c||u.info)&&N.jsx(GK,{card:u}),u.refreshInterval&&N.jsxs(JD,{children:[N.jsx(ZD,{className:"pr-1",children:N.jsx("div",{className:Oe("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":g||p})})}),N.jsx(sw,{side:"right",align:"center",children:N.jsx("p",{className:"text-xs",children:`Realtime (${u==null?void 0:u.refreshInterval})`})})]}),!u.refreshInterval&&(g||p)&&N.jsx(aw,{className:"h-4 w-4 animate-spin text-muted-foreground"})]}),N.jsx(Ma,{text:(u==null?void 0:u.description)||"",onSave:Y=>_(a,u.id,Y),children:N.jsxs(Zy,{children:[" ",u.description]})})]}),N.jsx(lg,{className:"relative flex grow flex-col",children:F()}),N.jsx(ex,{children:z()})]});return N.jsxs(Jy,{tabIndex:-1,ref:i,role:"card-frame",onClick:T,className:Oe("relative flex h-full flex-col rounded-sm",{"border-dashed border-foreground/50":l===e.id&&c},s==null?void 0:s.dashboardCard,n,"semaphor-card-frame"),...r,children:[N.jsx(FG,{frame:e}),M()]})}const IX=m.forwardRef((e,t)=>m.createElement(We.label,se({},e,{ref:t,onMouseDown:n=>{var r;(r=e.onMouseDown)===null||r===void 0||r.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault()}}))),$T=IX,zR=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,jR=hp,ww=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return jR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],f=i==null?void 0:i[c];if(u===null)return null;const g=zR(u)||zR(f);return o[c][g]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,g]=u;return g===void 0||(c[f]=g),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:g,...p}=u;return Object.entries(p).every(v=>{let[y,x]=v;return Array.isArray(x)?x.includes({...i,...a}[y]):{...i,...a}[y]===x})?[...c,f,g]:c},[]);return jR(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},NX=ww("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),So=fe.forwardRef(({className:e,...t},n)=>N.jsx($T,{ref:n,className:Oe(NX(),e),...t}));So.displayName=$T.displayName;let ub=0;function Ig(){m.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:BR()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:BR()),ub++,()=>{ub===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),ub--}},[])}function BR(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}const db="focusScope.autoFocusOnMount",fb="focusScope.autoFocusOnUnmount",VR={bubbles:!1,cancelable:!0},Ng=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=m.useState(null),c=Cn(o),u=Cn(i),f=m.useRef(null),g=st(t,y=>l(y)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let y=function(S){if(p.paused||!a)return;const R=S.target;a.contains(R)?f.current=R:ss(f.current,{select:!0})},x=function(S){if(p.paused||!a)return;const R=S.relatedTarget;R!==null&&(a.contains(R)||ss(f.current,{select:!0}))},w=function(S){if(document.activeElement===document.body)for(const E of S)E.removedNodes.length>0&&ss(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const _=new MutationObserver(w);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),_.disconnect()}}},[r,a,p.paused]),m.useEffect(()=>{if(a){WR.add(p);const y=document.activeElement;if(!a.contains(y)){const w=new CustomEvent(db,VR);a.addEventListener(db,c),a.dispatchEvent(w),w.defaultPrevented||(LX(VX(DT(a)),{select:!0}),document.activeElement===y&&ss(a))}return()=>{a.removeEventListener(db,c),setTimeout(()=>{const w=new CustomEvent(fb,VR);a.addEventListener(fb,u),a.dispatchEvent(w),w.defaultPrevented||ss(y??document.body,{select:!0}),a.removeEventListener(fb,u),WR.remove(p)},0)}}},[a,c,u,p]);const v=m.useCallback(y=>{if(!n&&!r||p.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,w=document.activeElement;if(x&&w){const _=y.currentTarget,[S,R]=FX(_);S&&R?!y.shiftKey&&w===R?(y.preventDefault(),n&&ss(S,{select:!0})):y.shiftKey&&w===S&&(y.preventDefault(),n&&ss(R,{select:!0})):w===_&&y.preventDefault()}},[n,r,p.paused]);return m.createElement(We.div,se({tabIndex:-1},s,{ref:g,onKeyDown:v}))});function LX(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ss(r,{select:t}),document.activeElement!==n)return}function FX(e){const t=DT(e),n=HR(t,e),r=HR(t.reverse(),e);return[n,r]}function DT(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function HR(e,t){for(const n of e)if(!zX(n,{upTo:t}))return n}function zX(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function jX(e){return e instanceof HTMLInputElement&&"select"in e}function ss(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&jX(e)&&t&&e.select()}}const WR=BX();function BX(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=UR(e,t),e.unshift(t)},remove(t){var n;e=UR(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function UR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function VX(e){return e.filter(t=>t.tagName!=="A")}var HX=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},xl=new WeakMap,kh=new WeakMap,Mh={},hb=0,TT=function(e){return e&&(e.host||TT(e.parentNode))},WX=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=TT(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},UX=function(e,t,n,r){var o=WX(t,Array.isArray(e)?e:[e]);Mh[n]||(Mh[n]=new WeakMap);var i=Mh[n],s=[],a=new Set,l=new Set(o),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};o.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(g){if(a.has(g))u(g);else{var p=g.getAttribute(r),v=p!==null&&p!=="false",y=(xl.get(g)||0)+1,x=(i.get(g)||0)+1;xl.set(g,y),i.set(g,x),s.push(g),y===1&&v&&kh.set(g,!0),x===1&&g.setAttribute(n,"true"),v||g.setAttribute(r,"true")}})};return u(t),a.clear(),hb++,function(){s.forEach(function(f){var g=xl.get(f)-1,p=i.get(f)-1;xl.set(f,g),i.set(f,p),g||(kh.has(f)||f.removeAttribute(r),kh.delete(f)),p||f.removeAttribute(n)}),hb--,hb||(xl=new WeakMap,xl=new WeakMap,kh=new WeakMap,Mh={})}},Lg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||HX(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),UX(r,o,n,"aria-hidden")):function(){return null}},Wo=function(){return Wo=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Wo.apply(this,arguments)};function kT(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function qX(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var lp="right-scroll-bar-position",cp="width-before-scroll-bar",GX="with-scroll-bars-hidden",YX="--removed-body-scroll-bar-size";function KX(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function XX(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}function QX(e,t){return XX(t||null,function(n){return e.forEach(function(r){return KX(r,n)})})}function JX(e){return e}function ZX(e,t){t===void 0&&(t=JX);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function eQ(e){e===void 0&&(e={});var t=ZX(null);return t.options=Wo({async:!0,ssr:!1},e),t}var MT=function(e){var t=e.sideCar,n=kT(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return fe.createElement(r,Wo({},n))};MT.isSideCarExport=!0;function tQ(e,t){return e.useMedium(t),MT}var AT=eQ(),pb=function(){},Fg=fe.forwardRef(function(e,t){var n=fe.useRef(null),r=fe.useState({onScrollCapture:pb,onWheelCapture:pb,onTouchMoveCapture:pb}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,g=e.sideCar,p=e.noIsolation,v=e.inert,y=e.allowPinchZoom,x=e.as,w=x===void 0?"div":x,_=kT(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),S=g,R=QX([n,t]),E=Wo(Wo({},_),o);return fe.createElement(fe.Fragment,null,u&&fe.createElement(S,{sideCar:AT,removeScrollBar:c,shards:f,noIsolation:p,inert:v,setCallbacks:i,allowPinchZoom:!!y,lockRef:n}),s?fe.cloneElement(fe.Children.only(a),Wo(Wo({},E),{ref:R})):fe.createElement(w,Wo({},E,{className:l,ref:R}),a))});Fg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Fg.classNames={fullWidth:cp,zeroRight:lp};var qR,nQ=function(){if(qR)return qR;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rQ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=nQ();return t&&e.setAttribute("nonce",t),e}function oQ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function iQ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var sQ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=rQ())&&(oQ(t,n),iQ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},aQ=function(){var e=sQ();return function(t,n){fe.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},IT=function(){var e=aQ(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},lQ={left:0,top:0,right:0,gap:0},gb=function(e){return parseInt(e||"",10)||0},cQ=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[gb(n),gb(r),gb(o)]},uQ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return lQ;var t=cQ(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},dQ=IT(),fQ=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
239
+ .`.concat(GX,` {
240
+ overflow: hidden `).concat(r,`;
241
+ padding-right: `).concat(a,"px ").concat(r,`;
242
+ }
243
+ body {
244
+ overflow: hidden `).concat(r,`;
245
+ overscroll-behavior: contain;
246
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
247
+ padding-left: `.concat(o,`px;
248
+ padding-top: `).concat(i,`px;
249
+ padding-right: `).concat(s,`px;
250
+ margin-left:0;
251
+ margin-top:0;
252
+ margin-right: `).concat(a,"px ").concat(r,`;
253
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
254
+ }
255
+
256
+ .`).concat(lp,` {
257
+ right: `).concat(a,"px ").concat(r,`;
258
+ }
259
+
260
+ .`).concat(cp,` {
261
+ margin-right: `).concat(a,"px ").concat(r,`;
262
+ }
263
+
264
+ .`).concat(lp," .").concat(lp,` {
265
+ right: 0 `).concat(r,`;
266
+ }
267
+
268
+ .`).concat(cp," .").concat(cp,` {
269
+ margin-right: 0 `).concat(r,`;
270
+ }
271
+
272
+ body {
273
+ `).concat(YX,": ").concat(a,`px;
274
+ }
275
+ `)},hQ=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=fe.useMemo(function(){return uQ(o)},[o]);return fe.createElement(dQ,{styles:fQ(i,!t,o,n?"":"!important")})},dy=!1;if(typeof window<"u")try{var Ah=Object.defineProperty({},"passive",{get:function(){return dy=!0,!0}});window.addEventListener("test",Ah,Ah),window.removeEventListener("test",Ah,Ah)}catch{dy=!1}var wl=dy?{passive:!1}:!1,pQ=function(e){return e.tagName==="TEXTAREA"},NT=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!pQ(e)&&n[t]==="visible")},gQ=function(e){return NT(e,"overflowY")},mQ=function(e){return NT(e,"overflowX")},GR=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=LT(e,n);if(r){var o=FT(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},vQ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},bQ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},LT=function(e,t){return e==="v"?gQ(t):mQ(t)},FT=function(e,t){return e==="v"?vQ(t):bQ(t)},yQ=function(e,t){return e==="h"&&t==="rtl"?-1:1},xQ=function(e,t,n,r,o){var i=yQ(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,f=0,g=0;do{var p=FT(e,a),v=p[0],y=p[1],x=p[2],w=y-x-i*v;(v||w)&&LT(e,a)&&(f+=w,g+=v),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&f===0||!o&&s>f)||!u&&(o&&g===0||!o&&-s>g))&&(c=!0),c},Ih=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},YR=function(e){return[e.deltaX,e.deltaY]},KR=function(e){return e&&"current"in e?e.current:e},wQ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_Q=function(e){return`
276
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
277
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
278
+ `)},SQ=0,_l=[];function CQ(e){var t=fe.useRef([]),n=fe.useRef([0,0]),r=fe.useRef(),o=fe.useState(SQ++)[0],i=fe.useState(function(){return IT()})[0],s=fe.useRef(e);fe.useEffect(function(){s.current=e},[e]),fe.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=qX([e.lockRef.current],(e.shards||[]).map(KR),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=fe.useCallback(function(y,x){if("touches"in y&&y.touches.length===2)return!s.current.allowPinchZoom;var w=Ih(y),_=n.current,S="deltaX"in y?y.deltaX:_[0]-w[0],R="deltaY"in y?y.deltaY:_[1]-w[1],E,O=y.target,k=Math.abs(S)>Math.abs(R)?"h":"v";if("touches"in y&&k==="h"&&O.type==="range")return!1;var T=GR(k,O);if(!T)return!0;if(T?E=k:(E=k==="v"?"h":"v",T=GR(k,O)),!T)return!1;if(!r.current&&"changedTouches"in y&&(S||R)&&(r.current=E),!E)return!0;var M=r.current||E;return xQ(M,x,y,M==="h"?S:R,!0)},[]),l=fe.useCallback(function(y){var x=y;if(!(!_l.length||_l[_l.length-1]!==i)){var w="deltaY"in x?YR(x):Ih(x),_=t.current.filter(function(E){return E.name===x.type&&E.target===x.target&&wQ(E.delta,w)})[0];if(_&&_.should){x.cancelable&&x.preventDefault();return}if(!_){var S=(s.current.shards||[]).map(KR).filter(Boolean).filter(function(E){return E.contains(x.target)}),R=S.length>0?a(x,S[0]):!s.current.noIsolation;R&&x.cancelable&&x.preventDefault()}}},[]),c=fe.useCallback(function(y,x,w,_){var S={name:y,delta:x,target:w,should:_};t.current.push(S),setTimeout(function(){t.current=t.current.filter(function(R){return R!==S})},1)},[]),u=fe.useCallback(function(y){n.current=Ih(y),r.current=void 0},[]),f=fe.useCallback(function(y){c(y.type,YR(y),y.target,a(y,e.lockRef.current))},[]),g=fe.useCallback(function(y){c(y.type,Ih(y),y.target,a(y,e.lockRef.current))},[]);fe.useEffect(function(){return _l.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:g}),document.addEventListener("wheel",l,wl),document.addEventListener("touchmove",l,wl),document.addEventListener("touchstart",u,wl),function(){_l=_l.filter(function(y){return y!==i}),document.removeEventListener("wheel",l,wl),document.removeEventListener("touchmove",l,wl),document.removeEventListener("touchstart",u,wl)}},[]);var p=e.removeScrollBar,v=e.inert;return fe.createElement(fe.Fragment,null,v?fe.createElement(i,{styles:_Q(o)}):null,p?fe.createElement(hQ,{gapMode:"margin"}):null)}const EQ=tQ(AT,CQ);var zT=fe.forwardRef(function(e,t){return fe.createElement(Fg,Wo({},e,{ref:t,sideCar:EQ}))});zT.classNames=Fg.classNames;const zg=zT,jT="Popover",[BT,Vhe]=Dn(jT,[ii]),_w=ii(),[RQ,Sc]=BT(jT),PQ=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=_w(t),l=m.useRef(null),[c,u]=m.useState(!1),[f=!1,g]=Yn({prop:r,defaultProp:o,onChange:i});return m.createElement(Xd,a,m.createElement(RQ,{scope:t,contentId:vr(),triggerRef:l,open:f,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(p=>!p),[g]),hasCustomAnchor:c,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:s},n))},OQ="PopoverTrigger",$Q=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Sc(OQ,n),i=_w(n),s=st(t,o.triggerRef),a=m.createElement(We.button,se({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":WT(o.open)},r,{ref:s,onClick:Ee(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:m.createElement(Qd,se({asChild:!0},i),a)}),VT="PopoverPortal",[DQ,TQ]=BT(VT,{forceMount:void 0}),kQ=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=Sc(VT,t);return m.createElement(DQ,{scope:t,forceMount:n},m.createElement(yn,{present:n||i.open},m.createElement(Tg,{asChild:!0,container:o},r)))},ed="PopoverContent",MQ=m.forwardRef((e,t)=>{const n=TQ(ed,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=Sc(ed,e.__scopePopover);return m.createElement(yn,{present:r||i.open},i.modal?m.createElement(AQ,se({},o,{ref:t})):m.createElement(IQ,se({},o,{ref:t})))}),AQ=m.forwardRef((e,t)=>{const n=Sc(ed,e.__scopePopover),r=m.useRef(null),o=st(t,r),i=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return Lg(s)},[]),m.createElement(zg,{as:Mi,allowPinchZoom:!0},m.createElement(HT,se({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:Ee(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Ee(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),IQ=m.forwardRef((e,t)=>{const n=Sc(ed,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(HT,se({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),HT=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=e,g=Sc(ed,n),p=_w(n);return Ig(),m.createElement(Ng,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(xc,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>g.onOpenChange(!1)},m.createElement(Jd,se({"data-state":WT(g.open),role:"dialog",id:g.contentId},p,f,{ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))});function WT(e){return e?"open":"closed"}const NQ=PQ,LQ=$Q,FQ=kQ,UT=MQ,Sw=NQ,Cw=LQ,jg=fe.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>N.jsx(FQ,{children:N.jsx(UT,{ref:o,align:t,sideOffset:n,className:Oe("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));jg.displayName=UT.displayName;const Ew=fe.forwardRef(({className:e,...t},n)=>N.jsx("textarea",{className:Oe("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Ew.displayName="Textarea";const fy="horizontal",zQ=["horizontal","vertical"],qT=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=fy,...o}=e,i=GT(r)?r:fy,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return m.createElement(We.div,se({"data-orientation":i},a,o,{ref:t}))});qT.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!GT(r)?new Error(jQ(o,n)):null}};function jQ(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
279
+ - horizontal
280
+ - vertical
281
+
282
+ Defaulting to \`${fy}\`.`}function GT(e){return zQ.includes(e)}const YT=qT,Bg=fe.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>N.jsx(YT,{ref:o,decorative:n,orientation:t,className:Oe("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Bg.displayName=YT.displayName;function hy(e,[t,n]){return Math.min(n,Math.max(t,e))}function Vg(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const BQ=[" ","Enter","ArrowUp","ArrowDown"],VQ=[" ","Enter"],Hg="Select",[Wg,Ug,HQ]=ug(Hg),[Cc,Hhe]=Dn(Hg,[HQ,ii]),Rw=ii(),[WQ,qa]=Cc(Hg),[UQ,qQ]=Cc(Hg),GQ=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:g,required:p}=e,v=Rw(t),[y,x]=m.useState(null),[w,_]=m.useState(null),[S,R]=m.useState(!1),E=Ba(c),[O=!1,k]=Yn({prop:r,defaultProp:o,onChange:i}),[T,M]=Yn({prop:s,defaultProp:a,onChange:l}),F=m.useRef(null),z=y?!!y.closest("form"):!0,[B,Y]=m.useState(new Set),G=Array.from(B).map(j=>j.props.value).join(";");return m.createElement(Xd,v,m.createElement(WQ,{required:p,scope:t,trigger:y,onTriggerChange:x,valueNode:w,onValueNodeChange:_,valueNodeHasChildren:S,onValueNodeHasChildrenChange:R,contentId:vr(),value:T,onValueChange:M,open:O,onOpenChange:k,dir:E,triggerPointerDownPosRef:F,disabled:g},m.createElement(Wg.Provider,{scope:t},m.createElement(UQ,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(j=>{Y(ee=>new Set(ee).add(j))},[]),onNativeOptionRemove:m.useCallback(j=>{Y(ee=>{const q=new Set(ee);return q.delete(j),q})},[])},n)),z?m.createElement(ZT,{key:G,"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:f,value:T,onChange:j=>M(j.target.value),disabled:g},T===void 0?m.createElement("option",{value:""}):null,Array.from(B)):null))},YQ="SelectTrigger",KQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=Rw(n),s=qa(YQ,n),a=s.disabled||r,l=st(t,s.onTriggerChange),c=Ug(n),[u,f,g]=ek(v=>{const y=c().filter(_=>!_.disabled),x=y.find(_=>_.value===s.value),w=tk(y,v,x);w!==void 0&&s.onValueChange(w.value)}),p=()=>{a||(s.onOpenChange(!0),g())};return m.createElement(Qd,se({asChild:!0},i),m.createElement(We.button,se({type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":JT(s.value)?"":void 0},o,{ref:l,onClick:Ee(o.onClick,v=>{v.currentTarget.focus()}),onPointerDown:Ee(o.onPointerDown,v=>{const y=v.target;y.hasPointerCapture(v.pointerId)&&y.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&(p(),s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)},v.preventDefault())}),onKeyDown:Ee(o.onKeyDown,v=>{const y=u.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(y&&v.key===" ")&&BQ.includes(v.key)&&(p(),v.preventDefault())})})))}),XQ="SelectValue",QQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=qa(XQ,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,f=st(t,l.onValueNodeChange);return Gn(()=>{c(u)},[c,u]),m.createElement(We.span,se({},a,{ref:f,style:{pointerEvents:"none"}}),JT(l.value)?m.createElement(m.Fragment,null,s):i)}),JQ=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.createElement(We.span,se({"aria-hidden":!0},o,{ref:t}),r||"▼")}),ZQ=e=>m.createElement(Tg,se({asChild:!0},e)),hc="SelectContent",eJ=m.forwardRef((e,t)=>{const n=qa(hc,e.__scopeSelect),[r,o]=m.useState();if(Gn(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?ti.createPortal(m.createElement(KT,{scope:e.__scopeSelect},m.createElement(Wg.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),i):null}return m.createElement(tJ,se({},e,{ref:t}))}),Ci=10,[KT,Ga]=Cc(hc),tJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:y,avoidCollisions:x,...w}=e,_=qa(hc,n),[S,R]=m.useState(null),[E,O]=m.useState(null),k=st(t,de=>R(de)),[T,M]=m.useState(null),[F,z]=m.useState(null),B=Ug(n),[Y,G]=m.useState(!1),j=m.useRef(!1);m.useEffect(()=>{if(S)return Lg(S)},[S]),Ig();const ee=m.useCallback(de=>{const[oe,...Z]=B().map(W=>W.ref.current),[ie]=Z.slice(-1),ye=document.activeElement;for(const W of de)if(W===ye||(W==null||W.scrollIntoView({block:"nearest"}),W===oe&&E&&(E.scrollTop=0),W===ie&&E&&(E.scrollTop=E.scrollHeight),W==null||W.focus(),document.activeElement!==ye))return},[B,E]),q=m.useCallback(()=>ee([T,S]),[ee,T,S]);m.useEffect(()=>{Y&&q()},[Y,q]);const{onOpenChange:X,triggerPointerDownPosRef:re}=_;m.useEffect(()=>{if(S){let de={x:0,y:0};const oe=ie=>{var ye,W,me,_e;de={x:Math.abs(Math.round(ie.pageX)-((ye=(W=re.current)===null||W===void 0?void 0:W.x)!==null&&ye!==void 0?ye:0)),y:Math.abs(Math.round(ie.pageY)-((me=(_e=re.current)===null||_e===void 0?void 0:_e.y)!==null&&me!==void 0?me:0))}},Z=ie=>{de.x<=10&&de.y<=10?ie.preventDefault():S.contains(ie.target)||X(!1),document.removeEventListener("pointermove",oe),re.current=null};return re.current!==null&&(document.addEventListener("pointermove",oe),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",oe),document.removeEventListener("pointerup",Z,{capture:!0})}}},[S,X,re]),m.useEffect(()=>{const de=()=>X(!1);return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[X]);const[$,H]=ek(de=>{const oe=B().filter(ye=>!ye.disabled),Z=oe.find(ye=>ye.ref.current===document.activeElement),ie=tk(oe,de,Z);ie&&setTimeout(()=>ie.ref.current.focus())}),ne=m.useCallback((de,oe,Z)=>{const ie=!j.current&&!Z;(_.value!==void 0&&_.value===oe||ie)&&(M(de),ie&&(j.current=!0))},[_.value]),I=m.useCallback(()=>S==null?void 0:S.focus(),[S]),ce=m.useCallback((de,oe,Z)=>{const ie=!j.current&&!Z;(_.value!==void 0&&_.value===oe||ie)&&z(de)},[_.value]),ge=r==="popper"?XR:nJ,he=ge===XR?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:g,collisionPadding:p,sticky:v,hideWhenDetached:y,avoidCollisions:x}:{};return m.createElement(KT,{scope:n,content:S,viewport:E,onViewportChange:O,itemRefCallback:ne,selectedItem:T,onItemLeave:I,itemTextRefCallback:ce,focusSelectedItem:q,selectedItemText:F,position:r,isPositioned:Y,searchRef:$},m.createElement(zg,{as:Mi,allowPinchZoom:!0},m.createElement(Ng,{asChild:!0,trapped:_.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:Ee(o,de=>{var oe;(oe=_.trigger)===null||oe===void 0||oe.focus({preventScroll:!0}),de.preventDefault()})},m.createElement(xc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>_.onOpenChange(!1)},m.createElement(ge,se({role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:de=>de.preventDefault()},w,he,{onPlaced:()=>G(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:Ee(w.onKeyDown,de=>{const oe=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!oe&&de.key.length===1&&H(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let ie=B().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(de.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const ye=de.target,W=ie.indexOf(ye);ie=ie.slice(W+1)}setTimeout(()=>ee(ie)),de.preventDefault()}})}))))))}),nJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=qa(hc,n),s=Ga(hc,n),[a,l]=m.useState(null),[c,u]=m.useState(null),f=st(t,k=>u(k)),g=Ug(n),p=m.useRef(!1),v=m.useRef(!0),{viewport:y,selectedItem:x,selectedItemText:w,focusSelectedItem:_}=s,S=m.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&y&&x&&w){const k=i.trigger.getBoundingClientRect(),T=c.getBoundingClientRect(),M=i.valueNode.getBoundingClientRect(),F=w.getBoundingClientRect();if(i.dir!=="rtl"){const ye=F.left-T.left,W=M.left-ye,me=k.left-W,_e=k.width+me,Pe=Math.max(_e,T.width),$e=window.innerWidth-Ci,Ue=hy(W,[Ci,$e-Pe]);a.style.minWidth=_e+"px",a.style.left=Ue+"px"}else{const ye=T.right-F.right,W=window.innerWidth-M.right-ye,me=window.innerWidth-k.right-W,_e=k.width+me,Pe=Math.max(_e,T.width),$e=window.innerWidth-Ci,Ue=hy(W,[Ci,$e-Pe]);a.style.minWidth=_e+"px",a.style.right=Ue+"px"}const z=g(),B=window.innerHeight-Ci*2,Y=y.scrollHeight,G=window.getComputedStyle(c),j=parseInt(G.borderTopWidth,10),ee=parseInt(G.paddingTop,10),q=parseInt(G.borderBottomWidth,10),X=parseInt(G.paddingBottom,10),re=j+ee+Y+X+q,$=Math.min(x.offsetHeight*5,re),H=window.getComputedStyle(y),ne=parseInt(H.paddingTop,10),I=parseInt(H.paddingBottom,10),ce=k.top+k.height/2-Ci,ge=B-ce,he=x.offsetHeight/2,de=x.offsetTop+he,oe=j+ee+de,Z=re-oe;if(oe<=ce){const ye=x===z[z.length-1].ref.current;a.style.bottom="0px";const W=c.clientHeight-y.offsetTop-y.offsetHeight,me=Math.max(ge,he+(ye?I:0)+W+q),_e=oe+me;a.style.height=_e+"px"}else{const ye=x===z[0].ref.current;a.style.top="0px";const me=Math.max(ce,j+y.offsetTop+(ye?ne:0)+he)+Z;a.style.height=me+"px",y.scrollTop=oe-ce+y.offsetTop}a.style.margin=`${Ci}px 0`,a.style.minHeight=$+"px",a.style.maxHeight=B+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[g,i.trigger,i.valueNode,a,c,y,x,w,i.dir,r]);Gn(()=>S(),[S]);const[R,E]=m.useState();Gn(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const O=m.useCallback(k=>{k&&v.current===!0&&(S(),_==null||_(),v.current=!1)},[S,_]);return m.createElement(rJ,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:O},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R}},m.createElement(We.div,se({},o,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),XR=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Ci,...i}=e,s=Rw(n);return m.createElement(Jd,se({},s,i,{ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}}))}),[rJ,Pw]=Cc(hc,{}),QR="SelectViewport",oJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ga(QR,n),i=Pw(QR,n),s=st(t,o.onViewportChange),a=m.useRef(0);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(Wg.Slot,{scope:n},m.createElement(We.div,se({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:Ee(r.onScroll,l=>{const c=l.currentTarget,{contentWrapper:u,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&u){const g=Math.abs(a.current-c.scrollTop);if(g>0){const p=window.innerHeight-Ci*2,v=parseFloat(u.style.minHeight),y=parseFloat(u.style.height),x=Math.max(v,y);if(x<p){const w=x+g,_=Math.min(p,w),S=w-_;u.style.height=_+"px",u.style.bottom==="0px"&&(c.scrollTop=S>0?S:0,u.style.justifyContent="flex-end")}}}a.current=c.scrollTop})}))))}),iJ="SelectGroup",[sJ,aJ]=Cc(iJ),lJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=vr();return m.createElement(sJ,{scope:n,id:o},m.createElement(We.div,se({role:"group","aria-labelledby":o},r,{ref:t})))}),cJ="SelectLabel",uJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=aJ(cJ,n);return m.createElement(We.div,se({id:o.id},r,{ref:t}))}),py="SelectItem",[dJ,XT]=Cc(py),fJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=qa(py,n),l=Ga(py,n),c=a.value===r,[u,f]=m.useState(i??""),[g,p]=m.useState(!1),v=st(t,w=>{var _;return(_=l.itemRefCallback)===null||_===void 0?void 0:_.call(l,w,r,o)}),y=vr(),x=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.createElement(dJ,{scope:n,value:r,disabled:o,textId:y,isSelected:c,onItemTextChange:m.useCallback(w=>{f(_=>{var S;return _||((S=w==null?void 0:w.textContent)!==null&&S!==void 0?S:"").trim()})},[])},m.createElement(Wg.ItemSlot,{scope:n,value:r,disabled:o,textValue:u},m.createElement(We.div,se({role:"option","aria-labelledby":y,"data-highlighted":g?"":void 0,"aria-selected":c&&g,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:v,onFocus:Ee(s.onFocus,()=>p(!0)),onBlur:Ee(s.onBlur,()=>p(!1)),onPointerUp:Ee(s.onPointerUp,x),onPointerMove:Ee(s.onPointerMove,w=>{if(o){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}else w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ee(s.onPointerLeave,w=>{if(w.currentTarget===document.activeElement){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}}),onKeyDown:Ee(s.onKeyDown,w=>{var _;((_=l.searchRef)===null||_===void 0?void 0:_.current)!==""&&w.key===" "||(VQ.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})}))))}),Nh="SelectItemText",hJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=qa(Nh,n),a=Ga(Nh,n),l=XT(Nh,n),c=qQ(Nh,n),[u,f]=m.useState(null),g=st(t,w=>f(w),l.onItemTextChange,w=>{var _;return(_=a.itemTextRefCallback)===null||_===void 0?void 0:_.call(a,w,l.value,l.disabled)}),p=u==null?void 0:u.textContent,v=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},p),[l.disabled,l.value,p]),{onNativeOptionAdd:y,onNativeOptionRemove:x}=c;return Gn(()=>(y(v),()=>x(v)),[y,x,v]),m.createElement(m.Fragment,null,m.createElement(We.span,se({id:l.textId},i,{ref:g})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?ti.createPortal(i.children,s.valueNode):null)}),pJ="SelectItemIndicator",gJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return XT(pJ,n).isSelected?m.createElement(We.span,se({"aria-hidden":!0},r,{ref:t})):null}),JR="SelectScrollUpButton",mJ=m.forwardRef((e,t)=>{const n=Ga(JR,e.__scopeSelect),r=Pw(JR,e.__scopeSelect),[o,i]=m.useState(!1),s=st(t,r.onScrollButtonChange);return Gn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollTop>0;i(c)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(QT,se({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),ZR="SelectScrollDownButton",vJ=m.forwardRef((e,t)=>{const n=Ga(ZR,e.__scopeSelect),r=Pw(ZR,e.__scopeSelect),[o,i]=m.useState(!1),s=st(t,r.onScrollButtonChange);return Gn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const c=a.scrollHeight-a.clientHeight,u=Math.ceil(a.scrollTop)<c;i(u)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(QT,se({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),QT=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Ga("SelectScrollButton",n),s=m.useRef(null),a=Ug(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),Gn(()=>{var c;const u=a().find(f=>f.ref.current===document.activeElement);u==null||(c=u.ref.current)===null||c===void 0||c.scrollIntoView({block:"nearest"})},[a]),m.createElement(We.div,se({"aria-hidden":!0},o,{ref:t,style:{flexShrink:0,...o.style},onPointerDown:Ee(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Ee(o.onPointerMove,()=>{var c;(c=i.onItemLeave)===null||c===void 0||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Ee(o.onPointerLeave,()=>{l()})}))}),bJ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(We.div,se({"aria-hidden":!0},r,{ref:t}))});function JT(e){return e===""||e===void 0}const ZT=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=m.useRef(null),i=st(t,o),s=Vg(n);return m.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const f=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(f)}},[s,n]),m.createElement(YD,{asChild:!0},m.createElement("select",se({},r,{ref:i,defaultValue:n})))});ZT.displayName="BubbleSelect";function ek(e){const t=Cn(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function tk(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=yJ(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function yJ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const xJ=GQ,nk=KQ,wJ=QQ,_J=JQ,SJ=ZQ,rk=eJ,CJ=oJ,EJ=lJ,ok=uJ,ik=fJ,RJ=hJ,PJ=gJ,sk=mJ,ak=vJ,lk=bJ,ck=xJ,OJ=EJ,uk=wJ,Ow=fe.forwardRef(({className:e,children:t,...n},r)=>N.jsxs(nk,{ref:r,className:Oe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,N.jsx(_J,{asChild:!0,children:N.jsx(Ag,{className:"h-4 w-4 opacity-50"})})]}));Ow.displayName=nk.displayName;const dk=fe.forwardRef(({className:e,...t},n)=>N.jsx(sk,{ref:n,className:Oe("flex cursor-default items-center justify-center py-1",e),...t,children:N.jsx(lK,{className:"h-4 w-4"})}));dk.displayName=sk.displayName;const fk=fe.forwardRef(({className:e,...t},n)=>N.jsx(ak,{ref:n,className:Oe("flex cursor-default items-center justify-center py-1",e),...t,children:N.jsx(Ag,{className:"h-4 w-4"})}));fk.displayName=ak.displayName;const $w=fe.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>N.jsx(SJ,{children:N.jsxs(rk,{ref:o,className:Oe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[N.jsx(dk,{}),N.jsx(CJ,{className:Oe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),N.jsx(fk,{})]})}));$w.displayName=rk.displayName;const hk=fe.forwardRef(({className:e,...t},n)=>N.jsx(ok,{ref:n,className:Oe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));hk.displayName=ok.displayName;const Au=fe.forwardRef(({className:e,children:t,...n},r)=>N.jsxs(ik,{ref:r,className:Oe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[N.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:N.jsx(PJ,{children:N.jsx(Zd,{className:"h-4 w-4"})})}),N.jsx(RJ,{children:t})]}));Au.displayName=ik.displayName;const pk=fe.forwardRef(({className:e,...t},n)=>N.jsx(lk,{ref:n,className:Oe("-mx-1 my-1 h-px bg-muted",e),...t}));pk.displayName=lk.displayName;const gy=ww("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Po=fe.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?Mi:"button";return N.jsx(s,{className:Oe(gy({variant:t,size:n,className:e})),ref:i,...o})});Po.displayName="Button";function $J({filter:e}){const[t,n]=m.useState(e.sql),[r,o]=m.useState(!1),{updateFilter:i}=Li();function s(){const l={...e,sql:t};i(l),o(!1)}function a(l){console.log("operation",l);const c={...e,operation:l};i(c)}return N.jsxs(Sw,{open:r,onOpenChange:o,children:[N.jsx(Cw,{children:N.jsx(oT,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),N.jsxs(jg,{onDoubleClick:l=>l.stopPropagation(),className:"m-2 w-full min-w-[350px] space-y-4",children:[N.jsxs("div",{className:"space-y-2",children:[N.jsx("h4",{className:"font-medium leading-none",children:"Customize Filter"}),N.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize the filter operation and SQL"})]}),N.jsx(Bg,{}),N.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[N.jsxs("div",{className:"col-span-2 space-y-1",children:[N.jsx(So,{children:"Table Column"}),N.jsx(So,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),N.jsxs("div",{className:"col-span-2 space-y-1",children:[N.jsx(So,{children:"Data Type"}),N.jsx(So,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),N.jsxs("div",{className:"col-span-2 space-y-1",children:[N.jsx(So,{className:"text-sm",children:"Filter Operation"}),N.jsx(DJ,{updateFilterOperation:a,value:e.operation})]})]}),N.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[N.jsx(So,{className:"text-sm",children:"Values SQL"}),N.jsx(Ew,{value:t,onChange:l=>n(l.target.value),className:`min-w-full grow resize font-mono text-xs ${n9}`})]}),N.jsx("div",{className:"flex justify-end gap-2",children:N.jsxs(Po,{onClick:s,size:"sm",variant:"outline",children:[N.jsx(Zd,{className:"mr-2 size-4"}),"Apply"]})})]})]})}function DJ({value:e,updateFilterOperation:t}){return N.jsxs(ck,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[N.jsx(Ow,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:N.jsx(uk,{placeholder:"Operation"})}),N.jsxs($w,{children:[N.jsx(Au,{value:"=",children:"Equals"}),N.jsx(Au,{value:"in",children:"Contains"}),N.jsx(Au,{value:"like",children:"Like"})]})]})}function Rt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Ur(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function tr(e,t){const n=Rt(e);return isNaN(t)?Ur(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function $o(e,t){const n=Rt(e);if(isNaN(t))return Ur(e,NaN);if(!t)return n;const r=n.getDate(),o=Ur(e,n.getTime());o.setMonth(n.getMonth()+t+1,0);const i=o.getDate();return r>=i?o:(n.setFullYear(o.getFullYear(),o.getMonth(),r),n)}const Dw=6048e5,TJ=864e5;let kJ={};function ef(){return kJ}function Zo(e,t){var a,l,c,u;const n=ef(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Rt(e),i=o.getDay(),s=(i<r?7:0)+i-r;return o.setDate(o.getDate()-s),o.setHours(0,0,0,0),o}function za(e){return Zo(e,{weekStartsOn:1})}function gk(e){const t=Rt(e),n=t.getFullYear(),r=Ur(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=za(r),i=Ur(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=za(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function pc(e){const t=Rt(e);return t.setHours(0,0,0,0),t}function Bp(e){const t=Rt(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 Go(e,t){const n=pc(e),r=pc(t),o=+n-Bp(n),i=+r-Bp(r);return Math.round((o-i)/TJ)}function MJ(e){const t=gk(e),n=Ur(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),za(n)}function my(e,t){const n=t*7;return tr(e,n)}function AJ(e,t){return $o(e,t*12)}function IJ(e){let t;return e.forEach(function(n){const r=Rt(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function NJ(e){let t;return e.forEach(n=>{const r=Rt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function mr(e,t){const n=pc(e),r=pc(t);return+n==+r}function Tw(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function LJ(e){if(!Tw(e)&&typeof e!="number")return!1;const t=Rt(e);return!isNaN(Number(t))}function td(e,t){const n=Rt(e),r=Rt(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function FJ(e,t,n){const r=Zo(e,n),o=Zo(t,n),i=+r-Bp(r),s=+o-Bp(o);return Math.round((i-s)/Dw)}function kw(e){const t=Rt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function br(e){const t=Rt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function mk(e){const t=Rt(e),n=Ur(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Mw(e,t){var a,l,c,u;const n=ef(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=Rt(e),i=o.getDay(),s=(i<r?-7:0)+6-(i-r);return o.setDate(o.getDate()+s),o.setHours(23,59,59,999),o}function vk(e){return Mw(e,{weekStartsOn:1})}const zJ={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"}},jJ=(e,t,n)=>{let r;const o=zJ[e];return typeof o=="string"?r=o:t===1?r=o.one:r=o.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function mb(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const BJ={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},VJ={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},HJ={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},WJ={date:mb({formats:BJ,defaultWidth:"full"}),time:mb({formats:VJ,defaultWidth:"full"}),dateTime:mb({formats:HJ,defaultWidth:"full"})},UJ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},qJ=(e,t,n,r)=>UJ[e];function lu(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&e.formattingValues){const s=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):s;o=e.formattingValues[a]||e.formattingValues[s]}else{const s=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;o=e.values[a]||e.values[s]}const i=e.argumentCallback?e.argumentCallback(t):t;return o[i]}}const GJ={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},YJ={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},KJ={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"]},XJ={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"]},QJ={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"}},JJ={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"}},ZJ=(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"},eZ={ordinalNumber:ZJ,era:lu({values:GJ,defaultWidth:"wide"}),quarter:lu({values:YJ,defaultWidth:"wide",argumentCallback:e=>e-1}),month:lu({values:KJ,defaultWidth:"wide"}),day:lu({values:XJ,defaultWidth:"wide"}),dayPeriod:lu({values:QJ,defaultWidth:"wide",formattingValues:JJ,defaultFormattingWidth:"wide"})};function cu(e){return(t,n={})=>{const r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;const s=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?nZ(a,f=>f.test(s)):tZ(a,f=>f.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(s.length);return{value:c,rest:u}}}function tZ(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function nZ(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function rZ(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const o=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=n.valueCallback?n.valueCallback(s):s;const a=t.slice(o.length);return{value:s,rest:a}}}const oZ=/^(\d+)(th|st|nd|rd)?/i,iZ=/\d+/i,sZ={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},aZ={any:[/^b/i,/^(a|c)/i]},lZ={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},cZ={any:[/1/i,/2/i,/3/i,/4/i]},uZ={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},dZ={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]},fZ={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},hZ={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]},pZ={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},gZ={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}},mZ={ordinalNumber:rZ({matchPattern:oZ,parsePattern:iZ,valueCallback:e=>parseInt(e,10)}),era:cu({matchPatterns:sZ,defaultMatchWidth:"wide",parsePatterns:aZ,defaultParseWidth:"any"}),quarter:cu({matchPatterns:lZ,defaultMatchWidth:"wide",parsePatterns:cZ,defaultParseWidth:"any",valueCallback:e=>e+1}),month:cu({matchPatterns:uZ,defaultMatchWidth:"wide",parsePatterns:dZ,defaultParseWidth:"any"}),day:cu({matchPatterns:fZ,defaultMatchWidth:"wide",parsePatterns:hZ,defaultParseWidth:"any"}),dayPeriod:cu({matchPatterns:pZ,defaultMatchWidth:"any",parsePatterns:gZ,defaultParseWidth:"any"})},bk={code:"en-US",formatDistance:jJ,formatLong:WJ,formatRelative:qJ,localize:eZ,match:mZ,options:{weekStartsOn:0,firstWeekContainsDate:1}};function vZ(e){const t=Rt(e);return Go(t,mk(t))+1}function yk(e){const t=Rt(e),n=+za(t)-+MJ(t);return Math.round(n/Dw)+1}function xk(e,t){var u,f,g,p;const n=Rt(e),r=n.getFullYear(),o=ef(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(g=o.locale)==null?void 0:g.options)==null?void 0:p.firstWeekContainsDate)??1,s=Ur(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=Zo(s,t),l=Ur(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=Zo(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function bZ(e,t){var a,l,c,u;const n=ef(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,o=xk(e,t),i=Ur(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),Zo(i,t)}function wk(e,t){const n=Rt(e),r=+Zo(n,t)-+bZ(n,t);return Math.round(r/Dw)+1}function Lt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ts={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Lt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Lt(n+1,2)},d(e,t){return Lt(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 Lt(e.getHours()%12||12,t.length)},H(e,t){return Lt(e.getHours(),t.length)},m(e,t){return Lt(e.getMinutes(),t.length)},s(e,t){return Lt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Lt(o,t.length)}},Sl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},eP={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(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return ts.y(e,t)},Y:function(e,t,n,r){const o=xk(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return Lt(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Lt(i,t.length)},R:function(e,t){const n=gk(e);return Lt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Lt(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 Lt(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 Lt(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 ts.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 Lt(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 o=wk(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Lt(o,t.length)},I:function(e,t,n){const r=yk(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Lt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ts.d(e,t)},D:function(e,t,n){const r=vZ(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Lt(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 o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Lt(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const o=e.getDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Lt(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),o=r===0?7:r;switch(t){case"i":return String(o);case"ii":return Lt(o,t.length);case"io":return n.ordinalNumber(o,{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 o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let o;switch(r===12?o=Sl.noon:r===0?o=Sl.midnight:o=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let o;switch(r>=17?o=Sl.evening:r>=12?o=Sl.afternoon:r>=4?o=Sl.morning:o=Sl.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(o,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(o,{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 ts.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ts.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Lt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Lt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ts.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ts.s(e,t)},S:function(e,t){return ts.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return nP(r);case"XXXX":case"XX":return ca(r);case"XXXXX":case"XXX":default:return ca(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return nP(r);case"xxxx":case"xx":return ca(r);case"xxxxx":case"xxx":default:return ca(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+tP(r,":");case"OOOO":default:return"GMT"+ca(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+tP(r,":");case"zzzz":default:return"GMT"+ca(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Lt(r,t.length)},T:function(e,t,n){const r=e.getTime();return Lt(r,t.length)}};function tP(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Math.trunc(r/60),i=r%60;return i===0?n+String(o):n+String(o)+t+Lt(i,2)}function nP(e,t){return e%60===0?(e>0?"-":"+")+Lt(Math.abs(e)/60,2):ca(e,t)}function ca(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Lt(Math.trunc(r/60),2),i=Lt(r%60,2);return n+o+t+i}const rP=(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"})}},_k=(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"})}},yZ=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return rP(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",rP(r,t)).replace("{{time}}",_k(o,t))},xZ={p:_k,P:yZ},wZ=/^D+$/,_Z=/^Y+$/,SZ=["D","DD","YY","YYYY"];function CZ(e){return wZ.test(e)}function EZ(e){return _Z.test(e)}function RZ(e,t,n){const r=PZ(e,t,n);if(console.warn(r),SZ.includes(e))throw new RangeError(r)}function PZ(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 OZ=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$Z=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,DZ=/^'([^]*?)'?$/,TZ=/''/g,kZ=/[a-zA-Z]/;function Ko(e,t,n){var u,f,g,p,v,y,x,w;const r=ef(),o=(n==null?void 0:n.locale)??r.locale??bk,i=(n==null?void 0:n.firstWeekContainsDate)??((f=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(g=r.locale)==null?void 0:g.options)==null?void 0:p.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((y=(v=n==null?void 0:n.locale)==null?void 0:v.options)==null?void 0:y.weekStartsOn)??r.weekStartsOn??((w=(x=r.locale)==null?void 0:x.options)==null?void 0:w.weekStartsOn)??0,a=Rt(e);if(!LJ(a))throw new RangeError("Invalid time value");let l=t.match($Z).map(_=>{const S=_[0];if(S==="p"||S==="P"){const R=xZ[S];return R(_,o.formatLong)}return _}).join("").match(OZ).map(_=>{if(_==="''")return{isToken:!1,value:"'"};const S=_[0];if(S==="'")return{isToken:!1,value:MZ(_)};if(eP[S])return{isToken:!0,value:_};if(S.match(kZ))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:_}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(_=>{if(!_.isToken)return _.value;const S=_.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&EZ(S)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&CZ(S))&&RZ(S,t,String(e));const R=eP[S[0]];return R(a,S,o.localize,c)}).join("")}function MZ(e){const t=e.match(DZ);return t?t[1].replace(TZ,"'"):e}function AZ(e){const t=Rt(e),n=t.getFullYear(),r=t.getMonth(),o=Ur(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function IZ(e){return Math.trunc(+Rt(e)/1e3)}function NZ(e){const t=Rt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function LZ(e,t){return FJ(NZ(e),br(e),t)+1}function vy(e,t){const n=Rt(e),r=Rt(t);return n.getTime()>r.getTime()}function Sk(e,t){const n=Rt(e),r=Rt(t);return+n<+r}function Aw(e,t){const n=Rt(e),r=Rt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function FZ(e,t){const n=Rt(e),r=Rt(t);return n.getFullYear()===r.getFullYear()}function vb(e,t){return tr(e,-t)}function bb(e,t){const n=Rt(e),r=n.getFullYear(),o=n.getDate(),i=Ur(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=AZ(i);return n.setMonth(t,Math.min(o,s)),n}function oP(e,t){const n=Rt(e);return isNaN(+n)?Ur(e,NaN):(n.setFullYear(t),n)}var Qe=function(){return Qe=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Qe.apply(this,arguments)};function zZ(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Ck(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var by={exports:{}},uu={};/**
283
+ * @license React
284
+ * react-jsx-runtime.development.js
285
+ *
286
+ * Copyright (c) Facebook, Inc. and its affiliates.
287
+ *
288
+ * This source code is licensed under the MIT license found in the
289
+ * LICENSE file in the root directory of this source tree.
290
+ */var iP;function jZ(){return iP||(iP=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),v=Symbol.iterator,y="@@iterator";function x(P){if(P===null||typeof P!="object")return null;var K=v&&P[v]||P[y];return typeof K=="function"?K:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(P){{for(var K=arguments.length,ae=new Array(K>1?K-1:0),Se=1;Se<K;Se++)ae[Se-1]=arguments[Se];S("error",P,ae)}}function S(P,K,ae){{var Se=w.ReactDebugCurrentFrame,je=Se.getStackAddendum();je!==""&&(K+="%s",ae=ae.concat([je]));var Ve=ae.map(function(Ae){return String(Ae)});Ve.unshift("Warning: "+K),Function.prototype.apply.call(console[P],console,Ve)}}var R=!1,E=!1,O=!1,k=!1,T=!1,M;M=Symbol.for("react.module.reference");function F(P){return!!(typeof P=="string"||typeof P=="function"||P===r||P===i||T||P===o||P===c||P===u||k||P===p||R||E||O||typeof P=="object"&&P!==null&&(P.$$typeof===g||P.$$typeof===f||P.$$typeof===s||P.$$typeof===a||P.$$typeof===l||P.$$typeof===M||P.getModuleId!==void 0))}function z(P,K,ae){var Se=P.displayName;if(Se)return Se;var je=K.displayName||K.name||"";return je!==""?ae+"("+je+")":ae}function B(P){return P.displayName||"Context"}function Y(P){if(P==null)return null;if(typeof P.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof P=="function")return P.displayName||P.name||null;if(typeof P=="string")return P;switch(P){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof P=="object")switch(P.$$typeof){case a:var K=P;return B(K)+".Consumer";case s:var ae=P;return B(ae._context)+".Provider";case l:return z(P,P.render,"ForwardRef");case f:var Se=P.displayName||null;return Se!==null?Se:Y(P.type)||"Memo";case g:{var je=P,Ve=je._payload,Ae=je._init;try{return Y(Ae(Ve))}catch{return null}}}return null}var G=Object.assign,j=0,ee,q,X,re,$,H,ne;function I(){}I.__reactDisabledLog=!0;function ce(){{if(j===0){ee=console.log,q=console.info,X=console.warn,re=console.error,$=console.group,H=console.groupCollapsed,ne=console.groupEnd;var P={configurable:!0,enumerable:!0,value:I,writable:!0};Object.defineProperties(console,{info:P,log:P,warn:P,error:P,group:P,groupCollapsed:P,groupEnd:P})}j++}}function ge(){{if(j--,j===0){var P={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:G({},P,{value:ee}),info:G({},P,{value:q}),warn:G({},P,{value:X}),error:G({},P,{value:re}),group:G({},P,{value:$}),groupCollapsed:G({},P,{value:H}),groupEnd:G({},P,{value:ne})})}j<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var he=w.ReactCurrentDispatcher,de;function oe(P,K,ae){{if(de===void 0)try{throw Error()}catch(je){var Se=je.stack.trim().match(/\n( *(at )?)/);de=Se&&Se[1]||""}return`
291
+ `+de+P}}var Z=!1,ie;{var ye=typeof WeakMap=="function"?WeakMap:Map;ie=new ye}function W(P,K){if(!P||Z)return"";{var ae=ie.get(P);if(ae!==void 0)return ae}var Se;Z=!0;var je=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ve;Ve=he.current,he.current=null,ce();try{if(K){var Ae=function(){throw Error()};if(Object.defineProperty(Ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ae,[])}catch(tn){Se=tn}Reflect.construct(P,[],Ae)}else{try{Ae.call()}catch(tn){Se=tn}P.call(Ae.prototype)}}else{try{throw Error()}catch(tn){Se=tn}P()}}catch(tn){if(tn&&Se&&typeof tn.stack=="string"){for(var ke=tn.stack.split(`
292
+ `),Et=Se.stack.split(`
293
+ `),et=ke.length-1,rt=Et.length-1;et>=1&&rt>=0&&ke[et]!==Et[rt];)rt--;for(;et>=1&&rt>=0;et--,rt--)if(ke[et]!==Et[rt]){if(et!==1||rt!==1)do if(et--,rt--,rt<0||ke[et]!==Et[rt]){var jt=`
294
+ `+ke[et].replace(" at new "," at ");return P.displayName&&jt.includes("<anonymous>")&&(jt=jt.replace("<anonymous>",P.displayName)),typeof P=="function"&&ie.set(P,jt),jt}while(et>=1&&rt>=0);break}}}finally{Z=!1,he.current=Ve,ge(),Error.prepareStackTrace=je}var Rn=P?P.displayName||P.name:"",Hs=Rn?oe(Rn):"";return typeof P=="function"&&ie.set(P,Hs),Hs}function me(P,K,ae){return W(P,!1)}function _e(P){var K=P.prototype;return!!(K&&K.isReactComponent)}function Pe(P,K,ae){if(P==null)return"";if(typeof P=="function")return W(P,_e(P));if(typeof P=="string")return oe(P);switch(P){case c:return oe("Suspense");case u:return oe("SuspenseList")}if(typeof P=="object")switch(P.$$typeof){case l:return me(P.render);case f:return Pe(P.type,K,ae);case g:{var Se=P,je=Se._payload,Ve=Se._init;try{return Pe(Ve(je),K,ae)}catch{}}}return""}var $e=Object.prototype.hasOwnProperty,Ue={},ze=w.ReactDebugCurrentFrame;function Ne(P){if(P){var K=P._owner,ae=Pe(P.type,P._source,K?K.type:null);ze.setExtraStackFrame(ae)}else ze.setExtraStackFrame(null)}function Xe(P,K,ae,Se,je){{var Ve=Function.call.bind($e);for(var Ae in P)if(Ve(P,Ae)){var ke=void 0;try{if(typeof P[Ae]!="function"){var Et=Error((Se||"React class")+": "+ae+" type `"+Ae+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof P[Ae]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Et.name="Invariant Violation",Et}ke=P[Ae](K,Ae,Se,ae,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(et){ke=et}ke&&!(ke instanceof Error)&&(Ne(je),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Se||"React class",ae,Ae,typeof ke),Ne(null)),ke instanceof Error&&!(ke.message in Ue)&&(Ue[ke.message]=!0,Ne(je),_("Failed %s type: %s",ae,ke.message),Ne(null))}}}var gt=Array.isArray;function It(P){return gt(P)}function zt(P){{var K=typeof Symbol=="function"&&Symbol.toStringTag,ae=K&&P[Symbol.toStringTag]||P.constructor.name||"Object";return ae}}function ln(P){try{return le(P),!1}catch{return!0}}function le(P){return""+P}function Ce(P){if(ln(P))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",zt(P)),le(P)}var Le=w.ReactCurrentOwner,qe={key:!0,ref:!0,__self:!0,__source:!0},dt,rn,on;on={};function fn(P){if($e.call(P,"ref")){var K=Object.getOwnPropertyDescriptor(P,"ref").get;if(K&&K.isReactWarning)return!1}return P.ref!==void 0}function zn(P){if($e.call(P,"key")){var K=Object.getOwnPropertyDescriptor(P,"key").get;if(K&&K.isReactWarning)return!1}return P.key!==void 0}function wr(P,K){if(typeof P.ref=="string"&&Le.current&&K&&Le.current.stateNode!==K){var ae=Y(Le.current.type);on[ae]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',Y(Le.current.type),P.ref),on[ae]=!0)}}function hn(P,K){{var ae=function(){dt||(dt=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",K))};ae.isReactWarning=!0,Object.defineProperty(P,"key",{get:ae,configurable:!0})}}function nr(P,K){{var ae=function(){rn||(rn=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",K))};ae.isReactWarning=!0,Object.defineProperty(P,"ref",{get:ae,configurable:!0})}}var Tn=function(P,K,ae,Se,je,Ve,Ae){var ke={$$typeof:t,type:P,key:K,ref:ae,props:Ae,_owner:Ve};return ke._store={},Object.defineProperty(ke._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ke,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Se}),Object.defineProperty(ke,"_source",{configurable:!1,enumerable:!1,writable:!1,value:je}),Object.freeze&&(Object.freeze(ke.props),Object.freeze(ke)),ke};function Oc(P,K,ae,Se,je){{var Ve,Ae={},ke=null,Et=null;ae!==void 0&&(Ce(ae),ke=""+ae),zn(K)&&(Ce(K.key),ke=""+K.key),fn(K)&&(Et=K.ref,wr(K,je));for(Ve in K)$e.call(K,Ve)&&!qe.hasOwnProperty(Ve)&&(Ae[Ve]=K[Ve]);if(P&&P.defaultProps){var et=P.defaultProps;for(Ve in et)Ae[Ve]===void 0&&(Ae[Ve]=et[Ve])}if(ke||Et){var rt=typeof P=="function"?P.displayName||P.name||"Unknown":P;ke&&hn(Ae,rt),Et&&nr(Ae,rt)}return Tn(P,ke,Et,je,Se,Le.current,Ae)}}var ai=w.ReactCurrentOwner,Is=w.ReactDebugCurrentFrame;function jn(P){if(P){var K=P._owner,ae=Pe(P.type,P._source,K?K.type:null);Is.setExtraStackFrame(ae)}else Is.setExtraStackFrame(null)}var ko;ko=!1;function li(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function Ns(){{if(ai.current){var P=Y(ai.current.type);if(P)return`
295
+
296
+ Check the render method of \``+P+"`."}return""}}function $c(P){{if(P!==void 0){var K=P.fileName.replace(/^.*[\\\/]/,""),ae=P.lineNumber;return`
297
+
298
+ Check your code at `+K+":"+ae+"."}return""}}var Ls={};function Za(P){{var K=Ns();if(!K){var ae=typeof P=="string"?P:P.displayName||P.name;ae&&(K=`
299
+
300
+ Check the top-level render call using <`+ae+">.")}return K}}function Fs(P,K){{if(!P._store||P._store.validated||P.key!=null)return;P._store.validated=!0;var ae=Za(K);if(Ls[ae])return;Ls[ae]=!0;var Se="";P&&P._owner&&P._owner!==ai.current&&(Se=" It was passed a child from "+Y(P._owner.type)+"."),jn(P),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',ae,Se),jn(null)}}function zs(P,K){{if(typeof P!="object")return;if(It(P))for(var ae=0;ae<P.length;ae++){var Se=P[ae];li(Se)&&Fs(Se,K)}else if(li(P))P._store&&(P._store.validated=!0);else if(P){var je=x(P);if(typeof je=="function"&&je!==P.entries)for(var Ve=je.call(P),Ae;!(Ae=Ve.next()).done;)li(Ae.value)&&Fs(Ae.value,K)}}}function Dc(P){{var K=P.type;if(K==null||typeof K=="string")return;var ae;if(typeof K=="function")ae=K.propTypes;else if(typeof K=="object"&&(K.$$typeof===l||K.$$typeof===f))ae=K.propTypes;else return;if(ae){var Se=Y(K);Xe(ae,P.props,"prop",Se,P)}else if(K.PropTypes!==void 0&&!ko){ko=!0;var je=Y(K);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",je||"Unknown")}typeof K.getDefaultProps=="function"&&!K.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function js(P){{for(var K=Object.keys(P.props),ae=0;ae<K.length;ae++){var Se=K[ae];if(Se!=="children"&&Se!=="key"){jn(P),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Se),jn(null);break}}P.ref!==null&&(jn(P),_("Invalid attribute `ref` supplied to `React.Fragment`."),jn(null))}}function Bs(P,K,ae,Se,je,Ve){{var Ae=F(P);if(!Ae){var ke="";(P===void 0||typeof P=="object"&&P!==null&&Object.keys(P).length===0)&&(ke+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Et=$c(je);Et?ke+=Et:ke+=Ns();var et;P===null?et="null":It(P)?et="array":P!==void 0&&P.$$typeof===t?(et="<"+(Y(P.type)||"Unknown")+" />",ke=" Did you accidentally export a JSX literal instead of a component?"):et=typeof P,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",et,ke)}var rt=Oc(P,K,ae,je,Ve);if(rt==null)return rt;if(Ae){var jt=K.children;if(jt!==void 0)if(Se)if(It(jt)){for(var Rn=0;Rn<jt.length;Rn++)zs(jt[Rn],P);Object.freeze&&Object.freeze(jt)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else zs(jt,P)}return P===r?js(rt):Dc(rt),rt}}function Vs(P,K,ae){return Bs(P,K,ae,!0)}function Tc(P,K,ae){return Bs(P,K,ae,!1)}var kc=Tc,Mc=Vs;uu.Fragment=r,uu.jsx=kc,uu.jsxs=Mc}()),uu}var du={};/**
301
+ * @license React
302
+ * react-jsx-runtime.production.min.js
303
+ *
304
+ * Copyright (c) Facebook, Inc. and its affiliates.
305
+ *
306
+ * This source code is licensed under the MIT license found in the
307
+ * LICENSE file in the root directory of this source tree.
308
+ */var sP;function BZ(){if(sP)return du;sP=1;var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,f={},g=null,p=null;c!==void 0&&(g=""+c),l.key!==void 0&&(g=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(f[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)f[u]===void 0&&(f[u]=l[u]);return{$$typeof:t,type:a,key:g,ref:p,props:f,_owner:o.current}}return du.Fragment=n,du.jsx=s,du.jsxs=s,du}process.env.NODE_ENV==="production"?by.exports=BZ():by.exports=jZ();var xe=by.exports;function tf(e){return e.mode==="multiple"}function nf(e){return e.mode==="range"}function qg(e){return e.mode==="single"}var VZ={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function HZ(e,t){return Ko(e,"LLLL y",t)}function WZ(e,t){return Ko(e,"d",t)}function UZ(e,t){return Ko(e,"LLLL",t)}function qZ(e){return"".concat(e)}function GZ(e,t){return Ko(e,"cccccc",t)}function YZ(e,t){return Ko(e,"yyyy",t)}var KZ=Object.freeze({__proto__:null,formatCaption:HZ,formatDay:WZ,formatMonthCaption:UZ,formatWeekNumber:qZ,formatWeekdayName:GZ,formatYearCaption:YZ}),XZ=function(e,t,n){return Ko(e,"do MMMM (EEEE)",n)},QZ=function(){return"Month: "},JZ=function(){return"Go to next month"},ZZ=function(){return"Go to previous month"},eee=function(e,t){return Ko(e,"cccc",t)},tee=function(e){return"Week n. ".concat(e)},nee=function(){return"Year: "},ree=Object.freeze({__proto__:null,labelDay:XZ,labelMonthDropdown:QZ,labelNext:JZ,labelPrevious:ZZ,labelWeekNumber:tee,labelWeekday:eee,labelYearDropdown:nee});function oee(){var e="buttons",t=VZ,n=bk,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:KZ,labels:ree,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function iee(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=br(r):t&&(i=new Date(t,0,1)),o?s=kw(o):n&&(s=new Date(n,11,31)),{fromDate:i?pc(i):void 0,toDate:s?pc(s):void 0}}var Ek=m.createContext(void 0);function see(e){var t,n=e.initialProps,r=oee(),o=iee(n),i=o.fromDate,s=o.toDate,a=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;a!=="buttons"&&(!i||!s)&&(a="buttons");var l;(qg(n)||tf(n)||nf(n))&&(l=n.onSelect);var c=Qe(Qe(Qe({},r),n),{captionLayout:a,classNames:Qe(Qe({},r.classNames),n.classNames),components:Qe({},n.components),formatters:Qe(Qe({},r.formatters),n.formatters),fromDate:i,labels:Qe(Qe({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:Qe(Qe({},r.modifiers),n.modifiers),modifiersClassNames:Qe(Qe({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:Qe(Qe({},r.styles),n.styles),toDate:s});return xe.jsx(Ek.Provider,{value:c,children:e.children})}function qt(){var e=m.useContext(Ek);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function Rk(e){var t=qt(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return xe.jsx("div",{className:r.caption_label,style:o.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function aee(e){return xe.jsx("svg",Qe({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:xe.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function Pk(e){var t,n,r=e.onChange,o=e.value,i=e.children,s=e.caption,a=e.className,l=e.style,c=qt(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:aee;return xe.jsxs("div",{className:a,style:l,children:[xe.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),xe.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:i}),xe.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,xe.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function lee(e){var t,n=qt(),r=n.fromDate,o=n.toDate,i=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return xe.jsx(xe.Fragment,{});if(!o)return xe.jsx(xe.Fragment,{});var f=[];if(FZ(r,o))for(var g=br(r),p=r.getMonth();p<=o.getMonth();p++)f.push(bb(g,p));else for(var g=br(new Date),p=0;p<=11;p++)f.push(bb(g,p));var v=function(x){var w=Number(x.target.value),_=bb(br(e.displayMonth),w);e.onChange(_)},y=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:Pk;return xe.jsx(y,{name:"months","aria-label":u(),className:l.dropdown_month,style:i.dropdown_month,onChange:v,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:f.map(function(x){return xe.jsx("option",{value:x.getMonth(),children:a(x,{locale:s})},x.getMonth())})})}function cee(e){var t,n=e.displayMonth,r=qt(),o=r.fromDate,i=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,g=[];if(!o)return xe.jsx(xe.Fragment,{});if(!i)return xe.jsx(xe.Fragment,{});for(var p=o.getFullYear(),v=i.getFullYear(),y=p;y<=v;y++)g.push(oP(mk(new Date),y));var x=function(_){var S=oP(br(n),Number(_.target.value));e.onChange(S)},w=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:Pk;return xe.jsx(w,{name:"years","aria-label":f(),className:l.dropdown_year,style:a.dropdown_year,onChange:x,value:n.getFullYear(),caption:u(n,{locale:s}),children:g.map(function(_){return xe.jsx("option",{value:_.getFullYear(),children:u(_,{locale:s})},_.getFullYear())})})}function uee(e,t){var n=m.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function dee(e){var t=e.month,n=e.defaultMonth,r=e.today,o=t||n||r||new Date,i=e.toDate,s=e.fromDate,a=e.numberOfMonths,l=a===void 0?1:a;if(i&&td(i,o)<0){var c=-1*(l-1);o=$o(i,c)}return s&&td(o,s)<0&&(o=s),br(o)}function fee(){var e=qt(),t=dee(e),n=uee(t,e.month),r=n[0],o=n[1],i=function(s){var a;if(!e.disableNavigation){var l=br(s);o(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,i]}function hee(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=br(e),i=br($o(o,r)),s=td(i,o),a=[],l=0;l<s;l++){var c=$o(o,l);a.push(c)}return n&&(a=a.reverse()),a}function pee(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,s=r?i:1,a=br(e);if(!n)return $o(a,s);var l=td(n,e);if(!(l<i))return $o(a,s)}}function gee(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,o=t.numberOfMonths,i=o===void 0?1:o,s=r?i:1,a=br(e);if(!n)return $o(a,-s);var l=td(a,n);if(!(l<=0))return $o(a,-s)}}var Ok=m.createContext(void 0);function mee(e){var t=qt(),n=fee(),r=n[0],o=n[1],i=hee(r,t),s=pee(r,t),a=gee(r,t),l=function(f){return i.some(function(g){return Aw(f,g)})},c=function(f,g){l(f)||(g&&Sk(f,g)?o($o(f,1+t.numberOfMonths*-1)):o(f))},u={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return xe.jsx(Ok.Provider,{value:u,children:e.children})}function rf(){var e=m.useContext(Ok);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function aP(e){var t,n=qt(),r=n.classNames,o=n.styles,i=n.components,s=rf().goToMonth,a=function(u){s($o(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:Rk,c=xe.jsx(l,{id:e.id,displayMonth:e.displayMonth});return xe.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[xe.jsx("div",{className:r.vhidden,children:c}),xe.jsx(lee,{onChange:a,displayMonth:e.displayMonth}),xe.jsx(cee,{onChange:a,displayMonth:e.displayMonth})]})}function vee(e){return xe.jsx("svg",Qe({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:xe.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function bee(e){return xe.jsx("svg",Qe({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:xe.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Vp=m.forwardRef(function(e,t){var n=qt(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var s=i.join(" "),a=Qe(Qe({},o.button_reset),o.button);return e.style&&Object.assign(a,e.style),xe.jsx("button",Qe({},e,{ref:t,type:"button",className:s,style:a}))});function yee(e){var t,n,r=qt(),o=r.dir,i=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return xe.jsx(xe.Fragment,{});var g=c(e.previousMonth,{locale:i}),p=[s.nav_button,s.nav_button_previous].join(" "),v=u(e.nextMonth,{locale:i}),y=[s.nav_button,s.nav_button_next].join(" "),x=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:bee,w=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:vee;return xe.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&xe.jsx(Vp,{name:"previous-month","aria-label":g,className:p,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?xe.jsx(x,{className:s.nav_icon,style:a.nav_icon}):xe.jsx(w,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&xe.jsx(Vp,{name:"next-month","aria-label":v,className:y,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?xe.jsx(w,{className:s.nav_icon,style:a.nav_icon}):xe.jsx(x,{className:s.nav_icon,style:a.nav_icon})})]})}function lP(e){var t=qt().numberOfMonths,n=rf(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(v){return Aw(e.displayMonth,v)}),l=a===0,c=a===s.length-1,u=t>1&&(l||!c),f=t>1&&(c||!l),g=function(){r&&i(r)},p=function(){o&&i(o)};return xe.jsx(yee,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:f,nextMonth:o,previousMonth:r,onPreviousClick:g,onNextClick:p})}function xee(e){var t,n=qt(),r=n.classNames,o=n.disableNavigation,i=n.styles,s=n.captionLayout,a=n.components,l=(t=a==null?void 0:a.CaptionLabel)!==null&&t!==void 0?t:Rk,c;return o?c=xe.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=xe.jsx(aP,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=xe.jsxs(xe.Fragment,{children:[xe.jsx(aP,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),xe.jsx(lP,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=xe.jsxs(xe.Fragment,{children:[xe.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),xe.jsx(lP,{displayMonth:e.displayMonth,id:e.id})]}),xe.jsx("div",{className:r.caption,style:i.caption,children:c})}function wee(e){var t=qt(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?xe.jsx("tfoot",{className:o,style:r.tfoot,children:xe.jsx("tr",{children:xe.jsx("td",{colSpan:8,children:n})})}):xe.jsx(xe.Fragment,{})}function _ee(e,t,n){for(var r=n?za(new Date):Zo(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=tr(r,i);o.push(s)}return o}function See(){var e=qt(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,i=e.weekStartsOn,s=e.ISOWeek,a=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=_ee(o,i,s);return xe.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&xe.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,f){return xe.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:o}),children:a(u,{locale:o})},f)})]})}function Cee(){var e,t=qt(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:See;return xe.jsx("thead",{style:r.head,className:n.head,children:xe.jsx(i,{})})}function Eee(e){var t=qt(),n=t.locale,r=t.formatters.formatDay;return xe.jsx(xe.Fragment,{children:r(e.date,{locale:n})})}var Iw=m.createContext(void 0);function Ree(e){if(!tf(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return xe.jsx(Iw.Provider,{value:t,children:e.children})}return xe.jsx(Pee,{initialProps:e.initialProps,children:e.children})}function Pee(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,s=function(c,u,f){var g,p;(g=t.onDayClick)===null||g===void 0||g.call(t,c,u,f);var v=!!(u.selected&&o&&(r==null?void 0:r.length)===o);if(!v){var y=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!y){var x=r?Ck([],r,!0):[];if(u.selected){var w=x.findIndex(function(_){return mr(c,_)});x.splice(w,1)}else x.push(c);(p=t.onSelect)===null||p===void 0||p.call(t,x,c,u,f)}}},a={disabled:[]};r&&a.disabled.push(function(c){var u=i&&r.length>i-1,f=r.some(function(g){return mr(g,c)});return!!(u&&!f)});var l={selected:r,onDayClick:s,modifiers:a};return xe.jsx(Iw.Provider,{value:l,children:n})}function Nw(){var e=m.useContext(Iw);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function Oee(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?mr(o,e)&&mr(r,e)?void 0:mr(o,e)?{from:o,to:void 0}:mr(r,e)?void 0:vy(r,e)?{from:e,to:o}:{from:r,to:e}:o?vy(e,o)?{from:o,to:e}:{from:e,to:o}:r?Sk(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var Lw=m.createContext(void 0);function $ee(e){if(!nf(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return xe.jsx(Lw.Provider,{value:t,children:e.children})}return xe.jsx(Dee,{initialProps:e.initialProps,children:e.children})}function Dee(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},i=o.from,s=o.to,a=t.min,l=t.max,c=function(p,v,y){var x,w;(x=t.onDayClick)===null||x===void 0||x.call(t,p,v,y);var _=Oee(p,r);(w=t.onSelect)===null||w===void 0||w.call(t,_,p,v,y)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],s?(u.range_end=[s],mr(i,s)||(u.range_middle=[{after:i,before:s}])):u.range_end=[i]):s&&(u.range_start=[s],u.range_end=[s]),a&&(i&&!s&&u.disabled.push({after:vb(i,a-1),before:tr(i,a-1)}),i&&s&&u.disabled.push({after:i,before:tr(i,a-1)}),!i&&s&&u.disabled.push({after:vb(s,a-1),before:tr(s,a-1)})),l){if(i&&!s&&(u.disabled.push({before:tr(i,-l+1)}),u.disabled.push({after:tr(i,l-1)})),i&&s){var f=Go(s,i)+1,g=l-f;u.disabled.push({before:vb(i,g)}),u.disabled.push({after:tr(s,g)})}!i&&s&&(u.disabled.push({before:tr(s,-l+1)}),u.disabled.push({after:tr(s,l-1)}))}return xe.jsx(Lw.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function Fw(){var e=m.useContext(Lw);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function up(e){return Array.isArray(e)?Ck([],e,!0):e!==void 0?[e]:[]}function Tee(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=up(o)}),t}var Do;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(Do||(Do={}));var kee=Do.Selected,xi=Do.Disabled,Mee=Do.Hidden,Aee=Do.Today,yb=Do.RangeEnd,xb=Do.RangeMiddle,wb=Do.RangeStart,Iee=Do.Outside;function Nee(e,t,n){var r,o=(r={},r[kee]=up(e.selected),r[xi]=up(e.disabled),r[Mee]=up(e.hidden),r[Aee]=[e.today],r[yb]=[],r[xb]=[],r[wb]=[],r[Iee]=[],r);return e.fromDate&&o[xi].push({before:e.fromDate}),e.toDate&&o[xi].push({after:e.toDate}),tf(e)?o[xi]=o[xi].concat(t.modifiers[xi]):nf(e)&&(o[xi]=o[xi].concat(n.modifiers[xi]),o[wb]=n.modifiers[wb],o[xb]=n.modifiers[xb],o[yb]=n.modifiers[yb]),o}var $k=m.createContext(void 0);function Lee(e){var t=qt(),n=Nw(),r=Fw(),o=Nee(t,n,r),i=Tee(t.modifiers),s=Qe(Qe({},o),i);return xe.jsx($k.Provider,{value:s,children:e.children})}function Dk(){var e=m.useContext($k);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Fee(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function zee(e){return!!(e&&typeof e=="object"&&"from"in e)}function jee(e){return!!(e&&typeof e=="object"&&"after"in e)}function Bee(e){return!!(e&&typeof e=="object"&&"before"in e)}function Vee(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Hee(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=Go(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var s=Go(e,r)>=0&&Go(o,e)>=0;return s}return o?mr(o,e):r?mr(r,e):!1}function Wee(e){return Tw(e)}function Uee(e){return Array.isArray(e)&&e.every(Tw)}function qee(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Wee(n))return mr(e,n);if(Uee(n))return n.includes(e);if(zee(n))return Hee(e,n);if(Vee(n))return n.dayOfWeek.includes(e.getDay());if(Fee(n)){var r=Go(n.before,e),o=Go(n.after,e),i=r>0,s=o<0,a=vy(n.before,n.after);return a?s&&i:i||s}return jee(n)?Go(e,n.after)>0:Bee(n)?Go(n.before,e)>0:typeof n=="function"?n(e):!1})}function zw(e,t,n){var r=Object.keys(t).reduce(function(i,s){var a=t[s];return qee(e,a)&&i.push(s),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!Aw(e,n)&&(o.outside=!0),o}function Gee(e,t){for(var n=br(e[0]),r=kw(e[e.length-1]),o,i,s=n;s<=r;){var a=zw(s,t),l=!a.disabled&&!a.hidden;if(!l){s=tr(s,1);continue}if(a.selected)return s;a.today&&!i&&(i=s),o||(o=s),s=tr(s,1)}return i||o}var Yee=365;function Tk(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,s=t.retry,a=s===void 0?{count:0,lastFocused:e}:s,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,f=o.locale,g={day:tr,week:my,month:$o,year:AJ,startOfWeek:function(x){return o.ISOWeek?za(x):Zo(x,{locale:f,weekStartsOn:l})},endOfWeek:function(x){return o.ISOWeek?vk(x):Mw(x,{locale:f,weekStartsOn:l})}},p=g[n](e,r==="after"?1:-1);r==="before"&&c?p=IJ([c,p]):r==="after"&&u&&(p=NJ([u,p]));var v=!0;if(i){var y=zw(p,i);v=!y.disabled&&!y.hidden}return v?p:a.count>Yee?a.lastFocused:Tk(p,{moveBy:n,direction:r,context:o,modifiers:i,retry:Qe(Qe({},a),{count:a.count+1})})}var kk=m.createContext(void 0);function Kee(e){var t=rf(),n=Dk(),r=m.useState(),o=r[0],i=r[1],s=m.useState(),a=s[0],l=s[1],c=Gee(t.displayMonths,n),u=o??(a&&t.isDateDisplayed(a))?a:c,f=function(){l(o),i(void 0)},g=function(x){i(x)},p=qt(),v=function(x,w){if(o){var _=Tk(o,{moveBy:x,direction:w,context:p,modifiers:n});mr(o,_)||(t.goToDate(_,o),g(_))}},y={focusedDay:o,focusTarget:u,blur:f,focus:g,focusDayAfter:function(){return v("day","after")},focusDayBefore:function(){return v("day","before")},focusWeekAfter:function(){return v("week","after")},focusWeekBefore:function(){return v("week","before")},focusMonthBefore:function(){return v("month","before")},focusMonthAfter:function(){return v("month","after")},focusYearBefore:function(){return v("year","before")},focusYearAfter:function(){return v("year","after")},focusStartOfWeek:function(){return v("startOfWeek","before")},focusEndOfWeek:function(){return v("endOfWeek","after")}};return xe.jsx(kk.Provider,{value:y,children:e.children})}function jw(){var e=m.useContext(kk);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Xee(e,t){var n=Dk(),r=zw(e,n,t);return r}var Bw=m.createContext(void 0);function Qee(e){if(!qg(e.initialProps)){var t={selected:void 0};return xe.jsx(Bw.Provider,{value:t,children:e.children})}return xe.jsx(Jee,{initialProps:e.initialProps,children:e.children})}function Jee(e){var t=e.initialProps,n=e.children,r=function(i,s,a){var l,c,u;if((l=t.onDayClick)===null||l===void 0||l.call(t,i,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,i,s,a);return}(u=t.onSelect)===null||u===void 0||u.call(t,i,i,s,a)},o={selected:t.selected,onDayClick:r};return xe.jsx(Bw.Provider,{value:o,children:n})}function Mk(){var e=m.useContext(Bw);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Zee(e,t){var n=qt(),r=Mk(),o=Nw(),i=Fw(),s=jw(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,f=s.blur,g=s.focus,p=s.focusMonthBefore,v=s.focusMonthAfter,y=s.focusYearBefore,x=s.focusYearAfter,w=s.focusStartOfWeek,_=s.focusEndOfWeek,S=function(q){var X,re,$,H;qg(n)?(X=r.onDayClick)===null||X===void 0||X.call(r,e,t,q):tf(n)?(re=o.onDayClick)===null||re===void 0||re.call(o,e,t,q):nf(n)?($=i.onDayClick)===null||$===void 0||$.call(i,e,t,q):(H=n.onDayClick)===null||H===void 0||H.call(n,e,t,q)},R=function(q){var X;g(e),(X=n.onDayFocus)===null||X===void 0||X.call(n,e,t,q)},E=function(q){var X;f(),(X=n.onDayBlur)===null||X===void 0||X.call(n,e,t,q)},O=function(q){var X;(X=n.onDayMouseEnter)===null||X===void 0||X.call(n,e,t,q)},k=function(q){var X;(X=n.onDayMouseLeave)===null||X===void 0||X.call(n,e,t,q)},T=function(q){var X;(X=n.onDayPointerEnter)===null||X===void 0||X.call(n,e,t,q)},M=function(q){var X;(X=n.onDayPointerLeave)===null||X===void 0||X.call(n,e,t,q)},F=function(q){var X;(X=n.onDayTouchCancel)===null||X===void 0||X.call(n,e,t,q)},z=function(q){var X;(X=n.onDayTouchEnd)===null||X===void 0||X.call(n,e,t,q)},B=function(q){var X;(X=n.onDayTouchMove)===null||X===void 0||X.call(n,e,t,q)},Y=function(q){var X;(X=n.onDayTouchStart)===null||X===void 0||X.call(n,e,t,q)},G=function(q){var X;(X=n.onDayKeyUp)===null||X===void 0||X.call(n,e,t,q)},j=function(q){var X;switch(q.key){case"ArrowLeft":q.preventDefault(),q.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":q.preventDefault(),q.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":q.preventDefault(),q.stopPropagation(),c();break;case"ArrowUp":q.preventDefault(),q.stopPropagation(),u();break;case"PageUp":q.preventDefault(),q.stopPropagation(),q.shiftKey?y():p();break;case"PageDown":q.preventDefault(),q.stopPropagation(),q.shiftKey?x():v();break;case"Home":q.preventDefault(),q.stopPropagation(),w();break;case"End":q.preventDefault(),q.stopPropagation(),_();break}(X=n.onDayKeyDown)===null||X===void 0||X.call(n,e,t,q)},ee={onClick:S,onFocus:R,onBlur:E,onKeyDown:j,onKeyUp:G,onMouseEnter:O,onMouseLeave:k,onPointerEnter:T,onPointerLeave:M,onTouchCancel:F,onTouchEnd:z,onTouchMove:B,onTouchStart:Y};return ee}function ete(){var e=qt(),t=Mk(),n=Nw(),r=Fw(),o=qg(e)?t.selected:tf(e)?n.selected:nf(e)?r.selected:void 0;return o}function tte(e){return Object.values(Do).includes(e)}function nte(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var o=e.modifiersClassNames[r];if(o)n.push(o);else if(tte(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function rte(e,t){var n=Qe({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=Qe(Qe({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function ote(e,t,n){var r,o,i,s=qt(),a=jw(),l=Xee(e,t),c=Zee(e,l),u=ete(),f=!!(s.onDayClick||s.mode!=="default");m.useEffect(function(){var O;l.outside||a.focusedDay&&f&&mr(a.focusedDay,e)&&((O=n.current)===null||O===void 0||O.focus())},[a.focusedDay,e,n,f,l.outside]);var g=nte(s,l).join(" "),p=rte(s,l),v=!!(l.outside&&!s.showOutsideDays||l.hidden),y=(i=(o=s.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:Eee,x=xe.jsx(y,{date:e,displayMonth:t,activeModifiers:l}),w={style:p,className:g,children:x,role:"gridcell"},_=a.focusTarget&&mr(a.focusTarget,e)&&!l.outside,S=a.focusedDay&&mr(a.focusedDay,e),R=Qe(Qe(Qe({},w),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=S||_?0:-1,r)),c),E={isButton:f,isHidden:v,activeModifiers:l,selectedDays:u,buttonProps:R,divProps:w};return E}function ite(e){var t=m.useRef(null),n=ote(e.date,e.displayMonth,t);return n.isHidden?xe.jsx("div",{role:"gridcell"}):n.isButton?xe.jsx(Vp,Qe({name:"day",ref:t},n.buttonProps)):xe.jsx("div",Qe({},n.divProps))}function ste(e){var t=e.number,n=e.dates,r=qt(),o=r.onWeekNumberClick,i=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,u=c(Number(t),{locale:a});if(!o)return xe.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:u});var f=l(Number(t),{locale:a}),g=function(p){o(t,n,p)};return xe.jsx(Vp,{name:"week-number","aria-label":f,className:s.weeknumber,style:i.weeknumber,onClick:g,children:u})}function ate(e){var t,n,r=qt(),o=r.styles,i=r.classNames,s=r.showWeekNumber,a=r.components,l=(t=a==null?void 0:a.Day)!==null&&t!==void 0?t:ite,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:ste,u;return s&&(u=xe.jsx("td",{className:i.cell,style:o.cell,children:xe.jsx(c,{number:e.weekNumber,dates:e.dates})})),xe.jsxs("tr",{className:i.row,style:o.row,children:[u,e.dates.map(function(f){return xe.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:xe.jsx(l,{displayMonth:e.displayMonth,date:f})},IZ(f))})]})}function cP(e,t,n){for(var r=n!=null&&n.ISOWeek?vk(t):Mw(t,n),o=n!=null&&n.ISOWeek?za(e):Zo(e,n),i=Go(r,o),s=[],a=0;a<=i;a++)s.push(tr(o,a));var l=s.reduce(function(c,u){var f=n!=null&&n.ISOWeek?yk(u):wk(u,n),g=c.find(function(p){return p.weekNumber===f});return g?(g.dates.push(u),c):(c.push({weekNumber:f,dates:[u]}),c)},[]);return l}function lte(e,t){var n=cP(br(e),kw(e),t);if(t!=null&&t.useFixedWeeks){var r=LZ(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=my(i,6-r),a=cP(my(i,1),s,t);n.push.apply(n,a)}}return n}function cte(e){var t,n,r,o=qt(),i=o.locale,s=o.classNames,a=o.styles,l=o.hideHead,c=o.fixedWeeks,u=o.components,f=o.weekStartsOn,g=o.firstWeekContainsDate,p=o.ISOWeek,v=lte(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:i,weekStartsOn:f,firstWeekContainsDate:g}),y=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:Cee,x=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:ate,w=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:wee;return xe.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&xe.jsx(y,{}),xe.jsx("tbody",{className:s.tbody,style:a.tbody,children:v.map(function(_){return xe.jsx(x,{displayMonth:e.displayMonth,dates:_.dates,weekNumber:_.weekNumber},_.weekNumber)})}),xe.jsx(w,{displayMonth:e.displayMonth})]})}function ute(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var dte=ute()?m.useLayoutEffect:m.useEffect,_b=!1,fte=0;function uP(){return"react-day-picker-".concat(++fte)}function hte(e){var t,n=e??(_b?uP():null),r=m.useState(n),o=r[0],i=r[1];return dte(function(){o===null&&i(uP())},[]),m.useEffect(function(){_b===!1&&(_b=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function pte(e){var t,n,r=qt(),o=r.dir,i=r.classNames,s=r.styles,a=r.components,l=rf().displayMonths,c=hte(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[i.month],g=s.month,p=e.displayIndex===0,v=e.displayIndex===l.length-1,y=!p&&!v;o==="rtl"&&(t=[p,v],v=t[0],p=t[1]),p&&(f.push(i.caption_start),g=Qe(Qe({},g),s.caption_start)),v&&(f.push(i.caption_end),g=Qe(Qe({},g),s.caption_end)),y&&(f.push(i.caption_between),g=Qe(Qe({},g),s.caption_between));var x=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:xee;return xe.jsxs("div",{className:f.join(" "),style:g,children:[xe.jsx(x,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),xe.jsx(cte,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function gte(e){var t=qt(),n=t.classNames,r=t.styles;return xe.jsx("div",{className:n.months,style:r.months,children:e.children})}function mte(e){var t,n,r=e.initialProps,o=qt(),i=jw(),s=rf(),a=m.useState(!1),l=a[0],c=a[1];m.useEffect(function(){o.initialFocus&&i.focusTarget&&(l||(i.focus(i.focusTarget),c(!0)))},[o.initialFocus,l,i.focus,i.focusTarget,i]);var u=[o.classNames.root,o.className];o.numberOfMonths>1&&u.push(o.classNames.multiple_months),o.showWeekNumber&&u.push(o.classNames.with_weeknumber);var f=Qe(Qe({},o.styles.root),o.style),g=Object.keys(r).filter(function(v){return v.startsWith("data-")}).reduce(function(v,y){var x;return Qe(Qe({},v),(x={},x[y]=r[y],x))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:gte;return xe.jsx("div",Qe({className:u.join(" "),style:f,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},g,{children:xe.jsx(p,{children:s.displayMonths.map(function(v,y){return xe.jsx(pte,{displayIndex:y,displayMonth:v},y)})})}))}function vte(e){var t=e.children,n=zZ(e,["children"]);return xe.jsx(see,{initialProps:n,children:xe.jsx(mee,{children:xe.jsx(Qee,{initialProps:n,children:xe.jsx(Ree,{initialProps:n,children:xe.jsx($ee,{initialProps:n,children:xe.jsx(Lee,{children:xe.jsx(Kee,{children:t})})})})})})})}function bte(e){return xe.jsx(vte,Qe({},e,{children:xe.jsx(mte,{initialProps:e})}))}function Ak({className:e,classNames:t,showOutsideDays:n=!0,...r}){return N.jsx(bte,{showOutsideDays:n,className:Oe("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Oe(gy({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:Oe(gy({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...o})=>N.jsx(aK,{...o,className:"h-4 w-4"}),IconRight:({...o})=>N.jsx(nT,{...o,className:"h-4 w-4"})},...r})}Ak.displayName="Calendar";function yte({filter:e,className:t}){const[n,r]=m.useState(!1),[o,i]=m.useState(),[s,a]=m.useState(),l=Te(S=>S.filterValues),{authToken:c}=Ua(),u=Te(S=>S.actions.addOrUpdateFilterValue),f=Te(S=>S.actions.removeFilterValue),{data:g,isLoading:p,isFetching:v,isError:y,refetch:x}=Bd({queryKey:[e.sql],queryFn:()=>Fd("https://semaphor.cloud/api/v1/query",(c==null?void 0:c.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId});m.useEffect(()=>{var S;if(((S=g==null?void 0:g.records)==null?void 0:S.length)>0){const R=g.records[0];if(!R.min||!R.max)return;i({from:new Date(R.min),to:new Date(R.max)}),a({from:new Date(R.min),to:new Date(R.max)})}},[g]),m.useEffect(()=>{if(l&&!l.find(R=>R.filterId===e.id)){i(s);return}},[l,e.id,s]);function w(){f(e.id),i(s),r(!1)}function _(){if(!o)return;console.log(o);const S=[o==null?void 0:o.from,o==null?void 0:o.to];console.log(S);const R={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:bp(e),name:e.column,operation:"between",values:S};u(R),r(!1)}return p?N.jsx("div",{children:N.jsx(Qy,{className:"h-8 w-full bg-foreground/10"})}):y?N.jsx("div",{className:"h-8 w-full bg-muted px-2",children:"Error"}):g?N.jsx("div",{className:Oe("grid gap-2",t),children:N.jsxs(Sw,{open:n,onOpenChange:r,children:[N.jsx(Cw,{asChild:!0,children:N.jsxs(Po,{size:"sm",id:"date",variant:"outline",className:Oe("h-[34px] w-full justify-start rounded-sm text-left font-normal",!o&&"text-muted-foreground"),children:[N.jsx(tT,{className:"mr-2 h-4 w-4"}),o!=null&&o.from?o.to?N.jsxs(N.Fragment,{children:[Ko(o.from,"LLL dd, y")," -"," ",Ko(o.to,"LLL dd, y")]}):Ko(o.from,"LLL dd, y"):N.jsx("span",{children:"Pick a date"})]})}),N.jsxs(jg,{className:"w-auto p-0",align:"start",children:[N.jsx(Ak,{initialFocus:!0,mode:"range",defaultMonth:o==null?void 0:o.from,selected:o,onSelect:i,numberOfMonths:2}),N.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[N.jsx(Po,{size:"sm",variant:"outline",onClick:_,children:"Apply"}),N.jsx(Po,{size:"sm",variant:"outline",onClick:w,children:"Clear"})]})]})]})}):N.jsxs(So,{className:"w-fulll flex h-8 items-center bg-muted px-2",children:[" ","No Data"]})}/**
309
+ * react-virtual
310
+ *
311
+ * Copyright (c) TanStack
312
+ *
313
+ * This source code is licensed under the MIT license found in the
314
+ * LICENSE.md file in the root directory of this source tree.
315
+ *
316
+ * @license MIT
317
+ */function Hp(){return Hp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hp.apply(this,arguments)}/**
318
+ * virtual-core
319
+ *
320
+ * Copyright (c) TanStack
321
+ *
322
+ * This source code is licensed under the MIT license found in the
323
+ * LICENSE.md file in the root directory of this source tree.
324
+ *
325
+ * @license MIT
326
+ */function Wp(){return Wp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wp.apply(this,arguments)}/**
327
+ * virtual-core
328
+ *
329
+ * Copyright (c) TanStack
330
+ *
331
+ * This source code is licensed under the MIT license found in the
332
+ * LICENSE.md file in the root directory of this source tree.
333
+ *
334
+ * @license MIT
335
+ */function Cl(e,t,n){var r,o=(r=n.initialDeps)!=null?r:[],i;return function(){var s;n.key&&n.debug!=null&&n.debug()&&(s=Date.now());var a=e(),l=a.length!==o.length||a.some(function(v,y){return o[y]!==v});if(!l)return i;o=a;var c;if(n.key&&n.debug!=null&&n.debug()&&(c=Date.now()),i=t.apply(void 0,a),n.key&&n.debug!=null&&n.debug()){var u=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-c)*100)/100,g=f/16,p=function(y,x){for(y=String(y);y.length<x;)y=" "+y;return y};console.info("%c⏱ "+p(f,5)+" /"+p(u,5)+" ms",`
336
+ font-size: .6rem;
337
+ font-weight: bold;
338
+ color: hsl(`+Math.max(0,Math.min(120-120*g,120))+"deg 100% 31%);",n==null?void 0:n.key)}return n==null||n.onChange==null||n.onChange(i),i}}function Sb(e,t){if(e===void 0)throw new Error("Unexpected undefined"+(t?": "+t:""));return e}var xte=function(t,n){return Math.abs(t-n)<1};/**
339
+ * virtual-core
340
+ *
341
+ * Copyright (c) TanStack
342
+ *
343
+ * This source code is licensed under the MIT license found in the
344
+ * LICENSE.md file in the root directory of this source tree.
345
+ *
346
+ * @license MIT
347
+ */var wte=function(t){return t},_te=function(t){for(var n=Math.max(t.startIndex-t.overscan,0),r=Math.min(t.endIndex+t.overscan,t.count-1),o=[],i=n;i<=r;i++)o.push(i);return o},Ste=function(t,n){var r=t.scrollElement;if(r){var o=function(a){var l=a.width,c=a.height;n({width:Math.round(l),height:Math.round(c)})};o(r.getBoundingClientRect());var i=new ResizeObserver(function(s){var a=s[0];if(a!=null&&a.borderBoxSize){var l=a.borderBoxSize[0];if(l){o({width:l.inlineSize,height:l.blockSize});return}}o(r.getBoundingClientRect())});return i.observe(r,{box:"border-box"}),function(){i.unobserve(r)}}},Cte=function(t,n){var r=t.scrollElement;if(r){var o=function(){n(r[t.options.horizontal?"scrollLeft":"scrollTop"])};return o(),r.addEventListener("scroll",o,{passive:!0}),function(){r.removeEventListener("scroll",o)}}},Ete=function(t,n,r){if(n!=null&&n.borderBoxSize){var o=n.borderBoxSize[0];if(o){var i=Math.round(o[r.options.horizontal?"inlineSize":"blockSize"]);return i}}return Math.round(t.getBoundingClientRect()[r.options.horizontal?"width":"height"])},Rte=function(t,n,r){var o,i,s=n.adjustments,a=s===void 0?0:s,l=n.behavior,c=t+a;(o=r.scrollElement)==null||o.scrollTo==null||o.scrollTo((i={},i[r.options.horizontal?"left":"top"]=c,i.behavior=l,i))},Pte=function(t){var n=this;this.unsubs=[],this.scrollElement=null,this.isScrolling=!1,this.isScrollingTimeoutId=null,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollDirection=null,this.scrollAdjustments=0,this.measureElementCache=new Map,this.observer=function(){var r=null,o=function(){return r||(typeof ResizeObserver<"u"?r=new ResizeObserver(function(s){s.forEach(function(a){n._measureElement(a.target,a)})}):null)};return{disconnect:function(){var s;return(s=o())==null?void 0:s.disconnect()},observe:function(s){var a;return(a=o())==null?void 0:a.observe(s,{box:"border-box"})},unobserve:function(s){var a;return(a=o())==null?void 0:a.unobserve(s)}}}(),this.range=null,this.setOptions=function(r){Object.entries(r).forEach(function(o){var i=o[0],s=o[1];typeof s>"u"&&delete r[i]}),n.options=Wp({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:wte,rangeExtractor:_te,onChange:function(){},measureElement:Ete,initialRect:{width:0,height:0},scrollMargin:0,scrollingDelay:150,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1},r)},this.notify=function(r){n.options.onChange==null||n.options.onChange(n,r)},this.maybeNotify=Cl(function(){return n.calculateRange(),[n.isScrolling,n.range?n.range.startIndex:null,n.range?n.range.endIndex:null]},function(r){n.notify(r)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:function(){return n.options.debug},initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=function(){n.unsubs.filter(Boolean).forEach(function(r){return r()}),n.unsubs=[],n.scrollElement=null},this._didMount=function(){return n.measureElementCache.forEach(n.observer.observe),function(){n.observer.disconnect(),n.cleanup()}},this._willUpdate=function(){var r=n.options.getScrollElement();n.scrollElement!==r&&(n.cleanup(),n.scrollElement=r,n._scrollToOffset(n.scrollOffset,{adjustments:void 0,behavior:void 0}),n.unsubs.push(n.options.observeElementRect(n,function(o){n.scrollRect=o,n.maybeNotify()})),n.unsubs.push(n.options.observeElementOffset(n,function(o){n.scrollAdjustments=0,n.scrollOffset!==o&&(n.isScrollingTimeoutId!==null&&(clearTimeout(n.isScrollingTimeoutId),n.isScrollingTimeoutId=null),n.isScrolling=!0,n.scrollDirection=n.scrollOffset<o?"forward":"backward",n.scrollOffset=o,n.maybeNotify(),n.isScrollingTimeoutId=setTimeout(function(){n.isScrollingTimeoutId=null,n.isScrolling=!1,n.scrollDirection=null,n.maybeNotify()},n.options.scrollingDelay))})))},this.getSize=function(){return n.scrollRect[n.options.horizontal?"width":"height"]},this.memoOptions=Cl(function(){return[n.options.count,n.options.paddingStart,n.options.scrollMargin,n.options.getItemKey]},function(r,o,i,s){return n.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:o,scrollMargin:i,getItemKey:s}},{key:!1}),this.getFurthestMeasurement=function(r,o){for(var i=new Map,s=new Map,a=o-1;a>=0;a--){var l=r[a];if(!i.has(l.lane)){var c=s.get(l.lane);if(c==null||l.end>c.end?s.set(l.lane,l):l.end<c.end&&i.set(l.lane,!0),i.size===n.options.lanes)break}}return s.size===n.options.lanes?Array.from(s.values()).sort(function(u,f){return u.end-f.end})[0]:void 0},this.getMeasurements=Cl(function(){return[n.memoOptions(),n.itemSizeCache]},function(r,o){var i=r.count,s=r.paddingStart,a=r.scrollMargin,l=r.getItemKey,c=n.pendingMeasuredCacheIndexes.length>0?Math.min.apply(Math,n.pendingMeasuredCacheIndexes):0;n.pendingMeasuredCacheIndexes=[];for(var u=n.measurementsCache.slice(0,c),f=c;f<i;f++){var g=l(f),p=n.options.lanes===1?u[f-1]:n.getFurthestMeasurement(u,f),v=p?p.end:s+a,y=o.get(g),x=typeof y=="number"?y:n.options.estimateSize(f),w=v+x,_=p?p.lane:f%n.options.lanes;u[f]={index:f,start:v,size:x,end:w,key:g,lane:_}}return n.measurementsCache=u,u},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:function(){return n.options.debug}}),this.calculateRange=Cl(function(){return[n.getMeasurements(),n.getSize(),n.scrollOffset]},function(r,o,i){return n.range=r.length>0&&o>0?Ote({measurements:r,outerSize:o,scrollOffset:i}):null},{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:function(){return n.options.debug}}),this.getIndexes=Cl(function(){return[n.options.rangeExtractor,n.calculateRange(),n.options.overscan,n.options.count]},function(r,o,i,s){return o===null?[]:r(Wp({},o,{overscan:i,count:s}))},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return n.options.debug}}),this.indexFromElement=function(r){var o=n.options.indexAttribute,i=r.getAttribute(o);return i?parseInt(i,10):(console.warn("Missing attribute name '"+o+"={index}' on measured element."),-1)},this._measureElement=function(r,o){var i=n.measurementsCache[n.indexFromElement(r)];if(!i||!r.isConnected){n.measureElementCache.forEach(function(l,c){l===r&&(n.observer.unobserve(r),n.measureElementCache.delete(c))});return}var s=n.measureElementCache.get(i.key);s!==r&&(s&&n.observer.unobserve(s),n.observer.observe(r),n.measureElementCache.set(i.key,r));var a=n.options.measureElement(r,o,n);n.resizeItem(i,a)},this.resizeItem=function(r,o){var i,s=(i=n.itemSizeCache.get(r.key))!=null?i:r.size,a=o-s;a!==0&&(r.start<n.scrollOffset&&(process.env.NODE_ENV!=="production"&&n.options.debug&&console.info("correction",a),n._scrollToOffset(n.scrollOffset,{adjustments:n.scrollAdjustments+=a,behavior:void 0})),n.pendingMeasuredCacheIndexes.push(r.index),n.itemSizeCache=new Map(n.itemSizeCache.set(r.key,o)),n.notify(!1))},this.measureElement=function(r){r&&n._measureElement(r,void 0)},this.getVirtualItems=Cl(function(){return[n.getIndexes(),n.getMeasurements()]},function(r,o){for(var i=[],s=0,a=r.length;s<a;s++){var l=r[s],c=o[l];i.push(c)}return i},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return n.options.debug}}),this.getVirtualItemForOffset=function(r){var o=n.getMeasurements();return Sb(o[Ik(0,o.length-1,function(i){return Sb(o[i]).start},r)])},this.getOffsetForAlignment=function(r,o){var i=n.getSize();o==="auto"&&(r<=n.scrollOffset?o="start":r>=n.scrollOffset+i?o="end":o="start"),o==="start"?r=r:o==="end"?r=r-i:o==="center"&&(r=r-i/2);var s=n.options.horizontal?"scrollWidth":"scrollHeight",a=n.scrollElement?"document"in n.scrollElement?n.scrollElement.document.documentElement[s]:n.scrollElement[s]:0,l=a-n.getSize();return Math.max(Math.min(l,r),0)},this.getOffsetForIndex=function(r,o){o===void 0&&(o="auto"),r=Math.max(0,Math.min(r,n.options.count-1));var i=Sb(n.getMeasurements()[r]);if(o==="auto")if(i.end>=n.scrollOffset+n.getSize()-n.options.scrollPaddingEnd)o="end";else if(i.start<=n.scrollOffset+n.options.scrollPaddingStart)o="start";else return[n.scrollOffset,o];var s=o==="end"?i.end+n.options.scrollPaddingEnd:i.start-n.options.scrollPaddingStart;return[n.getOffsetForAlignment(s,o),o]},this.isDynamicMode=function(){return n.measureElementCache.size>0},this.cancelScrollToIndex=function(){n.scrollToIndexTimeoutId!==null&&(clearTimeout(n.scrollToIndexTimeoutId),n.scrollToIndexTimeoutId=null)},this.scrollToOffset=function(r,o){var i=o===void 0?{}:o,s=i.align,a=s===void 0?"start":s,l=i.behavior;n.cancelScrollToIndex(),l==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n._scrollToOffset(n.getOffsetForAlignment(r,a),{adjustments:void 0,behavior:l})},this.scrollToIndex=function(r,o){var i=o===void 0?{}:o,s=i.align,a=s===void 0?"auto":s,l=i.behavior;r=Math.max(0,Math.min(r,n.options.count-1)),n.cancelScrollToIndex(),l==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");var c=n.getOffsetForIndex(r,a),u=c[0],f=c[1];n._scrollToOffset(u,{adjustments:void 0,behavior:l}),l!=="smooth"&&n.isDynamicMode()&&(n.scrollToIndexTimeoutId=setTimeout(function(){n.scrollToIndexTimeoutId=null;var g=n.measureElementCache.has(n.options.getItemKey(r));if(g){var p=n.getOffsetForIndex(r,f),v=p[0];xte(v,n.scrollOffset)||n.scrollToIndex(r,{align:f,behavior:l})}else n.scrollToIndex(r,{align:f,behavior:l})}))},this.scrollBy=function(r,o){var i=o===void 0?{}:o,s=i.behavior;n.cancelScrollToIndex(),s==="smooth"&&n.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n._scrollToOffset(n.scrollOffset+r,{adjustments:void 0,behavior:s})},this.getTotalSize=function(){var r;return(((r=n.getMeasurements()[n.options.count-1])==null?void 0:r.end)||n.options.paddingStart)-n.options.scrollMargin+n.options.paddingEnd},this._scrollToOffset=function(r,o){var i=o.adjustments,s=o.behavior;n.options.scrollToFn(r,{behavior:s,adjustments:i},n)},this.measure=function(){n.itemSizeCache=new Map,n.notify(!1)},this.setOptions(t),this.scrollRect=this.options.initialRect,this.scrollOffset=this.options.initialOffset,this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(function(r){n.itemSizeCache.set(r.key,r.size)}),this.maybeNotify()},Ik=function(t,n,r,o){for(;t<=n;){var i=(t+n)/2|0,s=r(i);if(s<o)t=i+1;else if(s>o)n=i-1;else return i}return t>0?t-1:0};function Ote(e){for(var t=e.measurements,n=e.outerSize,r=e.scrollOffset,o=t.length-1,i=function(c){return t[c].start},s=Ik(0,o,i,r),a=s;a<o&&t[a].end<r+n;)a++;return{startIndex:s,endIndex:a}}/**
348
+ * react-virtual
349
+ *
350
+ * Copyright (c) TanStack
351
+ *
352
+ * This source code is licensed under the MIT license found in the
353
+ * LICENSE.md file in the root directory of this source tree.
354
+ *
355
+ * @license MIT
356
+ */var $te=typeof document<"u"?fe.useLayoutEffect:fe.useEffect;function Dte(e){var t=fe.useReducer(function(){return{}},{})[1],n=Hp({},e,{onChange:function(s,a){a?ti.flushSync(t):t(),e.onChange==null||e.onChange(s,a)}}),r=fe.useState(function(){return new Pte(n)}),o=r[0];return o.setOptions(n),fe.useEffect(function(){return o._didMount()},[]),$te(function(){return o._willUpdate()}),o}function Tte(e){return Dte(Hp({observeElementRect:Ste,observeElementOffset:Cte,scrollToFn:Rte},e))}var kte=Object.defineProperty,Mte=(e,t,n)=>t in e?kte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cb=(e,t,n)=>(Mte(e,typeof t!="symbol"?t+"":t,n),n);let Ate=class{constructor(){Cb(this,"current",this.detect()),Cb(this,"handoffState","pending"),Cb(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Oa=new Ate,En=(e,t)=>{Oa.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function Xo(e){let t=m.useRef(e);return En(()=>{t.current=e},[e]),t}function Vw(e,t){let[n,r]=m.useState(e),o=Xo(e);return En(()=>r(o.current),[o,r,...t]),n}let bt=function(e){let t=Xo(e);return m.useCallback((...n)=>t.current(...n),[t])};function Ite(e,t,n){let[r,o]=m.useState(n),i=e!==void 0,s=m.useRef(i),a=m.useRef(!1),l=m.useRef(!1);return i&&!s.current&&!a.current?(a.current=!0,s.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!i&&s.current&&!l.current&&(l.current=!0,s.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[i?e:r,bt(c=>(i||o(c),t==null?void 0:t(c)))]}function Nte(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ja(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Nte(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=ja();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function of(){let[e]=m.useState(ja);return m.useEffect(()=>()=>e.dispose(),[e]),e}function Lte(){let e=typeof document>"u";return"useSyncExternalStore"in fe?(t=>t.useSyncExternalStore)(fe)(()=>()=>{},()=>!1,()=>!e):!1}function Hw(){let e=Lte(),[t,n]=fe.useState(Oa.isHandoffComplete);return t&&Oa.isHandoffComplete===!1&&n(!1),fe.useEffect(()=>{t!==!0&&n(!0)},[t]),fe.useEffect(()=>Oa.handoff(),[]),e?!1:t}var dP;let sf=(dP=m.useId)!=null?dP:function(){let e=Hw(),[t,n]=m.useState(e?()=>Oa.nextId():null);return En(()=>{t===null&&n(Oa.nextId())},[t]),t!=null?""+t:void 0};function Ln(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ln),r}function Ww(e){return Oa.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let fP=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Fte=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(Fte||{}),zte=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(zte||{}),jte=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(jte||{}),Nk=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Nk||{});function Bte(e,t=0){var n;return e===((n=Ww(e))==null?void 0:n.body)?!1:Ln(t,{0(){return e.matches(fP)},1(){let r=e;for(;r!==null;){if(r.matches(fP))return!0;r=r.parentElement}return!1}})}var Vte=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Vte||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Hte(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let s=o.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Wte(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Ute(){return/Android/gi.test(window.navigator.userAgent)}function Lk(){return Wte()||Ute()}function Lh(e,t,n){let r=Xo(t);m.useEffect(()=>{function o(i){r.current(i)}return document.addEventListener(e,o,n),()=>document.removeEventListener(e,o,n)},[e,n])}function qte(e,t,n){let r=Xo(t);m.useEffect(()=>{function o(i){r.current(i)}return window.addEventListener(e,o,n),()=>window.removeEventListener(e,o,n)},[e,n])}function Gte(e,t,n=!0){let r=m.useRef(!1);m.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function o(s,a){if(!r.current||s.defaultPrevented)return;let l=a(s);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let c=function u(f){return typeof f=="function"?u(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let u of c){if(u===null)continue;let f=u instanceof HTMLElement?u:u.current;if(f!=null&&f.contains(l)||s.composed&&s.composedPath().includes(f))return}return!Bte(l,Nk.Loose)&&l.tabIndex!==-1&&s.preventDefault(),t(s,l)}let i=m.useRef(null);Lh("pointerdown",s=>{var a,l;r.current&&(i.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),Lh("mousedown",s=>{var a,l;r.current&&(i.current=((l=(a=s.composedPath)==null?void 0:a.call(s))==null?void 0:l[0])||s.target)},!0),Lh("click",s=>{Lk()||i.current&&(o(s,()=>i.current),i.current=null)},!0),Lh("touchend",s=>o(s,()=>s.target instanceof HTMLElement?s.target:null),!0),qte("blur",s=>o(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Yte(...e){return m.useMemo(()=>Ww(...e),[...e])}function hP(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Kte(e,t){let[n,r]=m.useState(()=>hP(e));return En(()=>{r(hP(e))},[e.type,e.as]),En(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let Xte=Symbol();function Ya(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=bt(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[Xte]))?void 0:n}function pP(e){return[e.screenX,e.screenY]}function Qte(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=pP(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=pP(t)}}}function Jte({container:e,accept:t,walk:n,enabled:r=!0}){let o=m.useRef(t),i=m.useRef(n);m.useEffect(()=>{o.current=t,i.current=n},[t,n]),En(()=>{if(!e||!r)return;let s=Ww(e);if(!s)return;let a=o.current,l=i.current,c=Object.assign(f=>a(f),{acceptNode:a}),u=s.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,c,!1);for(;u.nextNode();)l(u.currentNode)},[e,r,o,i])}function gP(e,t){let n=m.useRef([]),r=bt(e);m.useEffect(()=>{let o=[...n.current];for(let[i,s]of t.entries())if(n.current[i]!==s){let a=r(t,o);return n.current=t,a}},[r,...t])}function Up(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var qp=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(qp||{}),xs=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(xs||{});function ji({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??Zte;let l=Fk(t,e);if(i)return Fh(l,n,r,s,a);let c=o??0;if(c&2){let{static:u=!1,...f}=l;if(u)return Fh(f,n,r,s,a)}if(c&1){let{unmount:u=!0,...f}=l;return Ln(u?0:1,{0(){return null},1(){return Fh({...f,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Fh(l,n,r,s,a)}function Fh(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=Eb(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},u=typeof s=="function"?s(t):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t));let f={};if(t){let g=!1,p=[];for(let[v,y]of Object.entries(t))typeof y=="boolean"&&(g=!0),y===!0&&p.push(v);g&&(f["data-headlessui-state"]=p.join(" "))}if(i===m.Fragment&&Object.keys(yy(l)).length>0){if(!m.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(y=>` - ${y}`).join(`
357
+ `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(y=>` - ${y}`).join(`
358
+ `)].join(`
359
+ `));let g=u.props,p=typeof(g==null?void 0:g.className)=="function"?(...y)=>Up(g==null?void 0:g.className(...y),l.className):Up(g==null?void 0:g.className,l.className),v=p?{className:p}:{};return m.cloneElement(u,Object.assign({},Fk(u.props,yy(Eb(l,["ref"]))),f,c,{ref:o(u.ref,c.ref)},v))}return m.createElement(i,Object.assign({},Eb(l,["ref"]),i!==m.Fragment&&c,i!==m.Fragment&&f),u)}function Zte(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function Fk(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](o,...i){let s=n[r];for(let a of s){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;a(o,...i)}}});return t}function si(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function yy(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Eb(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let ene="div";var zk=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(zk||{});function tne(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return ji({ourProps:i,theirProps:o,slot:{},defaultTag:ene,name:"Hidden"})}let nne=si(tne),Uw=m.createContext(null);Uw.displayName="OpenClosedContext";var Fr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Fr||{});function qw(){return m.useContext(Uw)}function jk({value:e,children:t}){return m.createElement(Uw.Provider,{value:e},t)}function rne(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let ua=[];rne(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&ua[0]!==t.target&&(ua.unshift(t.target),ua=ua.filter(n=>n!=null&&n.isConnected),ua.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function one(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&ine(n)?!1:r}function ine(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function sne(e){throw new Error("Unexpected object: "+e)}var Sn=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Sn||{});function mP(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:sne(e)}}function Bk(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))Hk(n,Vk(t,r),o);return n}function Vk(e,t){return e?e+"["+t+"]":t}function Hk(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())Hk(e,Vk(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):Bk(n,t,e)}var Mr=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Mr||{}),ane=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ane||{}),lne=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(lne||{}),cne=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(cne||{}),une=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualOptions=7]="UpdateVirtualOptions",e))(une||{});function Rb(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=t(e.options.slice()),o=r.length>0&&r[0].dataRef.current.order!==null?r.sort((s,a)=>s.dataRef.current.order-a.dataRef.current.order):Hte(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let dne={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var t,n;if((t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===0)return e;if((n=e.dataRef.current)!=null&&n.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0}}return{...e,comboboxState:0}},2(e,t){var n,r,o,i,s;if((n=e.dataRef.current)!=null&&n.disabled||(r=e.dataRef.current)!=null&&r.optionsRef.current&&!((o=e.dataRef.current)!=null&&o.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let u=t.focus===Sn.Specific?t.idx:mP(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var g,p;return(p=(g=e.activeOptionIndex)!=null?g:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?p:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),f=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===u&&e.activationTrigger===f?e:{...e,activeOptionIndex:u,activationTrigger:f}}let a=Rb(e);if(a.activeOptionIndex===null){let u=a.options.findIndex(f=>!f.dataRef.current.disabled);u!==-1&&(a.activeOptionIndex=u)}let l=t.focus===Sn.Specific?t.idx:mP(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:u=>u.id,resolveDisabled:u=>u.dataRef.current.disabled}),c=(s=t.trigger)!=null?s:2;return e.activeOptionIndex===l&&e.activationTrigger===c?e:{...e,...a,activeOptionIndex:l,activationTrigger:c}},3:(e,t)=>{var n,r,o;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:[...e.options,t.payload]};let i=t.payload,s=Rb(e,l=>(l.push(i),l));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(t.payload.dataRef.current.value)&&(s.activeOptionIndex=s.options.indexOf(i));let a={...e,...s,activationTrigger:2};return(o=e.dataRef.current)!=null&&o.__demoMode&&e.dataRef.current.value===void 0&&(a.activeOptionIndex=0),a},4:(e,t)=>{var n;if((n=e.dataRef.current)!=null&&n.virtual)return{...e,options:e.options.filter(o=>o.id!==t.id)};let r=Rb(e,o=>{let i=o.findIndex(s=>s.id===t.id);return i!==-1&&o.splice(i,1),o});return{...e,...r,activationTrigger:2}},5:(e,t)=>e.labelId===t.id?e:{...e,labelId:t.id},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n;if(((n=e.virtual)==null?void 0:n.options)===t.options)return e;let r=e.activeOptionIndex;if(e.activeOptionIndex!==null){let o=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);o!==-1?r=o:r=null}return{...e,activeOptionIndex:r,virtual:Object.assign({},e.virtual,{options:t.options})}}},Gw=m.createContext(null);Gw.displayName="ComboboxActionsContext";function af(e){let t=m.useContext(Gw);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,af),n}return t}let Wk=m.createContext(null);function fne(e){var t;let n=Ka("VirtualProvider"),[r,o]=m.useMemo(()=>{let l=n.optionsRef.current;if(!l)return[0,0];let c=window.getComputedStyle(l);return[parseFloat(c.paddingBlockStart||c.paddingTop),parseFloat(c.paddingBlockEnd||c.paddingBottom)]},[n.optionsRef.current]),i=Tte({scrollPaddingStart:r,scrollPaddingEnd:o,count:n.virtual.options.length,estimateSize(){return 40},getScrollElement(){var l;return(l=n.optionsRef.current)!=null?l:null},overscan:12}),[s,a]=m.useState(0);return En(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(Wk.Provider,{value:i},m.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:l=>{if(l){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||n.activationTrigger===0)return;n.activeOptionIndex!==null&&n.virtual.options.length>n.activeOptionIndex&&i.scrollToIndex(n.activeOptionIndex)}}},i.getVirtualItems().map(l=>{var c;return m.createElement(m.Fragment,{key:l.key},m.cloneElement((c=e.children)==null?void 0:c.call(e,{option:n.virtual.options[l.index],open:n.comboboxState===0}),{key:`${s}-${l.key}`,"data-index":l.index,"aria-setsize":n.virtual.options.length,"aria-posinset":l.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${l.start}px)`,overflowAnchor:"none"}}))})))}let Yw=m.createContext(null);Yw.displayName="ComboboxDataContext";function Ka(e){let t=m.useContext(Yw);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ka),n}return t}function hne(e,t){return Ln(t.type,dne,e,t)}let pne=m.Fragment;function gne(e,t){let{value:n,defaultValue:r,onChange:o,form:i,name:s,by:a=null,disabled:l=!1,__demoMode:c=!1,nullable:u=!1,multiple:f=!1,immediate:g=!1,virtual:p=null,...v}=e,y=!1,x=null,[w=f?[]:void 0,_]=Ite(n,o,r),[S,R]=m.useReducer(hne,{dataRef:m.createRef(),comboboxState:c?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),E=m.useRef(!1),O=m.useRef({static:!1,hold:!1}),k=m.useRef(null),T=m.useRef(null),M=m.useRef(null),F=m.useRef(null),z=bt(typeof a=="string"?(Z,ie)=>{let ye=a;return(Z==null?void 0:Z[ye])===(ie==null?void 0:ie[ye])}:a??((Z,ie)=>Z===ie)),B=bt(Z=>S.options.findIndex(ie=>z(ie.dataRef.current.value,Z))),Y=m.useCallback(Z=>Ln(j.mode,{1:()=>w.some(ie=>z(ie,Z)),0:()=>z(w,Z)}),[w]),G=bt(Z=>S.activeOptionIndex===B(Z)),j=m.useMemo(()=>({...S,immediate:y,optionsPropsRef:O,labelRef:k,inputRef:T,buttonRef:M,optionsRef:F,value:w,defaultValue:r,disabled:l,mode:f?1:0,virtual:S.virtual,get activeOptionIndex(){if(E.current&&S.activeOptionIndex===null&&S.options.length>0){let Z=S.options.findIndex(ie=>!ie.dataRef.current.disabled);if(Z!==-1)return Z}return S.activeOptionIndex},calculateIndex:B,compare:z,isSelected:Y,isActive:G,nullable:u,__demoMode:c}),[w,r,l,f,u,c,S,x]);En(()=>{},[x,void 0]),En(()=>{S.dataRef.current=j},[j]),Gte([j.buttonRef,j.inputRef,j.optionsRef],()=>ge.closeCombobox(),j.comboboxState===0);let ee=m.useMemo(()=>{var Z,ie,ye;return{open:j.comboboxState===0,disabled:l,activeIndex:j.activeOptionIndex,activeOption:j.activeOptionIndex===null?null:j.virtual?j.virtual.options[(Z=j.activeOptionIndex)!=null?Z:0]:(ye=(ie=j.options[j.activeOptionIndex])==null?void 0:ie.dataRef.current.value)!=null?ye:null,value:w}},[j,l,w]),q=bt(()=>{if(j.activeOptionIndex!==null){if(j.virtual)I(j.virtual.options[j.activeOptionIndex]);else{let{dataRef:Z}=j.options[j.activeOptionIndex];I(Z.current.value)}ge.goToOption(Sn.Specific,j.activeOptionIndex)}}),X=bt(()=>{R({type:0}),E.current=!0}),re=bt(()=>{R({type:1}),E.current=!1}),$=bt((Z,ie,ye)=>(E.current=!1,Z===Sn.Specific?R({type:2,focus:Sn.Specific,idx:ie,trigger:ye}):R({type:2,focus:Z,trigger:ye}))),H=bt((Z,ie)=>(R({type:3,payload:{id:Z,dataRef:ie}}),()=>{j.isActive(ie.current.value)&&(E.current=!0),R({type:4,id:Z})})),ne=bt(Z=>(R({type:5,id:Z}),()=>R({type:5,id:null}))),I=bt(Z=>Ln(j.mode,{0(){return _==null?void 0:_(Z)},1(){let ie=j.value.slice(),ye=ie.findIndex(W=>z(W,Z));return ye===-1?ie.push(Z):ie.splice(ye,1),_==null?void 0:_(ie)}})),ce=bt(Z=>{R({type:6,trigger:Z})}),ge=m.useMemo(()=>({onChange:I,registerOption:H,registerLabel:ne,goToOption:$,closeCombobox:re,openCombobox:X,setActivationTrigger:ce,selectActiveOption:q}),[]),he=t===null?{}:{ref:t},de=m.useRef(null),oe=of();return m.useEffect(()=>{de.current&&r!==void 0&&oe.addEventListener(de.current,"reset",()=>{_==null||_(r)})},[de,_]),m.createElement(Gw.Provider,{value:ge},m.createElement(Yw.Provider,{value:j},m.createElement(jk,{value:Ln(j.comboboxState,{0:Fr.Open,1:Fr.Closed})},s!=null&&w!=null&&Bk({[s]:w}).map(([Z,ie],ye)=>m.createElement(nne,{features:zk.Hidden,ref:ye===0?W=>{var me;de.current=(me=W==null?void 0:W.closest("form"))!=null?me:null}:void 0,...yy({key:Z,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:Z,value:ie})})),ji({ourProps:he,theirProps:v,slot:ee,defaultTag:pne,name:"Combobox"}))))}let mne="input";function vne(e,t){var n,r,o,i,s;let a=sf(),{id:l=`headlessui-combobox-input-${a}`,onChange:c,displayValue:u,type:f="text",...g}=e,p=Ka("Combobox.Input"),v=af("Combobox.Input"),y=Ya(p.inputRef,t),x=Yte(p.inputRef),w=m.useRef(!1),_=of(),S=bt(()=>{v.onChange(null),p.optionsRef.current&&(p.optionsRef.current.scrollTop=0),v.goToOption(Sn.Nothing)}),R=function(){var j;return typeof u=="function"&&p.value!==void 0?(j=u(p.value))!=null?j:"":typeof p.value=="string"?p.value:""}();gP(([j,ee],[q,X])=>{if(w.current)return;let re=p.inputRef.current;re&&((X===0&&ee===1||j!==q)&&(re.value=j),requestAnimationFrame(()=>{if(w.current||!re||(x==null?void 0:x.activeElement)!==re)return;let{selectionStart:$,selectionEnd:H}=re;Math.abs((H??0)-($??0))===0&&$===0&&re.setSelectionRange(re.value.length,re.value.length)}))},[R,p.comboboxState,x]),gP(([j],[ee])=>{if(j===0&&ee===1){if(w.current)return;let q=p.inputRef.current;if(!q)return;let X=q.value,{selectionStart:re,selectionEnd:$,selectionDirection:H}=q;q.value="",q.value=X,H!==null?q.setSelectionRange(re,$,H):q.setSelectionRange(re,$)}},[p.comboboxState]);let E=m.useRef(!1),O=bt(()=>{E.current=!0}),k=bt(()=>{_.nextFrame(()=>{E.current=!1})}),T=bt(j=>{switch(w.current=!0,j.key){case Mr.Enter:if(w.current=!1,p.comboboxState!==0||E.current)return;if(j.preventDefault(),j.stopPropagation(),p.activeOptionIndex===null){v.closeCombobox();return}v.selectActiveOption(),p.mode===0&&v.closeCombobox();break;case Mr.ArrowDown:return w.current=!1,j.preventDefault(),j.stopPropagation(),Ln(p.comboboxState,{0:()=>v.goToOption(Sn.Next),1:()=>v.openCombobox()});case Mr.ArrowUp:return w.current=!1,j.preventDefault(),j.stopPropagation(),Ln(p.comboboxState,{0:()=>v.goToOption(Sn.Previous),1:()=>{v.openCombobox(),_.nextFrame(()=>{p.value||v.goToOption(Sn.Last)})}});case Mr.Home:if(j.shiftKey)break;return w.current=!1,j.preventDefault(),j.stopPropagation(),v.goToOption(Sn.First);case Mr.PageUp:return w.current=!1,j.preventDefault(),j.stopPropagation(),v.goToOption(Sn.First);case Mr.End:if(j.shiftKey)break;return w.current=!1,j.preventDefault(),j.stopPropagation(),v.goToOption(Sn.Last);case Mr.PageDown:return w.current=!1,j.preventDefault(),j.stopPropagation(),v.goToOption(Sn.Last);case Mr.Escape:return w.current=!1,p.comboboxState!==0?void 0:(j.preventDefault(),p.optionsRef.current&&!p.optionsPropsRef.current.static&&j.stopPropagation(),p.nullable&&p.mode===0&&p.value===null&&S(),v.closeCombobox());case Mr.Tab:if(w.current=!1,p.comboboxState!==0)return;p.mode===0&&p.activationTrigger!==1&&v.selectActiveOption(),v.closeCombobox();break}}),M=bt(j=>{c==null||c(j),p.nullable&&p.mode===0&&j.target.value===""&&S(),v.openCombobox()}),F=bt(j=>{var ee,q,X;let re=(ee=j.relatedTarget)!=null?ee:ua.find($=>$!==j.currentTarget);if(w.current=!1,!((q=p.optionsRef.current)!=null&&q.contains(re))&&!((X=p.buttonRef.current)!=null&&X.contains(re))&&p.comboboxState===0)return j.preventDefault(),p.mode===0&&(p.nullable&&p.value===null?S():p.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),z=bt(j=>{var ee,q,X;let re=(ee=j.relatedTarget)!=null?ee:ua.find($=>$!==j.currentTarget);(q=p.buttonRef.current)!=null&&q.contains(re)||(X=p.optionsRef.current)!=null&&X.contains(re)||p.disabled||p.immediate&&p.comboboxState!==0&&(v.openCombobox(),_.nextFrame(()=>{v.setActivationTrigger(1)}))}),B=Vw(()=>{if(p.labelId)return[p.labelId].join(" ")},[p.labelId]),Y=m.useMemo(()=>({open:p.comboboxState===0,disabled:p.disabled}),[p]),G={ref:y,id:l,role:"combobox",type:f,"aria-controls":(n=p.optionsRef.current)==null?void 0:n.id,"aria-expanded":p.comboboxState===0,"aria-activedescendant":p.activeOptionIndex===null?void 0:p.virtual?(r=p.options.find(j=>{var ee;return!((ee=p.virtual)!=null&&ee.disabled(j.dataRef.current.value))&&p.compare(j.dataRef.current.value,p.virtual.options[p.activeOptionIndex])}))==null?void 0:r.id:(o=p.options[p.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":B,"aria-autocomplete":"list",defaultValue:(s=(i=e.defaultValue)!=null?i:p.defaultValue!==void 0?u==null?void 0:u(p.defaultValue):null)!=null?s:p.defaultValue,disabled:p.disabled,onCompositionStart:O,onCompositionEnd:k,onKeyDown:T,onChange:M,onFocus:z,onBlur:F};return ji({ourProps:G,theirProps:g,slot:Y,defaultTag:mne,name:"Combobox.Input"})}let bne="button";function yne(e,t){var n;let r=Ka("Combobox.Button"),o=af("Combobox.Button"),i=Ya(r.buttonRef,t),s=sf(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,c=of(),u=bt(y=>{switch(y.key){case Mr.ArrowDown:return y.preventDefault(),y.stopPropagation(),r.comboboxState===1&&o.openCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case Mr.ArrowUp:return y.preventDefault(),y.stopPropagation(),r.comboboxState===1&&(o.openCombobox(),c.nextFrame(()=>{r.value||o.goToOption(Sn.Last)})),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case Mr.Escape:return r.comboboxState!==0?void 0:(y.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&y.stopPropagation(),o.closeCombobox(),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})}));default:return}}),f=bt(y=>{if(one(y.currentTarget))return y.preventDefault();r.comboboxState===0?o.closeCombobox():(y.preventDefault(),o.openCombobox()),c.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})})}),g=Vw(()=>{if(r.labelId)return[r.labelId,a].join(" ")},[r.labelId,a]),p=m.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:i,id:a,type:Kte(e,r.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=r.optionsRef.current)==null?void 0:n.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":g,disabled:r.disabled,onClick:f,onKeyDown:u};return ji({ourProps:v,theirProps:l,slot:p,defaultTag:bne,name:"Combobox.Button"})}let xne="label";function wne(e,t){let n=sf(),{id:r=`headlessui-combobox-label-${n}`,...o}=e,i=Ka("Combobox.Label"),s=af("Combobox.Label"),a=Ya(i.labelRef,t);En(()=>s.registerLabel(r),[r]);let l=bt(()=>{var u;return(u=i.inputRef.current)==null?void 0:u.focus({preventScroll:!0})}),c=m.useMemo(()=>({open:i.comboboxState===0,disabled:i.disabled}),[i]);return ji({ourProps:{ref:a,id:r,onClick:l},theirProps:o,slot:c,defaultTag:xne,name:"Combobox.Label"})}let _ne="ul",Sne=qp.RenderStrategy|qp.Static;function Cne(e,t){let n=sf(),{id:r=`headlessui-combobox-options-${n}`,hold:o=!1,...i}=e,s=Ka("Combobox.Options"),a=Ya(s.optionsRef,t),l=qw(),c=l!==null?(l&Fr.Open)===Fr.Open:s.comboboxState===0;En(()=>{var p;s.optionsPropsRef.current.static=(p=e.static)!=null?p:!1},[s.optionsPropsRef,e.static]),En(()=>{s.optionsPropsRef.current.hold=o},[s.optionsPropsRef,o]),Jte({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(p){return p.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:p.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(p){p.setAttribute("role","none")}});let u=Vw(()=>{var p,v;return(v=s.labelId)!=null?v:(p=s.buttonRef.current)==null?void 0:p.id},[s.labelId,s.buttonRef.current]),f=m.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),g={"aria-labelledby":u,role:"listbox","aria-multiselectable":s.mode===1?!0:void 0,id:r,ref:a};return s.virtual&&s.comboboxState===0&&Object.assign(i,{children:m.createElement(fne,null,i.children)}),ji({ourProps:g,theirProps:i,slot:f,defaultTag:_ne,features:Sne,visible:c,name:"Combobox.Options"})}let Ene="li";function Rne(e,t){var n;let r=sf(),{id:o=`headlessui-combobox-option-${r}`,disabled:i=!1,value:s,order:a=null,...l}=e,c=Ka("Combobox.Option"),u=af("Combobox.Option"),f=c.virtual?c.activeOptionIndex===c.calculateIndex(s):c.activeOptionIndex===null?!1:((n=c.options[c.activeOptionIndex])==null?void 0:n.id)===o,g=c.isSelected(s),p=m.useRef(null),v=Xo({disabled:i,value:s,domRef:p,order:a}),y=m.useContext(Wk),x=Ya(t,p,y?y.measureElement:null),w=bt(()=>u.onChange(s));En(()=>u.registerOption(o,v),[v,o]);let _=m.useRef(!(c.virtual||c.__demoMode));En(()=>{if(!c.virtual||!c.__demoMode)return;let F=ja();return F.requestAnimationFrame(()=>{_.current=!0}),F.dispose},[c.virtual,c.__demoMode]),En(()=>{if(!_.current||c.comboboxState!==0||!f||c.activationTrigger===0)return;let F=ja();return F.requestAnimationFrame(()=>{var z,B;(B=(z=p.current)==null?void 0:z.scrollIntoView)==null||B.call(z,{block:"nearest"})}),F.dispose},[p,f,c.comboboxState,c.activationTrigger,c.activeOptionIndex]);let S=bt(F=>{var z;if(i||(z=c.virtual)!=null&&z.disabled(s))return F.preventDefault();w(),Lk()||requestAnimationFrame(()=>{var B;return(B=c.inputRef.current)==null?void 0:B.focus({preventScroll:!0})}),c.mode===0&&requestAnimationFrame(()=>u.closeCombobox())}),R=bt(()=>{var F;if(i||(F=c.virtual)!=null&&F.disabled(s))return u.goToOption(Sn.Nothing);let z=c.calculateIndex(s);u.goToOption(Sn.Specific,z)}),E=Qte(),O=bt(F=>E.update(F)),k=bt(F=>{var z;if(!E.wasMoved(F)||i||(z=c.virtual)!=null&&z.disabled(s)||f)return;let B=c.calculateIndex(s);u.goToOption(Sn.Specific,B,0)}),T=bt(F=>{var z;E.wasMoved(F)&&(i||(z=c.virtual)!=null&&z.disabled(s)||f&&(c.optionsPropsRef.current.hold||u.goToOption(Sn.Nothing)))}),M=m.useMemo(()=>({active:f,selected:g,disabled:i}),[f,g,i]);return ji({ourProps:{id:o,ref:x,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":g,disabled:void 0,onClick:S,onFocus:R,onPointerEnter:O,onMouseEnter:O,onPointerMove:k,onMouseMove:k,onPointerLeave:T,onMouseLeave:T},theirProps:l,slot:M,defaultTag:Ene,name:"Combobox.Option"})}let Pne=si(gne),One=si(yne),$ne=si(vne),Dne=si(wne),Tne=si(Cne),kne=si(Rne),El=Object.assign(Pne,{Input:$ne,Button:One,Label:Dne,Options:Tne,Option:kne});function Kw(){let e=m.useRef(!1);return En(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Mne(e=0){let[t,n]=m.useState(e),r=Kw(),o=m.useCallback(l=>{r.current&&n(c=>c|l)},[t,r]),i=m.useCallback(l=>!!(t&l),[t]),s=m.useCallback(l=>{r.current&&n(c=>c&~l)},[n,r]),a=m.useCallback(l=>{r.current&&n(c=>c^l)},[n]);return{flags:t,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}function Ane(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Pb(e,...t){e&&t.length>0&&e.classList.add(...t)}function Ob(e,...t){e&&t.length>0&&e.classList.remove(...t)}function Ine(e,t){let n=ja();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,s]=[r,o].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(u=>u.includes("ms")?parseFloat(u):parseFloat(u)*1e3).sort((u,f)=>f-u);return c}),a=i+s;if(a!==0){n.group(c=>{c.setTimeout(()=>{t(),c.dispose()},a),c.addEventListener(e,"transitionrun",u=>{u.target===u.currentTarget&&c.dispose()})});let l=n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),l())})}else t();return n.add(()=>t()),n.dispose}function Nne(e,t,n,r){let o=n?"enter":"leave",i=ja(),s=r!==void 0?Ane(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Ln(o,{enter:()=>t.enter,leave:()=>t.leave}),l=Ln(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Ln(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Ob(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Pb(e,...t.base,...a,...c),i.nextFrame(()=>{Ob(e,...t.base,...a,...c),Pb(e,...t.base,...a,...l),Ine(e,()=>(Ob(e,...t.base,...a),Pb(e,...t.base,...t.entered),s()))}),i.dispose}function Lne({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let s=Kw(),a=of(),l=Xo(n);En(()=>{e&&(l.current="enter")},[e]),En(()=>{let c=ja();a.add(c.dispose);let u=t.current;if(u&&l.current!=="idle"&&s.current)return c.dispose(),o.current(l.current),c.add(Nne(u,r.current,l.current==="enter",()=>{c.dispose(),i.current(l.current)})),c.dispose},[n])}function ns(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Gg=m.createContext(null);Gg.displayName="TransitionContext";var Fne=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Fne||{});function zne(){let e=m.useContext(Gg);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function jne(){let e=m.useContext(Yg);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Yg=m.createContext(null);Yg.displayName="NestingContext";function Kg(e){return"children"in e?Kg(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Uk(e,t){let n=Xo(e),r=m.useRef([]),o=Kw(),i=of(),s=bt((p,v=xs.Hidden)=>{let y=r.current.findIndex(({el:x})=>x===p);y!==-1&&(Ln(v,{[xs.Unmount](){r.current.splice(y,1)},[xs.Hidden](){r.current[y].state="hidden"}}),i.microTask(()=>{var x;!Kg(r)&&o.current&&((x=n.current)==null||x.call(n))}))}),a=bt(p=>{let v=r.current.find(({el:y})=>y===p);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:p,state:"visible"}),()=>s(p,xs.Unmount)}),l=m.useRef([]),c=m.useRef(Promise.resolve()),u=m.useRef({enter:[],leave:[],idle:[]}),f=bt((p,v,y)=>{l.current.splice(0),t&&(t.chains.current[v]=t.chains.current[v].filter(([x])=>x!==p)),t==null||t.chains.current[v].push([p,new Promise(x=>{l.current.push(x)})]),t==null||t.chains.current[v].push([p,new Promise(x=>{Promise.all(u.current[v].map(([w,_])=>_)).then(()=>x())})]),v==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(v)):y(v)}),g=bt((p,v,y)=>{Promise.all(u.current[v].splice(0).map(([x,w])=>w)).then(()=>{var x;(x=l.current.shift())==null||x()}).then(()=>y(v))});return m.useMemo(()=>({children:r,register:a,unregister:s,onStart:f,onStop:g,wait:c,chains:u}),[a,s,r,f,g,u,c])}function Bne(){}let Vne=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function vP(e){var t;let n={};for(let r of Vne)n[r]=(t=e[r])!=null?t:Bne;return n}function Hne(e){let t=m.useRef(vP(e));return m.useEffect(()=>{t.current=vP(e)},[e]),t}let Wne="div",qk=qp.RenderStrategy;function Une(e,t){var n,r;let{beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a,enter:l,enterFrom:c,enterTo:u,entered:f,leave:g,leaveFrom:p,leaveTo:v,...y}=e,x=m.useRef(null),w=Ya(x,t),_=(n=y.unmount)==null||n?xs.Unmount:xs.Hidden,{show:S,appear:R,initial:E}=zne(),[O,k]=m.useState(S?"visible":"hidden"),T=jne(),{register:M,unregister:F}=T;m.useEffect(()=>M(x),[M,x]),m.useEffect(()=>{if(_===xs.Hidden&&x.current){if(S&&O!=="visible"){k("visible");return}return Ln(O,{hidden:()=>F(x),visible:()=>M(x)})}},[O,x,M,F,S,_]);let z=Xo({base:ns(y.className),enter:ns(l),enterFrom:ns(c),enterTo:ns(u),entered:ns(f),leave:ns(g),leaveFrom:ns(p),leaveTo:ns(v)}),B=Hne({beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a}),Y=Hw();m.useEffect(()=>{if(Y&&O==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,O,Y]);let G=E&&!R,j=R&&S&&E,ee=!Y||G?"idle":S?"enter":"leave",q=Mne(0),X=bt(ce=>Ln(ce,{enter:()=>{q.addFlag(Fr.Opening),B.current.beforeEnter()},leave:()=>{q.addFlag(Fr.Closing),B.current.beforeLeave()},idle:()=>{}})),re=bt(ce=>Ln(ce,{enter:()=>{q.removeFlag(Fr.Opening),B.current.afterEnter()},leave:()=>{q.removeFlag(Fr.Closing),B.current.afterLeave()},idle:()=>{}})),$=Uk(()=>{k("hidden"),F(x)},T),H=m.useRef(!1);Lne({immediate:j,container:x,classes:z,direction:ee,onStart:Xo(ce=>{H.current=!0,$.onStart(x,ce,X)}),onStop:Xo(ce=>{H.current=!1,$.onStop(x,ce,re),ce==="leave"&&!Kg($)&&(k("hidden"),F(x))})});let ne=y,I={ref:w};return j?ne={...ne,className:Up(y.className,...z.current.enter,...z.current.enterFrom)}:H.current&&(ne.className=Up(y.className,(r=x.current)==null?void 0:r.className),ne.className===""&&delete ne.className),m.createElement(Yg.Provider,{value:$},m.createElement(jk,{value:Ln(O,{visible:Fr.Open,hidden:Fr.Closed})|q.flags},ji({ourProps:I,theirProps:ne,defaultTag:Wne,features:qk,visible:O==="visible",name:"Transition.Child"})))}function qne(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=m.useRef(null),a=Ya(s,t);Hw();let l=qw();if(n===void 0&&l!==null&&(n=(l&Fr.Open)===Fr.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=m.useState(n?"visible":"hidden"),f=Uk(()=>{u("hidden")}),[g,p]=m.useState(!0),v=m.useRef([n]);En(()=>{g!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),p(!1))},[v,n]);let y=m.useMemo(()=>({show:n,appear:r,initial:g}),[n,r,g]);m.useEffect(()=>{if(n)u("visible");else if(!Kg(f))u("hidden");else{let S=s.current;if(!S)return;let R=S.getBoundingClientRect();R.x===0&&R.y===0&&R.width===0&&R.height===0&&u("hidden")}},[n,f]);let x={unmount:o},w=bt(()=>{var S;g&&p(!1),(S=e.beforeEnter)==null||S.call(e)}),_=bt(()=>{var S;g&&p(!1),(S=e.beforeLeave)==null||S.call(e)});return m.createElement(Yg.Provider,{value:f},m.createElement(Gg.Provider,{value:y},ji({ourProps:{...x,as:m.Fragment,children:m.createElement(Gk,{ref:a,...x,...i,beforeEnter:w,beforeLeave:_})},theirProps:{},defaultTag:m.Fragment,features:qk,visible:c==="visible",name:"Transition"})))}function Gne(e,t){let n=m.useContext(Gg)!==null,r=qw()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(xy,{ref:t,...e}):m.createElement(Gk,{ref:t,...e}))}let xy=si(qne),Gk=si(Une),Yne=si(Gne),Kne=Object.assign(xy,{Child:Yne,Root:xy});function Xne(e){const t=/(>=|<=|>|<|=)/,n=e.match(t);if(n){const r=n[0],[o,i]=e.split(r);return{operation:r,value:i.trim()}}else return null}function Qne(e,t,n){const r=`SELECT ${n}, COUNT(*) FROM ${t} {{ filters | where }} GROUP BY ${n} ORDER BY ${n} ASC LIMIT 50`,o=`SELECT min(${n}) as min, max(${n}) as max FROM ${t} {{ filters | where }}`;return zd.includes(e)?o:r}function Jne({filter:e}){const[t,n]=m.useState([]),[r,o]=m.useState(""),[i,s]=m.useState(""),a=m.useRef(null),{authToken:l}=Ua(),c=Te(T=>T.filterValues),u=Te(T=>T.actions.addOrUpdateFilterValue),f=Te(T=>T.actions.removeFilterValue),g=S(c),{data:p,isLoading:v,isFetching:y,isError:x,refetch:w}=Bd({queryKey:["filter",e.id,e.sql,JSON.stringify(g)],queryFn:()=>Fd("https://semaphor.cloud/api/v1/query",(l==null?void 0:l.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:g}),enabled:!!e.sql&&!!e.connectionId}),_=m.useMemo(()=>{var T;return(T=p==null?void 0:p.records)==null?void 0:T.map(M=>{let F=e.column.split(".").slice(-1)[0].replace(/"/g,"");return M[F]===void 0&&(F=F.toLowerCase()),{id:M[F],value:M[F]}})},[p,e.column]);m.useEffect(()=>{if(c){const T=c.find(M=>M.filterId===e.id);if(!T){n([]);return}if(T.operation==="in"){const M=_==null?void 0:_.filter(F=>T.values.includes(F.value));M&&n(M)}else o(`${T.operation} ${T.values[0]}`)}},[p]),m.useEffect(()=>{if(c&&!c.find(M=>M.filterId===e.id)){n([]);return}},[c,e.id]);function S(T){return T?T.filter(M=>{const z=M.name.split(".");if(z.slice(0,z.length-1).join(".")===e.table&&M.name!==e.column)return!0}):[]}function R(T){const M=Xne(T[0].toString());if(!(M!=null&&M.value)||!(M!=null&&M.operation))return;const F={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:bp(e),name:e.column,operation:M.operation,values:[Number(M.value)]};u(F)}function E(T){if(console.log("onComboBoxChange",T),T.length===1&&_.find(F=>F.value===T[0].value)===void 0){R(T);return}if(n(T),T.length===0){f(e.id);return}const M={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:bp(e),operation:e.operation,values:T.map(F=>F.value)};u(M)}function O(){var T;o(""),f(e.id),console.log(e.id),(T=a.current)==null||T.click()}if(v)return N.jsx("div",{children:N.jsx(Qy,{className:"h-8 w-full bg-foreground/10"})});if(x)return N.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"});let k=[];return rc.includes(e.dataType)?k=_:k=i===""?_:_==null?void 0:_.filter(T=>T.value.toLowerCase().replace(/\s+/g,"").includes(i.toLowerCase().replace(/\s+/g,""))),N.jsx("div",{className:"w-full",children:N.jsx(El,{value:t,onChange:E,multiple:!0,children:N.jsxs("div",{className:"relative",children:[N.jsxs("div",{className:"relative w-full cursor-default overflow-hidden rounded-sm border bg-background text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-background/75 focus-visible:ring-offset-2 sm:text-sm",children:[N.jsx(El.Input,{className:"flex h-8 w-full rounded border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",displayValue:T=>T.map(F=>F.value).join(", ")||r,onChange:T=>{o(T.target.value),s(T.target.value)}}),N.jsx(El.Button,{ref:a,className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:N.jsx(dG,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),N.jsx(Kne,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:N.jsxs(El.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-sm border bg-background py-1 text-base shadow-lg ring-1 ring-black/5 focus:outline-none sm:text-sm",children:[rc.includes(e.dataType)&&N.jsxs(El.Option,{value:r,className:"flex items-center justify-between gap-2 px-3 py-2",children:[N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("span",{className:"font-thin",children:"#"}),N.jsx("span",{children:r})]}),r&&N.jsx(Po,{variant:"link",className:"h-4 w-3 cursor-pointer text-foreground/50 hover:text-foreground/100",onClick:T=>{T.stopPropagation(),O()},children:"Clear"})]},"custom"),(k==null?void 0:k.length)===0&&i!==""?N.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):k==null?void 0:k.map(T=>N.jsx(El.Option,{className:({active:M})=>`relative cursor-default select-none border-b border-muted py-2 pl-10 pr-4 ${M?"bg-muted":"text-foreground-900"}`,value:T,children:({selected:M,active:F})=>N.jsxs("div",{className:"",children:[N.jsx("span",{className:`block ${M?"font-medium":"font-normal"}`,children:typeof T.value=="boolean"?T.value?"True":"False":T.value}),M?N.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:N.jsx($D,{className:"h-5 w-5","aria-hidden":"true"})}):null]})},T.value))]})})]})})})}const Zne=XC.WidthProvider(XC.Responsive);function ere(){var O,k,T;const e=Te(M=>M.isDashboardEditing);Te(M=>M.currentBreakpoint);const t=Te(M=>M.themeStyle),n=Te(M=>M.selectedSheetId);(O=Te(M=>{var F,z;return(z=(F=M.dashboard)==null?void 0:F.sheets)==null?void 0:z.filter(B=>B.id===n)}))==null||O[0].layout;const r=(k=Te(M=>{var F,z;return(z=(F=M.dashboard)==null?void 0:F.sheets)==null?void 0:z.filter(B=>B.id===n)}))==null?void 0:k[0].layouts,o=Te(M=>M.dashboard.filters),i=Te(M=>{var F,z,B;return(B=(z=(F=M.dashboard)==null?void 0:F.sheets)==null?void 0:z.find(Y=>Y.id===n))==null?void 0:B.frames}),{getSelectedSheet:s,getSelectedSheetLayout:a,getSelectedSheetLayouts:l,setSheetLayout:c,setSheetLayouts:u,setCurrentBreakpoint:f,removeFilter:g,updateFilter:p,removeFilterValue:v}=Te(M=>M.actions),y=s(),x=m.useCallback(M=>{f(M)},[]),w=m.useCallback((M,F)=>{y!=null&&y.id&&u(y.id,F)},[y==null?void 0:y.id,u]);if(!n)return null;const _=(M,F)=>N.jsx(Yk,{className:"after:content-none",ref:F,handleAxis:M}),S=M=>zd.includes(M.dataType)?N.jsx(yte,{filter:M}):N.jsx(Jne,{filter:M});function R(){return o==null?void 0:o.map(M=>N.jsxs("div",{className:Oe("group z-50 flex w-full flex-col rounded-md bg-muted/50 p-2"),children:[N.jsx(Ma,{className:"my-1",text:M.title||M.column,onSave:F=>p({...M,title:F}),children:N.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[N.jsxs("div",{className:"flex grow items-center gap-2",children:[N.jsx(So,{className:"inline-block text-sm",children:M.title}),e&&N.jsx($J,{filter:M})]}),N.jsxs("div",{className:"flex items-center gap-2",children:[N.jsx("div",{onClick:()=>v(M.id),className:"invisible cursor-pointer text-xs text-muted-foreground hover:text-foreground hover:underline group-hover:visible",children:"Clear"}),e&&N.jsx(dK,{onClick:()=>{v(M.id),g(M.id)},className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})]})]})}),S(M)]},M.id))}function E(){return i==null?void 0:i.map(M=>N.jsx("div",{role:"dashboard-frame-container",className:Oe("group",t==null?void 0:t.dashboardCardContainer),children:N.jsx(AX,{frame:M})},M.id))}return N.jsx(N.Fragment,{children:N.jsxs(Zne,{margin:[10,10],isDraggable:e,resizeHandles:e?["sw","nw","ne","se","e","w"]:[],className:Oe((T=t==null?void 0:t.gridLayout)==null?void 0:T.className),layouts:r,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:1,onBreakpointChange:x,onLayoutChange:w,resizeHandle:_,children:[R(),E()]})})}const Yk=m.forwardRef(({className:e,handleAxis:t,...n},r)=>N.jsx("div",{ref:r,className:Oe(`react-resizable-handle z-10 react-resizable-handle-${t} absolute border-foreground/40`,{"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0":t==="nw","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0":t==="ne","border-foreground/40 group-hover:border-2 group-hover:border-r-0 group-hover:border-t-0":t==="sw","border-foreground/40 group-hover:border-2 group-hover:border-l-0 group-hover:border-t-0":t==="se","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0 group-hover:border-t-0":t==="e","border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-r-0 group-hover:border-t-0":t==="w"},e),...n}));Yk.displayName="ResizeHandle";const Xw=fe.forwardRef(({className:e,type:t,...n},r)=>N.jsx("input",{type:t,className:Oe("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Xw.displayName="Input";let tre=(e,t=21)=>(n=t)=>{let r="",o=n;for(;o--;)r+=e[Math.random()*e.length|0];return r};var Ec={exports:{}};const nre=typeof Buffer<"u",bP=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,yP=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Kk(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),nre&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));const r=JSON.parse(e,t);if(r===null||typeof r!="object")return r;const o=n&&n.protoAction||"error",i=n&&n.constructorAction||"error";if(o==="ignore"&&i==="ignore")return r;if(o!=="ignore"&&i!=="ignore"){if(bP.test(e)===!1&&yP.test(e)===!1)return r}else if(o!=="ignore"&&i==="ignore"){if(bP.test(e)===!1)return r}else if(yP.test(e)===!1)return r;return Xk(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function Xk(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let o=[e];for(;o.length;){const i=o;o=[];for(const s of i){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"__proto__")){if(r===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.__proto__}if(n!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype")){if(r===!0)return null;if(n==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.constructor}for(const a in s){const l=s[a];l&&typeof l=="object"&&o.push(l)}}}return e}function Qw(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return Kk(e,t,n)}finally{Error.stackTraceLimit=r}}function rre(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return Kk(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}Ec.exports=Qw;Ec.exports.default=Qw;Ec.exports.parse=Qw;Ec.exports.safeParse=rre;Ec.exports.scan=Xk;var ore=Ec.exports;const xP=vc(ore);var Qk=tre("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7);function ire(e){const t=["ROOT"];let n=-1,r=null;function o(l,c,u){switch(l){case'"':{n=c,t.pop(),t.push(u),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=c,r=c,t.pop(),t.push(u),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c,t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"{":{n=c,t.pop(),t.push(u),t.push("INSIDE_OBJECT_START");break}case"[":{n=c,t.pop(),t.push(u),t.push("INSIDE_ARRAY_START");break}}}function i(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=c,t.pop();break}}}function s(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}}}for(let l=0;l<e.length;l++){const c=e[l];switch(t[t.length-1]){case"ROOT":o(c,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=l,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(c){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{o(c,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(c,l);break}case"INSIDE_STRING":{switch(c){case'"':{t.pop(),n=l;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=l}break}case"INSIDE_ARRAY_START":{switch(c){case"]":{n=l,t.pop();break}default:{n=l,o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,t.pop();break}default:{n=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=l;break}case"INSIDE_NUMBER":{switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const f=e.substring(r,l+1);!"false".startsWith(f)&&!"true".startsWith(f)&&!"null".startsWith(f)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(c,l):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l)):n=l;break}}}let a=e.slice(0,n+1);for(let l=t.length-1;l>=0;l--)switch(t[l]){case"INSIDE_STRING":{a+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{a+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{a+="]";break}case"INSIDE_LITERAL":{const u=e.substring(r,e.length);"true".startsWith(u)?a+="true".slice(u.length):"false".startsWith(u)?a+="false".slice(u.length):"null".startsWith(u)&&(a+="null".slice(u.length))}}return a}function sre(e){if(e!=null)try{return xP.parse(e)}catch{try{const n=ire(e);return xP.parse(n)}catch{}}}var nd={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},rd={code:"1",name:"function_call",parse:e=>{if(e==null||typeof e!="object"||!("function_call"in e)||typeof e.function_call!="object"||e.function_call==null||!("name"in e.function_call)||!("arguments"in e.function_call)||typeof e.function_call.name!="string"||typeof e.function_call.arguments!="string")throw new Error('"function_call" parts expect an object with a "function_call" property.');return{type:"function_call",value:e}}},od={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},id={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},sd={code:"4",name:"assistant_message",parse:e=>{if(e==null||typeof e!="object"||!("id"in e)||!("role"in e)||!("content"in e)||typeof e.id!="string"||typeof e.role!="string"||e.role!=="assistant"||!Array.isArray(e.content)||!e.content.every(t=>t!=null&&typeof t=="object"&&"type"in t&&t.type==="text"&&"text"in t&&t.text!=null&&typeof t.text=="object"&&"value"in t.text&&typeof t.text.value=="string"))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},ad={code:"5",name:"assistant_control_data",parse:e=>{if(e==null||typeof e!="object"||!("threadId"in e)||!("messageId"in e)||typeof e.threadId!="string"||typeof e.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},ld={code:"6",name:"data_message",parse:e=>{if(e==null||typeof e!="object"||!("role"in e)||!("data"in e)||typeof e.role!="string"||e.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},cd={code:"7",name:"tool_calls",parse:e=>{if(e==null||typeof e!="object"||!("tool_calls"in e)||typeof e.tool_calls!="object"||e.tool_calls==null||!Array.isArray(e.tool_calls)||e.tool_calls.some(t=>t==null||typeof t!="object"||!("id"in t)||typeof t.id!="string"||!("type"in t)||typeof t.type!="string"||!("function"in t)||t.function==null||typeof t.function!="object"||!("arguments"in t.function)||typeof t.function.name!="string"||typeof t.function.arguments!="string"))throw new Error('"tool_calls" parts expect an object with a ToolCallPayload.');return{type:"tool_calls",value:e}}},ud={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},dd={code:"9",name:"tool_call",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string"||!("args"in e)||typeof e.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},fd={code:"a",name:"tool_result",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string"||!("args"in e)||typeof e.args!="object"||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId", "toolName", "args", and "result" property.');return{type:"tool_result",value:e}}},hd={code:"b",name:"tool_call_streaming_start",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},pd={code:"c",name:"tool_call_delta",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("argsTextDelta"in e)||typeof e.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},gd={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string"||!("usage"in e)||e.usage==null||typeof e.usage!="object"||!("promptTokens"in e.usage)||typeof e.usage.promptTokens!="number"||!("completionTokens"in e.usage)||typeof e.usage.completionTokens!="number")throw new Error('"finish_message" parts expect an object with a "finishReason" and "usage" property.');return{type:"finish_message",value:e}}},are=[nd,rd,od,id,sd,ad,ld,cd,ud,dd,fd,hd,pd,gd],lre={[nd.code]:nd,[rd.code]:rd,[od.code]:od,[id.code]:id,[sd.code]:sd,[ad.code]:ad,[ld.code]:ld,[cd.code]:cd,[ud.code]:ud,[dd.code]:dd,[fd.code]:fd,[hd.code]:hd,[pd.code]:pd,[gd.code]:gd};nd.name+"",nd.code,rd.name+"",rd.code,od.name+"",od.code,id.name+"",id.code,sd.name+"",sd.code,ad.name+"",ad.code,ld.name+"",ld.code,cd.name+"",cd.code,ud.name+"",ud.code,dd.name+"",dd.code,fd.name+"",fd.code,hd.name+"",hd.code,pd.name+"",pd.code,gd.name+"",gd.code;var cre=are.map(e=>e.code),Jk=e=>{const t=e.indexOf(":");if(t===-1)throw new Error("Failed to parse stream string. No separator found.");const n=e.slice(0,t);if(!cre.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,o=e.slice(t+1),i=JSON.parse(o);return lre[r].parse(i)},ure=10;function dre(e,t){const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return e.length=0,n}async function*fre(e,{isAborted:t}={}){const n=new TextDecoder,r=[];let o=0;for(;;){const{value:i}=await e.read();if(i&&(r.push(i),o+=i.length,i[i.length-1]!==ure))continue;if(r.length===0)break;const s=dre(r,o);o=0;const a=n.decode(s,{stream:!0}).split(`
360
+ `).filter(l=>l!=="").map(Jk);for(const l of a)yield l;if(t!=null&&t()){e.cancel();break}}}function zh(e,t){return!e||!t||!t.length?e:{...e,annotations:[...t]}}async function hre({reader:e,abortControllerRef:t,update:n,onToolCall:r,onFinish:o,generateId:i=Qk,getCurrentDate:s=()=>new Date}){const a=s(),l={data:[]};let c;const u={};let f={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},g="unknown";for await(const{type:p,value:v}of fre(e,{isAborted:()=>(t==null?void 0:t.current)===null})){if(p==="text"&&(l.text?l.text={...l.text,content:(l.text.content||"")+v}:l.text={id:i(),role:"assistant",content:v,createdAt:a}),p==="finish_message"){const{completionTokens:S,promptTokens:R}=v.usage;g=v.finishReason,f={completionTokens:S,promptTokens:R,totalTokens:S+R}}if(p==="tool_call_streaming_start")l.text==null&&(l.text={id:i(),role:"assistant",content:"",createdAt:a}),l.text.toolInvocations==null&&(l.text.toolInvocations=[]),u[v.toolCallId]={text:"",toolName:v.toolName,prefixMapIndex:l.text.toolInvocations.length},l.text.toolInvocations.push({state:"partial-call",toolCallId:v.toolCallId,toolName:v.toolName,args:void 0});else if(p==="tool_call_delta"){const S=u[v.toolCallId];S.text+=v.argsTextDelta,l.text.toolInvocations[S.prefixMapIndex]={state:"partial-call",toolCallId:v.toolCallId,toolName:S.toolName,args:sre(S.text)},l.text.internalUpdateId=i()}else if(p==="tool_call"){if(u[v.toolCallId]!=null?l.text.toolInvocations[u[v.toolCallId].prefixMapIndex]={state:"call",...v}:(l.text==null&&(l.text={id:i(),role:"assistant",content:"",createdAt:a}),l.text.toolInvocations==null&&(l.text.toolInvocations=[]),l.text.toolInvocations.push({state:"call",...v})),l.text.internalUpdateId=i(),r){const S=await r({toolCall:v});S!=null&&(l.text.toolInvocations[l.text.toolInvocations.length-1]={state:"result",...v,result:S})}}else if(p==="tool_result"){l.text==null&&(l.text={id:i(),role:"assistant",content:"",createdAt:a}),l.text.toolInvocations==null&&(l.text.toolInvocations=[]);const S=l.text.toolInvocations.findIndex(E=>E.toolCallId===v.toolCallId),R={state:"result",...v};S!==-1?l.text.toolInvocations[S]=R:l.text.toolInvocations.push(R)}let y=null;p==="function_call"&&(l.function_call={id:i(),role:"assistant",content:"",function_call:v.function_call,name:v.function_call.name,createdAt:a},y=l.function_call);let x=null;p==="tool_calls"&&(l.tool_calls={id:i(),role:"assistant",content:"",tool_calls:v.tool_calls,createdAt:a},x=l.tool_calls),p==="data"&&l.data.push(...v);let w=l.text;p==="message_annotations"&&(c?c.push(...v):c=[...v],y=zh(l.function_call,c),x=zh(l.tool_calls,c),w=zh(l.text,c)),c!=null&&c.length&&["text","function_call","tool_calls"].forEach(R=>{l[R]&&(l[R].annotations=[...c])});const _=[y,x,w].filter(Boolean).map(S=>({...zh(S,c)}));n(_,[...l.data])}return o==null||o({prefixMap:l,finishReason:g,usage:f}),{messages:[l.text,l.function_call,l.tool_calls].filter(Boolean),data:l.data}}var pre=()=>fetch;async function gre({api:e,body:t,streamProtocol:n="data",credentials:r,headers:o,abortController:i,restoreMessagesOnFailure:s,onResponse:a,onUpdate:l,onFinish:c,onToolCall:u,generateId:f,fetch:g=pre()}){var p,v;const y=await g(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...o},signal:(p=i==null?void 0:i())==null?void 0:p.signal,credentials:r}).catch(w=>{throw s(),w});if(a)try{await a(y)}catch(w){throw w}if(!y.ok)throw s(),new Error((v=await y.text())!=null?v:"Failed to fetch the chat response.");if(!y.body)throw new Error("The response body is empty.");const x=y.body.getReader();switch(n){case"text":{const w=mre(),_={id:f(),createdAt:new Date,role:"assistant",content:""};for(;;){const{done:S,value:R}=await x.read();if(S)break;if(_.content+=w(R),_.id=f(),l([{..._}],[]),(i==null?void 0:i())===null){x.cancel();break}}return c==null||c(_,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"}),{messages:[_],data:[]}}case"data":return await hre({reader:x,abortControllerRef:i!=null?{current:i()}:void 0,update:l,onToolCall:u,onFinish({prefixMap:w,finishReason:_,usage:S}){c&&w.text!=null&&c(w.text,{usage:S,finishReason:_})},generateId:f});default:{const w=n;throw new Error(`Unknown stream protocol: ${w}`)}}}function mre(e){const t=new TextDecoder;return e?function(n){return t.decode(n,{stream:!0}).split(`
361
+ `).filter(o=>o!=="").map(Jk).filter(Boolean)}:function(n){return n?t.decode(n,{stream:!0}):""}}async function vre({getStreamedResponse:e,experimental_onFunctionCall:t,experimental_onToolCall:n,updateChatRequest:r,getCurrentMessages:o}){for(;;){const i=await e();if("messages"in i){let s=!1;for(const a of i.messages)if(!((a.function_call===void 0||typeof a.function_call=="string")&&(a.tool_calls===void 0||typeof a.tool_calls=="string"))){if(s=!0,t){const l=a.function_call;if(typeof l!="object"){console.warn("experimental_onFunctionCall should not be defined when using tools");continue}const c=await t(o(),l);if(c===void 0){s=!1;break}r(c)}if(n){const l=a.tool_calls;if(!Array.isArray(l)||l.some(u=>typeof u!="object")){console.warn("experimental_onToolCall should not be defined when using tools");continue}const c=await n(o(),l);if(c===void 0){s=!1;break}r(c)}}if(!s)break}else{let s=function(l){for(const c of l.messages){if(c.tool_calls!==void 0)for(const u of c.tool_calls)typeof u=="object"&&u.function.arguments&&typeof u.function.arguments!="string"&&(u.function.arguments=JSON.stringify(u.function.arguments));c.function_call!==void 0&&typeof c.function_call=="object"&&c.function_call.arguments&&typeof c.function_call.arguments!="string"&&(c.function_call.arguments=JSON.stringify(c.function_call.arguments))}};const a=i;if((a.function_call===void 0||typeof a.function_call=="string")&&(a.tool_calls===void 0||typeof a.tool_calls=="string"))break;if(t){const l=a.function_call;if(typeof l!="object"){console.warn("experimental_onFunctionCall should not be defined when using tools");continue}const c=await t(o(),l);if(c===void 0)break;s(c),r(c)}if(n){const l=a.tool_calls;if(typeof l!="object"){console.warn("experimental_onToolCall should not be defined when using functions");continue}const c=await n(o(),l);if(c===void 0)break;s(c),r(c)}}}}var bre=Hy();const ws=()=>{},hr=ws(),$b=Object,Pt=e=>e===hr,Uo=e=>typeof e=="function",Ds=(e,t)=>({...e,...t}),yre=e=>Uo(e.then),jh=new WeakMap;let xre=0;const md=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if($b(e)===e&&!r&&n!=RegExp){if(o=jh.get(e),o)return o;if(o=++xre+"~",jh.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=md(e[i])+",";jh.set(e,o)}if(n==$b){o="#";const s=$b.keys(e).sort();for(;!Pt(i=s.pop());)Pt(e[i])||(o+=i+":"+md(e[i])+",");jh.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},Ri=new WeakMap,Db={},Bh={},Jw="undefined",Xg=typeof window!=Jw,wy=typeof document!=Jw,wre=()=>Xg&&typeof window.requestAnimationFrame!=Jw,Zk=(e,t)=>{const n=Ri.get(e);return[()=>!Pt(t)&&e.get(t)||Db,r=>{if(!Pt(t)){const o=e.get(t);t in Bh||(Bh[t]=o),n[5](t,Ds(o,r),o||Db)}},n[6],()=>!Pt(t)&&t in Bh?Bh[t]:!Pt(t)&&e.get(t)||Db]};let _y=!0;const _re=()=>_y,[Sy,Cy]=Xg&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[ws,ws],Sre=()=>{const e=wy&&document.visibilityState;return Pt(e)||e!=="hidden"},Cre=e=>(wy&&document.addEventListener("visibilitychange",e),Sy("focus",e),()=>{wy&&document.removeEventListener("visibilitychange",e),Cy("focus",e)}),Ere=e=>{const t=()=>{_y=!0,e()},n=()=>{_y=!1};return Sy("online",t),Sy("offline",n),()=>{Cy("online",t),Cy("offline",n)}},Rre={isOnline:_re,isVisible:Sre},Pre={initFocus:Cre,initReconnect:Ere},wP=!m.useId,vd=!Xg||"Deno"in window,Ore=e=>wre()?window.requestAnimationFrame(e):setTimeout(e,1),Tb=vd?m.useEffect:m.useLayoutEffect,kb=typeof navigator<"u"&&navigator.connection,_P=!vd&&kb&&(["slow-2g","2g"].includes(kb.effectiveType)||kb.saveData),Zw=e=>{if(Uo(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?md(e):"",[e,t]};let $re=0;const Ey=()=>++$re,eM=0,tM=1,nM=2,Dre=3;var fu={__proto__:null,ERROR_REVALIDATE_EVENT:Dre,FOCUS_EVENT:eM,MUTATE_EVENT:nM,RECONNECT_EVENT:tM};async function rM(...e){const[t,n,r,o]=e,i=Ds({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let s=i.populateCache;const a=i.rollbackOnError;let l=i.optimisticData;const c=g=>typeof a=="function"?a(g):a!==!1,u=i.throwOnError;if(Uo(n)){const g=n,p=[],v=t.keys();for(const y of v)!/^\$(inf|sub)\$/.test(y)&&g(t.get(y)._k)&&p.push(y);return Promise.all(p.map(f))}return f(n);async function f(g){const[p]=Zw(g);if(!p)return;const[v,y]=Zk(t,p),[x,w,_,S]=Ri.get(t),R=()=>{const Y=x[p];return(Uo(i.revalidate)?i.revalidate(v().data,g):i.revalidate!==!1)&&(delete _[p],delete S[p],Y&&Y[0])?Y[0](nM).then(()=>v().data):v().data};if(e.length<3)return R();let E=r,O;const k=Ey();w[p]=[k,0];const T=!Pt(l),M=v(),F=M.data,z=M._c,B=Pt(z)?F:z;if(T&&(l=Uo(l)?l(B,F):l,y({data:l,_c:B})),Uo(E))try{E=E(B)}catch(Y){O=Y}if(E&&yre(E))if(E=await E.catch(Y=>{O=Y}),k!==w[p][0]){if(O)throw O;return E}else O&&T&&c(O)&&(s=!0,y({data:B,_c:hr}));if(s&&!O)if(Uo(s)){const Y=s(E,B);y({data:Y,error:hr,_c:hr})}else y({data:E,error:hr,_c:hr});if(w[p][1]=Ey(),Promise.resolve(R()).then(()=>{y({_c:hr})}),O){if(u)throw O;return}return E}}const SP=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Tre=(e,t)=>{if(!Ri.has(e)){const n=Ds(Pre,t),r={},o=rM.bind(hr,e);let i=ws;const s={},a=(u,f)=>{const g=s[u]||[];return s[u]=g,g.push(f),()=>g.splice(g.indexOf(f),1)},l=(u,f,g)=>{e.set(u,f);const p=s[u];if(p)for(const v of p)v(f,g)},c=()=>{if(!Ri.has(e)&&(Ri.set(e,[r,{},{},{},o,l,a]),!vd)){const u=n.initFocus(setTimeout.bind(hr,SP.bind(hr,r,eM))),f=n.initReconnect(setTimeout.bind(hr,SP.bind(hr,r,tM)));i=()=>{u&&u(),f&&f(),Ri.delete(e)}}};return c(),[e,o,c,i]}return[e,Ri.get(e)[4]]},kre=(e,t,n,r,o)=>{const i=n.errorRetryCount,s=o.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Pt(i)&&s>i||setTimeout(r,a,o)},Mre=(e,t)=>md(e)==md(t),[oM,Are]=Tre(new Map),Ire=Ds({onLoadingSlow:ws,onSuccess:ws,onError:ws,onErrorRetry:kre,onDiscarded:ws,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:_P?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:_P?5e3:3e3,compare:Mre,isPaused:()=>!1,cache:oM,mutate:Are,fallback:{}},Rre),Nre=(e,t)=>{const n=Ds(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:s}=t;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=Ds(o,s))}return n},Lre=m.createContext({}),Fre="$inf$",iM=Xg&&window.__SWR_DEVTOOLS_USE__,zre=iM?window.__SWR_DEVTOOLS_USE__:[],jre=()=>{iM&&(window.__SWR_DEVTOOLS_REACT__=m)},Bre=e=>Uo(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Vre=()=>Ds(Ire,m.useContext(Lre)),Hre=e=>(t,n,r)=>e(t,n&&((...i)=>{const[s]=Zw(t),[,,,a]=Ri.get(oM);if(s.startsWith(Fre))return n(...i);const l=a[s];return Pt(l)?n(...i):(delete a[s],l)}),r),Wre=zre.concat(Hre),Ure=e=>function(...n){const r=Vre(),[o,i,s]=Bre(n),a=Nre(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(Wre);for(let f=u.length;f--;)l=u[f](l);return l(o,i||a.fetcher||null,a)},qre=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}};jre();const CP=m.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),Mb={dedupe:!0},Gre=(e,t,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:f,keepPreviousData:g}=n,[p,v,y,x]=Ri.get(r),[w,_]=Zw(e),S=m.useRef(!1),R=m.useRef(!1),E=m.useRef(w),O=m.useRef(t),k=m.useRef(n),T=()=>k.current,M=()=>T().isVisible()&&T().isOnline(),[F,z,B,Y]=Zk(r,w),G=m.useRef({}).current,j=Pt(s)?n.fallback[w]:s,ee=(W,me)=>{for(const _e in G){const Pe=_e;if(Pe==="data"){if(!o(W[Pe],me[Pe])&&(!Pt(W[Pe])||!o(ge,me[Pe])))return!1}else if(me[Pe]!==W[Pe])return!1}return!0},q=m.useMemo(()=>{const W=!w||!t?!1:Pt(a)?T().isPaused()||i?!1:Pt(l)?!0:l:a,me=Ne=>{const Xe=Ds(Ne);return delete Xe._k,W?{isValidating:!0,isLoading:!0,...Xe}:Xe},_e=F(),Pe=Y(),$e=me(_e),Ue=_e===Pe?$e:me(Pe);let ze=$e;return[()=>{const Ne=me(F());return ee(Ne,ze)?(ze.data=Ne.data,ze.isLoading=Ne.isLoading,ze.isValidating=Ne.isValidating,ze.error=Ne.error,ze):(ze=Ne,Ne)},()=>Ue]},[r,w]),X=bre.useSyncExternalStore(m.useCallback(W=>B(w,(me,_e)=>{ee(_e,me)||W()}),[r,w]),q[0],q[1]),re=!S.current,$=p[w]&&p[w].length>0,H=X.data,ne=Pt(H)?j:H,I=X.error,ce=m.useRef(ne),ge=g?Pt(H)?ce.current:H:ne,he=$&&!Pt(I)?!1:re&&!Pt(a)?a:T().isPaused()?!1:i?Pt(ne)?!1:l:Pt(ne)||l,de=!!(w&&t&&re&&he),oe=Pt(X.isValidating)?de:X.isValidating,Z=Pt(X.isLoading)?de:X.isLoading,ie=m.useCallback(async W=>{const me=O.current;if(!w||!me||R.current||T().isPaused())return!1;let _e,Pe,$e=!0;const Ue=W||{},ze=!y[w]||!Ue.dedupe,Ne=()=>wP?!R.current&&w===E.current&&S.current:w===E.current,Xe={isValidating:!1,isLoading:!1},gt=()=>{z(Xe)},It=()=>{const ln=y[w];ln&&ln[1]===Pe&&delete y[w]},zt={isValidating:!0};Pt(F().data)&&(zt.isLoading=!0);try{if(ze&&(z(zt),n.loadingTimeout&&Pt(F().data)&&setTimeout(()=>{$e&&Ne()&&T().onLoadingSlow(w,n)},n.loadingTimeout),y[w]=[me(_),Ey()]),[_e,Pe]=y[w],_e=await _e,ze&&setTimeout(It,n.dedupingInterval),!y[w]||y[w][1]!==Pe)return ze&&Ne()&&T().onDiscarded(w),!1;Xe.error=hr;const ln=v[w];if(!Pt(ln)&&(Pe<=ln[0]||Pe<=ln[1]||ln[1]===0))return gt(),ze&&Ne()&&T().onDiscarded(w),!1;const le=F().data;Xe.data=o(le,_e)?le:_e,ze&&Ne()&&T().onSuccess(_e,w,n)}catch(ln){It();const le=T(),{shouldRetryOnError:Ce}=le;le.isPaused()||(Xe.error=ln,ze&&Ne()&&(le.onError(ln,w,le),(Ce===!0||Uo(Ce)&&Ce(ln))&&(!T().revalidateOnFocus||!T().revalidateOnReconnect||M())&&le.onErrorRetry(ln,w,le,Le=>{const qe=p[w];qe&&qe[0]&&qe[0](fu.ERROR_REVALIDATE_EVENT,Le)},{retryCount:(Ue.retryCount||0)+1,dedupe:!0})))}return $e=!1,gt(),!0},[w,r]),ye=m.useCallback((...W)=>rM(r,E.current,...W),[]);if(Tb(()=>{O.current=t,k.current=n,Pt(H)||(ce.current=H)}),Tb(()=>{if(!w)return;const W=ie.bind(hr,Mb);let me=0;const Pe=qre(w,p,($e,Ue={})=>{if($e==fu.FOCUS_EVENT){const ze=Date.now();T().revalidateOnFocus&&ze>me&&M()&&(me=ze+T().focusThrottleInterval,W())}else if($e==fu.RECONNECT_EVENT)T().revalidateOnReconnect&&M()&&W();else{if($e==fu.MUTATE_EVENT)return ie();if($e==fu.ERROR_REVALIDATE_EVENT)return ie(Ue)}});return R.current=!1,E.current=w,S.current=!0,z({_k:_}),he&&(Pt(ne)||vd?W():Ore(W)),()=>{R.current=!0,Pe()}},[w]),Tb(()=>{let W;function me(){const Pe=Uo(c)?c(F().data):c;Pe&&W!==-1&&(W=setTimeout(_e,Pe))}function _e(){!F().error&&(u||T().isVisible())&&(f||T().isOnline())?ie(Mb).then(me):me()}return me(),()=>{W&&(clearTimeout(W),W=-1)}},[c,u,f,w]),m.useDebugValue(ge),i&&Pt(ne)&&w){if(!wP&&vd)throw new Error("Fallback data is required when using suspense in SSR.");O.current=t,k.current=n,R.current=!1;const W=x[w];if(!Pt(W)){const me=ye(W);CP(me)}if(Pt(I)){const me=ie(Mb);Pt(ge)||(me.status="fulfilled",me.value=!0),CP(me)}else throw I}return{mutate:ye,get data(){return G.data=!0,ge},get error(){return G.error=!0,I},get isValidating(){return G.isValidating=!0,oe},get isLoading(){return G.isLoading=!0,Z}}},Vh=Ure(Gre);var Yre=async(e,t,n,r,o,i,s,a,l,c,u,f,g,p,v,y,x)=>{var w;const _=s.current;n(t.messages,!1);const S=p?t.messages:t.messages.map(({role:R,content:E,experimental_attachments:O,name:k,data:T,annotations:M,toolInvocations:F,function_call:z,tool_calls:B,tool_call_id:Y})=>({role:R,content:E,...O!==void 0&&{experimental_attachments:O},...k!==void 0&&{name:k},...T!==void 0&&{data:T},...M!==void 0&&{annotations:M},...F!==void 0&&{toolInvocations:F},tool_call_id:Y,...z!==void 0&&{function_call:z},...B!==void 0&&{tool_calls:B}}));return await gre({api:e,body:(w=v==null?void 0:v({messages:t.messages,requestData:t.data,requestBody:t.body}))!=null?w:{messages:S,data:t.data,...i.current.body,...t.body,...t.functions!==void 0&&{functions:t.functions},...t.function_call!==void 0&&{function_call:t.function_call},...t.tools!==void 0&&{tools:t.tools},...t.tool_choice!==void 0&&{tool_choice:t.tool_choice}},streamProtocol:c,credentials:i.current.credentials,headers:{...i.current.headers,...t.headers},abortController:()=>a.current,restoreMessagesOnFailure(){x||n(_,!1)},onResponse:f,onUpdate(R,E){n([...t.messages,...R],!1),r([...o||[],...E||[]],!1)},onToolCall:g,onFinish:u,generateId:l,fetch:y})};function Kre({api:e="/api/chat",id:t,initialMessages:n,initialInput:r="",sendExtraMessageFields:o,experimental_onFunctionCall:i,experimental_onToolCall:s,onToolCall:a,experimental_prepareRequestBody:l,experimental_maxAutomaticRoundtrips:c=0,maxAutomaticRoundtrips:u=c,maxToolRoundtrips:f=u,streamMode:g,streamProtocol:p,onResponse:v,onFinish:y,onError:x,credentials:w,headers:_,body:S,generateId:R=Qk,fetch:E,keepLastMessageOnError:O=!1}={}){g&&(p??(p=g==="text"?"text":void 0));const k=m.useId(),T=t??k,M=typeof e=="string"?[e,T]:T,[F]=m.useState([]),{data:z,mutate:B}=Vh([M,"messages"],null,{fallbackData:n??F}),{data:Y=!1,mutate:G}=Vh([M,"loading"],null),{data:j,mutate:ee}=Vh([M,"streamData"],null),{data:q=void 0,mutate:X}=Vh([M,"error"],null),re=m.useRef(z||[]);m.useEffect(()=>{re.current=z||[]},[z]);const $=m.useRef(null),H=m.useRef({credentials:w,headers:_,body:S});m.useEffect(()=>{H.current={credentials:w,headers:_,body:S}},[w,_,S]);const ne=m.useCallback(async W=>{const me=re.current.length;try{G(!0),X(void 0);const $e=new AbortController;$.current=$e,await vre({getStreamedResponse:()=>Yre(e,W,B,ee,j,H,re,$,R,p,y,v,a,o,l,E,O),experimental_onFunctionCall:i,experimental_onToolCall:s,updateChatRequest:Ue=>{W=Ue},getCurrentMessages:()=>re.current}),$.current=null}catch($e){if($e.name==="AbortError")return $.current=null,null;x&&$e instanceof Error&&x($e),X($e)}finally{G(!1)}const _e=re.current,Pe=_e[_e.length-1];_e.length>me&&Pe!=null&&f>0&&EP(Pe)&&Xre(_e)<=f&&await ne({messages:_e})},[B,G,e,H,v,y,x,X,ee,j,p,o,i,s,l,a,f,re,$,R,E,O]),I=m.useCallback(async(W,{options:me,functions:_e,function_call:Pe,tools:$e,tool_choice:Ue,data:ze,headers:Ne,body:Xe}={})=>{W.id||(W.id=R());const gt={headers:Ne??(me==null?void 0:me.headers),body:Xe??(me==null?void 0:me.body)},It={messages:re.current.concat(W),options:gt,headers:gt.headers,body:gt.body,data:ze,..._e!==void 0&&{functions:_e},...Pe!==void 0&&{function_call:Pe},...$e!==void 0&&{tools:$e},...Ue!==void 0&&{tool_choice:Ue}};return ne(It)},[ne,R]),ce=m.useCallback(async({options:W,functions:me,function_call:_e,tools:Pe,tool_choice:$e,data:Ue,headers:ze,body:Ne}={})=>{if(re.current.length===0)return null;const Xe={headers:ze??(W==null?void 0:W.headers),body:Ne??(W==null?void 0:W.body)};if(re.current[re.current.length-1].role==="assistant"){const zt={messages:re.current.slice(0,-1),options:Xe,headers:Xe.headers,body:Xe.body,data:Ue,...me!==void 0&&{functions:me},..._e!==void 0&&{function_call:_e},...Pe!==void 0&&{tools:Pe},...$e!==void 0&&{tool_choice:$e}};return ne(zt)}const It={messages:re.current,options:Xe,headers:Xe.headers,body:Xe.body,data:Ue,...me!==void 0&&{functions:me},..._e!==void 0&&{function_call:_e},...Pe!==void 0&&{tools:Pe},...$e!==void 0&&{tool_choice:$e}};return ne(It)},[ne]),ge=m.useCallback(()=>{$.current&&($.current.abort(),$.current=null)},[]),he=m.useCallback(W=>{typeof W=="function"&&(W=W(re.current)),B(W,!1),re.current=W},[B]),[de,oe]=m.useState(r),Z=m.useCallback(async(W,me={},_e)=>{var Pe,$e,Ue,ze,Ne;if((Pe=W==null?void 0:W.preventDefault)==null||Pe.call(W),!de&&!me.allowEmptySubmit)return;_e&&(H.current={...H.current,..._e});const Xe=[],gt=me.experimental_attachments;if(gt)if(gt instanceof FileList)for(const le of Array.from(gt)){const{name:Ce,type:Le}=le,qe=await new Promise((dt,rn)=>{const on=new FileReader;on.onload=fn=>{var zn;dt((zn=fn.target)==null?void 0:zn.result)},on.onerror=fn=>rn(fn),on.readAsDataURL(le)});Xe.push({name:Ce,contentType:Le,url:qe})}else if(Array.isArray(gt))for(const le of gt){const{name:Ce,url:Le,contentType:qe}=le;Xe.push({name:Ce,contentType:qe,url:Le})}else throw new Error("Invalid attachments type");const It={headers:(Ue=me.headers)!=null?Ue:($e=me.options)==null?void 0:$e.headers,body:(Ne=me.body)!=null?Ne:(ze=me.options)==null?void 0:ze.body},ln={messages:!de&&me.allowEmptySubmit?re.current:re.current.concat({id:R(),createdAt:new Date,role:"user",content:de,experimental_attachments:Xe.length>0?Xe:void 0}),options:It,headers:It.headers,body:It.body,data:me.data};ne(ln),oe("")},[de,R,ne]),ie=W=>{oe(W.target.value)},ye=({toolCallId:W,result:me})=>{const _e=re.current.map(($e,Ue,ze)=>Ue===ze.length-1&&$e.role==="assistant"&&$e.toolInvocations?{...$e,toolInvocations:$e.toolInvocations.map(Ne=>Ne.toolCallId===W?{...Ne,result:me}:Ne)}:$e);B(_e,!1);const Pe=_e[_e.length-1];EP(Pe)&&ne({messages:_e})};return{messages:z||[],error:q,append:I,reload:ce,stop:ge,setMessages:he,input:de,setInput:oe,handleInputChange:ie,handleSubmit:Z,isLoading:Y,data:j,addToolResult:ye,experimental_addToolResult:ye}}function EP(e){return e.role==="assistant"&&e.toolInvocations&&e.toolInvocations.length>0&&e.toolInvocations.every(t=>"result"in t)}function Xre(e){let t=0;for(let n=e.length-1;n>=0&&e[n].role==="assistant";n--)t++;return t}function Qre(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const sM="ScrollArea",[aM,Uhe]=Dn(sM),[Jre,po]=aM(sM),lM=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=m.useState(null),[c,u]=m.useState(null),[f,g]=m.useState(null),[p,v]=m.useState(null),[y,x]=m.useState(null),[w,_]=m.useState(0),[S,R]=m.useState(0),[E,O]=m.useState(!1),[k,T]=m.useState(!1),M=st(t,z=>l(z)),F=Ba(o);return m.createElement(Jre,{scope:n,type:r,dir:F,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:f,onContentChange:g,scrollbarX:p,onScrollbarXChange:v,scrollbarXEnabled:E,onScrollbarXEnabledChange:O,scrollbarY:y,onScrollbarYChange:x,scrollbarYEnabled:k,onScrollbarYEnabledChange:T,onCornerWidthChange:_,onCornerHeightChange:R},m.createElement(We.div,se({dir:F},s,{ref:M,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":S+"px",...e.style}})))}),Zre="ScrollAreaViewport",eoe=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=po(Zre,n),s=m.useRef(null),a=st(t,s,i.onViewportChange);return m.createElement(m.Fragment,null,m.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),m.createElement(We.div,se({"data-radix-scroll-area-viewport":""},o,{ref:a,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style}}),m.createElement("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"}},r)))}),Bi="ScrollAreaScrollbar",cM=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=po(Bi,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return m.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?m.createElement(toe,se({},r,{ref:t,forceMount:n})):o.type==="scroll"?m.createElement(noe,se({},r,{ref:t,forceMount:n})):o.type==="auto"?m.createElement(uM,se({},r,{ref:t,forceMount:n})):o.type==="always"?m.createElement(e1,se({},r,{ref:t})):null}),toe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=po(Bi,e.__scopeScrollArea),[i,s]=m.useState(!1);return m.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),m.createElement(yn,{present:n||i},m.createElement(uM,se({"data-state":i?"visible":"hidden"},r,{ref:t})))}),noe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=po(Bi,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Jg(()=>l("SCROLL_END"),100),[a,l]=Qre("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return m.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),m.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let f=c[u];const g=()=>{const p=c[u];f!==p&&(l("SCROLL"),s()),f=p};return c.addEventListener("scroll",g),()=>c.removeEventListener("scroll",g)}},[o.viewport,i,l,s]),m.createElement(yn,{present:n||a!=="hidden"},m.createElement(e1,se({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:Ee(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Ee(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),uM=m.forwardRef((e,t)=>{const n=po(Bi,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=m.useState(!1),a=e.orientation==="horizontal",l=Jg(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return gc(n.viewport,l),gc(n.content,l),m.createElement(yn,{present:r||i},m.createElement(e1,se({"data-state":i?"visible":"hidden"},o,{ref:t})))}),e1=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=po(Bi,e.__scopeScrollArea),i=m.useRef(null),s=m.useRef(0),[a,l]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=pM(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:g=>i.current=g,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:g=>s.current=g};function f(g,p){return uoe(g,s.current,a,p)}return n==="horizontal"?m.createElement(roe,se({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const g=o.viewport.scrollLeft,p=RP(g,a,o.dir);i.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollLeft=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollLeft=f(g,o.dir))}})):n==="vertical"?m.createElement(ooe,se({},u,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const g=o.viewport.scrollTop,p=RP(g,a);i.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:g=>{o.viewport&&(o.viewport.scrollTop=g)},onDragScroll:g=>{o.viewport&&(o.viewport.scrollTop=f(g))}})):null}),roe=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=po(Bi,e.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),c=st(t,l,i.onScrollbarXChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(fM,se({"data-orientation":"horizontal"},o,{ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Qg(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,f)=>{if(i.viewport){const g=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(g),mM(g,f)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Gp(s.paddingLeft),paddingEnd:Gp(s.paddingRight)}})}}))}),ooe=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=po(Bi,e.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),c=st(t,l,i.onScrollbarYChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(fM,se({"data-orientation":"vertical"},o,{ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Qg(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,f)=>{if(i.viewport){const g=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(g),mM(g,f)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Gp(s.paddingTop),paddingEnd:Gp(s.paddingBottom)}})}}))}),[ioe,dM]=aM(Bi),fM=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:f,...g}=e,p=po(Bi,n),[v,y]=m.useState(null),x=st(t,M=>y(M)),w=m.useRef(null),_=m.useRef(""),S=p.viewport,R=r.content-r.viewport,E=Cn(u),O=Cn(l),k=Jg(f,10);function T(M){if(w.current){const F=M.clientX-w.current.left,z=M.clientY-w.current.top;c({x:F,y:z})}}return m.useEffect(()=>{const M=F=>{const z=F.target;(v==null?void 0:v.contains(z))&&E(F,R)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[S,v,R,E]),m.useEffect(O,[r,O]),gc(v,k),gc(p.content,k),m.createElement(ioe,{scope:n,scrollbar:v,hasThumb:o,onThumbChange:Cn(i),onThumbPointerUp:Cn(s),onThumbPositionChange:O,onThumbPointerDown:Cn(a)},m.createElement(We.div,se({},g,{ref:x,style:{position:"absolute",...g.style},onPointerDown:Ee(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),w.current=v.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),T(M))}),onPointerMove:Ee(e.onPointerMove,T),onPointerUp:Ee(e.onPointerUp,M=>{const F=M.target;F.hasPointerCapture(M.pointerId)&&F.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=_.current,p.viewport&&(p.viewport.style.scrollBehavior=""),w.current=null})})))}),Ry="ScrollAreaThumb",soe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=dM(Ry,e.__scopeScrollArea);return m.createElement(yn,{present:n||o.hasThumb},m.createElement(aoe,se({ref:t},r)))}),aoe=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=po(Ry,n),s=dM(Ry,n),{onThumbPositionChange:a}=s,l=st(t,f=>s.onThumbChange(f)),c=m.useRef(),u=Jg(()=>{c.current&&(c.current(),c.current=void 0)},100);return m.useEffect(()=>{const f=i.viewport;if(f){const g=()=>{if(u(),!c.current){const p=doe(f,a);c.current=p,a()}};return a(),f.addEventListener("scroll",g),()=>f.removeEventListener("scroll",g)}},[i.viewport,u,a]),m.createElement(We.div,se({"data-state":s.hasThumb?"visible":"hidden"},o,{ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ee(e.onPointerDownCapture,f=>{const p=f.target.getBoundingClientRect(),v=f.clientX-p.left,y=f.clientY-p.top;s.onThumbPointerDown({x:v,y})}),onPointerUp:Ee(e.onPointerUp,s.onThumbPointerUp)}))}),hM="ScrollAreaCorner",loe=m.forwardRef((e,t)=>{const n=po(hM,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.createElement(coe,se({},e,{ref:t})):null}),coe=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=po(hM,n),[i,s]=m.useState(0),[a,l]=m.useState(0),c=!!(i&&a);return gc(o.scrollbarX,()=>{var u;const f=((u=o.scrollbarX)===null||u===void 0?void 0:u.offsetHeight)||0;o.onCornerHeightChange(f),l(f)}),gc(o.scrollbarY,()=>{var u;const f=((u=o.scrollbarY)===null||u===void 0?void 0:u.offsetWidth)||0;o.onCornerWidthChange(f),s(f)}),c?m.createElement(We.div,se({},r,{ref:t,style:{width:i,height:a,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function Gp(e){return e?parseInt(e,10):0}function pM(e,t){const n=e/t;return isNaN(n)?0:n}function Qg(e){const t=pM(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function uoe(e,t,n,r="ltr"){const o=Qg(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,f=r==="ltr"?[0,u]:[u*-1,0];return gM([l,c],f)(e)}function RP(e,t,n="ltr"){const r=Qg(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=hy(e,l);return gM([0,s],[0,a])(c)}function gM(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function mM(e,t){return e>0&&e<t}const doe=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,a=n.top!==i.top;(s||a)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Jg(e,t){const n=Cn(e),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function gc(e,t){const n=Cn(t);Gn(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const vM=lM,foe=eoe,hoe=loe,t1=fe.forwardRef(({className:e,children:t,...n},r)=>N.jsxs(vM,{ref:r,className:Oe("relative overflow-hidden",e),...n,children:[N.jsx(foe,{className:"h-full w-full rounded-[inherit]",children:t}),N.jsx(Zg,{}),N.jsx(hoe,{})]}));t1.displayName=vM.displayName;const Zg=fe.forwardRef(({className:e,orientation:t="vertical",...n},r)=>N.jsx(cM,{ref:r,orientation:t,className:Oe("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:N.jsx(soe,{className:"relative flex-1 rounded-full bg-border"})}));Zg.displayName=cM.displayName;const bM="Switch",[poe,qhe]=Dn(bM),[goe,moe]=poe(bM),voe=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,g]=m.useState(null),p=st(t,_=>g(_)),v=m.useRef(!1),y=f?!!f.closest("form"):!0,[x=!1,w]=Yn({prop:o,defaultProp:i,onChange:c});return m.createElement(goe,{scope:n,checked:x,disabled:a},m.createElement(We.button,se({type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":yM(x),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:p,onClick:Ee(e.onClick,_=>{w(S=>!S),y&&(v.current=_.isPropagationStopped(),v.current||_.stopPropagation())})})),y&&m.createElement(xoe,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),boe="SwitchThumb",yoe=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=moe(boe,n);return m.createElement(We.span,se({"data-state":yM(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),xoe=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Vg(n),a=Dg(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",se({type:"checkbox","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function yM(e){return e?"checked":"unchecked"}const em=voe,xM=yoe,wM=fe.forwardRef(({className:e,...t},n)=>N.jsx(em,{className:Oe("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:N.jsx(xM,{className:Oe("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));wM.displayName=em.displayName;const woe=fe.forwardRef(({className:e,...t},n)=>N.jsx(em,{className:Oe("peer inline-flex h-4 w-8 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:N.jsx(xM,{className:Oe("pointer-events-none block h-3 w-3 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));woe.displayName=em.displayName;function _oe(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Soe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Coe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Eoe={};function PP(e,t){return((t||Eoe).jsx?Coe:Soe).test(e)}const Roe=/[ \t\n\f\r]/g;function Poe(e){return typeof e=="object"?e.type==="text"?OP(e.value):!1:OP(e)}function OP(e){return e.replace(Roe,"")===""}class lf{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}lf.prototype.property={};lf.prototype.normal={};lf.prototype.space=null;function _M(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new lf(n,r,t)}function Py(e){return e.toLowerCase()}class go{constructor(t,n){this.property=t,this.attribute=n}}go.prototype.space=null;go.prototype.boolean=!1;go.prototype.booleanish=!1;go.prototype.overloadedBoolean=!1;go.prototype.number=!1;go.prototype.commaSeparated=!1;go.prototype.spaceSeparated=!1;go.prototype.commaOrSpaceSeparated=!1;go.prototype.mustUseProperty=!1;go.prototype.defined=!1;let Ooe=0;const ct=Xa(),vn=Xa(),SM=Xa(),Re=Xa(),Wt=Xa(),Fl=Xa(),$r=Xa();function Xa(){return 2**++Ooe}const Oy=Object.freeze(Object.defineProperty({__proto__:null,boolean:ct,booleanish:vn,commaOrSpaceSeparated:$r,commaSeparated:Fl,number:Re,overloadedBoolean:SM,spaceSeparated:Wt},Symbol.toStringTag,{value:"Module"})),Ab=Object.keys(Oy);class n1 extends go{constructor(t,n,r,o){let i=-1;if(super(t,n),$P(this,"space",o),typeof r=="number")for(;++i<Ab.length;){const s=Ab[i];$P(this,Ab[i],(r&Oy[s])===Oy[s])}}}n1.prototype.defined=!0;function $P(e,t,n){n&&(e[t]=n)}const $oe={}.hasOwnProperty;function Rc(e){const t={},n={};let r;for(r in e.properties)if($oe.call(e.properties,r)){const o=e.properties[r],i=new n1(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[Py(r)]=r,n[Py(i.attribute)]=r}return new lf(t,n,e.space)}const CM=Rc({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),EM=Rc({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function RM(e,t){return t in e?e[t]:t}function PM(e,t){return RM(e,t.toLowerCase())}const OM=Rc({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:PM,properties:{xmlns:null,xmlnsXLink:null}}),$M=Rc({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:vn,ariaAutoComplete:null,ariaBusy:vn,ariaChecked:vn,ariaColCount:Re,ariaColIndex:Re,ariaColSpan:Re,ariaControls:Wt,ariaCurrent:null,ariaDescribedBy:Wt,ariaDetails:null,ariaDisabled:vn,ariaDropEffect:Wt,ariaErrorMessage:null,ariaExpanded:vn,ariaFlowTo:Wt,ariaGrabbed:vn,ariaHasPopup:null,ariaHidden:vn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Wt,ariaLevel:Re,ariaLive:null,ariaModal:vn,ariaMultiLine:vn,ariaMultiSelectable:vn,ariaOrientation:null,ariaOwns:Wt,ariaPlaceholder:null,ariaPosInSet:Re,ariaPressed:vn,ariaReadOnly:vn,ariaRelevant:null,ariaRequired:vn,ariaRoleDescription:Wt,ariaRowCount:Re,ariaRowIndex:Re,ariaRowSpan:Re,ariaSelected:vn,ariaSetSize:Re,ariaSort:null,ariaValueMax:Re,ariaValueMin:Re,ariaValueNow:Re,ariaValueText:null,role:null}}),Doe=Rc({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:PM,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fl,acceptCharset:Wt,accessKey:Wt,action:null,allow:null,allowFullScreen:ct,allowPaymentRequest:ct,allowUserMedia:ct,alt:null,as:null,async:ct,autoCapitalize:null,autoComplete:Wt,autoFocus:ct,autoPlay:ct,blocking:Wt,capture:null,charSet:null,checked:ct,cite:null,className:Wt,cols:Re,colSpan:null,content:null,contentEditable:vn,controls:ct,controlsList:Wt,coords:Re|Fl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ct,defer:ct,dir:null,dirName:null,disabled:ct,download:SM,draggable:vn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ct,formTarget:null,headers:Wt,height:Re,hidden:ct,high:Re,href:null,hrefLang:null,htmlFor:Wt,httpEquiv:Wt,id:null,imageSizes:null,imageSrcSet:null,inert:ct,inputMode:null,integrity:null,is:null,isMap:ct,itemId:null,itemProp:Wt,itemRef:Wt,itemScope:ct,itemType:Wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ct,low:Re,manifest:null,max:null,maxLength:Re,media:null,method:null,min:null,minLength:Re,multiple:ct,muted:ct,name:null,nonce:null,noModule:ct,noValidate:ct,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:ct,optimum:Re,pattern:null,ping:Wt,placeholder:null,playsInline:ct,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ct,referrerPolicy:null,rel:Wt,required:ct,reversed:ct,rows:Re,rowSpan:Re,sandbox:Wt,scope:null,scoped:ct,seamless:ct,selected:ct,shadowRootDelegatesFocus:ct,shadowRootMode:null,shape:null,size:Re,sizes:null,slot:null,span:Re,spellCheck:vn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Re,step:null,style:null,tabIndex:Re,target:null,title:null,translate:null,type:null,typeMustMatch:ct,useMap:null,value:vn,width:Re,wrap:null,align:null,aLink:null,archive:Wt,axis:null,background:null,bgColor:null,border:Re,borderColor:null,bottomMargin:Re,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ct,declare:ct,event:null,face:null,frame:null,frameBorder:null,hSpace:Re,leftMargin:Re,link:null,longDesc:null,lowSrc:null,marginHeight:Re,marginWidth:Re,noResize:ct,noHref:ct,noShade:ct,noWrap:ct,object:null,profile:null,prompt:null,rev:null,rightMargin:Re,rules:null,scheme:null,scrolling:vn,standby:null,summary:null,text:null,topMargin:Re,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Re,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ct,disableRemotePlayback:ct,prefix:null,property:null,results:Re,security:null,unselectable:null}}),Toe=Rc({space:"svg",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"},transform:RM,properties:{about:$r,accentHeight:Re,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Re,amplitude:Re,arabicForm:null,ascent:Re,attributeName:null,attributeType:null,azimuth:Re,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Re,by:null,calcMode:null,capHeight:Re,className:Wt,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:Re,diffuseConstant:Re,direction:null,display:null,dur:null,divisor:Re,dominantBaseline:null,download:ct,dx:null,dy:null,edgeMode:null,editable:null,elevation:Re,enableBackground:null,end:null,event:null,exponent:Re,externalResourcesRequired:null,fill:null,fillOpacity:Re,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:Fl,g2:Fl,glyphName:Fl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Re,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Re,horizOriginX:Re,horizOriginY:Re,id:null,ideographic:Re,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Re,k:Re,k1:Re,k2:Re,k3:Re,k4:Re,kernelMatrix:$r,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Re,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:Re,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:Re,overlineThickness:Re,paintOrder:null,panose1:null,path:null,pathLength:Re,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Re,pointsAtY:Re,pointsAtZ:Re,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:$r,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:$r,rev:$r,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:$r,requiredFeatures:$r,requiredFonts:$r,requiredFormats:$r,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:Re,specularExponent:Re,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Re,strikethroughThickness:Re,string:null,stroke:null,strokeDashArray:$r,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Re,strokeOpacity:Re,strokeWidth:null,style:null,surfaceScale:Re,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:$r,tabIndex:Re,tableValues:null,target:null,targetX:Re,targetY:Re,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:$r,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Re,underlineThickness:Re,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Re,values:null,vAlphabetic:Re,vMathematical:Re,vectorEffect:null,vHanging:Re,vIdeographic:Re,version:null,vertAdvY:Re,vertOriginX:Re,vertOriginY:Re,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Re,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),koe=/^data[-\w.:]+$/i,DP=/-[a-z]/g,Moe=/[A-Z]/g;function Aoe(e,t){const n=Py(t);let r=t,o=go;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&koe.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(DP,Noe);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!DP.test(i)){let s=i.replace(Moe,Ioe);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=n1}return new o(r,t)}function Ioe(e){return"-"+e.toLowerCase()}function Noe(e){return e.charAt(1).toUpperCase()}const Loe={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"},Foe=_M([EM,CM,OM,$M,Doe],"html"),r1=_M([EM,CM,OM,$M,Toe],"svg");function zoe(e){return e.join(" ").trim()}var DM={},TP=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,joe=/\n/g,Boe=/^\s*/,Voe=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Hoe=/^:\s*/,Woe=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Uoe=/^[;\s]*/,qoe=/^\s+|\s+$/g,Goe=`
362
+ `,kP="/",MP="*",da="",Yoe="comment",Koe="declaration",Xoe=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(v){var y=v.match(joe);y&&(n+=y.length);var x=v.lastIndexOf(Goe);r=~x?v.length-x:r+v.length}function i(){var v={line:n,column:r};return function(y){return y.position=new s(v),c(),y}}function s(v){this.start=v,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(v){var y=new Error(t.source+":"+n+":"+r+": "+v);if(y.reason=v,y.filename=t.source,y.line=n,y.column=r,y.source=e,!t.silent)throw y}function l(v){var y=v.exec(e);if(y){var x=y[0];return o(x),e=e.slice(x.length),y}}function c(){l(Boe)}function u(v){var y;for(v=v||[];y=f();)y!==!1&&v.push(y);return v}function f(){var v=i();if(!(kP!=e.charAt(0)||MP!=e.charAt(1))){for(var y=2;da!=e.charAt(y)&&(MP!=e.charAt(y)||kP!=e.charAt(y+1));)++y;if(y+=2,da===e.charAt(y-1))return a("End of comment missing");var x=e.slice(2,y-2);return r+=2,o(x),e=e.slice(y),r+=2,v({type:Yoe,comment:x})}}function g(){var v=i(),y=l(Voe);if(y){if(f(),!l(Hoe))return a("property missing ':'");var x=l(Woe),w=v({type:Koe,property:AP(y[0].replace(TP,da)),value:x?AP(x[0].replace(TP,da)):da});return l(Uoe),w}}function p(){var v=[];u(v);for(var y;y=g();)y!==!1&&(v.push(y),u(v));return v}return c(),p()};function AP(e){return e?e.replace(qoe,da):da}var Qoe=as&&as.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(DM,"__esModule",{value:!0});var Joe=Qoe(Xoe);function Zoe(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,Joe.default)(e),o=typeof t=="function";return r.forEach(function(i){if(i.type==="declaration"){var s=i.property,a=i.value;o?t(s,a,i):a&&(n=n||{},n[s]=a)}}),n}var IP=DM.default=Zoe;const eie=IP.default||IP,TM=kM("end"),o1=kM("start");function kM(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 tie(e){const t=o1(e),n=TM(e);if(t&&n)return{start:t,end:n}}function Iu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?NP(e.position):"start"in e||"end"in e?NP(e):"line"in e||"column"in e?$y(e):""}function $y(e){return LP(e&&e.line)+":"+LP(e&&e.column)}function NP(e){return $y(e&&e.start)+"-"+$y(e&&e.end)}function LP(e){return e&&typeof e=="number"?e:1}class Kn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(s=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=o,this.line=a?a.line:void 0,this.name=Iu(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}Kn.prototype.file="";Kn.prototype.name="";Kn.prototype.reason="";Kn.prototype.message="";Kn.prototype.stack="";Kn.prototype.column=void 0;Kn.prototype.line=void 0;Kn.prototype.ancestors=void 0;Kn.prototype.cause=void 0;Kn.prototype.fatal=void 0;Kn.prototype.place=void 0;Kn.prototype.ruleId=void 0;Kn.prototype.source=void 0;const i1={}.hasOwnProperty,nie=new Map,rie=/[A-Z]/g,oie=/-([a-z])/g,iie=new Set(["table","tbody","thead","tfoot","tr"]),sie=new Set(["td","th"]),MM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function aie(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=gie(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=pie(n,t.jsx,t.jsxs)}const o={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"?r1:Foe,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=AM(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function AM(e,t,n){if(t.type==="element")return lie(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return cie(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return die(e,t,n);if(t.type==="mdxjsEsm")return uie(e,t);if(t.type==="root")return fie(e,t,n);if(t.type==="text")return hie(e,t)}function lie(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=r1,e.schema=o),e.ancestors.push(t);const i=NM(e,t.tagName,!1),s=mie(e,t);let a=a1(e,t);return iie.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!Poe(l):!0})),IM(e,s,i,t),s1(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function cie(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)}bd(e,t.position)}function uie(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bd(e,t.position)}function die(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=r1,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:NM(e,t.name,!0),s=vie(e,t),a=a1(e,t);return IM(e,s,i,t),s1(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function fie(e,t,n){const r={};return s1(r,a1(e,t)),e.create(t,e.Fragment,r,n)}function hie(e,t){return t.value}function IM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function s1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function pie(e,t,n){return r;function r(o,i,s,a){const c=Array.isArray(s.children)?n:t;return a?c(i,s,a):c(i,s)}}function gie(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=o1(r);return t(o,i,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function mie(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&i1.call(t.properties,o)){const i=bie(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&sie.has(t.tagName)?r=a:n[s]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function vie(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const s=i.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else bd(e,t.position);else{const o=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else bd(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function a1(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:nie;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=o.get(l)||0;s=l+"-"+c,o.set(l,c+1)}}const a=AM(e,i,s);a!==void 0&&n.push(a)}return n}function bie(e,t,n){const r=Aoe(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?_oe(n):zoe(n)),r.property==="style"){let o=typeof n=="object"?n:yie(e,String(n));return e.stylePropertyNameCase==="css"&&(o=xie(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?Loe[r.property]||r.property:r.attribute,n]}}function yie(e,t){const n={};try{eie(t,r)}catch(o){if(!e.ignoreInvalidStyle){const i=o,s=new Kn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=MM+"#cannot-parse-style-attribute",s}}return n;function r(o,i){let s=o;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(oie,_ie)),n[s]=i}}function NM(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,s;for(;++i<o.length;){const a=PP(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=s}else r=PP(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return i1.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);bd(e)}function bd(e,t){const n=new Kn("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=MM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function xie(e){const t={};let n;for(n in e)i1.call(e,n)&&(t[wie(n)]=e[n]);return t}function wie(e){let t=e.replace(rie,Sie);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function _ie(e,t){return t.toUpperCase()}function Sie(e){return"-"+e.toLowerCase()}const Ib={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"]},Cie={};function Eie(e,t){const n=t||Cie,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return LM(e,r,o)}function LM(e,t,n){if(Rie(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 FP(e.children,t,n)}return Array.isArray(e)?FP(e,t,n):""}function FP(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=LM(e[o],t,n);return r.join("")}function Rie(e){return!!(e&&typeof e=="object")}const zP=document.createElement("i");function l1(e){const t="&"+e+";";zP.innerHTML=t;const n=zP.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ei(e,t,n,r){const o=e.length;let i=0,s;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function lo(e,t){return e.length>0?(ei(e,e.length,0,t),e):t}const jP={}.hasOwnProperty;function Pie(e){const t={};let n=-1;for(;++n<e.length;)Oie(t,e[n]);return t}function Oie(e,t){let n;for(n in t){const o=(jP.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){jP.call(o,s)||(o[s]=[]);const a=i[s];$ie(o[s],Array.isArray(a)?a:a?[a]:[])}}}function $ie(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ei(e,0,0,r)}function FM(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 zl(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Die=Ms(new RegExp("\\p{P}","u")),qo=Ms(/[A-Za-z]/),zr=Ms(/[\dA-Za-z]/),Tie=Ms(/[#-'*+\--9=?A-Z^-~]/);function Dy(e){return e!==null&&(e<32||e===127)}const Ty=Ms(/\d/),kie=Ms(/[\dA-Fa-f]/),zM=Ms(/[!-/:-@[-`{-~]/);function Je(e){return e!==null&&e<-2}function yr(e){return e!==null&&(e<0||e===32)}function Dt(e){return e===-2||e===-1||e===32}function Mie(e){return zM(e)||Die(e)}const Aie=Ms(/\s/);function Ms(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Pc(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&zr(e.charCodeAt(n+1))&&zr(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),o=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function Ut(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Dt(l)?(e.enter(n),a(l)):t(l)}function a(l){return Dt(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const Iie={tokenize:Nie};function Nie(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ut(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return Je(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const Lie={tokenize:Fie},BP={tokenize:zie};function Fie(e){const t=this,n=[];let r=0,o,i,s;return a;function a(S){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,l,c)(S)}return c(S)}function l(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&_();const R=t.events.length;let E=R,O;for(;E--;)if(t.events[E][0]==="exit"&&t.events[E][1].type==="chunkFlow"){O=t.events[E][1].end;break}w(r);let k=R;for(;k<t.events.length;)t.events[k][1].end=Object.assign({},O),k++;return ei(t.events,E+1,0,t.events.slice(R)),t.events.length=k,c(S)}return a(S)}function c(S){if(r===n.length){if(!o)return g(S);if(o.currentConstruct&&o.currentConstruct.concrete)return v(S);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(BP,u,f)(S)}function u(S){return o&&_(),w(r),g(S)}function f(S){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,v(S)}function g(S){return t.containerState={},e.attempt(BP,p,v)(S)}function p(S){return r++,n.push([t.currentConstruct,t.containerState]),g(S)}function v(S){if(S===null){o&&_(),w(0),e.consume(S);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:o}),y(S)}function y(S){if(S===null){x(e.exit("chunkFlow"),!0),w(0),e.consume(S);return}return Je(S)?(e.consume(S),x(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(S),y)}function x(S,R){const E=t.sliceStream(S);if(R&&E.push(null),S.previous=i,i&&(i.next=S),i=S,o.defineSkip(S.start),o.write(E),t.parser.lazy[S.start.line]){let O=o.events.length;for(;O--;)if(o.events[O][1].start.offset<s&&(!o.events[O][1].end||o.events[O][1].end.offset>s))return;const k=t.events.length;let T=k,M,F;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(M){F=t.events[T][1].end;break}M=!0}for(w(r),O=k;O<t.events.length;)t.events[O][1].end=Object.assign({},F),O++;ei(t.events,T+1,0,t.events.slice(k)),t.events.length=O}}function w(S){let R=n.length;for(;R-- >S;){const E=n[R];t.containerState=E[1],E[0].exit.call(t,e)}n.length=S}function _(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function zie(e,t,n){return Ut(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function VP(e){if(e===null||yr(e)||Aie(e))return 1;if(Mie(e))return 2}function c1(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const ky={name:"attention",tokenize:Bie,resolveAll:jie};function jie(e,t){let n=-1,r,o,i,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f=Object.assign({},e[r][1].end),g=Object.assign({},e[n][1].start);HP(f,-l),HP(g,l),s={type:l>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},e[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:g},i={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=lo(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=lo(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=lo(c,c1(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=lo(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=lo(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,ei(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function Bie(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=VP(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=VP(l),f=!u||u===2&&o||n.includes(l),g=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?f:f&&(o||!g)),c._close=!!(i===42?g:g&&(u||!f)),t(l)}}function HP(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Vie={name:"autolink",tokenize:Hie};function Hie(e,t,n){let r=0;return o;function o(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return qo(p)?(e.consume(p),s):c(p)}function s(p){return p===43||p===45||p===46||zr(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||zr(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Dy(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):Tie(p)?(e.consume(p),c):n(p)}function u(p){return zr(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):g(p)}function g(p){if((p===45||zr(p))&&r++<63){const v=p===45?g:f;return e.consume(p),v}return n(p)}}const tm={tokenize:Wie,partial:!0};function Wie(e,t,n){return r;function r(i){return Dt(i)?Ut(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||Je(i)?t(i):n(i)}}const jM={name:"blockQuote",tokenize:Uie,continuation:{tokenize:qie},exit:Gie};function Uie(e,t,n){const r=this;return o;function o(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return Dt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function qie(e,t,n){const r=this;return o;function o(s){return Dt(s)?Ut(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(jM,t,n)(s)}}function Gie(e){e.exit("blockQuote")}const BM={name:"characterEscape",tokenize:Yie};function Yie(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return zM(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const VM={name:"characterReference",tokenize:Kie};function Kie(e,t,n){const r=this;let o=0,i,s;return a;function a(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),l}function l(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,s=zr,u(f))}function c(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=kie,u):(e.enter("characterReferenceValue"),i=7,s=Ty,u(f))}function u(f){if(f===59&&o){const g=e.exit("characterReferenceValue");return s===zr&&!l1(r.sliceSerialize(g))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&o++<i?(e.consume(f),u):n(f)}}const WP={tokenize:Qie,partial:!0},UP={name:"codeFenced",tokenize:Xie,concrete:!0};function Xie(e,t,n){const r=this,o={tokenize:E,partial:!0};let i=0,s=0,a;return l;function l(O){return c(O)}function c(O){const k=r.events[r.events.length-1];return i=k&&k[1].type==="linePrefix"?k[2].sliceSerialize(k[1],!0).length:0,a=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(O)}function u(O){return O===a?(s++,e.consume(O),u):s<3?n(O):(e.exit("codeFencedFenceSequence"),Dt(O)?Ut(e,f,"whitespace")(O):f(O))}function f(O){return O===null||Je(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(WP,y,R)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),g(O))}function g(O){return O===null||Je(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(O)):Dt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ut(e,p,"whitespace")(O)):O===96&&O===a?n(O):(e.consume(O),g)}function p(O){return O===null||Je(O)?f(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(O))}function v(O){return O===null||Je(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(O)):O===96&&O===a?n(O):(e.consume(O),v)}function y(O){return e.attempt(o,R,x)(O)}function x(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),w}function w(O){return i>0&&Dt(O)?Ut(e,_,"linePrefix",i+1)(O):_(O)}function _(O){return O===null||Je(O)?e.check(WP,y,R)(O):(e.enter("codeFlowValue"),S(O))}function S(O){return O===null||Je(O)?(e.exit("codeFlowValue"),_(O)):(e.consume(O),S)}function R(O){return e.exit("codeFenced"),t(O)}function E(O,k,T){let M=0;return F;function F(j){return O.enter("lineEnding"),O.consume(j),O.exit("lineEnding"),z}function z(j){return O.enter("codeFencedFence"),Dt(j)?Ut(O,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):B(j)}function B(j){return j===a?(O.enter("codeFencedFenceSequence"),Y(j)):T(j)}function Y(j){return j===a?(M++,O.consume(j),Y):M>=s?(O.exit("codeFencedFenceSequence"),Dt(j)?Ut(O,G,"whitespace")(j):G(j)):T(j)}function G(j){return j===null||Je(j)?(O.exit("codeFencedFence"),k(j)):T(j)}}}function Qie(e,t,n){const r=this;return o;function o(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Nb={name:"codeIndented",tokenize:Zie},Jie={tokenize:ese,partial:!0};function Zie(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),Ut(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):Je(c)?e.attempt(Jie,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||Je(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function ese(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):Je(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):Ut(e,i,"linePrefix",5)(s)}function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):Je(s)?o(s):n(s)}}const tse={name:"codeText",tokenize:ose,resolve:nse,previous:rse};function nse(e){let t=e.length-4,n=3,r,o;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;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function rse(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function ose(e,t,n){let r=0,o,i;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),a(f)}function a(f){return f===96?(e.consume(f),r++,a):(e.exit("codeTextSequence"),l(f))}function l(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),l):f===96?(i=e.enter("codeTextSequence"),o=0,u(f)):Je(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(f))}function c(f){return f===null||f===32||f===96||Je(f)?(e.exit("codeTextData"),l(f)):(e.consume(f),c)}function u(f){return f===96?(e.consume(f),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(i.type="codeTextData",c(f))}}function HM(e){const t={};let n=-1,r,o,i,s,a,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,ise(e,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--&&(s=e[i],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(o&&(e[o][1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);o&&(r[1].end=Object.assign({},e[o][1].start),a=e.slice(o,n),a.unshift(r),ei(e,o,n-o+1,a))}}return!c}function ise(e,t){const n=e[t][1],r=e[t][2];let o=t-1;const i=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let u,f,g=-1,p=n,v=0,y=0;const x=[y];for(;p;){for(;e[++o][1]!==p;);i.push(o),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++g<a.length;)a[g][0]==="exit"&&a[g-1][0]==="enter"&&a[g][1].type===a[g-1][1].type&&a[g][1].start.line!==a[g][1].end.line&&(y=g+1,x.push(y),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):x.pop(),g=x.length;g--;){const w=a.slice(x[g],x[g+1]),_=i.pop();l.unshift([_,_+w.length-1]),ei(e,_,2,w)}for(g=-1;++g<l.length;)c[v+l[g][0]]=v+l[g][1],v+=l[g][1]-l[g][0]-1;return c}const sse={tokenize:cse,resolve:lse},ase={tokenize:use,partial:!0};function lse(e){return HM(e),e}function cse(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):Je(a)?e.check(ase,s,i)(a):(e.consume(a),o)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function use(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ut(e,i,"linePrefix")}function i(s){if(s===null||Je(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function WM(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return f;function f(w){return w===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(w),e.exit(i),g):w===null||w===32||w===41||Dy(w)?n(w):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),y(w))}function g(w){return w===62?(e.enter(i),e.consume(w),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(e.exit("chunkString"),e.exit(a),g(w)):w===null||w===60||Je(w)?n(w):(e.consume(w),w===92?v:p)}function v(w){return w===60||w===62||w===92?(e.consume(w),p):p(w)}function y(w){return!u&&(w===null||w===41||yr(w))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(w)):u<c&&w===40?(e.consume(w),u++,y):w===41?(e.consume(w),u--,y):w===null||w===32||w===40||Dy(w)?n(w):(e.consume(w),w===92?x:y)}function x(w){return w===40||w===41||w===92?(e.consume(w),y):y(w)}}function UM(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(o),e.consume(p),e.exit(o),e.enter(i),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(i),e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):Je(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||Je(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!Dt(p)),p===92?g:f)}function g(p){return p===91||p===92||p===93?(e.consume(p),a++,f):f(p)}}function qM(e,t,n,r,o,i){let s;return a;function a(g){return g===34||g===39||g===40?(e.enter(r),e.enter(o),e.consume(g),e.exit(o),s=g===40?41:g,l):n(g)}function l(g){return g===s?(e.enter(o),e.consume(g),e.exit(o),e.exit(r),t):(e.enter(i),c(g))}function c(g){return g===s?(e.exit(i),l(s)):g===null?n(g):Je(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),Ut(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(g))}function u(g){return g===s||g===null||Je(g)?(e.exit("chunkString"),c(g)):(e.consume(g),g===92?f:u)}function f(g){return g===s||g===92?(e.consume(g),u):u(g)}}function Nu(e,t){let n;return r;function r(o){return Je(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Dt(o)?Ut(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const dse={name:"definition",tokenize:hse},fse={tokenize:pse,partial:!0};function hse(e,t,n){const r=this;let o;return i;function i(p){return e.enter("definition"),s(p)}function s(p){return UM.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return o=zl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return yr(p)?Nu(e,c)(p):c(p)}function c(p){return WM(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(fse,f,f)(p)}function f(p){return Dt(p)?Ut(e,g,"whitespace")(p):g(p)}function g(p){return p===null||Je(p)?(e.exit("definition"),r.parser.defined.push(o),t(p)):n(p)}}function pse(e,t,n){return r;function r(a){return yr(a)?Nu(e,o)(a):n(a)}function o(a){return qM(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Dt(a)?Ut(e,s,"whitespace")(a):s(a)}function s(a){return a===null||Je(a)?t(a):n(a)}}const gse={name:"hardBreakEscape",tokenize:mse};function mse(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return Je(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const vse={name:"headingAtx",tokenize:yse,resolve:bse};function bse(e,t){let n=e.length-2,r=3,o,i;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&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ei(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function yse(e,t,n){let r=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||yr(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||Je(u)?(e.exit("atxHeading"),t(u)):Dt(u)?Ut(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||yr(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const xse=["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"],qP=["pre","script","style","textarea"],wse={name:"htmlFlow",tokenize:Ese,resolveTo:Cse,concrete:!0},_se={tokenize:Pse,partial:!0},Sse={tokenize:Rse,partial:!0};function Cse(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 Ese(e,t,n){const r=this;let o,i,s,a,l;return c;function c(I){return u(I)}function u(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),f}function f(I){return I===33?(e.consume(I),g):I===47?(e.consume(I),i=!0,y):I===63?(e.consume(I),o=3,r.interrupt?t:$):qo(I)?(e.consume(I),s=String.fromCharCode(I),x):n(I)}function g(I){return I===45?(e.consume(I),o=2,p):I===91?(e.consume(I),o=5,a=0,v):qo(I)?(e.consume(I),o=4,r.interrupt?t:$):n(I)}function p(I){return I===45?(e.consume(I),r.interrupt?t:$):n(I)}function v(I){const ce="CDATA[";return I===ce.charCodeAt(a++)?(e.consume(I),a===ce.length?r.interrupt?t:B:v):n(I)}function y(I){return qo(I)?(e.consume(I),s=String.fromCharCode(I),x):n(I)}function x(I){if(I===null||I===47||I===62||yr(I)){const ce=I===47,ge=s.toLowerCase();return!ce&&!i&&qP.includes(ge)?(o=1,r.interrupt?t(I):B(I)):xse.includes(s.toLowerCase())?(o=6,ce?(e.consume(I),w):r.interrupt?t(I):B(I)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):i?_(I):S(I))}return I===45||zr(I)?(e.consume(I),s+=String.fromCharCode(I),x):n(I)}function w(I){return I===62?(e.consume(I),r.interrupt?t:B):n(I)}function _(I){return Dt(I)?(e.consume(I),_):F(I)}function S(I){return I===47?(e.consume(I),F):I===58||I===95||qo(I)?(e.consume(I),R):Dt(I)?(e.consume(I),S):F(I)}function R(I){return I===45||I===46||I===58||I===95||zr(I)?(e.consume(I),R):E(I)}function E(I){return I===61?(e.consume(I),O):Dt(I)?(e.consume(I),E):S(I)}function O(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),l=I,k):Dt(I)?(e.consume(I),O):T(I)}function k(I){return I===l?(e.consume(I),l=null,M):I===null||Je(I)?n(I):(e.consume(I),k)}function T(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||yr(I)?E(I):(e.consume(I),T)}function M(I){return I===47||I===62||Dt(I)?S(I):n(I)}function F(I){return I===62?(e.consume(I),z):n(I)}function z(I){return I===null||Je(I)?B(I):Dt(I)?(e.consume(I),z):n(I)}function B(I){return I===45&&o===2?(e.consume(I),ee):I===60&&o===1?(e.consume(I),q):I===62&&o===4?(e.consume(I),H):I===63&&o===3?(e.consume(I),$):I===93&&o===5?(e.consume(I),re):Je(I)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(_se,ne,Y)(I)):I===null||Je(I)?(e.exit("htmlFlowData"),Y(I)):(e.consume(I),B)}function Y(I){return e.check(Sse,G,ne)(I)}function G(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),j}function j(I){return I===null||Je(I)?Y(I):(e.enter("htmlFlowData"),B(I))}function ee(I){return I===45?(e.consume(I),$):B(I)}function q(I){return I===47?(e.consume(I),s="",X):B(I)}function X(I){if(I===62){const ce=s.toLowerCase();return qP.includes(ce)?(e.consume(I),H):B(I)}return qo(I)&&s.length<8?(e.consume(I),s+=String.fromCharCode(I),X):B(I)}function re(I){return I===93?(e.consume(I),$):B(I)}function $(I){return I===62?(e.consume(I),H):I===45&&o===2?(e.consume(I),$):B(I)}function H(I){return I===null||Je(I)?(e.exit("htmlFlowData"),ne(I)):(e.consume(I),H)}function ne(I){return e.exit("htmlFlow"),t(I)}}function Rse(e,t,n){const r=this;return o;function o(s){return Je(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function Pse(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(tm,t,n)}}const Ose={name:"htmlText",tokenize:$se};function $se(e,t,n){const r=this;let o,i,s;return a;function a($){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume($),l}function l($){return $===33?(e.consume($),c):$===47?(e.consume($),E):$===63?(e.consume($),S):qo($)?(e.consume($),T):n($)}function c($){return $===45?(e.consume($),u):$===91?(e.consume($),i=0,v):qo($)?(e.consume($),_):n($)}function u($){return $===45?(e.consume($),p):n($)}function f($){return $===null?n($):$===45?(e.consume($),g):Je($)?(s=f,q($)):(e.consume($),f)}function g($){return $===45?(e.consume($),p):f($)}function p($){return $===62?ee($):$===45?g($):f($)}function v($){const H="CDATA[";return $===H.charCodeAt(i++)?(e.consume($),i===H.length?y:v):n($)}function y($){return $===null?n($):$===93?(e.consume($),x):Je($)?(s=y,q($)):(e.consume($),y)}function x($){return $===93?(e.consume($),w):y($)}function w($){return $===62?ee($):$===93?(e.consume($),w):y($)}function _($){return $===null||$===62?ee($):Je($)?(s=_,q($)):(e.consume($),_)}function S($){return $===null?n($):$===63?(e.consume($),R):Je($)?(s=S,q($)):(e.consume($),S)}function R($){return $===62?ee($):S($)}function E($){return qo($)?(e.consume($),O):n($)}function O($){return $===45||zr($)?(e.consume($),O):k($)}function k($){return Je($)?(s=k,q($)):Dt($)?(e.consume($),k):ee($)}function T($){return $===45||zr($)?(e.consume($),T):$===47||$===62||yr($)?M($):n($)}function M($){return $===47?(e.consume($),ee):$===58||$===95||qo($)?(e.consume($),F):Je($)?(s=M,q($)):Dt($)?(e.consume($),M):ee($)}function F($){return $===45||$===46||$===58||$===95||zr($)?(e.consume($),F):z($)}function z($){return $===61?(e.consume($),B):Je($)?(s=z,q($)):Dt($)?(e.consume($),z):M($)}function B($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(e.consume($),o=$,Y):Je($)?(s=B,q($)):Dt($)?(e.consume($),B):(e.consume($),G)}function Y($){return $===o?(e.consume($),o=void 0,j):$===null?n($):Je($)?(s=Y,q($)):(e.consume($),Y)}function G($){return $===null||$===34||$===39||$===60||$===61||$===96?n($):$===47||$===62||yr($)?M($):(e.consume($),G)}function j($){return $===47||$===62||yr($)?M($):n($)}function ee($){return $===62?(e.consume($),e.exit("htmlTextData"),e.exit("htmlText"),t):n($)}function q($){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),X}function X($){return Dt($)?Ut(e,re,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):re($)}function re($){return e.enter("htmlTextData"),s($)}}const u1={name:"labelEnd",tokenize:Ise,resolveTo:Ase,resolveAll:Mse},Dse={tokenize:Nse},Tse={tokenize:Lse},kse={tokenize:Fse};function Mse(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function Ase(e,t){let n=e.length,r=0,o,i,s,a;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[i][1].start),end:Object.assign({},e[s][1].end)},u={type:"labelText",start:Object.assign({},e[i+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return a=[["enter",l,t],["enter",c,t]],a=lo(a,e.slice(i+1,i+r+3)),a=lo(a,[["enter",u,t]]),a=lo(a,c1(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=lo(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=lo(a,e.slice(s+1)),a=lo(a,[["exit",l,t]]),ei(e,i,e.length,a),e}function Ise(e,t,n){const r=this;let o=r.events.length,i,s;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return a;function a(g){return i?i._inactive?f(g):(s=r.parser.defined.includes(zl(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(g),e.exit("labelMarker"),e.exit("labelEnd"),l):n(g)}function l(g){return g===40?e.attempt(Dse,u,s?u:f)(g):g===91?e.attempt(Tse,u,s?c:f)(g):s?u(g):f(g)}function c(g){return e.attempt(kse,u,f)(g)}function u(g){return t(g)}function f(g){return i._balanced=!0,n(g)}}function Nse(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),o}function o(f){return yr(f)?Nu(e,i)(f):i(f)}function i(f){return f===41?u(f):WM(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return yr(f)?Nu(e,l)(f):u(f)}function a(f){return n(f)}function l(f){return f===34||f===39||f===40?qM(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):u(f)}function c(f){return yr(f)?Nu(e,u)(f):u(f)}function u(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function Lse(e,t,n){const r=this;return o;function o(a){return UM.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(zl(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function Fse(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const zse={name:"labelStartImage",tokenize:jse,resolveAll:u1.resolveAll};function jse(e,t,n){const r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Bse={name:"labelStartLink",tokenize:Vse,resolveAll:u1.resolveAll};function Vse(e,t,n){const r=this;return o;function o(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Lb={name:"lineEnding",tokenize:Hse};function Hse(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ut(e,t,"linePrefix")}}const dp={name:"thematicBreak",tokenize:Wse};function Wse(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return o=c,a(c)}function a(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||Je(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Dt(c)?Ut(e,a,"whitespace")(c):a(c))}}const ur={name:"list",tokenize:Gse,continuation:{tokenize:Yse},exit:Xse},Use={tokenize:Qse,partial:!0},qse={tokenize:Kse,partial:!0};function Gse(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,s=0;return a;function a(p){const v=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Ty(p)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(dp,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return Ty(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(tm,r.interrupt?n:u,e.attempt(Use,g,f))}function u(p){return r.containerState.initialBlankLine=!0,i++,g(p)}function f(p){return Dt(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),g):n(p)}function g(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Yse(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(tm,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ut(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!Dt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(qse,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ut(e,e.attempt(ur,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Kse(e,t,n){const r=this;return Ut(e,o,"listItemIndent",r.containerState.size+1);function o(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function Xse(e){e.exit(this.containerState.type)}function Qse(e,t,n){const r=this;return Ut(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const s=r.events[r.events.length-1];return!Dt(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const GP={name:"setextUnderline",tokenize:Zse,resolveTo:Jse};function Jse(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[i][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function Zse(e,t,n){const r=this;let o;return i;function i(c){let u=r.events.length,f;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){f=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),o=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===o?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Dt(c)?Ut(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||Je(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const eae={tokenize:tae};function tae(e){const t=this,n=e.attempt(tm,r,e.attempt(this.parser.constructs.flowInitial,o,Ut(e,e.attempt(this.parser.constructs.flow,o,e.attempt(sse,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const nae={resolveAll:YM()},rae=GM("string"),oae=GM("text");function GM(e){return{tokenize:t,resolveAll:YM(e==="text"?iae:void 0)};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,s,a);return s;function s(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const f=o[u];let g=-1;if(f)for(;++g<f.length;){const p=f[g];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function YM(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function iae(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],o=t.sliceStream(r);let i=o.length,s=-1,a=0,l;for(;i--;){const c=o[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+i,_bufferIndex:i?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function sae(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const o={},i=[];let s=[],a=[];const l={consume:_,enter:S,exit:R,attempt:k(E),check:k(O),interrupt:k(O,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:g,now:v,defineSkip:y,write:f};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function f(z){return s=lo(s,z),x(),s[s.length-1]!==null?[]:(T(t,0),c.events=c1(i,c.events,c),c.events)}function g(z,B){return lae(p(z),B)}function p(z){return aae(s,z)}function v(){const{line:z,column:B,offset:Y,_index:G,_bufferIndex:j}=r;return{line:z,column:B,offset:Y,_index:G,_bufferIndex:j}}function y(z){o[z.line]=z.column,F()}function x(){let z;for(;r._index<s.length;){const B=s[r._index];if(typeof B=="string")for(z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===z&&r._bufferIndex<B.length;)w(B.charCodeAt(r._bufferIndex));else w(B)}}function w(z){u=u(z)}function _(z){Je(z)?(r.line++,r.column=1,r.offset+=z===-3?2:1,F()):z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=z}function S(z,B){const Y=B||{};return Y.type=z,Y.start=v(),c.events.push(["enter",Y,c]),a.push(Y),Y}function R(z){const B=a.pop();return B.end=v(),c.events.push(["exit",B,c]),B}function E(z,B){T(z,B.from)}function O(z,B){B.restore()}function k(z,B){return Y;function Y(G,j,ee){let q,X,re,$;return Array.isArray(G)?ne(G):"tokenize"in G?ne([G]):H(G);function H(he){return de;function de(oe){const Z=oe!==null&&he[oe],ie=oe!==null&&he.null,ye=[...Array.isArray(Z)?Z:Z?[Z]:[],...Array.isArray(ie)?ie:ie?[ie]:[]];return ne(ye)(oe)}}function ne(he){return q=he,X=0,he.length===0?ee:I(he[X])}function I(he){return de;function de(oe){return $=M(),re=he,he.partial||(c.currentConstruct=he),he.name&&c.parser.constructs.disable.null.includes(he.name)?ge():he.tokenize.call(B?Object.assign(Object.create(c),B):c,l,ce,ge)(oe)}}function ce(he){return z(re,$),j}function ge(he){return $.restore(),++X<q.length?I(q[X]):ee}}}function T(z,B){z.resolveAll&&!i.includes(z)&&i.push(z),z.resolve&&ei(c.events,B,c.events.length-B,z.resolve(c.events.slice(B),c)),z.resolveTo&&(c.events=z.resolveTo(c.events,c))}function M(){const z=v(),B=c.previous,Y=c.currentConstruct,G=c.events.length,j=Array.from(a);return{restore:ee,from:G};function ee(){r=z,c.previous=B,c.currentConstruct=Y,c.events.length=G,a=j,F()}}function F(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function aae(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let s;if(n===o)s=[e[n].slice(r,i)];else{if(s=e.slice(n,o),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}i>0&&s.push(e[o].slice(0,i))}return s}function lae(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
363
+ `;break}case-3:{s=`\r
364
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&o)continue;s=" ";break}default:s=String.fromCharCode(i)}o=i===-2,r.push(s)}return r.join("")}const cae={42:ur,43:ur,45:ur,48:ur,49:ur,50:ur,51:ur,52:ur,53:ur,54:ur,55:ur,56:ur,57:ur,62:jM},uae={91:dse},dae={[-2]:Nb,[-1]:Nb,32:Nb},fae={35:vse,42:dp,45:[GP,dp],60:wse,61:GP,95:dp,96:UP,126:UP},hae={38:VM,92:BM},pae={[-5]:Lb,[-4]:Lb,[-3]:Lb,33:zse,38:VM,42:ky,60:[Vie,Ose],91:Bse,92:[gse,BM],93:u1,95:ky,96:tse},gae={null:[ky,nae]},mae={null:[42,95]},vae={null:[]},bae=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:mae,contentInitial:uae,disable:vae,document:cae,flow:fae,flowInitial:dae,insideSpan:gae,string:hae,text:pae},Symbol.toStringTag,{value:"Module"}));function yae(e){const n=Pie([bae,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:o(Iie),document:o(Lie),flow:o(eae),string:o(rae),text:o(oae)};return r;function o(i){return s;function s(a){return sae(r,i,a)}}}function xae(e){for(;!HM(e););return e}const YP=/[\0\t\n\r]/g;function wae(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let c,u,f,g,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),f=0,t="",n&&(i.charCodeAt(0)===65279&&f++,n=void 0);f<i.length;){if(YP.lastIndex=f,c=YP.exec(i),g=c&&c.index!==void 0?c.index:i.length,p=i.charCodeAt(g),!c){t=i.slice(f);break}if(p===10&&f===g&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),f<g&&(l.push(i.slice(f,g)),e+=g-f),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}f=g+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const _ae=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Sae(e){return e.replace(_ae,Cae)}function Cae(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return FM(n.slice(i?2:1),i?16:10)}return l1(n)||e}const KM={}.hasOwnProperty;function Eae(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Rae(n)(xae(yae(n).document().write(wae()(e,t,!0))))}function Rae(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(ze),autolinkProtocol:M,autolinkEmail:M,atxHeading:i(_e),blockQuote:i(Z),characterEscape:M,characterReference:M,codeFenced:i(ie),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(ie,s),codeText:i(ye,s),codeTextData:M,data:M,codeFlowValue:M,definition:i(W),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(me),hardBreakEscape:i(Pe),hardBreakTrailing:i(Pe),htmlFlow:i($e,s),htmlFlowData:M,htmlText:i($e,s),htmlTextData:M,image:i(Ue),label:s,link:i(ze),listItem:i(Xe),listItemValue:g,listOrdered:i(Ne,f),listUnordered:i(Ne),paragraph:i(gt),reference:I,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(_e),strong:i(It),thematicBreak:i(ln)},exit:{atxHeading:l(),atxHeadingSequence:E,autolink:l(),autolinkEmail:oe,autolinkProtocol:de,blockQuote:l(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:ge,characterReferenceMarkerNumeric:ge,characterReferenceValue:he,codeFenced:l(x),codeFencedFence:y,codeFencedFenceInfo:p,codeFencedFenceMeta:v,codeFlowValue:F,codeIndented:l(w),codeText:l(j),codeTextData:F,data:F,definition:l(),definitionDestinationString:R,definitionLabelString:_,definitionTitleString:S,emphasis:l(),hardBreakEscape:l(B),hardBreakTrailing:l(B),htmlFlow:l(Y),htmlFlowData:F,htmlText:l(G),htmlTextData:F,image:l(q),label:re,labelText:X,lineEnding:z,link:l(ee),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ce,resourceDestinationString:$,resourceTitleString:H,resource:ne,setextHeading:l(T),setextHeadingLineSequence:k,setextHeadingText:O,strong:l(),thematicBreak:l()}};XM(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(le){let Ce={type:"root",children:[]};const Le={stack:[Ce],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},qe=[];let dt=-1;for(;++dt<le.length;)if(le[dt][1].type==="listOrdered"||le[dt][1].type==="listUnordered")if(le[dt][0]==="enter")qe.push(dt);else{const rn=qe.pop();dt=o(le,rn,dt)}for(dt=-1;++dt<le.length;){const rn=t[le[dt][0]];KM.call(rn,le[dt][1].type)&&rn[le[dt][1].type].call(Object.assign({sliceSerialize:le[dt][2].sliceSerialize},Le),le[dt][1])}if(Le.tokenStack.length>0){const rn=Le.tokenStack[Le.tokenStack.length-1];(rn[1]||KP).call(Le,void 0,rn[0])}for(Ce.position={start:rs(le.length>0?le[0][1].start:{line:1,column:1,offset:0}),end:rs(le.length>0?le[le.length-2][1].end:{line:1,column:1,offset:0})},dt=-1;++dt<t.transforms.length;)Ce=t.transforms[dt](Ce)||Ce;return Ce}function o(le,Ce,Le){let qe=Ce-1,dt=-1,rn=!1,on,fn,zn,wr;for(;++qe<=Le;){const hn=le[qe];switch(hn[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{hn[0]==="enter"?dt++:dt--,wr=void 0;break}case"lineEndingBlank":{hn[0]==="enter"&&(on&&!wr&&!dt&&!zn&&(zn=qe),wr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:wr=void 0}if(!dt&&hn[0]==="enter"&&hn[1].type==="listItemPrefix"||dt===-1&&hn[0]==="exit"&&(hn[1].type==="listUnordered"||hn[1].type==="listOrdered")){if(on){let nr=qe;for(fn=void 0;nr--;){const Tn=le[nr];if(Tn[1].type==="lineEnding"||Tn[1].type==="lineEndingBlank"){if(Tn[0]==="exit")continue;fn&&(le[fn][1].type="lineEndingBlank",rn=!0),Tn[1].type="lineEnding",fn=nr}else if(!(Tn[1].type==="linePrefix"||Tn[1].type==="blockQuotePrefix"||Tn[1].type==="blockQuotePrefixWhitespace"||Tn[1].type==="blockQuoteMarker"||Tn[1].type==="listItemIndent"))break}zn&&(!fn||zn<fn)&&(on._spread=!0),on.end=Object.assign({},fn?le[fn][1].start:hn[1].end),le.splice(fn||qe,0,["exit",on,hn[2]]),qe++,Le++}if(hn[1].type==="listItemPrefix"){const nr={type:"listItem",_spread:!1,start:Object.assign({},hn[1].start),end:void 0};on=nr,le.splice(qe,0,["enter",nr,hn[2]]),qe++,Le++,zn=void 0,wr=!0}}}return le[Ce][1]._spread=rn,Le}function i(le,Ce){return Le;function Le(qe){a.call(this,le(qe),qe),Ce&&Ce.call(this,qe)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(le,Ce,Le){this.stack[this.stack.length-1].children.push(le),this.stack.push(le),this.tokenStack.push([Ce,Le]),le.position={start:rs(Ce.start),end:void 0}}function l(le){return Ce;function Ce(Le){le&&le.call(this,Le),c.call(this,Le)}}function c(le,Ce){const Le=this.stack.pop(),qe=this.tokenStack.pop();if(qe)qe[0].type!==le.type&&(Ce?Ce.call(this,le,qe[0]):(qe[1]||KP).call(this,le,qe[0]));else throw new Error("Cannot close `"+le.type+"` ("+Iu({start:le.start,end:le.end})+"): it’s not open");Le.position.end=rs(le.end)}function u(){return Eie(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function g(le){if(this.data.expectingFirstListItemValue){const Ce=this.stack[this.stack.length-2];Ce.start=Number.parseInt(this.sliceSerialize(le),10),this.data.expectingFirstListItemValue=void 0}}function p(){const le=this.resume(),Ce=this.stack[this.stack.length-1];Ce.lang=le}function v(){const le=this.resume(),Ce=this.stack[this.stack.length-1];Ce.meta=le}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const le=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=le.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const le=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=le.replace(/(\r?\n|\r)$/g,"")}function _(le){const Ce=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Ce,Le.identifier=zl(this.sliceSerialize(le)).toLowerCase()}function S(){const le=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=le}function R(){const le=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=le}function E(le){const Ce=this.stack[this.stack.length-1];if(!Ce.depth){const Le=this.sliceSerialize(le).length;Ce.depth=Le}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function k(le){const Ce=this.stack[this.stack.length-1];Ce.depth=this.sliceSerialize(le).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function M(le){const Le=this.stack[this.stack.length-1].children;let qe=Le[Le.length-1];(!qe||qe.type!=="text")&&(qe=zt(),qe.position={start:rs(le.start),end:void 0},Le.push(qe)),this.stack.push(qe)}function F(le){const Ce=this.stack.pop();Ce.value+=this.sliceSerialize(le),Ce.position.end=rs(le.end)}function z(le){const Ce=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=Ce.children[Ce.children.length-1];Le.position.end=rs(le.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ce.type)&&(M.call(this,le),F.call(this,le))}function B(){this.data.atHardBreak=!0}function Y(){const le=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=le}function G(){const le=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=le}function j(){const le=this.resume(),Ce=this.stack[this.stack.length-1];Ce.value=le}function ee(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=Ce,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function q(){const le=this.stack[this.stack.length-1];if(this.data.inReference){const Ce=this.data.referenceType||"shortcut";le.type+="Reference",le.referenceType=Ce,delete le.url,delete le.title}else delete le.identifier,delete le.label;this.data.referenceType=void 0}function X(le){const Ce=this.sliceSerialize(le),Le=this.stack[this.stack.length-2];Le.label=Sae(Ce),Le.identifier=zl(Ce).toLowerCase()}function re(){const le=this.stack[this.stack.length-1],Ce=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const qe=le.children;Le.children=qe}else Le.alt=Ce}function $(){const le=this.resume(),Ce=this.stack[this.stack.length-1];Ce.url=le}function H(){const le=this.resume(),Ce=this.stack[this.stack.length-1];Ce.title=le}function ne(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ce(le){const Ce=this.resume(),Le=this.stack[this.stack.length-1];Le.label=Ce,Le.identifier=zl(this.sliceSerialize(le)).toLowerCase(),this.data.referenceType="full"}function ge(le){this.data.characterReferenceType=le.type}function he(le){const Ce=this.sliceSerialize(le),Le=this.data.characterReferenceType;let qe;Le?(qe=FM(Ce,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):qe=l1(Ce);const dt=this.stack.pop();dt.value+=qe,dt.position.end=rs(le.end)}function de(le){F.call(this,le);const Ce=this.stack[this.stack.length-1];Ce.url=this.sliceSerialize(le)}function oe(le){F.call(this,le);const Ce=this.stack[this.stack.length-1];Ce.url="mailto:"+this.sliceSerialize(le)}function Z(){return{type:"blockquote",children:[]}}function ie(){return{type:"code",lang:null,meta:null,value:""}}function ye(){return{type:"inlineCode",value:""}}function W(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function me(){return{type:"emphasis",children:[]}}function _e(){return{type:"heading",depth:0,children:[]}}function Pe(){return{type:"break"}}function $e(){return{type:"html",value:""}}function Ue(){return{type:"image",title:null,url:"",alt:null}}function ze(){return{type:"link",title:null,url:"",children:[]}}function Ne(le){return{type:"list",ordered:le.type==="listOrdered",start:null,spread:le._spread,children:[]}}function Xe(le){return{type:"listItem",spread:le._spread,checked:null,children:[]}}function gt(){return{type:"paragraph",children:[]}}function It(){return{type:"strong",children:[]}}function zt(){return{type:"text",value:""}}function ln(){return{type:"thematicBreak"}}}function rs(e){return{line:e.line,column:e.column,offset:e.offset}}function XM(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?XM(e,r):Pae(e,r)}}function Pae(e,t){let n;for(n in t)if(KM.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 KP(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Iu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Iu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Iu({start:t.start,end:t.end})+") is still open")}function Oae(e){const t=this;t.parser=n;function n(r){return Eae(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function $ae(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 Dae(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
365
+ `}]}function Tae(e,t){const n=t.value?t.value+`
366
+ `:"",r={};t.lang&&(r.className=["language-"+t.lang]);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 kae(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Mae(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Aae(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=Pc(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function Iae(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 Nae(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function QM(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 o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const s=o[o.length-1];return s&&s.type==="text"?s.value+=r:o.push({type:"text",value:r}),o}function Lae(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return QM(e,t);const o={src:Pc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function Fae(e,t){const n={src:Pc(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 zae(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 jae(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return QM(e,t);const o={href:Pc(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function Bae(e,t){const n={href:Pc(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 Vae(e,t,n){const r=e.all(t),o=n?Hae(n):JM(t),i={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let f;u&&u.type==="element"&&u.tagName==="p"?f=u:(f={type:"element",tagName:"p",properties:{},children:[]},r.unshift(f)),f.children.length>0&&f.children.unshift({type:"text",value:" "}),f.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(o||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
367
+ `}),u.type==="element"&&u.tagName==="p"&&!o?s.push(...u.children):s.push(u)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
368
+ `});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function Hae(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=JM(n[r])}return t}function JM(e){const t=e.spread;return t??e.children.length>1}function Wae(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const s=r[o];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function Uae(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qae(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Gae(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Yae(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),o.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=o1(t.children[1]),l=TM(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),o.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function Kae(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const f=t.children[l],g={},p=s?s[l]:void 0;p&&(g.align=p);let v={type:"element",tagName:i,properties:g,children:[]};f&&(v.children=e.all(f),e.patch(f,v),v=e.applyData(f,v)),c.push(v)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function Xae(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const XP=9,QP=32;function Qae(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(JP(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(JP(t.slice(o),o>0,!1)),i.join("")}function JP(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===XP||i===QP;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===XP||i===QP;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function Jae(e,t){const n={type:"text",value:Qae(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Zae(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const ele={blockquote:$ae,break:Dae,code:Tae,delete:kae,emphasis:Mae,footnoteReference:Aae,heading:Iae,html:Nae,imageReference:Lae,image:Fae,inlineCode:zae,linkReference:jae,link:Bae,listItem:Vae,list:Wae,paragraph:Uae,root:qae,strong:Gae,table:Yae,tableCell:Xae,tableRow:Kae,text:Jae,thematicBreak:Zae,toml:Hh,yaml:Hh,definition:Hh,footnoteDefinition:Hh};function Hh(){}const ZM=-1,nm=0,Yp=1,Kp=2,d1=3,f1=4,h1=5,p1=6,eA=7,tA=8,ZP=typeof self=="object"?self:globalThis,tle=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,s]=t[o];switch(i){case nm:case ZM:return n(s,o);case Yp:{const a=n([],o);for(const l of s)a.push(r(l));return a}case Kp:{const a=n({},o);for(const[l,c]of s)a[r(l)]=r(c);return a}case d1:return n(new Date(s),o);case f1:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case h1:{const a=n(new Map,o);for(const[l,c]of s)a.set(r(l),r(c));return a}case p1:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case eA:{const{name:a,message:l}=s;return n(new ZP[a](l),o)}case tA:return n(BigInt(s),o);case"BigInt":return n(Object(BigInt(s)),o)}return n(new ZP[i](s),o)};return r},eO=e=>tle(new Map,e)(0),Rl="",{toString:nle}={},{keys:rle}=Object,hu=e=>{const t=typeof e;if(t!=="object"||!e)return[nm,t];const n=nle.call(e).slice(8,-1);switch(n){case"Array":return[Yp,Rl];case"Object":return[Kp,Rl];case"Date":return[d1,Rl];case"RegExp":return[f1,Rl];case"Map":return[h1,Rl];case"Set":return[p1,Rl]}return n.includes("Array")?[Yp,n]:n.includes("Error")?[eA,n]:[Kp,n]},Wh=([e,t])=>e===nm&&(t==="function"||t==="symbol"),ole=(e,t,n,r)=>{const o=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},i=s=>{if(n.has(s))return n.get(s);let[a,l]=hu(s);switch(a){case nm:{let u=s;switch(l){case"bigint":a=tA,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([ZM],s)}return o([a,u],s)}case Yp:{if(l)return o([l,[...s]],s);const u=[],f=o([a,u],s);for(const g of s)u.push(i(g));return f}case Kp:{if(l)switch(l){case"BigInt":return o([l,s.toString()],s);case"Boolean":case"Number":case"String":return o([l,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const u=[],f=o([a,u],s);for(const g of rle(s))(e||!Wh(hu(s[g])))&&u.push([i(g),i(s[g])]);return f}case d1:return o([a,s.toISOString()],s);case f1:{const{source:u,flags:f}=s;return o([a,{source:u,flags:f}],s)}case h1:{const u=[],f=o([a,u],s);for(const[g,p]of s)(e||!(Wh(hu(g))||Wh(hu(p))))&&u.push([i(g),i(p)]);return f}case p1:{const u=[],f=o([a,u],s);for(const g of s)(e||!Wh(hu(g)))&&u.push(i(g));return f}}const{message:c}=s;return o([a,{name:l,message:c}],s)};return i},tO=(e,{json:t,lossy:n}={})=>{const r=[];return ole(!(t||n),!!t,new Map,r)(e),r},Xp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?eO(tO(e,t)):structuredClone(e):(e,t)=>eO(tO(e,t));function ile(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 sle(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ale(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ile,r=e.options.footnoteBackLabel||sle,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),f=String(c.identifier).toUpperCase(),g=Pc(f.toLowerCase());let p=0;const v=[],y=e.footnoteCounts.get(f);for(;y!==void 0&&++p<=y;){v.length>0&&v.push({type:"text",value:" "});let _=typeof n=="string"?n:n(l,p);typeof _=="string"&&(_={type:"text",value:_}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+g+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const x=u[u.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const _=x.children[x.children.length-1];_&&_.type==="text"?_.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...v)}else u.push(...v);const w={type:"element",tagName:"li",properties:{id:t+"fn-"+g},children:e.wrap(u,!0)};e.patch(c,w),a.push(w)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...Xp(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
369
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
370
+ `}]}}const nA=function(e){if(e==null)return dle;if(typeof e=="function")return rm(e);if(typeof e=="object")return Array.isArray(e)?lle(e):cle(e);if(typeof e=="string")return ule(e);throw new Error("Expected function, string, or object as test")};function lle(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=nA(e[n]);return rm(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function cle(e){const t=e;return rm(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function ule(e){return rm(t);function t(n){return n&&n.type===e}}function rm(e){return t;function t(n,r,o){return!!(fle(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function dle(){return!0}function fle(e){return e!==null&&typeof e=="object"&&"type"in e}const rA=[],hle=!0,nO=!1,ple="skip";function gle(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=nA(o),s=r?-1:1;a(e,void 0,[])();function a(l,c,u){const f=l&&typeof l=="object"?l:{};if(typeof f.type=="string"){const p=typeof f.tagName=="string"?f.tagName:typeof f.name=="string"?f.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return g;function g(){let p=rA,v,y,x;if((!t||i(l,c,u[u.length-1]||void 0))&&(p=mle(n(l,u)),p[0]===nO))return p;if("children"in l&&l.children){const w=l;if(w.children&&p[0]!==ple)for(y=(r?w.children.length:-1)+s,x=u.concat(w);y>-1&&y<w.children.length;){const _=w.children[y];if(v=a(_,y,x)(),v[0]===nO)return v;y=typeof v[1]=="number"?v[1]:y+s}}return p}}}function mle(e){return Array.isArray(e)?e:typeof e=="number"?[hle,e]:e==null?rA:[e]}function oA(e,t,n,r){let o,i,s;typeof t=="function"&&typeof n!="function"?(i=void 0,s=t,o=n):(i=t,s=n,o=r),gle(e,i,a,o);function a(l,c){const u=c[c.length-1],f=u?u.children.indexOf(l):void 0;return s(l,f,u)}}const My={}.hasOwnProperty,vle={};function ble(e,t){const n=t||vle,r=new Map,o=new Map,i=new Map,s={...ele,...n.handlers},a={all:c,applyData:xle,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:yle,wrap:_le};return oA(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const f=u.type==="definition"?r:o,g=String(u.identifier).toUpperCase();f.has(g)||f.set(g,u)}}),a;function l(u,f){const g=u.type,p=a.handlers[g];if(My.call(a.handlers,g)&&p)return p(a,u,f);if(a.options.passThrough&&a.options.passThrough.includes(g)){if("children"in u){const{children:y,...x}=u,w=Xp(x);return w.children=a.all(u),w}return Xp(u)}return(a.options.unknownHandler||wle)(a,u,f)}function c(u){const f=[];if("children"in u){const g=u.children;let p=-1;for(;++p<g.length;){const v=a.one(g[p],u);if(v){if(p&&g[p-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=rO(v.value)),!Array.isArray(v)&&v.type==="element")){const y=v.children[0];y&&y.type==="text"&&(y.value=rO(y.value))}Array.isArray(v)?f.push(...v):f.push(v)}}}return f}}function yle(e,t){e.position&&(t.position=tie(e))}function xle(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&i&&Object.assign(n.properties,Xp(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function wle(e,t){const n=t.data||{},r="value"in t&&!(My.call(n,"hProperties")||My.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 _le(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
371
+ `});++r<e.length;)r&&n.push({type:"text",value:`
372
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
373
+ `}),n}function rO(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function oO(e,t){const n=ble(e,t),r=n.one(e,void 0),o=ale(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
374
+ `},o),i}function Sle(e,t){return e&&"run"in e?async function(n,r){const o=oO(n,{file:r,...t});await e.run(o,r)}:function(n,r){return oO(n,{file:r,...t||e})}}function iO(e){if(e)throw e}var fp=Object.prototype.hasOwnProperty,iA=Object.prototype.toString,sO=Object.defineProperty,aO=Object.getOwnPropertyDescriptor,lO=function(t){return typeof Array.isArray=="function"?Array.isArray(t):iA.call(t)==="[object Array]"},cO=function(t){if(!t||iA.call(t)!=="[object Object]")return!1;var n=fp.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&fp.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||fp.call(t,o)},uO=function(t,n){sO&&n.name==="__proto__"?sO(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},dO=function(t,n){if(n==="__proto__")if(fp.call(t,n)){if(aO)return aO(t,n).value}else return;return t[n]},Cle=function e(){var t,n,r,o,i,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=dO(a,n),o=dO(t,n),a!==o&&(u&&o&&(cO(o)||(i=lO(o)))?(i?(i=!1,s=r&&lO(r)?r:[]):s=r&&cO(r)?r:{},uO(a,{name:n,newValue:e(u,s,o)})):typeof o<"u"&&uO(a,{name:n,newValue:o}));return a};const Fb=vc(Cle);function Ay(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 Ele(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){const u=e[++i];let f=-1;if(l){s(l);return}for(;++f<o.length;)(c[f]===null||c[f]===void 0)&&(c[f]=o[f]);o=c,u?Rle(u,a)(...c):s(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function Rle(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l instanceof Promise?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const zo={basename:Ple,dirname:Ole,extname:$le,join:Dle,sep:"/"};function Ple(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');cf(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Ole(e){if(cf(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 $le(e){cf(e);let t=e.length,n=-1,r=0,o=-1,i=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function Dle(...e){let t=-1,n;for(;++t<e.length;)cf(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Tle(n)}function Tle(e){cf(e);const t=e.codePointAt(0)===47;let n=kle(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function kle(e,t){let n="",r=0,o=-1,i=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length>0){n="",r=0,o=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function cf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Mle={cwd:Ale};function Ale(){return"/"}function Iy(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ile(e){if(typeof e=="string")e=new URL(e);else if(!Iy(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 Nle(e)}function Nle(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 o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const zb=["history","path","basename","stem","extname","dirname"];class sA{constructor(t){let n;t?Iy(t)?n={path:t}:typeof t=="string"||Lle(t)?n={value:t}:n=t:n={},this.cwd=Mle.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<zb.length;){const i=zb[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)zb.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?zo.basename(this.path):void 0}set basename(t){Bb(t,"basename"),jb(t,"basename"),this.path=zo.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?zo.dirname(this.path):void 0}set dirname(t){fO(this.basename,"dirname"),this.path=zo.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?zo.extname(this.path):void 0}set extname(t){if(jb(t,"extname"),fO(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=zo.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Iy(t)&&(t=Ile(t)),Bb(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?zo.basename(this.path,this.extname):void 0}set stem(t){Bb(t,"stem"),jb(t,"stem"),this.path=zo.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new Kn(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function jb(e,t){if(e&&e.includes(zo.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+zo.sep+"`")}function Bb(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function fO(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function Lle(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Fle=function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};Object.setPrototypeOf(i,r);const s=Object.getOwnPropertyNames(o);for(const a of s){const l=Object.getOwnPropertyDescriptor(o,a);l&&Object.defineProperty(i,a,l)}return i},zle={}.hasOwnProperty;class g1 extends Fle{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=Ele()}copy(){const t=new g1;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Fb(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Wb("data",this.frozen),this.namespace[t]=n,this):zle.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Wb("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 o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Uh(t),r=this.parser||this.Parser;return Vb("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Vb("process",this.parser||this.Parser),Hb("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Uh(t),l=r.parse(a);r.run(l,a,function(u,f,g){if(u||!f||!g)return c(u);const p=f,v=r.stringify(p,g);Vle(v)?g.value=v:g.result=v,c(u,g)});function c(u,f){u||!f?s(u):i?i(f):n(void 0,f)}}}processSync(t){let n=!1,r;return this.freeze(),Vb("processSync",this.parser||this.Parser),Hb("processSync",this.compiler||this.Compiler),this.process(t,o),pO("processSync","process",n),r;function o(i,s){n=!0,iO(i),r=s}}run(t,n,r){hO(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,a){const l=Uh(n);o.run(t,l,c);function c(u,f,g){const p=f||t;u?a(u):s?s(p):r(void 0,p,g)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),pO("runSync","run",r),o;function i(s,a){iO(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Uh(n),o=this.compiler||this.Compiler;return Hb("stringify",o),hO(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(Wb("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...f]=c;l(u,f)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(o.settings=Fb(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const f=c[u];i(f)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let f=-1,g=-1;for(;++f<r.length;)if(r[f][0]===c){g=f;break}if(g===-1)r.push([c,...u]);else if(u.length>0){let[p,...v]=u;const y=r[g][1];Ay(y)&&Ay(p)&&(p=Fb(!0,y,p)),r[g]=[c,p,...v]}}}}const jle=new g1().freeze();function Vb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Hb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Wb(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 hO(e){if(!Ay(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function pO(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Uh(e){return Ble(e)?e:new sA(e)}function Ble(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Vle(e){return typeof e=="string"||Hle(e)}function Hle(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Wle="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",gO=[],mO={allowDangerousHtml:!0},Ule=/^(https?|ircs?|mailto|xmpp)$/i,qle=[{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:"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 aA(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,i=e.components,s=e.disallowedElements,a=e.rehypePlugins||gO,l=e.remarkPlugins||gO,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...mO}:mO,u=e.skipHtml,f=e.unwrapDisallowed,g=e.urlTransform||Gle,p=jle().use(Oae).use(l).use(Sle,c).use(a),v=new sA;typeof r=="string"&&(v.value=r);for(const _ of qle)Object.hasOwn(e,_.from)&&(""+_.from+(_.to?"use `"+_.to+"` instead":"remove it")+Wle+_.id,void 0);const y=p.parse(v);let x=p.runSync(y,v);return o&&(x={type:"element",tagName:"div",properties:{className:o},children:x.type==="root"?x.children:[x]}),oA(x,w),aie(x,{Fragment:N.Fragment,components:i,ignoreInvalidStyle:!0,jsx:N.jsx,jsxs:N.jsxs,passKeys:!0,passNode:!0});function w(_,S,R){if(_.type==="raw"&&R&&typeof S=="number")return u?R.children.splice(S,1):R.children[S]={type:"text",value:_.value},S;if(_.type==="element"){let E;for(E in Ib)if(Object.hasOwn(Ib,E)&&Object.hasOwn(_.properties,E)){const O=_.properties[E],k=Ib[E];(k===null||k.includes(_.tagName))&&(_.properties[E]=g(String(O||""),E,_))}}if(_.type==="element"){let E=t?!t.includes(_.tagName):s?s.includes(_.tagName):!1;if(!E&&n&&typeof S=="number"&&(E=!n(_,S,R)),E&&R&&typeof S=="number")return f&&_.children?R.children.splice(S,1,..._.children):R.children.splice(S,1),S}}}function Gle(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t<0||o>-1&&t>o||n>-1&&t>n||r>-1&&t>r||Ule.test(e.slice(0,t))?e:""}function Yle(){const e=m.useRef(null),[t,n]=m.useState(""),[r,o]=m.useState(!1),i=Te(T=>T.dashboard.aiScopeTables),s=Te(T=>T.selectedSheetId),{addFrame:a,setSelectedFrameId:l}=Li(),{authToken:c}=Ua(),u=m$(),{messages:f,input:g,handleInputChange:p,handleSubmit:v,addToolResult:y,stop:x,isLoading:w}=Kre({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${c==null?void 0:c.accessToken}`},maxToolRoundtrips:5,initialInput:"Can you provide some example questions I can ask about the data I have access to?",async onToolCall({toolCall:T}){if(S(T.toolName),console.log("onToolCall",T,f),T.toolName==="getLocation"){const M=["New York","Los Angeles","Chicago","San Francisco"];return M[Math.floor(Math.random()*M.length)]}if(T.toolName==="getTables")return JSON.stringify(i||[]);if(T.toolName==="getData"){console.log(T.args);const M=T.args;if(!(M!=null&&M.sql)||!(M!=null&&M.connectionId))return"Please provide sql, connectionId and table";const F=await u.fetchQuery({queryKey:["chat",M.connectionId,M.sql],queryFn:()=>Fd("https://semaphor.cloud/api/v1/query",(c==null?void 0:c.accessToken)||(c==null?void 0:c.accessToken)||"",{connection_id:M.connectionId,sql:M.sql})});return n("Summarizing"),JSON.stringify(F)}},onFinish(T,M){console.log("onFinish",T,M),T.content&&n("")}}),_=()=>{var T;(T=e.current)==null||T.scrollIntoView({behavior:"smooth"})};m.useEffect(()=>{_()},[f]);function S(T){T==="getTables"&&n("Initializing"),T==="getSchemas"&&n("Analyzing"),T==="getData"&&n("Fetching")}function R(T){const M=T.toolInvocations||[];return M.length===0||M.find(z=>z.toolName==="getData"&&"result"in z)?!0:r}function E(T){return T==null?void 0:T.map(M=>{var F;return R(M)?N.jsxs("div",{className:"relative rounded-md bg-background px-4 py-2 text-foreground/80",children:[N.jsxs("div",{className:"",children:[M.role!=="user"&&N.jsx("strong",{className:"mr-2",children:ki.startCase(M.role)}),N.jsx(aA,{components:Kle,children:M.content})]}),(F=M.toolInvocations)==null?void 0:F.map(z=>{const B=z.toolCallId;return"result"in z?N.jsx("div",{children:O(z)},B):N.jsxs("div",{children:["Calling ",z.toolName,"..."]},B)})]},M.id):null})}function O(T){if("result"in T){let M;try{const F=JSON.parse(T.result);if(M=N.jsx("pre",{className:"whitespace-normal text-xs",children:JSON.stringify(F,null,2)}),T.toolName==="getData"){console.log(T);const z=cw({cardType:T.args.chartType,data:F.records});return N.jsxs("div",{className:"space-y-2",children:[r&&N.jsxs("div",{children:[N.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${T.toolName}: `,M]}),N.jsxs("div",{className:"flex h-[350px] w-[99%] grow flex-col",children:[z&&N.jsx(Gx,{cfg:z}),N.jsx(Po,{onClick:()=>k(F.sql,F.records,z),variant:"outline",size:"sm",className:"absolute right-3 top-3",children:"Add"})]})]})}}catch{M=N.jsx("span",{children:T.result})}return N.jsxs("div",{children:[N.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${T.toolName}: `,M]})}return`Calling ${T.toolName}...`}function k(T,M,F){if(!s)return;const z={id:Na(),title:"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}]},type:F.type,cfg:F,sql:T,data:M},B={id:Na(),cards:[z],activeCardId:z.id};a(s,B),l(B.id)}return N.jsxs("div",{className:"flex h-full grow flex-col justify-between break-words rounded-md bg-muted/70 px-6 py-6",children:[N.jsxs("div",{className:"flex items-center gap-5",children:[N.jsx(So,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),!1]}),N.jsx(Bg,{className:"my-4"}),N.jsxs(t1,{className:"flex flex-1 basis-0 flex-col flex-wrap justify-end py-2",children:[N.jsx("div",{className:"space-y-2",children:E(f)}),N.jsx("div",{ref:e,className:"mt-2 text-right text-xs text-muted-foreground",children:t}),N.jsx(Zg,{orientation:"vertical"})]}),N.jsx("div",{className:"",children:N.jsxs("form",{className:"flex w-full grow justify-between gap-2 rounded-md bg-muted p-1",onSubmit:v,children:[N.jsx(Xw,{className:"w-full focus-visible:ring-offset-0",value:g,disabled:w,placeholder:"What can I help you with?",onChange:p}),w&&N.jsx(Po,{onClick:()=>x(),children:"Stop"})]})})]})}const Kle={li:({node:e,...t})=>N.jsx("li",{className:"my-2 ml-5 list-disc rounded-md bg-muted/50 px-2 py-1",...t})};function lA(){const e=Te(a=>{var l;return(l=a.dashboard)==null?void 0:l.sheets}),t=null,[n,r]=m.useState(!1);Te(a=>a.isDashboardEditing);const o=Te(a=>a.themeStyle);Te(a=>a.isVisualEditing);const i=Te(a=>a.selectedSheetId),s=Te(a=>a.actions.setSelectedSheetId);return e?N.jsxs(M$,{role:"dashboard-tabs-container",className:Oe("relative flex grow",o==null?void 0:o.dashboardTabsContainer),onValueChange:a=>{s(a)},value:i||e[0].id,children:[N.jsx("div",{className:Oe(`grow overflow-y-scroll ${n&&!t?"max-h-screen min-h-0":t}`),children:e==null?void 0:e.map(a=>N.jsx(ix,{className:"mt-0",value:a.id,children:N.jsx(ere,{})},a.id))}),!n&&N.jsx("div",{role:"chat-bubble",className:"group absolute right-5 top-10 hidden md:block",children:N.jsx(Po,{className:"p-1",onClick:()=>r(!0),variant:"ghost",children:N.jsx(uK,{strokeWidth:1.2,className:"visible size-8 text-muted-foreground group-hover:visible"})})}),N.jsxs("div",{role:"chat-box-container",className:Oe(`relative mt-2 hidden w-1/3 md:${n?"block":"hidden"}`),children:[N.jsx(Po,{onClick:()=>r(!1),className:"absolute right-3 top-3 h-6 p-1",variant:"ghost",children:N.jsx(lw,{className:"size-4 text-muted-foreground"})}),N.jsx(Yle,{})]})]}):null}function cA({children:e}){return N.jsx(g8,{defaultTheme:"system",storageKey:"vite-ui-theme",children:N.jsx(rK,{delayDuration:0,children:e})})}function uA(e){return N.jsx(lT,{dashboardProps:e,children:N.jsx(cA,{children:N.jsx(w$,{...e,children:N.jsx(lA,{})})})})}const Ny=["Enter"," "],Xle=["ArrowDown","PageUp","Home"],dA=["ArrowUp","PageDown","End"],Qle=[...Xle,...dA],Jle={ltr:[...Ny,"ArrowRight"],rtl:[...Ny,"ArrowLeft"]},Zle={ltr:["ArrowLeft"],rtl:["ArrowRight"]},om="Menu",[yd,ece,tce]=ug(om),[Qa,fA]=Dn(om,[tce,ii,yc]),m1=ii(),hA=yc(),[nce,Ja]=Qa(om),[rce,uf]=Qa(om),oce=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=m1(t),[l,c]=m.useState(null),u=m.useRef(!1),f=Cn(i),g=Ba(o);return m.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),m.createElement(Xd,a,m.createElement(nce,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c},m.createElement(rce,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:g,modal:s},r)))},pA=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=m1(n);return m.createElement(Qd,se({},o,r,{ref:t}))}),gA="MenuPortal",[ice,mA]=Qa(gA,{forceMount:void 0}),sce=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Ja(gA,t);return m.createElement(ice,{scope:t,forceMount:n},m.createElement(yn,{present:n||i.open},m.createElement(Tg,{asChild:!0,container:o},r)))},Oo="MenuContent",[ace,v1]=Qa(Oo),lce=m.forwardRef((e,t)=>{const n=mA(Oo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Ja(Oo,e.__scopeMenu),s=uf(Oo,e.__scopeMenu);return m.createElement(yd.Provider,{scope:e.__scopeMenu},m.createElement(yn,{present:r||i.open},m.createElement(yd.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(cce,se({},o,{ref:t})):m.createElement(uce,se({},o,{ref:t})))))}),cce=m.forwardRef((e,t)=>{const n=Ja(Oo,e.__scopeMenu),r=m.useRef(null),o=st(t,r);return m.useEffect(()=>{const i=r.current;if(i)return Lg(i)},[]),m.createElement(b1,se({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Ee(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),uce=m.forwardRef((e,t)=>{const n=Ja(Oo,e.__scopeMenu);return m.createElement(b1,se({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),b1=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:g,onDismiss:p,disableOutsideScroll:v,...y}=e,x=Ja(Oo,n),w=uf(Oo,n),_=m1(n),S=hA(n),R=ece(n),[E,O]=m.useState(null),k=m.useRef(null),T=st(t,k,x.onContentChange),M=m.useRef(0),F=m.useRef(""),z=m.useRef(0),B=m.useRef(null),Y=m.useRef("right"),G=m.useRef(0),j=v?zg:m.Fragment,ee=v?{as:Mi,allowPinchZoom:!0}:void 0,q=re=>{var $,H;const ne=F.current+re,I=R().filter(Z=>!Z.disabled),ce=document.activeElement,ge=($=I.find(Z=>Z.ref.current===ce))===null||$===void 0?void 0:$.textValue,he=I.map(Z=>Z.textValue),de=$ce(he,ne,ge),oe=(H=I.find(Z=>Z.textValue===de))===null||H===void 0?void 0:H.ref.current;(function Z(ie){F.current=ie,window.clearTimeout(M.current),ie!==""&&(M.current=window.setTimeout(()=>Z(""),1e3))})(ne),oe&&setTimeout(()=>oe.focus())};m.useEffect(()=>()=>window.clearTimeout(M.current),[]),Ig();const X=m.useCallback(re=>{var $,H;return Y.current===(($=B.current)===null||$===void 0?void 0:$.side)&&Tce(re,(H=B.current)===null||H===void 0?void 0:H.area)},[]);return m.createElement(ace,{scope:n,searchRef:F,onItemEnter:m.useCallback(re=>{X(re)&&re.preventDefault()},[X]),onItemLeave:m.useCallback(re=>{var $;X(re)||(($=k.current)===null||$===void 0||$.focus(),O(null))},[X]),onTriggerLeave:m.useCallback(re=>{X(re)&&re.preventDefault()},[X]),pointerGraceTimerRef:z,onPointerGraceIntentChange:m.useCallback(re=>{B.current=re},[])},m.createElement(j,ee,m.createElement(Ng,{asChild:!0,trapped:o,onMountAutoFocus:Ee(i,re=>{var $;re.preventDefault(),($=k.current)===null||$===void 0||$.focus()}),onUnmountAutoFocus:s},m.createElement(xc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:g,onDismiss:p},m.createElement(nx,se({asChild:!0},S,{dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:O,onEntryFocus:Ee(l,re=>{w.isUsingKeyboardRef.current||re.preventDefault()})}),m.createElement(Jd,se({role:"menu","aria-orientation":"vertical","data-state":wA(x.open),"data-radix-menu-content":"",dir:w.dir},_,y,{ref:T,style:{outline:"none",...y.style},onKeyDown:Ee(y.onKeyDown,re=>{const H=re.target.closest("[data-radix-menu-content]")===re.currentTarget,ne=re.ctrlKey||re.altKey||re.metaKey,I=re.key.length===1;H&&(re.key==="Tab"&&re.preventDefault(),!ne&&I&&q(re.key));const ce=k.current;if(re.target!==ce||!Qle.includes(re.key))return;re.preventDefault();const he=R().filter(de=>!de.disabled).map(de=>de.ref.current);dA.includes(re.key)&&he.reverse(),Pce(he)}),onBlur:Ee(e.onBlur,re=>{re.currentTarget.contains(re.target)||(window.clearTimeout(M.current),F.current="")}),onPointerMove:Ee(e.onPointerMove,xd(re=>{const $=re.target,H=G.current!==re.clientX;if(re.currentTarget.contains($)&&H){const ne=re.clientX>G.current?"right":"left";Y.current=ne,G.current=re.clientX}}))})))))))}),dce=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(We.div,se({role:"group"},r,{ref:t}))}),fce=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(We.div,se({},r,{ref:t}))}),Ly="MenuItem",vO="menu.itemSelect",y1=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),s=uf(Ly,e.__scopeMenu),a=v1(Ly,e.__scopeMenu),l=st(t,i),c=m.useRef(!1),u=()=>{const f=i.current;if(!n&&f){const g=new CustomEvent(vO,{bubbles:!0,cancelable:!0});f.addEventListener(vO,p=>r==null?void 0:r(p),{once:!0}),S$(f,g),g.defaultPrevented?c.current=!1:s.onClose()}};return m.createElement(vA,se({},o,{ref:l,disabled:n,onClick:Ee(e.onClick,u),onPointerDown:f=>{var g;(g=e.onPointerDown)===null||g===void 0||g.call(e,f),c.current=!0},onPointerUp:Ee(e.onPointerUp,f=>{var g;c.current||(g=f.currentTarget)===null||g===void 0||g.click()}),onKeyDown:Ee(e.onKeyDown,f=>{const g=a.searchRef.current!=="";n||g&&f.key===" "||Ny.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),vA=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=v1(Ly,n),a=hA(n),l=m.useRef(null),c=st(t,l),[u,f]=m.useState(!1),[g,p]=m.useState("");return m.useEffect(()=>{const v=l.current;if(v){var y;p(((y=v.textContent)!==null&&y!==void 0?y:"").trim())}},[i.children]),m.createElement(yd.ItemSlot,{scope:n,disabled:r,textValue:o??g},m.createElement(rx,se({asChild:!0},a,{focusable:!r}),m.createElement(We.div,se({role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:c,onPointerMove:Ee(e.onPointerMove,xd(v=>{r?s.onItemLeave(v):(s.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus())})),onPointerLeave:Ee(e.onPointerLeave,xd(v=>s.onItemLeave(v))),onFocus:Ee(e.onFocus,()=>f(!0)),onBlur:Ee(e.onBlur,()=>f(!1))}))))}),hce=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.createElement(yA,{scope:e.__scopeMenu,checked:n},m.createElement(y1,se({role:"menuitemcheckbox","aria-checked":Qp(n)?"mixed":n},o,{ref:t,"data-state":x1(n),onSelect:Ee(o.onSelect,()=>r==null?void 0:r(Qp(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),pce="MenuRadioGroup",[gce,mce]=Qa(pce,{value:void 0,onValueChange:()=>{}}),vce=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=Cn(r);return m.createElement(gce,{scope:e.__scopeMenu,value:n,onValueChange:i},m.createElement(dce,se({},o,{ref:t})))}),bce="MenuRadioItem",yce=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=mce(bce,e.__scopeMenu),i=n===o.value;return m.createElement(yA,{scope:e.__scopeMenu,checked:i},m.createElement(y1,se({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":x1(i),onSelect:Ee(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),bA="MenuItemIndicator",[yA,xce]=Qa(bA,{checked:!1}),wce=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=xce(bA,n);return m.createElement(yn,{present:r||Qp(i.checked)||i.checked===!0},m.createElement(We.span,se({},o,{ref:t,"data-state":x1(i.checked)})))}),_ce=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(We.div,se({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),Sce="MenuSub",[Ghe,xA]=Qa(Sce),qh="MenuSubTrigger",Cce=m.forwardRef((e,t)=>{const n=Ja(qh,e.__scopeMenu),r=uf(qh,e.__scopeMenu),o=xA(qh,e.__scopeMenu),i=v1(qh,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>u,[u]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),m.createElement(pA,se({asChild:!0},c),m.createElement(vA,se({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":wA(n.open)},e,{ref:cg(t,o.onTriggerChange),onClick:f=>{var g;(g=e.onClick)===null||g===void 0||g.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Ee(e.onPointerMove,xd(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Ee(e.onPointerLeave,xd(f=>{var g;u();const p=(g=n.content)===null||g===void 0?void 0:g.getBoundingClientRect();if(p){var v;const y=(v=n.content)===null||v===void 0?void 0:v.dataset.side,x=y==="right",w=x?-5:5,_=p[x?"left":"right"],S=p[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+w,y:f.clientY},{x:_,y:p.top},{x:S,y:p.top},{x:S,y:p.bottom},{x:_,y:p.bottom}],side:y}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Ee(e.onKeyDown,f=>{const g=i.searchRef.current!=="";if(!(e.disabled||g&&f.key===" ")&&Jle[r.dir].includes(f.key)){var p;n.onOpenChange(!0),(p=n.content)===null||p===void 0||p.focus(),f.preventDefault()}})})))}),Ece="MenuSubContent",Rce=m.forwardRef((e,t)=>{const n=mA(Oo,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Ja(Oo,e.__scopeMenu),s=uf(Oo,e.__scopeMenu),a=xA(Ece,e.__scopeMenu),l=m.useRef(null),c=st(t,l);return m.createElement(yd.Provider,{scope:e.__scopeMenu},m.createElement(yn,{present:r||i.open},m.createElement(yd.Slot,{scope:e.__scopeMenu},m.createElement(b1,se({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Ee(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Ee(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Ee(e.onKeyDown,u=>{const f=u.currentTarget.contains(u.target),g=Zle[s.dir].includes(u.key);if(f&&g){var p;i.onOpenChange(!1),(p=a.trigger)===null||p===void 0||p.focus(),u.preventDefault()}})})))))});function wA(e){return e?"open":"closed"}function Qp(e){return e==="indeterminate"}function x1(e){return Qp(e)?"indeterminate":e?"checked":"unchecked"}function Pce(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Oce(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function $ce(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Oce(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Dce(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function Tce(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Dce(n,t)}function xd(e){return t=>t.pointerType==="mouse"?e(t):void 0}const kce=oce,Mce=pA,Ace=sce,Ice=lce,Nce=fce,Lce=y1,Fce=hce,zce=vce,jce=yce,Bce=wce,Vce=_ce,Hce=Cce,Wce=Rce,_A="DropdownMenu",[Uce,Yhe]=Dn(_A,[fA]),qr=fA(),[qce,SA]=Uce(_A),Gce=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=qr(t),c=m.useRef(null),[u=!1,f]=Yn({prop:o,defaultProp:i,onChange:s});return m.createElement(qce,{scope:t,triggerId:vr(),triggerRef:c,contentId:vr(),open:u,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(g=>!g),[f]),modal:a},m.createElement(kce,se({},l,{open:u,onOpenChange:f,dir:r,modal:a}),n))},Yce="DropdownMenuTrigger",Kce=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=SA(Yce,n),s=qr(n);return m.createElement(Mce,se({asChild:!0},s),m.createElement(We.button,se({type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r},o,{ref:cg(t,i.triggerRef),onPointerDown:Ee(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Ee(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),Xce=e=>{const{__scopeDropdownMenu:t,...n}=e,r=qr(t);return m.createElement(Ace,se({},r,n))},Qce="DropdownMenuContent",Jce=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=SA(Qce,n),i=qr(n),s=m.useRef(!1);return m.createElement(Ice,se({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:Ee(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Ee(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),Zce=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qr(n);return m.createElement(Nce,se({},o,r,{ref:t}))}),eue=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qr(n);return m.createElement(Lce,se({},o,r,{ref:t}))}),tue=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qr(n);return m.createElement(Fce,se({},o,r,{ref:t}))}),nue=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qr(n);return m.createElement(zce,se({},o,r,{ref:t}))}),rue=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qr(n);return m.createElement(jce,se({},o,r,{ref:t}))}),oue=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qr(n);return m.createElement(Bce,se({},o,r,{ref:t}))}),iue=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qr(n);return m.createElement(Vce,se({},o,r,{ref:t}))}),sue=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qr(n);return m.createElement(Hce,se({},o,r,{ref:t}))}),aue=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=qr(n);return m.createElement(Wce,se({},o,r,{ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}}))}),lue=Gce,cue=Kce,uue=Xce,CA=Jce,EA=Zce,RA=eue,PA=tue,due=nue,OA=rue,$A=oue,DA=iue,TA=sue,kA=aue,fue=lue,hue=cue,pue=due,gue=fe.forwardRef(({className:e,inset:t,children:n,...r},o)=>N.jsxs(TA,{ref:o,className:Oe("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,N.jsx(nT,{className:"ml-auto h-4 w-4"})]}));gue.displayName=TA.displayName;const mue=fe.forwardRef(({className:e,...t},n)=>N.jsx(kA,{ref:n,className:Oe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));mue.displayName=kA.displayName;const MA=fe.forwardRef(({className:e,sideOffset:t=4,...n},r)=>N.jsx(uue,{children:N.jsx(CA,{ref:r,sideOffset:t,className:Oe("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));MA.displayName=CA.displayName;const vue=fe.forwardRef(({className:e,inset:t,...n},r)=>N.jsx(RA,{ref:r,className:Oe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));vue.displayName=RA.displayName;const bue=fe.forwardRef(({className:e,children:t,checked:n,...r},o)=>N.jsxs(PA,{ref:o,className:Oe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[N.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:N.jsx($A,{children:N.jsx(Zd,{className:"h-4 w-4"})})}),t]}));bue.displayName=PA.displayName;const AA=fe.forwardRef(({className:e,children:t,...n},r)=>N.jsxs(OA,{ref:r,className:Oe("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[N.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:N.jsx($A,{children:N.jsx(rT,{className:"h-2 w-2 fill-current"})})}),t]}));AA.displayName=OA.displayName;const IA=fe.forwardRef(({className:e,inset:t,...n},r)=>N.jsx(EA,{ref:r,className:Oe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));IA.displayName=EA.displayName;const NA=fe.forwardRef(({className:e,...t},n)=>N.jsx(DA,{ref:n,className:Oe("-mx-1 my-1 h-px bg-muted",e),...t}));NA.displayName=DA.displayName;function yue(e){var t;return{...e,sheets:(t=e==null?void 0:e.sheets)==null?void 0:t.map(n=>{var r;return{...n,frames:(r=n.frames)==null?void 0:r.map(o=>{var i;return{...o,cards:(i=o.cards)==null?void 0:i.map(s=>LA(s))}})}})}}function LA(e){var t,n,r,o;return{...e,cfg:{...e.cfg,data:{...(t=e.cfg)==null?void 0:t.data,labels:[],datasets:(o=(r=(n=e.cfg)==null?void 0:n.data)==null?void 0:r.datasets)==null?void 0:o.map(i=>({...i,data:[]}))}},customCfg:xue(e.customCfg),data:[]}}function xue(e){var t,n;return e?{...e,data:{...e==null?void 0:e.data,labels:[],datasets:(n=(t=e==null?void 0:e.data)==null?void 0:t.datasets)==null?void 0:n.map(r=>({...r,data:[]}))}}:null}function FA(e){return`semaphor:bookmark:${e}`}const zA="Dialog",[jA,Khe]=Dn(zA),[wue,To]=jA(zA),_ue=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=m.useRef(null),l=m.useRef(null),[c=!1,u]=Yn({prop:r,defaultProp:o,onChange:i});return m.createElement(wue,{scope:t,triggerRef:a,contentRef:l,contentId:vr(),titleId:vr(),descriptionId:vr(),open:c,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(f=>!f),[u]),modal:s},n)},Sue="DialogTrigger",Cue=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=To(Sue,n),i=st(t,o.triggerRef);return m.createElement(We.button,se({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":w1(o.open)},r,{ref:i,onClick:Ee(e.onClick,o.onOpenToggle)}))}),BA="DialogPortal",[Eue,VA]=jA(BA,{forceMount:void 0}),Rue=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=To(BA,t);return m.createElement(Eue,{scope:t,forceMount:n},m.Children.map(r,s=>m.createElement(yn,{present:n||i.open},m.createElement(Tg,{asChild:!0,container:o},s))))},Fy="DialogOverlay",Pue=m.forwardRef((e,t)=>{const n=VA(Fy,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=To(Fy,e.__scopeDialog);return i.modal?m.createElement(yn,{present:r||i.open},m.createElement(Oue,se({},o,{ref:t}))):null}),Oue=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=To(Fy,n);return m.createElement(zg,{as:Mi,allowPinchZoom:!0,shards:[o.contentRef]},m.createElement(We.div,se({"data-state":w1(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),wd="DialogContent",$ue=m.forwardRef((e,t)=>{const n=VA(wd,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=To(wd,e.__scopeDialog);return m.createElement(yn,{present:r||i.open},i.modal?m.createElement(Due,se({},o,{ref:t})):m.createElement(Tue,se({},o,{ref:t})))}),Due=m.forwardRef((e,t)=>{const n=To(wd,e.__scopeDialog),r=m.useRef(null),o=st(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return Lg(i)},[]),m.createElement(HA,se({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ee(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:Ee(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:Ee(e.onFocusOutside,i=>i.preventDefault())}))}),Tue=m.forwardRef((e,t)=>{const n=To(wd,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(HA,se({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=e.onCloseAutoFocus)===null||s===void 0||s.call(e,i),!i.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),i.preventDefault()}r.current=!1,o.current=!1},onInteractOutside:i=>{var s,a;(s=e.onInteractOutside)===null||s===void 0||s.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const l=i.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}}))}),HA=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=To(wd,n),l=m.useRef(null),c=st(t,l);return Ig(),m.createElement(m.Fragment,null,m.createElement(Ng,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(xc,se({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":w1(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),kue="DialogTitle",Mue=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=To(kue,n);return m.createElement(We.h2,se({id:o.titleId},r,{ref:t}))}),Aue="DialogDescription",Iue=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=To(Aue,n);return m.createElement(We.p,se({id:o.descriptionId},r,{ref:t}))}),Nue="DialogClose",Lue=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=To(Nue,n);return m.createElement(We.button,se({type:"button"},r,{ref:t,onClick:Ee(e.onClick,()=>o.onOpenChange(!1))}))});function w1(e){return e?"open":"closed"}const Fue=_ue,zue=Cue,jue=Rue,WA=Pue,UA=$ue,qA=Mue,GA=Iue,Bue=Lue,Vue=Fue,Hue=zue,Wue=jue,YA=fe.forwardRef(({className:e,...t},n)=>N.jsx(WA,{ref:n,className:Oe("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));YA.displayName=WA.displayName;const KA=fe.forwardRef(({className:e,children:t,...n},r)=>N.jsxs(Wue,{children:[N.jsx(YA,{}),N.jsxs(UA,{ref:r,className:Oe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,N.jsxs(Bue,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[N.jsx(lw,{className:"h-4 w-4"}),N.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));KA.displayName=UA.displayName;const XA=({className:e,...t})=>N.jsx("div",{className:Oe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});XA.displayName="DialogHeader";const QA=({className:e,...t})=>N.jsx("div",{className:Oe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});QA.displayName="DialogFooter";const JA=fe.forwardRef(({className:e,...t},n)=>N.jsx(qA,{ref:n,className:Oe("text-lg font-semibold leading-none tracking-tight",e),...t}));JA.displayName=qA.displayName;const ZA=fe.forwardRef(({className:e,...t},n)=>N.jsx(GA,{ref:n,className:Oe("text-sm text-muted-foreground",e),...t}));ZA.displayName=GA.displayName;const eI="Checkbox",[Uue,Xhe]=Dn(eI),[que,Gue]=Uue(eI),Yue=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[f,g]=m.useState(null),p=st(t,S=>g(S)),v=m.useRef(!1),y=f?!!f.closest("form"):!0,[x=!1,w]=Yn({prop:o,defaultProp:i,onChange:c}),_=m.useRef(x);return m.useEffect(()=>{const S=f==null?void 0:f.form;if(S){const R=()=>w(_.current);return S.addEventListener("reset",R),()=>S.removeEventListener("reset",R)}},[f,w]),m.createElement(que,{scope:n,state:x,disabled:a},m.createElement(We.button,se({type:"button",role:"checkbox","aria-checked":$a(x)?"mixed":x,"aria-required":s,"data-state":tI(x),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:p,onKeyDown:Ee(e.onKeyDown,S=>{S.key==="Enter"&&S.preventDefault()}),onClick:Ee(e.onClick,S=>{w(R=>$a(R)?!0:!R),y&&(v.current=S.isPropagationStopped(),v.current||S.stopPropagation())})})),y&&m.createElement(Que,{control:f,bubbles:!v.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),Kue="CheckboxIndicator",Xue=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Gue(Kue,n);return m.createElement(yn,{present:r||$a(i.state)||i.state===!0},m.createElement(We.span,se({"data-state":tI(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),Que=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Vg(n),a=Dg(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});l.indeterminate=$a(n),f.call(l,$a(n)?!1:n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",se({type:"checkbox","aria-hidden":!0,defaultChecked:$a(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function $a(e){return e==="indeterminate"}function tI(e){return $a(e)?"indeterminate":e?"checked":"unchecked"}const nI=Yue,Jue=Xue,rI=fe.forwardRef(({className:e,...t},n)=>N.jsx(nI,{ref:n,className:Oe("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:N.jsx(Jue,{className:Oe("flex items-center justify-center text-current"),children:N.jsx(Zd,{className:"h-4 w-4"})})}));rI.displayName=nI.displayName;const oI=m.forwardRef(({className:e,...t},n)=>N.jsx("div",{role:"editor-panel",ref:n,className:Oe("flex grow h-full",e),...t}));oI.displayName="EditorPanel";const iI=m.forwardRef(({className:e,...t},n)=>N.jsx("div",{ref:n,className:Oe(" flex flex-col space-y-2 w-[270px]",e),...t}));iI.displayName="EditorAside";const sI=m.forwardRef(({className:e,...t},n)=>N.jsx("div",{ref:n,className:Oe(" grow",e),...t}));sI.displayName="EditorMain";const Zue=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=Yn({prop:n,onChange:o,defaultProp:r});return m.createElement(We.button,se({type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0},i,{ref:t,onClick:Ee(e.onClick,()=>{e.disabled||a(!s)})}))}),aI=Zue,ede=ww("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),lI=fe.forwardRef(({className:e,variant:t,size:n,...r},o)=>N.jsx(aI,{ref:o,className:Oe(ede({variant:t,size:n,className:e})),...r}));lI.displayName=aI.displayName;const{createElement:mc,createContext:tde,createRef:Qhe,forwardRef:cI,useCallback:Dr,useContext:uI,useEffect:Da,useImperativeHandle:dI,useLayoutEffect:nde,useMemo:rde,useRef:co,useState:Jp}=fe,bO=fe.useId,im=tde(null);im.displayName="PanelGroupContext";const _d=nde,ode=typeof bO=="function"?bO:()=>null;let ide=0;function _1(e=null){const t=ode(),n=co(e||t||null);return n.current===null&&(n.current=""+ide++),e??n.current}function fI({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:f,order:g,style:p,tagName:v="div",...y}){const x=uI(im);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:_,getPanelSize:S,getPanelStyle:R,groupId:E,isPanelCollapsed:O,registerPanel:k,resizePanel:T,unregisterPanel:M}=x,F=_1(s),z=co({callbacks:{onCollapse:c,onExpand:u,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:F,idIsFromProps:s!==void 0,order:g});co({didLogMissingDefaultSizeWarning:!1}),_d(()=>{const{callbacks:Y,constraints:G}=z.current;z.current.id=F,z.current.idIsFromProps=s!==void 0,z.current.order=g,Y.onCollapse=c,Y.onExpand=u,Y.onResize=f,G.collapsedSize=n,G.collapsible=r,G.defaultSize=o,G.maxSize=a,G.minSize=l}),_d(()=>{const Y=z.current;return k(Y),()=>{M(Y)}},[g,F,k,M]),dI(i,()=>({collapse:()=>{w(z.current)},expand:()=>{_(z.current)},getId(){return F},getSize(){return S(z.current)},isCollapsed(){return O(z.current)},isExpanded(){return!O(z.current)},resize:Y=>{T(z.current,Y)}}),[w,_,S,O,F,T]);const B=R(z.current,o);return mc(v,{...y,children:e,className:t,style:{...B,...p},"data-panel":"","data-panel-id":F,"data-panel-group-id":E,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const hI=cI((e,t)=>mc(fI,{...e,forwardedRef:t}));fI.displayName="Panel";hI.displayName="forwardRef(Panel)";function ut(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const pI=10;function Sd(e,t,n=pI){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function Ar(e,t,n){return Sd(e,t,n)===0}function Ml({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];ut(r!=null);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(Sd(n,a)<0)if(i){const l=(o+a)/2;Sd(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(pI)),n}function wu({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:o}){if(Ar(e,0))return t;const i=[...t],[s,a]=r;ut(s!=null),ut(a!=null);let l=0;if(o==="keyboard"){{const u=e<0?a:s,f=n[u];if(ut(f),f.collapsible){const g=t[u];ut(g!=null);const p=n[u];ut(p);const{collapsedSize:v=0,minSize:y=0}=p;if(Ar(g,v)){const x=y-g;Sd(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const u=e<0?s:a,f=n[u];ut(f);const{collapsible:g}=f;if(g){const p=t[u];ut(p!=null);const v=n[u];ut(v);const{collapsedSize:y=0,minSize:x=0}=v;if(Ar(p,x)){const w=p-y;Sd(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}}{const u=e<0?1:-1;let f=e<0?a:s,g=0;for(;;){const v=t[f];ut(v!=null);const x=Ml({panelConstraints:n,panelIndex:f,size:100})-v;if(g+=x,f+=u,f<0||f>=n.length)break}const p=Math.min(Math.abs(e),Math.abs(g));e=e<0?0-p:p}{let f=e<0?s:a;for(;f>=0&&f<n.length;){const g=Math.abs(e)-Math.abs(l),p=t[f];ut(p!=null);const v=p-g,y=Ml({panelConstraints:n,panelIndex:f,size:v});if(!Ar(p,y)&&(l+=p-y,i[f]=y,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(Ar(l,0))return t;{const u=e<0?a:s,f=t[u];ut(f!=null);const g=f+l,p=Ml({panelConstraints:n,panelIndex:u,size:g});if(i[u]=p,!Ar(p,g)){let v=g-p,x=e<0?a:s;for(;x>=0&&x<n.length;){const w=i[x];ut(w!=null);const _=w+v,S=Ml({panelConstraints:n,panelIndex:x,size:_});if(Ar(w,S)||(v-=S-w,i[x]=S),Ar(v,0))break;e>0?x--:x++}}}const c=i.reduce((u,f)=>f+u,0);return Ar(c,100)?i:t}function sde({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];ut(a!=null),t.forEach((f,g)=>{const{constraints:p}=f,{maxSize:v=100,minSize:y=0}=p;g===a?(r=y,o=v):(i+=y,s+=v)});const l=Math.min(o,100-i),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function Cd(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function gI(e,t){const r=Cd(e).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return r??null}function mI(e,t){const n=gI(e,t);return n!=null?[n,n+1]:[-1,-1]}function vI(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function sm(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function ade(e,t,n){var r,o,i,s;const a=sm(t),l=Cd(e),c=a?l.indexOf(a):-1,u=(r=(o=n[c])===null||o===void 0?void 0:o.id)!==null&&r!==void 0?r:null,f=(i=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null;return[u,f]}function lde({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,setLayout:i}){co({didWarnAboutMissingResizeHandle:!1}),_d(()=>{const s=Cd(n);for(let a=0;a<o.length-1;a++){const{valueMax:l,valueMin:c,valueNow:u}=sde({layout:r,panelsArray:o,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const g=o[a];ut(g),f.setAttribute("aria-controls",g.id),f.setAttribute("aria-valuemax",""+Math.round(l)),f.setAttribute("aria-valuemin",""+Math.round(c)),f.setAttribute("aria-valuenow",u!=null?""+Math.round(u):"")}}return()=>{s.forEach((a,l)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,o]),Da(()=>{const s=t.current;ut(s);const{panelDataArray:a}=s,l=vI(n);ut(l!=null,`No group found for id "${n}"`);const c=Cd(n);ut(c);const u=c.map(f=>{const g=f.getAttribute("data-panel-resize-handle-id");ut(g);const[p,v]=ade(n,g,a);if(p==null||v==null)return()=>{};const y=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const w=a.findIndex(_=>_.id===p);if(w>=0){const _=a[w];ut(_);const S=r[w],{collapsedSize:R=0,collapsible:E,minSize:O=0}=_.constraints;if(S!=null&&E){const k=wu({delta:Ar(S,R)?O-R:R-S,layout:r,panelConstraints:a.map(T=>T.constraints),pivotIndices:mI(n,g),trigger:"keyboard"});r!==k&&i(k)}}break}}};return f.addEventListener("keydown",y),()=>{f.removeEventListener("keydown",y)}});return()=>{u.forEach(f=>f())}},[e,t,n,r,o,i])}function yO(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function bI(e){return e.type==="keydown"}function yI(e){return e.type.startsWith("mouse")}function xI(e){return e.type.startsWith("touch")}function wI(e,t){const n=e==="horizontal";if(yI(t))return n?t.clientX:t.clientY;if(xI(t)){const r=t.touches[0];return ut(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function cde(e,t,n,r){const o=n==="horizontal",i=sm(t);ut(i);const s=i.getAttribute("data-panel-group-id");ut(s);let{initialCursorPosition:a}=r;const l=wI(n,e),c=vI(s);ut(c);const u=c.getBoundingClientRect(),f=o?u.width:u.height;return(l-a)/f*100}function ude(e,t,n,r,o){if(bI(e)){const i=n==="horizontal";let s=0;e.shiftKey?s=100:o!=null?s=o:s=10;let a=0;switch(e.key){case"ArrowDown":a=i?0:s;break;case"ArrowLeft":a=i?-s:0;break;case"ArrowRight":a=i?s:0;break;case"ArrowUp":a=i?0:-s;break;case"End":a=100;break;case"Home":a=-100;break}return a}else return r==null?0:cde(e,t,n,r)}function dde({panelDataArray:e}){const t=Array(e.length),n=e.map(i=>i.constraints);let r=0,o=100;for(let i=0;i<e.length;i++){const s=n[i];ut(s);const{defaultSize:a}=s;a!=null&&(r++,t[i]=a,o-=a)}for(let i=0;i<e.length;i++){const s=n[i];ut(s);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=o/l;r++,t[i]=c,o-=c}return t}function Pl(e,t,n){t.forEach((r,o)=>{const i=e[o];ut(i);const{callbacks:s,constraints:a,id:l}=i,{collapsedSize:c=0,collapsible:u}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:g,onExpand:p,onResize:v}=s;v&&v(r,f),u&&(g||p)&&(p&&(f==null||f===c)&&r!==c&&p(),g&&(f==null||f!==c)&&r===c&&g())}})}function Gh(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function fde({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const s=n[o];let a;return s==null?a=e??"1":r.length===1?a="1":a=s.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}let zy=null,ma=null;function _I(e){switch(e){case"horizontal":return"ew-resize";case"horizontal-max":return"w-resize";case"horizontal-min":return"e-resize";case"vertical":return"ns-resize";case"vertical-max":return"n-resize";case"vertical-min":return"s-resize"}}function hde(){ma!==null&&(document.head.removeChild(ma),zy=null,ma=null)}function Ub(e){if(zy===e)return;zy=e;const t=_I(e);ma===null&&(ma=document.createElement("style"),document.head.appendChild(ma)),ma.innerHTML=`*{cursor: ${t}!important;}`}function pde(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function xO(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function SI(e){return`react-resizable-panels:${e}`}function CI(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:o,order:i}=t;return o?r:i?`${i}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function EI(e,t){try{const n=SI(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function gde(e,t,n){var r,o;const i=(r=EI(e,n))!==null&&r!==void 0?r:{},s=CI(t);return(o=i[s])!==null&&o!==void 0?o:null}function mde(e,t,n,r,o){var i;const s=SI(e),a=CI(t),l=(i=EI(e,o))!==null&&i!==void 0?i:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function wO({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((i,s)=>i+s,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(i=>`${i}%`).join(", ")}`);if(!Ar(r,100))for(let i=0;i<t.length;i++){const s=n[i];ut(s!=null);const a=100/r*s;n[i]=a}let o=0;for(let i=0;i<t.length;i++){const s=n[i];ut(s!=null);const a=Ml({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!Ar(o,0))for(let i=0;i<t.length;i++){const s=n[i];ut(s!=null);const a=s+o,l=Ml({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,Ar(o,0)))break}return n}const vde=100,_u={getItem:e=>(xO(_u),_u.getItem(e)),setItem:(e,t)=>{xO(_u),_u.setItem(e,t)}},_O={};function RI({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=_u,style:c,tagName:u="div",...f}){const g=_1(i),[p,v]=Jp(null),[y,x]=Jp([]),w=co({}),_=co(new Map),S=co(0),R=co({autoSaveId:e,direction:r,dragState:p,id:g,keyboardResizeBy:a,onLayout:s,storage:l}),E=co({layout:y,panelDataArray:[],panelDataArrayChanged:!1});co({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),dI(o,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:$}=E.current;return $},setLayout:$=>{const{onLayout:H}=R.current,{layout:ne,panelDataArray:I}=E.current,ce=wO({layout:$,panelConstraints:I.map(ge=>ge.constraints)});yO(ne,ce)||(x(ce),E.current.layout=ce,H&&H(ce),Pl(I,ce,w.current))}}),[]),_d(()=>{R.current.autoSaveId=e,R.current.direction=r,R.current.dragState=p,R.current.id=g,R.current.onLayout=s,R.current.storage=l}),lde({committedValuesRef:R,eagerValuesRef:E,groupId:g,layout:y,panelDataArray:E.current.panelDataArray,setLayout:x}),Da(()=>{const{panelDataArray:$}=E.current;if(e){if(y.length===0||y.length!==$.length)return;let H=_O[e];H==null&&(H=pde(mde,vde),_O[e]=H);const ne=[...$],I=new Map(_.current);H(e,ne,I,y,l)}},[e,y,l]),Da(()=>{});const O=Dr($=>{const{onLayout:H}=R.current,{layout:ne,panelDataArray:I}=E.current;if($.constraints.collapsible){const ce=I.map(oe=>oe.constraints),{collapsedSize:ge=0,panelSize:he,pivotIndices:de}=Ol(I,$,ne);if(ut(he!=null),he!==ge){_.current.set($.id,he);const Z=Dl(I,$)===I.length-1?he-ge:ge-he,ie=wu({delta:Z,layout:ne,panelConstraints:ce,pivotIndices:de,trigger:"imperative-api"});Gh(ne,ie)||(x(ie),E.current.layout=ie,H&&H(ie),Pl(I,ie,w.current))}}},[]),k=Dr($=>{const{onLayout:H}=R.current,{layout:ne,panelDataArray:I}=E.current;if($.constraints.collapsible){const ce=I.map(Z=>Z.constraints),{collapsedSize:ge=0,panelSize:he,minSize:de=0,pivotIndices:oe}=Ol(I,$,ne);if(he===ge){const Z=_.current.get($.id),ie=Z!=null&&Z>=de?Z:de,W=Dl(I,$)===I.length-1?he-ie:ie-he,me=wu({delta:W,layout:ne,panelConstraints:ce,pivotIndices:oe,trigger:"imperative-api"});Gh(ne,me)||(x(me),E.current.layout=me,H&&H(me),Pl(I,me,w.current))}}},[]),T=Dr($=>{const{layout:H,panelDataArray:ne}=E.current,{panelSize:I}=Ol(ne,$,H);return ut(I!=null),I},[]),M=Dr(($,H)=>{const{panelDataArray:ne}=E.current,I=Dl(ne,$);return fde({defaultSize:H,dragState:p,layout:y,panelData:ne,panelIndex:I})},[p,y]),F=Dr($=>{const{layout:H,panelDataArray:ne}=E.current,{collapsedSize:I=0,collapsible:ce,panelSize:ge}=Ol(ne,$,H);return ce===!0&&ge===I},[]),z=Dr($=>{const{layout:H,panelDataArray:ne}=E.current,{collapsedSize:I=0,collapsible:ce,panelSize:ge}=Ol(ne,$,H);return ut(ge!=null),!ce||ge>I},[]),B=Dr($=>{const{panelDataArray:H}=E.current;H.push($),H.sort((ne,I)=>{const ce=ne.order,ge=I.order;return ce==null&&ge==null?0:ce==null?-1:ge==null?1:ce-ge}),E.current.panelDataArrayChanged=!0},[]);_d(()=>{if(E.current.panelDataArrayChanged){E.current.panelDataArrayChanged=!1;const{autoSaveId:$,onLayout:H,storage:ne}=R.current,{layout:I,panelDataArray:ce}=E.current;let ge=null;if($){const de=gde($,ce,ne);de&&(_.current=new Map(Object.entries(de.expandToSizes)),ge=de.layout)}ge==null&&(ge=dde({panelDataArray:ce}));const he=wO({layout:ge,panelConstraints:ce.map(de=>de.constraints)});yO(I,he)||(x(he),E.current.layout=he,H&&H(he),Pl(ce,he,w.current))}});const Y=Dr($=>function(ne){ne.preventDefault();const{direction:I,dragState:ce,id:ge,keyboardResizeBy:he,onLayout:de}=R.current,{layout:oe,panelDataArray:Z}=E.current,{initialLayout:ie}=ce??{},ye=mI(ge,$);let W=ude(ne,$,I,ce,he);if(W===0)return;const me=I==="horizontal";document.dir==="rtl"&&me&&(W=-W);const _e=Z.map(Ue=>Ue.constraints),Pe=wu({delta:W,layout:ie??oe,panelConstraints:_e,pivotIndices:ye,trigger:bI(ne)?"keyboard":"mouse-or-touch"}),$e=!Gh(oe,Pe);(yI(ne)||xI(ne))&&S.current!=W&&(S.current=W,Ub($e?me?"horizontal":"vertical":me?W<0?"horizontal-min":"horizontal-max":W<0?"vertical-min":"vertical-max")),$e&&(x(Pe),E.current.layout=Pe,de&&de(Pe),Pl(Z,Pe,w.current))},[]),G=Dr(($,H)=>{const{onLayout:ne}=R.current,{layout:I,panelDataArray:ce}=E.current,ge=ce.map(ye=>ye.constraints),{panelSize:he,pivotIndices:de}=Ol(ce,$,I);ut(he!=null);const Z=Dl(ce,$)===ce.length-1?he-H:H-he,ie=wu({delta:Z,layout:I,panelConstraints:ge,pivotIndices:de,trigger:"imperative-api"});Gh(I,ie)||(x(ie),E.current.layout=ie,ne&&ne(ie),Pl(ce,ie,w.current))},[]),j=Dr(($,H)=>{const{direction:ne}=R.current,{layout:I}=E.current,ce=sm($);ut(ce);const ge=wI(ne,H);v({dragHandleId:$,dragHandleRect:ce.getBoundingClientRect(),initialCursorPosition:ge,initialLayout:I})},[]),ee=Dr(()=>{hde(),v(null)},[]),q=Dr($=>{const{panelDataArray:H}=E.current,ne=Dl(H,$);ne>=0&&(H.splice(ne,1),delete w.current[$.id],E.current.panelDataArrayChanged=!0)},[]),X=rde(()=>({collapsePanel:O,direction:r,dragState:p,expandPanel:k,getPanelSize:T,getPanelStyle:M,groupId:g,isPanelCollapsed:F,isPanelExpanded:z,registerPanel:B,registerResizeHandle:Y,resizePanel:G,startDragging:j,stopDragging:ee,unregisterPanel:q}),[O,p,r,k,T,M,g,F,z,B,Y,G,j,ee,q]),re={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return mc(im.Provider,{value:X},mc(u,{...f,children:t,className:n,style:{...re,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":g}))}const PI=cI((e,t)=>mc(RI,{...e,forwardedRef:t}));RI.displayName="PanelGroup";PI.displayName="forwardRef(PanelGroup)";function Dl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Ol(e,t,n){const r=e.map(c=>c.constraints),o=Dl(e,t),i=r[o],a=o===e.length-1?[o-1,o]:[o,o+1],l=n[o];return{...i,panelSize:l,pivotIndices:a}}function bde({disabled:e,handleId:t,resizeHandler:n}){Da(()=>{if(e||n==null)return;const r=sm(t);if(r==null)return;const o=i=>{if(!i.defaultPrevented)switch(i.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{i.preventDefault(),n(i);break}case"F6":{i.preventDefault();const s=r.getAttribute("data-panel-group-id");ut(s);const a=Cd(s),l=gI(s,t);ut(l!==null);const c=i.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[c].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function OI({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:o,style:i={},tabIndex:s=0,tagName:a="div",...l}){const c=co(null),u=co({onDragging:o});Da(()=>{u.current.onDragging=o});const f=uI(im);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:g,dragState:p,groupId:v,registerResizeHandle:y,startDragging:x,stopDragging:w}=f,_=_1(r),S=(p==null?void 0:p.dragHandleId)===_,[R,E]=Jp(!1),[O,k]=Jp(null),T=Dr(()=>{const F=c.current;ut(F),F.blur(),w();const{onDragging:z}=u.current;z&&z(!1)},[w]);Da(()=>{if(n)k(null);else{const F=y(_);k(()=>F)}},[n,_,y]),Da(()=>{if(n||O==null||!S)return;const F=G=>{O(G)},z=G=>{O(G)},B=c.current;ut(B);const Y=B.ownerDocument;return Y.body.addEventListener("contextmenu",T),Y.body.addEventListener("mousemove",F),Y.body.addEventListener("touchmove",F),Y.body.addEventListener("mouseleave",z),window.addEventListener("mouseup",T),window.addEventListener("touchend",T),()=>{Y.body.removeEventListener("contextmenu",T),Y.body.removeEventListener("mousemove",F),Y.body.removeEventListener("touchmove",F),Y.body.removeEventListener("mouseleave",z),window.removeEventListener("mouseup",T),window.removeEventListener("touchend",T)}},[g,n,S,O,T]),bde({disabled:n,handleId:_,resizeHandler:O});const M={cursor:_I(g),touchAction:"none",userSelect:"none"};return mc(a,{...l,children:e,className:t,onBlur:()=>E(!1),onFocus:()=>E(!0),onMouseDown:F=>{x(_,F.nativeEvent);const z=u.current;ut(z);const{onDragging:B}=z;B&&B(!0)},onMouseUp:T,onTouchCancel:T,onTouchEnd:T,onTouchStart:F=>{x(_,F.nativeEvent);const z=u.current;ut(z);const{onDragging:B}=z;B&&B(!0)},ref:c,role:"separator",style:{...M,...i},tabIndex:s,"data-panel-group-direction":g,"data-panel-group-id":v,"data-resize-handle":"","data-resize-handle-active":S?"pointer":R?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":_})}OI.displayName="PanelResizeHandle";function yde(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function CO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SO(Object(n),!0).forEach(function(r){yde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xde(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function wde(e,t){if(e==null)return{};var n=xde(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _de(e,t){return Sde(e)||Cde(e,t)||Ede(e,t)||Rde()}function Sde(e){if(Array.isArray(e))return e}function Cde(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var s=e[Symbol.iterator](),a;!(r=(a=s.next()).done)&&(n.push(a.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&s.return!=null&&s.return()}finally{if(o)throw i}}return n}}function Ede(e,t){if(e){if(typeof e=="string")return EO(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return EO(e,t)}}function EO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Rde(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
375
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pde(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function PO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RO(Object(n),!0).forEach(function(r){Pde(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RO(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ode(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(o,i){return i(o)},r)}}function Su(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(o,a))}}}function Zp(e){return{}.toString.call(e).includes("Object")}function $de(e){return!Object.keys(e).length}function Ed(e){return typeof e=="function"}function Dde(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Tde(e,t){return Zp(t)||Ss("changeType"),Object.keys(t).some(function(n){return!Dde(e,n)})&&Ss("changeField"),t}function kde(e){Ed(e)||Ss("selectorType")}function Mde(e){Ed(e)||Zp(e)||Ss("handlerType"),Zp(e)&&Object.values(e).some(function(t){return!Ed(t)})&&Ss("handlersType")}function Ade(e){e||Ss("initialIsRequired"),Zp(e)||Ss("initialType"),$de(e)&&Ss("initialContent")}function Ide(e,t){throw new Error(e[t]||e.default)}var Nde={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},Ss=Su(Ide)(Nde),Yh={changes:Tde,selector:kde,handler:Mde,initial:Ade};function Lde(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Yh.initial(e),Yh.handler(t);var n={current:e},r=Su(jde)(n,t),o=Su(zde)(n),i=Su(Yh.changes)(e),s=Su(Fde)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return Yh.selector(c),c(n.current)}function l(c){Ode(r,o,i,s)(c)}return[a,l]}function Fde(e,t){return Ed(t)?t(e.current):t}function zde(e,t){return e.current=PO(PO({},e.current),t),t}function jde(e,t,n){return Ed(t)?t(e.current):Object.keys(n).forEach(function(r){var o;return(o=t[r])===null||o===void 0?void 0:o.call(t,e.current[r])}),n}var Bde={create:Lde},Vde={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function Hde(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return o.length>=e.length?e.apply(this,o):function(){for(var s=arguments.length,a=new Array(s),l=0;l<s;l++)a[l]=arguments[l];return t.apply(n,[].concat(o,a))}}}function Wde(e){return{}.toString.call(e).includes("Object")}function Ude(e){return e||OO("configIsRequired"),Wde(e)||OO("configType"),e.urls?(qde(),{paths:{vs:e.urls.monacoBase}}):e}function qde(){console.warn($I.deprecation)}function Gde(e,t){throw new Error(e[t]||e.default)}var $I={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
376
+ You are using deprecated way of configuration.
377
+
378
+ Instead of using
379
+ monaco.config({ urls: { monacoBase: '...' } })
380
+ use
381
+ monaco.config({ paths: { vs: '...' } })
382
+
383
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
384
+ `},OO=Hde(Gde)($I),Yde={config:Ude},Kde=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(i,s){return s(i)},o)}};function DI(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],DI(e[n],t[n]))}),CO(CO({},e),t)}var Xde={type:"cancelation",msg:"operation is manually canceled"};function qb(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(Xde):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var Qde=Bde.create({config:Vde,isInitialized:!1,resolve:null,reject:null,monaco:null}),TI=_de(Qde,2),df=TI[0],am=TI[1];function Jde(e){var t=Yde.config(e),n=t.monaco,r=wde(t,["monaco"]);am(function(o){return{config:DI(o.config,r),monaco:n}})}function Zde(){var e=df(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(am({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),qb(Gb);if(window.monaco&&window.monaco.editor)return kI(window.monaco),e.resolve(window.monaco),qb(Gb);Kde(efe,nfe)(rfe)}return qb(Gb)}function efe(e){return document.body.appendChild(e)}function tfe(e){var t=document.createElement("script");return e&&(t.src=e),t}function nfe(e){var t=df(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=tfe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function rfe(){var e=df(function(n){var r=n.config,o=n.resolve,i=n.reject;return{config:r,resolve:o,reject:i}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){kI(n),e.resolve(n)},function(n){e.reject(n)})}function kI(e){df().monaco||am({monaco:e})}function ofe(){return df(function(e){var t=e.monaco;return t})}var Gb=new Promise(function(e,t){return am({resolve:e,reject:t})}),MI={config:Jde,init:Zde,__getMonacoInstance:ofe},ife={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Yb=ife,sfe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},afe=sfe;function lfe({children:e}){return m.createElement("div",{style:afe.container},e)}var cfe=lfe,ufe=cfe;function dfe({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return m.createElement("section",{style:{...Yb.wrapper,width:e,height:t},...s},!n&&m.createElement(ufe,null,r),m.createElement("div",{ref:o,style:{...Yb.fullWidth,...!n&&Yb.hide},className:i}))}var ffe=dfe,AI=m.memo(ffe);function hfe(e){m.useEffect(e,[])}var II=hfe;function pfe(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var Nr=pfe;function Lu(){}function Al(e,t,n,r){return gfe(e,r)||mfe(e,t,n,r)}function gfe(e,t){return e.editor.getModel(NI(e,t))}function mfe(e,t,n,r){return e.editor.createModel(t,n,r?NI(e,r):void 0)}function NI(e,t){return e.Uri.parse(t)}function vfe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:f={},height:g="100%",width:p="100%",className:v,wrapperProps:y={},beforeMount:x=Lu,onMount:w=Lu}){let[_,S]=m.useState(!1),[R,E]=m.useState(!0),O=m.useRef(null),k=m.useRef(null),T=m.useRef(null),M=m.useRef(w),F=m.useRef(x),z=m.useRef(!1);II(()=>{let j=MI.init();return j.then(ee=>(k.current=ee)&&E(!1)).catch(ee=>(ee==null?void 0:ee.type)!=="cancelation"&&console.error("Monaco initialization: error:",ee)),()=>O.current?G():j.cancel()}),Nr(()=>{if(O.current&&k.current){let j=O.current.getOriginalEditor(),ee=Al(k.current,e||"",r||n||"text",i||"");ee!==j.getModel()&&j.setModel(ee)}},[i],_),Nr(()=>{if(O.current&&k.current){let j=O.current.getModifiedEditor(),ee=Al(k.current,t||"",o||n||"text",s||"");ee!==j.getModel()&&j.setModel(ee)}},[s],_),Nr(()=>{let j=O.current.getModifiedEditor();j.getOption(k.current.editor.EditorOption.readOnly)?j.setValue(t||""):t!==j.getValue()&&(j.executeEdits("",[{range:j.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),j.pushUndoStop())},[t],_),Nr(()=>{var j,ee;(ee=(j=O.current)==null?void 0:j.getModel())==null||ee.original.setValue(e||"")},[e],_),Nr(()=>{let{original:j,modified:ee}=O.current.getModel();k.current.editor.setModelLanguage(j,r||n||"text"),k.current.editor.setModelLanguage(ee,o||n||"text")},[n,r,o],_),Nr(()=>{var j;(j=k.current)==null||j.editor.setTheme(c)},[c],_),Nr(()=>{var j;(j=O.current)==null||j.updateOptions(f)},[f],_);let B=m.useCallback(()=>{var q;if(!k.current)return;F.current(k.current);let j=Al(k.current,e||"",r||n||"text",i||""),ee=Al(k.current,t||"",o||n||"text",s||"");(q=O.current)==null||q.setModel({original:j,modified:ee})},[n,t,o,e,r,i,s]),Y=m.useCallback(()=>{var j;!z.current&&T.current&&(O.current=k.current.editor.createDiffEditor(T.current,{automaticLayout:!0,...f}),B(),(j=k.current)==null||j.editor.setTheme(c),S(!0),z.current=!0)},[f,c,B]);m.useEffect(()=>{_&&M.current(O.current,k.current)},[_]),m.useEffect(()=>{!R&&!_&&Y()},[R,_,Y]);function G(){var ee,q,X,re;let j=(ee=O.current)==null?void 0:ee.getModel();a||((q=j==null?void 0:j.original)==null||q.dispose()),l||((X=j==null?void 0:j.modified)==null||X.dispose()),(re=O.current)==null||re.dispose()}return m.createElement(AI,{width:p,height:g,isEditorReady:_,loading:u,_ref:T,className:v,wrapperProps:y})}var bfe=vfe;m.memo(bfe);function yfe(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var xfe=yfe,Kh=new Map;function wfe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:f=!0,keepCurrentModel:g=!1,width:p="100%",height:v="100%",className:y,wrapperProps:x={},beforeMount:w=Lu,onMount:_=Lu,onChange:S,onValidate:R=Lu}){let[E,O]=m.useState(!1),[k,T]=m.useState(!0),M=m.useRef(null),F=m.useRef(null),z=m.useRef(null),B=m.useRef(_),Y=m.useRef(w),G=m.useRef(),j=m.useRef(r),ee=xfe(i),q=m.useRef(!1),X=m.useRef(!1);II(()=>{let H=MI.init();return H.then(ne=>(M.current=ne)&&T(!1)).catch(ne=>(ne==null?void 0:ne.type)!=="cancelation"&&console.error("Monaco initialization: error:",ne)),()=>F.current?$():H.cancel()}),Nr(()=>{var ne,I,ce,ge;let H=Al(M.current,e||r||"",t||o||"",i||n||"");H!==((ne=F.current)==null?void 0:ne.getModel())&&(f&&Kh.set(ee,(I=F.current)==null?void 0:I.saveViewState()),(ce=F.current)==null||ce.setModel(H),f&&((ge=F.current)==null||ge.restoreViewState(Kh.get(i))))},[i],E),Nr(()=>{var H;(H=F.current)==null||H.updateOptions(c)},[c],E),Nr(()=>{!F.current||r===void 0||(F.current.getOption(M.current.editor.EditorOption.readOnly)?F.current.setValue(r):r!==F.current.getValue()&&(X.current=!0,F.current.executeEdits("",[{range:F.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),F.current.pushUndoStop(),X.current=!1))},[r],E),Nr(()=>{var ne,I;let H=(ne=F.current)==null?void 0:ne.getModel();H&&o&&((I=M.current)==null||I.editor.setModelLanguage(H,o))},[o],E),Nr(()=>{var H;a!==void 0&&((H=F.current)==null||H.revealLine(a))},[a],E),Nr(()=>{var H;(H=M.current)==null||H.editor.setTheme(s)},[s],E);let re=m.useCallback(()=>{var H;if(!(!z.current||!M.current)&&!q.current){Y.current(M.current);let ne=i||n,I=Al(M.current,r||e||"",t||o||"",ne||"");F.current=(H=M.current)==null?void 0:H.editor.create(z.current,{model:I,automaticLayout:!0,...c},u),f&&F.current.restoreViewState(Kh.get(ne)),M.current.editor.setTheme(s),a!==void 0&&F.current.revealLine(a),O(!0),q.current=!0}},[e,t,n,r,o,i,c,u,f,s,a]);m.useEffect(()=>{E&&B.current(F.current,M.current)},[E]),m.useEffect(()=>{!k&&!E&&re()},[k,E,re]),j.current=r,m.useEffect(()=>{var H,ne;E&&S&&((H=G.current)==null||H.dispose(),G.current=(ne=F.current)==null?void 0:ne.onDidChangeModelContent(I=>{X.current||S(F.current.getValue(),I)}))},[E,S]),m.useEffect(()=>{if(E){let H=M.current.editor.onDidChangeMarkers(ne=>{var ce;let I=(ce=F.current.getModel())==null?void 0:ce.uri;if(I&&ne.find(ge=>ge.path===I.path)){let ge=M.current.editor.getModelMarkers({resource:I});R==null||R(ge)}});return()=>{H==null||H.dispose()}}return()=>{}},[E,R]);function $(){var H,ne;(H=G.current)==null||H.dispose(),g?f&&Kh.set(i,F.current.saveViewState()):(ne=F.current.getModel())==null||ne.dispose(),F.current.dispose()}return m.createElement(AI,{width:p,height:v,isEditorReady:E,loading:l,_ref:z,className:y,wrapperProps:x})}var _fe=wfe,LI=m.memo(_fe),Sfe=LI;const FI="Collapsible",[Cfe,zI]=Dn(FI),[Efe,S1]=Cfe(FI),Rfe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=Yn({prop:r,defaultProp:o,onChange:s});return m.createElement(Efe,{scope:n,disabled:i,contentId:vr(),open:l,onOpenToggle:m.useCallback(()=>c(u=>!u),[c])},m.createElement(We.div,se({"data-state":C1(l),"data-disabled":i?"":void 0},a,{ref:t})))}),Pfe="CollapsibleTrigger",Ofe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=S1(Pfe,n);return m.createElement(We.button,se({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":C1(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:Ee(e.onClick,o.onOpenToggle)}))}),jI="CollapsibleContent",$fe=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=S1(jI,e.__scopeCollapsible);return m.createElement(yn,{present:n||o.open},({present:i})=>m.createElement(Dfe,se({},r,{ref:t,present:i})))}),Dfe=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=S1(jI,n),[a,l]=m.useState(r),c=m.useRef(null),u=st(t,c),f=m.useRef(0),g=f.current,p=m.useRef(0),v=p.current,y=s.open||a,x=m.useRef(y),w=m.useRef();return m.useEffect(()=>{const _=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(_)},[]),Gn(()=>{const _=c.current;if(_){w.current=w.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const S=_.getBoundingClientRect();f.current=S.height,p.current=S.width,x.current||(_.style.transitionDuration=w.current.transitionDuration,_.style.animationName=w.current.animationName),l(r)}},[s.open,r]),m.createElement(We.div,se({"data-state":C1(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!y},i,{ref:u,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style}}),y&&o)});function C1(e){return e?"open":"closed"}const Tfe=Rfe,kfe=Ofe,Mfe=$fe,As="Accordion",Afe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[E1,Ife,Nfe]=ug(As),[lm,Jhe]=Dn(As,[Nfe,zI]),R1=zI(),BI=m.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return m.createElement(E1.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(jfe,se({},i,{ref:t})):m.createElement(zfe,se({},o,{ref:t})))});BI.propTypes={type(e){const t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?new Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):e.type==="multiple"&&typeof t=="string"?new Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):e.type==="single"&&Array.isArray(t)?new Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};const[VI,Lfe]=lm(As),[HI,Ffe]=lm(As,{collapsible:!1}),zfe=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=Yn({prop:n,defaultProp:r,onChange:o});return m.createElement(VI,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>i&&l(""),[i,l])},m.createElement(HI,{scope:e.__scopeAccordion,collapsible:i},m.createElement(WI,se({},s,{ref:t}))))}),jfe=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=Yn({prop:n,defaultProp:r,onChange:o}),l=m.useCallback(u=>a((f=[])=>[...f,u]),[a]),c=m.useCallback(u=>a((f=[])=>f.filter(g=>g!==u)),[a]);return m.createElement(VI,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},m.createElement(HI,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(WI,se({},i,{ref:t}))))}),[Bfe,cm]=lm(As),WI=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=m.useRef(null),l=st(a,t),c=Ife(n),f=Ba(o)==="ltr",g=Ee(e.onKeyDown,p=>{var v;if(!Afe.includes(p.key))return;const y=p.target,x=c().filter(M=>{var F;return!((F=M.ref.current)!==null&&F!==void 0&&F.disabled)}),w=x.findIndex(M=>M.ref.current===y),_=x.length;if(w===-1)return;p.preventDefault();let S=w;const R=0,E=_-1,O=()=>{S=w+1,S>E&&(S=R)},k=()=>{S=w-1,S<R&&(S=E)};switch(p.key){case"Home":S=R;break;case"End":S=E;break;case"ArrowRight":i==="horizontal"&&(f?O():k());break;case"ArrowDown":i==="vertical"&&O();break;case"ArrowLeft":i==="horizontal"&&(f?k():O());break;case"ArrowUp":i==="vertical"&&k();break}const T=S%_;(v=x[T].ref.current)===null||v===void 0||v.focus()});return m.createElement(Bfe,{scope:n,disabled:r,direction:o,orientation:i},m.createElement(E1.Slot,{scope:n},m.createElement(We.div,se({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:g}))))}),jy="AccordionItem",[Vfe,P1]=lm(jy),Hfe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=cm(jy,n),s=Lfe(jy,n),a=R1(n),l=vr(),c=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return m.createElement(Vfe,{scope:n,open:c,disabled:u,triggerId:l},m.createElement(Tfe,se({"data-orientation":i.orientation,"data-state":UI(c)},a,o,{ref:t,disabled:u,open:c,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})))}),Wfe="AccordionHeader",Ufe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=cm(As,n),i=P1(Wfe,n);return m.createElement(We.h3,se({"data-orientation":o.orientation,"data-state":UI(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),$O="AccordionTrigger",qfe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=cm(As,n),i=P1($O,n),s=Ffe($O,n),a=R1(n);return m.createElement(E1.ItemSlot,{scope:n},m.createElement(kfe,se({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:t})))}),Gfe="AccordionContent",Yfe=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=cm(As,n),i=P1(Gfe,n),s=R1(n);return m.createElement(Mfe,se({role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation},s,r,{ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});function UI(e){return e?"open":"closed"}const Kfe=BI,Xfe=Hfe,Qfe=Ufe,qI=qfe,GI=Yfe,Jfe=Kfe,YI=fe.forwardRef(({className:e,...t},n)=>N.jsx(Xfe,{ref:n,className:Oe("border-b",e),...t}));YI.displayName="AccordionItem";const KI=fe.forwardRef(({className:e,children:t,...n},r)=>N.jsx(Qfe,{className:"flex",children:N.jsxs(qI,{ref:r,className:Oe("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,N.jsx(Ag,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));KI.displayName=qI.displayName;const XI=fe.forwardRef(({className:e,children:t,...n},r)=>N.jsx(GI,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:N.jsx("div",{className:Oe("pb-4 pt-0",e),children:t})}));XI.displayName=GI.displayName;const QI="Radio",[Zfe,JI]=Dn(QI),[ehe,the]=Zfe(QI),nhe=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,...c}=e,[u,f]=m.useState(null),g=st(t,y=>f(y)),p=m.useRef(!1),v=u?!!u.closest("form"):!0;return m.createElement(ehe,{scope:n,checked:o,disabled:s},m.createElement(We.button,se({type:"button",role:"radio","aria-checked":o,"data-state":ZI(o),"data-disabled":s?"":void 0,disabled:s,value:a},c,{ref:g,onClick:Ee(e.onClick,y=>{o||l==null||l(),v&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})})),v&&m.createElement(ihe,{control:u,bubbles:!p.current,name:r,value:a,checked:o,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))}),rhe="RadioIndicator",ohe=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=the(rhe,n);return m.createElement(yn,{present:r||i.checked},m.createElement(We.span,se({"data-state":ZI(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:t})))}),ihe=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Vg(n),a=Dg(t);return m.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&f){const g=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(g)}},[s,n,r]),m.createElement("input",se({type:"radio","aria-hidden":!0,defaultChecked:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function ZI(e){return e?"checked":"unchecked"}const she=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],e5="RadioGroup",[ahe,Zhe]=Dn(e5,[yc,JI]),t5=yc(),n5=JI(),[lhe,che]=ahe(e5),uhe=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:u=!0,onValueChange:f,...g}=e,p=t5(n),v=Ba(c),[y,x]=Yn({prop:i,defaultProp:o,onChange:f});return m.createElement(lhe,{scope:n,name:r,required:s,disabled:a,value:y,onValueChange:x},m.createElement(nx,se({asChild:!0},p,{orientation:l,dir:v,loop:u}),m.createElement(We.div,se({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:v},g,{ref:t}))))}),dhe="RadioGroupItem",fhe=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=che(dhe,n),s=i.disabled||r,a=t5(n),l=n5(n),c=m.useRef(null),u=st(t,c),f=i.value===o.value,g=m.useRef(!1);return m.useEffect(()=>{const p=y=>{she.includes(y.key)&&(g.current=!0)},v=()=>g.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",v),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",v)}},[]),m.createElement(rx,se({asChild:!0},a,{focusable:!s,active:f}),m.createElement(nhe,se({disabled:s,required:i.required,checked:f},l,o,{name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:Ee(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Ee(o.onFocus,()=>{var p;g.current&&((p=c.current)===null||p===void 0||p.click())})})))}),hhe=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=n5(n);return m.createElement(ohe,se({},o,r,{ref:t}))}),r5=uhe,o5=fhe,phe=hhe,i5=fe.forwardRef(({className:e,...t},n)=>N.jsx(r5,{className:Oe("grid gap-2",e),...t,ref:n}));i5.displayName=r5.displayName;const s5=fe.forwardRef(({className:e,...t},n)=>N.jsx(o5,{ref:n,className:Oe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:N.jsx(phe,{className:"flex items-center justify-center",children:N.jsx(rT,{className:"h-2.5 w-2.5 fill-current text-current"})})}));s5.displayName=o5.displayName;var ghe=Object.defineProperty,mhe=(e,t,n)=>t in e?ghe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xh=(e,t,n)=>(mhe(e,typeof t!="symbol"?t+"":t,n),n);const vhe={stringify:e=>e,parse:e=>e},bhe={stringify:e=>`${e}`,parse:e=>parseFloat(e)},yhe={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},xhe={stringify:e=>e.name,parse:(e,t)=>{const n=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof n=="function"?n.bind(t):void 0}},whe={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},Kb={string:vhe,number:bhe,boolean:yhe,function:xhe,json:whe},Xb=Symbol.for("r2wc.render"),Qh=Symbol.for("r2wc.connected"),ia=Symbol.for("r2wc.context"),os=Symbol.for("r2wc.props");function _he(e,t,n){var r,o,i;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const s=(Array.isArray(t.props)?t.props.slice():Object.keys(t.props)).filter(f=>f!=="container"),a={},l={},c={};for(const f of s){a[f]=Array.isArray(t.props)?"string":t.props[f];const g=She(f);l[f]=g,c[g]=f}class u extends HTMLElement{constructor(){super(),Xh(this,r,!0),Xh(this,o),Xh(this,i,{}),Xh(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[os].container=this.container;for(const g of s){const p=l[g],v=this.getAttribute(p),y=a[g],x=Kb[y];v&&x!=null&&x.parse&&(this[os][g]=x.parse(v,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[Qh]=!0,this[Xb]()}disconnectedCallback(){this[Qh]=!1,this[ia]&&n.unmount(this[ia]),delete this[ia]}attributeChangedCallback(g,p,v){const y=c[g],x=a[y],w=Kb[x];y in a&&w!=null&&w.parse&&(this[os][y]=w.parse(v,this),this[Xb]())}[(r=Qh,o=ia,i=os,Xb)](){this[Qh]&&(this[ia]?n.update(this[ia],this[os]):this[ia]=n.mount(this.container,e,this[os]))}}for(const f of s){const g=l[f],p=a[f];Object.defineProperty(u.prototype,f,{enumerable:!0,configurable:!0,get(){return this[os][f]},set(v){this[os][f]=v;const y=Kb[p];if(y!=null&&y.stringify){const x=y.stringify(v);this.getAttribute(g)!==x&&this.setAttribute(g,x)}}})}return u}function She(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Che(e,t,n){const r=a0(e),o=m.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function Ehe({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function Rhe({root:e}){e.unmount()}function Phe(e,t={}){return _he(e,t,{mount:Che,update:Ehe,unmount:Rhe})}const Ohe={id:"string",version:"string",authToken:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function"},$he=Phe(uA,{props:Ohe});exports.$57acba87d6e25586$export$ccf8d8d7bbf3c2cc=lM;exports.$a093c7e1ec25a057$export$8c610744efcf8a1d=KD;exports.Accordion=Jfe;exports.AccordionContent=XI;exports.AccordionItem=YI;exports.AccordionTrigger=KI;exports.BOOLEAN_DATA_TYPES=Gy;exports.Button=Po;exports.Calendar=tT;exports.Card=Jy;exports.CardContent=lg;exports.CardDescription=Zy;exports.CardFooter=ex;exports.CardHeader=ag;exports.CardTitle=Vd;exports.ChartJsVisual=Gx;exports.Check=Zd;exports.CheckIcon=$D;exports.Checkbox=rI;exports.ChevronDown=Ag;exports.ClipboardCopyIcon=hG;exports.Cross2Icon=DD;exports.DATE_DATA_TYPES=zd;exports.Dashboard=uA;exports.DashboardPanel=w$;exports.DashboardTabs=lA;exports.DashboardWC=$he;exports.Dialog=Vue;exports.DialogContent=KA;exports.DialogDescription=ZA;exports.DialogFooter=QA;exports.DialogHeader=XA;exports.DialogTitle=JA;exports.DialogTrigger=Hue;exports.DropdownMenu=fue;exports.DropdownMenuContent=MA;exports.DropdownMenuLabel=IA;exports.DropdownMenuRadioGroup=pue;exports.DropdownMenuRadioItem=AA;exports.DropdownMenuSeparator=NA;exports.DropdownMenuTrigger=hue;exports.Editable=Ma;exports.EditorAside=iI;exports.EditorMain=sI;exports.EditorPanel=oI;exports.Ft=Sfe;exports.HoverCard=hT;exports.HoverCardContent=hw;exports.HoverCardTrigger=pT;exports.InfoCircledIcon=xG;exports.Input=Xw;exports.KPICard=iT;exports.Label=So;exports.LoaderCircle=aw;exports.Markdown=aA;exports.NUMBER_DATA_TYPES=rc;exports.PYTHON_DEFAULT_CODE=i$;exports.Panel=hI;exports.PanelGroup=PI;exports.PanelResizeHandle=OI;exports.PaperPlaneIcon=_G;exports.PlayIcon=CG;exports.Popover=Sw;exports.PopoverContent=jg;exports.PopoverTrigger=Cw;exports.RadioGroup=i5;exports.RadioGroupItem=s5;exports.ScrollArea=t1;exports.ScrollBar=Zg;exports.Select=ck;exports.SelectContent=$w;exports.SelectGroup=OJ;exports.SelectItem=Au;exports.SelectLabel=hk;exports.SelectSeparator=pk;exports.SelectTrigger=Ow;exports.SelectValue=uk;exports.SemaphorContextProvider=lT;exports.SemaphorQueryClient=sT;exports.Separator=Bg;exports.Settings=oT;exports.SliderIcon=RG;exports.Switch=wM;exports.TEXT_DATA_TYPES=ig;exports.Table=pw;exports.TableBody=mw;exports.TableCell=zp;exports.TableHead=vw;exports.TableHeader=gw;exports.TableRow=Mu;exports.TableVisual=OT;exports.Tabs=M$;exports.TabsContent=ix;exports.TabsList=A$;exports.TabsTrigger=I$;exports.Textarea=Ew;exports.Toggle=lI;exports.Tooltip=JD;exports.TooltipContent=sw;exports.TooltipTrigger=ZD;exports.TriangleDownIcon=Yx;exports.TriangleUpIcon=Kx;exports.UXProvider=cA;exports.X=lw;exports._=ki;exports.cleanCard=LA;exports.cn=Oe;exports.copyToClipboard=Z4;exports.createChartConfig=cw;exports.createLucideIcon=xr;exports.createSqlGenConfig=D9;exports.de=LI;exports.flexRender=uy;exports.fmt=Yy;exports.getBookmarkKey=FA;exports.getCanvasBackgroundColor=mp;exports.getColumnDataType=T9;exports.getContrastColor=vp;exports.getCoreRowModel=CT;exports.getDashbaordStateWithoutData=yue;exports.getDefaultFilterSql=Qne;exports.getFilterValueType=bp;exports.getKeys=uo;exports.getNumberAxis=cT;exports.getPaginationRowModel=RT;exports.getQualifiedTableName=a$;exports.getRequest=J4;exports.getSortedRowModel=ET;exports.getSql=$9;exports.isColumnInSqlGen=k9;exports.jsxRuntimeExports=N;exports.pivotData=Xx;exports.postRequest=Fd;exports.resolveBaseQuery=qO;exports.resolveDataType=Bu;exports.titleCase=t9;exports.useCard=AK;exports.useDashboardActions=Li;exports.useDashboardCard=uw;exports.useDashboardStore=Te;exports.useEditorActions=TD;exports.useEditorStore=so;exports.useQuery=Bd;exports.useReactTable=PT;exports.useSemaphorContext=Ua;exports.useTheme=y$;exports.v4=Na;