react-semaphor 0.0.148 → 0.0.149

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,364 +0,0 @@
1
- "use strict";var bL=Object.defineProperty;var yL=(e,t,n)=>t in e?bL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ce=(e,t,n)=>(yL(e,typeof t!="symbol"?t+"":t,n),n),iv=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var W=(e,t,n)=>(iv(e,t,"read from private field"),n?n.call(e):t.get(e)),Oe=(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)},_e=(e,t,n,r)=>(iv(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var zf=(e,t,n,r)=>({set _(o){_e(e,t,o,n)},get _(){return W(e,t,r)}}),it=(e,t,n)=>(iv(e,t,"access private method"),n);const m=require("react"),Ao=require("react-dom");function r$(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 ie=r$(m),xL=r$(Ao);var Qs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Od(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function dy(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 Eb={exports:{}},qc={};/**
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 iS;function wL(){return iS||(iS=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"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),b=Symbol.iterator,y="@@iterator";function x($){if($===null||typeof $!="object")return null;var U=b&&$[b]||$[y];return typeof U=="function"?U:null}var _=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w($){{for(var U=arguments.length,oe=new Array(U>1?U-1:0),xe=1;xe<U;xe++)oe[xe-1]=arguments[xe];C("error",$,oe)}}function C($,U,oe){{var xe=_.ReactDebugCurrentFrame,Te=xe.getStackAddendum();Te!==""&&(U+="%s",oe=oe.concat([Te]));var Ie=oe.map(function(Pe){return String(Pe)});Ie.unshift("Warning: "+U),Function.prototype.apply.call(console[$],console,Ie)}}var R=!1,E=!1,T=!1,O=!1,D=!1,I;I=Symbol.for("react.module.reference");function N($){return!!(typeof $=="string"||typeof $=="function"||$===r||$===i||D||$===o||$===u||$===d||O||$===g||R||E||T||typeof $=="object"&&$!==null&&($.$$typeof===p||$.$$typeof===f||$.$$typeof===s||$.$$typeof===a||$.$$typeof===l||$.$$typeof===I||$.getModuleId!==void 0))}function V($,U,oe){var xe=$.displayName;if(xe)return xe;var Te=U.displayName||U.name||"";return Te!==""?oe+"("+Te+")":oe}function G($){return $.displayName||"Context"}function le($){if($==null)return null;if(typeof $.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof $=="function")return $.displayName||$.name||null;if(typeof $=="string")return $;switch($){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof $=="object")switch($.$$typeof){case a:var U=$;return G(U)+".Consumer";case s:var oe=$;return G(oe._context)+".Provider";case l:return V($,$.render,"ForwardRef");case f:var xe=$.displayName||null;return xe!==null?xe:le($.type)||"Memo";case p:{var Te=$,Ie=Te._payload,Pe=Te._init;try{return le(Pe(Ie))}catch{return null}}}return null}var ee=Object.assign,F=0,Z,Y,Q,ae,j,B,te;function ce(){}ce.__reactDisabledLog=!0;function ue(){{if(F===0){Z=console.log,Y=console.info,Q=console.warn,ae=console.error,j=console.group,B=console.groupCollapsed,te=console.groupEnd;var $={configurable:!0,enumerable:!0,value:ce,writable:!0};Object.defineProperties(console,{info:$,log:$,warn:$,error:$,group:$,groupCollapsed:$,groupEnd:$})}F++}}function ge(){{if(F--,F===0){var $={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ee({},$,{value:Z}),info:ee({},$,{value:Y}),warn:ee({},$,{value:Q}),error:ee({},$,{value:ae}),group:ee({},$,{value:j}),groupCollapsed:ee({},$,{value:B}),groupEnd:ee({},$,{value:te})})}F<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ve=_.ReactCurrentDispatcher,de;function J($,U,oe){{if(de===void 0)try{throw Error()}catch(Te){var xe=Te.stack.trim().match(/\n( *(at )?)/);de=xe&&xe[1]||""}return`
10
- `+de+$}}var X=!1,re;{var be=typeof WeakMap=="function"?WeakMap:Map;re=new be}function H($,U){if(!$||X)return"";{var oe=re.get($);if(oe!==void 0)return oe}var xe;X=!0;var Te=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ie;Ie=ve.current,ve.current=null,ue();try{if(U){var Pe=function(){throw Error()};if(Object.defineProperty(Pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Pe,[])}catch(Bt){xe=Bt}Reflect.construct($,[],Pe)}else{try{Pe.call()}catch(Bt){xe=Bt}$.call(Pe.prototype)}}else{try{throw Error()}catch(Bt){xe=Bt}$()}}catch(Bt){if(Bt&&xe&&typeof Bt.stack=="string"){for(var Re=Bt.stack.split(`
11
- `),mt=xe.stack.split(`
12
- `),He=Re.length-1,Ge=mt.length-1;He>=1&&Ge>=0&&Re[He]!==mt[Ge];)Ge--;for(;He>=1&&Ge>=0;He--,Ge--)if(Re[He]!==mt[Ge]){if(He!==1||Ge!==1)do if(He--,Ge--,Ge<0||Re[He]!==mt[Ge]){var Ot=`
13
- `+Re[He].replace(" at new "," at ");return $.displayName&&Ot.includes("<anonymous>")&&(Ot=Ot.replace("<anonymous>",$.displayName)),typeof $=="function"&&re.set($,Ot),Ot}while(He>=1&&Ge>=0);break}}}finally{X=!1,ve.current=Ie,ge(),Error.prepareStackTrace=Te}var fn=$?$.displayName||$.name:"",Ms=fn?J(fn):"";return typeof $=="function"&&re.set($,Ms),Ms}function De($,U,oe){return H($,!1)}function Ne($){var U=$.prototype;return!!(U&&U.isReactComponent)}function Ve($,U,oe){if($==null)return"";if(typeof $=="function")return H($,Ne($));if(typeof $=="string")return J($);switch($){case u:return J("Suspense");case d:return J("SuspenseList")}if(typeof $=="object")switch($.$$typeof){case l:return De($.render);case f:return Ve($.type,U,oe);case p:{var xe=$,Te=xe._payload,Ie=xe._init;try{return Ve(Ie(Te),U,oe)}catch{}}}return""}var qe=Object.prototype.hasOwnProperty,gt={},ft=_.ReactDebugCurrentFrame;function ht($){if($){var U=$._owner,oe=Ve($.type,$._source,U?U.type:null);ft.setExtraStackFrame(oe)}else ft.setExtraStackFrame(null)}function Gt($,U,oe,xe,Te){{var Ie=Function.call.bind(qe);for(var Pe in $)if(Ie($,Pe)){var Re=void 0;try{if(typeof $[Pe]!="function"){var mt=Error((xe||"React class")+": "+oe+" type `"+Pe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof $[Pe]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw mt.name="Invariant Violation",mt}Re=$[Pe](U,Pe,xe,oe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(He){Re=He}Re&&!(Re instanceof Error)&&(ht(Te),w("%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).",xe||"React class",oe,Pe,typeof Re),ht(null)),Re instanceof Error&&!(Re.message in gt)&&(gt[Re.message]=!0,ht(Te),w("Failed %s type: %s",oe,Re.message),ht(null))}}}var Wt=Array.isArray;function En($){return Wt($)}function rn($){{var U=typeof Symbol=="function"&&Symbol.toStringTag,oe=U&&$[Symbol.toStringTag]||$.constructor.name||"Object";return oe}}function Cc($){try{return Gr($),!1}catch{return!0}}function Gr($){return""+$}function gs($){if(Cc($))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",rn($)),Gr($)}var vn=_.ReactCurrentOwner,co={key:!0,ref:!0,__self:!0,__source:!0},zo,jo,Yr;Yr={};function ms($){if(qe.call($,"ref")){var U=Object.getOwnPropertyDescriptor($,"ref").get;if(U&&U.isReactWarning)return!1}return $.ref!==void 0}function vs($){if(qe.call($,"key")){var U=Object.getOwnPropertyDescriptor($,"key").get;if(U&&U.isReactWarning)return!1}return $.key!==void 0}function bs($,U){if(typeof $.ref=="string"&&vn.current&&U&&vn.current.stateNode!==U){var oe=le(vn.current.type);Yr[oe]||(w('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',le(vn.current.type),$.ref),Yr[oe]=!0)}}function ys($,U){{var oe=function(){zo||(zo=!0,w("%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)",U))};oe.isReactWarning=!0,Object.defineProperty($,"key",{get:oe,configurable:!0})}}function xs($,U){{var oe=function(){jo||(jo=!0,w("%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)",U))};oe.isReactWarning=!0,Object.defineProperty($,"ref",{get:oe,configurable:!0})}}var ws=function($,U,oe,xe,Te,Ie,Pe){var Re={$$typeof:t,type:$,key:U,ref:oe,props:Pe,_owner:Ie};return Re._store={},Object.defineProperty(Re._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Re,"_self",{configurable:!1,enumerable:!1,writable:!1,value:xe}),Object.defineProperty(Re,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Te}),Object.freeze&&(Object.freeze(Re.props),Object.freeze(Re)),Re};function Ec($,U,oe,xe,Te){{var Ie,Pe={},Re=null,mt=null;oe!==void 0&&(gs(oe),Re=""+oe),vs(U)&&(gs(U.key),Re=""+U.key),ms(U)&&(mt=U.ref,bs(U,Te));for(Ie in U)qe.call(U,Ie)&&!co.hasOwnProperty(Ie)&&(Pe[Ie]=U[Ie]);if($&&$.defaultProps){var He=$.defaultProps;for(Ie in He)Pe[Ie]===void 0&&(Pe[Ie]=He[Ie])}if(Re||mt){var Ge=typeof $=="function"?$.displayName||$.name||"Unknown":$;Re&&ys(Pe,Ge),mt&&xs(Pe,Ge)}return ws($,Re,mt,Te,xe,vn.current,Pe)}}var Vo=_.ReactCurrentOwner,_s=_.ReactDebugCurrentFrame;function Rn($){if($){var U=$._owner,oe=Ve($.type,$._source,U?U.type:null);_s.setExtraStackFrame(oe)}else _s.setExtraStackFrame(null)}var uo;uo=!1;function Bo($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function Ss(){{if(Vo.current){var $=le(Vo.current.type);if($)return`
14
-
15
- Check the render method of \``+$+"`."}return""}}function Rc($){{if($!==void 0){var U=$.fileName.replace(/^.*[\\\/]/,""),oe=$.lineNumber;return`
16
-
17
- Check your code at `+U+":"+oe+"."}return""}}var Cs={};function Ha($){{var U=Ss();if(!U){var oe=typeof $=="string"?$:$.displayName||$.name;oe&&(U=`
18
-
19
- Check the top-level render call using <`+oe+">.")}return U}}function Es($,U){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var oe=Ha(U);if(Cs[oe])return;Cs[oe]=!0;var xe="";$&&$._owner&&$._owner!==Vo.current&&(xe=" It was passed a child from "+le($._owner.type)+"."),Rn($),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',oe,xe),Rn(null)}}function Rs($,U){{if(typeof $!="object")return;if(En($))for(var oe=0;oe<$.length;oe++){var xe=$[oe];Bo(xe)&&Es(xe,U)}else if(Bo($))$._store&&($._store.validated=!0);else if($){var Te=x($);if(typeof Te=="function"&&Te!==$.entries)for(var Ie=Te.call($),Pe;!(Pe=Ie.next()).done;)Bo(Pe.value)&&Es(Pe.value,U)}}}function $c($){{var U=$.type;if(U==null||typeof U=="string")return;var oe;if(typeof U=="function")oe=U.propTypes;else if(typeof U=="object"&&(U.$$typeof===l||U.$$typeof===f))oe=U.propTypes;else return;if(oe){var xe=le(U);Gt(oe,$.props,"prop",xe,$)}else if(U.PropTypes!==void 0&&!uo){uo=!0;var Te=le(U);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Te||"Unknown")}typeof U.getDefaultProps=="function"&&!U.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function $s($){{for(var U=Object.keys($.props),oe=0;oe<U.length;oe++){var xe=U[oe];if(xe!=="children"&&xe!=="key"){Rn($),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",xe),Rn(null);break}}$.ref!==null&&(Rn($),w("Invalid attribute `ref` supplied to `React.Fragment`."),Rn(null))}}function Ps($,U,oe,xe,Te,Ie){{var Pe=N($);if(!Pe){var Re="";($===void 0||typeof $=="object"&&$!==null&&Object.keys($).length===0)&&(Re+=" 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 mt=Rc(Te);mt?Re+=mt:Re+=Ss();var He;$===null?He="null":En($)?He="array":$!==void 0&&$.$$typeof===t?(He="<"+(le($.type)||"Unknown")+" />",Re=" Did you accidentally export a JSX literal instead of a component?"):He=typeof $,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",He,Re)}var Ge=Ec($,U,oe,Te,Ie);if(Ge==null)return Ge;if(Pe){var Ot=U.children;if(Ot!==void 0)if(xe)if(En(Ot)){for(var fn=0;fn<Ot.length;fn++)Rs(Ot[fn],$);Object.freeze&&Object.freeze(Ot)}else w("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 Rs(Ot,$)}return $===r?$s(Ge):$c(Ge),Ge}}function Os($,U,oe){return Ps($,U,oe,!0)}function Pc($,U,oe){return Ps($,U,oe,!1)}var Oc=Pc,Mc=Os;qc.Fragment=r,qc.jsx=Oc,qc.jsxs=Mc}()),qc}var Gc={};/**
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 sS;function _L(){if(sS)return Gc;sS=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,u){var d,f={},p=null,g=null;u!==void 0&&(p=""+u),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(g=l.ref);for(d in l)r.call(l,d)&&!i.hasOwnProperty(d)&&(f[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)f[d]===void 0&&(f[d]=l[d]);return{$$typeof:t,type:a,key:p,ref:g,props:f,_owner:o.current}}return Gc.Fragment=n,Gc.jsx=s,Gc.jsxs=s,Gc}process.env.NODE_ENV==="production"?Eb.exports=_L():Eb.exports=wL();var k=Eb.exports;function o$(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=o$(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Kh(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=o$(e))&&(r&&(r+=" "),r+=t);return r}const SL=Object.freeze(Object.defineProperty({__proto__:null,clsx:Kh,default:Kh},Symbol.toStringTag,{value:"Module"})),fy="-";function CL(e){const t=RL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(fy);return a[0]===""&&a.length!==1&&a.shift(),i$(a,t)||EL(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function i$(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?i$(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(fy);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const aS=/^\[(.+)\]$/;function EL(e){if(aS.test(e)){const t=aS.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function RL(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return PL(Object.entries(e.classGroups),n).forEach(([i,s])=>{Rb(s,r,i,t)}),r}function Rb(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:lS(t,o);i.classGroupId=n;return}if(typeof o=="function"){if($L(o)){Rb(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{Rb(s,lS(t,i),n,r)})})}function lS(e,t){let n=e;return t.split(fy).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function $L(e){return e.isThemeGetter}function PL(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 OL(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 s$="!";function ML(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,u=0,d;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(u,y)),u=y+o;continue}if(x==="/"){d=y;continue}}x==="["?l++:x==="]"&&l--}const f=a.length===0?s:s.substring(u),p=f.startsWith(s$),g=p?f.substring(1):f,b=d&&d>u?d-u:void 0;return{modifiers:a,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:b}}}function DL(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 TL(e){return{cache:OL(e.cacheSize),splitModifiers:ML(e),...CL(e)}}const AL=/\s+/;function IL(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(AL).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(s);let f=r(d?u.substring(0,d):u),p=!!d;if(!f){if(!d)return{isTailwindClass:!1,originalClassName:s};if(f=r(u),!f)return{isTailwindClass:!1,originalClassName:s};p=!1}const g=DL(a).join(":");return{isTailwindClass:!0,modifierId:l?g+s$:g,classGroupId:f,originalClassName:s,hasPostfixModifier:p}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:u}=s,d=a+l;return i.has(d)?!1:(i.add(d),o(l,u).forEach(f=>i.add(a+f)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function kL(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=a$(t))&&(r&&(r+=" "),r+=n);return r}function a$(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=a$(e[r]))&&(n&&(n+=" "),n+=t);return n}function NL(e,...t){let n,r,o,i=s;function s(l){const u=t.reduce((d,f)=>f(d),e());return n=TL(u),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=IL(l,n);return o(l,d),d}return function(){return i(kL.apply(null,arguments))}}function kt(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const l$=/^\[(?:([a-z-]+):)?(.+)\]$/i,LL=/^\d+\/\d+$/,FL=new Set(["px","full","screen"]),zL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jL=/\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$/,VL=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,BL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Jr(e){return ea(e)||FL.has(e)||LL.test(e)}function Ti(e){return mc(e,"length",XL)}function ea(e){return!!e&&!Number.isNaN(Number(e))}function jf(e){return mc(e,"number",ea)}function Yc(e){return!!e&&Number.isInteger(Number(e))}function HL(e){return e.endsWith("%")&&ea(e.slice(0,-1))}function nt(e){return l$.test(e)}function Ai(e){return zL.test(e)}const WL=new Set(["length","size","percentage"]);function UL(e){return mc(e,WL,c$)}function qL(e){return mc(e,"position",c$)}const GL=new Set(["image","url"]);function YL(e){return mc(e,GL,ZL)}function KL(e){return mc(e,"",QL)}function Kc(){return!0}function mc(e,t,n){const r=l$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function XL(e){return jL.test(e)}function c$(){return!1}function QL(e){return VL.test(e)}function ZL(e){return BL.test(e)}function JL(){const e=kt("colors"),t=kt("spacing"),n=kt("blur"),r=kt("brightness"),o=kt("borderColor"),i=kt("borderRadius"),s=kt("borderSpacing"),a=kt("borderWidth"),l=kt("contrast"),u=kt("grayscale"),d=kt("hueRotate"),f=kt("invert"),p=kt("gap"),g=kt("gradientColorStops"),b=kt("gradientColorStopPositions"),y=kt("inset"),x=kt("margin"),_=kt("opacity"),w=kt("padding"),C=kt("saturate"),R=kt("scale"),E=kt("sepia"),T=kt("skew"),O=kt("space"),D=kt("translate"),I=()=>["auto","contain","none"],N=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",nt,t],G=()=>[nt,t],le=()=>["",Jr,Ti],ee=()=>["auto",ea,nt],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Z=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],Q=()=>["start","end","center","between","around","evenly","stretch"],ae=()=>["","0",nt],j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[ea,jf],te=()=>[ea,nt];return{cacheSize:500,separator:":",theme:{colors:[Kc],spacing:[Jr,Ti],blur:["none","",Ai,nt],brightness:B(),borderColor:[e],borderRadius:["none","","full",Ai,nt],borderSpacing:G(),borderWidth:le(),contrast:B(),grayscale:ae(),hueRotate:te(),invert:ae(),gap:G(),gradientColorStops:[e],gradientColorStopPositions:[HL,Ti],inset:V(),margin:V(),opacity:B(),padding:G(),saturate:B(),scale:B(),sepia:ae(),skew:te(),space:G(),translate:G()},classGroups:{aspect:[{aspect:["auto","square","video",nt]}],container:["container"],columns:[{columns:[Ai]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"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:[...F(),nt]}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],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",Yc,nt]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",nt]}],grow:[{grow:ae()}],shrink:[{shrink:ae()}],order:[{order:["first","last","none",Yc,nt]}],"grid-cols":[{"grid-cols":[Kc]}],"col-start-end":[{col:["auto",{span:["full",Yc,nt]},nt]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[Kc]}],"row-start-end":[{row:["auto",{span:[Yc,nt]},nt]}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",nt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",nt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],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":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",nt,t]}],"min-w":[{"min-w":["min","max","fit",nt,Jr]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[Ai]},Ai,nt]}],h:[{h:[nt,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",Jr,nt]}],"max-h":[{"max-h":[nt,t,"min","max","fit"]}],"font-size":[{text:["base",Ai,Ti]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",jf]}],"font-family":[{font:[Kc]}],"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",nt]}],"line-clamp":[{"line-clamp":["none",ea,jf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Jr,nt]}],"list-image":[{"list-image":["none",nt]}],"list-style-type":[{list:["none","disc","decimal",nt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Jr,Ti]}],"underline-offset":[{"underline-offset":["auto",Jr,nt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:G()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",nt]}],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",nt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),qL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",UL]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},YL]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],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":[_]}],"border-style":[{border:[...Z(),"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":[_]}],"divide-style":[{divide:Z()}],"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:["",...Z()]}],"outline-offset":[{"outline-offset":[Jr,nt]}],"outline-w":[{outline:[Jr,Ti]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[Jr,Ti]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ai,KL]}],"shadow-color":[{shadow:[Kc]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":Y()}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ai,nt]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[C]}],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":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"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",nt]}],duration:[{duration:te()}],ease:[{ease:["linear","in","out","in-out",nt]}],delay:[{delay:te()}],animate:[{animate:["none","spin","ping","pulse","bounce",nt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[Yc,nt]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",nt]}],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",nt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":G()}],"scroll-mx":[{"scroll-mx":G()}],"scroll-my":[{"scroll-my":G()}],"scroll-ms":[{"scroll-ms":G()}],"scroll-me":[{"scroll-me":G()}],"scroll-mt":[{"scroll-mt":G()}],"scroll-mr":[{"scroll-mr":G()}],"scroll-mb":[{"scroll-mb":G()}],"scroll-ml":[{"scroll-ml":G()}],"scroll-p":[{"scroll-p":G()}],"scroll-px":[{"scroll-px":G()}],"scroll-py":[{"scroll-py":G()}],"scroll-ps":[{"scroll-ps":G()}],"scroll-pe":[{"scroll-pe":G()}],"scroll-pt":[{"scroll-pt":G()}],"scroll-pr":[{"scroll-pr":G()}],"scroll-pb":[{"scroll-pb":G()}],"scroll-pl":[{"scroll-pl":G()}],"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",nt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Jr,Ti,jf]}],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 e9=NL(JL);class t9 extends Error{}t9.prototype.name="InvalidTokenError";function Se(...e){return e9(Kh(e))}async function yl(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 jp(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 n9(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 u$(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(o,i)=>r9(i,t))}function r9(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 o9(e){return e.charAt(0).toUpperCase()+e.slice(1)}const i9="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";var s9={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const cS=e=>{let t;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const f=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(p=>p(t,f))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(s9?"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},a9=e=>e?cS(e):cS;var $b={exports:{}},sv={},Vf={exports:{}},av={};/**
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 uS;function l9(){return uS||(uS=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(C){{for(var R=arguments.length,E=new Array(R>1?R-1:0),T=1;T<R;T++)E[T-1]=arguments[T];r("error",C,E)}}function r(C,R,E){{var T=t.ReactDebugCurrentFrame,O=T.getStackAddendum();O!==""&&(R+="%s",E=E.concat([O]));var D=E.map(function(I){return String(I)});D.unshift("Warning: "+R),Function.prototype.apply.call(console[C],console,D)}}function o(C,R){return C===R&&(C!==0||1/C===1/R)||C!==C&&R!==R}var i=typeof Object.is=="function"?Object.is:o,s=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue,d=!1,f=!1;function p(C,R,E){d||e.startTransition!==void 0&&(d=!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 T=R();if(!f){var O=R();i(T,O)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}var D=s({inst:{value:T,getSnapshot:R}}),I=D[0].inst,N=D[1];return l(function(){I.value=T,I.getSnapshot=R,g(I)&&N({inst:I})},[C,T,R]),a(function(){g(I)&&N({inst:I});var V=function(){g(I)&&N({inst:I})};return C(V)},[C]),u(T),T}function g(C){var R=C.getSnapshot,E=C.value;try{var T=R();return!i(E,T)}catch{return!0}}function b(C,R,E){return R()}var y=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",x=!y,_=x?b:p,w=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:_;av.useSyncExternalStore=w,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),av}var lv={};/**
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 dS;function c9(){if(dS)return lv;dS=1;var e=m;function t(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(f,p){var g=p(),b=r({inst:{value:g,getSnapshot:p}}),y=b[0].inst,x=b[1];return i(function(){y.value=g,y.getSnapshot=p,l(y)&&x({inst:y})},[f,g,p]),o(function(){return l(y)&&x({inst:y}),f(function(){l(y)&&x({inst:y})})},[f]),s(g),g}function l(f){var p=f.getSnapshot;f=f.value;try{var g=p();return!n(f,g)}catch{return!0}}function u(f,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return lv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,lv}var fS;function d$(){return fS||(fS=1,process.env.NODE_ENV==="production"?Vf.exports=c9():Vf.exports=l9()),Vf.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 hS;function u9(){return hS||(hS=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=d$();function n(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&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 u(d,f,p,g,b){var y=i(null),x;y.current===null?(x={hasValue:!1,value:null},y.current=x):x=y.current;var _=a(function(){var E=!1,T,O,D=function(G){if(!E){E=!0,T=G;var le=g(G);if(b!==void 0&&x.hasValue){var ee=x.value;if(b(ee,le))return O=ee,ee}return O=le,le}var F=T,Z=O;if(r(F,G))return Z;var Y=g(G);return b!==void 0&&b(Z,Y)?Z:(T=G,O=Y,Y)},I=p===void 0?null:p,N=function(){return D(f())},V=I===null?void 0:function(){return D(I())};return[N,V]},[f,p,g,b]),w=_[0],C=_[1],R=o(d,w,C);return s(function(){x.hasValue=!0,x.value=R},[R]),l(R),R}sv.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),sv}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 pS;function d9(){if(pS)return cv;pS=1;var e=m,t=d$();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}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(u,d,f,p,g){var b=i(null);if(b.current===null){var y={hasValue:!1,value:null};b.current=y}else y=b.current;b=a(function(){function _(T){if(!w){if(w=!0,C=T,T=p(T),g!==void 0&&y.hasValue){var O=y.value;if(g(O,T))return R=O}return R=T}if(O=R,r(C,T))return O;var D=p(T);return g!==void 0&&g(O,D)?O:(C=T,R=D)}var w=!1,C,R,E=f===void 0?null:f;return[function(){return _(d())},E===null?void 0:function(){return _(E())}]},[d,f,p,g]);var x=o(u,b[0],b[1]);return s(function(){y.hasValue=!0,y.value=x},[x]),l(x),x},cv}process.env.NODE_ENV==="production"?$b.exports=d9():$b.exports=u9();var f9=$b.exports;const h9=Od(f9);var f$={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:p9}=m,{useSyncExternalStoreWithSelector:g9}=h9;let gS=!1;function m9(e,t=e.getState,n){(f$?"production":void 0)!=="production"&&n&&!gS&&(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"),gS=!0);const r=g9(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return p9(r),r}const mS=e=>{(f$?"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"?a9(e):e,n=(r,o)=>m9(t,r,o);return Object.assign(n,t),n},h$=e=>e?mS(e):mS;var p$=Symbol.for("immer-nothing"),vS=Symbol.for("immer-draftable"),_r=Symbol.for("immer-state"),v9=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 Jn(e,...t){if(process.env.NODE_ENV!=="production"){const n=v9[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 Ql=Object.getPrototypeOf;function Zl(e){return!!e&&!!e[_r]}function wa(e){var t;return e?g$(e)||Array.isArray(e)||!!e[vS]||!!((t=e.constructor)!=null&&t[vS])||Bp(e)||Hp(e):!1}var b9=Object.prototype.constructor.toString();function g$(e){if(!e||typeof e!="object")return!1;const t=Ql(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)===b9}function ku(e,t){Vp(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Vp(e){const t=e[_r];return t?t.type_:Array.isArray(e)?1:Bp(e)?2:Hp(e)?3:0}function Pb(e,t){return Vp(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function m$(e,t,n){const r=Vp(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function y9(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Bp(e){return e instanceof Map}function Hp(e){return e instanceof Set}function Gs(e){return e.copy_||e.base_}function Ob(e,t){if(Bp(e))return new Map(e);if(Hp(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&g$(e))return Ql(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[_r];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(Ql(e),n)}function hy(e,t=!1){return Wp(e)||Zl(e)||!wa(e)||(Vp(e)>1&&(e.set=e.add=e.clear=e.delete=x9),Object.freeze(e),t&&ku(e,(n,r)=>hy(r,!0))),e}function x9(){Jn(2)}function Wp(e){return Object.isFrozen(e)}var w9={};function _a(e){const t=w9[e];return t||Jn(0,e),t}var Nu;function v$(){return Nu}function _9(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function bS(e,t){t&&(_a("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Mb(e){Db(e),e.drafts_.forEach(S9),e.drafts_=null}function Db(e){e===Nu&&(Nu=e.parent_)}function yS(e){return Nu=_9(Nu,e)}function S9(e){const t=e[_r];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function xS(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[_r].modified_&&(Mb(t),Jn(4)),wa(e)&&(e=Xh(t,e),t.parent_||Qh(t,e)),t.patches_&&_a("Patches").generateReplacementPatches_(n[_r].base_,e,t.patches_,t.inversePatches_)):e=Xh(t,n,[]),Mb(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==p$?e:void 0}function Xh(e,t,n){if(Wp(t))return t;const r=t[_r];if(!r)return ku(t,(o,i)=>wS(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Qh(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),ku(i,(a,l)=>wS(e,r,o,a,l,n,s)),Qh(e,o,!1),n&&e.patches_&&_a("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function wS(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&Jn(5),Zl(o)){const a=i&&t&&t.type_!==3&&!Pb(t.assigned_,r)?i.concat(r):void 0,l=Xh(e,o,a);if(m$(n,r,l),Zl(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(wa(o)&&!Wp(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Xh(e,o),(!t||!t.scope_.parent_)&&Qh(e,o)}}function Qh(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&hy(t,n)}function C9(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:v$(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=py;n&&(o=[r],i=Lu);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var py={get(e,t){if(t===_r)return e;const n=Gs(e);if(!Pb(n,t))return E9(e,n,t);const r=n[t];return e.finalized_||!wa(r)?r:r===uv(e.base_,t)?(dv(e),e.copy_[t]=Ab(r,e)):r},has(e,t){return t in Gs(e)},ownKeys(e){return Reflect.ownKeys(Gs(e))},set(e,t,n){const r=b$(Gs(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=uv(Gs(e),t),i=o==null?void 0:o[_r];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(y9(n,o)&&(n!==void 0||Pb(e.base_,t)))return!0;dv(e),Tb(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 uv(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,dv(e),Tb(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Gs(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Jn(11)},getPrototypeOf(e){return Ql(e.base_)},setPrototypeOf(){Jn(12)}},Lu={};ku(py,(e,t)=>{Lu[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Lu.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Jn(13),Lu.set.call(this,e,t,void 0)};Lu.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Jn(14),py.set.call(this,e[0],t,n,e[0])};function uv(e,t){const n=e[_r];return(n?Gs(n):e)[t]}function E9(e,t,n){var o;const r=b$(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function b$(e,t){if(!(t in e))return;let n=Ql(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ql(n)}}function Tb(e){e.modified_||(e.modified_=!0,e.parent_&&Tb(e.parent_))}function dv(e){e.copy_||(e.copy_=Ob(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var R9=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,...u){return s.produce(l,d=>n.call(this,d,...u))}}typeof n!="function"&&Jn(6),r!==void 0&&typeof r!="function"&&Jn(7);let o;if(wa(t)){const i=yS(this),s=Ab(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?Mb(i):Db(i)}return bS(i,r),xS(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===p$&&(o=void 0),this.autoFreeze_&&hy(o,!0),r){const i=[],s=[];_a("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else Jn(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){wa(e)||Jn(8),Zl(e)&&(e=$9(e));const t=yS(this),n=Ab(e,void 0);return n[_r].isManual_=!0,Db(t),n}finishDraft(e,t){const n=e&&e[_r];(!n||!n.isManual_)&&Jn(9);const{scope_:r}=n;return bS(r,t),xS(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=_a("Patches").applyPatches_;return Zl(e)?r(e,t):this.produce(e,o=>r(o,t))}};function Ab(e,t){const n=Bp(e)?_a("MapSet").proxyMap_(e,t):Hp(e)?_a("MapSet").proxySet_(e,t):C9(e,t);return(t?t.scope_:v$()).drafts_.push(n),n}function $9(e){return Zl(e)||Jn(10,e),y$(e)}function y$(e){if(!wa(e)||Wp(e))return e;const t=e[_r];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ob(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Ob(e,!0);return ku(n,(r,o)=>{m$(n,r,y$(o))}),t&&(t.finalized_=!1),n}var Sr=new R9,P9=Sr.produce;Sr.produceWithPatches.bind(Sr);Sr.setAutoFreeze.bind(Sr);Sr.setUseStrictShallowCopy.bind(Sr);Sr.applyPatches.bind(Sr);Sr.createDraft.bind(Sr);Sr.finishDraft.bind(Sr);const O9=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?P9(o):o;return t(a,i,...s)},e(r.setState,n,r)),x$=O9;var Ib,Bf=Ao;if(process.env.NODE_ENV==="production")Ib=Bf.createRoot,Bf.hydrateRoot;else{var _S=Bf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Ib=function(e,t){_S.usingClientEntryPoint=!0;try{return Bf.createRoot(e,t)}finally{_S.usingClientEntryPoint=!1}}}var w$={},_$={},gy={exports:{}},Nt=String,S$=function(){return{isColorSupported:!1,reset:Nt,bold:Nt,dim:Nt,italic:Nt,underline:Nt,inverse:Nt,hidden:Nt,strikethrough:Nt,black:Nt,red:Nt,green:Nt,yellow:Nt,blue:Nt,magenta:Nt,cyan:Nt,white:Nt,gray:Nt,bgBlack:Nt,bgRed:Nt,bgGreen:Nt,bgYellow:Nt,bgBlue:Nt,bgMagenta:Nt,bgCyan:Nt,bgWhite:Nt}};gy.exports=S$();gy.exports.createColors=S$;var M9=gy.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,u){for(var d in u)Object.defineProperty(l,d,{enumerable:!0,get:u[d]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(M9);function r(l){return l&&l.__esModule?l:{default:l}}let o=new Set;function i(l,u,d){typeof process<"u"&&process.env.JEST_WORKER_ID||d&&o.has(d)||(d&&o.add(d),console.warn(""),u.forEach(f=>console.warn(l,"-",f)))}function s(l){return n.default.dim(l)}const a={info(l,u){i(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[u,l])},warn(l,u){i(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[u,l])},risk(l,u){i(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[u,l])}}})(_$);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(_$);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}}})(w$);let fv=w$;var D9=(fv.__esModule?fv:{default:fv}).default;const Tt=Od(D9),C$=`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
- `,kb={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[Tt.blue[500],Tt.teal[500],Tt.amber[500],Tt.red[500],Tt.indigo[500],Tt.green[500]],borderColor:[Tt.blue[500],Tt.teal[500],Tt.amber[500],Tt.red[500],Tt.indigo[500],Tt.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:SS},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:1,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[Tt.blue[500],Tt.teal[500],Tt.amber[500],Tt.red[500],Tt.indigo[500],Tt.green[500]],borderColor:[Tt.blue[500],Tt.teal[500],Tt.amber[500],Tt.red[500],Tt.indigo[500],Tt.green[500]],datalables:{color:SS}},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:Tt.slate[800]}},y:{grid:{display:!0,color:Tt.slate[800]}}}}}}};function SS(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=Zh()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Zh()),Jh(n)}function Zh(){return Ee.getState().theme==="dark"?"#000000":"#FFFFFF"}function Jh(e){let t=0,n=0,r=0,o=0;const i=d=>{const f=d.replace("#",""),p=parseInt(f.substring(0,2),16),g=parseInt(f.substring(2,4),16),b=parseInt(f.substring(4,6),16);t+=p,n+=g,r+=b,o++};Array.isArray(e)?e.forEach(d=>{i(d)}):i(e);const s=t/o,a=n/o,l=r/o;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}var Md=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(){}},Jl=typeof window>"u"||"Deno"in window;function jr(){}function T9(e,t){return typeof e=="function"?e(t):e}function Nb(e){return typeof e=="number"&&e>=0&&e!==1/0}function E$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function CS(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==my(s,t.options))return!1}else if(!zu(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 ES(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Fu(t.options.mutationKey)!==Fu(i))return!1}else if(!zu(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function my(e,t){return((t==null?void 0:t.queryKeyHashFn)||Fu)(e)}function Fu(e){return JSON.stringify(e,(t,n)=>Fb(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function zu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!zu(e[n],t[n])):!1}function R$(e,t){if(e===t)return e;const n=RS(e)&&RS(t);if(n||Fb(e)&&Fb(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 u=0;u<s;u++){const d=n?u:i[u];!n&&e[d]===void 0&&t[d]===void 0&&r.includes(d)?(a[d]=void 0,l++):(a[d]=R$(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function Lb(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function RS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Fb(e){if(!$S(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!$S(n)||!n.hasOwnProperty("isPrototypeOf"))}function $S(e){return Object.prototype.toString.call(e)==="[object Object]"}function A9(e){return new Promise(t=>{setTimeout(t,e)})}function zb(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?R$(e,t):t}function I9(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function k9(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ia,Vi,Ml,GR,N9=(GR=class extends Md{constructor(){super();Oe(this,ia,void 0);Oe(this,Vi,void 0);Oe(this,Ml,void 0);_e(this,Ml,t=>{if(!Jl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,Vi)||this.setEventListener(W(this,Ml))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Vi))==null||t.call(this),_e(this,Vi,void 0))}setEventListener(t){var n;_e(this,Ml,t),(n=W(this,Vi))==null||n.call(this),_e(this,Vi,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,ia)!==t&&(_e(this,ia,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof W(this,ia)=="boolean"?W(this,ia):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ia=new WeakMap,Vi=new WeakMap,Ml=new WeakMap,GR),ep=new N9,Dl,Bi,Tl,YR,L9=(YR=class extends Md{constructor(){super();Oe(this,Dl,!0);Oe(this,Bi,void 0);Oe(this,Tl,void 0);_e(this,Tl,t=>{if(!Jl&&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(){W(this,Bi)||this.setEventListener(W(this,Tl))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,Bi))==null||t.call(this),_e(this,Bi,void 0))}setEventListener(t){var n;_e(this,Tl,t),(n=W(this,Bi))==null||n.call(this),_e(this,Bi,t(this.setOnline.bind(this)))}setOnline(t){W(this,Dl)!==t&&(_e(this,Dl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,Dl)}},Dl=new WeakMap,Bi=new WeakMap,Tl=new WeakMap,YR),ju=new L9;function F9(e){return Math.min(1e3*2**e,3e4)}function Up(e){return(e??"online")==="online"?ju.isOnline():!0}var $$=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function hv(e){return e instanceof $$}function P$(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((x,_)=>{i=x,s=_}),l=x=>{var _;r||(g(new $$(x)),(_=e.abort)==null||_.call(e))},u=()=>{t=!0},d=()=>{t=!1},f=()=>!ep.isFocused()||e.networkMode!=="always"&&!ju.isOnline(),p=x=>{var _;r||(r=!0,(_=e.onSuccess)==null||_.call(e,x),o==null||o(),i(x))},g=x=>{var _;r||(r=!0,(_=e.onError)==null||_.call(e,x),o==null||o(),s(x))},b=()=>new Promise(x=>{var _;o=w=>{const C=r||!f();return C&&x(w),C},(_=e.onPause)==null||_.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(_){x=Promise.reject(_)}Promise.resolve(x).then(p).catch(_=>{var T;if(r)return;const w=e.retry??(Jl?0:3),C=e.retryDelay??F9,R=typeof C=="function"?C(n,_):C,E=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,_);if(t||!E){g(_);return}n++,(T=e.onFail)==null||T.call(e,n,_),A9(R).then(()=>{if(f())return b()}).then(()=>{t?g(_):y()})})};return Up(e.networkMode)?y():b().then(y),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:u,continueRetry:d}}function z9(){let e=[],t=0,n=p=>{p()},r=p=>{p()},o=p=>setTimeout(p,0);const i=p=>{o=p},s=p=>{let g;t++;try{g=p()}finally{t--,t||u()}return g},a=p=>{t?e.push(p):o(()=>{n(p)})},l=p=>(...g)=>{a(()=>{p(...g)})},u=()=>{const p=e;e=[],p.length&&o(()=>{r(()=>{p.forEach(g=>{n(g)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:p=>{n=p},setBatchNotifyFunction:p=>{r=p},setScheduler:i}}var _n=z9(),sa,KR,O$=(KR=class{constructor(){Oe(this,sa,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Nb(this.gcTime)&&_e(this,sa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Jl?1/0:5*60*1e3))}clearGcTimeout(){W(this,sa)&&(clearTimeout(W(this,sa)),_e(this,sa,void 0))}},sa=new WeakMap,KR),Al,Il,Lr,Hi,Fr,pn,fd,aa,kl,Nh,to,ti,XR,j9=(XR=class extends O${constructor(t){super();Oe(this,kl);Oe(this,to);Oe(this,Al,void 0);Oe(this,Il,void 0);Oe(this,Lr,void 0);Oe(this,Hi,void 0);Oe(this,Fr,void 0);Oe(this,pn,void 0);Oe(this,fd,void 0);Oe(this,aa,void 0);_e(this,aa,!1),_e(this,fd,t.defaultOptions),it(this,kl,Nh).call(this,t.options),_e(this,pn,[]),_e(this,Lr,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,_e(this,Al,t.state||V9(this.options)),this.state=W(this,Al),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!W(this,pn).length&&this.state.fetchStatus==="idle"&&W(this,Lr).remove(this)}setData(t,n){const r=zb(this.state.data,t,this.options);return it(this,to,ti).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){it(this,to,ti).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=W(this,Hi);return(r=W(this,Fr))==null||r.cancel(t),n?n.then(jr).catch(jr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(W(this,Al))}isActive(){return W(this,pn).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||W(this,pn).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!E$(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=W(this,pn).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,Fr))==null||n.continue()}onOnline(){var n;const t=W(this,pn).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=W(this,Fr))==null||n.continue()}addObserver(t){W(this,pn).includes(t)||(W(this,pn).push(t),this.clearGcTimeout(),W(this,Lr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){W(this,pn).includes(t)&&(_e(this,pn,W(this,pn).filter(n=>n!==t)),W(this,pn).length||(W(this,Fr)&&(W(this,aa)?W(this,Fr).cancel({revert:!0}):W(this,Fr).cancelRetry()),this.scheduleGc()),W(this,Lr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return W(this,pn).length}invalidate(){this.state.isInvalidated||it(this,to,ti).call(this,{type:"invalidate"})}fetch(t,n){var u,d,f,p;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,Hi))return(u=W(this,Fr))==null||u.continueRetry(),W(this,Hi)}if(t&&it(this,kl,Nh).call(this,t),!this.options.queryFn){const g=W(this,pn).find(b=>b.options.queryFn);g&&it(this,kl,Nh).call(this,g.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=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(_e(this,aa,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(_e(this,aa,!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),(d=this.options.behavior)==null||d.onFetch(a,this),_e(this,Il,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=a.fetchOptions)==null?void 0:f.meta))&&it(this,to,ti).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=g=>{var b,y,x,_;hv(g)&&g.silent||it(this,to,ti).call(this,{type:"error",error:g}),hv(g)||((y=(b=W(this,Lr).config).onError)==null||y.call(b,g,this),(_=(x=W(this,Lr).config).onSettled)==null||_.call(x,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return _e(this,Fr,P$({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var b,y,x,_;if(typeof g>"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(g),(y=(b=W(this,Lr).config).onSuccess)==null||y.call(b,g,this),(_=(x=W(this,Lr).config).onSettled)==null||_.call(x,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(g,b)=>{it(this,to,ti).call(this,{type:"failed",failureCount:g,error:b})},onPause:()=>{it(this,to,ti).call(this,{type:"pause"})},onContinue:()=>{it(this,to,ti).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),_e(this,Hi,W(this,Fr).promise),W(this,Hi)}},Al=new WeakMap,Il=new WeakMap,Lr=new WeakMap,Hi=new WeakMap,Fr=new WeakMap,pn=new WeakMap,fd=new WeakMap,aa=new WeakMap,kl=new WeakSet,Nh=function(t){this.options={...W(this,fd),...t},this.updateGcTime(this.options.gcTime)},to=new WeakSet,ti=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:Up(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 hv(o)&&o.revert&&W(this,Il)?{...W(this,Il),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),_n.batch(()=>{W(this,pn).forEach(r=>{r.onQueryUpdate()}),W(this,Lr).notify({query:this,type:"updated",action:t})})},XR);function V9(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 yo,QR,B9=(QR=class extends Md{constructor(t={}){super();Oe(this,yo,void 0);this.config=t,_e(this,yo,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??my(o,n);let s=this.get(i);return s||(s=new j9({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){W(this,yo).has(t.queryHash)||(W(this,yo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=W(this,yo).get(t.queryHash);n&&(t.destroy(),n===t&&W(this,yo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){_n.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return W(this,yo).get(t)}getAll(){return[...W(this,yo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>CS(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>CS(t,r)):n}notify(t){_n.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){_n.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){_n.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},yo=new WeakMap,QR),xo,hd,hr,Nl,wo,zi,ZR,H9=(ZR=class extends O${constructor(t){super();Oe(this,wo);Oe(this,xo,void 0);Oe(this,hd,void 0);Oe(this,hr,void 0);Oe(this,Nl,void 0);this.mutationId=t.mutationId,_e(this,hd,t.defaultOptions),_e(this,hr,t.mutationCache),_e(this,xo,[]),this.state=t.state||W9(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...W(this,hd),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){W(this,xo).includes(t)||(W(this,xo).push(t),this.clearGcTimeout(),W(this,hr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){_e(this,xo,W(this,xo).filter(n=>n!==t)),this.scheduleGc(),W(this,hr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){W(this,xo).length||(this.state.status==="pending"?this.scheduleGc():W(this,hr).remove(this))}continue(){var t;return((t=W(this,Nl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,u,d,f,p,g,b,y,x,_,w,C,R,E,T,O;const n=()=>(_e(this,Nl,P$({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(D,I)=>{it(this,wo,zi).call(this,{type:"failed",failureCount:D,error:I})},onPause:()=>{it(this,wo,zi).call(this,{type:"pause"})},onContinue:()=>{it(this,wo,zi).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),W(this,Nl).promise),r=this.state.status==="pending";try{if(!r){it(this,wo,zi).call(this,{type:"pending",variables:t}),await((i=(o=W(this,hr).config).onMutate)==null?void 0:i.call(o,t,this));const I=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));I!==this.state.context&&it(this,wo,zi).call(this,{type:"pending",context:I,variables:t})}const D=await n();return await((u=(l=W(this,hr).config).onSuccess)==null?void 0:u.call(l,D,t,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,D,t,this.state.context)),await((g=(p=W(this,hr).config).onSettled)==null?void 0:g.call(p,D,null,this.state.variables,this.state.context,this)),await((y=(b=this.options).onSettled)==null?void 0:y.call(b,D,null,t,this.state.context)),it(this,wo,zi).call(this,{type:"success",data:D}),D}catch(D){try{throw await((_=(x=W(this,hr).config).onError)==null?void 0:_.call(x,D,t,this.state.context,this)),await((C=(w=this.options).onError)==null?void 0:C.call(w,D,t,this.state.context)),await((E=(R=W(this,hr).config).onSettled)==null?void 0:E.call(R,void 0,D,this.state.variables,this.state.context,this)),await((O=(T=this.options).onSettled)==null?void 0:O.call(T,void 0,D,t,this.state.context)),D}finally{it(this,wo,zi).call(this,{type:"error",error:D})}}}},xo=new WeakMap,hd=new WeakMap,hr=new WeakMap,Nl=new WeakMap,wo=new WeakSet,zi=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:!Up(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),_n.batch(()=>{W(this,xo).forEach(r=>{r.onMutationUpdate(t)}),W(this,hr).notify({mutation:this,type:"updated",action:t})})},ZR);function W9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var zr,pd,la,JR,U9=(JR=class extends Md{constructor(t={}){super();Oe(this,zr,void 0);Oe(this,pd,void 0);Oe(this,la,void 0);this.config=t,_e(this,zr,[]),_e(this,pd,0)}build(t,n,r){const o=new H9({mutationCache:this,mutationId:++zf(this,pd)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){W(this,zr).push(t),this.notify({type:"added",mutation:t})}remove(t){_e(this,zr,W(this,zr).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){_n.batch(()=>{W(this,zr).forEach(t=>{this.remove(t)})})}getAll(){return W(this,zr)}find(t){const n={exact:!0,...t};return W(this,zr).find(r=>ES(n,r))}findAll(t={}){return W(this,zr).filter(n=>ES(t,n))}notify(t){_n.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return _e(this,la,(W(this,la)??Promise.resolve()).then(()=>{const t=W(this,zr).filter(n=>n.state.isPaused);return _n.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(jr)),Promise.resolve()))}).then(()=>{_e(this,la,void 0)})),W(this,la)}},zr=new WeakMap,pd=new WeakMap,la=new WeakMap,JR);function q9(e){return{onFetch:(t,n)=>{const r=async()=>{var b,y,x,_,w;const o=t.options,i=(x=(y=(b=t.fetchOptions)==null?void 0:b.meta)==null?void 0:y.fetchMore)==null?void 0:x.direction,s=((_=t.state.data)==null?void 0:_.pages)||[],a=((w=t.state.data)==null?void 0:w.pageParams)||[],l={pages:[],pageParams:[]};let u=!1;const d=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},f=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),p=async(C,R,E)=>{if(u)return Promise.reject();if(R==null&&C.pages.length)return Promise.resolve(C);const T={queryKey:t.queryKey,pageParam:R,direction:E?"backward":"forward",meta:t.options.meta};d(T);const O=await f(T),{maxPages:D}=t.options,I=E?k9:I9;return{pages:I(C.pages,O,D),pageParams:I(C.pageParams,R,D)}};let g;if(i&&s.length){const C=i==="backward",R=C?G9:PS,E={pages:s,pageParams:a},T=R(o,E);g=await p(E,T,C)}else{g=await p(l,a[0]??o.initialPageParam);const C=e??s.length;for(let R=1;R<C;R++){const E=PS(o,g);g=await p(g,E)}}return g};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 PS(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function G9(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var an,Wi,Ui,Ll,Fl,qi,zl,jl,e$,Y9=(e$=class{constructor(e={}){Oe(this,an,void 0);Oe(this,Wi,void 0);Oe(this,Ui,void 0);Oe(this,Ll,void 0);Oe(this,Fl,void 0);Oe(this,qi,void 0);Oe(this,zl,void 0);Oe(this,jl,void 0);_e(this,an,e.queryCache||new B9),_e(this,Wi,e.mutationCache||new U9),_e(this,Ui,e.defaultOptions||{}),_e(this,Ll,new Map),_e(this,Fl,new Map),_e(this,qi,0)}mount(){zf(this,qi)._++,W(this,qi)===1&&(_e(this,zl,ep.subscribe(()=>{ep.isFocused()&&(this.resumePausedMutations(),W(this,an).onFocus())})),_e(this,jl,ju.subscribe(()=>{ju.isOnline()&&(this.resumePausedMutations(),W(this,an).onOnline())})))}unmount(){var e,t;zf(this,qi)._--,W(this,qi)===0&&((e=W(this,zl))==null||e.call(this),_e(this,zl,void 0),(t=W(this,jl))==null||t.call(this),_e(this,jl,void 0))}isFetching(e){return W(this,an).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,Wi).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=W(this,an).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=W(this,an).find({queryKey:e}),o=r==null?void 0:r.state.data,i=T9(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return W(this,an).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return _n.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=W(this,an).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=W(this,an);_n.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=W(this,an),r={type:"active",...e};return _n.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=_n.batch(()=>W(this,an).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(jr).catch(jr)}invalidateQueries(e={},t={}){return _n.batch(()=>{if(W(this,an).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=_n.batch(()=>W(this,an).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(jr)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(jr)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=W(this,an).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(jr).catch(jr)}fetchInfiniteQuery(e){return e.behavior=q9(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jr).catch(jr)}resumePausedMutations(){return W(this,Wi).resumePausedMutations()}getQueryCache(){return W(this,an)}getMutationCache(){return W(this,Wi)}getDefaultOptions(){return W(this,Ui)}setDefaultOptions(e){_e(this,Ui,e)}setQueryDefaults(e,t){W(this,Ll).set(Fu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,Ll).values()];let n={};return t.forEach(r=>{zu(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){W(this,Fl).set(Fu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,Fl).values()];let n={};return t.forEach(r=>{zu(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...W(this,Ui).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=my(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:{...W(this,Ui).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,an).clear(),W(this,Wi).clear()}},an=new WeakMap,Wi=new WeakMap,Ui=new WeakMap,Ll=new WeakMap,Fl=new WeakMap,qi=new WeakMap,zl=new WeakMap,jl=new WeakMap,e$),Zn,Lt,gd,Vn,ca,Vl,_o,md,Bl,Hl,ua,da,Gi,Wl,fa,cu,vd,jb,bd,Vb,yd,Bb,xd,Hb,wd,Wb,_d,Ub,Sd,qb,zp,M$,t$,K9=(t$=class extends Md{constructor(t,n){super();Oe(this,fa);Oe(this,vd);Oe(this,bd);Oe(this,yd);Oe(this,xd);Oe(this,wd);Oe(this,_d);Oe(this,Sd);Oe(this,zp);Oe(this,Zn,void 0);Oe(this,Lt,void 0);Oe(this,gd,void 0);Oe(this,Vn,void 0);Oe(this,ca,void 0);Oe(this,Vl,void 0);Oe(this,_o,void 0);Oe(this,md,void 0);Oe(this,Bl,void 0);Oe(this,Hl,void 0);Oe(this,ua,void 0);Oe(this,da,void 0);Oe(this,Gi,void 0);Oe(this,Wl,new Set);this.options=n,_e(this,Zn,t),_e(this,_o,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(W(this,Lt).addObserver(this),OS(W(this,Lt),this.options)?it(this,fa,cu).call(this):this.updateResult(),it(this,xd,Hb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Gb(W(this,Lt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Gb(W(this,Lt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,it(this,wd,Wb).call(this),it(this,_d,Ub).call(this),W(this,Lt).removeObserver(this)}setOptions(t,n){const r=this.options,o=W(this,Lt);if(this.options=W(this,Zn).defaultQueryOptions(t),Lb(r,this.options)||W(this,Zn).getQueryCache().notify({type:"observerOptionsUpdated",query:W(this,Lt),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),it(this,Sd,qb).call(this);const i=this.hasListeners();i&&MS(W(this,Lt),o,this.options,r)&&it(this,fa,cu).call(this),this.updateResult(n),i&&(W(this,Lt)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&it(this,vd,jb).call(this);const s=it(this,bd,Vb).call(this);i&&(W(this,Lt)!==o||this.options.enabled!==r.enabled||s!==W(this,Gi))&&it(this,yd,Bb).call(this,s)}getOptimisticResult(t){const n=W(this,Zn).getQueryCache().build(W(this,Zn),t),r=this.createResult(n,t);return Q9(this,r)&&(_e(this,Vn,r),_e(this,Vl,this.options),_e(this,ca,W(this,Lt).state)),r}getCurrentResult(){return W(this,Vn)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(W(this,Wl).add(r),t[r])})}),n}getCurrentQuery(){return W(this,Lt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=W(this,Zn).defaultQueryOptions(t),r=W(this,Zn).getQueryCache().build(W(this,Zn),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return it(this,fa,cu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),W(this,Vn)))}createResult(t,n){var T;const r=W(this,Lt),o=this.options,i=W(this,Vn),s=W(this,ca),a=W(this,Vl),u=t!==r?t.state:W(this,gd),{state:d}=t;let{error:f,errorUpdatedAt:p,fetchStatus:g,status:b}=d,y=!1,x;if(n._optimisticResults){const O=this.hasListeners(),D=!O&&OS(t,n),I=O&&MS(t,r,n,o);(D||I)&&(g=Up(t.options.networkMode)?"fetching":"paused",d.dataUpdatedAt||(b="pending")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.select&&typeof d.data<"u")if(i&&d.data===(s==null?void 0:s.data)&&n.select===W(this,md))x=W(this,Bl);else try{_e(this,md,n.select),x=n.select(d.data),x=zb(i==null?void 0:i.data,x,n),_e(this,Bl,x),_e(this,_o,null)}catch(O){_e(this,_o,O)}else x=d.data;if(typeof n.placeholderData<"u"&&typeof x>"u"&&b==="pending"){let O;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))O=i.data;else if(O=typeof n.placeholderData=="function"?n.placeholderData((T=W(this,Hl))==null?void 0:T.state.data,W(this,Hl)):n.placeholderData,n.select&&typeof O<"u")try{O=n.select(O),_e(this,_o,null)}catch(D){_e(this,_o,D)}typeof O<"u"&&(b="success",x=zb(i==null?void 0:i.data,O,n),y=!0)}W(this,_o)&&(f=W(this,_o),x=W(this,Bl),p=Date.now(),b="error");const _=g==="fetching",w=b==="pending",C=b==="error",R=w&&_;return{status:b,fetchStatus:g,isPending:w,isSuccess:b==="success",isError:C,isInitialLoading:R,isLoading:R,data:x,dataUpdatedAt:d.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:_,isRefetching:_&&!w,isLoadingError:C&&d.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:y,isRefetchError:C&&d.dataUpdatedAt!==0,isStale:vy(t,n),refetch:this.refetch}}updateResult(t){const n=W(this,Vn),r=this.createResult(W(this,Lt),this.options);if(_e(this,ca,W(this,Lt).state),_e(this,Vl,this.options),W(this,ca).data!==void 0&&_e(this,Hl,W(this,Lt)),Lb(r,n))return;_e(this,Vn,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!W(this,Wl).size)return!0;const l=new Set(a??W(this,Wl));return this.options.throwOnError&&l.add("error"),Object.keys(W(this,Vn)).some(u=>{const d=u;return W(this,Vn)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),it(this,zp,M$).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&it(this,xd,Hb).call(this)}},Zn=new WeakMap,Lt=new WeakMap,gd=new WeakMap,Vn=new WeakMap,ca=new WeakMap,Vl=new WeakMap,_o=new WeakMap,md=new WeakMap,Bl=new WeakMap,Hl=new WeakMap,ua=new WeakMap,da=new WeakMap,Gi=new WeakMap,Wl=new WeakMap,fa=new WeakSet,cu=function(t){it(this,Sd,qb).call(this);let n=W(this,Lt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(jr)),n},vd=new WeakSet,jb=function(){if(it(this,wd,Wb).call(this),Jl||W(this,Vn).isStale||!Nb(this.options.staleTime))return;const n=E$(W(this,Vn).dataUpdatedAt,this.options.staleTime)+1;_e(this,ua,setTimeout(()=>{W(this,Vn).isStale||this.updateResult()},n))},bd=new WeakSet,Vb=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,Lt)):this.options.refetchInterval)??!1},yd=new WeakSet,Bb=function(t){it(this,_d,Ub).call(this),_e(this,Gi,t),!(Jl||this.options.enabled===!1||!Nb(W(this,Gi))||W(this,Gi)===0)&&_e(this,da,setInterval(()=>{(this.options.refetchIntervalInBackground||ep.isFocused())&&it(this,fa,cu).call(this)},W(this,Gi)))},xd=new WeakSet,Hb=function(){it(this,vd,jb).call(this),it(this,yd,Bb).call(this,it(this,bd,Vb).call(this))},wd=new WeakSet,Wb=function(){W(this,ua)&&(clearTimeout(W(this,ua)),_e(this,ua,void 0))},_d=new WeakSet,Ub=function(){W(this,da)&&(clearInterval(W(this,da)),_e(this,da,void 0))},Sd=new WeakSet,qb=function(){const t=W(this,Zn).getQueryCache().build(W(this,Zn),this.options);if(t===W(this,Lt))return;const n=W(this,Lt);_e(this,Lt,t),_e(this,gd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},zp=new WeakSet,M$=function(t){_n.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(W(this,Vn))}),W(this,Zn).getQueryCache().notify({query:W(this,Lt),type:"observerResultsUpdated"})})},t$);function X9(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function OS(e,t){return X9(e,t)||e.state.dataUpdatedAt>0&&Gb(e,t,t.refetchOnMount)}function Gb(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&vy(e,t)}return!1}function MS(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&vy(e,n)}function vy(e,t){return e.isStaleByTime(t.staleTime)}function Q9(e,t){return!Lb(e.getCurrentResult(),t)}var D$=ie.createContext(void 0),T$=e=>{const t=ie.useContext(D$);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},Z9=({client:e,children:t})=>(ie.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ie.createElement(D$.Provider,{value:e},t)),A$=ie.createContext(!1),J9=()=>ie.useContext(A$);A$.Provider;function eF(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var tF=ie.createContext(eF()),nF=()=>ie.useContext(tF);function rF(e,t){return typeof e=="function"?e(...t):!!e}var oF=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},iF=e=>{ie.useEffect(()=>{e.clearReset()},[e])},sF=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&rF(n,[e.error,r]),aF=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},lF=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,cF=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function uF(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=T$(n),o=J9(),i=nF(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",aF(s),oF(s,i),iF(i);const[a]=ie.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(ie.useSyncExternalStore(ie.useCallback(u=>{const d=o?()=>{}:a.subscribe(_n.batchCalls(u));return a.updateResult(),d},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),ie.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),lF(s,l))throw cF(s,a,i);if(sF({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function So(e,t){return uF(e,K9,t)}let Hf;const dF=new Uint8Array(16);function fF(){if(!Hf&&(Hf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Hf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Hf(dF)}const wn=[];for(let e=0;e<256;++e)wn.push((e+256).toString(16).slice(1));function hF(e,t=0){return wn[e[t+0]]+wn[e[t+1]]+wn[e[t+2]]+wn[e[t+3]]+"-"+wn[e[t+4]]+wn[e[t+5]]+"-"+wn[e[t+6]]+wn[e[t+7]]+"-"+wn[e[t+8]]+wn[e[t+9]]+"-"+wn[e[t+10]]+wn[e[t+11]]+wn[e[t+12]]+wn[e[t+13]]+wn[e[t+14]]+wn[e[t+15]]}const pF=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),DS={randomUUID:pF};function Vu(e,t,n){if(DS.randomUUID&&!t&&!e)return DS.randomUUID();e=e||{};const r=e.random||(e.rng||fF)();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 hF(r)}const Kt=h$()(x$((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:Vu(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:Vu(),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})}}}))),gF=()=>Kt(e=>e.actions);function I$({children:e}){const t=new Y9;return k.jsx(Z9,{client:t,children:e})}var Qe={context:void 0,registry:void 0};function uu(e){Qe.context=e}var mF=(e,t)=>e===t,Bu=Symbol("solid-proxy"),by=Symbol("solid-track"),tp={equals:mF},k$=j$,bi=1,np=2,N$={owned:null,cleanups:null,context:null,owner:null},pv={},bt=null,gv=null,$t=null,In=null,fi=null,qp=0;function ts(e,t){const n=$t,r=bt,o=e.length===0,i=t===void 0?r:t,s=o?N$:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>dn(()=>Yp(s)));bt=s,$t=null;try{return Oo(a,!0)}finally{$t=n,bt=r}}function Tn(e,t){t=t?Object.assign({},tp,t):tp;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),z$(n,o));return[F$.bind(n),r]}function Yb(e,t,n){const r=Gp(e,t,!0,bi);vc(r)}function ns(e,t,n){const r=Gp(e,t,!1,bi);vc(r)}function yy(e,t,n){k$=DF;const r=Gp(e,t,!1,bi);(!n||!n.render)&&(r.user=!0),fi?fi.push(r):vc(r)}function Hn(e,t,n){n=n?Object.assign({},tp,n):tp;const r=Gp(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,vc(r),F$.bind(r)}function vF(e){return e&&typeof e=="object"&&"then"in e}function bF(e,t,n){let r,o,i;arguments.length===2&&typeof t=="object"||arguments.length===1?(r=!0,o=e,i=t||{}):(r=e,o=t,i=n||{});let s=null,a=pv,l=null,u=!1,d="initialValue"in i,f=typeof r=="function"&&Hn(r);const p=new Set,[g,b]=(i.storage||Tn)(i.initialValue),[y,x]=Tn(void 0),[_,w]=Tn(void 0,{equals:!1}),[C,R]=Tn(d?"ready":"unresolved");if(Qe.context){l=`${Qe.context.id}${Qe.context.count++}`;let I;i.ssrLoadFrom==="initial"?a=i.initialValue:Qe.load&&(I=Qe.load(l))&&(a=I)}function E(I,N,V,G){return s===I&&(s=null,G!==void 0&&(d=!0),(I===a||N===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(G,{value:N})),a=pv,T(N,V)),N}function T(I,N){Oo(()=>{N===void 0&&b(()=>I),R(N!==void 0?"errored":d?"ready":"unresolved"),x(N);for(const V of p.keys())V.decrement();p.clear()},!1)}function O(){const I=PF,N=g(),V=y();if(V!==void 0&&!s)throw V;return $t&&!$t.user&&I&&Yb(()=>{_(),s&&(I.resolved||p.has(I)||(I.increment(),p.add(I)))}),N}function D(I=!0){if(I!==!1&&u)return;u=!1;const N=f?f():r;if(N==null||N===!1){E(s,dn(g));return}const V=a!==pv?a:dn(()=>o(N,{value:g(),refetching:I}));return vF(V)?(s=V,"value"in V?(V.status==="success"?E(s,V.value,void 0,N):E(s,void 0,void 0,N),V):(u=!0,queueMicrotask(()=>u=!1),Oo(()=>{R(d?"refreshing":"pending"),w()},!1),V.then(G=>E(V,G,void 0,N),G=>E(V,void 0,B$(G),N)))):(E(s,V,void 0,N),V)}return Object.defineProperties(O,{state:{get:()=>C()},error:{get:()=>y()},loading:{get(){const I=C();return I==="pending"||I==="refreshing"}},latest:{get(){if(!d)return O();const I=y();if(I&&!s)throw I;return g()}}}),f?Yb(()=>D(!1)):D(!1),[O,{refetch:D,mutate:b}]}function yF(e){return Oo(e,!1)}function dn(e){if($t===null)return e();const t=$t;$t=null;try{return e()}finally{$t=t}}function xF(e,t,n){const r=Array.isArray(e);let o,i=n&&n.defer;return s=>{let a;if(r){a=Array(e.length);for(let u=0;u<e.length;u++)a[u]=e[u]()}else a=e();if(i){i=!1;return}const l=dn(()=>t(a,o,s));return o=a,l}}function L$(e){yy(()=>dn(e))}function ec(e){return bt===null||(bt.cleanups===null?bt.cleanups=[e]:bt.cleanups.push(e)),e}function wF(){return $t}function TS(){return bt}function _F(e,t){const n=bt,r=$t;bt=e,$t=null;try{return Oo(t,!0)}catch(o){wy(o)}finally{bt=n,$t=r}}function SF(e){const t=$t,n=bt;return Promise.resolve().then(()=>{$t=t,bt=n;let r;return Oo(e,!1),$t=bt=null,r?r.done:void 0})}var[CF,lle]=Tn(!1);function EF(){return[CF,SF]}function RF(e,t){const n=Symbol("context");return{id:n,Provider:TF(n),defaultValue:e}}function $F(e){return bt&&bt.context&&bt.context[e.id]!==void 0?bt.context[e.id]:e.defaultValue}function xy(e){const t=Hn(e),n=Hn(()=>Kb(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var PF;function F$(){if(this.sources&&this.state)if(this.state===bi)vc(this);else{const e=In;In=null,Oo(()=>op(this),!1),In=e}if($t){const e=this.observers?this.observers.length:0;$t.sources?($t.sources.push(this),$t.sourceSlots.push(e)):($t.sources=[this],$t.sourceSlots=[e]),this.observers?(this.observers.push($t),this.observerSlots.push($t.sources.length-1)):(this.observers=[$t],this.observerSlots=[$t.sources.length-1])}return this.value}function z$(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&Oo(()=>{for(let o=0;o<e.observers.length;o+=1){const i=e.observers[o],s=gv&&gv.running;s&&gv.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?In.push(i):fi.push(i),i.observers&&V$(i)),s||(i.state=bi)}if(In.length>1e6)throw In=[],new Error},!1)),t}function vc(e){if(!e.fn)return;Yp(e);const t=qp;OF(e,e.value,t)}function OF(e,t,n){let r;const o=bt,i=$t;$t=bt=e;try{r=e.fn(t)}catch(s){return e.pure&&(e.state=bi,e.owned&&e.owned.forEach(Yp),e.owned=null),e.updatedAt=n+1,wy(s)}finally{$t=i,bt=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?z$(e,r):e.value=r,e.updatedAt=n)}function Gp(e,t,n,r=bi,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:bt,context:bt?bt.context:null,pure:n};return bt===null||bt!==N$&&(bt.owned?bt.owned.push(i):bt.owned=[i]),i}function rp(e){if(e.state===0)return;if(e.state===np)return op(e);if(e.suspense&&dn(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<qp);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===bi)vc(e);else if(e.state===np){const r=In;In=null,Oo(()=>op(e,t[0]),!1),In=r}}function Oo(e,t){if(In)return e();let n=!1;t||(In=[]),fi?n=!0:fi=[],qp++;try{const r=e();return MF(n),r}catch(r){n||(fi=null),In=null,wy(r)}}function MF(e){if(In&&(j$(In),In=null),e)return;const t=fi;fi=null,t.length&&Oo(()=>k$(t),!1)}function j$(e){for(let t=0;t<e.length;t++)rp(e[t])}function DF(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:rp(r)}if(Qe.context){if(Qe.count){Qe.effects||(Qe.effects=[]),Qe.effects.push(...e.slice(0,n));return}else Qe.effects&&(e=[...Qe.effects,...e],n+=Qe.effects.length,delete Qe.effects);uu()}for(t=0;t<n;t++)rp(e[t])}function op(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const o=r.state;o===bi?r!==t&&(!r.updatedAt||r.updatedAt<qp)&&rp(r):o===np&&op(r,t)}}}function V$(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=np,n.pure?In.push(n):fi.push(n),n.observers&&V$(n))}}function Yp(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){const i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Yp(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function B$(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function wy(e,t=bt){throw B$(e)}function Kb(e){if(typeof e=="function"&&!e.length)return Kb(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Kb(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function TF(e,t){return function(r){let o;return ns(()=>o=dn(()=>(bt.context={...bt.context,[e]:r.value},xy(()=>r.children))),void 0),o}}var Xb=Symbol("fallback");function ip(e){for(let t=0;t<e.length;t++)e[t]()}function AF(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return ec(()=>ip(i)),()=>{let l=e()||[],u,d;return l[by],dn(()=>{let p=l.length,g,b,y,x,_,w,C,R,E;if(p===0)s!==0&&(ip(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Xb],o[0]=ts(T=>(i[0]=T,n.fallback())),s=1);else if(s===0){for(o=new Array(p),d=0;d<p;d++)r[d]=l[d],o[d]=ts(f);s=p}else{for(y=new Array(p),x=new Array(p),a&&(_=new Array(p)),w=0,C=Math.min(s,p);w<C&&r[w]===l[w];w++);for(C=s-1,R=p-1;C>=w&&R>=w&&r[C]===l[R];C--,R--)y[R]=o[C],x[R]=i[C],a&&(_[R]=a[C]);for(g=new Map,b=new Array(R+1),d=R;d>=w;d--)E=l[d],u=g.get(E),b[d]=u===void 0?-1:u,g.set(E,d);for(u=w;u<=C;u++)E=r[u],d=g.get(E),d!==void 0&&d!==-1?(y[d]=o[u],x[d]=i[u],a&&(_[d]=a[u]),d=b[d],g.set(E,d)):i[u]();for(d=w;d<p;d++)d in y?(o[d]=y[d],i[d]=x[d],a&&(a[d]=_[d],a[d](d))):o[d]=ts(f);o=o.slice(0,s=p),r=l.slice(0)}return o});function f(p){if(i[d]=p,a){const[g,b]=Tn(d);return a[d]=b,t(l[d],g)}return t(l[d])}}}function IF(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,l;return ec(()=>ip(i)),()=>{const u=e()||[];return u[by],dn(()=>{if(u.length===0)return a!==0&&(ip(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[Xb],o[0]=ts(f=>(i[0]=f,n.fallback())),a=1),o;for(r[0]===Xb&&(i[0](),i=[],r=[],o=[],a=0),l=0;l<u.length;l++)l<r.length&&r[l]!==u[l]?s[l](()=>u[l]):l>=r.length&&(o[l]=ts(d));for(;l<r.length;l++)i[l]();return a=s.length=i.length=u.length,r=u.slice(0),o=o.slice(0,a)});function d(f){i[l]=f;const[p,g]=Tn(u[l]);return s[l]=g,t(p,l)}}}function H$(e,t){return dn(()=>e(t||{}))}function Wf(){return!0}var Qb={get(e,t,n){return t===Bu?n:e.get(t)},has(e,t){return t===Bu?!0:e.has(t)},set:Wf,deleteProperty:Wf,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Wf,deleteProperty:Wf}},ownKeys(e){return e.keys()}};function mv(e){return(e=typeof e=="function"?e():e)?e:{}}function kF(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function W$(...e){let t=!1;for(let i=0;i<e.length;i++){const s=e[i];t=t||!!s&&Bu in s,e[i]=typeof s=="function"?(t=!0,Hn(s)):s}if(t)return new Proxy({get(i){for(let s=e.length-1;s>=0;s--){const a=mv(e[s])[i];if(a!==void 0)return a}},has(i){for(let s=e.length-1;s>=0;s--)if(i in mv(e[s]))return!0;return!1},keys(){const i=[];for(let s=0;s<e.length;s++)i.push(...Object.keys(mv(e[s])));return[...new Set(i)]}},Qb);const n={},r={},o=new Set;for(let i=e.length-1;i>=0;i--){const s=e[i];if(!s)continue;const a=Object.getOwnPropertyNames(s);for(let l=0,u=a.length;l<u;l++){const d=a[l];if(d==="__proto__"||d==="constructor")continue;const f=Object.getOwnPropertyDescriptor(s,d);if(!o.has(d))f.get?(o.add(d),Object.defineProperty(n,d,{enumerable:!0,configurable:!0,get:kF.bind(r[d]=[f.get.bind(s)])})):(f.value!==void 0&&o.add(d),n[d]=f.value);else{const p=r[d];p?f.get?p.push(f.get.bind(s)):f.value!==void 0&&p.push(()=>f.value):n[d]===void 0&&(n[d]=f.value)}}}return n}function U$(e,...t){if(Bu in e){const o=new Set(t.length>1?t.flat():t[0]),i=t.map(s=>new Proxy({get(a){return s.includes(a)?e[a]:void 0},has(a){return s.includes(a)&&a in e},keys(){return s.filter(a=>a in e)}},Qb));return i.push(new Proxy({get(s){return o.has(s)?void 0:e[s]},has(s){return o.has(s)?!1:s in e},keys(){return Object.keys(e).filter(s=>!o.has(s))}},Qb)),i}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),s=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let a=!1,l=0;for(const u of t)u.includes(o)&&(a=!0,s?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;a||(s?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}function NF(e){let t,n;const r=o=>{const i=Qe.context;if(i){const[a,l]=Tn();Qe.count||(Qe.count=0),Qe.count++,(n||(n=e())).then(u=>{uu(i),Qe.count--,l(()=>u.default),uu()}),t=a}else if(!t){const[a]=bF(()=>(n||(n=e())).then(l=>l.default));t=a}let s;return Hn(()=>(s=t())&&dn(()=>{if(!i)return s(o);const a=Qe.context;uu(i);const l=s(o);return uu(a),l}))};return r.preload=()=>n||((n=e()).then(o=>t=()=>o.default),n),r}var LF=0;function FF(){const e=Qe.context;return e?`${e.id}${e.count++}`:`cl-${LF++}`}var q$=e=>`Stale read from <${e}>.`;function zF(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Hn(AF(()=>e.each,e.children,t||void 0))}function jF(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Hn(IF(()=>e.each,e.children,t||void 0))}function VF(e){const t=e.keyed,n=Hn(()=>e.when,void 0,{equals:(r,o)=>t?r===o:!r==!o});return Hn(()=>{const r=n();if(r){const o=e.children;return typeof o=="function"&&o.length>0?dn(()=>o(t?r:()=>{if(!dn(n))throw q$("Show");return e.when})):o}return e.fallback},void 0,void 0)}function BF(e){let t=!1;const n=(i,s)=>i[0]===s[0]&&(t?i[1]===s[1]:!i[1]==!s[1])&&i[2]===s[2],r=xy(()=>e.children),o=Hn(()=>{let i=r();Array.isArray(i)||(i=[i]);for(let s=0;s<i.length;s++){const a=i[s].when;if(a)return t=!!i[s].keyed,[s,a,i[s]]}return[-1]},void 0,{equals:n});return Hn(()=>{const[i,s,a]=o();if(i<0)return e.fallback;const l=a.children;return typeof l=="function"&&l.length>0?dn(()=>l(t?s:()=>{if(dn(o)[0]!==i)throw q$("Match");return a.when})):l},void 0,void 0)}function HF(e){return e}var WF=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],UF=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...WF]),qF=new Set(["innerHTML","textContent","innerText","children"]),GF=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),YF=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});function KF(e,t){const n=YF[e];return typeof n=="object"?n[t]?n.$:void 0:n}var XF=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),QF=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),ZF={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function JF(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,u=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){const d=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],d)}else if(i===a)for(;s<o;)(!u||!u.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){const d=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],d),t[o]=n[i]}else{if(!u){u=new Map;let f=a;for(;f<i;)u.set(n[f],f++)}const d=u.get(t[s]);if(d!=null)if(a<d&&d<i){let f=s,p=1,g;for(;++f<o&&f<i&&!((g=u.get(t[f]))==null||g!==d+p);)p++;if(p>d-a){const b=t[s];for(;a<d;)e.insertBefore(n[a++],b)}else e.replaceChild(n[a++],t[s++])}else s++;else t[s++].remove()}}}var AS="_$DX_DELEGATE";function e4(e,t,n,r={}){let o;return ts(i=>{o=i,t===document?e():ap(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function t4(e,t,n){let r;const o=()=>{const s=document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:s.content.firstChild},i=t?()=>dn(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function G$(e,t=window.document){const n=t[AS]||(t[AS]=new Set);for(let r=0,o=e.length;r<o;r++){const i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,c4))}}function sp(e,t,n){Qe.context||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function n4(e,t,n,r){Qe.context||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function Y$(e,t){Qe.context||(t==null?e.removeAttribute("class"):e.className=t)}function K$(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const o=n[0];e.addEventListener(t,n[0]=i=>o.call(e,n[1],i))}else e.addEventListener(t,n)}function r4(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,s;for(i=0,s=o.length;i<s;i++){const a=o[i];!a||a==="undefined"||t[a]||(IS(e,a,!1),delete n[a])}for(i=0,s=r.length;i<s;i++){const a=r[i],l=!!t[a];!a||a==="undefined"||n[a]===l||!l||(IS(e,a,!0),n[a]=l)}return n}function o4(e,t,n){if(!t)return n?sp(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function X$(e,t={},n,r){const o={};return r||ns(()=>o.children=tc(e,t.children,o.children)),ns(()=>t.ref&&t.ref(e)),ns(()=>s4(e,t,n,!0,o,!0)),o}function i4(e,t,n){return dn(()=>e(t,n))}function ap(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return tc(e,t,r,n);ns(o=>tc(e,t(),o,n),r)}function s4(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=kS(e,s,null,o[s],n,i)}for(const s in t){if(s==="children"){r||tc(e,t.children);continue}const a=t[s];o[s]=kS(e,s,a,o[s],n,i)}}function a4(e){let t,n;return!Qe.context||!(t=Qe.registry.get(n=u4()))?e():(Qe.completed&&Qe.completed.add(t),Qe.registry.delete(n),t)}function l4(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function IS(e,t,n){const r=t.trim().split(/\s+/);for(let o=0,i=r.length;o<i;o++)e.classList.toggle(r[o],n)}function kS(e,t,n,r,o,i){let s,a,l,u,d;if(t==="style")return o4(e,n,r);if(t==="classList")return r4(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const f=t.slice(3);r&&e.removeEventListener(f,r),n&&e.addEventListener(f,n)}else if(t.slice(0,10)==="oncapture:"){const f=t.slice(10);r&&e.removeEventListener(f,r,!0),n&&e.addEventListener(f,n,!0)}else if(t.slice(0,2)==="on"){const f=t.slice(2).toLowerCase(),p=XF.has(f);if(!p&&r){const g=Array.isArray(r)?r[0]:r;e.removeEventListener(f,g)}(p||n)&&(K$(e,f,n,p),p&&G$([f]))}else if(t.slice(0,5)==="attr:")sp(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(l=qF.has(t))||!o&&((u=KF(t,e.tagName))||(a=UF.has(t)))||(s=e.nodeName.includes("-"))){if(d)t=t.slice(5),a=!0;else if(Qe.context)return n;t==="class"||t==="className"?Y$(e,n):s&&!a&&!l?e[l4(t)]=n:e[u||t]=n}else{const f=o&&t.indexOf(":")>-1&&ZF[t.split(":")[0]];f?n4(e,f,t,n):sp(e,GF[t]||t,n)}return n}function c4(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),Qe.registry&&!Qe.done&&(Qe.done=_$HY.done=!0);n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(o!==void 0?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function tc(e,t,n,r,o){if(Qe.context){!n&&(n=[...e.childNodes]);let a=[];for(let l=0;l<n.length;l++){const u=n[l];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():a.push(u)}n=a}for(;typeof n=="function";)n=n();if(t===n)return n;const i=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,i==="string"||i==="number"){if(Qe.context)return n;if(i==="number"&&(t=t.toString()),s){let a=n[0];a&&a.nodeType===3?a.data=t:a=document.createTextNode(t),n=ol(e,n,r,a)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||i==="boolean"){if(Qe.context)return n;n=ol(e,n,r)}else{if(i==="function")return ns(()=>{let a=t();for(;typeof a=="function";)a=a();n=tc(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(Zb(a,t,n,o))return ns(()=>n=tc(e,a,n,r,!0)),()=>n;if(Qe.context){if(!a.length)return n;if(r===void 0)return[...e.childNodes];let u=a[0],d=[u];for(;(u=u.nextSibling)!==r;)d.push(u);return n=d}if(a.length===0){if(n=ol(e,n,r),s)return n}else l?n.length===0?NS(e,a,r):JF(e,n,a):(n&&ol(e),NS(e,a));n=a}else if(t.nodeType){if(Qe.context&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=ol(e,n,r,t);ol(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Zb(e,t,n,r){let o=!1;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[i],u;if(!(a==null||a===!0||a===!1))if((u=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Zb(e,a,l)||o;else if(u==="function")if(r){for(;typeof a=="function";)a=a();o=Zb(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else e.push(a),o=!0;else{const d=String(a);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d))}}return o}function NS(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function ol(e,t,n,r){if(n===void 0)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let i=!1;for(let s=t.length-1;s>=0;s--){const a=t[s];if(o!==a){const l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove()}else i=!0}}else e.insertBefore(o,n);return[o]}function u4(){const e=Qe.context;return`${e.id}${e.count++}`}var d4="http://www.w3.org/2000/svg";function Q$(e,t=!1){return t?document.createElementNS(d4,e):document.createElement(e)}function f4(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=TS();let i,s=!!Qe.context;return yy(()=>{s&&(TS().user=s=!1),i||(i=_F(o,()=>Hn(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,u]=Tn(!1),d=()=>u(!0);ts(f=>ap(a,()=>l()?f():i(),null)),ec(d)}else{const l=Q$(e.isSVG?"g":"div",e.isSVG),u=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),ap(u,i),a.appendChild(l),e.ref&&e.ref(l),ec(()=>a.removeChild(l))}},void 0,{render:!s}),n}function h4(e){const[t,n]=U$(e,["component"]),r=Hn(()=>t.component);return Hn(()=>{const o=r();switch(typeof o){case"function":return dn(()=>o(n));case"string":const i=QF.has(o),s=Qe.context?a4():Q$(o,i);return X$(s,n,i),s}})}var p4=function(){function e(){this.keyToValue=new Map,this.valueToKey=new Map}return e.prototype.set=function(t,n){this.keyToValue.set(t,n),this.valueToKey.set(n,t)},e.prototype.getByKey=function(t){return this.keyToValue.get(t)},e.prototype.getByValue=function(t){return this.valueToKey.get(t)},e.prototype.clear=function(){this.keyToValue.clear(),this.valueToKey.clear()},e}(),Z$=function(){function e(t){this.generateIdentifier=t,this.kv=new p4}return e.prototype.register=function(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))},e.prototype.clear=function(){this.kv.clear()},e.prototype.getIdentifier=function(t){return this.kv.getByValue(t)},e.prototype.getValue=function(t){return this.kv.getByKey(t)},e}(),g4=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),m4=function(e){g4(t,e);function t(){var n=e.call(this,function(r){return r.name})||this;return n.classToAllowedProps=new Map,n}return t.prototype.register=function(n,r){typeof r=="object"?(r.allowProps&&this.classToAllowedProps.set(n,r.allowProps),e.prototype.register.call(this,n,r.identifier)):e.prototype.register.call(this,n,r)},t.prototype.getAllowedProps=function(n){return this.classToAllowedProps.get(n)},t}(Z$),v4=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i};function b4(e){if("values"in Object)return Object.values(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function y4(e,t){var n=b4(e);if("find"in n)return n.find(t);for(var r=n,o=0;o<r.length;o++){var i=r[o];if(t(i))return i}}function nc(e,t){Object.entries(e).forEach(function(n){var r=v4(n,2),o=r[0],i=r[1];return t(i,o)})}function Lh(e,t){return e.indexOf(t)!==-1}function LS(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(t(r))return r}}var x4=function(){function e(){this.transfomers={}}return e.prototype.register=function(t){this.transfomers[t.name]=t},e.prototype.findApplicable=function(t){return y4(this.transfomers,function(n){return n.isApplicable(t)})},e.prototype.findByName=function(t){return this.transfomers[t]},e}(),w4=function(e){return Object.prototype.toString.call(e).slice(8,-1)},J$=function(e){return typeof e>"u"},_4=function(e){return e===null},Hu=function(e){return typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype},Jb=function(e){return Hu(e)&&Object.keys(e).length===0},is=function(e){return Array.isArray(e)},S4=function(e){return typeof e=="string"},C4=function(e){return typeof e=="number"&&!isNaN(e)},E4=function(e){return typeof e=="boolean"},R4=function(e){return e instanceof RegExp},Wu=function(e){return e instanceof Map},Uu=function(e){return e instanceof Set},eP=function(e){return w4(e)==="Symbol"},$4=function(e){return e instanceof Date&&!isNaN(e.valueOf())},P4=function(e){return e instanceof Error},FS=function(e){return typeof e=="number"&&isNaN(e)},O4=function(e){return E4(e)||_4(e)||J$(e)||C4(e)||S4(e)||eP(e)},M4=function(e){return typeof e=="bigint"},D4=function(e){return e===1/0||e===-1/0},T4=function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},A4=function(e){return e instanceof URL},tP=function(e){return e.replace(/\./g,"\\.")},vv=function(e){return e.map(String).map(tP).join(".")},_u=function(e){for(var t=[],n="",r=0;r<e.length;r++){var o=e.charAt(r),i=o==="\\"&&e.charAt(r+1)===".";if(i){n+=".",r++;continue}var s=o===".";if(s){t.push(n),n="";continue}n+=o}var a=n;return t.push(a),t},e0=function(){return e0=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},e0.apply(this,arguments)},t0=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i},n0=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e};function go(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var nP=[go(J$,"undefined",function(){return null},function(){}),go(M4,"bigint",function(e){return e.toString()},function(e){return typeof BigInt<"u"?BigInt(e):e}),go($4,"Date",function(e){return e.toISOString()},function(e){return new Date(e)}),go(P4,"Error",function(e,t){var n={name:e.name,message:e.message};return t.allowedErrorProps.forEach(function(r){n[r]=e[r]}),n},function(e,t){var n=new Error(e.message);return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(function(r){n[r]=e[r]}),n}),go(R4,"regexp",function(e){return""+e},function(e){var t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),go(Uu,"set",function(e){return n0([],t0(e.values()))},function(e){return new Set(e)}),go(Wu,"map",function(e){return n0([],t0(e.entries()))},function(e){return new Map(e)}),go(function(e){return FS(e)||D4(e)},"number",function(e){return FS(e)?"NaN":e>0?"Infinity":"-Infinity"},Number),go(function(e){return e===0&&1/e===-1/0},"number",function(){return"-0"},Number),go(A4,"URL",function(e){return e.toString()},function(e){return new URL(e)})];function Kp(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var rP=Kp(function(e,t){if(eP(e)){var n=!!t.symbolRegistry.getIdentifier(e);return n}return!1},function(e,t){var n=t.symbolRegistry.getIdentifier(e);return["symbol",n]},function(e){return e.description},function(e,t,n){var r=n.symbolRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown symbol");return r}),I4=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(function(e,t){return e[t.name]=t,e},{}),oP=Kp(T4,function(e){return["typed-array",e.constructor.name]},function(e){return n0([],t0(e))},function(e,t){var n=I4[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function iP(e,t){if(e!=null&&e.constructor){var n=!!t.classRegistry.getIdentifier(e.constructor);return n}return!1}var sP=Kp(iP,function(e,t){var n=t.classRegistry.getIdentifier(e.constructor);return["class",n]},function(e,t){var n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return e0({},e);var r={};return n.forEach(function(o){r[o]=e[o]}),r},function(e,t,n){var r=n.classRegistry.getValue(t[1]);if(!r)throw new Error("Trying to deserialize unknown class - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564");return Object.assign(Object.create(r.prototype),e)}),aP=Kp(function(e,t){return!!t.customTransformerRegistry.findApplicable(e)},function(e,t){var n=t.customTransformerRegistry.findApplicable(e);return["custom",n.name]},function(e,t){var n=t.customTransformerRegistry.findApplicable(e);return n.serialize(e)},function(e,t,n){var r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw new Error("Trying to deserialize unknown custom value");return r.deserialize(e)}),k4=[sP,rP,aP,oP],zS=function(e,t){var n=LS(k4,function(o){return o.isApplicable(e,t)});if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};var r=LS(nP,function(o){return o.isApplicable(e,t)});if(r)return{value:r.transform(e,t),type:r.annotation}},lP={};nP.forEach(function(e){lP[e.annotation]=e});var N4=function(e,t,n){if(is(t))switch(t[0]){case"symbol":return rP.untransform(e,t,n);case"class":return sP.untransform(e,t,n);case"custom":return aP.untransform(e,t,n);case"typed-array":return oP.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{var r=lP[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},_l=function(e,t){for(var n=e.keys();t>0;)n.next(),t--;return n.next().value};function cP(e){if(Lh(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Lh(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Lh(e,"constructor"))throw new Error("constructor is not allowed as a property")}var L4=function(e,t){cP(t);for(var n=0;n<t.length;n++){var r=t[n];if(Uu(e))e=_l(e,+r);else if(Wu(e)){var o=+r,i=+t[++n]==0?"key":"value",s=_l(e,o);switch(i){case"key":e=s;break;case"value":e=e.get(s);break}}else e=e[r]}return e},r0=function(e,t,n){if(cP(t),t.length===0)return n(e);for(var r=e,o=0;o<t.length-1;o++){var i=t[o];if(is(r)){var s=+i;r=r[s]}else if(Hu(r))r=r[i];else if(Uu(r)){var a=+i;r=_l(r,a)}else if(Wu(r)){var l=o===t.length-2;if(l)break;var a=+i,u=+t[++o]==0?"key":"value",d=_l(r,a);switch(u){case"key":r=d;break;case"value":r=r.get(d);break}}}var f=t[t.length-1];if(is(r)?r[+f]=n(r[+f]):Hu(r)&&(r[f]=n(r[f])),Uu(r)){var p=_l(r,+f),g=n(p);p!==g&&(r.delete(p),r.add(g))}if(Wu(r)){var a=+t[t.length-2],b=_l(r,a),u=+f==0?"key":"value";switch(u){case"key":{var y=n(b);r.set(y,r.get(b)),y!==b&&r.delete(b);break}case"value":{r.set(b,n(r.get(b)));break}}}return e},ai=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i},Yi=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e};function o0(e,t,n){if(n===void 0&&(n=[]),!!e){if(!is(e)){nc(e,function(s,a){return o0(s,t,Yi(Yi([],ai(n)),ai(_u(a))))});return}var r=ai(e,2),o=r[0],i=r[1];i&&nc(i,function(s,a){o0(s,t,Yi(Yi([],ai(n)),ai(_u(a))))}),t(o,n)}}function F4(e,t,n){return o0(t,function(r,o){e=r0(e,o,function(i){return N4(i,r,n)})}),e}function z4(e,t){function n(s,a){var l=L4(e,_u(a));s.map(_u).forEach(function(u){e=r0(e,u,function(){return l})})}if(is(t)){var r=ai(t,2),o=r[0],i=r[1];o.forEach(function(s){e=r0(e,_u(s),function(){return e})}),i&&nc(i,n)}else nc(t,n);return e}var j4=function(e,t){return Hu(e)||is(e)||Wu(e)||Uu(e)||iP(e,t)};function V4(e,t,n){var r=n.get(e);r?r.push(t):n.set(e,[t])}function B4(e,t){var n={},r=void 0;return e.forEach(function(o){if(!(o.length<=1)){t||(o=o.map(function(l){return l.map(String)}).sort(function(l,u){return l.length-u.length}));var i=ai(o),s=i[0],a=i.slice(1);s.length===0?r=a.map(vv):n[vv(s)]=a.map(vv)}}),r?Jb(n)?[r]:[r,n]:Jb(n)?void 0:n}var uP=function(e,t,n,r,o,i,s){var a;o===void 0&&(o=[]),i===void 0&&(i=[]),s===void 0&&(s=new Map);var l=O4(e);if(!l){V4(e,o,t);var u=s.get(e);if(u)return r?{transformedValue:null}:u}if(!j4(e,n)){var d=zS(e,n),f=d?{transformedValue:d.value,annotations:[d.type]}:{transformedValue:e};return l||s.set(e,f),f}if(Lh(i,e))return{transformedValue:null};var p=zS(e,n),g=(a=p==null?void 0:p.value)!==null&&a!==void 0?a:e,b=is(g)?[]:{},y={};nc(g,function(_,w){var C=uP(_,t,n,r,Yi(Yi([],ai(o)),[w]),Yi(Yi([],ai(i)),[e]),s);b[w]=C.transformedValue,is(C.annotations)?y[w]=C.annotations:Hu(C.annotations)&&nc(C.annotations,function(R,E){y[tP(w)+"."+E]=R})});var x=Jb(y)?{transformedValue:b,annotations:p?[p.type]:void 0}:{transformedValue:b,annotations:p?[p.type,y]:y};return l||s.set(e,x),x};function dP(e){return Object.prototype.toString.call(e).slice(8,-1)}function H4(e){if(dP(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function jS(e){return dP(e)==="Array"}function W4(e,t,n,r,o){const i={}.propertyIsEnumerable.call(r,t)?"enumerable":"nonenumerable";i==="enumerable"&&(e[t]=n),o&&i==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function i0(e,t={}){if(jS(e))return e.map(o=>i0(o,t));if(!H4(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((o,i)=>{if(jS(t.props)&&!t.props.includes(i))return o;const s=e[i],a=i0(s,t);return W4(o,i,a,e,t.nonenumerable),o},{})}var Zs=function(){return Zs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Zs.apply(this,arguments)},U4=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i},q4=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},fP=function(){function e(t){var n=t===void 0?{}:t,r=n.dedupe,o=r===void 0?!1:r;this.classRegistry=new m4,this.symbolRegistry=new Z$(function(i){var s;return(s=i.description)!==null&&s!==void 0?s:""}),this.customTransformerRegistry=new x4,this.allowedErrorProps=[],this.dedupe=o}return e.prototype.serialize=function(t){var n=new Map,r=uP(t,n,this,this.dedupe),o={json:r.transformedValue};r.annotations&&(o.meta=Zs(Zs({},o.meta),{values:r.annotations}));var i=B4(n,this.dedupe);return i&&(o.meta=Zs(Zs({},o.meta),{referentialEqualities:i})),o},e.prototype.deserialize=function(t){var n=t.json,r=t.meta,o=i0(n);return r!=null&&r.values&&(o=F4(o,r.values,this)),r!=null&&r.referentialEqualities&&(o=z4(o,r.referentialEqualities)),o},e.prototype.stringify=function(t){return JSON.stringify(this.serialize(t))},e.prototype.parse=function(t){return this.deserialize(JSON.parse(t))},e.prototype.registerClass=function(t,n){this.classRegistry.register(t,n)},e.prototype.registerSymbol=function(t,n){this.symbolRegistry.register(t,n)},e.prototype.registerCustom=function(t,n){this.customTransformerRegistry.register(Zs({name:n},t))},e.prototype.allowErrorProps=function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];(t=this.allowedErrorProps).push.apply(t,q4([],U4(n)))},e.defaultInstance=new e,e.serialize=e.defaultInstance.serialize.bind(e.defaultInstance),e.deserialize=e.defaultInstance.deserialize.bind(e.defaultInstance),e.stringify=e.defaultInstance.stringify.bind(e.defaultInstance),e.parse=e.defaultInstance.parse.bind(e.defaultInstance),e.registerClass=e.defaultInstance.registerClass.bind(e.defaultInstance),e.registerSymbol=e.defaultInstance.registerSymbol.bind(e.defaultInstance),e.registerCustom=e.defaultInstance.registerCustom.bind(e.defaultInstance),e.allowErrorProps=e.defaultInstance.allowErrorProps.bind(e.defaultInstance),e}(),G4=fP.serialize,Y4=fP.stringify;function K4(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function X4(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function Q4({queryState:e,observerCount:t,isStale:n}){return e.fetchStatus==="fetching"?"blue":t?e.fetchStatus==="paused"?"purple":n?"yellow":"green":"gray"}function Z4({status:e,isPaused:t}){return t?"purple":e==="error"?"red":e==="pending"?"yellow":e==="success"?"green":"gray"}function J4(e){return e==="fresh"?"green":e==="stale"?"yellow":e==="paused"?"purple":e==="inactive"?"gray":"blue"}var e8=(e,t=!1)=>{const{json:n}=G4(e);return JSON.stringify(n,null,t?2:void 0)},Uf=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,t8=(e,t)=>e.queryHash.localeCompare(t.queryHash),hP=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,n8=(e,t)=>Uf(e)===Uf(t)?hP(e,t):Uf(e)>Uf(t)?1:-1,r8={status:n8,"query hash":t8,"last updated":hP},qf=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,pP=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,o8=(e,t)=>qf(e)===qf(t)?pP(e,t):qf(e)>qf(t)?1:-1,i8={status:o8,"last updated":pP},s8=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),a8=()=>{const[e,t]=Tn("dark");return L$(()=>{const n=window.matchMedia("(prefers-color-scheme: dark)");t(n.matches?"dark":"light");const r=o=>{t(o.matches?"dark":"light")};n.addEventListener("change",r),ec(()=>n.removeEventListener("change",r))}),e},du=(e,t,n)=>{if(t.length===0)return n;if(e instanceof Map){const r=new Map(e);if(t.length===1)return r.set(t[0],n),r;const[o,...i]=t;return r.set(o,du(r.get(o),i,n)),r}if(e instanceof Set){const r=du(Array.from(e),t,n);return new Set(r)}if(Array.isArray(e)){const r=[...e];if(t.length===1)return r[t[0]]=n,r;const[o,...i]=t;return r[o]=du(r[o],i,n),r}if(e instanceof Object){const r={...e};if(t.length===1)return r[t[0]]=n,r;const[o,...i]=t;return r[o]=du(r[o],i,n),r}return e},fu=(e,t)=>{if(e instanceof Map){const n=new Map(e);if(t.length===1)return n.delete(t[0]),n;const[r,...o]=t;return n.set(r,fu(n.get(r),o)),n}if(e instanceof Set){const n=fu(Array.from(e),t);return new Set(n)}if(Array.isArray(e)){const n=[...e];if(t.length===1)return n.filter((i,s)=>s.toString()!==t[0]);const[r,...o]=t;return n[r]=fu(n[r],o),n}if(e instanceof Object){const n={...e};if(t.length===1)return delete n[t[0]],n;const[r,...o]=t;return n[r]=fu(n[r],o),n}return e},l8=e=>{if(!e||document.querySelector("#_goober"))return;const n=document.createElement("style"),r=document.createTextNode("");n.appendChild(r),n.id="_goober",n.setAttribute("nonce",e),document.head.appendChild(n)},Ul,Cd,Ed,Rd,ha,$d,ql,Gl,Yl,Kl,Xl,Pd,n$,c8=(n$=class{constructor(e){Oe(this,Ul,void 0);Oe(this,Cd,void 0);Oe(this,Ed,void 0);Oe(this,Rd,void 0);Oe(this,ha,!1);Oe(this,$d,void 0);Oe(this,ql,void 0);Oe(this,Gl,void 0);Oe(this,Yl,void 0);Oe(this,Kl,void 0);Oe(this,Xl,void 0);Oe(this,Pd,void 0);const{client:t,queryFlavor:n,version:r,onlineManager:o,buttonPosition:i,position:s,initialIsOpen:a,errorTypes:l,styleNonce:u}=e;_e(this,Ul,Tn(t)),_e(this,Ed,n),_e(this,Rd,r),_e(this,Cd,o),_e(this,$d,u),_e(this,ql,Tn(i)),_e(this,Gl,Tn(s)),_e(this,Yl,Tn(a)),_e(this,Kl,Tn(l))}setButtonPosition(e){W(this,ql)[1](e)}setPosition(e){W(this,Gl)[1](e)}setInitialIsOpen(e){W(this,Yl)[1](e)}setErrorTypes(e){W(this,Kl)[1](e)}setClient(e){W(this,Ul)[1](e)}mount(e){if(W(this,ha))throw new Error("Devtools is already mounted");const t=e4(()=>{const[n]=W(this,ql),[r]=W(this,Gl),[o]=W(this,Yl),[i]=W(this,Kl),[s]=W(this,Ul);let a;W(this,Xl)?a=W(this,Xl):(a=NF(()=>Promise.resolve().then(()=>require("./2DAFLIRC-QEwj8O5E.js"))),_e(this,Xl,a)),l8(W(this,$d));const l=this;return H$(a,W$({get queryFlavor(){return W(l,Ed)},get version(){return W(l,Rd)},get onlineManager(){return W(l,Cd)}},{get client(){return s()},get buttonPosition(){return n()},get position(){return r()},get initialIsOpen(){return o()},get errorTypes(){return i()}}))},e);_e(this,ha,!0),_e(this,Pd,t)}unmount(){var e;if(!W(this,ha))throw new Error("Devtools is not mounted");(e=W(this,Pd))==null||e.call(this),_e(this,ha,!1)}},Ul=new WeakMap,Cd=new WeakMap,Ed=new WeakMap,Rd=new WeakMap,ha=new WeakMap,$d=new WeakMap,ql=new WeakMap,Gl=new WeakMap,Yl=new WeakMap,Kl=new WeakMap,Xl=new WeakMap,Pd=new WeakMap,n$);function u8(e){const t=T$(),n=e.client||t,r=ie.useRef(null),{buttonPosition:o,position:i,initialIsOpen:s,errorTypes:a,styleNonce:l}=e,[u]=ie.useState(new c8({client:n,queryFlavor:"React Query",version:"5",onlineManager:ju,buttonPosition:o,position:i,initialIsOpen:s,errorTypes:a,styleNonce:l}));return ie.useEffect(()=>{u.setClient(n)},[n,u]),ie.useEffect(()=>{o&&u.setButtonPosition(o)},[o,u]),ie.useEffect(()=>{i&&u.setPosition(i)},[i,u]),ie.useEffect(()=>{u.setInitialIsOpen(s||!1)},[s,u]),ie.useEffect(()=>{u.setErrorTypes(a||[])},[a,u]),ie.useEffect(()=>(r.current&&u.mount(r.current),()=>{u.unmount()}),[u]),ie.createElement("div",{className:"tsqd-parent-container",ref:r})}var d8=process.env.NODE_ENV!=="development"?function(){return null}:u8;const f8={id:"",authToken:void 0},gP=m.createContext(f8),mP=({children:e,dashboardProps:t})=>k.jsxs(I$,{children:[k.jsx(gP.Provider,{value:t,children:e}),k.jsx(d8,{initialIsOpen:!1})]});function Da(){const e=m.useContext(gP);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function h8(e,t){var be;let n=m.useMemo(()=>[],[]);const r=Da().authToken||e,o=Kt(H=>H.selectedConnectionId),i=Kt(H=>H.selectedDatabaseName),s=Kt(H=>H.selectedSchemaName),a=Kt(H=>H.selectedTableName),l=Kt(H=>H.actions.setCurrentColumns),u=Kt(H=>H.actions.setSelectedConnectionId),d=Kt(H=>H.actions.setSelectedDatabaseName),f=Kt(H=>H.actions.setSelectedSchemaName),p=Kt(H=>H.actions.setSelectedTableName),g=Kt(H=>H.actions.setCardSql),{data:b,isLoading:y,isError:x}=So({queryKey:["connections"],queryFn:()=>yl("https://semaphor.cloud/api/v1/connections",(r==null?void 0:r.accessToken)||""),enabled:!!(r!=null&&r.accessToken)}),_=b==null?void 0:b.connections.find(H=>H.id===o),w=(_==null?void 0:_.type)==="API"||(_==null?void 0:_.type)==="S3",{data:C,isLoading:R,isFetching:E,isError:T,refetch:O}=So({queryKey:[o],queryFn:()=>yl("https://semaphor.cloud/api/v1/databases",(r==null?void 0:r.accessToken)||"",{connection_id:o}),enabled:!!o&&!w}),{data:D,isLoading:I,isFetching:N,isError:V,refetch:G}=So({queryKey:[o,i],queryFn:()=>yl("https://semaphor.cloud/api/v1/schemas",(r==null?void 0:r.accessToken)||"",{connection_id:o,database_name:i}),enabled:!!o&&!!i&&!w}),{data:le,isLoading:ee,isFetching:F,isError:Z,refetch:Y}=So({queryKey:[o,i,s],queryFn:()=>yl("https://semaphor.cloud/api/v1/tables",(r==null?void 0:r.accessToken)||"",{connection_id:o,database_name:i,schema_name:s}),enabled:!!o&&!!i&&!!s&&!w}),{data:Q,isLoading:ae,isFetching:j,isError:B}=So({queryKey:[o,i,s,a],queryFn:()=>yl("https://semaphor.cloud/api/v1/columns",(r==null?void 0:r.accessToken)||"",{connection_id:o,database_name:i,schema_name:s,table_name:a}),enabled:!!o&&!!i&&!!s&&!!a||w});m.useEffect(()=>{l(n)},[Q,l,n]),m.useEffect(()=>{var H;w&&(d("NA"),f("NA"),p((H=_==null?void 0:_.type)==null?void 0:H.toLowerCase()))},[w,g,p,f,d,_]);const te=w?(be=_==null?void 0:_.type)==null?void 0:be.toLowerCase():a||"",ce=w?"":s||"";function ue(H){f(H),p("")}function ge(H){d(H),f(""),p("")}function ve(H){u(H)}C&&C.databases.length>0,D&&D.schemas.length>0,Q&&Q.columns.length>0&&(n=Q.columns.map(H=>({...H,data_type:H.data_type.toLowerCase()}))),T&&(n=[]),(B||x)&&(n=[]);const de=b==null?void 0:b.connections.map(H=>({id:H.id,name:H.name,type:H.type})),J=C==null?void 0:C.databases.map(H=>({id:H.database_name,name:H.database_name})),X=D==null?void 0:D.schemas.map(H=>({id:H.schema_name,name:H.schema_name})),re=le==null?void 0:le.tables.map(H=>({id:H.table_name,name:H.table_name}));return{connectionItems:de,isConnectionsLoading:y,isConnectionsError:x,databaseItems:J,isDatabasesLoadingOrFetching:R||E,isDatabaseError:T,schemaItems:X,isSchemaLoadingOrFetching:I||N,isSchemaError:V,tableItems:re,isTableLoadingOrFetching:ee||F,isTableError:Z,columns:n,isColumnsLoadingOrFetching:ae||j,isColumnsError:B,isAPIConnection:w,tableName:te,schemaName:ce,handleConnectionChange:ve,handleDatabaseChange:ge,handleSchemaChange:ue}}const p8=e=>{const t=new Date(e);return!isNaN(t.getTime())},g8=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),qu=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?p8(e)?t="date":g8(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function m8({get:e,dataPoint:t,card:n}){var p;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValue:i,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:u,columnValue:d}=t,f={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:u,expression:(p=n.preferences)==null?void 0:p.filterOnClickField,valueType:qu(d),operation:"=",values:[d]};if(l!=null&&l.find(g=>g.id===n.id)){const g=n.id;if(d==null){a(n),i(g);return}else s(f)}o(n),r(f)}var lp={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
- */lp.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__",u=500,d="__lodash_placeholder__",f=1,p=2,g=4,b=1,y=2,x=1,_=2,w=4,C=8,R=16,E=32,T=64,O=128,D=256,I=512,N=30,V="...",G=800,le=16,ee=1,F=2,Z=3,Y=1/0,Q=9007199254740991,ae=17976931348623157e292,j=NaN,B=4294967295,te=B-1,ce=B>>>1,ue=[["ary",O],["bind",x],["bindKey",_],["curry",C],["curryRight",R],["flip",I],["partial",E],["partialRight",T],["rearg",D]],ge="[object Arguments]",ve="[object Array]",de="[object AsyncFunction]",J="[object Boolean]",X="[object Date]",re="[object DOMException]",be="[object Error]",H="[object Function]",De="[object GeneratorFunction]",Ne="[object Map]",Ve="[object Number]",qe="[object Null]",gt="[object Object]",ft="[object Promise]",ht="[object Proxy]",Gt="[object RegExp]",Wt="[object Set]",En="[object String]",rn="[object Symbol]",Cc="[object Undefined]",Gr="[object WeakMap]",gs="[object WeakSet]",vn="[object ArrayBuffer]",co="[object DataView]",zo="[object Float32Array]",jo="[object Float64Array]",Yr="[object Int8Array]",ms="[object Int16Array]",vs="[object Int32Array]",bs="[object Uint8Array]",ys="[object Uint8ClampedArray]",xs="[object Uint16Array]",ws="[object Uint32Array]",Ec=/\b__p \+= '';/g,Vo=/\b(__p \+=) '' \+/g,_s=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Rn=/&(?:amp|lt|gt|quot|#39);/g,uo=/[&<>"']/g,Bo=RegExp(Rn.source),Ss=RegExp(uo.source),Rc=/<%-([\s\S]+?)%>/g,Cs=/<%([\s\S]+?)%>/g,Ha=/<%=([\s\S]+?)%>/g,Es=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Rs=/^\w*$/,$c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$s=/[\\^$.*+?()[\]{}|]/g,Ps=RegExp($s.source),Os=/^\s+/,Pc=/\s/,Oc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Mc=/\{\n\/\* \[wrapped with (.+)\] \*/,$=/,? & /,U=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,oe=/[()=,{}\[\]\/\s]/,xe=/\\(\\)?/g,Te=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ie=/\w*$/,Pe=/^[-+]0x[0-9a-f]+$/i,Re=/^0b[01]+$/i,mt=/^\[object .+?Constructor\]$/,He=/^0o[0-7]+$/i,Ge=/^(?:0|[1-9]\d*)$/,Ot=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,fn=/($^)/,Ms=/['\n\r\u2028\u2029\\]/g,Bt="\\ud800-\\udfff",d5="\\u0300-\\u036f",f5="\\ufe20-\\ufe2f",h5="\\u20d0-\\u20ff",Iw=d5+f5+h5,kw="\\u2700-\\u27bf",Nw="a-z\\xdf-\\xf6\\xf8-\\xff",p5="\\xac\\xb1\\xd7\\xf7",g5="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",m5="\\u2000-\\u206f",v5=" \\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",Lw="A-Z\\xc0-\\xd6\\xd8-\\xde",Fw="\\ufe0e\\ufe0f",zw=p5+g5+m5+v5,Kg="['’]",b5="["+Bt+"]",jw="["+zw+"]",Zd="["+Iw+"]",Vw="\\d+",y5="["+kw+"]",Bw="["+Nw+"]",Hw="[^"+Bt+zw+Vw+kw+Nw+Lw+"]",Xg="\\ud83c[\\udffb-\\udfff]",x5="(?:"+Zd+"|"+Xg+")",Ww="[^"+Bt+"]",Qg="(?:\\ud83c[\\udde6-\\uddff]){2}",Zg="[\\ud800-\\udbff][\\udc00-\\udfff]",Wa="["+Lw+"]",Uw="\\u200d",qw="(?:"+Bw+"|"+Hw+")",w5="(?:"+Wa+"|"+Hw+")",Gw="(?:"+Kg+"(?:d|ll|m|re|s|t|ve))?",Yw="(?:"+Kg+"(?:D|LL|M|RE|S|T|VE))?",Kw=x5+"?",Xw="["+Fw+"]?",_5="(?:"+Uw+"(?:"+[Ww,Qg,Zg].join("|")+")"+Xw+Kw+")*",S5="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",C5="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Qw=Xw+Kw+_5,E5="(?:"+[y5,Qg,Zg].join("|")+")"+Qw,R5="(?:"+[Ww+Zd+"?",Zd,Qg,Zg,b5].join("|")+")",$5=RegExp(Kg,"g"),P5=RegExp(Zd,"g"),Jg=RegExp(Xg+"(?="+Xg+")|"+R5+Qw,"g"),O5=RegExp([Wa+"?"+Bw+"+"+Gw+"(?="+[jw,Wa,"$"].join("|")+")",w5+"+"+Yw+"(?="+[jw,Wa+qw,"$"].join("|")+")",Wa+"?"+qw+"+"+Gw,Wa+"+"+Yw,C5,S5,Vw,E5].join("|"),"g"),M5=RegExp("["+Uw+Bt+Iw+Fw+"]"),D5=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,T5=["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"],A5=-1,It={};It[zo]=It[jo]=It[Yr]=It[ms]=It[vs]=It[bs]=It[ys]=It[xs]=It[ws]=!0,It[ge]=It[ve]=It[vn]=It[J]=It[co]=It[X]=It[be]=It[H]=It[Ne]=It[Ve]=It[gt]=It[Gt]=It[Wt]=It[En]=It[Gr]=!1;var Dt={};Dt[ge]=Dt[ve]=Dt[vn]=Dt[co]=Dt[J]=Dt[X]=Dt[zo]=Dt[jo]=Dt[Yr]=Dt[ms]=Dt[vs]=Dt[Ne]=Dt[Ve]=Dt[gt]=Dt[Gt]=Dt[Wt]=Dt[En]=Dt[rn]=Dt[bs]=Dt[ys]=Dt[xs]=Dt[ws]=!0,Dt[be]=Dt[H]=Dt[Gr]=!1;var I5={À:"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"},k5={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},N5={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},L5={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},F5=parseFloat,z5=parseInt,Zw=typeof Qs=="object"&&Qs&&Qs.Object===Object&&Qs,j5=typeof self=="object"&&self&&self.Object===Object&&self,bn=Zw||j5||Function("return this")(),em=t&&!t.nodeType&&t,Ds=em&&!0&&e&&!e.nodeType&&e,Jw=Ds&&Ds.exports===em,tm=Jw&&Zw.process,Pr=function(){try{var q=Ds&&Ds.require&&Ds.require("util").types;return q||tm&&tm.binding&&tm.binding("util")}catch{}}(),e1=Pr&&Pr.isArrayBuffer,t1=Pr&&Pr.isDate,n1=Pr&&Pr.isMap,r1=Pr&&Pr.isRegExp,o1=Pr&&Pr.isSet,i1=Pr&&Pr.isTypedArray;function or(q,fe,se){switch(se.length){case 0:return q.call(fe);case 1:return q.call(fe,se[0]);case 2:return q.call(fe,se[0],se[1]);case 3:return q.call(fe,se[0],se[1],se[2])}return q.apply(fe,se)}function V5(q,fe,se,Me){for(var Ue=-1,yt=q==null?0:q.length;++Ue<yt;){var on=q[Ue];fe(Me,on,se(on),q)}return Me}function Or(q,fe){for(var se=-1,Me=q==null?0:q.length;++se<Me&&fe(q[se],se,q)!==!1;);return q}function B5(q,fe){for(var se=q==null?0:q.length;se--&&fe(q[se],se,q)!==!1;);return q}function s1(q,fe){for(var se=-1,Me=q==null?0:q.length;++se<Me;)if(!fe(q[se],se,q))return!1;return!0}function Si(q,fe){for(var se=-1,Me=q==null?0:q.length,Ue=0,yt=[];++se<Me;){var on=q[se];fe(on,se,q)&&(yt[Ue++]=on)}return yt}function Jd(q,fe){var se=q==null?0:q.length;return!!se&&Ua(q,fe,0)>-1}function nm(q,fe,se){for(var Me=-1,Ue=q==null?0:q.length;++Me<Ue;)if(se(fe,q[Me]))return!0;return!1}function Ht(q,fe){for(var se=-1,Me=q==null?0:q.length,Ue=Array(Me);++se<Me;)Ue[se]=fe(q[se],se,q);return Ue}function Ci(q,fe){for(var se=-1,Me=fe.length,Ue=q.length;++se<Me;)q[Ue+se]=fe[se];return q}function rm(q,fe,se,Me){var Ue=-1,yt=q==null?0:q.length;for(Me&&yt&&(se=q[++Ue]);++Ue<yt;)se=fe(se,q[Ue],Ue,q);return se}function H5(q,fe,se,Me){var Ue=q==null?0:q.length;for(Me&&Ue&&(se=q[--Ue]);Ue--;)se=fe(se,q[Ue],Ue,q);return se}function om(q,fe){for(var se=-1,Me=q==null?0:q.length;++se<Me;)if(fe(q[se],se,q))return!0;return!1}var W5=im("length");function U5(q){return q.split("")}function q5(q){return q.match(U)||[]}function a1(q,fe,se){var Me;return se(q,function(Ue,yt,on){if(fe(Ue,yt,on))return Me=yt,!1}),Me}function ef(q,fe,se,Me){for(var Ue=q.length,yt=se+(Me?1:-1);Me?yt--:++yt<Ue;)if(fe(q[yt],yt,q))return yt;return-1}function Ua(q,fe,se){return fe===fe?oI(q,fe,se):ef(q,l1,se)}function G5(q,fe,se,Me){for(var Ue=se-1,yt=q.length;++Ue<yt;)if(Me(q[Ue],fe))return Ue;return-1}function l1(q){return q!==q}function c1(q,fe){var se=q==null?0:q.length;return se?am(q,fe)/se:j}function im(q){return function(fe){return fe==null?n:fe[q]}}function sm(q){return function(fe){return q==null?n:q[fe]}}function u1(q,fe,se,Me,Ue){return Ue(q,function(yt,on,Mt){se=Me?(Me=!1,yt):fe(se,yt,on,Mt)}),se}function Y5(q,fe){var se=q.length;for(q.sort(fe);se--;)q[se]=q[se].value;return q}function am(q,fe){for(var se,Me=-1,Ue=q.length;++Me<Ue;){var yt=fe(q[Me]);yt!==n&&(se=se===n?yt:se+yt)}return se}function lm(q,fe){for(var se=-1,Me=Array(q);++se<q;)Me[se]=fe(se);return Me}function K5(q,fe){return Ht(fe,function(se){return[se,q[se]]})}function d1(q){return q&&q.slice(0,g1(q)+1).replace(Os,"")}function ir(q){return function(fe){return q(fe)}}function cm(q,fe){return Ht(fe,function(se){return q[se]})}function Dc(q,fe){return q.has(fe)}function f1(q,fe){for(var se=-1,Me=q.length;++se<Me&&Ua(fe,q[se],0)>-1;);return se}function h1(q,fe){for(var se=q.length;se--&&Ua(fe,q[se],0)>-1;);return se}function X5(q,fe){for(var se=q.length,Me=0;se--;)q[se]===fe&&++Me;return Me}var Q5=sm(I5),Z5=sm(k5);function J5(q){return"\\"+L5[q]}function eI(q,fe){return q==null?n:q[fe]}function qa(q){return M5.test(q)}function tI(q){return D5.test(q)}function nI(q){for(var fe,se=[];!(fe=q.next()).done;)se.push(fe.value);return se}function um(q){var fe=-1,se=Array(q.size);return q.forEach(function(Me,Ue){se[++fe]=[Ue,Me]}),se}function p1(q,fe){return function(se){return q(fe(se))}}function Ei(q,fe){for(var se=-1,Me=q.length,Ue=0,yt=[];++se<Me;){var on=q[se];(on===fe||on===d)&&(q[se]=d,yt[Ue++]=se)}return yt}function tf(q){var fe=-1,se=Array(q.size);return q.forEach(function(Me){se[++fe]=Me}),se}function rI(q){var fe=-1,se=Array(q.size);return q.forEach(function(Me){se[++fe]=[Me,Me]}),se}function oI(q,fe,se){for(var Me=se-1,Ue=q.length;++Me<Ue;)if(q[Me]===fe)return Me;return-1}function iI(q,fe,se){for(var Me=se+1;Me--;)if(q[Me]===fe)return Me;return Me}function Ga(q){return qa(q)?aI(q):W5(q)}function Kr(q){return qa(q)?lI(q):U5(q)}function g1(q){for(var fe=q.length;fe--&&Pc.test(q.charAt(fe)););return fe}var sI=sm(N5);function aI(q){for(var fe=Jg.lastIndex=0;Jg.test(q);)++fe;return fe}function lI(q){return q.match(Jg)||[]}function cI(q){return q.match(O5)||[]}var uI=function q(fe){fe=fe==null?bn:Ya.defaults(bn.Object(),fe,Ya.pick(bn,T5));var se=fe.Array,Me=fe.Date,Ue=fe.Error,yt=fe.Function,on=fe.Math,Mt=fe.Object,dm=fe.RegExp,dI=fe.String,Mr=fe.TypeError,nf=se.prototype,fI=yt.prototype,Ka=Mt.prototype,rf=fe["__core-js_shared__"],of=fI.toString,Et=Ka.hasOwnProperty,hI=0,m1=function(){var c=/[^.]+$/.exec(rf&&rf.keys&&rf.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}(),sf=Ka.toString,pI=of.call(Mt),gI=bn._,mI=dm("^"+of.call(Et).replace($s,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),af=Jw?fe.Buffer:n,Ri=fe.Symbol,lf=fe.Uint8Array,v1=af?af.allocUnsafe:n,cf=p1(Mt.getPrototypeOf,Mt),b1=Mt.create,y1=Ka.propertyIsEnumerable,uf=nf.splice,x1=Ri?Ri.isConcatSpreadable:n,Tc=Ri?Ri.iterator:n,Ts=Ri?Ri.toStringTag:n,df=function(){try{var c=Ls(Mt,"defineProperty");return c({},"",{}),c}catch{}}(),vI=fe.clearTimeout!==bn.clearTimeout&&fe.clearTimeout,bI=Me&&Me.now!==bn.Date.now&&Me.now,yI=fe.setTimeout!==bn.setTimeout&&fe.setTimeout,ff=on.ceil,hf=on.floor,fm=Mt.getOwnPropertySymbols,xI=af?af.isBuffer:n,w1=fe.isFinite,wI=nf.join,_I=p1(Mt.keys,Mt),sn=on.max,$n=on.min,SI=Me.now,CI=fe.parseInt,_1=on.random,EI=nf.reverse,hm=Ls(fe,"DataView"),Ac=Ls(fe,"Map"),pm=Ls(fe,"Promise"),Xa=Ls(fe,"Set"),Ic=Ls(fe,"WeakMap"),kc=Ls(Mt,"create"),pf=Ic&&new Ic,Qa={},RI=Fs(hm),$I=Fs(Ac),PI=Fs(pm),OI=Fs(Xa),MI=Fs(Ic),gf=Ri?Ri.prototype:n,Nc=gf?gf.valueOf:n,S1=gf?gf.toString:n;function M(c){if(Yt(c)&&!Ye(c)&&!(c instanceof dt)){if(c instanceof Dr)return c;if(Et.call(c,"__wrapped__"))return C_(c)}return new Dr(c)}var Za=function(){function c(){}return function(h){if(!Ut(h))return{};if(b1)return b1(h);c.prototype=h;var v=new c;return c.prototype=n,v}}();function mf(){}function Dr(c,h){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!h,this.__index__=0,this.__values__=n}M.templateSettings={escape:Rc,evaluate:Cs,interpolate:Ha,variable:"",imports:{_:M}},M.prototype=mf.prototype,M.prototype.constructor=M,Dr.prototype=Za(mf.prototype),Dr.prototype.constructor=Dr;function dt(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=B,this.__views__=[]}function DI(){var c=new dt(this.__wrapped__);return c.__actions__=Wn(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Wn(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Wn(this.__views__),c}function TI(){if(this.__filtered__){var c=new dt(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}function AI(){var c=this.__wrapped__.value(),h=this.__dir__,v=Ye(c),S=h<0,P=v?c.length:0,A=Uk(0,P,this.__views__),L=A.start,z=A.end,K=z-L,he=S?z:L-1,pe=this.__iteratees__,ye=pe.length,$e=0,Ae=$n(K,this.__takeCount__);if(!v||!S&&P==K&&Ae==K)return G1(c,this.__actions__);var Fe=[];e:for(;K--&&$e<Ae;){he+=h;for(var tt=-1,ze=c[he];++tt<ye;){var ct=pe[tt],pt=ct.iteratee,lr=ct.type,zn=pt(ze);if(lr==F)ze=zn;else if(!zn){if(lr==ee)continue e;break e}}Fe[$e++]=ze}return Fe}dt.prototype=Za(mf.prototype),dt.prototype.constructor=dt;function As(c){var h=-1,v=c==null?0:c.length;for(this.clear();++h<v;){var S=c[h];this.set(S[0],S[1])}}function II(){this.__data__=kc?kc(null):{},this.size=0}function kI(c){var h=this.has(c)&&delete this.__data__[c];return this.size-=h?1:0,h}function NI(c){var h=this.__data__;if(kc){var v=h[c];return v===l?n:v}return Et.call(h,c)?h[c]:n}function LI(c){var h=this.__data__;return kc?h[c]!==n:Et.call(h,c)}function FI(c,h){var v=this.__data__;return this.size+=this.has(c)?0:1,v[c]=kc&&h===n?l:h,this}As.prototype.clear=II,As.prototype.delete=kI,As.prototype.get=NI,As.prototype.has=LI,As.prototype.set=FI;function Ho(c){var h=-1,v=c==null?0:c.length;for(this.clear();++h<v;){var S=c[h];this.set(S[0],S[1])}}function zI(){this.__data__=[],this.size=0}function jI(c){var h=this.__data__,v=vf(h,c);if(v<0)return!1;var S=h.length-1;return v==S?h.pop():uf.call(h,v,1),--this.size,!0}function VI(c){var h=this.__data__,v=vf(h,c);return v<0?n:h[v][1]}function BI(c){return vf(this.__data__,c)>-1}function HI(c,h){var v=this.__data__,S=vf(v,c);return S<0?(++this.size,v.push([c,h])):v[S][1]=h,this}Ho.prototype.clear=zI,Ho.prototype.delete=jI,Ho.prototype.get=VI,Ho.prototype.has=BI,Ho.prototype.set=HI;function Wo(c){var h=-1,v=c==null?0:c.length;for(this.clear();++h<v;){var S=c[h];this.set(S[0],S[1])}}function WI(){this.size=0,this.__data__={hash:new As,map:new(Ac||Ho),string:new As}}function UI(c){var h=Of(this,c).delete(c);return this.size-=h?1:0,h}function qI(c){return Of(this,c).get(c)}function GI(c){return Of(this,c).has(c)}function YI(c,h){var v=Of(this,c),S=v.size;return v.set(c,h),this.size+=v.size==S?0:1,this}Wo.prototype.clear=WI,Wo.prototype.delete=UI,Wo.prototype.get=qI,Wo.prototype.has=GI,Wo.prototype.set=YI;function Is(c){var h=-1,v=c==null?0:c.length;for(this.__data__=new Wo;++h<v;)this.add(c[h])}function KI(c){return this.__data__.set(c,l),this}function XI(c){return this.__data__.has(c)}Is.prototype.add=Is.prototype.push=KI,Is.prototype.has=XI;function Xr(c){var h=this.__data__=new Ho(c);this.size=h.size}function QI(){this.__data__=new Ho,this.size=0}function ZI(c){var h=this.__data__,v=h.delete(c);return this.size=h.size,v}function JI(c){return this.__data__.get(c)}function ek(c){return this.__data__.has(c)}function tk(c,h){var v=this.__data__;if(v instanceof Ho){var S=v.__data__;if(!Ac||S.length<o-1)return S.push([c,h]),this.size=++v.size,this;v=this.__data__=new Wo(S)}return v.set(c,h),this.size=v.size,this}Xr.prototype.clear=QI,Xr.prototype.delete=ZI,Xr.prototype.get=JI,Xr.prototype.has=ek,Xr.prototype.set=tk;function C1(c,h){var v=Ye(c),S=!v&&zs(c),P=!v&&!S&&Di(c),A=!v&&!S&&!P&&nl(c),L=v||S||P||A,z=L?lm(c.length,dI):[],K=z.length;for(var he in c)(h||Et.call(c,he))&&!(L&&(he=="length"||P&&(he=="offset"||he=="parent")||A&&(he=="buffer"||he=="byteLength"||he=="byteOffset")||Yo(he,K)))&&z.push(he);return z}function E1(c){var h=c.length;return h?c[Em(0,h-1)]:n}function nk(c,h){return Mf(Wn(c),ks(h,0,c.length))}function rk(c){return Mf(Wn(c))}function gm(c,h,v){(v!==n&&!Qr(c[h],v)||v===n&&!(h in c))&&Uo(c,h,v)}function Lc(c,h,v){var S=c[h];(!(Et.call(c,h)&&Qr(S,v))||v===n&&!(h in c))&&Uo(c,h,v)}function vf(c,h){for(var v=c.length;v--;)if(Qr(c[v][0],h))return v;return-1}function ok(c,h,v,S){return $i(c,function(P,A,L){h(S,P,v(P),L)}),S}function R1(c,h){return c&&ho(h,hn(h),c)}function ik(c,h){return c&&ho(h,qn(h),c)}function Uo(c,h,v){h=="__proto__"&&df?df(c,h,{configurable:!0,enumerable:!0,value:v,writable:!0}):c[h]=v}function mm(c,h){for(var v=-1,S=h.length,P=se(S),A=c==null;++v<S;)P[v]=A?n:Xm(c,h[v]);return P}function ks(c,h,v){return c===c&&(v!==n&&(c=c<=v?c:v),h!==n&&(c=c>=h?c:h)),c}function Tr(c,h,v,S,P,A){var L,z=h&f,K=h&p,he=h&g;if(v&&(L=P?v(c,S,P,A):v(c)),L!==n)return L;if(!Ut(c))return c;var pe=Ye(c);if(pe){if(L=Gk(c),!z)return Wn(c,L)}else{var ye=Pn(c),$e=ye==H||ye==De;if(Di(c))return X1(c,z);if(ye==gt||ye==ge||$e&&!P){if(L=K||$e?{}:g_(c),!z)return K?Nk(c,ik(L,c)):kk(c,R1(L,c))}else{if(!Dt[ye])return P?c:{};L=Yk(c,ye,z)}}A||(A=new Xr);var Ae=A.get(c);if(Ae)return Ae;A.set(c,L),W_(c)?c.forEach(function(ze){L.add(Tr(ze,h,v,ze,c,A))}):B_(c)&&c.forEach(function(ze,ct){L.set(ct,Tr(ze,h,v,ct,c,A))});var Fe=he?K?Nm:km:K?qn:hn,tt=pe?n:Fe(c);return Or(tt||c,function(ze,ct){tt&&(ct=ze,ze=c[ct]),Lc(L,ct,Tr(ze,h,v,ct,c,A))}),L}function sk(c){var h=hn(c);return function(v){return $1(v,c,h)}}function $1(c,h,v){var S=v.length;if(c==null)return!S;for(c=Mt(c);S--;){var P=v[S],A=h[P],L=c[P];if(L===n&&!(P in c)||!A(L))return!1}return!0}function P1(c,h,v){if(typeof c!="function")throw new Mr(s);return Wc(function(){c.apply(n,v)},h)}function Fc(c,h,v,S){var P=-1,A=Jd,L=!0,z=c.length,K=[],he=h.length;if(!z)return K;v&&(h=Ht(h,ir(v))),S?(A=nm,L=!1):h.length>=o&&(A=Dc,L=!1,h=new Is(h));e:for(;++P<z;){var pe=c[P],ye=v==null?pe:v(pe);if(pe=S||pe!==0?pe:0,L&&ye===ye){for(var $e=he;$e--;)if(h[$e]===ye)continue e;K.push(pe)}else A(h,ye,S)||K.push(pe)}return K}var $i=t_(fo),O1=t_(bm,!0);function ak(c,h){var v=!0;return $i(c,function(S,P,A){return v=!!h(S,P,A),v}),v}function bf(c,h,v){for(var S=-1,P=c.length;++S<P;){var A=c[S],L=h(A);if(L!=null&&(z===n?L===L&&!ar(L):v(L,z)))var z=L,K=A}return K}function lk(c,h,v,S){var P=c.length;for(v=Ze(v),v<0&&(v=-v>P?0:P+v),S=S===n||S>P?P:Ze(S),S<0&&(S+=P),S=v>S?0:q_(S);v<S;)c[v++]=h;return c}function M1(c,h){var v=[];return $i(c,function(S,P,A){h(S,P,A)&&v.push(S)}),v}function yn(c,h,v,S,P){var A=-1,L=c.length;for(v||(v=Xk),P||(P=[]);++A<L;){var z=c[A];h>0&&v(z)?h>1?yn(z,h-1,v,S,P):Ci(P,z):S||(P[P.length]=z)}return P}var vm=n_(),D1=n_(!0);function fo(c,h){return c&&vm(c,h,hn)}function bm(c,h){return c&&D1(c,h,hn)}function yf(c,h){return Si(h,function(v){return Ko(c[v])})}function Ns(c,h){h=Oi(h,c);for(var v=0,S=h.length;c!=null&&v<S;)c=c[po(h[v++])];return v&&v==S?c:n}function T1(c,h,v){var S=h(c);return Ye(c)?S:Ci(S,v(c))}function Ln(c){return c==null?c===n?Cc:qe:Ts&&Ts in Mt(c)?Wk(c):r7(c)}function ym(c,h){return c>h}function ck(c,h){return c!=null&&Et.call(c,h)}function uk(c,h){return c!=null&&h in Mt(c)}function dk(c,h,v){return c>=$n(h,v)&&c<sn(h,v)}function xm(c,h,v){for(var S=v?nm:Jd,P=c[0].length,A=c.length,L=A,z=se(A),K=1/0,he=[];L--;){var pe=c[L];L&&h&&(pe=Ht(pe,ir(h))),K=$n(pe.length,K),z[L]=!v&&(h||P>=120&&pe.length>=120)?new Is(L&&pe):n}pe=c[0];var ye=-1,$e=z[0];e:for(;++ye<P&&he.length<K;){var Ae=pe[ye],Fe=h?h(Ae):Ae;if(Ae=v||Ae!==0?Ae:0,!($e?Dc($e,Fe):S(he,Fe,v))){for(L=A;--L;){var tt=z[L];if(!(tt?Dc(tt,Fe):S(c[L],Fe,v)))continue e}$e&&$e.push(Fe),he.push(Ae)}}return he}function fk(c,h,v,S){return fo(c,function(P,A,L){h(S,v(P),A,L)}),S}function zc(c,h,v){h=Oi(h,c),c=y_(c,h);var S=c==null?c:c[po(Ir(h))];return S==null?n:or(S,c,v)}function A1(c){return Yt(c)&&Ln(c)==ge}function hk(c){return Yt(c)&&Ln(c)==vn}function pk(c){return Yt(c)&&Ln(c)==X}function jc(c,h,v,S,P){return c===h?!0:c==null||h==null||!Yt(c)&&!Yt(h)?c!==c&&h!==h:gk(c,h,v,S,jc,P)}function gk(c,h,v,S,P,A){var L=Ye(c),z=Ye(h),K=L?ve:Pn(c),he=z?ve:Pn(h);K=K==ge?gt:K,he=he==ge?gt:he;var pe=K==gt,ye=he==gt,$e=K==he;if($e&&Di(c)){if(!Di(h))return!1;L=!0,pe=!1}if($e&&!pe)return A||(A=new Xr),L||nl(c)?f_(c,h,v,S,P,A):Bk(c,h,K,v,S,P,A);if(!(v&b)){var Ae=pe&&Et.call(c,"__wrapped__"),Fe=ye&&Et.call(h,"__wrapped__");if(Ae||Fe){var tt=Ae?c.value():c,ze=Fe?h.value():h;return A||(A=new Xr),P(tt,ze,v,S,A)}}return $e?(A||(A=new Xr),Hk(c,h,v,S,P,A)):!1}function mk(c){return Yt(c)&&Pn(c)==Ne}function wm(c,h,v,S){var P=v.length,A=P,L=!S;if(c==null)return!A;for(c=Mt(c);P--;){var z=v[P];if(L&&z[2]?z[1]!==c[z[0]]:!(z[0]in c))return!1}for(;++P<A;){z=v[P];var K=z[0],he=c[K],pe=z[1];if(L&&z[2]){if(he===n&&!(K in c))return!1}else{var ye=new Xr;if(S)var $e=S(he,pe,K,c,h,ye);if(!($e===n?jc(pe,he,b|y,S,ye):$e))return!1}}return!0}function I1(c){if(!Ut(c)||Zk(c))return!1;var h=Ko(c)?mI:mt;return h.test(Fs(c))}function vk(c){return Yt(c)&&Ln(c)==Gt}function bk(c){return Yt(c)&&Pn(c)==Wt}function yk(c){return Yt(c)&&Nf(c.length)&&!!It[Ln(c)]}function k1(c){return typeof c=="function"?c:c==null?Gn:typeof c=="object"?Ye(c)?F1(c[0],c[1]):L1(c):rS(c)}function _m(c){if(!Hc(c))return _I(c);var h=[];for(var v in Mt(c))Et.call(c,v)&&v!="constructor"&&h.push(v);return h}function xk(c){if(!Ut(c))return n7(c);var h=Hc(c),v=[];for(var S in c)S=="constructor"&&(h||!Et.call(c,S))||v.push(S);return v}function Sm(c,h){return c<h}function N1(c,h){var v=-1,S=Un(c)?se(c.length):[];return $i(c,function(P,A,L){S[++v]=h(P,A,L)}),S}function L1(c){var h=Fm(c);return h.length==1&&h[0][2]?v_(h[0][0],h[0][1]):function(v){return v===c||wm(v,c,h)}}function F1(c,h){return jm(c)&&m_(h)?v_(po(c),h):function(v){var S=Xm(v,c);return S===n&&S===h?Qm(v,c):jc(h,S,b|y)}}function xf(c,h,v,S,P){c!==h&&vm(h,function(A,L){if(P||(P=new Xr),Ut(A))wk(c,h,L,v,xf,S,P);else{var z=S?S(Bm(c,L),A,L+"",c,h,P):n;z===n&&(z=A),gm(c,L,z)}},qn)}function wk(c,h,v,S,P,A,L){var z=Bm(c,v),K=Bm(h,v),he=L.get(K);if(he){gm(c,v,he);return}var pe=A?A(z,K,v+"",c,h,L):n,ye=pe===n;if(ye){var $e=Ye(K),Ae=!$e&&Di(K),Fe=!$e&&!Ae&&nl(K);pe=K,$e||Ae||Fe?Ye(z)?pe=z:Zt(z)?pe=Wn(z):Ae?(ye=!1,pe=X1(K,!0)):Fe?(ye=!1,pe=Q1(K,!0)):pe=[]:Uc(K)||zs(K)?(pe=z,zs(z)?pe=G_(z):(!Ut(z)||Ko(z))&&(pe=g_(K))):ye=!1}ye&&(L.set(K,pe),P(pe,K,S,A,L),L.delete(K)),gm(c,v,pe)}function z1(c,h){var v=c.length;if(v)return h+=h<0?v:0,Yo(h,v)?c[h]:n}function j1(c,h,v){h.length?h=Ht(h,function(A){return Ye(A)?function(L){return Ns(L,A.length===1?A[0]:A)}:A}):h=[Gn];var S=-1;h=Ht(h,ir(Le()));var P=N1(c,function(A,L,z){var K=Ht(h,function(he){return he(A)});return{criteria:K,index:++S,value:A}});return Y5(P,function(A,L){return Ik(A,L,v)})}function _k(c,h){return V1(c,h,function(v,S){return Qm(c,S)})}function V1(c,h,v){for(var S=-1,P=h.length,A={};++S<P;){var L=h[S],z=Ns(c,L);v(z,L)&&Vc(A,Oi(L,c),z)}return A}function Sk(c){return function(h){return Ns(h,c)}}function Cm(c,h,v,S){var P=S?G5:Ua,A=-1,L=h.length,z=c;for(c===h&&(h=Wn(h)),v&&(z=Ht(c,ir(v)));++A<L;)for(var K=0,he=h[A],pe=v?v(he):he;(K=P(z,pe,K,S))>-1;)z!==c&&uf.call(z,K,1),uf.call(c,K,1);return c}function B1(c,h){for(var v=c?h.length:0,S=v-1;v--;){var P=h[v];if(v==S||P!==A){var A=P;Yo(P)?uf.call(c,P,1):Pm(c,P)}}return c}function Em(c,h){return c+hf(_1()*(h-c+1))}function Ck(c,h,v,S){for(var P=-1,A=sn(ff((h-c)/(v||1)),0),L=se(A);A--;)L[S?A:++P]=c,c+=v;return L}function Rm(c,h){var v="";if(!c||h<1||h>Q)return v;do h%2&&(v+=c),h=hf(h/2),h&&(c+=c);while(h);return v}function ot(c,h){return Hm(b_(c,h,Gn),c+"")}function Ek(c){return E1(rl(c))}function Rk(c,h){var v=rl(c);return Mf(v,ks(h,0,v.length))}function Vc(c,h,v,S){if(!Ut(c))return c;h=Oi(h,c);for(var P=-1,A=h.length,L=A-1,z=c;z!=null&&++P<A;){var K=po(h[P]),he=v;if(K==="__proto__"||K==="constructor"||K==="prototype")return c;if(P!=L){var pe=z[K];he=S?S(pe,K,z):n,he===n&&(he=Ut(pe)?pe:Yo(h[P+1])?[]:{})}Lc(z,K,he),z=z[K]}return c}var H1=pf?function(c,h){return pf.set(c,h),c}:Gn,$k=df?function(c,h){return df(c,"toString",{configurable:!0,enumerable:!1,value:Jm(h),writable:!0})}:Gn;function Pk(c){return Mf(rl(c))}function Ar(c,h,v){var S=-1,P=c.length;h<0&&(h=-h>P?0:P+h),v=v>P?P:v,v<0&&(v+=P),P=h>v?0:v-h>>>0,h>>>=0;for(var A=se(P);++S<P;)A[S]=c[S+h];return A}function Ok(c,h){var v;return $i(c,function(S,P,A){return v=h(S,P,A),!v}),!!v}function wf(c,h,v){var S=0,P=c==null?S:c.length;if(typeof h=="number"&&h===h&&P<=ce){for(;S<P;){var A=S+P>>>1,L=c[A];L!==null&&!ar(L)&&(v?L<=h:L<h)?S=A+1:P=A}return P}return $m(c,h,Gn,v)}function $m(c,h,v,S){var P=0,A=c==null?0:c.length;if(A===0)return 0;h=v(h);for(var L=h!==h,z=h===null,K=ar(h),he=h===n;P<A;){var pe=hf((P+A)/2),ye=v(c[pe]),$e=ye!==n,Ae=ye===null,Fe=ye===ye,tt=ar(ye);if(L)var ze=S||Fe;else he?ze=Fe&&(S||$e):z?ze=Fe&&$e&&(S||!Ae):K?ze=Fe&&$e&&!Ae&&(S||!tt):Ae||tt?ze=!1:ze=S?ye<=h:ye<h;ze?P=pe+1:A=pe}return $n(A,te)}function W1(c,h){for(var v=-1,S=c.length,P=0,A=[];++v<S;){var L=c[v],z=h?h(L):L;if(!v||!Qr(z,K)){var K=z;A[P++]=L===0?0:L}}return A}function U1(c){return typeof c=="number"?c:ar(c)?j:+c}function sr(c){if(typeof c=="string")return c;if(Ye(c))return Ht(c,sr)+"";if(ar(c))return S1?S1.call(c):"";var h=c+"";return h=="0"&&1/c==-Y?"-0":h}function Pi(c,h,v){var S=-1,P=Jd,A=c.length,L=!0,z=[],K=z;if(v)L=!1,P=nm;else if(A>=o){var he=h?null:jk(c);if(he)return tf(he);L=!1,P=Dc,K=new Is}else K=h?[]:z;e:for(;++S<A;){var pe=c[S],ye=h?h(pe):pe;if(pe=v||pe!==0?pe:0,L&&ye===ye){for(var $e=K.length;$e--;)if(K[$e]===ye)continue e;h&&K.push(ye),z.push(pe)}else P(K,ye,v)||(K!==z&&K.push(ye),z.push(pe))}return z}function Pm(c,h){return h=Oi(h,c),c=y_(c,h),c==null||delete c[po(Ir(h))]}function q1(c,h,v,S){return Vc(c,h,v(Ns(c,h)),S)}function _f(c,h,v,S){for(var P=c.length,A=S?P:-1;(S?A--:++A<P)&&h(c[A],A,c););return v?Ar(c,S?0:A,S?A+1:P):Ar(c,S?A+1:0,S?P:A)}function G1(c,h){var v=c;return v instanceof dt&&(v=v.value()),rm(h,function(S,P){return P.func.apply(P.thisArg,Ci([S],P.args))},v)}function Om(c,h,v){var S=c.length;if(S<2)return S?Pi(c[0]):[];for(var P=-1,A=se(S);++P<S;)for(var L=c[P],z=-1;++z<S;)z!=P&&(A[P]=Fc(A[P]||L,c[z],h,v));return Pi(yn(A,1),h,v)}function Y1(c,h,v){for(var S=-1,P=c.length,A=h.length,L={};++S<P;){var z=S<A?h[S]:n;v(L,c[S],z)}return L}function Mm(c){return Zt(c)?c:[]}function Dm(c){return typeof c=="function"?c:Gn}function Oi(c,h){return Ye(c)?c:jm(c,h)?[c]:S_(wt(c))}var Mk=ot;function Mi(c,h,v){var S=c.length;return v=v===n?S:v,!h&&v>=S?c:Ar(c,h,v)}var K1=vI||function(c){return bn.clearTimeout(c)};function X1(c,h){if(h)return c.slice();var v=c.length,S=v1?v1(v):new c.constructor(v);return c.copy(S),S}function Tm(c){var h=new c.constructor(c.byteLength);return new lf(h).set(new lf(c)),h}function Dk(c,h){var v=h?Tm(c.buffer):c.buffer;return new c.constructor(v,c.byteOffset,c.byteLength)}function Tk(c){var h=new c.constructor(c.source,Ie.exec(c));return h.lastIndex=c.lastIndex,h}function Ak(c){return Nc?Mt(Nc.call(c)):{}}function Q1(c,h){var v=h?Tm(c.buffer):c.buffer;return new c.constructor(v,c.byteOffset,c.length)}function Z1(c,h){if(c!==h){var v=c!==n,S=c===null,P=c===c,A=ar(c),L=h!==n,z=h===null,K=h===h,he=ar(h);if(!z&&!he&&!A&&c>h||A&&L&&K&&!z&&!he||S&&L&&K||!v&&K||!P)return 1;if(!S&&!A&&!he&&c<h||he&&v&&P&&!S&&!A||z&&v&&P||!L&&P||!K)return-1}return 0}function Ik(c,h,v){for(var S=-1,P=c.criteria,A=h.criteria,L=P.length,z=v.length;++S<L;){var K=Z1(P[S],A[S]);if(K){if(S>=z)return K;var he=v[S];return K*(he=="desc"?-1:1)}}return c.index-h.index}function J1(c,h,v,S){for(var P=-1,A=c.length,L=v.length,z=-1,K=h.length,he=sn(A-L,0),pe=se(K+he),ye=!S;++z<K;)pe[z]=h[z];for(;++P<L;)(ye||P<A)&&(pe[v[P]]=c[P]);for(;he--;)pe[z++]=c[P++];return pe}function e_(c,h,v,S){for(var P=-1,A=c.length,L=-1,z=v.length,K=-1,he=h.length,pe=sn(A-z,0),ye=se(pe+he),$e=!S;++P<pe;)ye[P]=c[P];for(var Ae=P;++K<he;)ye[Ae+K]=h[K];for(;++L<z;)($e||P<A)&&(ye[Ae+v[L]]=c[P++]);return ye}function Wn(c,h){var v=-1,S=c.length;for(h||(h=se(S));++v<S;)h[v]=c[v];return h}function ho(c,h,v,S){var P=!v;v||(v={});for(var A=-1,L=h.length;++A<L;){var z=h[A],K=S?S(v[z],c[z],z,v,c):n;K===n&&(K=c[z]),P?Uo(v,z,K):Lc(v,z,K)}return v}function kk(c,h){return ho(c,zm(c),h)}function Nk(c,h){return ho(c,h_(c),h)}function Sf(c,h){return function(v,S){var P=Ye(v)?V5:ok,A=h?h():{};return P(v,c,Le(S,2),A)}}function Ja(c){return ot(function(h,v){var S=-1,P=v.length,A=P>1?v[P-1]:n,L=P>2?v[2]:n;for(A=c.length>3&&typeof A=="function"?(P--,A):n,L&&Fn(v[0],v[1],L)&&(A=P<3?n:A,P=1),h=Mt(h);++S<P;){var z=v[S];z&&c(h,z,S,A)}return h})}function t_(c,h){return function(v,S){if(v==null)return v;if(!Un(v))return c(v,S);for(var P=v.length,A=h?P:-1,L=Mt(v);(h?A--:++A<P)&&S(L[A],A,L)!==!1;);return v}}function n_(c){return function(h,v,S){for(var P=-1,A=Mt(h),L=S(h),z=L.length;z--;){var K=L[c?z:++P];if(v(A[K],K,A)===!1)break}return h}}function Lk(c,h,v){var S=h&x,P=Bc(c);function A(){var L=this&&this!==bn&&this instanceof A?P:c;return L.apply(S?v:this,arguments)}return A}function r_(c){return function(h){h=wt(h);var v=qa(h)?Kr(h):n,S=v?v[0]:h.charAt(0),P=v?Mi(v,1).join(""):h.slice(1);return S[c]()+P}}function el(c){return function(h){return rm(tS(eS(h).replace($5,"")),c,"")}}function Bc(c){return function(){var h=arguments;switch(h.length){case 0:return new c;case 1:return new c(h[0]);case 2:return new c(h[0],h[1]);case 3:return new c(h[0],h[1],h[2]);case 4:return new c(h[0],h[1],h[2],h[3]);case 5:return new c(h[0],h[1],h[2],h[3],h[4]);case 6:return new c(h[0],h[1],h[2],h[3],h[4],h[5]);case 7:return new c(h[0],h[1],h[2],h[3],h[4],h[5],h[6])}var v=Za(c.prototype),S=c.apply(v,h);return Ut(S)?S:v}}function Fk(c,h,v){var S=Bc(c);function P(){for(var A=arguments.length,L=se(A),z=A,K=tl(P);z--;)L[z]=arguments[z];var he=A<3&&L[0]!==K&&L[A-1]!==K?[]:Ei(L,K);if(A-=he.length,A<v)return l_(c,h,Cf,P.placeholder,n,L,he,n,n,v-A);var pe=this&&this!==bn&&this instanceof P?S:c;return or(pe,this,L)}return P}function o_(c){return function(h,v,S){var P=Mt(h);if(!Un(h)){var A=Le(v,3);h=hn(h),v=function(z){return A(P[z],z,P)}}var L=c(h,v,S);return L>-1?P[A?h[L]:L]:n}}function i_(c){return Go(function(h){var v=h.length,S=v,P=Dr.prototype.thru;for(c&&h.reverse();S--;){var A=h[S];if(typeof A!="function")throw new Mr(s);if(P&&!L&&Pf(A)=="wrapper")var L=new Dr([],!0)}for(S=L?S:v;++S<v;){A=h[S];var z=Pf(A),K=z=="wrapper"?Lm(A):n;K&&Vm(K[0])&&K[1]==(O|C|E|D)&&!K[4].length&&K[9]==1?L=L[Pf(K[0])].apply(L,K[3]):L=A.length==1&&Vm(A)?L[z]():L.thru(A)}return function(){var he=arguments,pe=he[0];if(L&&he.length==1&&Ye(pe))return L.plant(pe).value();for(var ye=0,$e=v?h[ye].apply(this,he):pe;++ye<v;)$e=h[ye].call(this,$e);return $e}})}function Cf(c,h,v,S,P,A,L,z,K,he){var pe=h&O,ye=h&x,$e=h&_,Ae=h&(C|R),Fe=h&I,tt=$e?n:Bc(c);function ze(){for(var ct=arguments.length,pt=se(ct),lr=ct;lr--;)pt[lr]=arguments[lr];if(Ae)var zn=tl(ze),cr=X5(pt,zn);if(S&&(pt=J1(pt,S,P,Ae)),A&&(pt=e_(pt,A,L,Ae)),ct-=cr,Ae&&ct<he){var Jt=Ei(pt,zn);return l_(c,h,Cf,ze.placeholder,v,pt,Jt,z,K,he-ct)}var Zr=ye?v:this,Qo=$e?Zr[c]:c;return ct=pt.length,z?pt=o7(pt,z):Fe&&ct>1&&pt.reverse(),pe&&K<ct&&(pt.length=K),this&&this!==bn&&this instanceof ze&&(Qo=tt||Bc(Qo)),Qo.apply(Zr,pt)}return ze}function s_(c,h){return function(v,S){return fk(v,c,h(S),{})}}function Ef(c,h){return function(v,S){var P;if(v===n&&S===n)return h;if(v!==n&&(P=v),S!==n){if(P===n)return S;typeof v=="string"||typeof S=="string"?(v=sr(v),S=sr(S)):(v=U1(v),S=U1(S)),P=c(v,S)}return P}}function Am(c){return Go(function(h){return h=Ht(h,ir(Le())),ot(function(v){var S=this;return c(h,function(P){return or(P,S,v)})})})}function Rf(c,h){h=h===n?" ":sr(h);var v=h.length;if(v<2)return v?Rm(h,c):h;var S=Rm(h,ff(c/Ga(h)));return qa(h)?Mi(Kr(S),0,c).join(""):S.slice(0,c)}function zk(c,h,v,S){var P=h&x,A=Bc(c);function L(){for(var z=-1,K=arguments.length,he=-1,pe=S.length,ye=se(pe+K),$e=this&&this!==bn&&this instanceof L?A:c;++he<pe;)ye[he]=S[he];for(;K--;)ye[he++]=arguments[++z];return or($e,P?v:this,ye)}return L}function a_(c){return function(h,v,S){return S&&typeof S!="number"&&Fn(h,v,S)&&(v=S=n),h=Xo(h),v===n?(v=h,h=0):v=Xo(v),S=S===n?h<v?1:-1:Xo(S),Ck(h,v,S,c)}}function $f(c){return function(h,v){return typeof h=="string"&&typeof v=="string"||(h=kr(h),v=kr(v)),c(h,v)}}function l_(c,h,v,S,P,A,L,z,K,he){var pe=h&C,ye=pe?L:n,$e=pe?n:L,Ae=pe?A:n,Fe=pe?n:A;h|=pe?E:T,h&=~(pe?T:E),h&w||(h&=~(x|_));var tt=[c,h,P,Ae,ye,Fe,$e,z,K,he],ze=v.apply(n,tt);return Vm(c)&&x_(ze,tt),ze.placeholder=S,w_(ze,c,h)}function Im(c){var h=on[c];return function(v,S){if(v=kr(v),S=S==null?0:$n(Ze(S),292),S&&w1(v)){var P=(wt(v)+"e").split("e"),A=h(P[0]+"e"+(+P[1]+S));return P=(wt(A)+"e").split("e"),+(P[0]+"e"+(+P[1]-S))}return h(v)}}var jk=Xa&&1/tf(new Xa([,-0]))[1]==Y?function(c){return new Xa(c)}:nv;function c_(c){return function(h){var v=Pn(h);return v==Ne?um(h):v==Wt?rI(h):K5(h,c(h))}}function qo(c,h,v,S,P,A,L,z){var K=h&_;if(!K&&typeof c!="function")throw new Mr(s);var he=S?S.length:0;if(he||(h&=~(E|T),S=P=n),L=L===n?L:sn(Ze(L),0),z=z===n?z:Ze(z),he-=P?P.length:0,h&T){var pe=S,ye=P;S=P=n}var $e=K?n:Lm(c),Ae=[c,h,v,S,P,pe,ye,A,L,z];if($e&&t7(Ae,$e),c=Ae[0],h=Ae[1],v=Ae[2],S=Ae[3],P=Ae[4],z=Ae[9]=Ae[9]===n?K?0:c.length:sn(Ae[9]-he,0),!z&&h&(C|R)&&(h&=~(C|R)),!h||h==x)var Fe=Lk(c,h,v);else h==C||h==R?Fe=Fk(c,h,z):(h==E||h==(x|E))&&!P.length?Fe=zk(c,h,v,S):Fe=Cf.apply(n,Ae);var tt=$e?H1:x_;return w_(tt(Fe,Ae),c,h)}function u_(c,h,v,S){return c===n||Qr(c,Ka[v])&&!Et.call(S,v)?h:c}function d_(c,h,v,S,P,A){return Ut(c)&&Ut(h)&&(A.set(h,c),xf(c,h,n,d_,A),A.delete(h)),c}function Vk(c){return Uc(c)?n:c}function f_(c,h,v,S,P,A){var L=v&b,z=c.length,K=h.length;if(z!=K&&!(L&&K>z))return!1;var he=A.get(c),pe=A.get(h);if(he&&pe)return he==h&&pe==c;var ye=-1,$e=!0,Ae=v&y?new Is:n;for(A.set(c,h),A.set(h,c);++ye<z;){var Fe=c[ye],tt=h[ye];if(S)var ze=L?S(tt,Fe,ye,h,c,A):S(Fe,tt,ye,c,h,A);if(ze!==n){if(ze)continue;$e=!1;break}if(Ae){if(!om(h,function(ct,pt){if(!Dc(Ae,pt)&&(Fe===ct||P(Fe,ct,v,S,A)))return Ae.push(pt)})){$e=!1;break}}else if(!(Fe===tt||P(Fe,tt,v,S,A))){$e=!1;break}}return A.delete(c),A.delete(h),$e}function Bk(c,h,v,S,P,A,L){switch(v){case co:if(c.byteLength!=h.byteLength||c.byteOffset!=h.byteOffset)return!1;c=c.buffer,h=h.buffer;case vn:return!(c.byteLength!=h.byteLength||!A(new lf(c),new lf(h)));case J:case X:case Ve:return Qr(+c,+h);case be:return c.name==h.name&&c.message==h.message;case Gt:case En:return c==h+"";case Ne:var z=um;case Wt:var K=S&b;if(z||(z=tf),c.size!=h.size&&!K)return!1;var he=L.get(c);if(he)return he==h;S|=y,L.set(c,h);var pe=f_(z(c),z(h),S,P,A,L);return L.delete(c),pe;case rn:if(Nc)return Nc.call(c)==Nc.call(h)}return!1}function Hk(c,h,v,S,P,A){var L=v&b,z=km(c),K=z.length,he=km(h),pe=he.length;if(K!=pe&&!L)return!1;for(var ye=K;ye--;){var $e=z[ye];if(!(L?$e in h:Et.call(h,$e)))return!1}var Ae=A.get(c),Fe=A.get(h);if(Ae&&Fe)return Ae==h&&Fe==c;var tt=!0;A.set(c,h),A.set(h,c);for(var ze=L;++ye<K;){$e=z[ye];var ct=c[$e],pt=h[$e];if(S)var lr=L?S(pt,ct,$e,h,c,A):S(ct,pt,$e,c,h,A);if(!(lr===n?ct===pt||P(ct,pt,v,S,A):lr)){tt=!1;break}ze||(ze=$e=="constructor")}if(tt&&!ze){var zn=c.constructor,cr=h.constructor;zn!=cr&&"constructor"in c&&"constructor"in h&&!(typeof zn=="function"&&zn instanceof zn&&typeof cr=="function"&&cr instanceof cr)&&(tt=!1)}return A.delete(c),A.delete(h),tt}function Go(c){return Hm(b_(c,n,$_),c+"")}function km(c){return T1(c,hn,zm)}function Nm(c){return T1(c,qn,h_)}var Lm=pf?function(c){return pf.get(c)}:nv;function Pf(c){for(var h=c.name+"",v=Qa[h],S=Et.call(Qa,h)?v.length:0;S--;){var P=v[S],A=P.func;if(A==null||A==c)return P.name}return h}function tl(c){var h=Et.call(M,"placeholder")?M:c;return h.placeholder}function Le(){var c=M.iteratee||ev;return c=c===ev?k1:c,arguments.length?c(arguments[0],arguments[1]):c}function Of(c,h){var v=c.__data__;return Qk(h)?v[typeof h=="string"?"string":"hash"]:v.map}function Fm(c){for(var h=hn(c),v=h.length;v--;){var S=h[v],P=c[S];h[v]=[S,P,m_(P)]}return h}function Ls(c,h){var v=eI(c,h);return I1(v)?v:n}function Wk(c){var h=Et.call(c,Ts),v=c[Ts];try{c[Ts]=n;var S=!0}catch{}var P=sf.call(c);return S&&(h?c[Ts]=v:delete c[Ts]),P}var zm=fm?function(c){return c==null?[]:(c=Mt(c),Si(fm(c),function(h){return y1.call(c,h)}))}:rv,h_=fm?function(c){for(var h=[];c;)Ci(h,zm(c)),c=cf(c);return h}:rv,Pn=Ln;(hm&&Pn(new hm(new ArrayBuffer(1)))!=co||Ac&&Pn(new Ac)!=Ne||pm&&Pn(pm.resolve())!=ft||Xa&&Pn(new Xa)!=Wt||Ic&&Pn(new Ic)!=Gr)&&(Pn=function(c){var h=Ln(c),v=h==gt?c.constructor:n,S=v?Fs(v):"";if(S)switch(S){case RI:return co;case $I:return Ne;case PI:return ft;case OI:return Wt;case MI:return Gr}return h});function Uk(c,h,v){for(var S=-1,P=v.length;++S<P;){var A=v[S],L=A.size;switch(A.type){case"drop":c+=L;break;case"dropRight":h-=L;break;case"take":h=$n(h,c+L);break;case"takeRight":c=sn(c,h-L);break}}return{start:c,end:h}}function qk(c){var h=c.match(Mc);return h?h[1].split($):[]}function p_(c,h,v){h=Oi(h,c);for(var S=-1,P=h.length,A=!1;++S<P;){var L=po(h[S]);if(!(A=c!=null&&v(c,L)))break;c=c[L]}return A||++S!=P?A:(P=c==null?0:c.length,!!P&&Nf(P)&&Yo(L,P)&&(Ye(c)||zs(c)))}function Gk(c){var h=c.length,v=new c.constructor(h);return h&&typeof c[0]=="string"&&Et.call(c,"index")&&(v.index=c.index,v.input=c.input),v}function g_(c){return typeof c.constructor=="function"&&!Hc(c)?Za(cf(c)):{}}function Yk(c,h,v){var S=c.constructor;switch(h){case vn:return Tm(c);case J:case X:return new S(+c);case co:return Dk(c,v);case zo:case jo:case Yr:case ms:case vs:case bs:case ys:case xs:case ws:return Q1(c,v);case Ne:return new S;case Ve:case En:return new S(c);case Gt:return Tk(c);case Wt:return new S;case rn:return Ak(c)}}function Kk(c,h){var v=h.length;if(!v)return c;var S=v-1;return h[S]=(v>1?"& ":"")+h[S],h=h.join(v>2?", ":" "),c.replace(Oc,`{
70
- /* [wrapped with `+h+`] */
71
- `)}function Xk(c){return Ye(c)||zs(c)||!!(x1&&c&&c[x1])}function Yo(c,h){var v=typeof c;return h=h??Q,!!h&&(v=="number"||v!="symbol"&&Ge.test(c))&&c>-1&&c%1==0&&c<h}function Fn(c,h,v){if(!Ut(v))return!1;var S=typeof h;return(S=="number"?Un(v)&&Yo(h,v.length):S=="string"&&h in v)?Qr(v[h],c):!1}function jm(c,h){if(Ye(c))return!1;var v=typeof c;return v=="number"||v=="symbol"||v=="boolean"||c==null||ar(c)?!0:Rs.test(c)||!Es.test(c)||h!=null&&c in Mt(h)}function Qk(c){var h=typeof c;return h=="string"||h=="number"||h=="symbol"||h=="boolean"?c!=="__proto__":c===null}function Vm(c){var h=Pf(c),v=M[h];if(typeof v!="function"||!(h in dt.prototype))return!1;if(c===v)return!0;var S=Lm(v);return!!S&&c===S[0]}function Zk(c){return!!m1&&m1 in c}var Jk=rf?Ko:ov;function Hc(c){var h=c&&c.constructor,v=typeof h=="function"&&h.prototype||Ka;return c===v}function m_(c){return c===c&&!Ut(c)}function v_(c,h){return function(v){return v==null?!1:v[c]===h&&(h!==n||c in Mt(v))}}function e7(c){var h=If(c,function(S){return v.size===u&&v.clear(),S}),v=h.cache;return h}function t7(c,h){var v=c[1],S=h[1],P=v|S,A=P<(x|_|O),L=S==O&&v==C||S==O&&v==D&&c[7].length<=h[8]||S==(O|D)&&h[7].length<=h[8]&&v==C;if(!(A||L))return c;S&x&&(c[2]=h[2],P|=v&x?0:w);var z=h[3];if(z){var K=c[3];c[3]=K?J1(K,z,h[4]):z,c[4]=K?Ei(c[3],d):h[4]}return z=h[5],z&&(K=c[5],c[5]=K?e_(K,z,h[6]):z,c[6]=K?Ei(c[5],d):h[6]),z=h[7],z&&(c[7]=z),S&O&&(c[8]=c[8]==null?h[8]:$n(c[8],h[8])),c[9]==null&&(c[9]=h[9]),c[0]=h[0],c[1]=P,c}function n7(c){var h=[];if(c!=null)for(var v in Mt(c))h.push(v);return h}function r7(c){return sf.call(c)}function b_(c,h,v){return h=sn(h===n?c.length-1:h,0),function(){for(var S=arguments,P=-1,A=sn(S.length-h,0),L=se(A);++P<A;)L[P]=S[h+P];P=-1;for(var z=se(h+1);++P<h;)z[P]=S[P];return z[h]=v(L),or(c,this,z)}}function y_(c,h){return h.length<2?c:Ns(c,Ar(h,0,-1))}function o7(c,h){for(var v=c.length,S=$n(h.length,v),P=Wn(c);S--;){var A=h[S];c[S]=Yo(A,v)?P[A]:n}return c}function Bm(c,h){if(!(h==="constructor"&&typeof c[h]=="function")&&h!="__proto__")return c[h]}var x_=__(H1),Wc=yI||function(c,h){return bn.setTimeout(c,h)},Hm=__($k);function w_(c,h,v){var S=h+"";return Hm(c,Kk(S,i7(qk(S),v)))}function __(c){var h=0,v=0;return function(){var S=SI(),P=le-(S-v);if(v=S,P>0){if(++h>=G)return arguments[0]}else h=0;return c.apply(n,arguments)}}function Mf(c,h){var v=-1,S=c.length,P=S-1;for(h=h===n?S:h;++v<h;){var A=Em(v,P),L=c[A];c[A]=c[v],c[v]=L}return c.length=h,c}var S_=e7(function(c){var h=[];return c.charCodeAt(0)===46&&h.push(""),c.replace($c,function(v,S,P,A){h.push(P?A.replace(xe,"$1"):S||v)}),h});function po(c){if(typeof c=="string"||ar(c))return c;var h=c+"";return h=="0"&&1/c==-Y?"-0":h}function Fs(c){if(c!=null){try{return of.call(c)}catch{}try{return c+""}catch{}}return""}function i7(c,h){return Or(ue,function(v){var S="_."+v[0];h&v[1]&&!Jd(c,S)&&c.push(S)}),c.sort()}function C_(c){if(c instanceof dt)return c.clone();var h=new Dr(c.__wrapped__,c.__chain__);return h.__actions__=Wn(c.__actions__),h.__index__=c.__index__,h.__values__=c.__values__,h}function s7(c,h,v){(v?Fn(c,h,v):h===n)?h=1:h=sn(Ze(h),0);var S=c==null?0:c.length;if(!S||h<1)return[];for(var P=0,A=0,L=se(ff(S/h));P<S;)L[A++]=Ar(c,P,P+=h);return L}function a7(c){for(var h=-1,v=c==null?0:c.length,S=0,P=[];++h<v;){var A=c[h];A&&(P[S++]=A)}return P}function l7(){var c=arguments.length;if(!c)return[];for(var h=se(c-1),v=arguments[0],S=c;S--;)h[S-1]=arguments[S];return Ci(Ye(v)?Wn(v):[v],yn(h,1))}var c7=ot(function(c,h){return Zt(c)?Fc(c,yn(h,1,Zt,!0)):[]}),u7=ot(function(c,h){var v=Ir(h);return Zt(v)&&(v=n),Zt(c)?Fc(c,yn(h,1,Zt,!0),Le(v,2)):[]}),d7=ot(function(c,h){var v=Ir(h);return Zt(v)&&(v=n),Zt(c)?Fc(c,yn(h,1,Zt,!0),n,v):[]});function f7(c,h,v){var S=c==null?0:c.length;return S?(h=v||h===n?1:Ze(h),Ar(c,h<0?0:h,S)):[]}function h7(c,h,v){var S=c==null?0:c.length;return S?(h=v||h===n?1:Ze(h),h=S-h,Ar(c,0,h<0?0:h)):[]}function p7(c,h){return c&&c.length?_f(c,Le(h,3),!0,!0):[]}function g7(c,h){return c&&c.length?_f(c,Le(h,3),!0):[]}function m7(c,h,v,S){var P=c==null?0:c.length;return P?(v&&typeof v!="number"&&Fn(c,h,v)&&(v=0,S=P),lk(c,h,v,S)):[]}function E_(c,h,v){var S=c==null?0:c.length;if(!S)return-1;var P=v==null?0:Ze(v);return P<0&&(P=sn(S+P,0)),ef(c,Le(h,3),P)}function R_(c,h,v){var S=c==null?0:c.length;if(!S)return-1;var P=S-1;return v!==n&&(P=Ze(v),P=v<0?sn(S+P,0):$n(P,S-1)),ef(c,Le(h,3),P,!0)}function $_(c){var h=c==null?0:c.length;return h?yn(c,1):[]}function v7(c){var h=c==null?0:c.length;return h?yn(c,Y):[]}function b7(c,h){var v=c==null?0:c.length;return v?(h=h===n?1:Ze(h),yn(c,h)):[]}function y7(c){for(var h=-1,v=c==null?0:c.length,S={};++h<v;){var P=c[h];S[P[0]]=P[1]}return S}function P_(c){return c&&c.length?c[0]:n}function x7(c,h,v){var S=c==null?0:c.length;if(!S)return-1;var P=v==null?0:Ze(v);return P<0&&(P=sn(S+P,0)),Ua(c,h,P)}function w7(c){var h=c==null?0:c.length;return h?Ar(c,0,-1):[]}var _7=ot(function(c){var h=Ht(c,Mm);return h.length&&h[0]===c[0]?xm(h):[]}),S7=ot(function(c){var h=Ir(c),v=Ht(c,Mm);return h===Ir(v)?h=n:v.pop(),v.length&&v[0]===c[0]?xm(v,Le(h,2)):[]}),C7=ot(function(c){var h=Ir(c),v=Ht(c,Mm);return h=typeof h=="function"?h:n,h&&v.pop(),v.length&&v[0]===c[0]?xm(v,n,h):[]});function E7(c,h){return c==null?"":wI.call(c,h)}function Ir(c){var h=c==null?0:c.length;return h?c[h-1]:n}function R7(c,h,v){var S=c==null?0:c.length;if(!S)return-1;var P=S;return v!==n&&(P=Ze(v),P=P<0?sn(S+P,0):$n(P,S-1)),h===h?iI(c,h,P):ef(c,l1,P,!0)}function $7(c,h){return c&&c.length?z1(c,Ze(h)):n}var P7=ot(O_);function O_(c,h){return c&&c.length&&h&&h.length?Cm(c,h):c}function O7(c,h,v){return c&&c.length&&h&&h.length?Cm(c,h,Le(v,2)):c}function M7(c,h,v){return c&&c.length&&h&&h.length?Cm(c,h,n,v):c}var D7=Go(function(c,h){var v=c==null?0:c.length,S=mm(c,h);return B1(c,Ht(h,function(P){return Yo(P,v)?+P:P}).sort(Z1)),S});function T7(c,h){var v=[];if(!(c&&c.length))return v;var S=-1,P=[],A=c.length;for(h=Le(h,3);++S<A;){var L=c[S];h(L,S,c)&&(v.push(L),P.push(S))}return B1(c,P),v}function Wm(c){return c==null?c:EI.call(c)}function A7(c,h,v){var S=c==null?0:c.length;return S?(v&&typeof v!="number"&&Fn(c,h,v)?(h=0,v=S):(h=h==null?0:Ze(h),v=v===n?S:Ze(v)),Ar(c,h,v)):[]}function I7(c,h){return wf(c,h)}function k7(c,h,v){return $m(c,h,Le(v,2))}function N7(c,h){var v=c==null?0:c.length;if(v){var S=wf(c,h);if(S<v&&Qr(c[S],h))return S}return-1}function L7(c,h){return wf(c,h,!0)}function F7(c,h,v){return $m(c,h,Le(v,2),!0)}function z7(c,h){var v=c==null?0:c.length;if(v){var S=wf(c,h,!0)-1;if(Qr(c[S],h))return S}return-1}function j7(c){return c&&c.length?W1(c):[]}function V7(c,h){return c&&c.length?W1(c,Le(h,2)):[]}function B7(c){var h=c==null?0:c.length;return h?Ar(c,1,h):[]}function H7(c,h,v){return c&&c.length?(h=v||h===n?1:Ze(h),Ar(c,0,h<0?0:h)):[]}function W7(c,h,v){var S=c==null?0:c.length;return S?(h=v||h===n?1:Ze(h),h=S-h,Ar(c,h<0?0:h,S)):[]}function U7(c,h){return c&&c.length?_f(c,Le(h,3),!1,!0):[]}function q7(c,h){return c&&c.length?_f(c,Le(h,3)):[]}var G7=ot(function(c){return Pi(yn(c,1,Zt,!0))}),Y7=ot(function(c){var h=Ir(c);return Zt(h)&&(h=n),Pi(yn(c,1,Zt,!0),Le(h,2))}),K7=ot(function(c){var h=Ir(c);return h=typeof h=="function"?h:n,Pi(yn(c,1,Zt,!0),n,h)});function X7(c){return c&&c.length?Pi(c):[]}function Q7(c,h){return c&&c.length?Pi(c,Le(h,2)):[]}function Z7(c,h){return h=typeof h=="function"?h:n,c&&c.length?Pi(c,n,h):[]}function Um(c){if(!(c&&c.length))return[];var h=0;return c=Si(c,function(v){if(Zt(v))return h=sn(v.length,h),!0}),lm(h,function(v){return Ht(c,im(v))})}function M_(c,h){if(!(c&&c.length))return[];var v=Um(c);return h==null?v:Ht(v,function(S){return or(h,n,S)})}var J7=ot(function(c,h){return Zt(c)?Fc(c,h):[]}),e3=ot(function(c){return Om(Si(c,Zt))}),t3=ot(function(c){var h=Ir(c);return Zt(h)&&(h=n),Om(Si(c,Zt),Le(h,2))}),n3=ot(function(c){var h=Ir(c);return h=typeof h=="function"?h:n,Om(Si(c,Zt),n,h)}),r3=ot(Um);function o3(c,h){return Y1(c||[],h||[],Lc)}function i3(c,h){return Y1(c||[],h||[],Vc)}var s3=ot(function(c){var h=c.length,v=h>1?c[h-1]:n;return v=typeof v=="function"?(c.pop(),v):n,M_(c,v)});function D_(c){var h=M(c);return h.__chain__=!0,h}function a3(c,h){return h(c),c}function Df(c,h){return h(c)}var l3=Go(function(c){var h=c.length,v=h?c[0]:0,S=this.__wrapped__,P=function(A){return mm(A,c)};return h>1||this.__actions__.length||!(S instanceof dt)||!Yo(v)?this.thru(P):(S=S.slice(v,+v+(h?1:0)),S.__actions__.push({func:Df,args:[P],thisArg:n}),new Dr(S,this.__chain__).thru(function(A){return h&&!A.length&&A.push(n),A}))});function c3(){return D_(this)}function u3(){return new Dr(this.value(),this.__chain__)}function d3(){this.__values__===n&&(this.__values__=U_(this.value()));var c=this.__index__>=this.__values__.length,h=c?n:this.__values__[this.__index__++];return{done:c,value:h}}function f3(){return this}function h3(c){for(var h,v=this;v instanceof mf;){var S=C_(v);S.__index__=0,S.__values__=n,h?P.__wrapped__=S:h=S;var P=S;v=v.__wrapped__}return P.__wrapped__=c,h}function p3(){var c=this.__wrapped__;if(c instanceof dt){var h=c;return this.__actions__.length&&(h=new dt(this)),h=h.reverse(),h.__actions__.push({func:Df,args:[Wm],thisArg:n}),new Dr(h,this.__chain__)}return this.thru(Wm)}function g3(){return G1(this.__wrapped__,this.__actions__)}var m3=Sf(function(c,h,v){Et.call(c,v)?++c[v]:Uo(c,v,1)});function v3(c,h,v){var S=Ye(c)?s1:ak;return v&&Fn(c,h,v)&&(h=n),S(c,Le(h,3))}function b3(c,h){var v=Ye(c)?Si:M1;return v(c,Le(h,3))}var y3=o_(E_),x3=o_(R_);function w3(c,h){return yn(Tf(c,h),1)}function _3(c,h){return yn(Tf(c,h),Y)}function S3(c,h,v){return v=v===n?1:Ze(v),yn(Tf(c,h),v)}function T_(c,h){var v=Ye(c)?Or:$i;return v(c,Le(h,3))}function A_(c,h){var v=Ye(c)?B5:O1;return v(c,Le(h,3))}var C3=Sf(function(c,h,v){Et.call(c,v)?c[v].push(h):Uo(c,v,[h])});function E3(c,h,v,S){c=Un(c)?c:rl(c),v=v&&!S?Ze(v):0;var P=c.length;return v<0&&(v=sn(P+v,0)),Lf(c)?v<=P&&c.indexOf(h,v)>-1:!!P&&Ua(c,h,v)>-1}var R3=ot(function(c,h,v){var S=-1,P=typeof h=="function",A=Un(c)?se(c.length):[];return $i(c,function(L){A[++S]=P?or(h,L,v):zc(L,h,v)}),A}),$3=Sf(function(c,h,v){Uo(c,v,h)});function Tf(c,h){var v=Ye(c)?Ht:N1;return v(c,Le(h,3))}function P3(c,h,v,S){return c==null?[]:(Ye(h)||(h=h==null?[]:[h]),v=S?n:v,Ye(v)||(v=v==null?[]:[v]),j1(c,h,v))}var O3=Sf(function(c,h,v){c[v?0:1].push(h)},function(){return[[],[]]});function M3(c,h,v){var S=Ye(c)?rm:u1,P=arguments.length<3;return S(c,Le(h,4),v,P,$i)}function D3(c,h,v){var S=Ye(c)?H5:u1,P=arguments.length<3;return S(c,Le(h,4),v,P,O1)}function T3(c,h){var v=Ye(c)?Si:M1;return v(c,kf(Le(h,3)))}function A3(c){var h=Ye(c)?E1:Ek;return h(c)}function I3(c,h,v){(v?Fn(c,h,v):h===n)?h=1:h=Ze(h);var S=Ye(c)?nk:Rk;return S(c,h)}function k3(c){var h=Ye(c)?rk:Pk;return h(c)}function N3(c){if(c==null)return 0;if(Un(c))return Lf(c)?Ga(c):c.length;var h=Pn(c);return h==Ne||h==Wt?c.size:_m(c).length}function L3(c,h,v){var S=Ye(c)?om:Ok;return v&&Fn(c,h,v)&&(h=n),S(c,Le(h,3))}var F3=ot(function(c,h){if(c==null)return[];var v=h.length;return v>1&&Fn(c,h[0],h[1])?h=[]:v>2&&Fn(h[0],h[1],h[2])&&(h=[h[0]]),j1(c,yn(h,1),[])}),Af=bI||function(){return bn.Date.now()};function z3(c,h){if(typeof h!="function")throw new Mr(s);return c=Ze(c),function(){if(--c<1)return h.apply(this,arguments)}}function I_(c,h,v){return h=v?n:h,h=c&&h==null?c.length:h,qo(c,O,n,n,n,n,h)}function k_(c,h){var v;if(typeof h!="function")throw new Mr(s);return c=Ze(c),function(){return--c>0&&(v=h.apply(this,arguments)),c<=1&&(h=n),v}}var qm=ot(function(c,h,v){var S=x;if(v.length){var P=Ei(v,tl(qm));S|=E}return qo(c,S,h,v,P)}),N_=ot(function(c,h,v){var S=x|_;if(v.length){var P=Ei(v,tl(N_));S|=E}return qo(h,S,c,v,P)});function L_(c,h,v){h=v?n:h;var S=qo(c,C,n,n,n,n,n,h);return S.placeholder=L_.placeholder,S}function F_(c,h,v){h=v?n:h;var S=qo(c,R,n,n,n,n,n,h);return S.placeholder=F_.placeholder,S}function z_(c,h,v){var S,P,A,L,z,K,he=0,pe=!1,ye=!1,$e=!0;if(typeof c!="function")throw new Mr(s);h=kr(h)||0,Ut(v)&&(pe=!!v.leading,ye="maxWait"in v,A=ye?sn(kr(v.maxWait)||0,h):A,$e="trailing"in v?!!v.trailing:$e);function Ae(Jt){var Zr=S,Qo=P;return S=P=n,he=Jt,L=c.apply(Qo,Zr),L}function Fe(Jt){return he=Jt,z=Wc(ct,h),pe?Ae(Jt):L}function tt(Jt){var Zr=Jt-K,Qo=Jt-he,oS=h-Zr;return ye?$n(oS,A-Qo):oS}function ze(Jt){var Zr=Jt-K,Qo=Jt-he;return K===n||Zr>=h||Zr<0||ye&&Qo>=A}function ct(){var Jt=Af();if(ze(Jt))return pt(Jt);z=Wc(ct,tt(Jt))}function pt(Jt){return z=n,$e&&S?Ae(Jt):(S=P=n,L)}function lr(){z!==n&&K1(z),he=0,S=K=P=z=n}function zn(){return z===n?L:pt(Af())}function cr(){var Jt=Af(),Zr=ze(Jt);if(S=arguments,P=this,K=Jt,Zr){if(z===n)return Fe(K);if(ye)return K1(z),z=Wc(ct,h),Ae(K)}return z===n&&(z=Wc(ct,h)),L}return cr.cancel=lr,cr.flush=zn,cr}var j3=ot(function(c,h){return P1(c,1,h)}),V3=ot(function(c,h,v){return P1(c,kr(h)||0,v)});function B3(c){return qo(c,I)}function If(c,h){if(typeof c!="function"||h!=null&&typeof h!="function")throw new Mr(s);var v=function(){var S=arguments,P=h?h.apply(this,S):S[0],A=v.cache;if(A.has(P))return A.get(P);var L=c.apply(this,S);return v.cache=A.set(P,L)||A,L};return v.cache=new(If.Cache||Wo),v}If.Cache=Wo;function kf(c){if(typeof c!="function")throw new Mr(s);return function(){var h=arguments;switch(h.length){case 0:return!c.call(this);case 1:return!c.call(this,h[0]);case 2:return!c.call(this,h[0],h[1]);case 3:return!c.call(this,h[0],h[1],h[2])}return!c.apply(this,h)}}function H3(c){return k_(2,c)}var W3=Mk(function(c,h){h=h.length==1&&Ye(h[0])?Ht(h[0],ir(Le())):Ht(yn(h,1),ir(Le()));var v=h.length;return ot(function(S){for(var P=-1,A=$n(S.length,v);++P<A;)S[P]=h[P].call(this,S[P]);return or(c,this,S)})}),Gm=ot(function(c,h){var v=Ei(h,tl(Gm));return qo(c,E,n,h,v)}),j_=ot(function(c,h){var v=Ei(h,tl(j_));return qo(c,T,n,h,v)}),U3=Go(function(c,h){return qo(c,D,n,n,n,h)});function q3(c,h){if(typeof c!="function")throw new Mr(s);return h=h===n?h:Ze(h),ot(c,h)}function G3(c,h){if(typeof c!="function")throw new Mr(s);return h=h==null?0:sn(Ze(h),0),ot(function(v){var S=v[h],P=Mi(v,0,h);return S&&Ci(P,S),or(c,this,P)})}function Y3(c,h,v){var S=!0,P=!0;if(typeof c!="function")throw new Mr(s);return Ut(v)&&(S="leading"in v?!!v.leading:S,P="trailing"in v?!!v.trailing:P),z_(c,h,{leading:S,maxWait:h,trailing:P})}function K3(c){return I_(c,1)}function X3(c,h){return Gm(Dm(h),c)}function Q3(){if(!arguments.length)return[];var c=arguments[0];return Ye(c)?c:[c]}function Z3(c){return Tr(c,g)}function J3(c,h){return h=typeof h=="function"?h:n,Tr(c,g,h)}function eN(c){return Tr(c,f|g)}function tN(c,h){return h=typeof h=="function"?h:n,Tr(c,f|g,h)}function nN(c,h){return h==null||$1(c,h,hn(h))}function Qr(c,h){return c===h||c!==c&&h!==h}var rN=$f(ym),oN=$f(function(c,h){return c>=h}),zs=A1(function(){return arguments}())?A1:function(c){return Yt(c)&&Et.call(c,"callee")&&!y1.call(c,"callee")},Ye=se.isArray,iN=e1?ir(e1):hk;function Un(c){return c!=null&&Nf(c.length)&&!Ko(c)}function Zt(c){return Yt(c)&&Un(c)}function sN(c){return c===!0||c===!1||Yt(c)&&Ln(c)==J}var Di=xI||ov,aN=t1?ir(t1):pk;function lN(c){return Yt(c)&&c.nodeType===1&&!Uc(c)}function cN(c){if(c==null)return!0;if(Un(c)&&(Ye(c)||typeof c=="string"||typeof c.splice=="function"||Di(c)||nl(c)||zs(c)))return!c.length;var h=Pn(c);if(h==Ne||h==Wt)return!c.size;if(Hc(c))return!_m(c).length;for(var v in c)if(Et.call(c,v))return!1;return!0}function uN(c,h){return jc(c,h)}function dN(c,h,v){v=typeof v=="function"?v:n;var S=v?v(c,h):n;return S===n?jc(c,h,n,v):!!S}function Ym(c){if(!Yt(c))return!1;var h=Ln(c);return h==be||h==re||typeof c.message=="string"&&typeof c.name=="string"&&!Uc(c)}function fN(c){return typeof c=="number"&&w1(c)}function Ko(c){if(!Ut(c))return!1;var h=Ln(c);return h==H||h==De||h==de||h==ht}function V_(c){return typeof c=="number"&&c==Ze(c)}function Nf(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=Q}function Ut(c){var h=typeof c;return c!=null&&(h=="object"||h=="function")}function Yt(c){return c!=null&&typeof c=="object"}var B_=n1?ir(n1):mk;function hN(c,h){return c===h||wm(c,h,Fm(h))}function pN(c,h,v){return v=typeof v=="function"?v:n,wm(c,h,Fm(h),v)}function gN(c){return H_(c)&&c!=+c}function mN(c){if(Jk(c))throw new Ue(i);return I1(c)}function vN(c){return c===null}function bN(c){return c==null}function H_(c){return typeof c=="number"||Yt(c)&&Ln(c)==Ve}function Uc(c){if(!Yt(c)||Ln(c)!=gt)return!1;var h=cf(c);if(h===null)return!0;var v=Et.call(h,"constructor")&&h.constructor;return typeof v=="function"&&v instanceof v&&of.call(v)==pI}var Km=r1?ir(r1):vk;function yN(c){return V_(c)&&c>=-Q&&c<=Q}var W_=o1?ir(o1):bk;function Lf(c){return typeof c=="string"||!Ye(c)&&Yt(c)&&Ln(c)==En}function ar(c){return typeof c=="symbol"||Yt(c)&&Ln(c)==rn}var nl=i1?ir(i1):yk;function xN(c){return c===n}function wN(c){return Yt(c)&&Pn(c)==Gr}function _N(c){return Yt(c)&&Ln(c)==gs}var SN=$f(Sm),CN=$f(function(c,h){return c<=h});function U_(c){if(!c)return[];if(Un(c))return Lf(c)?Kr(c):Wn(c);if(Tc&&c[Tc])return nI(c[Tc]());var h=Pn(c),v=h==Ne?um:h==Wt?tf:rl;return v(c)}function Xo(c){if(!c)return c===0?c:0;if(c=kr(c),c===Y||c===-Y){var h=c<0?-1:1;return h*ae}return c===c?c:0}function Ze(c){var h=Xo(c),v=h%1;return h===h?v?h-v:h:0}function q_(c){return c?ks(Ze(c),0,B):0}function kr(c){if(typeof c=="number")return c;if(ar(c))return j;if(Ut(c)){var h=typeof c.valueOf=="function"?c.valueOf():c;c=Ut(h)?h+"":h}if(typeof c!="string")return c===0?c:+c;c=d1(c);var v=Re.test(c);return v||He.test(c)?z5(c.slice(2),v?2:8):Pe.test(c)?j:+c}function G_(c){return ho(c,qn(c))}function EN(c){return c?ks(Ze(c),-Q,Q):c===0?c:0}function wt(c){return c==null?"":sr(c)}var RN=Ja(function(c,h){if(Hc(h)||Un(h)){ho(h,hn(h),c);return}for(var v in h)Et.call(h,v)&&Lc(c,v,h[v])}),Y_=Ja(function(c,h){ho(h,qn(h),c)}),Ff=Ja(function(c,h,v,S){ho(h,qn(h),c,S)}),$N=Ja(function(c,h,v,S){ho(h,hn(h),c,S)}),PN=Go(mm);function ON(c,h){var v=Za(c);return h==null?v:R1(v,h)}var MN=ot(function(c,h){c=Mt(c);var v=-1,S=h.length,P=S>2?h[2]:n;for(P&&Fn(h[0],h[1],P)&&(S=1);++v<S;)for(var A=h[v],L=qn(A),z=-1,K=L.length;++z<K;){var he=L[z],pe=c[he];(pe===n||Qr(pe,Ka[he])&&!Et.call(c,he))&&(c[he]=A[he])}return c}),DN=ot(function(c){return c.push(n,d_),or(K_,n,c)});function TN(c,h){return a1(c,Le(h,3),fo)}function AN(c,h){return a1(c,Le(h,3),bm)}function IN(c,h){return c==null?c:vm(c,Le(h,3),qn)}function kN(c,h){return c==null?c:D1(c,Le(h,3),qn)}function NN(c,h){return c&&fo(c,Le(h,3))}function LN(c,h){return c&&bm(c,Le(h,3))}function FN(c){return c==null?[]:yf(c,hn(c))}function zN(c){return c==null?[]:yf(c,qn(c))}function Xm(c,h,v){var S=c==null?n:Ns(c,h);return S===n?v:S}function jN(c,h){return c!=null&&p_(c,h,ck)}function Qm(c,h){return c!=null&&p_(c,h,uk)}var VN=s_(function(c,h,v){h!=null&&typeof h.toString!="function"&&(h=sf.call(h)),c[h]=v},Jm(Gn)),BN=s_(function(c,h,v){h!=null&&typeof h.toString!="function"&&(h=sf.call(h)),Et.call(c,h)?c[h].push(v):c[h]=[v]},Le),HN=ot(zc);function hn(c){return Un(c)?C1(c):_m(c)}function qn(c){return Un(c)?C1(c,!0):xk(c)}function WN(c,h){var v={};return h=Le(h,3),fo(c,function(S,P,A){Uo(v,h(S,P,A),S)}),v}function UN(c,h){var v={};return h=Le(h,3),fo(c,function(S,P,A){Uo(v,P,h(S,P,A))}),v}var qN=Ja(function(c,h,v){xf(c,h,v)}),K_=Ja(function(c,h,v,S){xf(c,h,v,S)}),GN=Go(function(c,h){var v={};if(c==null)return v;var S=!1;h=Ht(h,function(A){return A=Oi(A,c),S||(S=A.length>1),A}),ho(c,Nm(c),v),S&&(v=Tr(v,f|p|g,Vk));for(var P=h.length;P--;)Pm(v,h[P]);return v});function YN(c,h){return X_(c,kf(Le(h)))}var KN=Go(function(c,h){return c==null?{}:_k(c,h)});function X_(c,h){if(c==null)return{};var v=Ht(Nm(c),function(S){return[S]});return h=Le(h),V1(c,v,function(S,P){return h(S,P[0])})}function XN(c,h,v){h=Oi(h,c);var S=-1,P=h.length;for(P||(P=1,c=n);++S<P;){var A=c==null?n:c[po(h[S])];A===n&&(S=P,A=v),c=Ko(A)?A.call(c):A}return c}function QN(c,h,v){return c==null?c:Vc(c,h,v)}function ZN(c,h,v,S){return S=typeof S=="function"?S:n,c==null?c:Vc(c,h,v,S)}var Q_=c_(hn),Z_=c_(qn);function JN(c,h,v){var S=Ye(c),P=S||Di(c)||nl(c);if(h=Le(h,4),v==null){var A=c&&c.constructor;P?v=S?new A:[]:Ut(c)?v=Ko(A)?Za(cf(c)):{}:v={}}return(P?Or:fo)(c,function(L,z,K){return h(v,L,z,K)}),v}function e6(c,h){return c==null?!0:Pm(c,h)}function t6(c,h,v){return c==null?c:q1(c,h,Dm(v))}function n6(c,h,v,S){return S=typeof S=="function"?S:n,c==null?c:q1(c,h,Dm(v),S)}function rl(c){return c==null?[]:cm(c,hn(c))}function r6(c){return c==null?[]:cm(c,qn(c))}function o6(c,h,v){return v===n&&(v=h,h=n),v!==n&&(v=kr(v),v=v===v?v:0),h!==n&&(h=kr(h),h=h===h?h:0),ks(kr(c),h,v)}function i6(c,h,v){return h=Xo(h),v===n?(v=h,h=0):v=Xo(v),c=kr(c),dk(c,h,v)}function s6(c,h,v){if(v&&typeof v!="boolean"&&Fn(c,h,v)&&(h=v=n),v===n&&(typeof h=="boolean"?(v=h,h=n):typeof c=="boolean"&&(v=c,c=n)),c===n&&h===n?(c=0,h=1):(c=Xo(c),h===n?(h=c,c=0):h=Xo(h)),c>h){var S=c;c=h,h=S}if(v||c%1||h%1){var P=_1();return $n(c+P*(h-c+F5("1e-"+((P+"").length-1))),h)}return Em(c,h)}var a6=el(function(c,h,v){return h=h.toLowerCase(),c+(v?J_(h):h)});function J_(c){return Zm(wt(c).toLowerCase())}function eS(c){return c=wt(c),c&&c.replace(Ot,Q5).replace(P5,"")}function l6(c,h,v){c=wt(c),h=sr(h);var S=c.length;v=v===n?S:ks(Ze(v),0,S);var P=v;return v-=h.length,v>=0&&c.slice(v,P)==h}function c6(c){return c=wt(c),c&&Ss.test(c)?c.replace(uo,Z5):c}function u6(c){return c=wt(c),c&&Ps.test(c)?c.replace($s,"\\$&"):c}var d6=el(function(c,h,v){return c+(v?"-":"")+h.toLowerCase()}),f6=el(function(c,h,v){return c+(v?" ":"")+h.toLowerCase()}),h6=r_("toLowerCase");function p6(c,h,v){c=wt(c),h=Ze(h);var S=h?Ga(c):0;if(!h||S>=h)return c;var P=(h-S)/2;return Rf(hf(P),v)+c+Rf(ff(P),v)}function g6(c,h,v){c=wt(c),h=Ze(h);var S=h?Ga(c):0;return h&&S<h?c+Rf(h-S,v):c}function m6(c,h,v){c=wt(c),h=Ze(h);var S=h?Ga(c):0;return h&&S<h?Rf(h-S,v)+c:c}function v6(c,h,v){return v||h==null?h=0:h&&(h=+h),CI(wt(c).replace(Os,""),h||0)}function b6(c,h,v){return(v?Fn(c,h,v):h===n)?h=1:h=Ze(h),Rm(wt(c),h)}function y6(){var c=arguments,h=wt(c[0]);return c.length<3?h:h.replace(c[1],c[2])}var x6=el(function(c,h,v){return c+(v?"_":"")+h.toLowerCase()});function w6(c,h,v){return v&&typeof v!="number"&&Fn(c,h,v)&&(h=v=n),v=v===n?B:v>>>0,v?(c=wt(c),c&&(typeof h=="string"||h!=null&&!Km(h))&&(h=sr(h),!h&&qa(c))?Mi(Kr(c),0,v):c.split(h,v)):[]}var _6=el(function(c,h,v){return c+(v?" ":"")+Zm(h)});function S6(c,h,v){return c=wt(c),v=v==null?0:ks(Ze(v),0,c.length),h=sr(h),c.slice(v,v+h.length)==h}function C6(c,h,v){var S=M.templateSettings;v&&Fn(c,h,v)&&(h=n),c=wt(c),h=Ff({},h,S,u_);var P=Ff({},h.imports,S.imports,u_),A=hn(P),L=cm(P,A),z,K,he=0,pe=h.interpolate||fn,ye="__p += '",$e=dm((h.escape||fn).source+"|"+pe.source+"|"+(pe===Ha?Te:fn).source+"|"+(h.evaluate||fn).source+"|$","g"),Ae="//# sourceURL="+(Et.call(h,"sourceURL")?(h.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++A5+"]")+`
72
- `;c.replace($e,function(ze,ct,pt,lr,zn,cr){return pt||(pt=lr),ye+=c.slice(he,cr).replace(Ms,J5),ct&&(z=!0,ye+=`' +
73
- __e(`+ct+`) +
74
- '`),zn&&(K=!0,ye+=`';
75
- `+zn+`;
76
- __p += '`),pt&&(ye+=`' +
77
- ((__t = (`+pt+`)) == null ? '' : __t) +
78
- '`),he=cr+ze.length,ze}),ye+=`';
79
- `;var Fe=Et.call(h,"variable")&&h.variable;if(!Fe)ye=`with (obj) {
80
- `+ye+`
81
- }
82
- `;else if(oe.test(Fe))throw new Ue(a);ye=(K?ye.replace(Ec,""):ye).replace(Vo,"$1").replace(_s,"$1;"),ye="function("+(Fe||"obj")+`) {
83
- `+(Fe?"":`obj || (obj = {});
84
- `)+"var __t, __p = ''"+(z?", __e = _.escape":"")+(K?`, __j = Array.prototype.join;
85
- function print() { __p += __j.call(arguments, '') }
86
- `:`;
87
- `)+ye+`return __p
88
- }`;var tt=nS(function(){return yt(A,Ae+"return "+ye).apply(n,L)});if(tt.source=ye,Ym(tt))throw tt;return tt}function E6(c){return wt(c).toLowerCase()}function R6(c){return wt(c).toUpperCase()}function $6(c,h,v){if(c=wt(c),c&&(v||h===n))return d1(c);if(!c||!(h=sr(h)))return c;var S=Kr(c),P=Kr(h),A=f1(S,P),L=h1(S,P)+1;return Mi(S,A,L).join("")}function P6(c,h,v){if(c=wt(c),c&&(v||h===n))return c.slice(0,g1(c)+1);if(!c||!(h=sr(h)))return c;var S=Kr(c),P=h1(S,Kr(h))+1;return Mi(S,0,P).join("")}function O6(c,h,v){if(c=wt(c),c&&(v||h===n))return c.replace(Os,"");if(!c||!(h=sr(h)))return c;var S=Kr(c),P=f1(S,Kr(h));return Mi(S,P).join("")}function M6(c,h){var v=N,S=V;if(Ut(h)){var P="separator"in h?h.separator:P;v="length"in h?Ze(h.length):v,S="omission"in h?sr(h.omission):S}c=wt(c);var A=c.length;if(qa(c)){var L=Kr(c);A=L.length}if(v>=A)return c;var z=v-Ga(S);if(z<1)return S;var K=L?Mi(L,0,z).join(""):c.slice(0,z);if(P===n)return K+S;if(L&&(z+=K.length-z),Km(P)){if(c.slice(z).search(P)){var he,pe=K;for(P.global||(P=dm(P.source,wt(Ie.exec(P))+"g")),P.lastIndex=0;he=P.exec(pe);)var ye=he.index;K=K.slice(0,ye===n?z:ye)}}else if(c.indexOf(sr(P),z)!=z){var $e=K.lastIndexOf(P);$e>-1&&(K=K.slice(0,$e))}return K+S}function D6(c){return c=wt(c),c&&Bo.test(c)?c.replace(Rn,sI):c}var T6=el(function(c,h,v){return c+(v?" ":"")+h.toUpperCase()}),Zm=r_("toUpperCase");function tS(c,h,v){return c=wt(c),h=v?n:h,h===n?tI(c)?cI(c):q5(c):c.match(h)||[]}var nS=ot(function(c,h){try{return or(c,n,h)}catch(v){return Ym(v)?v:new Ue(v)}}),A6=Go(function(c,h){return Or(h,function(v){v=po(v),Uo(c,v,qm(c[v],c))}),c});function I6(c){var h=c==null?0:c.length,v=Le();return c=h?Ht(c,function(S){if(typeof S[1]!="function")throw new Mr(s);return[v(S[0]),S[1]]}):[],ot(function(S){for(var P=-1;++P<h;){var A=c[P];if(or(A[0],this,S))return or(A[1],this,S)}})}function k6(c){return sk(Tr(c,f))}function Jm(c){return function(){return c}}function N6(c,h){return c==null||c!==c?h:c}var L6=i_(),F6=i_(!0);function Gn(c){return c}function ev(c){return k1(typeof c=="function"?c:Tr(c,f))}function z6(c){return L1(Tr(c,f))}function j6(c,h){return F1(c,Tr(h,f))}var V6=ot(function(c,h){return function(v){return zc(v,c,h)}}),B6=ot(function(c,h){return function(v){return zc(c,v,h)}});function tv(c,h,v){var S=hn(h),P=yf(h,S);v==null&&!(Ut(h)&&(P.length||!S.length))&&(v=h,h=c,c=this,P=yf(h,hn(h)));var A=!(Ut(v)&&"chain"in v)||!!v.chain,L=Ko(c);return Or(P,function(z){var K=h[z];c[z]=K,L&&(c.prototype[z]=function(){var he=this.__chain__;if(A||he){var pe=c(this.__wrapped__),ye=pe.__actions__=Wn(this.__actions__);return ye.push({func:K,args:arguments,thisArg:c}),pe.__chain__=he,pe}return K.apply(c,Ci([this.value()],arguments))})}),c}function H6(){return bn._===this&&(bn._=gI),this}function nv(){}function W6(c){return c=Ze(c),ot(function(h){return z1(h,c)})}var U6=Am(Ht),q6=Am(s1),G6=Am(om);function rS(c){return jm(c)?im(po(c)):Sk(c)}function Y6(c){return function(h){return c==null?n:Ns(c,h)}}var K6=a_(),X6=a_(!0);function rv(){return[]}function ov(){return!1}function Q6(){return{}}function Z6(){return""}function J6(){return!0}function eL(c,h){if(c=Ze(c),c<1||c>Q)return[];var v=B,S=$n(c,B);h=Le(h),c-=B;for(var P=lm(S,h);++v<c;)h(v);return P}function tL(c){return Ye(c)?Ht(c,po):ar(c)?[c]:Wn(S_(wt(c)))}function nL(c){var h=++hI;return wt(c)+h}var rL=Ef(function(c,h){return c+h},0),oL=Im("ceil"),iL=Ef(function(c,h){return c/h},1),sL=Im("floor");function aL(c){return c&&c.length?bf(c,Gn,ym):n}function lL(c,h){return c&&c.length?bf(c,Le(h,2),ym):n}function cL(c){return c1(c,Gn)}function uL(c,h){return c1(c,Le(h,2))}function dL(c){return c&&c.length?bf(c,Gn,Sm):n}function fL(c,h){return c&&c.length?bf(c,Le(h,2),Sm):n}var hL=Ef(function(c,h){return c*h},1),pL=Im("round"),gL=Ef(function(c,h){return c-h},0);function mL(c){return c&&c.length?am(c,Gn):0}function vL(c,h){return c&&c.length?am(c,Le(h,2)):0}return M.after=z3,M.ary=I_,M.assign=RN,M.assignIn=Y_,M.assignInWith=Ff,M.assignWith=$N,M.at=PN,M.before=k_,M.bind=qm,M.bindAll=A6,M.bindKey=N_,M.castArray=Q3,M.chain=D_,M.chunk=s7,M.compact=a7,M.concat=l7,M.cond=I6,M.conforms=k6,M.constant=Jm,M.countBy=m3,M.create=ON,M.curry=L_,M.curryRight=F_,M.debounce=z_,M.defaults=MN,M.defaultsDeep=DN,M.defer=j3,M.delay=V3,M.difference=c7,M.differenceBy=u7,M.differenceWith=d7,M.drop=f7,M.dropRight=h7,M.dropRightWhile=p7,M.dropWhile=g7,M.fill=m7,M.filter=b3,M.flatMap=w3,M.flatMapDeep=_3,M.flatMapDepth=S3,M.flatten=$_,M.flattenDeep=v7,M.flattenDepth=b7,M.flip=B3,M.flow=L6,M.flowRight=F6,M.fromPairs=y7,M.functions=FN,M.functionsIn=zN,M.groupBy=C3,M.initial=w7,M.intersection=_7,M.intersectionBy=S7,M.intersectionWith=C7,M.invert=VN,M.invertBy=BN,M.invokeMap=R3,M.iteratee=ev,M.keyBy=$3,M.keys=hn,M.keysIn=qn,M.map=Tf,M.mapKeys=WN,M.mapValues=UN,M.matches=z6,M.matchesProperty=j6,M.memoize=If,M.merge=qN,M.mergeWith=K_,M.method=V6,M.methodOf=B6,M.mixin=tv,M.negate=kf,M.nthArg=W6,M.omit=GN,M.omitBy=YN,M.once=H3,M.orderBy=P3,M.over=U6,M.overArgs=W3,M.overEvery=q6,M.overSome=G6,M.partial=Gm,M.partialRight=j_,M.partition=O3,M.pick=KN,M.pickBy=X_,M.property=rS,M.propertyOf=Y6,M.pull=P7,M.pullAll=O_,M.pullAllBy=O7,M.pullAllWith=M7,M.pullAt=D7,M.range=K6,M.rangeRight=X6,M.rearg=U3,M.reject=T3,M.remove=T7,M.rest=q3,M.reverse=Wm,M.sampleSize=I3,M.set=QN,M.setWith=ZN,M.shuffle=k3,M.slice=A7,M.sortBy=F3,M.sortedUniq=j7,M.sortedUniqBy=V7,M.split=w6,M.spread=G3,M.tail=B7,M.take=H7,M.takeRight=W7,M.takeRightWhile=U7,M.takeWhile=q7,M.tap=a3,M.throttle=Y3,M.thru=Df,M.toArray=U_,M.toPairs=Q_,M.toPairsIn=Z_,M.toPath=tL,M.toPlainObject=G_,M.transform=JN,M.unary=K3,M.union=G7,M.unionBy=Y7,M.unionWith=K7,M.uniq=X7,M.uniqBy=Q7,M.uniqWith=Z7,M.unset=e6,M.unzip=Um,M.unzipWith=M_,M.update=t6,M.updateWith=n6,M.values=rl,M.valuesIn=r6,M.without=J7,M.words=tS,M.wrap=X3,M.xor=e3,M.xorBy=t3,M.xorWith=n3,M.zip=r3,M.zipObject=o3,M.zipObjectDeep=i3,M.zipWith=s3,M.entries=Q_,M.entriesIn=Z_,M.extend=Y_,M.extendWith=Ff,tv(M,M),M.add=rL,M.attempt=nS,M.camelCase=a6,M.capitalize=J_,M.ceil=oL,M.clamp=o6,M.clone=Z3,M.cloneDeep=eN,M.cloneDeepWith=tN,M.cloneWith=J3,M.conformsTo=nN,M.deburr=eS,M.defaultTo=N6,M.divide=iL,M.endsWith=l6,M.eq=Qr,M.escape=c6,M.escapeRegExp=u6,M.every=v3,M.find=y3,M.findIndex=E_,M.findKey=TN,M.findLast=x3,M.findLastIndex=R_,M.findLastKey=AN,M.floor=sL,M.forEach=T_,M.forEachRight=A_,M.forIn=IN,M.forInRight=kN,M.forOwn=NN,M.forOwnRight=LN,M.get=Xm,M.gt=rN,M.gte=oN,M.has=jN,M.hasIn=Qm,M.head=P_,M.identity=Gn,M.includes=E3,M.indexOf=x7,M.inRange=i6,M.invoke=HN,M.isArguments=zs,M.isArray=Ye,M.isArrayBuffer=iN,M.isArrayLike=Un,M.isArrayLikeObject=Zt,M.isBoolean=sN,M.isBuffer=Di,M.isDate=aN,M.isElement=lN,M.isEmpty=cN,M.isEqual=uN,M.isEqualWith=dN,M.isError=Ym,M.isFinite=fN,M.isFunction=Ko,M.isInteger=V_,M.isLength=Nf,M.isMap=B_,M.isMatch=hN,M.isMatchWith=pN,M.isNaN=gN,M.isNative=mN,M.isNil=bN,M.isNull=vN,M.isNumber=H_,M.isObject=Ut,M.isObjectLike=Yt,M.isPlainObject=Uc,M.isRegExp=Km,M.isSafeInteger=yN,M.isSet=W_,M.isString=Lf,M.isSymbol=ar,M.isTypedArray=nl,M.isUndefined=xN,M.isWeakMap=wN,M.isWeakSet=_N,M.join=E7,M.kebabCase=d6,M.last=Ir,M.lastIndexOf=R7,M.lowerCase=f6,M.lowerFirst=h6,M.lt=SN,M.lte=CN,M.max=aL,M.maxBy=lL,M.mean=cL,M.meanBy=uL,M.min=dL,M.minBy=fL,M.stubArray=rv,M.stubFalse=ov,M.stubObject=Q6,M.stubString=Z6,M.stubTrue=J6,M.multiply=hL,M.nth=$7,M.noConflict=H6,M.noop=nv,M.now=Af,M.pad=p6,M.padEnd=g6,M.padStart=m6,M.parseInt=v6,M.random=s6,M.reduce=M3,M.reduceRight=D3,M.repeat=b6,M.replace=y6,M.result=XN,M.round=pL,M.runInContext=q,M.sample=A3,M.size=N3,M.snakeCase=x6,M.some=L3,M.sortedIndex=I7,M.sortedIndexBy=k7,M.sortedIndexOf=N7,M.sortedLastIndex=L7,M.sortedLastIndexBy=F7,M.sortedLastIndexOf=z7,M.startCase=_6,M.startsWith=S6,M.subtract=gL,M.sum=mL,M.sumBy=vL,M.template=C6,M.times=eL,M.toFinite=Xo,M.toInteger=Ze,M.toLength=q_,M.toLower=E6,M.toNumber=kr,M.toSafeInteger=EN,M.toString=wt,M.toUpper=R6,M.trim=$6,M.trimEnd=P6,M.trimStart=O6,M.truncate=M6,M.unescape=D6,M.uniqueId=nL,M.upperCase=T6,M.upperFirst=Zm,M.each=T_,M.eachRight=A_,M.first=P_,tv(M,function(){var c={};return fo(M,function(h,v){Et.call(M.prototype,v)||(c[v]=h)}),c}(),{chain:!1}),M.VERSION=r,Or(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){M[c].placeholder=M}),Or(["drop","take"],function(c,h){dt.prototype[c]=function(v){v=v===n?1:sn(Ze(v),0);var S=this.__filtered__&&!h?new dt(this):this.clone();return S.__filtered__?S.__takeCount__=$n(v,S.__takeCount__):S.__views__.push({size:$n(v,B),type:c+(S.__dir__<0?"Right":"")}),S},dt.prototype[c+"Right"]=function(v){return this.reverse()[c](v).reverse()}}),Or(["filter","map","takeWhile"],function(c,h){var v=h+1,S=v==ee||v==Z;dt.prototype[c]=function(P){var A=this.clone();return A.__iteratees__.push({iteratee:Le(P,3),type:v}),A.__filtered__=A.__filtered__||S,A}}),Or(["head","last"],function(c,h){var v="take"+(h?"Right":"");dt.prototype[c]=function(){return this[v](1).value()[0]}}),Or(["initial","tail"],function(c,h){var v="drop"+(h?"":"Right");dt.prototype[c]=function(){return this.__filtered__?new dt(this):this[v](1)}}),dt.prototype.compact=function(){return this.filter(Gn)},dt.prototype.find=function(c){return this.filter(c).head()},dt.prototype.findLast=function(c){return this.reverse().find(c)},dt.prototype.invokeMap=ot(function(c,h){return typeof c=="function"?new dt(this):this.map(function(v){return zc(v,c,h)})}),dt.prototype.reject=function(c){return this.filter(kf(Le(c)))},dt.prototype.slice=function(c,h){c=Ze(c);var v=this;return v.__filtered__&&(c>0||h<0)?new dt(v):(c<0?v=v.takeRight(-c):c&&(v=v.drop(c)),h!==n&&(h=Ze(h),v=h<0?v.dropRight(-h):v.take(h-c)),v)},dt.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},dt.prototype.toArray=function(){return this.take(B)},fo(dt.prototype,function(c,h){var v=/^(?:filter|find|map|reject)|While$/.test(h),S=/^(?:head|last)$/.test(h),P=M[S?"take"+(h=="last"?"Right":""):h],A=S||/^find/.test(h);P&&(M.prototype[h]=function(){var L=this.__wrapped__,z=S?[1]:arguments,K=L instanceof dt,he=z[0],pe=K||Ye(L),ye=function(ct){var pt=P.apply(M,Ci([ct],z));return S&&$e?pt[0]:pt};pe&&v&&typeof he=="function"&&he.length!=1&&(K=pe=!1);var $e=this.__chain__,Ae=!!this.__actions__.length,Fe=A&&!$e,tt=K&&!Ae;if(!A&&pe){L=tt?L:new dt(this);var ze=c.apply(L,z);return ze.__actions__.push({func:Df,args:[ye],thisArg:n}),new Dr(ze,$e)}return Fe&&tt?c.apply(this,z):(ze=this.thru(ye),Fe?S?ze.value()[0]:ze.value():ze)})}),Or(["pop","push","shift","sort","splice","unshift"],function(c){var h=nf[c],v=/^(?:push|sort|unshift)$/.test(c)?"tap":"thru",S=/^(?:pop|shift)$/.test(c);M.prototype[c]=function(){var P=arguments;if(S&&!this.__chain__){var A=this.value();return h.apply(Ye(A)?A:[],P)}return this[v](function(L){return h.apply(Ye(L)?L:[],P)})}}),fo(dt.prototype,function(c,h){var v=M[h];if(v){var S=v.name+"";Et.call(Qa,S)||(Qa[S]=[]),Qa[S].push({name:h,func:v})}}),Qa[Cf(n,_).name]=[{name:"wrapper",func:n}],dt.prototype.clone=DI,dt.prototype.reverse=TI,dt.prototype.value=AI,M.prototype.at=l3,M.prototype.chain=c3,M.prototype.commit=u3,M.prototype.next=d3,M.prototype.plant=h3,M.prototype.reverse=p3,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=g3,M.prototype.first=M.prototype.head,Tc&&(M.prototype[Tc]=f3),M},Ya=uI();Ds?((Ds.exports=Ya)._=Ya,em._=Ya):bn._=Ya}).call(Qs)})(lp,lp.exports);var xl=lp.exports;const Sa=Od(xl),VS=["lg","md","sm","xs","xxs"],Ee=h$()(x$((e,t)=>({currentBreakpoint:"lg",dashboard:{id:"",style:kb},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{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&&xl.forEach(i.frames,l=>{var d;const u=(d=l.cards)==null?void 0:d.find(f=>f.id===n);u&&(u.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(u=>u.id===n);s&&xl.forEach(s.frames,u=>{var f;const d=(f=u.cards)==null?void 0:f.find(p=>p.id===r);d&&(d.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&&xl.forEach(i.frames,l=>{var d;const u=(d=l.cards)==null?void 0:d.find(f=>f.id===n);u&&(u.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(u=>u.id===n);s&&xl.forEach(s.frames,u=>{var f;const d=(f=u.cards)==null?void 0:f.find(p=>p.id===r);d&&(d.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,u,d;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n);if(s){const f=(u=s.cards)==null?void 0:u.find(p=>p.id===r);f&&(f.sql=o,(d=i.onUpdateCard)==null||d.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(u=>u.id===n);s&&xl.forEach(s.frames,u=>{var f;const d=(f=u.cards)==null?void 0:f.find(p=>p.id===r);d&&(d.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(u=>u.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 o;r.dashboard.filters?(o=r.dashboard.filters)==null||o.push(n):r.dashboard.filters=[n]})},removeFilter: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);console.log("index",s),s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1))}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,u,d,f,p;const s=(u=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:u.find(g=>g.id===n);if(!s)return;const a=(d=s==null?void 0:s.frames)==null?void 0:d.find(g=>g.id===r);if(a){const g=(f=a.cards)==null?void 0:f.findIndex(b=>b.id===o.id);g>-1&&((p=a.cards)==null||p.splice(g,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,u,d;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(f=>f.id===n);if(i){i.frames||(i.frames=[]),(l=i.frames)==null||l.push(r);const f={i:r.id,x:0,y:1/0,w:20,h:7,minW:6,minH:2};(u=i.layout)==null||u.push(f),i!=null&&i.layouts||(i.layouts={}),VS.forEach(p=>{i.layouts[p]||(i.layouts[p]=[]),i.layouts[p].push(f)}),(d=o.onAddFrame)==null||d.call(o,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,u,d;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(p=>p.id===r);console.log(f),typeof f=="number"&&f>-1&&((u=i.frames)==null||u.splice(f,1),(d=i.layout)==null||d.splice(f,1),i.layouts=VS.reduce((p,g)=>{if(p&&p[g]){const b=p[g].findIndex(y=>y.i===r);typeof b=="number"&&b>-1&&p[g].splice(b,1)}return p},i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(u=i==null?void 0:i.frames)==null?void 0:u.findIndex(f=>f.id===r.id);i&&((d=i.frames)==null||d.splice(s,1,r))})},updateCard:(n,r)=>{e(o=>{var a,l,u,d,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(u=i==null?void 0:i.cards)==null?void 0:u.findIndex(p=>p.id===r.id);i&&((d=i.cards)==null||d.splice(s,1,r),(f=o.onUpdateCard)==null||f.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,u,d,f,p;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(g=>g.id===n),s=(u=i==null?void 0:i.cards)==null?void 0:u.findIndex(g=>g.id===r.id);i&&((d=i.cards)==null||d.splice(s,1),(f=i.layout)==null||f.splice(s,1),(p=o.onRemoveCard)==null||p.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(u=>u.id===n);i&&(((l=i.cards)==null?void 0:l.find(d=>d.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 u=(i=a[l].cards)==null?void 0:i.find(d=>d.id===n);if(u)return u}}},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)=>{m8({card:n,dataPoint:r,set:e,get:t})}}}))),Ta=()=>Ee(e=>e.actions),v8={theme:"system",setTheme:()=>null},vP=m.createContext(v8);function b8({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 k.jsx(vP.Provider,{...r,value:s,children:e})}const bP=()=>{const e=m.useContext(vP);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function y8(e,t,n){return await(await fetch(`https://semaphor.cloud/api/v1/dashboard?id=${e}&version=${t}`,{headers:{Authorization:`Bearer ${n}`}})).json()}function yP(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function BS(e,t){const n=yP(e);return n==="dark"?Sa.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function x8({id:e,version:t,authToken:n,customStyle:r,currentTheme:o,onSave:i,onEvent:s}){const{data:a,refetch:l,isLoading:u,isError:d}=So({queryKey:[e],queryFn:()=>y8(e,t||"",n==null?void 0:n.accessToken),enabled:!1}),{theme:f,setTheme:p}=bP(),{setDashboard:g,setSelectedSheetId:b,setStyle:y,setOnSaveFunction:x}=Ee(O=>O.actions);Ee(O=>O.actions.setCustomCards);const _=Ee(O=>O.actions.setFilterValues),w=Ee(O=>O.actions.setBookmarkKey),C=Ee(O=>O.actions.setAuthToken),R=Ee(O=>O.actions.setThemeStyle),E=Ee(O=>O.actions.setDashboardTheme),T=Ee(O=>O.actions.setOnEvent);return m.useEffect(()=>{if(f){const O=yP(f);E(O)}},[f,E]),m.useEffect(()=>{o&&p(o)},[o,p]),m.useEffect(()=>{const O=Sa.cloneDeep(kb);if(r){const D=Sa.merge(O,r),I=BS(f,D);R(I),y(D)}else{const D=BS(f,O);R(D),y(kb)}},[f,r,y,R]),m.useEffect(()=>{var V;if(!a||!a.dashboard)return;const O=a.dashboard,D=CT(O.id),I=JSON.parse(localStorage.getItem(D)||"[]"),N=I.find(G=>G.default===!0);if(N)g(N.template),w(N.name),N.filterValues&&_(N.filterValues);else{g(O);const G=I.find(le=>(le==null?void 0:le.name)==="Original");G?G.template=O:I.push({name:"Original",template:O,default:!1}),localStorage.setItem(D,JSON.stringify(I))}b((V=O.sheets)==null?void 0:V[0].id)},[a,g,b,_,w]),m.useEffect(()=>{i&&x(i),s&&T(s)},[i,x,s,T]),m.useEffect(()=>{n&&n.accessToken&&(C(n),l())},[n,l,C]),{isLoading:u,isError:d}}function _y({className:e,...t}){return k.jsx("div",{className:Se("animate-pulse rounded-md bg-muted",e),...t})}function xP({className:e,style:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:u,version:d,customCards:f,...p}){Ee(_=>_.selectedSheetId);const g=Ee(_=>_.themeStyle),b=Ee(_=>_.onEvent),{isLoading:y,isError:x}=x8({id:a,version:d,authToken:l,customStyle:t,currentTheme:u,onSave:n,onEvent:r});return y||!l?(b==null||b({type:"info",message:`isLoading: ${y}, accessToken: ${l==null?void 0:l.accessToken}`}),o?k.jsx(o,{message:"loading"}):k.jsx("div",{className:"flex items-center gap-3",children:k.jsx(_y,{className:"h-1 w-full dark:h-[2px]"})})):x?(b==null||b({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),k.jsx(i,{})):k.jsx("div",{children:"Error"})):k.jsx("div",{className:Se("flex h-full grow flex-col justify-between",g==null?void 0:g.dashboardPanel,e),role:"dashboard-panel",...p})}function ne(){return ne=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},ne.apply(this,arguments)}function we(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 mn(e,t=[]){let n=[];function r(i,s){const a=m.createContext(s),l=n.length;n=[...n,s];function u(f){const{scope:p,children:g,...b}=f,y=(p==null?void 0:p[e][l])||a,x=m.useMemo(()=>b,Object.values(b));return m.createElement(y.Provider,{value:x},g)}function d(f,p){const g=(p==null?void 0:p[e][l])||a,b=m.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${f}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}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,w8(o,...t)]}function w8(...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:u})=>{const f=l(i)[`__scope${u}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function _8(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Xp(...e){return t=>e.forEach(n=>_8(n,t))}function Xe(...e){return m.useCallback(Xp(...e),e)}const pi=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(S8);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(s0,ne({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(s0,ne({},r,{ref:t}),n)});pi.displayName="Slot";const s0=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...C8(r,n.props),ref:t?Xp(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});s0.displayName="SlotClone";const wP=({children:e})=>m.createElement(m.Fragment,null,e);function S8(e){return m.isValidElement(e)&&e.type===wP}function C8(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 Qp(e){const t=e+"CollectionProvider",[n,r]=mn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:b,children:y}=g,x=m.useRef(null),_=m.useRef(new Map).current;return m.createElement(o,{scope:b,itemMap:_,collectionRef:x},y)},a=e+"CollectionSlot",l=m.forwardRef((g,b)=>{const{scope:y,children:x}=g,_=i(a,y),w=Xe(b,_.collectionRef);return m.createElement(pi,{ref:w},x)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",f=m.forwardRef((g,b)=>{const{scope:y,children:x,..._}=g,w=m.useRef(null),C=Xe(b,w),R=i(u,y);return m.useEffect(()=>(R.itemMap.set(w,{ref:w,..._}),()=>void R.itemMap.delete(w))),m.createElement(pi,{[d]:"",ref:C},x)});function p(g){const b=i(e+"CollectionConsumer",g);return m.useCallback(()=>{const x=b.collectionRef.current;if(!x)return[];const _=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((R,E)=>_.indexOf(R.ref.current)-_.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:l,ItemSlot:f},p,r]}const kn=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},E8=ie.useId||(()=>{});let R8=0;function nr(e){const[t,n]=ie.useState(E8());return kn(()=>{e||n(r=>r??String(R8++))},[e]),e||(t?`radix-${t}`:"")}const $8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ke=$8.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?pi:t;return m.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),m.createElement(a,ne({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function _P(e,t){e&&Ao.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 Nn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=P8({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=cn(n),l=m.useCallback(u=>{if(i){const f=typeof u=="function"?u(e):u;f!==e&&a(f)}else o(u)},[i,e,o,a]);return[s,l]}function P8({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 O8=m.createContext(void 0);function Aa(e){const t=m.useContext(O8);return e||t||"ltr"}const bv="rovingFocusGroup.onEntryFocus",M8={bubbles:!1,cancelable:!0},Sy="RovingFocusGroup",[a0,SP,D8]=Qp(Sy),[T8,bc]=mn(Sy,[D8]),[A8,I8]=T8(Sy),k8=m.forwardRef((e,t)=>m.createElement(a0.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(a0.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(N8,ne({},e,{ref:t}))))),N8=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,f=m.useRef(null),p=Xe(t,f),g=Aa(i),[b=null,y]=Nn({prop:s,defaultProp:a,onChange:l}),[x,_]=m.useState(!1),w=cn(u),C=SP(n),R=m.useRef(!1),[E,T]=m.useState(0);return m.useEffect(()=>{const O=f.current;if(O)return O.addEventListener(bv,w),()=>O.removeEventListener(bv,w)},[w]),m.createElement(A8,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:b,onItemFocus:m.useCallback(O=>y(O),[y]),onItemShiftTab:m.useCallback(()=>_(!0),[]),onFocusableItemAdd:m.useCallback(()=>T(O=>O+1),[]),onFocusableItemRemove:m.useCallback(()=>T(O=>O-1),[])},m.createElement(ke.div,ne({tabIndex:x||E===0?-1:0,"data-orientation":r},d,{ref:p,style:{outline:"none",...e.style},onMouseDown:we(e.onMouseDown,()=>{R.current=!0}),onFocus:we(e.onFocus,O=>{const D=!R.current;if(O.target===O.currentTarget&&D&&!x){const I=new CustomEvent(bv,M8);if(O.currentTarget.dispatchEvent(I),!I.defaultPrevented){const N=C().filter(F=>F.focusable),V=N.find(F=>F.active),G=N.find(F=>F.id===b),ee=[V,G,...N].filter(Boolean).map(F=>F.ref.current);CP(ee)}}R.current=!1}),onBlur:we(e.onBlur,()=>_(!1))})))}),L8="RovingFocusGroupItem",F8=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=nr(),l=i||a,u=I8(L8,n),d=u.currentTabStopId===l,f=SP(n),{onFocusableItemAdd:p,onFocusableItemRemove:g}=u;return m.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),m.createElement(a0.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(ke.span,ne({tabIndex:d?0:-1,"data-orientation":u.orientation},s,{ref:t,onMouseDown:we(e.onMouseDown,b=>{r?u.onItemFocus(l):b.preventDefault()}),onFocus:we(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:we(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){u.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const y=V8(b,u.orientation,u.dir);if(y!==void 0){b.preventDefault();let _=f().filter(w=>w.focusable).map(w=>w.ref.current);if(y==="last")_.reverse();else if(y==="prev"||y==="next"){y==="prev"&&_.reverse();const w=_.indexOf(b.currentTarget);_=u.loop?B8(_,w+1):_.slice(w+1)}setTimeout(()=>CP(_))}})})))}),z8={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function j8(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function V8(e,t,n){const r=j8(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return z8[r]}function CP(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function B8(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Cy=k8,Ey=F8;function H8(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const nn=e=>{const{present:t,children:n}=e,r=W8(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=Xe(r.ref,o.ref);return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:i}):null};nn.displayName="Presence";function W8(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=H8(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=Gf(r.current);i.current=a==="mounted"?u:"none"},[a]),kn(()=>{const u=r.current,d=o.current;if(d!==e){const p=i.current,g=Gf(u);e?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),kn(()=>{if(t){const u=f=>{const g=Gf(r.current).includes(f.animationName);f.target===t&&g&&Ao.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(i.current=Gf(r.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:m.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Gf(e){return(e==null?void 0:e.animationName)||"none"}const EP="Tabs",[U8,cle]=mn(EP,[bc]),RP=bc(),[q8,Ry]=U8(EP),G8=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...u}=e,d=Aa(a),[f,p]=Nn({prop:r,onChange:o,defaultProp:i});return m.createElement(q8,{scope:n,baseId:nr(),value:f,onValueChange:p,orientation:s,dir:d,activationMode:l},m.createElement(ke.div,ne({dir:d,"data-orientation":s},u,{ref:t})))}),Y8="TabsList",K8=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=Ry(Y8,n),s=RP(n);return m.createElement(Cy,ne({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(ke.div,ne({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),X8="TabsTrigger",Q8=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=Ry(X8,n),a=RP(n),l=$P(s.baseId,r),u=PP(s.baseId,r),d=r===s.value;return m.createElement(Ey,ne({asChild:!0},a,{focusable:!o,active:d}),m.createElement(ke.button,ne({type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:we(e.onMouseDown,f=>{!o&&f.button===0&&f.ctrlKey===!1?s.onValueChange(r):f.preventDefault()}),onKeyDown:we(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&s.onValueChange(r)}),onFocus:we(e.onFocus,()=>{const f=s.activationMode!=="manual";!d&&!o&&f&&s.onValueChange(r)})})))}),Z8="TabsContent",J8=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=Ry(Z8,n),l=$P(a.baseId,r),u=PP(a.baseId,r),d=r===a.value,f=m.useRef(d);return m.useEffect(()=>{const p=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(p)},[]),m.createElement(nn,{present:o||d},({present:p})=>m.createElement(ke.div,ne({"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:u,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0}}),p&&i))});function $P(e,t){return`${e}-trigger-${t}`}function PP(e,t){return`${e}-content-${t}`}const ez=G8,OP=K8,MP=Q8,DP=J8,TP=ez,AP=ie.forwardRef(({className:e,...t},n)=>k.jsx(OP,{ref:n,className:Se("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));AP.displayName=OP.displayName;const IP=ie.forwardRef(({className:e,...t},n)=>k.jsx(MP,{ref:n,className:Se("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}));IP.displayName=MP.displayName;const $y=ie.forwardRef(({className:e,...t},n)=>k.jsx(DP,{ref:n,className:Se("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));$y.displayName=DP.displayName;var kP={exports:{}},Dd={},l0={exports:{}};(function(e,t){(function(n,r){r(t)})(Qs,function(n){function r(J){return function(re,be,H,De,Ne,Ve,qe){return J(re,be,qe)}}function o(J){return function(re,be,H,De){if(!re||!be||typeof re!="object"||typeof be!="object")return J(re,be,H,De);var Ne=De.get(re),Ve=De.get(be);if(Ne&&Ve)return Ne===be&&Ve===re;De.set(re,be),De.set(be,re);var qe=J(re,be,H,De);return De.delete(re),De.delete(be),qe}}function i(J,X){var re={};for(var be in J)re[be]=J[be];for(var be in X)re[be]=X[be];return re}function s(J){return J.constructor===Object||J.constructor==null}function a(J){return typeof J.then=="function"}function l(J,X){return J===X||J!==J&&X!==X}var u="[object Arguments]",d="[object Boolean]",f="[object Date]",p="[object RegExp]",g="[object Map]",b="[object Number]",y="[object Object]",x="[object Set]",_="[object String]",w=Object.prototype.toString;function C(J){var X=J.areArraysEqual,re=J.areDatesEqual,be=J.areMapsEqual,H=J.areObjectsEqual,De=J.areRegExpsEqual,Ne=J.areSetsEqual,Ve=J.createIsNestedEqual,qe=Ve(gt);function gt(ft,ht,Gt){if(ft===ht)return!0;if(!ft||!ht||typeof ft!="object"||typeof ht!="object")return ft!==ft&&ht!==ht;if(s(ft)&&s(ht))return H(ft,ht,qe,Gt);var Wt=Array.isArray(ft),En=Array.isArray(ht);if(Wt||En)return Wt===En&&X(ft,ht,qe,Gt);var rn=w.call(ft);return rn!==w.call(ht)?!1:rn===f?re(ft,ht,qe,Gt):rn===p?De(ft,ht,qe,Gt):rn===g?be(ft,ht,qe,Gt):rn===x?Ne(ft,ht,qe,Gt):rn===y||rn===u?a(ft)||a(ht)?!1:H(ft,ht,qe,Gt):rn===d||rn===b||rn===_?l(ft.valueOf(),ht.valueOf()):!1}return gt}function R(J,X,re,be){var H=J.length;if(X.length!==H)return!1;for(;H-- >0;)if(!re(J[H],X[H],H,H,J,X,be))return!1;return!0}var E=o(R);function T(J,X){return l(J.valueOf(),X.valueOf())}function O(J,X,re,be){var H=J.size===X.size;if(!H)return!1;if(!J.size)return!0;var De={},Ne=0;return J.forEach(function(Ve,qe){if(H){var gt=!1,ft=0;X.forEach(function(ht,Gt){!gt&&!De[ft]&&(gt=re(qe,Gt,Ne,ft,J,X,be)&&re(Ve,ht,qe,Gt,J,X,be))&&(De[ft]=!0),ft++}),Ne++,H=gt}}),H}var D=o(O),I="_owner",N=Object.prototype.hasOwnProperty;function V(J,X,re,be){var H=Object.keys(J),De=H.length;if(Object.keys(X).length!==De)return!1;for(var Ne;De-- >0;){if(Ne=H[De],Ne===I){var Ve=!!J.$$typeof,qe=!!X.$$typeof;if((Ve||qe)&&Ve!==qe)return!1}if(!N.call(X,Ne)||!re(J[Ne],X[Ne],Ne,Ne,J,X,be))return!1}return!0}var G=o(V);function le(J,X){return J.source===X.source&&J.flags===X.flags}function ee(J,X,re,be){var H=J.size===X.size;if(!H)return!1;if(!J.size)return!0;var De={};return J.forEach(function(Ne,Ve){if(H){var qe=!1,gt=0;X.forEach(function(ft,ht){!qe&&!De[gt]&&(qe=re(Ne,ft,Ve,ht,J,X,be))&&(De[gt]=!0),gt++}),H=qe}}),H}var F=o(ee),Z=Object.freeze({areArraysEqual:R,areDatesEqual:T,areMapsEqual:O,areObjectsEqual:V,areRegExpsEqual:le,areSetsEqual:ee,createIsNestedEqual:r}),Y=Object.freeze({areArraysEqual:E,areDatesEqual:T,areMapsEqual:D,areObjectsEqual:G,areRegExpsEqual:le,areSetsEqual:F,createIsNestedEqual:r}),Q=C(Z);function ae(J,X){return Q(J,X,void 0)}var j=C(i(Z,{createIsNestedEqual:function(){return l}}));function B(J,X){return j(J,X,void 0)}var te=C(Y);function ce(J,X){return te(J,X,new WeakMap)}var ue=C(i(Y,{createIsNestedEqual:function(){return l}}));function ge(J,X){return ue(J,X,new WeakMap)}function ve(J){return C(i(Z,J(Z)))}function de(J){var X=C(i(Y,J(Y)));return function(re,be,H){return H===void 0&&(H=new WeakMap),X(re,be,H)}}n.circularDeepEqual=ce,n.circularShallowEqual=ge,n.createCustomCircularEqual=de,n.createCustomEqual=ve,n.deepEqual=ae,n.sameValueZeroEqual=l,n.shallowEqual=B,Object.defineProperty(n,"__esModule",{value:!0})})})(l0,l0.exports);var Py=l0.exports;const Oy=dy(SL);var lt={},tz=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(lt,"__esModule",{value:!0});lt.bottom=My;lt.childrenEqual=iz;lt.cloneLayout=NP;lt.cloneLayoutItem=pa;lt.collides=Zp;lt.compact=FP;lt.compactItem=zP;lt.compactType=yz;lt.correctBounds=jP;lt.fastPositionEqual=az;lt.fastRGLPropsEqual=void 0;lt.getAllCollisions=VP;lt.getFirstCollision=ta;lt.getLayoutItem=Dy;lt.getStatics=Ty;lt.modifyLayout=LP;lt.moveElement=pu;lt.moveElementAwayFromCollision=u0;lt.noop=void 0;lt.perc=cz;lt.resizeItemInDirection=gz;lt.setTopLeft=vz;lt.setTransform=mz;lt.sortLayoutItems=Fy;lt.sortLayoutItemsByColRow=qP;lt.sortLayoutItemsByRowCol=UP;lt.synchronizeLayoutWithChildren=bz;lt.validateLayout=GP;lt.withLayoutItem=oz;var HS=Py,hu=nz(m);function nz(e){return e&&e.__esModule?e:{default:e}}const rz=process.env.NODE_ENV==="production";function My(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 NP(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=pa(e[n]);return t}function LP(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 oz(e,t,n){let r=Dy(e,t);return r?(r=n(pa(r)),e=LP(e,r),[e,r]):[e,null]}function pa(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 iz(e,t){return(0,HS.deepEqual)(hu.default.Children.map(e,n=>n==null?void 0:n.key),hu.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,HS.deepEqual)(hu.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),hu.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const sz=tz;lt.fastRGLPropsEqual=sz;function az(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Zp(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 FP(e,t,n,r){const o=Ty(e),i=Fy(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let u=pa(i[a]);u.static||(u=zP(o,u,t,n,i,r),o.push(u)),s[e.indexOf(i[a])]=u,u.moved=!1}return s}const lz={x:"w",y:"h"};function c0(e,t,n,r){const o=lz[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;Zp(t,a)&&c0(e,a,n+t[o],r)}}t[r]=n}function zP(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(My(e),t.y);t.y>0&&!ta(e,t);)t.y--;else if(a)for(;t.x>0&&!ta(e,t);)t.x--;let l;for(;(l=ta(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&&!ta(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function jP(e,t){const n=Ty(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(;ta(n,i);)i.y++}return e}function Dy(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function ta(e,t){for(let n=0,r=e.length;n<r;n++)if(Zp(e[n],t))return e[n]}function VP(e,t){return e.filter(n=>Zp(n,t))}function Ty(e){return e.filter(t=>t.static)}function pu(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 u=t.x,d=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let f=Fy(e,s);(s==="vertical"&&typeof r=="number"?d>=r:s==="horizontal"&&typeof n=="number"?u>=n:!1)&&(f=f.reverse());const g=VP(f,t),b=g.length>0;if(b&&l)return NP(e);if(b&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=u,t.y=d,t.moved=!1,e;for(let y=0,x=g.length;y<x;y++){const _=g[y];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(_.i," at [").concat(_.x,",").concat(_.y,"]"),!_.moved&&(_.static?e=u0(e,_,t,o,s):e=u0(e,t,_,o,s))}return e}function u0(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"},p=ta(e,f),g=p&&p.y+p.h>t.y,b=p&&t.x+t.w>p.x;if(p){if(g&&a)return pu(e,n,void 0,t.y+1,r,l,o);if(g&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(b&&s)return pu(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,"]."),pu(e,n,s?f.x:void 0,a?f.y:void 0,r,l,o)}const u=s?n.x+1:void 0,d=a?n.y+1:void 0;return u==null&&d==null?e:pu(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function cz(e){return e*100+"%"}const BP=(e,t,n,r)=>e+n>r?t:n,HP=(e,t,n)=>e<0?t:n,WP=e=>Math.max(0,e),Ay=e=>Math.max(0,e),Iy=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:HP(s,e.height,o),top:Ay(s)}},ky=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:BP(e.left,e.width,s,n),left:WP(o)}},Ny=(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:BP(e.left,e.width,i,n),top:Ay(r),left:WP(s)}},Ly=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:HP(r,e.height,i),top:Ay(r)}},uz=function(){return Iy(arguments.length<=0?void 0:arguments[0],ky(...arguments))},dz=function(){return Iy(arguments.length<=0?void 0:arguments[0],Ny(...arguments))},fz=function(){return Ly(arguments.length<=0?void 0:arguments[0],ky(...arguments))},hz=function(){return Ly(arguments.length<=0?void 0:arguments[0],Ny(...arguments))},pz={n:Iy,ne:uz,e:ky,se:fz,s:Ly,sw:hz,w:Ny,nw:dz};function gz(e,t,n,r){const o=pz[e];return o?o(t,{...t,...n},r):n}function mz(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 vz(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 Fy(e,t){return t==="horizontal"?qP(e):t==="vertical"?UP(e):e}function UP(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 qP(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 bz(e,t,n,r,o){e=e||[];const i=[];hu.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Dy(e,String(a.key)),u=a.props["data-grid"];l&&u==null?i.push(pa(l)):u?(rz||GP([u],"ReactGridLayout.children"),i.push(pa({...u,i:a.key}))):i.push(pa({w:1,h:1,x:0,y:My(i),i:String(a.key)}))});const s=jP(i,{cols:n});return o?s:FP(s,r,n)}function GP(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 yz(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const xz=()=>{};lt.noop=xz;var Io={};Object.defineProperty(Io,"__esModule",{value:!0});Io.calcGridColWidth=Jp;Io.calcGridItemPosition=wz;Io.calcGridItemWHPx=d0;Io.calcWH=Sz;Io.calcXY=_z;Io.clamp=na;function Jp(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function d0(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function wz(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,u=Jp(e),d={};return i&&i.resizing?(d.width=Math.round(i.resizing.width),d.height=Math.round(i.resizing.height)):(d.width=d0(r,u,s[0]),d.height=d0(o,l,s[1])),i&&i.dragging?(d.top=Math.round(i.dragging.top),d.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(d.top=Math.round(i.resizing.top),d.left=Math.round(i.resizing.left)):(d.top=Math.round((l+s[1])*n+a[1]),d.left=Math.round((u+s[0])*t+a[0])),d}function _z(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,u=Jp(e);let d=Math.round((n-i[0])/(u+i[0])),f=Math.round((t-i[1])/(a+i[1]));return d=na(d,0,s-r),f=na(f,0,l-o),{x:d,y:f}}function Sz(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:u}=e,d=Jp(e);let f=Math.round((t+s[0])/(d+s[0])),p=Math.round((n+s[1])/(u+s[1])),g=na(f,0,l-r),b=na(p,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(g=na(f,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(b=na(p,0,a)),{w:g,h:b}}function na(e,t,n){return Math.max(Math.min(e,n),t)}var eg={},f0={exports:{}},yv,WS;function zy(){if(WS)return yv;WS=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return yv=e,yv}var xv,US;function Cz(){if(US)return xv;US=1;var e=zy();function t(){}function n(){}return n.resetWarningCache=t,xv=function(){function r(s,a,l,u,d,f){if(f!==e){var p=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 p.name="Invariant Violation",p}}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},xv}var Yf={exports:{}},_t={};/** @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 qS;function Ez(){return qS||(qS=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,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,_=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function C(H){return typeof H=="string"||typeof H=="function"||H===r||H===u||H===i||H===o||H===f||H===p||typeof H=="object"&&H!==null&&(H.$$typeof===b||H.$$typeof===g||H.$$typeof===s||H.$$typeof===a||H.$$typeof===d||H.$$typeof===x||H.$$typeof===_||H.$$typeof===w||H.$$typeof===y)}function R(H){if(typeof H=="object"&&H!==null){var De=H.$$typeof;switch(De){case t:var Ne=H.type;switch(Ne){case l:case u:case r:case i:case o:case f:return Ne;default:var Ve=Ne&&Ne.$$typeof;switch(Ve){case a:case d:case b:case g:case s:return Ve;default:return De}}case n:return De}}}var E=l,T=u,O=a,D=s,I=t,N=d,V=r,G=b,le=g,ee=n,F=i,Z=o,Y=f,Q=!1;function ae(H){return Q||(Q=!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.")),j(H)||R(H)===l}function j(H){return R(H)===u}function B(H){return R(H)===a}function te(H){return R(H)===s}function ce(H){return typeof H=="object"&&H!==null&&H.$$typeof===t}function ue(H){return R(H)===d}function ge(H){return R(H)===r}function ve(H){return R(H)===b}function de(H){return R(H)===g}function J(H){return R(H)===n}function X(H){return R(H)===i}function re(H){return R(H)===o}function be(H){return R(H)===f}_t.AsyncMode=E,_t.ConcurrentMode=T,_t.ContextConsumer=O,_t.ContextProvider=D,_t.Element=I,_t.ForwardRef=N,_t.Fragment=V,_t.Lazy=G,_t.Memo=le,_t.Portal=ee,_t.Profiler=F,_t.StrictMode=Z,_t.Suspense=Y,_t.isAsyncMode=ae,_t.isConcurrentMode=j,_t.isContextConsumer=B,_t.isContextProvider=te,_t.isElement=ce,_t.isForwardRef=ue,_t.isFragment=ge,_t.isLazy=ve,_t.isMemo=de,_t.isPortal=J,_t.isProfiler=X,_t.isStrictMode=re,_t.isSuspense=be,_t.isValidElementType=C,_t.typeOf=R}()),_t}var St={};/** @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 GS;function Rz(){if(GS)return St;GS=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,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,b=e?Symbol.for("react.lazy"):60116,y=e?Symbol.for("react.block"):60121,x=e?Symbol.for("react.fundamental"):60117,_=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function C(E){if(typeof E=="object"&&E!==null){var T=E.$$typeof;switch(T){case t:switch(E=E.type,E){case l:case u:case r:case i:case o:case f:return E;default:switch(E=E&&E.$$typeof,E){case a:case d:case b:case g:case s:return E;default:return T}}case n:return T}}}function R(E){return C(E)===u}return St.AsyncMode=l,St.ConcurrentMode=u,St.ContextConsumer=a,St.ContextProvider=s,St.Element=t,St.ForwardRef=d,St.Fragment=r,St.Lazy=b,St.Memo=g,St.Portal=n,St.Profiler=i,St.StrictMode=o,St.Suspense=f,St.isAsyncMode=function(E){return R(E)||C(E)===l},St.isConcurrentMode=R,St.isContextConsumer=function(E){return C(E)===a},St.isContextProvider=function(E){return C(E)===s},St.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===t},St.isForwardRef=function(E){return C(E)===d},St.isFragment=function(E){return C(E)===r},St.isLazy=function(E){return C(E)===b},St.isMemo=function(E){return C(E)===g},St.isPortal=function(E){return C(E)===n},St.isProfiler=function(E){return C(E)===i},St.isStrictMode=function(E){return C(E)===o},St.isSuspense=function(E){return C(E)===f},St.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===r||E===u||E===i||E===o||E===f||E===p||typeof E=="object"&&E!==null&&(E.$$typeof===b||E.$$typeof===g||E.$$typeof===s||E.$$typeof===a||E.$$typeof===d||E.$$typeof===x||E.$$typeof===_||E.$$typeof===w||E.$$typeof===y)},St.typeOf=C,St}var YS;function YP(){return YS||(YS=1,process.env.NODE_ENV==="production"?Yf.exports=Rz():Yf.exports=Ez()),Yf.exports}/*
103
- object-assign
104
- (c) Sindre Sorhus
105
- @license MIT
106
- */var wv,KS;function $z(){if(KS)return wv;KS=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(d){return s[d]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(d){u[d]=d}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return wv=o()?Object.assign:function(i,s){for(var a,l=r(i),u,d=1;d<arguments.length;d++){a=Object(arguments[d]);for(var f in a)t.call(a,f)&&(l[f]=a[f]);if(e){u=e(a);for(var p=0;p<u.length;p++)n.call(a,u[p])&&(l[u[p]]=a[u[p]])}}return l},wv}var _v,XS;function KP(){return XS||(XS=1,_v=Function.call.bind(Object.prototype.hasOwnProperty)),_v}var Sv,QS;function Pz(){if(QS)return Sv;QS=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=zy(),n={},r=KP();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,u){if(process.env.NODE_ENV!=="production"){for(var d in i)if(r(i,d)){var f;try{if(typeof i[d]!="function"){var p=Error((l||"React class")+": "+a+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw p.name="Invariant Violation",p}f=i[d](s,d,l,a,null,t)}catch(b){f=b}if(f&&!(f instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+d+"` 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 g=u?u():"";e("Failed "+a+" type: "+f.message+(g??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Sv=o,Sv}var Cv,ZS;function Oz(){if(ZS)return Cv;ZS=1;var e=YP(),t=$z(),n=zy(),r=KP(),o=Pz(),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 Cv=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function f(j){var B=j&&(u&&j[u]||j[d]);if(typeof B=="function")return B}var p="<<anonymous>>",g={array:_("array"),bigint:_("bigint"),bool:_("boolean"),func:_("function"),number:_("number"),object:_("object"),string:_("string"),symbol:_("symbol"),any:w(),arrayOf:C,element:R(),elementType:E(),instanceOf:T,node:N(),objectOf:D,oneOf:O,oneOfType:I,shape:G,exact:le};function b(j,B){return j===B?j!==0||1/j===1/B:j!==j&&B!==B}function y(j,B){this.message=j,this.data=B&&typeof B=="object"?B:{},this.stack=""}y.prototype=Error.prototype;function x(j){if(process.env.NODE_ENV!=="production")var B={},te=0;function ce(ge,ve,de,J,X,re,be){if(J=J||p,re=re||de,be!==n){if(l){var H=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 H.name="Invariant Violation",H}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var De=J+":"+de;!B[De]&&te<3&&(i("You are manually calling a React.PropTypes validation function for the `"+re+"` prop on `"+J+"`. 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."),B[De]=!0,te++)}}return ve[de]==null?ge?ve[de]===null?new y("The "+X+" `"+re+"` is marked as required "+("in `"+J+"`, but its value is `null`.")):new y("The "+X+" `"+re+"` is marked as required in "+("`"+J+"`, but its value is `undefined`.")):null:j(ve,de,J,X,re)}var ue=ce.bind(null,!1);return ue.isRequired=ce.bind(null,!0),ue}function _(j){function B(te,ce,ue,ge,ve,de){var J=te[ce],X=Z(J);if(X!==j){var re=Y(J);return new y("Invalid "+ge+" `"+ve+"` of type "+("`"+re+"` supplied to `"+ue+"`, expected ")+("`"+j+"`."),{expectedType:j})}return null}return x(B)}function w(){return x(s)}function C(j){function B(te,ce,ue,ge,ve){if(typeof j!="function")return new y("Property `"+ve+"` of component `"+ue+"` has invalid PropType notation inside arrayOf.");var de=te[ce];if(!Array.isArray(de)){var J=Z(de);return new y("Invalid "+ge+" `"+ve+"` of type "+("`"+J+"` supplied to `"+ue+"`, expected an array."))}for(var X=0;X<de.length;X++){var re=j(de,X,ue,ge,ve+"["+X+"]",n);if(re instanceof Error)return re}return null}return x(B)}function R(){function j(B,te,ce,ue,ge){var ve=B[te];if(!a(ve)){var de=Z(ve);return new y("Invalid "+ue+" `"+ge+"` of type "+("`"+de+"` supplied to `"+ce+"`, expected a single ReactElement."))}return null}return x(j)}function E(){function j(B,te,ce,ue,ge){var ve=B[te];if(!e.isValidElementType(ve)){var de=Z(ve);return new y("Invalid "+ue+" `"+ge+"` of type "+("`"+de+"` supplied to `"+ce+"`, expected a single ReactElement type."))}return null}return x(j)}function T(j){function B(te,ce,ue,ge,ve){if(!(te[ce]instanceof j)){var de=j.name||p,J=ae(te[ce]);return new y("Invalid "+ge+" `"+ve+"` of type "+("`"+J+"` supplied to `"+ue+"`, expected ")+("instance of `"+de+"`."))}return null}return x(B)}function O(j){if(!Array.isArray(j))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 B(te,ce,ue,ge,ve){for(var de=te[ce],J=0;J<j.length;J++)if(b(de,j[J]))return null;var X=JSON.stringify(j,function(be,H){var De=Y(H);return De==="symbol"?String(H):H});return new y("Invalid "+ge+" `"+ve+"` of value `"+String(de)+"` "+("supplied to `"+ue+"`, expected one of "+X+"."))}return x(B)}function D(j){function B(te,ce,ue,ge,ve){if(typeof j!="function")return new y("Property `"+ve+"` of component `"+ue+"` has invalid PropType notation inside objectOf.");var de=te[ce],J=Z(de);if(J!=="object")return new y("Invalid "+ge+" `"+ve+"` of type "+("`"+J+"` supplied to `"+ue+"`, expected an object."));for(var X in de)if(r(de,X)){var re=j(de,X,ue,ge,ve+"."+X,n);if(re instanceof Error)return re}return null}return x(B)}function I(j){if(!Array.isArray(j))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var B=0;B<j.length;B++){var te=j[B];if(typeof te!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Q(te)+" at index "+B+"."),s}function ce(ue,ge,ve,de,J){for(var X=[],re=0;re<j.length;re++){var be=j[re],H=be(ue,ge,ve,de,J,n);if(H==null)return null;H.data&&r(H.data,"expectedType")&&X.push(H.data.expectedType)}var De=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new y("Invalid "+de+" `"+J+"` supplied to "+("`"+ve+"`"+De+"."))}return x(ce)}function N(){function j(B,te,ce,ue,ge){return ee(B[te])?null:new y("Invalid "+ue+" `"+ge+"` supplied to "+("`"+ce+"`, expected a ReactNode."))}return x(j)}function V(j,B,te,ce,ue){return new y((j||"React class")+": "+B+" type `"+te+"."+ce+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ue+"`.")}function G(j){function B(te,ce,ue,ge,ve){var de=te[ce],J=Z(de);if(J!=="object")return new y("Invalid "+ge+" `"+ve+"` of type `"+J+"` "+("supplied to `"+ue+"`, expected `object`."));for(var X in j){var re=j[X];if(typeof re!="function")return V(ue,ge,ve,X,Y(re));var be=re(de,X,ue,ge,ve+"."+X,n);if(be)return be}return null}return x(B)}function le(j){function B(te,ce,ue,ge,ve){var de=te[ce],J=Z(de);if(J!=="object")return new y("Invalid "+ge+" `"+ve+"` of type `"+J+"` "+("supplied to `"+ue+"`, expected `object`."));var X=t({},te[ce],j);for(var re in X){var be=j[re];if(r(j,re)&&typeof be!="function")return V(ue,ge,ve,re,Y(be));if(!be)return new y("Invalid "+ge+" `"+ve+"` key `"+re+"` supplied to `"+ue+"`.\nBad object: "+JSON.stringify(te[ce],null," ")+`
107
- Valid keys: `+JSON.stringify(Object.keys(j),null," "));var H=be(de,re,ue,ge,ve+"."+re,n);if(H)return H}return null}return x(B)}function ee(j){switch(typeof j){case"number":case"string":case"undefined":return!0;case"boolean":return!j;case"object":if(Array.isArray(j))return j.every(ee);if(j===null||a(j))return!0;var B=f(j);if(B){var te=B.call(j),ce;if(B!==j.entries){for(;!(ce=te.next()).done;)if(!ee(ce.value))return!1}else for(;!(ce=te.next()).done;){var ue=ce.value;if(ue&&!ee(ue[1]))return!1}}else return!1;return!0;default:return!1}}function F(j,B){return j==="symbol"?!0:B?B["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&B instanceof Symbol:!1}function Z(j){var B=typeof j;return Array.isArray(j)?"array":j instanceof RegExp?"object":F(B,j)?"symbol":B}function Y(j){if(typeof j>"u"||j===null)return""+j;var B=Z(j);if(B==="object"){if(j instanceof Date)return"date";if(j instanceof RegExp)return"regexp"}return B}function Q(j){var B=Y(j);switch(B){case"array":case"object":return"an "+B;case"boolean":case"date":case"regexp":return"a "+B;default:return B}}function ae(j){return!j.constructor||!j.constructor.name?p:j.constructor.name}return g.checkPropTypes=o,g.resetWarningCache=o.resetWarningCache,g.PropTypes=g,g},Cv}if(process.env.NODE_ENV!=="production"){var Mz=YP(),Dz=!0;f0.exports=Oz()(Mz.isElement,Dz)}else f0.exports=Cz()();var fs=f0.exports,tg={exports:{}},XP={};function QP(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=QP(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function JS(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=QP(e))&&(r&&(r+=" "),r+=t);return r}const Tz=Object.freeze(Object.defineProperty({__proto__:null,clsx:JS,default:JS},Symbol.toStringTag,{value:"Module"})),Az=dy(Tz);var Qt={},ko={};Object.defineProperty(ko,"__esModule",{value:!0});ko.dontSetMe=Fz;ko.findInArray=Iz;ko.int=Lz;ko.isFunction=kz;ko.isNum=Nz;function Iz(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 Nz(e){return typeof e=="number"&&!isNaN(e)}function Lz(e){return parseInt(e,10)}function Fz(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 Ia={};Object.defineProperty(Ia,"__esModule",{value:!0});Ia.browserPrefixToKey=JP;Ia.browserPrefixToStyle=zz;Ia.default=void 0;Ia.getPrefix=ZP;const Ev=["Moz","Webkit","O","ms"];function ZP(){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<Ev.length;r++)if(JP(t,Ev[r])in n)return Ev[r];return""}function JP(e,t){return t?"".concat(t).concat(jz(e)):e}function zz(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function jz(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}Ia.default=ZP();Object.defineProperty(Qt,"__esModule",{value:!0});Qt.addClassName=nO;Qt.addEvent=Hz;Qt.addUserSelectStyles=ej;Qt.createCSSTransform=Xz;Qt.createSVGTransform=Qz;Qt.getTouch=Zz;Qt.getTouchIdentifier=Jz;Qt.getTranslation=jy;Qt.innerHeight=Gz;Qt.innerWidth=Yz;Qt.matchesSelector=tO;Qt.matchesSelectorAndParentsTo=Bz;Qt.offsetXYFromParent=Kz;Qt.outerHeight=Uz;Qt.outerWidth=qz;Qt.removeClassName=rO;Qt.removeEvent=Wz;Qt.removeUserSelectStyles=tj;var xr=ko,eC=Vz(Ia);function eO(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(eO=function(r){return r?n:t})(e)}function Vz(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=eO(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 Kf="";function tO(e,t){return Kf||(Kf=(0,xr.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,xr.isFunction)(e[n])})),(0,xr.isFunction)(e[Kf])?e[Kf](t):!1}function Bz(e,t,n){let r=e;do{if(tO(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Hz(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 Wz(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 Uz(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,xr.int)(n.borderTopWidth),t+=(0,xr.int)(n.borderBottomWidth),t}function qz(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,xr.int)(n.borderLeftWidth),t+=(0,xr.int)(n.borderRightWidth),t}function Gz(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,xr.int)(n.paddingTop),t-=(0,xr.int)(n.paddingBottom),t}function Yz(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,xr.int)(n.paddingLeft),t-=(0,xr.int)(n.paddingRight),t}function Kz(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 Xz(e,t){const n=jy(e,t,"px");return{[(0,eC.browserPrefixToKey)("transform",eC.default)]:n}}function Qz(e,t){return jy(e,t,"")}function jy(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 Zz(e,t){return e.targetTouches&&(0,xr.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,xr.findInArray)(e.changedTouches,n=>t===n.identifier)}function Jz(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function ej(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&&nO(e.body,"react-draggable-transparent-selection")}function tj(e){if(e)try{if(e.body&&rO(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 nO(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function rO(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var No={};Object.defineProperty(No,"__esModule",{value:!0});No.canDragX=oj;No.canDragY=ij;No.createCoreData=aj;No.createDraggableData=lj;No.getBoundPosition=nj;No.getControlPosition=sj;No.snapToGrid=rj;var ur=ko,Sl=Qt;function nj(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:cj(r);const o=Vy(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,u=s.getComputedStyle(o),d=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,ur.int)(d.paddingLeft)+(0,ur.int)(u.marginLeft),top:-o.offsetTop+(0,ur.int)(d.paddingTop)+(0,ur.int)(u.marginTop),right:(0,Sl.innerWidth)(l)-(0,Sl.outerWidth)(o)-o.offsetLeft+(0,ur.int)(d.paddingRight)-(0,ur.int)(u.marginRight),bottom:(0,Sl.innerHeight)(l)-(0,Sl.outerHeight)(o)-o.offsetTop+(0,ur.int)(d.paddingBottom)-(0,ur.int)(u.marginBottom)}}return(0,ur.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,ur.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,ur.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,ur.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function rj(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function oj(e){return e.props.axis==="both"||e.props.axis==="x"}function ij(e){return e.props.axis==="both"||e.props.axis==="y"}function sj(e,t,n){const r=typeof t=="number"?(0,Sl.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=Vy(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,Sl.offsetXYFromParent)(r||e,i,n.props.scale)}function aj(e,t,n){const r=!(0,ur.isNum)(e.lastX),o=Vy(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 lj(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 cj(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Vy(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var ng={},rg={};Object.defineProperty(rg,"__esModule",{value:!0});rg.default=uj;function uj(){}Object.defineProperty(ng,"__esModule",{value:!0});ng.default=void 0;var Rv=fj(m),Yn=By(fs),dj=By(Ao),On=Qt,Ii=No,$v=ko,Xc=By(rg);function By(e){return e&&e.__esModule?e:{default:e}}function oO(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(oO=function(r){return r?n:t})(e)}function fj(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=oO(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 jn(e,t,n){return t=hj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hj(e){var t=pj(e,"string");return typeof t=="symbol"?t:String(t)}function pj(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 eo={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let ki=eo.mouse,og=class extends Rv.Component{constructor(){super(...arguments),jn(this,"dragging",!1),jn(this,"lastX",NaN),jn(this,"lastY",NaN),jn(this,"touchIdentifier",null),jn(this,"mounted",!1),jn(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,On.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,On.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,On.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,Ii.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,Ii.createCoreData)(this,s,a);(0,Xc.default)("DraggableCore: handleDragStart: %j",l),(0,Xc.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,On.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,On.addEvent)(r,ki.move,this.handleDrag),(0,On.addEvent)(r,ki.stop,this.handleDragStop))}),jn(this,"handleDrag",t=>{const n=(0,Ii.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,Ii.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,Ii.createCoreData)(this,r,o);if((0,Xc.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}),jn(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,Ii.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,u=o-this.lastY||0;[l,u]=(0,Ii.snapToGrid)(this.props.grid,l,u),r=this.lastX+l,o=this.lastY+u}const i=(0,Ii.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,On.removeUserSelectStyles)(a.ownerDocument),(0,Xc.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Xc.default)("DraggableCore: Removing handlers"),(0,On.removeEvent)(a.ownerDocument,ki.move,this.handleDrag),(0,On.removeEvent)(a.ownerDocument,ki.stop,this.handleDragStop))}),jn(this,"onMouseDown",t=>(ki=eo.mouse,this.handleDragStart(t))),jn(this,"onMouseUp",t=>(ki=eo.mouse,this.handleDragStop(t))),jn(this,"onTouchStart",t=>(ki=eo.touch,this.handleDragStart(t))),jn(this,"onTouchEnd",t=>(ki=eo.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,On.addEvent)(t,eo.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,On.removeEvent)(n,eo.mouse.move,this.handleDrag),(0,On.removeEvent)(n,eo.touch.move,this.handleDrag),(0,On.removeEvent)(n,eo.mouse.stop,this.handleDragStop),(0,On.removeEvent)(n,eo.touch.stop,this.handleDragStop),(0,On.removeEvent)(t,eo.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,On.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:dj.default.findDOMNode(this)}render(){return Rv.cloneElement(Rv.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};ng.default=og;jn(og,"displayName","DraggableCore");jn(og,"propTypes",{allowAnyClick:Yn.default.bool,children:Yn.default.node.isRequired,disabled:Yn.default.bool,enableUserSelectHack:Yn.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:Yn.default.arrayOf(Yn.default.number),handle:Yn.default.string,cancel:Yn.default.string,nodeRef:Yn.default.object,onStart:Yn.default.func,onDrag:Yn.default.func,onStop:Yn.default.func,onMouseDown:Yn.default.func,scale:Yn.default.number,className:$v.dontSetMe,style:$v.dontSetMe,transform:$v.dontSetMe});jn(og,"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=p(m),n=d(fs),r=d(Ao),o=d(Az),i=Qt,s=No,a=ko,l=d(ng),u=d(rg);function d(w){return w&&w.__esModule?w:{default:w}}function f(w){if(typeof WeakMap!="function")return null;var C=new WeakMap,R=new WeakMap;return(f=function(E){return E?R:C})(w)}function p(w,C){if(!C&&w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var R=f(C);if(R&&R.has(w))return R.get(w);var E={},T=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in w)if(O!=="default"&&Object.prototype.hasOwnProperty.call(w,O)){var D=T?Object.getOwnPropertyDescriptor(w,O):null;D&&(D.get||D.set)?Object.defineProperty(E,O,D):E[O]=w[O]}return E.default=w,R&&R.set(w,E),E}function g(){return g=Object.assign?Object.assign.bind():function(w){for(var C=1;C<arguments.length;C++){var R=arguments[C];for(var E in R)Object.prototype.hasOwnProperty.call(R,E)&&(w[E]=R[E])}return w},g.apply(this,arguments)}function b(w,C,R){return C=y(C),C in w?Object.defineProperty(w,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[C]=R,w}function y(w){var C=x(w,"string");return typeof C=="symbol"?C:String(C)}function x(w,C){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var E=R.call(w,C||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(w)}class _ extends t.Component{static getDerivedStateFromProps(C,R){let{position:E}=C,{prevPropsPosition:T}=R;return E&&(!T||E.x!==T.x||E.y!==T.y)?((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:T}),{x:E.x,y:E.y,prevPropsPosition:{...E}}):null}constructor(C){super(C),b(this,"onDragStart",(R,E)=>{if((0,u.default)("Draggable: onDragStart: %j",E),this.props.onStart(R,(0,s.createDraggableData)(this,E))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),b(this,"onDrag",(R,E)=>{if(!this.state.dragging)return!1;(0,u.default)("Draggable: onDrag: %j",E);const T=(0,s.createDraggableData)(this,E),O={x:T.x,y:T.y,slackX:0,slackY:0};if(this.props.bounds){const{x:I,y:N}=O;O.x+=this.state.slackX,O.y+=this.state.slackY;const[V,G]=(0,s.getBoundPosition)(this,O.x,O.y);O.x=V,O.y=G,O.slackX=this.state.slackX+(I-O.x),O.slackY=this.state.slackY+(N-O.y),T.x=O.x,T.y=O.y,T.deltaX=O.x-this.state.x,T.deltaY=O.y-this.state.y}if(this.props.onDrag(R,T)===!1)return!1;this.setState(O)}),b(this,"onDragStop",(R,E)=>{if(!this.state.dragging||this.props.onStop(R,(0,s.createDraggableData)(this,E))===!1)return!1;(0,u.default)("Draggable: onDragStop: %j",E);const O={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:I,y:N}=this.props.position;O.x=I,O.y=N}this.setState(O)}),this.state={dragging:!1,dragged:!1,x:C.position?C.position.x:C.defaultPosition.x,y:C.position?C.position.y:C.defaultPosition.y,prevPropsPosition:{...C.position},slackX:0,slackY:0,isElementSVG:!1},C.position&&!(C.onDrag||C.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var C,R;return(C=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&C!==void 0?C:r.default.findDOMNode(this)}render(){const{axis:C,bounds:R,children:E,defaultPosition:T,defaultClassName:O,defaultClassNameDragging:D,defaultClassNameDragged:I,position:N,positionOffset:V,scale:G,...le}=this.props;let ee={},F=null;const Y=!!!N||this.state.dragging,Q=N||T,ae={x:(0,s.canDragX)(this)&&Y?this.state.x:Q.x,y:(0,s.canDragY)(this)&&Y?this.state.y:Q.y};this.state.isElementSVG?F=(0,i.createSVGTransform)(ae,V):ee=(0,i.createCSSTransform)(ae,V);const j=(0,o.default)(E.props.className||"",O,{[D]:this.state.dragging,[I]:this.state.dragged});return t.createElement(l.default,g({},le,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:j,style:{...E.props.style,...ee},transform:F}))}}e.default=_,b(_,"displayName","Draggable"),b(_,"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}),b(_,"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})})(XP);const{default:iO,DraggableCore:gj}=XP;tg.exports=iO;tg.exports.default=iO;tg.exports.DraggableCore=gj;var sO=tg.exports,ig={exports:{}},Td={},Hy={};Hy.__esModule=!0;Hy.cloneElement=wj;var mj=vj(m);function vj(e){return e&&e.__esModule?e:{default:e}}function tC(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 nC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tC(Object(n),!0).forEach(function(r){bj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bj(e,t,n){return t=yj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yj(e){var t=xj(e,"string");return typeof t=="symbol"?t:String(t)}function xj(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 wj(e,t){return t.style&&e.props.style&&(t.style=nC(nC({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),mj.default.cloneElement(e,t)}var Ad={};Ad.__esModule=!0;Ad.resizableProps=void 0;var Je=_j(fs);function _j(e){return e&&e.__esModule?e:{default:e}}var Sj={axis:Je.default.oneOf(["both","x","y","none"]),className:Je.default.string,children:Je.default.element.isRequired,draggableOpts:Je.default.shape({allowAnyClick:Je.default.bool,cancel:Je.default.string,children:Je.default.node,disabled:Je.default.bool,enableUserSelectHack:Je.default.bool,offsetParent:Je.default.node,grid:Je.default.arrayOf(Je.default.number),handle:Je.default.string,nodeRef:Je.default.object,onStart:Je.default.func,onDrag:Je.default.func,onStop:Je.default.func,onMouseDown:Je.default.func,scale:Je.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=Je.default.number).isRequired.apply(i,n)}return Je.default.number.apply(Je.default,n)},handle:Je.default.oneOfType([Je.default.node,Je.default.func]),handleSize:Je.default.arrayOf(Je.default.number),lockAspectRatio:Je.default.bool,maxConstraints:Je.default.arrayOf(Je.default.number),minConstraints:Je.default.arrayOf(Je.default.number),onResizeStop:Je.default.func,onResizeStart:Je.default.func,onResize:Je.default.func,resizeHandles:Je.default.arrayOf(Je.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:Je.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=Je.default.number).isRequired.apply(i,n)}return Je.default.number.apply(Je.default,n)}};Ad.resizableProps=Sj;Td.__esModule=!0;Td.default=void 0;var Qc=Pj(m),Cj=sO,Ej=Hy,Rj=Ad,$j=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function aO(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(aO=function(o){return o?n:t})(e)}function Pj(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=aO(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 h0(){return h0=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},h0.apply(this,arguments)}function Oj(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 rC(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 Pv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rC(Object(n),!0).forEach(function(r){Mj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Mj(e,t,n){return t=Dj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Dj(e){var t=Tj(e,"string");return typeof t=="symbol"?t:String(t)}function Tj(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 Aj(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,p0(e,t)}function p0(e,t){return p0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},p0(e,t)}var Wy=function(e){Aj(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,u=s.lockAspectRatio;if(!a&&!l&&!u)return[o,i];if(u){var d=this.props.width/this.props.height,f=o-this.props.width,p=i-this.props.height;Math.abs(f)>Math.abs(p*d)?i=o/d:o=i*d}var g=o,b=i,y=this.slack||[0,0],x=y[0],_=y[1];return o+=x,i+=_,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+(g-o),_+(b-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var u=l.node,d=l.deltaX,f=l.deltaY;o==="onResizeStart"&&s.resetData();var p=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",g=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!p&&!g)){var b=i[0],y=i[i.length-1],x=u.getBoundingClientRect();if(s.lastHandleRect!=null){if(y==="w"){var _=x.left-s.lastHandleRect.left;d+=_}if(b==="n"){var w=x.top-s.lastHandleRect.top;f+=w}}s.lastHandleRect=x,y==="w"&&(d=-d),b==="n"&&(f=-f);var C=s.props.width+(p?d/s.props.transformScale:0),R=s.props.height+(g?f/s.props.transformScale:0),E=s.runConstraints(C,R);C=E[0],R=E[1];var T=C!==s.props.width||R!==s.props.height,O=typeof s.props[o]=="function"?s.props[o]:null,D=o==="onResize"&&!T;O&&!D&&(a.persist==null||a.persist(),O(a,{node:u,size:{width:C,height:R},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return Qc.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=Pv({ref:i},a?{}:{handleAxis:o});return Qc.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 u=i.resizeHandles;i.transformScale;var d=Oj(i,$j);return(0,Ej.cloneElement)(s,Pv(Pv({},d),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,u.map(function(f){var p,g=(p=o.handleRefs[f])!=null?p:o.handleRefs[f]=Qc.createRef();return Qc.createElement(Cj.DraggableCore,h0({},l,{nodeRef:g,key:"resizableHandle-"+f,onStop:o.resizeHandler("onResizeStop",f),onStart:o.resizeHandler("onResizeStart",f),onDrag:o.resizeHandler("onResize",f)}),o.renderResizeHandle(f,g))}))}))},t}(Qc.Component);Td.default=Wy;Wy.propTypes=Rj.resizableProps;Wy.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var sg={};sg.__esModule=!0;sg.default=void 0;var Ov=Fj(m),Ij=lO(fs),kj=lO(Td),Nj=Ad,Lj=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function lO(e){return e&&e.__esModule?e:{default:e}}function cO(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(cO=function(o){return o?n:t})(e)}function Fj(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=cO(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 g0(){return g0=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},g0.apply(this,arguments)}function oC(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 cp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oC(Object(n),!0).forEach(function(r){zj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oC(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zj(e,t,n){return t=jj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jj(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){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 Hj(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,m0(e,t)}function m0(e,t){return m0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},m0(e,t)}var uO=function(e){Hj(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 u=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(u,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(u)},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,u=o.draggableOpts,d=o.minConstraints,f=o.maxConstraints,p=o.lockAspectRatio,g=o.axis;o.width,o.height;var b=o.resizeHandles,y=o.style,x=o.transformScale,_=Bj(o,Lj);return Ov.createElement(kj.default,{axis:g,draggableOpts:u,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:p,maxConstraints:f,minConstraints:d,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:b,transformScale:x,width:this.state.width},Ov.createElement("div",g0({},_,{style:cp(cp({},y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Ov.Component);sg.default=uO;uO.propTypes=cp(cp({},Nj.resizableProps),{},{children:Ij.default.element});ig.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};ig.exports.Resizable=Td.default;ig.exports.ResizableBox=sg.default;var Wj=ig.exports,hi={};Object.defineProperty(hi,"__esModule",{value:!0});hi.resizeHandleType=hi.resizeHandleAxesType=hi.default=void 0;var rt=dO(fs),Uj=dO(m);function dO(e){return e&&e.__esModule?e:{default:e}}const fO=rt.default.arrayOf(rt.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));hi.resizeHandleAxesType=fO;const hO=rt.default.oneOfType([rt.default.node,rt.default.func]);hi.resizeHandleType=hO;var qj={className:rt.default.string,style:rt.default.object,width:rt.default.number,autoSize:rt.default.bool,cols:rt.default.number,draggableCancel:rt.default.string,draggableHandle:rt.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:rt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&lt.validateLayout(t,"layout")},margin:rt.default.arrayOf(rt.default.number),containerPadding:rt.default.arrayOf(rt.default.number),rowHeight:rt.default.number,maxRows:rt.default.number,isBounded:rt.default.bool,isDraggable:rt.default.bool,isResizable:rt.default.bool,allowOverlap:rt.default.bool,preventCollision:rt.default.bool,useCSSTransforms:rt.default.bool,transformScale:rt.default.number,isDroppable:rt.default.bool,resizeHandles:fO,resizeHandle:hO,onLayoutChange:rt.default.func,onDragStart:rt.default.func,onDrag:rt.default.func,onDragStop:rt.default.func,onResizeStart:rt.default.func,onResize:rt.default.func,onResizeStop:rt.default.func,onDrop:rt.default.func,droppingItem:rt.default.shape({i:rt.default.string.isRequired,w:rt.default.number.isRequired,h:rt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};Uj.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:rt.default.any};hi.default=qj;Object.defineProperty(eg,"__esModule",{value:!0});eg.default=void 0;var il=Uy(m),xt=Uy(fs),Gj=sO,Yj=Wj,sl=lt,xn=Io,iC=hi,Kj=Uy(Oy);function Uy(e){return e&&e.__esModule?e:{default:e}}function vo(e,t,n){return t=Xj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xj(e){var t=Qj(e,"string");return typeof t=="symbol"?t:String(t)}function Qj(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 qy extends il.default.Component{constructor(){super(...arguments),vo(this,"state",{resizing:null,dragging:null,className:""}),vo(this,"elementRef",il.default.createRef()),vo(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(),u=r.getBoundingClientRect(),d=u.left/i,f=l.left/i,p=u.top/i,g=l.top/i;s.left=d-f+a.scrollLeft,s.top=p-g+a.scrollTop,this.setState({dragging:s});const{x:b,y}=(0,xn.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,b,y,{e:t,node:r,newPosition:s})}),vo(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:u,i:d,w:f,h:p,containerWidth:g}=this.props,b=this.getPositionParams();if(u){const{offsetParent:w}=r;if(w){const{margin:C,rowHeight:R}=this.props,E=w.clientHeight-(0,xn.calcGridItemWHPx)(p,R,C[1]);a=(0,xn.clamp)(a,0,E);const T=(0,xn.calcGridColWidth)(b),O=g-(0,xn.calcGridItemWHPx)(f,T,C[0]);l=(0,xn.clamp)(l,0,O)}}const y={top:a,left:l};this.setState({dragging:y});const{x,y:_}=(0,xn.calcXY)(b,a,l,f,p);return s.call(this,d,x,_,{e:t,node:r,newPosition:y})}),vo(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:u}=this.state.dragging,d={top:u,left:l};this.setState({dragging:null});const{x:f,y:p}=(0,xn.calcXY)(this.getPositionParams(),u,l,i,s);return o.call(this,a,f,p,{e:t,node:r,newPosition:d})}),vo(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),vo(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),vo(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,xn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,xn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,sl.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,sl.setTransform)(t):(i=(0,sl.setTopLeft)(t),n&&(i.left=(0,sl.perc)(t.left/r),i.width=(0,sl.perc)(t.width/r))),i}mixinDraggable(t,n){return il.default.createElement(Gj.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:u,resizeHandles:d,resizeHandle:f}=this.props,p=this.getPositionParams(),g=(0,xn.calcGridItemPosition)(p,0,0,o,0).width,b=(0,xn.calcGridItemPosition)(p,0,0,i,s),y=(0,xn.calcGridItemPosition)(p,0,0,a,l),x=[b.width,b.height],_=[Math.min(y.width,g),Math.min(y.height,1/0)];return il.default.createElement(Yj.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:_,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:u,resizeHandles:d,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:u,y:d,i:f,maxH:p,minH:g,containerWidth:b}=this.props,{minW:y,maxW:x}=this.props;let _=s;i&&(_=(0,sl.resizeItemInDirection)(a,r,s,b),this.setState({resizing:o==="onResizeStop"?null:_}));let{w,h:C}=(0,xn.calcWH)(this.getPositionParams(),_.width,_.height,u,d,a);w=(0,xn.clamp)(w,Math.max(y,1),x),C=(0,xn.clamp)(C,g,p),l.call(this,f,w,C,{e:t,node:i,size:_,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,u=(0,xn.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),d=il.default.Children.only(this.props.children);let f=il.default.cloneElement(d,{ref:this.elementRef,className:(0,Kj.default)("react-grid-item",d.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,...d.props.style,...this.createStyle(u)}});return f=this.mixinResizable(f,u,s),f=this.mixinDraggable(f,i),f}}eg.default=qy;vo(qy,"propTypes",{children:xt.default.element,cols:xt.default.number.isRequired,containerWidth:xt.default.number.isRequired,rowHeight:xt.default.number.isRequired,margin:xt.default.array.isRequired,maxRows:xt.default.number.isRequired,containerPadding:xt.default.array.isRequired,x:xt.default.number.isRequired,y:xt.default.number.isRequired,w:xt.default.number.isRequired,h:xt.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:xt.default.string.isRequired,resizeHandles:iC.resizeHandleAxesType,resizeHandle:iC.resizeHandleType,onDragStop:xt.default.func,onDragStart:xt.default.func,onDrag:xt.default.func,onResizeStop:xt.default.func,onResizeStart:xt.default.func,onResize:xt.default.func,isDraggable:xt.default.bool.isRequired,isResizable:xt.default.bool.isRequired,isBounded:xt.default.bool.isRequired,static:xt.default.bool,useCSSTransforms:xt.default.bool.isRequired,transformScale:xt.default.number,className:xt.default.string,handle:xt.default.string,cancel:xt.default.string,droppingPosition:xt.default.shape({e:xt.default.object.isRequired,left:xt.default.number.isRequired,top:xt.default.number.isRequired})});vo(qy,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(Dd,"__esModule",{value:!0});Dd.default=void 0;var js=tV(m),Mv=Py,Zj=Gy(Oy),Be=lt,Jj=Io,sC=Gy(eg),eV=Gy(hi);function Gy(e){return e&&e.__esModule?e:{default:e}}function pO(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(pO=function(r){return r?n:t})(e)}function tV(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=pO(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 Mn(e,t,n){return t=nV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nV(e){var t=rV(e,"string");return typeof t=="symbol"?t:String(t)}function rV(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 aC="react-grid-layout";let gO=!1;try{gO=/firefox/i.test(navigator.userAgent)}catch{}class ag extends js.Component{constructor(){super(...arguments),Mn(this,"state",{activeDrag:null,layout:(0,Be.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,Be.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Mn(this,"dragEnterCounter",0),Mn(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,Be.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,Be.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,i,s)}),Mn(this,"onDrag",(t,n,r,o)=>{let{e:i,node:s}=o;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:u,allowOverlap:d,preventCollision:f}=this.props,p=(0,Be.getLayoutItem)(l,t);if(!p)return;const g={w:p.w,h:p.h,x:p.x,y:p.y,placeholder:!0,i:t},b=!0;l=(0,Be.moveElement)(l,p,n,r,b,f,(0,Be.compactType)(this.props),u,d),this.props.onDrag(l,a,p,g,i,s),this.setState({layout:d?l:(0,Be.compact)(l,(0,Be.compactType)(this.props),u),activeDrag:g})}),Mn(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:u,preventCollision:d,allowOverlap:f}=this.props,p=(0,Be.getLayoutItem)(l,t);if(!p)return;const g=!0;l=(0,Be.moveElement)(l,p,n,r,g,d,(0,Be.compactType)(this.props),u,f);const b=f?l:(0,Be.compact)(l,(0,Be.compactType)(this.props),u);this.props.onDragStop(b,a,p,null,i,s);const{oldLayout:y}=this.state;this.setState({activeDrag:null,layout:b,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(b,y)}),Mn(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,Be.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,Be.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),Mn(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:u}=this.state;let{layout:d}=this.state;const{cols:f,preventCollision:p,allowOverlap:g}=this.props;let b=!1,y,x,_;const[w,C]=(0,Be.withLayoutItem)(d,t,E=>{let T;return x=E.x,_=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&&(_=E.y+(E.h-r),r=E.y!==_&&_<0?E.h:r,_=_<0?0:_),b=!0),p&&!g&&(T=(0,Be.getAllCollisions)(d,{...E,w:n,h:r,x,y:_}).filter(D=>D.i!==E.i).length>0,T&&(_=E.y,r=E.h,x=E.x,n=E.w,b=!1)),E.w=n,E.h=r,E});if(!C)return;y=w,b&&(y=(0,Be.moveElement)(w,C,x,_,!0,this.props.preventCollision,(0,Be.compactType)(this.props),f,g));const R={w:C.w,h:C.h,x:C.x,y:C.y,static:!0,i:t};this.props.onResize(y,u,C,R,i,s),this.setState({layout:g?y:(0,Be.compact)(y,(0,Be.compactType)(this.props),f),activeDrag:R})}),Mn(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a,oldResizeItem:l}=this.state,{cols:u,allowOverlap:d}=this.props,f=(0,Be.getLayoutItem)(a,t),p=d?a:(0,Be.compact)(a,(0,Be.compactType)(this.props),u);this.props.onResizeStop(p,l,f,null,i,s);const{oldLayout:g}=this.state;this.setState({activeDrag:null,layout:p,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(p,g)}),Mn(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),gO&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(aC)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:s,rowHeight:a,maxRows:l,width:u,containerPadding:d,transformScale:f}=this.props,p=o==null?void 0:o(t);if(p===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const g={...r,...p},{layout:b}=this.state,{layerX:y,layerY:x}=t.nativeEvent,_={left:y/f,top:x/f,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:w,top:C}=this.state.droppingPosition;(w!=y||C!=x)&&this.setState({droppingPosition:_})}}else{const w={cols:s,margin:i,maxRows:l,rowHeight:a,containerWidth:u,containerPadding:d||i},C=(0,Jj.calcXY)(w,x,y,g.w,g.h);this.setState({droppingDOMNode:js.createElement("div",{key:g.i}),droppingPosition:_,layout:[...b,{...g,x:C.x,y:C.y,static:!1,isDraggable:!0}]})}}),Mn(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,Be.compact)(r.filter(i=>i.i!==t.i),(0,Be.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Mn(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Mn(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Mn(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,Mv.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,Be.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,Be.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,Be.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,Be.fastRGLPropsEqual)(this.props,t,Mv.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,Be.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,Mv.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:u}=this.props;return js.createElement(sC.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:u},js.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,Be.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:s,containerPadding:a,rowHeight:l,maxRows:u,isDraggable:d,isResizable:f,isBounded:p,useCSSTransforms:g,transformScale:b,draggableCancel:y,draggableHandle:x,resizeHandles:_,resizeHandle:w}=this.props,{mounted:C,droppingPosition:R}=this.state,E=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&d,T=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&f,O=r.resizeHandles||_,D=E&&p&&r.isBounded!==!1;return js.createElement(sC.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:u,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:T,isBounded:D,useCSSTransforms:g&&C,usePercentages:!C,transformScale:b,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:O,resizeHandle:w},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,Zj.default)(aC,t),s={height:this.containerHeight(),...n};return js.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:Be.noop,onDragLeave:r?this.onDragLeave:Be.noop,onDragEnter:r?this.onDragEnter:Be.noop,onDragOver:r?this.onDragOver:Be.noop},js.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Dd.default=ag;Mn(ag,"displayName","ReactGridLayout");Mn(ag,"propTypes",eV.default);Mn(ag,"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:Be.noop,onDragStart:Be.noop,onDrag:Be.noop,onDragStop:Be.noop,onResizeStart:Be.noop,onResize:Be.noop,onResizeStop:Be.noop,onDrop:Be.noop,onDropDragOver:Be.noop});var lg={},ka={};Object.defineProperty(ka,"__esModule",{value:!0});ka.findOrGenerateResponsiveLayout=sV;ka.getBreakpointFromWidth=oV;ka.getColsFromBreakpoint=iV;ka.sortBreakpoints=Yy;var Xf=lt;function oV(e,t){const n=Yy(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 iV(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function sV(e,t,n,r,o,i){if(e[n])return(0,Xf.cloneLayout)(e[n]);let s=e[r];const a=Yy(t),l=a.slice(a.indexOf(n));for(let u=0,d=l.length;u<d;u++){const f=l[u];if(e[f]){s=e[f];break}}return s=(0,Xf.cloneLayout)(s||[]),(0,Xf.compact)((0,Xf.correctBounds)(s,{cols:o}),i,o)}function Yy(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(lg,"__esModule",{value:!0});lg.default=void 0;var lC=lV(m),Kn=mO(fs),Dv=Py,$l=lt,Vs=ka,aV=mO(Dd);function mO(e){return e&&e.__esModule?e:{default:e}}function vO(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(vO=function(r){return r?n:t})(e)}function lV(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=vO(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 v0(){return v0=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},v0.apply(this,arguments)}function up(e,t,n){return t=cV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cV(e){var t=uV(e,"string");return typeof t=="symbol"?t:String(t)}function uV(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 cC=e=>Object.prototype.toString.call(e);function Qf(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class Ky extends lC.Component{constructor(){super(...arguments),up(this,"state",this.generateInitialState()),up(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,Vs.getBreakpointFromWidth)(n,t),s=(0,Vs.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Vs.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,Dv.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Vs.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,Dv.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,Dv.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,Vs.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,Vs.getColsFromBreakpoint)(s,r),u={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in u||(u[a]=(0,$l.cloneLayout)(this.state.layout));let p=(0,Vs.findOrGenerateResponsiveLayout)(u,n,s,a,l,i);p=(0,$l.synchronizeLayoutWithChildren)(p,this.props.children,l,i,this.props.allowOverlap),u[s]=p,this.props.onLayoutChange(p,u),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:p,cols:l})}const d=Qf(this.props.margin,s),f=Qf(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,d,l,f)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:u,...d}=this.props;return lC.createElement(aV.default,v0({},d,{margin:Qf(i,this.state.breakpoint),containerPadding:Qf(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}lg.default=Ky;up(Ky,"propTypes",{breakpoint:Kn.default.string,breakpoints:Kn.default.object,allowOverlap:Kn.default.bool,cols:Kn.default.object,margin:Kn.default.oneOfType([Kn.default.array,Kn.default.object]),containerPadding:Kn.default.oneOfType([Kn.default.array,Kn.default.object]),layouts(e,t){if(cC(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+cC(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,$l.validateLayout)(e.layouts[n],"layouts."+n)})},width:Kn.default.number.isRequired,onBreakpointChange:Kn.default.func,onLayoutChange:Kn.default.func,onWidthChange:Kn.default.func});up(Ky,"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:$l.noop,onLayoutChange:$l.noop,onWidthChange:$l.noop});var Xy={},bO=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}()}(),b0=typeof window<"u"&&typeof document<"u"&&window.document===document,dp=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")()}(),dV=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(dp):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),fV=2;function hV(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){dV(i)}function a(){var l=Date.now();if(n){if(l-o<fV)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var pV=20,gV=["top","right","bottom","left","width","height","size","weight"],mV=typeof MutationObserver<"u",vV=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=hV(this.refresh.bind(this),pV)}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(){!b0||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mV?(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(){!b0||!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=gV.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}(),yO=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},rc=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||dp},xO=cg(0,0,0,0);function fp(e){return parseFloat(e)||0}function uC(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+fp(i)},0)}function bV(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]=fp(s)}return n}function yV(e){var t=e.getBBox();return cg(0,0,t.width,t.height)}function xV(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return xO;var r=rc(e).getComputedStyle(e),o=bV(r),i=o.left+o.right,s=o.top+o.bottom,a=fp(r.width),l=fp(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=uC(r,"left","right")+i),Math.round(l+s)!==n&&(l-=uC(r,"top","bottom")+s)),!_V(e)){var u=Math.round(a+i)-t,d=Math.round(l+s)-n;Math.abs(u)!==1&&(a-=u),Math.abs(d)!==1&&(l-=d)}return cg(o.left,o.top,a,l)}var wV=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof rc(e).SVGGraphicsElement}:function(e){return e instanceof rc(e).SVGElement&&typeof e.getBBox=="function"}}();function _V(e){return e===rc(e).document.documentElement}function SV(e){return b0?wV(e)?yV(e):xV(e):xO}function CV(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 yO(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function cg(e,t,n,r){return{x:e,y:t,width:n,height:r}}var EV=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=cg(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=SV(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}(),RV=function(){function e(t,n){var r=CV(n);yO(this,{target:t,contentRect:r})}return e}(),$V=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new bO,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 rc(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new EV(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 rc(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 RV(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}(),wO=typeof WeakMap<"u"?new WeakMap:new bO,_O=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=vV.getInstance(),r=new $V(t,n,this);wO.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){_O.prototype[e]=function(){var t;return(t=wO.get(this))[e].apply(t,arguments)}});var PV=function(){return typeof dp.ResizeObserver<"u"?dp.ResizeObserver:_O}();const OV=Object.freeze(Object.defineProperty({__proto__:null,default:PV},Symbol.toStringTag,{value:"Module"})),MV=dy(OV);Object.defineProperty(Xy,"__esModule",{value:!0});Xy.default=FV;var Zf=IV(m),DV=Qy(fs),TV=Qy(MV),AV=Qy(Oy);function Qy(e){return e&&e.__esModule?e:{default:e}}function SO(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(SO=function(r){return r?n:t})(e)}function IV(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=SO(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 y0(){return y0=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},y0.apply(this,arguments)}function al(e,t,n){return t=kV(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kV(e){var t=NV(e,"string");return typeof t=="symbol"?t:String(t)}function NV(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 LV="react-grid-layout";function FV(e){var t;return t=class extends Zf.Component{constructor(){super(...arguments),al(this,"state",{width:1280}),al(this,"elementRef",Zf.createRef()),al(this,"mounted",!1),al(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new TV.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?Zf.createElement("div",{className:(0,AV.default)(this.props.className,LV),style:this.props.style,ref:this.elementRef}):Zf.createElement(e,y0({innerRef:this.elementRef},o,this.state))}},al(t,"defaultProps",{measureBeforeMount:!1}),al(t,"propTypes",{measureBeforeMount:DV.default.bool}),t}(function(e){e.exports=Dd.default,e.exports.utils=lt,e.exports.calculateUtils=Io,e.exports.Responsive=lg.default,e.exports.Responsive.utils=ka,e.exports.WidthProvider=Xy.default})(kP);var dC=kP.exports;function Ca({children:e,className:t,text:n,onSave:r,type:o="input"}){const[i,s]=m.useState(!1),[a,l]=m.useState(n),u=Ee(p=>p.isDashboardEditing),d=p=>{p.stopPropagation(),u&&s(!0)};function f(){return o==="textarea"?k.jsx("textarea",{className:Se(" grow px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:p=>l(p.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:p=>{p.key==="Enter"&&p.shiftKey||(p.key==="Enter"||p.key==="Tab")&&(s(!1),r(a))}}):k.jsx("input",{onMouseDown:p=>p.stopPropagation(),type:"text",className:Se("px-2 py-1 text-sm bg-background outline-[0.5px] outline-dashed outline-primary/50 rounded-sm",t),onChange:p=>l(p.target.value),value:a,autoFocus:!0,onBlur:()=>s(!1),onKeyDown:p=>{(p.key==="Enter"||p.key==="Tab")&&(s(!1),r(a))}})}return k.jsx("div",{className:"flex",role:"editable",onDoubleClick:d,children:i?f():e})}const Zy=ie.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Zy.displayName="Card";const ug=ie.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se("flex flex-col space-y-1.5 p-6",e),...t}));ug.displayName="CardHeader";const dg=ie.forwardRef(({className:e,...t},n)=>k.jsx("h3",{ref:n,className:Se("text-2xl font-semibold leading-none tracking-tight",e),...t}));dg.displayName="CardTitle";const Jy=ie.forwardRef(({className:e,...t},n)=>k.jsx("p",{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));Jy.displayName="CardDescription";const fg=ie.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se("px-6 pb-6 pt-0",e),...t}));fg.displayName="CardContent";const ex=ie.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se("flex items-center p-6 pt-0",e),...t}));ex.displayName="CardFooter";/*!
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 Id(e){return e+.5|0}const Ki=(e,t,n)=>Math.max(Math.min(e,n),t);function gu(e){return Ki(Id(e*2.55),0,255)}function rs(e){return Ki(Id(e*255),0,255)}function ii(e){return Ki(Id(e/2.55)/100,0,1)}function fC(e){return Ki(Id(e*100),0,100)}const Nr={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},x0=[..."0123456789ABCDEF"],zV=e=>x0[e&15],jV=e=>x0[(e&240)>>4]+x0[e&15],Jf=e=>(e&240)>>4===(e&15),VV=e=>Jf(e.r)&&Jf(e.g)&&Jf(e.b)&&Jf(e.a);function BV(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Nr[e[1]]*17,g:255&Nr[e[2]]*17,b:255&Nr[e[3]]*17,a:t===5?Nr[e[4]]*17:255}:(t===7||t===9)&&(n={r:Nr[e[1]]<<4|Nr[e[2]],g:Nr[e[3]]<<4|Nr[e[4]],b:Nr[e[5]]<<4|Nr[e[6]],a:t===9?Nr[e[7]]<<4|Nr[e[8]]:255})),n}const HV=(e,t)=>e<255?t(e):"";function WV(e){var t=VV(e)?zV:jV;return e?"#"+t(e.r)+t(e.g)+t(e.b)+HV(e.a,t):void 0}const UV=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function CO(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 qV(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 GV(e,t,n){const r=CO(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 YV(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 tx(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,u,d;return i!==s&&(d=i-s,u=a>.5?d/(2-i-s):d/(i+s),l=YV(n,r,o,d,i),l=l*60+.5),[l|0,u||0,a]}function nx(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(rs)}function rx(e,t,n){return nx(CO,e,t,n)}function KV(e,t,n){return nx(GV,e,t,n)}function XV(e,t,n){return nx(qV,e,t,n)}function EO(e){return(e%360+360)%360}function QV(e){const t=UV.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?gu(+t[5]):rs(+t[5]));const o=EO(+t[2]),i=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=KV(o,i,s):t[1]==="hsv"?r=XV(o,i,s):r=rx(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function ZV(e,t){var n=tx(e);n[0]=EO(n[0]+t),n=rx(n),e.r=n[0],e.g=n[1],e.b=n[2]}function JV(e){if(!e)return;const t=tx(e),n=t[0],r=fC(t[1]),o=fC(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${ii(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const hC={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"},pC={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 eB(){const e={},t=Object.keys(pC),n=Object.keys(hC);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,hC[i]);i=parseInt(pC[s],16),e[a]=[i>>16&255,i>>8&255,i&255]}return e}let eh;function tB(e){eh||(eh=eB(),eh.transparent=[0,0,0,0]);const t=eh[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const nB=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function rB(e){const t=nB.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?gu(s):Ki(s*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?gu(r):Ki(r,0,255)),o=255&(t[4]?gu(o):Ki(o,0,255)),i=255&(t[6]?gu(i):Ki(i,0,255)),{r,g:o,b:i,a:n}}}function oB(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${ii(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Tv=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,ll=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function iB(e,t,n){const r=ll(ii(e.r)),o=ll(ii(e.g)),i=ll(ii(e.b));return{r:rs(Tv(r+n*(ll(ii(t.r))-r))),g:rs(Tv(o+n*(ll(ii(t.g))-o))),b:rs(Tv(i+n*(ll(ii(t.b))-i))),a:e.a+n*(t.a-e.a)}}function th(e,t,n){if(e){let r=tx(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=rx(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function RO(e,t){return e&&Object.assign(t||{},e)}function gC(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=rs(e[3]))):(t=RO(e,{r:0,g:0,b:0,a:1}),t.a=rs(t.a)),t}function sB(e){return e.charAt(0)==="r"?rB(e):QV(e)}class Gu{constructor(t){if(t instanceof Gu)return t;const n=typeof t;let r;n==="object"?r=gC(t):n==="string"&&(r=BV(t)||tB(t)||sB(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=RO(this._rgb);return t&&(t.a=ii(t.a)),t}set rgb(t){this._rgb=gC(t)}rgbString(){return this._valid?oB(this._rgb):void 0}hexString(){return this._valid?WV(this._rgb):void 0}hslString(){return this._valid?JV(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,u=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;i=1-u,r.r=255&u*r.r+i*o.r+.5,r.g=255&u*r.g+i*o.g+.5,r.b=255&u*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=iB(this._rgb,t._rgb,n)),this}clone(){return new Gu(this.rgb)}alpha(t){return this._rgb.a=rs(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Id(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 th(this._rgb,2,t),this}darken(t){return th(this._rgb,2,-t),this}saturate(t){return th(this._rgb,1,t),this}desaturate(t){return th(this._rgb,1,-t),this}rotate(t){return ZV(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 Zo(){}const aB=(()=>{let e=0;return()=>e++})();function at(e){return e===null||typeof e>"u"}function zt(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 ut(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Xt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function fr(e,t){return Xt(e)?e:t}function Ke(e,t){return typeof e>"u"?t:e}const lB=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,$O=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Pt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Ct(e,t,n,r){let o,i,s;if(zt(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(ut(e))for(s=Object.keys(e),i=s.length,o=0;o<i;o++)t.call(n,e[s[o]],s[o])}function hp(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(zt(e))return e.map(pp);if(ut(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 PO(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function cB(e,t,n,r){if(!PO(e))return;const o=t[e],i=n[e];ut(o)&&ut(i)?Mo(o,i,r):t[e]=pp(i)}function Mo(e,t,n){const r=zt(t)?t:[t],o=r.length;if(!ut(e))return e;n=n||{};const i=n.merger||cB;let s;for(let a=0;a<o;++a){if(s=r[a],!ut(s))continue;const l=Object.keys(s);for(let u=0,d=l.length;u<d;++u)i(l[u],e,s,n)}return e}function Su(e,t){return Mo(e,t,{merger:uB})}function uB(e,t,n){if(!PO(e))return;const r=t[e],o=n[e];ut(r)&&ut(o)?Su(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=pp(o))}const mC={"":e=>e,x:e=>e.x,y:e=>e.y};function dB(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 fB(e){const t=dB(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function ss(e,t){return(mC[t]||(mC[t]=fB(t)))(e)}function ox(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Yu=e=>typeof e<"u",as=e=>typeof e=="function",vC=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function hB(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Vt=Math.PI,jt=2*Vt,pB=jt+Vt,gp=Number.POSITIVE_INFINITY,gB=Vt/180,en=Vt/2,Bs=Vt/4,bC=Vt*2/3,Xi=Math.log10,Ro=Math.sign;function Cu(e,t,n){return Math.abs(e-t)<n}function yC(e){const t=Math.round(e);e=Cu(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Xi(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function mB(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 oc(e){return!isNaN(parseFloat(e))&&isFinite(e)}function vB(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function OO(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 no(e){return e*(Vt/180)}function ix(e){return e*(180/Vt)}function xC(e){if(!Xt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function MO(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*Vt&&(i+=jt),{angle:i,distance:o}}function w0(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function bB(e,t){return(e-t+pB)%jt-Vt}function mr(e){return(e%jt+jt)%jt}function Ku(e,t,n,r){const o=mr(e),i=mr(t),s=mr(n),a=mr(i-o),l=mr(s-o),u=mr(o-i),d=mr(o-s);return o===i||o===s||r&&i===s||a>l&&u<d}function gn(e,t,n){return Math.max(t,Math.min(n,e))}function yB(e){return gn(e,-32768,32767)}function li(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function sx(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 ci=(e,t,n,r)=>sx(e,n,r?o=>{const i=e[o][t];return i<n||i===n&&e[o+1][t]===n}:o=>e[o][t]<n),xB=(e,t,n)=>sx(e,n,r=>e[r][t]>=n);function wB(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 DO=["push","pop","shift","splice","unshift"];function _B(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),DO.forEach(n=>{const r="_onData"+ox(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 wC(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)&&(DO.forEach(i=>{delete e[i]}),delete e._chartjs)}function TO(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const AO=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function IO(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,AO.call(window,()=>{r=!1,e.apply(t,n)}))}}function SB(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const ax=e=>e==="start"?"left":e==="end"?"right":"center",Dn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,CB=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function kO(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:u,max:d,minDefined:f,maxDefined:p}=s.getUserBounds();f&&(o=gn(Math.min(ci(a,l,u).lo,n?r:ci(t,l,s.getPixelForValue(u)).lo),0,r-1)),p?i=gn(Math.max(ci(a,s.axis,d,!0).hi+1,n?0:ci(t,l,s.getPixelForValue(d),!0).hi+1),o,r)-o:i=r-o}return{start:o,count:i}}function NO(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 nh=e=>e===0||e===1,_C=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*jt/n)),SC=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*jt/n)+1,Eu={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*en)+1,easeOutSine:e=>Math.sin(e*en),easeInOutSine:e=>-.5*(Math.cos(Vt*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=>nh(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=>nh(e)?e:_C(e,.075,.3),easeOutElastic:e=>nh(e)?e:SC(e,.075,.3),easeInOutElastic(e){return nh(e)?e:e<.5?.5*_C(e*2,.1125,.45):.5+.5*SC(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-Eu.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?Eu.easeInBounce(e*2)*.5:Eu.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 CC(e){return lx(e)?e:new Gu(e)}function Av(e){return lx(e)?e:new Gu(e).saturate(.5).darken(.1).hexString()}const EB=["x","y","borderWidth","radius","tension"],RB=["color","borderColor","backgroundColor"];function $B(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:RB},numbers:{type:"number",properties:EB}}),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 PB(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const EC=new Map;function OB(e,t){t=t||{};const n=e+JSON.stringify(t);let r=EC.get(n);return r||(r=new Intl.NumberFormat(e,t),EC.set(n,r)),r}function kd(e,t,n){return OB(t,n).format(e)}const LO={values(e){return zt(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 u=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(u<1e-4||u>1e15)&&(o="scientific"),i=MB(e,n)}const s=Xi(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),kd(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Xi(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?LO.numeric.call(this,e,t,n):""}};function MB(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 hg={formatters:LO};function DB(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:hg.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 Ea=Object.create(null),_0=Object.create(null);function Ru(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 Iv(e,t,n){return typeof t=="string"?Mo(Ru(e,t),n):Mo(Ru(e,""),t)}class TB{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)=>Av(o.backgroundColor),this.hoverBorderColor=(r,o)=>Av(o.borderColor),this.hoverColor=(r,o)=>Av(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 Iv(this,t,n)}get(t){return Ru(this,t)}describe(t,n){return Iv(_0,t,n)}override(t,n){return Iv(Ea,t,n)}route(t,n,r,o){const i=Ru(this,t),s=Ru(this,r),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],u=s[o];return ut(l)?Object.assign({},u,l):Ke(l,u)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var qt=new TB({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[$B,PB,DB]);function AB(e){return!e||at(e.size)||at(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function mp(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 IB(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,u,d,f,p;for(l=0;l<a;l++)if(f=n[l],f!=null&&!zt(f))s=mp(e,o,i,s,f);else if(zt(f))for(u=0,d=f.length;u<d;u++)p=f[u],p!=null&&!zt(p)&&(s=mp(e,o,i,s,p));e.restore();const g=i.length/2;if(g>n.length){for(l=0;l<g;l++)delete o[i[l]];i.splice(0,g)}return s}function Hs(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 RC(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function S0(e,t,n,r){FO(e,t,n,r,null)}function FO(e,t,n,r,o){let i,s,a,l,u,d,f,p;const g=t.pointStyle,b=t.rotation,y=t.radius;let x=(b||0)*gB;if(g&&typeof g=="object"&&(i=g.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(x),e.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),e.restore();return}if(!(isNaN(y)||y<=0)){switch(e.beginPath(),g){default:o?e.ellipse(n,r,o/2,y,0,0,jt):e.arc(n,r,y,0,jt),e.closePath();break;case"triangle":d=o?o/2:y,e.moveTo(n+Math.sin(x)*d,r-Math.cos(x)*y),x+=bC,e.lineTo(n+Math.sin(x)*d,r-Math.cos(x)*y),x+=bC,e.lineTo(n+Math.sin(x)*d,r-Math.cos(x)*y),e.closePath();break;case"rectRounded":u=y*.516,l=y-u,s=Math.cos(x+Bs)*l,f=Math.cos(x+Bs)*(o?o/2-u:l),a=Math.sin(x+Bs)*l,p=Math.sin(x+Bs)*(o?o/2-u:l),e.arc(n-f,r-a,u,x-Vt,x-en),e.arc(n+p,r-s,u,x-en,x),e.arc(n+f,r+a,u,x,x+en),e.arc(n-p,r+s,u,x+en,x+Vt),e.closePath();break;case"rect":if(!b){l=Math.SQRT1_2*y,d=o?o/2:l,e.rect(n-d,r-l,2*d,2*l);break}x+=Bs;case"rectRot":f=Math.cos(x)*(o?o/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,p=Math.sin(x)*(o?o/2:y),e.moveTo(n-f,r-a),e.lineTo(n+p,r-s),e.lineTo(n+f,r+a),e.lineTo(n-p,r+s),e.closePath();break;case"crossRot":x+=Bs;case"cross":f=Math.cos(x)*(o?o/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,p=Math.sin(x)*(o?o/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s);break;case"star":f=Math.cos(x)*(o?o/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,p=Math.sin(x)*(o?o/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s),x+=Bs,f=Math.cos(x)*(o?o/2:y),s=Math.cos(x)*y,a=Math.sin(x)*y,p=Math.sin(x)*(o?o/2:y),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,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 ui(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 pg(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function gg(e){e.restore()}function kB(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 NB(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 LB(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),at(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 FB(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,u=n+i.actualBoundingBoxDescent,d=o.strikethrough?(l+u)/2:u;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=o.decorationWidth||2,e.moveTo(s,d),e.lineTo(a,d),e.stroke()}}function zB(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ra(e,t,n,r,o,i={}){const s=zt(t)?t:[t],a=i.strokeWidth>0&&i.strokeColor!=="";let l,u;for(e.save(),e.font=o.string,LB(e,i),l=0;l<s.length;++l)u=s[l],i.backdrop&&zB(e,i.backdrop),a&&(i.strokeColor&&(e.strokeStyle=i.strokeColor),at(i.strokeWidth)||(e.lineWidth=i.strokeWidth),e.strokeText(u,n,r,i.maxWidth)),e.fillText(u,n,r,i.maxWidth),FB(e,n,r,u,i),r+=Number(o.lineHeight);e.restore()}function Xu(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*Vt,Vt,!0),e.lineTo(n,r+i-s.bottomLeft),e.arc(n+s.bottomLeft,r+i-s.bottomLeft,s.bottomLeft,Vt,en,!0),e.lineTo(n+o-s.bottomRight,r+i),e.arc(n+o-s.bottomRight,r+i-s.bottomRight,s.bottomRight,en,0,!0),e.lineTo(n+o,r+s.topRight),e.arc(n+o-s.topRight,r+s.topRight,s.topRight,0,-en,!0),e.lineTo(n+s.topLeft,r)}const jB=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,VB=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function BB(e,t){const n=(""+e).match(jB);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 HB=e=>+e||0;function cx(e,t){const n={},r=ut(t),o=r?Object.keys(t):t,i=ut(e)?r?s=>Ke(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of o)n[s]=HB(i(s));return n}function zO(e){return cx(e,{top:"y",right:"x",bottom:"y",left:"x"})}function ga(e){return cx(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Cn(e){const t=zO(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function tn(e,t){e=e||{},t=t||qt.font;let n=Ke(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=Ke(e.style,t.style);r&&!(""+r).match(VB)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:Ke(e.family,t.family),lineHeight:BB(Ke(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Ke(e.weight,t.weight),string:""};return o.string=AB(o),o}function Ft(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&&zt(a)&&(a=a[n%a.length],o=!1),a!==void 0))return r&&!o&&(r.cacheable=!1),a}function WB(e,t,n){const{min:r,max:o}=e,i=$O(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 hs(e,t){return Object.assign(Object.create(e),t)}function ux(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=HO("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:a=>ux([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 VO(a,l,()=>ZB(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return PC(a).includes(l)},ownKeys(a){return PC(a)},set(a,l,u){const d=a._storage||(a._storage=o());return a[l]=d[l]=u,delete a._keys,!0}})}function ic(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:jO(e,r),setContext:i=>ic(e,i,n,r),override:i=>ic(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 VO(i,s,()=>qB(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 jO(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:as(n)?n:()=>n,isIndexable:as(r)?r:()=>r}}const UB=(e,t)=>e?e+ox(t):t,dx=(e,t)=>ut(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function VO(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function qB(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=e;let a=r[t];return as(a)&&s.isScriptable(t)&&(a=GB(t,a,e,n)),zt(a)&&a.length&&(a=YB(t,a,e,s.isIndexable)),dx(t,a)&&(a=ic(a,o,i&&i[t],s)),a}function GB(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),dx(e,l)&&(l=fx(o._scopes,o,e,l)),l}function YB(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(ut(t[0])){const l=t,u=o._scopes.filter(d=>d!==l);t=[];for(const d of l){const f=fx(u,o,e,d);t.push(ic(f,i,s&&s[e],a))}}return t}function BO(e,t,n){return as(e)?e(t,n):e}const KB=(e,t)=>e===!0?t:typeof e=="string"?ss(t,e):void 0;function XB(e,t,n,r,o){for(const i of t){const s=KB(n,i);if(s){e.add(s);const a=BO(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 fx(e,t,n,r){const o=t._rootScopes,i=BO(t._fallback,n,r),s=[...e,...o],a=new Set;a.add(r);let l=$C(a,s,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=$C(a,s,i,l,r),l===null)?!1:ux(Array.from(a),[""],o,i,()=>QB(t,n,r))}function $C(e,t,n,r,o){for(;n;)n=XB(e,t,n,r,o);return n}function QB(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return zt(o)&&ut(n)?n:o||{}}function ZB(e,t,n,r){let o;for(const i of t)if(o=HO(UB(i,e),n),typeof o<"u")return dx(e,o)?fx(n,r,e,o):o}function HO(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function PC(e){let t=e._keys;return t||(t=e._keys=JB(e._scopes)),t}function JB(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 WO(e,t,n,r){const{iScale:o}=e,{key:i="r"}=this._parsing,s=new Array(r);let a,l,u,d;for(a=0,l=r;a<l;++a)u=a+n,d=t[u],s[a]={r:o.parse(ss(d,i),u)};return s}const eH=Number.EPSILON||1e-14,sc=(e,t)=>t<e.length&&!e[t].skip&&e[t],UO=e=>e==="x"?"y":"x";function tH(e,t,n,r){const o=e.skip?t:e,i=t,s=n.skip?t:n,a=w0(i,o),l=w0(s,i);let u=a/(a+l),d=l/(a+l);u=isNaN(u)?0:u,d=isNaN(d)?0:d;const f=r*u,p=r*d;return{previous:{x:i.x-f*(s.x-o.x),y:i.y-f*(s.y-o.y)},next:{x:i.x+p*(s.x-o.x),y:i.y+p*(s.y-o.y)}}}function nH(e,t,n){const r=e.length;let o,i,s,a,l,u=sc(e,0);for(let d=0;d<r-1;++d)if(l=u,u=sc(e,d+1),!(!l||!u)){if(Cu(t[d],0,eH)){n[d]=n[d+1]=0;continue}o=n[d]/t[d],i=n[d+1]/t[d],a=Math.pow(o,2)+Math.pow(i,2),!(a<=9)&&(s=3/Math.sqrt(a),n[d]=o*s*t[d],n[d+1]=i*s*t[d])}}function rH(e,t,n="x"){const r=UO(n),o=e.length;let i,s,a,l=sc(e,0);for(let u=0;u<o;++u){if(s=a,a=l,l=sc(e,u+1),!a)continue;const d=a[n],f=a[r];s&&(i=(d-s[n])/3,a[`cp1${n}`]=d-i,a[`cp1${r}`]=f-i*t[u]),l&&(i=(l[n]-d)/3,a[`cp2${n}`]=d+i,a[`cp2${r}`]=f+i*t[u])}}function oH(e,t="x"){const n=UO(t),r=e.length,o=Array(r).fill(0),i=Array(r);let s,a,l,u=sc(e,0);for(s=0;s<r;++s)if(a=l,l=u,u=sc(e,s+1),!!l){if(u){const d=u[t]-l[t];o[s]=d!==0?(u[n]-l[n])/d:0}i[s]=a?u?Ro(o[s-1])!==Ro(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}nH(e,o,i),rH(e,i,t)}function rh(e,t,n){return Math.max(Math.min(e,n),t)}function iH(e,t){let n,r,o,i,s,a=ui(e[0],t);for(n=0,r=e.length;n<r;++n)s=i,i=a,a=n<r-1&&ui(e[n+1],t),i&&(o=e[n],s&&(o.cp1x=rh(o.cp1x,t.left,t.right),o.cp1y=rh(o.cp1y,t.top,t.bottom)),a&&(o.cp2x=rh(o.cp2x,t.left,t.right),o.cp2y=rh(o.cp2y,t.top,t.bottom)))}function sH(e,t,n,r,o){let i,s,a,l;if(t.spanGaps&&(e=e.filter(u=>!u.skip)),t.cubicInterpolationMode==="monotone")oH(e,o);else{let u=r?e[e.length-1]:e[0];for(i=0,s=e.length;i<s;++i)a=e[i],l=tH(u,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,u=a}t.capBezierPoints&&iH(e,n)}function hx(){return typeof window<"u"&&typeof document<"u"}function px(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function vp(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 mg=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function aH(e,t){return mg(e).getPropertyValue(t)}const lH=["top","right","bottom","left"];function ma(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=lH[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const cH=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function uH(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let s=!1,a,l;if(cH(o,i,e.target))a=o,l=i;else{const u=t.getBoundingClientRect();a=r.clientX-u.left,l=r.clientY-u.top,s=!0}return{x:a,y:l,box:s}}function Ys(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=mg(n),i=o.boxSizing==="border-box",s=ma(o,"padding"),a=ma(o,"border","width"),{x:l,y:u,box:d}=uH(e,n),f=s.left+(d&&a.left),p=s.top+(d&&a.top);let{width:g,height:b}=t;return i&&(g-=s.width+a.width,b-=s.height+a.height),{x:Math.round((l-f)/g*n.width/r),y:Math.round((u-p)/b*n.height/r)}}function dH(e,t,n){let r,o;if(t===void 0||n===void 0){const i=px(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const s=i.getBoundingClientRect(),a=mg(i),l=ma(a,"border","width"),u=ma(a,"padding");t=s.width-u.width-l.width,n=s.height-u.height-l.height,r=vp(a.maxWidth,i,"clientWidth"),o=vp(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||gp,maxHeight:o||gp}}const oh=e=>Math.round(e*10)/10;function fH(e,t,n,r){const o=mg(e),i=ma(o,"margin"),s=vp(o.maxWidth,e,"clientWidth")||gp,a=vp(o.maxHeight,e,"clientHeight")||gp,l=dH(e,t,n);let{width:u,height:d}=l;if(o.boxSizing==="content-box"){const p=ma(o,"border","width"),g=ma(o,"padding");u-=g.width+p.width,d-=g.height+p.height}return u=Math.max(0,u-i.width),d=Math.max(0,r?u/r:d-i.height),u=oh(Math.min(u,s,l.maxWidth)),d=oh(Math.min(d,a,l.maxHeight)),u&&!d&&(d=oh(u/2)),(t!==void 0||n!==void 0)&&r&&l.height&&d>l.height&&(d=l.height,u=oh(Math.floor(d*r))),{width:u,height:d}}function OC(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 hH=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};hx()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function MC(e,t){const n=aH(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Ks(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function pH(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 gH(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},s=Ks(e,o,n),a=Ks(o,i,n),l=Ks(i,t,n),u=Ks(s,a,n),d=Ks(a,l,n);return Ks(u,d,n)}const mH=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}}},vH=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Pl(e,t,n){return e?mH(t,n):vH()}function qO(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 GO(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function YO(e){return e==="angle"?{between:Ku,compare:bB,normalize:mr}:{between:li,compare:(t,n)=>t-n,normalize:t=>t}}function DC({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 bH(e,t,n){const{property:r,start:o,end:i}=n,{between:s,normalize:a}=YO(r),l=t.length;let{start:u,end:d,loop:f}=e,p,g;if(f){for(u+=l,d+=l,p=0,g=l;p<g&&s(a(t[u%l][r]),o,i);++p)u--,d--;u%=l,d%=l}return d<u&&(d+=l),{start:u,end:d,loop:f,style:e.style}}function KO(e,t,n){if(!n)return[e];const{property:r,start:o,end:i}=n,s=t.length,{compare:a,between:l,normalize:u}=YO(r),{start:d,end:f,loop:p,style:g}=bH(e,t,n),b=[];let y=!1,x=null,_,w,C;const R=()=>l(o,C,_)&&a(o,C)!==0,E=()=>a(i,_)===0||l(i,C,_),T=()=>y||R(),O=()=>!y||E();for(let D=d,I=d;D<=f;++D)w=t[D%s],!w.skip&&(_=u(w[r]),_!==C&&(y=l(_,o,i),x===null&&T()&&(x=a(_,o)===0?D:I),x!==null&&O()&&(b.push(DC({start:x,end:D,loop:p,count:s,style:g})),x=null),I=D,C=_));return x!==null&&b.push(DC({start:x,end:f,loop:p,count:s,style:g})),b}function XO(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const i=KO(r[o],e.points,t);i.length&&n.push(...i)}return n}function yH(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 xH(e,t,n,r){const o=e.length,i=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const u=e[l%o];u.skip||u.stop?a.skip||(r=!1,i.push({start:t%o,end:(l-1)%o,loop:r}),t=s=u.stop?l:null):(s=l,a.skip&&(t=l)),a=u}return s!==null&&i.push({start:t%o,end:s%o,loop:r}),i}function wH(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:s,end:a}=yH(n,o,i,r);if(r===!0)return TC(e,[{start:s,end:a,loop:i}],n,t);const l=a<s?a+o:a,u=!!e._fullLoop&&s===0&&a===o-1;return TC(e,xH(n,s,l,u),n,t)}function TC(e,t,n,r){return!r||!r.setContext||!n?t:_H(e,t,n,r)}function _H(e,t,n,r){const o=e._chart.getContext(),i=AC(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,u=[];let d=i,f=t[0].start,p=f;function g(b,y,x,_){const w=a?-1:1;if(b!==y){for(b+=l;n[b%l].skip;)b-=w;for(;n[y%l].skip;)y+=w;b%l!==y%l&&(u.push({start:b%l,end:y%l,loop:x,style:_}),d=_,f=y%l)}}for(const b of t){f=a?f:b.start;let y=n[f%l],x;for(p=f+1;p<=b.end;p++){const _=n[p%l];x=AC(r.setContext(hs(o,{type:"segment",p0:y,p1:_,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:s}))),SH(x,d)&&g(f,p-1,b.loop,d),y=_,d=x}f<p-1&&g(f,p-1,b.loop,d)}return u}function AC(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function SH(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 CH{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=AO.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 ni=new CH;const IC="transparent",EH={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=CC(e||IC),o=r.valid&&CC(t||IC);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class RH{constructor(t,n,r,o){const i=n[r];o=Ft([t.to,o,i,t.from]);const s=Ft([t.from,i,o]);this._active=!0,this._fn=t.fn||EH[t.type||typeof s],this._easing=Eu[t.easing]||Eu.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=Ft([t.to,n,o,t.from]),this._from=Ft([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 QO{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!ut(t))return;const n=Object.keys(qt.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const i=t[o];if(!ut(i))return;const s={};for(const a of n)s[a]=i[a];(zt(i.properties)&&i.properties||[o]).forEach(a=>{(a===o||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,o=PH(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&$H(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 u=s[l];if(u.charAt(0)==="$")continue;if(u==="options"){o.push(...this._animateOptions(t,n));continue}const d=n[u];let f=i[u];const p=r.get(u);if(f)if(p&&f.active()){f.update(p,d,a);continue}else f.cancel();if(!p||!p.duration){t[u]=d;continue}i[u]=f=new RH(p,t,u,d),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 ni.add(this._chart,r),!0}}function $H(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 PH(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 kC(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 OH(e,t,n){if(n===!1)return!1;const r=kC(e,n),o=kC(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function MH(e){let t,n,r,o;return ut(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 ZO(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 NC(e,t,n,r={}){const o=e.keys,i=r.mode==="single";let s,a,l,u;if(t!==null){for(s=0,a=o.length;s<a;++s){if(l=+o[s],l===n){if(r.all)continue;break}u=e.values[l],Xt(u)&&(i||t===0||Ro(t)===Ro(u))&&(t+=u)}return t}}function DH(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 LC(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function TH(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function AH(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 IH(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function FC(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 zC(e,t){const{chart:n,_cachedMeta:r}=e,o=n._stacks||(n._stacks={}),{iScale:i,vScale:s,index:a}=r,l=i.axis,u=s.axis,d=TH(i,s,r),f=t.length;let p;for(let g=0;g<f;++g){const b=t[g],{[l]:y,[u]:x}=b,_=b._stacks||(b._stacks={});p=_[u]=IH(o,d,y),p[a]=x,p._top=FC(p,s,!0,r.type),p._bottom=FC(p,s,!1,r.type);const w=p._visualValues||(p._visualValues={});w[a]=x}}function kv(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function kH(e,t){return hs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function NH(e,t,n){return hs(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Zc(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 Nv=e=>e==="reset"||e==="none",jC=(e,t)=>t?e:Object.assign({},e),LH=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:ZO(n,!0),values:null};class ro{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=LC(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&&Zc(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(f,p,g,b)=>f==="x"?p:f==="r"?b:g,i=n.xAxisID=Ke(r.xAxisID,kv(t,"x")),s=n.yAxisID=Ke(r.yAxisID,kv(t,"y")),a=n.rAxisID=Ke(r.rAxisID,kv(t,"r")),l=n.indexAxis,u=n.iAxisID=o(l,i,s,a),d=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(u),n.vScale=this.getScaleForId(d)}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&&wC(this._data,this),t._stacked&&Zc(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(ut(n))this._data=DH(n);else if(r!==n){if(r){wC(r,this);const o=this._cachedMeta;Zc(o),o._parsed=[]}n&&Object.isExtensible(n)&&_B(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=LC(n.vScale,n),n.stack!==r.stack&&(o=!0,Zc(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&zC(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,u=t>0&&r._parsed[t-1],d,f,p;if(this._parsing===!1)r._parsed=o,r._sorted=!0,p=o;else{zt(o[t])?p=this.parseArrayData(r,o,t,n):ut(o[t])?p=this.parseObjectData(r,o,t,n):p=this.parsePrimitiveData(r,o,t,n);const g=()=>f[a]===null||u&&f[a]<u[a];for(d=0;d<n;++d)r._parsed[d+t]=f=p[d],l&&(g()&&(l=!1),u=f);r._sorted=l}s&&zC(this,p)}parsePrimitiveData(t,n,r,o){const{iScale:i,vScale:s}=t,a=i.axis,l=s.axis,u=i.getLabels(),d=i===s,f=new Array(o);let p,g,b;for(p=0,g=o;p<g;++p)b=p+r,f[p]={[a]:d||i.parse(u[b],b),[l]:s.parse(n[b],b)};return f}parseArrayData(t,n,r,o){const{xScale:i,yScale:s}=t,a=new Array(o);let l,u,d,f;for(l=0,u=o;l<u;++l)d=l+r,f=n[d],a[l]={x:i.parse(f[0],d),y:s.parse(f[1],d)};return a}parseObjectData(t,n,r,o){const{xScale:i,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=new Array(o);let d,f,p,g;for(d=0,f=o;d<f;++d)p=d+r,g=n[p],u[d]={x:i.parse(ss(g,a),p),y:s.parse(ss(g,l),p)};return u}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:ZO(o,!0),values:n._stacks[t.axis]._visualValues};return NC(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=NC(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=LH(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:f}=AH(a);let p,g;function b(){g=o[p];const y=g[a.axis];return!Xt(g[t.axis])||d>y||f<y}for(p=0;p<s&&!(!b()&&(this.updateRangeFromParsed(u,t,g,l),i));++p);if(i){for(p=s-1;p>=0;--p)if(!b()){this.updateRangeFromParsed(u,t,g,l);break}}return u}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],Xt(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=MH(Ke(this.options.clip,OH(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,u=this.options.drawActiveElementsOnTop;let d;for(r.dataset&&r.dataset.draw(t,i,a,l),d=a;d<a+l;++d){const f=o[d];f.hidden||(f.active&&u?s.push(f):f.draw(t,i))}for(d=0;d<s.length;++d)s[d].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=NH(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&&Yu(r);if(a)return jC(a,l);const u=this.chart.config,d=u.datasetElementScopeKeys(this._type,t),f=o?[`${t}Hover`,"hover",t,""]:[t,""],p=u.getOptionScopes(this.getDataset(),d),g=Object.keys(qt.elements[t]),b=()=>this.getContext(r,o,n),y=u.resolveNamedOptions(p,g,b,f);return y.$shared&&(y.$shared=l,i[s]=Object.freeze(jC(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 d=this.chart.config,f=d.datasetAnimationScopeKeys(this._type,n),p=d.getOptionScopes(this.getDataset(),f);l=d.createResolver(p,this.getContext(t,r,n))}const u=new QO(o,l&&l.animations);return l&&l._cacheable&&(i[s]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Nv(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){Nv(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!Nv(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,u]of this._syncList)this[a](l,u);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=u=>{for(u.length+=n,a=u.length-1;a>=s;a--)u[a]=u[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&&Zc(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])}}Ce(ro,"defaults",{}),Ce(ro,"datasetElementType",null),Ce(ro,"dataElementType",null);function FH(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=TO(r.sort((o,i)=>o-i))}return e._cache.$bar}function zH(e){const t=e.iScale,n=FH(t,e.type);let r=t._length,o,i,s,a;const l=()=>{s===32767||s===-32768||(Yu(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 jH(e,t,n,r){const o=n.barThickness;let i,s;return at(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 VH(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 u=i-(i-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:u}}function BH(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,u=a;Math.abs(s)>Math.abs(a)&&(l=a,u=s),t[n.axis]=u,t._custom={barStart:l,barEnd:u,start:o,end:i,min:s,max:a}}function JO(e,t,n,r){return zt(e)?BH(e,t,n,r):t[n.axis]=n.parse(e,r),t}function VC(e,t,n,r){const o=e.iScale,i=e.vScale,s=o.getLabels(),a=o===i,l=[];let u,d,f,p;for(u=n,d=n+r;u<d;++u)p=t[u],f={},f[o.axis]=a||o.parse(s[u],u),l.push(JO(p,f,i,u));return l}function Lv(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function HH(e,t,n){return e!==0?Ro(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function WH(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 UH(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:u,bottom:d}=WH(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=u:(n._bottom||0)===r?o=d:(i[BC(d,s,a,l)]=!0,o=u)),i[BC(o,s,a,l)]=!0,e.borderSkipped=i}function BC(e,t,n,r){return r?(e=qH(e,t,n),e=HC(e,n,t)):e=HC(e,t,n),e}function qH(e,t,n){return e===t?n:e===n?t:e}function HC(e,t,n){return e==="start"?t:e==="end"?n:e}function GH(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Fh extends ro{parsePrimitiveData(t,n,r,o){return VC(t,n,r,o)}parseArrayData(t,n,r,o){return VC(t,n,r,o)}parseObjectData(t,n,r,o){const{iScale:i,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=i.axis==="x"?a:l,d=s.axis==="x"?a:l,f=[];let p,g,b,y;for(p=r,g=r+o;p<g;++p)y=n[p],b={},b[i.axis]=i.parse(ss(y,u),p),f.push(JO(ss(y,d),b,s,p));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=Lv(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(),u=a.isHorizontal(),d=this._getRuler(),{sharedOptions:f,includeOptions:p}=this._getSharedOptions(n,o);for(let g=n;g<n+r;g++){const b=this.getParsed(g),y=i||at(b[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),x=this._calculateBarIndexPixels(g,d),_=(b._stacks||{})[a.axis],w={horizontal:u,base:y.base,enableBorderRadius:!_||Lv(b._custom)||s===_._top||s===_._bottom,x:u?y.head:x.center,y:u?x.center:y.head,height:u?x.size:Math.abs(y.size),width:u?Math.abs(y.size):x.size};p&&(w.options=f||this.resolveDataElementOptions(g,t[g].active?"active":o));const C=w.options||t[g].options;UH(w,C,_,s),GH(w,C,d.ratio),this.updateElement(t[g],g,w,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 u=l.controller.getParsed(n),d=u&&u[l.vScale.axis];if(at(d)||isNaN(d))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||zH(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),u=l._custom,d=Lv(u);let f=l[n.axis],p=0,g=r?this.applyStack(n,l,r):f,b,y;g!==f&&(p=g-f,g=f),d&&(f=u.barStart,g=u.barEnd-u.barStart,f!==0&&Ro(f)!==Ro(u.barEnd)&&(p=0),p+=f);const x=!at(i)&&!d?i:p;let _=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?b=n.getPixelForValue(p+g):b=_,y=b-_,Math.abs(y)<s){y=HH(y,n,a)*s,f===a&&(_-=y/2);const w=n.getPixelForDecimal(0),C=n.getPixelForDecimal(1),R=Math.min(w,C),E=Math.max(w,C);_=Math.max(Math.min(_,E),R),b=_+y,r&&!d&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(b)-n.getValueForPixel(_))}if(_===n.getPixelForValue(a)){const w=Ro(y)*n.getLineWidthForValue(a)/2;_+=w,y-=w}return{size:y,base:_,head:b,center:b+y/2}}_calculateBarIndexPixels(t,n){const r=n.scale,o=this.options,i=o.skipNull,s=Ke(o.maxBarThickness,1/0);let a,l;if(n.grouped){const u=i?this._getStackCount(t):n.stackCount,d=o.barThickness==="flex"?VH(t,n,o,u):jH(t,n,o,u),f=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0);a=d.start+d.chunk*f+d.chunk/2,l=Math.min(s,d.chunk*d.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)}}Ce(Fh,"id","bar"),Ce(Fh,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Ce(Fh,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class zh extends ro{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=Ke(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=Ke(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),u=s._custom;return{label:r[t]||"",value:"("+a+", "+l+(u?", "+u:"")+")"}}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:u}=this._getSharedOptions(n,o),d=s.axis,f=a.axis;for(let p=n;p<n+r;p++){const g=t[p],b=!i&&this.getParsed(p),y={},x=y[d]=i?s.getPixelForDecimal(.5):s.getPixelForValue(b[d]),_=y[f]=i?a.getBasePixel():a.getPixelForValue(b[f]);y.skip=isNaN(x)||isNaN(_),u&&(y.options=l||this.resolveDataElementOptions(p,g.active?"active":o),i&&(y.options.radius=0)),this.updateElement(g,p,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+=Ke(r&&r._custom,i),o}}Ce(zh,"id","bubble"),Ce(zh,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Ce(zh,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function YH(e,t,n){let r=1,o=1,i=0,s=0;if(t<jt){const a=e,l=a+t,u=Math.cos(a),d=Math.sin(a),f=Math.cos(l),p=Math.sin(l),g=(C,R,E)=>Ku(C,a,l,!0)?1:Math.max(R,R*n,E,E*n),b=(C,R,E)=>Ku(C,a,l,!0)?-1:Math.min(R,R*n,E,E*n),y=g(0,u,f),x=g(en,d,p),_=b(Vt,u,f),w=b(Vt+en,d,p);r=(y-_)/2,o=(x-w)/2,i=-(y+_)/2,s=-(x+w)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:s}}class ra extends ro{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(ut(r[t])){const{key:l="value"}=this._parsing;i=u=>+ss(r[u],l)}let s,a;for(s=t,a=t+n;s<a;++s)o._parsed[s]=i(s)}}_getRotation(){return no(this.options.rotation-90)}_getCircumference(){return no(this.options.circumference)}_getRotationExtents(){let t=jt,n=-jt;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(lB(this.options.cutout,a),1),u=this._getRingWeight(this.index),{circumference:d,rotation:f}=this._getRotationExtents(),{ratioX:p,ratioY:g,offsetX:b,offsetY:y}=YH(f,d,l),x=(r.width-s)/p,_=(r.height-s)/g,w=Math.max(Math.min(x,_)/2,0),C=$O(this.options.radius,w),R=Math.max(C*l,0),E=(C-R)/this._getVisibleDatasetWeightTotal();this.offsetX=b*C,this.offsetY=y*C,o.total=this.calculateTotal(),this.outerRadius=C-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*u,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/jt)}updateElements(t,n,r,o){const i=o==="reset",s=this.chart,a=s.chartArea,u=s.options.animation,d=(a.left+a.right)/2,f=(a.top+a.bottom)/2,p=i&&u.animateScale,g=p?0:this.innerRadius,b=p?0:this.outerRadius,{sharedOptions:y,includeOptions:x}=this._getSharedOptions(n,o);let _=this._getRotation(),w;for(w=0;w<n;++w)_+=this._circumference(w,i);for(w=n;w<n+r;++w){const C=this._circumference(w,i),R=t[w],E={x:d+this.offsetX,y:f+this.offsetY,startAngle:_,endAngle:_+C,circumference:C,outerRadius:b,innerRadius:g};x&&(E.options=y||this.resolveDataElementOptions(w,R.active?"active":o)),_+=C,this.updateElement(R,w,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)?jt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=kd(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(Ke(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Ce(ra,"id","doughnut"),Ce(ra,"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"}),Ce(ra,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Ce(ra,"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 jh extends ro{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}=kO(n,o,s);this._drawStart=a,this._drawCount=l,NO(n)&&(a=0,l=o.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!i._decimated,r.points=o;const u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:u},t),this.updateElements(o,a,l,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:u}=this._cachedMeta,{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,o),p=s.axis,g=a.axis,{spanGaps:b,segment:y}=this.options,x=oc(b)?b:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||i||o==="none",w=n+r,C=t.length;let R=n>0&&this.getParsed(n-1);for(let E=0;E<C;++E){const T=t[E],O=_?T:{};if(E<n||E>=w){O.skip=!0;continue}const D=this.getParsed(E),I=at(D[g]),N=O[p]=s.getPixelForValue(D[p],E),V=O[g]=i||I?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,D,l):D[g],E);O.skip=isNaN(N)||isNaN(V)||I,O.stop=E>0&&Math.abs(D[p]-R[p])>x,y&&(O.parsed=D,O.raw=u.data[E]),f&&(O.options=d||this.resolveDataElementOptions(E,T.active?"active":o)),_||this.updateElement(T,E,O,o),R=D}}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()}}Ce(jh,"id","line"),Ce(jh,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ce(jh,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class $u extends ro{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=kd(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return WO.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,u=this._cachedMeta.rScale,d=u.xCenter,f=u.yCenter,p=u.getIndexAngle(0)-.5*Vt;let g=p,b;const y=360/this.countVisibleElements();for(b=0;b<n;++b)g+=this._computeAngle(b,o,y);for(b=n;b<n+r;b++){const x=t[b];let _=g,w=g+this._computeAngle(b,o,y),C=s.getDataVisibility(b)?u.getDistanceFromCenterForValue(this.getParsed(b).r):0;g=w,i&&(l.animateScale&&(C=0),l.animateRotate&&(_=w=p));const R={x:d,y:f,innerRadius:0,outerRadius:C,startAngle:_,endAngle:w,options:this.resolveDataElementOptions(b,x.active?"active":o)};this.updateElement(x,b,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)?no(this.resolveDataElementOptions(t,n).angle||r):0}}Ce($u,"id","polarArea"),Ce($u,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Ce($u,"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 C0 extends ra{}Ce(C0,"id","pie"),Ce(C0,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Vh extends ro{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 WO.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],u=this.resolveDataElementOptions(a,l.active?"active":o),d=i.getPointPositionForValue(a,this.getParsed(a).r),f=s?i.xCenter:d.x,p=s?i.yCenter:d.y,g={x:f,y:p,angle:d.angle,skip:isNaN(f)||isNaN(p),options:u};this.updateElement(l,a,g,o)}}}Ce(Vh,"id","radar"),Ce(Vh,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Ce(Vh,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Bh extends ro{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}=kO(n,r,o);if(this._drawStart=i,this._drawCount=s,NO(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 u=this.resolveDatasetElementOptions(t);u.segment=this.options.segment,this.updateElement(a,void 0,{animated:!o,options:u},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:u}=this._cachedMeta,d=this.resolveDataElementOptions(n,o),f=this.getSharedOptions(d),p=this.includeOptions(o,f),g=s.axis,b=a.axis,{spanGaps:y,segment:x}=this.options,_=oc(y)?y:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||i||o==="none";let C=n>0&&this.getParsed(n-1);for(let R=n;R<n+r;++R){const E=t[R],T=this.getParsed(R),O=w?E:{},D=at(T[b]),I=O[g]=s.getPixelForValue(T[g],R),N=O[b]=i||D?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,T,l):T[b],R);O.skip=isNaN(I)||isNaN(N)||D,O.stop=R>0&&Math.abs(T[g]-C[g])>_,x&&(O.parsed=T,O.raw=u.data[R]),p&&(O.options=f||this.resolveDataElementOptions(R,E.active?"active":o)),w||this.updateElement(E,R,O,o),C=T}this.updateSharedOptions(f,o,d)}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}}Ce(Bh,"id","scatter"),Ce(Bh,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Ce(Bh,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var KH=Object.freeze({__proto__:null,BarController:Fh,BubbleController:zh,DoughnutController:ra,LineController:jh,PieController:C0,PolarAreaController:$u,RadarController:Vh,ScatterController:Bh});function Ws(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class gx{constructor(t){Ce(this,"options");this.options=t||{}}static override(t){Object.assign(gx.prototype,t)}init(){}formats(){return Ws()}parse(){return Ws()}format(){return Ws()}add(){return Ws()}diff(){return Ws()}startOf(){return Ws()}endOf(){return Ws()}}var XH={_date:gx};function QH(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?xB:ci;if(r){if(o._sharedOptions){const u=i[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const f=l(i,t,n-d),p=l(i,t,n+d);return{lo:f.lo,hi:p.hi}}}}else return l(i,t,n)}return{lo:0,hi:i.length-1}}function Nd(e,t,n,r,o){const i=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=i.length;a<l;++a){const{index:u,data:d}=i[a],{lo:f,hi:p}=QH(i[a],t,s,o);for(let g=f;g<=p;++g){const b=d[g];b.skip||r(b,u,g)}}}function ZH(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 Fv(e,t,n,r,o){const i=[];return!o&&!e.isPointInArea(t)||Nd(e,n,t,function(a,l,u){!o&&!ui(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&i.push({element:a,datasetIndex:l,index:u})},!0),i}function JH(e,t,n,r){let o=[];function i(s,a,l){const{startAngle:u,endAngle:d}=s.getProps(["startAngle","endAngle"],r),{angle:f}=MO(s,{x:t.x,y:t.y});Ku(f,u,d)&&o.push({element:s,datasetIndex:a,index:l})}return Nd(e,n,t,i),o}function eW(e,t,n,r,o,i){let s=[];const a=ZH(n);let l=Number.POSITIVE_INFINITY;function u(d,f,p){const g=d.inRange(t.x,t.y,o);if(r&&!g)return;const b=d.getCenterPoint(o);if(!(!!i||e.isPointInArea(b))&&!g)return;const x=a(t,b);x<l?(s=[{element:d,datasetIndex:f,index:p}],l=x):x===l&&s.push({element:d,datasetIndex:f,index:p})}return Nd(e,n,t,u),s}function zv(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?JH(e,t,n,o):eW(e,t,n,r,o,i)}function WC(e,t,n,r,o){const i=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return Nd(e,n,t,(l,u,d)=>{l[s](t[n],o)&&(i.push({element:l,datasetIndex:u,index:d}),a=a||l.inRange(t.x,t.y,o))}),r&&!a?[]:i}var tW={evaluateInteractionItems:Nd,modes:{index(e,t,n,r){const o=Ys(t,e),i=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?Fv(e,o,i,r,s):zv(e,o,i,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const d=a[0].index,f=u.data[d];f&&!f.skip&&l.push({element:f,datasetIndex:u.index,index:d})}),l):[]},dataset(e,t,n,r){const o=Ys(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?Fv(e,o,i,r,s):zv(e,o,i,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,u=e.getDatasetMeta(l).data;a=[];for(let d=0;d<u.length;++d)a.push({element:u[d],datasetIndex:l,index:d})}return a},point(e,t,n,r){const o=Ys(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return Fv(e,o,i,r,s)},nearest(e,t,n,r){const o=Ys(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return zv(e,o,i,n.intersect,r,s)},x(e,t,n,r){const o=Ys(t,e);return WC(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=Ys(t,e);return WC(e,o,"y",n.intersect,r)}}};const e2=["left","top","right","bottom"];function Jc(e,t){return e.filter(n=>n.pos===t)}function UC(e,t){return e.filter(n=>e2.indexOf(n.pos)===-1&&n.box.axis===t)}function eu(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 nW(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 rW(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!e2.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 oW(e,t){const n=rW(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,u=n[a.stack],d=u&&a.stackWeight/u.weight;a.horizontal?(a.width=d?d*r:l&&t.availableWidth,a.height=o):(a.width=r,a.height=d?d*o:l&&t.availableHeight)}return n}function iW(e){const t=nW(e),n=eu(t.filter(u=>u.box.fullSize),!0),r=eu(Jc(t,"left"),!0),o=eu(Jc(t,"right")),i=eu(Jc(t,"top"),!0),s=eu(Jc(t,"bottom")),a=UC(t,"x"),l=UC(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:Jc(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(s).concat(a)}}function qC(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function t2(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 sW(e,t,n,r){const{pos:o,box:i}=n,s=e.maxPadding;if(!ut(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&&t2(s,i.getPadding());const a=Math.max(0,t.outerWidth-qC(s,e,"left","right")),l=Math.max(0,t.outerHeight-qC(s,e,"top","bottom")),u=a!==e.w,d=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:u,other:d}:{same:d,other:u}}function aW(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 lW(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 mu(e,t,n,r){const o=[];let i,s,a,l,u,d;for(i=0,s=e.length,u=0;i<s;++i){a=e[i],l=a.box,l.update(a.width||t.w,a.height||t.h,lW(a.horizontal,t));const{same:f,other:p}=sW(t,n,a,r);u|=f&&o.length,d=d||p,l.fullSize||o.push(a)}return u&&mu(o,t,n,r)||d}function ih(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 GC(e,t,n,r){const o=n.padding;let{x:i,y:s}=t;for(const a of e){const l=a.box,u=r[a.stack]||{count:1,placed:0,weight:1},d=a.stackWeight/u.weight||1;if(a.horizontal){const f=t.w*d,p=u.size||l.height;Yu(u.start)&&(s=u.start),l.fullSize?ih(l,o.left,s,n.outerWidth-o.right-o.left,p):ih(l,t.left+u.placed,s,f,p),u.start=s,u.placed+=f,s=l.bottom}else{const f=t.h*d,p=u.size||l.width;Yu(u.start)&&(i=u.start),l.fullSize?ih(l,i,o.top,p,n.outerHeight-o.bottom-o.top):ih(l,i,t.top+u.placed,p,f),u.start=i,u.placed+=f,i=l.right}}t.x=i,t.y=s}var An={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=Cn(e.options.layout.padding),i=Math.max(t-o.width,0),s=Math.max(n-o.height,0),a=iW(e.boxes),l=a.vertical,u=a.horizontal;Ct(e.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const d=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/d,hBoxMaxHeight:s/2}),p=Object.assign({},o);t2(p,Cn(r));const g=Object.assign({maxPadding:p,w:i,h:s,x:o.left,y:o.top},o),b=oW(l.concat(u),f);mu(a.fullSize,g,f,b),mu(l,g,f,b),mu(u,g,f,b)&&mu(l,g,f,b),aW(g),GC(a.leftAndTop,g,f,b),g.x+=g.w,g.y+=g.h,GC(a.rightAndBottom,g,f,b),e.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},Ct(a.chartArea,y=>{const x=y.box;Object.assign(x,e.chartArea),x.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class n2{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 cW extends n2{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Hh="$chartjs",uW={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},YC=e=>e===null||e==="";function dW(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[Hh]={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",YC(o)){const i=MC(e,"width");i!==void 0&&(e.width=i)}if(YC(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=MC(e,"height");i!==void 0&&(e.height=i)}return e}const r2=hH?{passive:!0}:!1;function fW(e,t,n){e.addEventListener(t,n,r2)}function hW(e,t,n){e.canvas.removeEventListener(t,n,r2)}function pW(e,t){const n=uW[e.type]||e.type,{x:r,y:o}=Ys(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function bp(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function gW(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||bp(a.addedNodes,r),s=s&&!bp(a.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function mW(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||bp(a.removedNodes,r),s=s&&!bp(a.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const Qu=new Map;let KC=0;function o2(){const e=window.devicePixelRatio;e!==KC&&(KC=e,Qu.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function vW(e,t){Qu.size||window.addEventListener("resize",o2),Qu.set(e,t)}function bW(e){Qu.delete(e),Qu.size||window.removeEventListener("resize",o2)}function yW(e,t,n){const r=e.canvas,o=r&&px(r);if(!o)return;const i=IO((a,l)=>{const u=o.clientWidth;n(a,l),u<o.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],u=l.contentRect.width,d=l.contentRect.height;u===0&&d===0||i(u,d)});return s.observe(o),vW(e,i),s}function jv(e,t,n){n&&n.disconnect(),t==="resize"&&bW(e)}function xW(e,t,n){const r=e.canvas,o=IO(i=>{e.ctx!==null&&n(pW(i,e))},e);return fW(r,t,o),o}class wW extends n2{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(dW(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Hh])return!1;const r=n[Hh].initial;["height","width"].forEach(i=>{const s=r[i];at(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[Hh],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),s={attach:gW,detach:mW,resize:yW}[n]||xW;o[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:jv,detach:jv,resize:jv}[n]||hW)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return fH(t,n,r,o)}isAttached(t){const n=px(t);return!!(n&&n.isConnected)}}function _W(e){return!hx()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?cW:wW}var kh;let yi=(kh=class{constructor(){Ce(this,"x");Ce(this,"y");Ce(this,"active",!1);Ce(this,"options");Ce(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return oc(this.x)&&oc(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}},Ce(kh,"defaults",{}),Ce(kh,"defaultRoutes"),kh);function SW(e,t){const n=e.options.ticks,r=CW(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?RW(t):[],s=i.length,a=i[0],l=i[s-1],u=[];if(s>o)return $W(t,u,i,s/o),u;const d=EW(i,t,o);if(s>0){let f,p;const g=s>1?Math.round((l-a)/(s-1)):null;for(sh(t,u,d,at(g)?0:a-g,a),f=0,p=s-1;f<p;f++)sh(t,u,d,i[f],i[f+1]);return sh(t,u,d,l,at(g)?t.length:l+g),u}return sh(t,u,d),u}function CW(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 EW(e,t,n){const r=PW(e),o=t.length/n;if(!r)return Math.max(o,1);const i=mB(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 RW(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function $W(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 sh(e,t,n,r,o){const i=Ke(r,0),s=Math.min(Ke(o,e.length),e.length);let a=0,l,u,d;for(n=Math.ceil(n),o&&(l=o-r,n=l/Math.floor(l/n)),d=i;d<0;)a++,d=Math.round(i+a*n);for(u=Math.max(i,0);u<s;u++)u===d&&(t.push(e[u]),a++,d=Math.round(i+a*n))}function PW(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 OW=e=>e==="left"?"right":e==="right"?"left":e,XC=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,QC=(e,t)=>Math.min(t||e,e);function ZC(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 MW(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),u;if(!(n&&(r===1?u=Math.max(l-i,s-l):t===0?u=(e.getPixelForTick(1)-l)/2:u=(l-e.getPixelForTick(o-1))/2,l+=o<t?u:-u,l<i-a||l>s+a)))return l}function DW(e,t){Ct(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 tu(e){return e.drawTicks?e.tickLength:0}function JC(e,t){if(!e.display)return 0;const n=tn(e.font,t),r=Cn(e.padding);return(zt(e.text)?e.text.length:1)*n.lineHeight+r.height}function TW(e,t){return hs(e,{scale:t,type:"scale"})}function AW(e,t,n){return hs(e,{tick:n,index:t,type:"tick"})}function IW(e,t,n){let r=ax(e);return(n&&t!=="right"||!n&&t==="right")&&(r=OW(r)),r}function kW(e,t,n,r){const{top:o,left:i,bottom:s,right:a,chart:l}=e,{chartArea:u,scales:d}=l;let f=0,p,g,b;const y=s-o,x=a-i;if(e.isHorizontal()){if(g=Dn(r,i,a),ut(n)){const _=Object.keys(n)[0],w=n[_];b=d[_].getPixelForValue(w)+y-t}else n==="center"?b=(u.bottom+u.top)/2+y-t:b=XC(e,n,t);p=a-i}else{if(ut(n)){const _=Object.keys(n)[0],w=n[_];g=d[_].getPixelForValue(w)-x+t}else n==="center"?g=(u.left+u.right)/2-x+t:g=XC(e,n,t);b=Dn(r,s,o),f=n==="left"?-en:en}return{titleX:g,titleY:b,maxWidth:p,rotation:f}}class Na extends yi{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=fr(t,Number.POSITIVE_INFINITY),n=fr(n,Number.NEGATIVE_INFINITY),r=fr(r,Number.POSITIVE_INFINITY),o=fr(o,Number.NEGATIVE_INFINITY),{min:fr(t,r),max:fr(n,o),minDefined:Xt(t),maxDefined:Xt(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,u=a.length;l<u;++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:fr(n,fr(r,n)),max:fr(r,fr(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(){Pt(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=WB(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?ZC(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=SW(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(){Pt(this.options.afterUpdate,[this])}beforeSetDimensions(){Pt(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(){Pt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Pt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Pt(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=Pt(n.callback,[i.value,r,t],this)}afterTickToLabelConversion(){Pt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Pt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=QC(this.ticks.length,t.ticks.maxTicksLimit),o=n.minRotation||0,i=n.maxRotation;let s=o,a,l,u;if(!this._isVisible()||!n.display||o>=i||r<=1||!this.isHorizontal()){this.labelRotation=o;return}const d=this._getLabelSizes(),f=d.widest.width,p=d.highest.height,g=gn(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:g/(r-1),f+6>a&&(a=g/(r-(t.offset?.5:1)),l=this.maxHeight-tu(t.grid)-n.padding-JC(t.title,this.chart.options.font),u=Math.sqrt(f*f+p*p),s=ix(Math.min(Math.asin(gn((d.highest.height+6)/a,-1,1)),Math.asin(gn(l/u,-1,1))-Math.asin(gn(p/u,-1,1)))),s=Math.max(o,Math.min(i,s))),this.labelRotation=s}afterCalculateLabelRotation(){Pt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Pt(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=JC(o,n.options.font);if(a?(t.width=this.maxWidth,t.height=tu(i)+l):(t.height=this.maxHeight,t.width=tu(i)+l),r.display&&this.ticks.length){const{first:u,last:d,widest:f,highest:p}=this._getLabelSizes(),g=r.padding*2,b=no(this.labelRotation),y=Math.cos(b),x=Math.sin(b);if(a){const _=r.mirror?0:x*f.width+y*p.height;t.height=Math.min(this.maxHeight,t.height+_+g)}else{const _=r.mirror?0:y*f.width+x*p.height;t.width=Math.min(this.maxWidth,t.width+_+g)}this._calculatePadding(u,d,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,u=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let p=0,g=0;l?u?(p=o*t.width,g=r*n.height):(p=r*t.height,g=o*n.width):i==="start"?g=n.width:i==="end"?p=t.width:i!=="inner"&&(p=t.width/2,g=n.width/2),this.paddingLeft=Math.max((p-d+s)*this.width/(this.width-d),0),this.paddingRight=Math.max((g-f+s)*this.width/(this.width-f),0)}else{let d=n.height/2,f=t.height/2;i==="start"?(d=0,f=t.height):i==="end"&&(d=n.height,f=0),this.paddingTop=d+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(){Pt(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++)at(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=ZC(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/QC(n,r));let u=0,d=0,f,p,g,b,y,x,_,w,C,R,E;for(f=0;f<n;f+=l){if(b=t[f].label,y=this._resolveTickFontOptions(f),o.font=x=y.string,_=i[x]=i[x]||{data:{},gc:[]},w=y.lineHeight,C=R=0,!at(b)&&!zt(b))C=mp(o,_.data,_.gc,C,b),R=w;else if(zt(b))for(p=0,g=b.length;p<g;++p)E=b[p],!at(E)&&!zt(E)&&(C=mp(o,_.data,_.gc,C,E),R+=w);s.push(C),a.push(R),u=Math.max(C,u),d=Math.max(R,d)}DW(i,n);const T=s.indexOf(u),O=a.indexOf(d),D=I=>({width:s[I]||0,height:a[I]||0});return{first:D(0),last:D(n-1),widest:D(T),highest:D(O),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 yB(this._alignToPixels?Hs(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=AW(this.getContext(),t,r))}return this.$context||(this.$context=TW(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=no(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,u=this.isHorizontal(),f=this.ticks.length+(l?1:0),p=tu(i),g=[],b=a.setContext(this.getContext()),y=b.display?b.width:0,x=y/2,_=function(Z){return Hs(r,Z,y)};let w,C,R,E,T,O,D,I,N,V,G,le;if(s==="top")w=_(this.bottom),O=this.bottom-p,I=w-x,V=_(t.top)+x,le=t.bottom;else if(s==="bottom")w=_(this.top),V=t.top,le=_(t.bottom)-x,O=w+x,I=this.top+p;else if(s==="left")w=_(this.right),T=this.right-p,D=w-x,N=_(t.left)+x,G=t.right;else if(s==="right")w=_(this.left),N=t.left,G=_(t.right)-x,T=w+x,D=this.left+p;else if(n==="x"){if(s==="center")w=_((t.top+t.bottom)/2+.5);else if(ut(s)){const Z=Object.keys(s)[0],Y=s[Z];w=_(this.chart.scales[Z].getPixelForValue(Y))}V=t.top,le=t.bottom,O=w+x,I=O+p}else if(n==="y"){if(s==="center")w=_((t.left+t.right)/2);else if(ut(s)){const Z=Object.keys(s)[0],Y=s[Z];w=_(this.chart.scales[Z].getPixelForValue(Y))}T=w-x,D=T-p,N=t.left,G=t.right}const ee=Ke(o.ticks.maxTicksLimit,f),F=Math.max(1,Math.ceil(f/ee));for(C=0;C<f;C+=F){const Z=this.getContext(C),Y=i.setContext(Z),Q=a.setContext(Z),ae=Y.lineWidth,j=Y.color,B=Q.dash||[],te=Q.dashOffset,ce=Y.tickWidth,ue=Y.tickColor,ge=Y.tickBorderDash||[],ve=Y.tickBorderDashOffset;R=MW(this,C,l),R!==void 0&&(E=Hs(r,R,ae),u?T=D=N=G=E:O=I=V=le=E,g.push({tx1:T,ty1:O,tx2:D,ty2:I,x1:N,y1:V,x2:G,y2:le,width:ae,color:j,borderDash:B,borderDashOffset:te,tickWidth:ce,tickColor:ue,tickBorderDash:ge,tickBorderDashOffset:ve}))}return this._ticksLength=f,this._borderValue=w,g}_computeLabelItems(t){const n=this.axis,r=this.options,{position:o,ticks:i}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:u,padding:d,mirror:f}=i,p=tu(r.grid),g=p+d,b=f?-d:g,y=-no(this.labelRotation),x=[];let _,w,C,R,E,T,O,D,I,N,V,G,le="middle";if(o==="top")T=this.bottom-b,O=this._getXAxisLabelAlignment();else if(o==="bottom")T=this.top+b,O=this._getXAxisLabelAlignment();else if(o==="left"){const F=this._getYAxisLabelAlignment(p);O=F.textAlign,E=F.x}else if(o==="right"){const F=this._getYAxisLabelAlignment(p);O=F.textAlign,E=F.x}else if(n==="x"){if(o==="center")T=(t.top+t.bottom)/2+g;else if(ut(o)){const F=Object.keys(o)[0],Z=o[F];T=this.chart.scales[F].getPixelForValue(Z)+g}O=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")E=(t.left+t.right)/2-g;else if(ut(o)){const F=Object.keys(o)[0],Z=o[F];E=this.chart.scales[F].getPixelForValue(Z)}O=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(l==="start"?le="top":l==="end"&&(le="bottom"));const ee=this._getLabelSizes();for(_=0,w=a.length;_<w;++_){C=a[_],R=C.label;const F=i.setContext(this.getContext(_));D=this.getPixelForTick(_)+i.labelOffset,I=this._resolveTickFontOptions(_),N=I.lineHeight,V=zt(R)?R.length:1;const Z=V/2,Y=F.color,Q=F.textStrokeColor,ae=F.textStrokeWidth;let j=O;s?(E=D,O==="inner"&&(_===w-1?j=this.options.reverse?"left":"right":_===0?j=this.options.reverse?"right":"left":j="center"),o==="top"?u==="near"||y!==0?G=-V*N+N/2:u==="center"?G=-ee.highest.height/2-Z*N+N:G=-ee.highest.height+N/2:u==="near"||y!==0?G=N/2:u==="center"?G=ee.highest.height/2-Z*N:G=ee.highest.height-V*N,f&&(G*=-1),y!==0&&!F.showLabelBackdrop&&(E+=N/2*Math.sin(y))):(T=D,G=(1-V)*N/2);let B;if(F.showLabelBackdrop){const te=Cn(F.backdropPadding),ce=ee.heights[_],ue=ee.widths[_];let ge=G-te.top,ve=0-te.left;switch(le){case"middle":ge-=ce/2;break;case"bottom":ge-=ce;break}switch(O){case"center":ve-=ue/2;break;case"right":ve-=ue;break;case"inner":_===w-1?ve-=ue:_>0&&(ve-=ue/2);break}B={left:ve,top:ge,width:ue+te.width,height:ce+te.height,color:F.backdropColor}}x.push({label:R,font:I,textOffset:G,options:{rotation:y,color:Y,strokeColor:Q,strokeWidth:ae,textAlign:j,textBaseline:le,translation:[E,T],backdrop:B}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-no(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 u,d;return n==="left"?o?(d=this.right+i,r==="near"?u="left":r==="center"?(u="center",d+=l/2):(u="right",d+=l)):(d=this.right-a,r==="near"?u="right":r==="center"?(u="center",d-=l/2):(u="left",d=this.left)):n==="right"?o?(d=this.left+i,r==="near"?u="right":r==="center"?(u="center",d-=l/2):(u="left",d-=l)):(d=this.left+a,r==="near"?u="left":r==="center"?(u="center",d+=l/2):(u="right",d=this.right)):u="right",{textAlign:u,x:d}}_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,u,d)=>{!d.width||!d.color||(r.save(),r.lineWidth=d.width,r.strokeStyle=d.color,r.setLineDash(d.borderDash||[]),r.lineDashOffset=d.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(u.x,u.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 u,d,f,p;this.isHorizontal()?(u=Hs(t,this.left,s)-s/2,d=Hs(t,this.right,a)+a/2,f=p=l):(f=Hs(t,this.top,s)-s/2,p=Hs(t,this.bottom,a)+a/2,u=d=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(u,f),n.lineTo(d,p),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,o=this._computeLabelArea();o&&pg(r,o);const i=this.getLabelItems(t);for(const s of i){const a=s.options,l=s.font,u=s.label,d=s.textOffset;Ra(r,u,0,d,l,a)}o&&gg(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=tn(r.font),s=Cn(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||ut(n)?(l+=s.bottom,zt(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:u,titleY:d,maxWidth:f,rotation:p}=kW(this,l,n,a);Ra(t,r.text,0,0,i,{color:r.color,maxWidth:f,rotation:p,textAlign:IW(a,n,o),textBaseline:"middle",translation:[u,d]})}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=Ke(t.grid&&t.grid.z,-1),o=Ke(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Na.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 tn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ah{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;FW(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,NW(t,s,r),this.override&&qt.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 qt[o]&&(delete qt[o][r],this.override&&delete Ea[r])}}function NW(e,t,n){const r=Mo(Object.create(null),[n?qt.get(n):{},qt.get(t),e.defaults]);qt.set(t,r),e.defaultRoutes&&LW(t,e.defaultRoutes),e.descriptors&&qt.describe(t,e.descriptors)}function LW(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(".");qt.route(i,o,l,a)})}function FW(e){return"id"in e&&"defaults"in e}class zW{constructor(){this.controllers=new ah(ro,"datasets",!0),this.elements=new ah(yi,"elements"),this.plugins=new ah(Object,"plugins"),this.scales=new ah(Na,"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):Ct(o,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const o=ox(t);Pt(r["before"+o],[],r),n[t](r),Pt(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 bo=new zW;class jW{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(Pt(a,l,s)===!1&&o.cancelable)return!1}return!0}invalidate(){at(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=Ke(r.options&&r.options.plugins,{}),i=VW(r);return o===!1&&!n?[]:HW(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 VW(e){const t={},n=[],r=Object.keys(bo.plugins.items);for(let i=0;i<r.length;i++)n.push(bo.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 BW(e,t){return!t&&e===!1?null:e===!0?{}:e}function HW(e,{plugins:t,localIds:n},r,o){const i=[],s=e.getContext();for(const a of t){const l=a.id,u=BW(r[l],o);u!==null&&i.push({plugin:a,options:WW(e.config,{plugin:a,local:n[l]},u,s)})}return i}function WW(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 E0(e,t){const n=qt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function UW(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function qW(e,t){return e===t?"_index_":"_value_"}function eE(e){if(e==="x"||e==="y"||e==="r")return e}function GW(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function R0(e,...t){if(eE(e))return e;for(const n of t){const r=n.axis||GW(n.position)||e.length>1&&eE(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function tE(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function YW(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 tE(e,"x",n[0])||tE(e,"y",n[0])}return{}}function KW(e,t){const n=Ea[e.type]||{scales:{}},r=t.scales||{},o=E0(e.type,t),i=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!ut(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=R0(s,a,YW(s,e),qt.scales[a.type]),u=qW(l,o),d=n.scales||{};i[s]=Su(Object.create(null),[{axis:l},a,d[l],d[u]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||E0(a,t),d=(Ea[a]||{}).scales||{};Object.keys(d).forEach(f=>{const p=UW(f,l),g=s[p+"AxisID"]||p;i[g]=i[g]||Object.create(null),Su(i[g],[{axis:p},r[g],d[f]])})}),Object.keys(i).forEach(s=>{const a=i[s];Su(a,[qt.scales[a.type],qt.scale])}),i}function i2(e){const t=e.options||(e.options={});t.plugins=Ke(t.plugins,{}),t.scales=KW(e,t)}function s2(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function XW(e){return e=e||{},e.data=s2(e.data),i2(e),e}const nE=new Map,a2=new Set;function lh(e,t){let n=nE.get(e);return n||(n=t(),nE.set(e,n),a2.add(n)),n}const nu=(e,t,n)=>{const r=ss(t,n);r!==void 0&&e.add(r)};class QW{constructor(t){this._config=XW(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=s2(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(),i2(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return lh(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return lh(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return lh(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return lh(`${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(d=>{t&&(l.add(t),d.forEach(f=>nu(l,t,f))),d.forEach(f=>nu(l,o,f)),d.forEach(f=>nu(l,Ea[i]||{},f)),d.forEach(f=>nu(l,qt,f)),d.forEach(f=>nu(l,_0,f))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),a2.has(n)&&s.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,Ea[n]||{},qt.datasets[n]||{},{type:n},qt,_0]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:a}=rE(this._resolverCache,t,o);let l=s;if(JW(s,n)){i.$shared=!1,r=as(r)?r():r;const u=this.createResolver(t,r,a);l=ic(s,r,u)}for(const u of n)i[u]=l[u];return i}createResolver(t,n,r=[""],o){const{resolver:i}=rE(this._resolverCache,t,r);return ut(n)?ic(i,n,void 0,o):i}}function rE(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:ux(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(o,i)),i}const ZW=e=>ut(e)&&Object.getOwnPropertyNames(e).some(t=>as(e[t]));function JW(e,t){const{isScriptable:n,isIndexable:r}=jO(e);for(const o of t){const i=n(o),s=r(o),a=(s||i)&&e[o];if(i&&(as(a)||ZW(a))||s&&zt(a))return!0}return!1}var eU="4.4.1";const tU=["top","bottom","left","right","chartArea"];function oE(e,t){return e==="top"||e==="bottom"||tU.indexOf(e)===-1&&t==="x"}function iE(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function sE(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Pt(n&&n.onComplete,[e],t)}function nU(e){const t=e.chart,n=t.options.animation;Pt(n&&n.onProgress,[e],t)}function l2(e){return hx()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Wh={},aE=e=>{const t=l2(e);return Object.values(Wh).filter(n=>n.canvas===t).pop()};function rU(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 oU(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function ch(e,t,n){return e.options.clip?e[n]:t[n]}function iU(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:ch(n,t,"left"),right:ch(n,t,"right"),top:ch(r,t,"top"),bottom:ch(r,t,"bottom")}:t}class Vr{static register(...t){bo.add(...t),lE()}static unregister(...t){bo.remove(...t),lE()}constructor(t,n){const r=this.config=new QW(n),o=l2(t),i=aE(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||_W(o)),this.platform.updateConfig(r);const a=this.platform.acquireContext(o,s.aspectRatio),l=a&&a.canvas,u=l&&l.height,d=l&&l.width;if(this.id=aB(),this.ctx=a,this.canvas=l,this.width=d,this.height=u,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 jW,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=SB(f=>this.update(f),s.resizeDelay||0),this._dataChanges=[],Wh[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}ni.listen(this,"complete",sE),ni.listen(this,"progress",nU),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return at(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 bo}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():OC(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return RC(this.canvas,this.ctx),this}stop(){return ni.stop(this),this}resize(t,n){ni.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,OC(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),Pt(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Ct(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=R0(s,a),u=l==="r",d=l==="x";return{options:a,dposition:u?"chartArea":d?"bottom":"left",dtype:u?"radialLinear":d?"category":"linear"}}))),Ct(i,s=>{const a=s.options,l=a.id,u=R0(l,a),d=Ke(a.type,s.dtype);(a.position===void 0||oE(a.position,u)!==oE(s.dposition))&&(a.position=s.dposition),o[l]=!0;let f=null;if(l in r&&r[l].type===d)f=r[l];else{const p=bo.getScale(d);f=new p({id:l,type:d,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),Ct(o,(s,a)=>{s||delete r[a]}),Ct(r,s=>{An.configure(this,s,s.options),An.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(iE("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||E0(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=bo.getController(a),{datasetElementType:u,dataElementType:d}=qt.datasets[a];Object.assign(l,{dataElementType:bo.getElement(d),datasetElementType:u&&bo.getElement(u)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Ct(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 u=0,d=this.data.datasets.length;u<d;u++){const{controller:f}=this.getDatasetMeta(u),p=!o&&i.indexOf(f)===-1;f.buildOrUpdateElements(p),s=Math.max(+f.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),o||Ct(i,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(iE("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Ct(this.scales,t=>{An.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!vC(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;rU(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(!vC(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;An.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Ct(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,as(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&&(ni.has(this)?this.attached&&!ni.running(this)&&ni.start(this):(this.draw(),sE({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=iU(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(o&&pg(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&&gg(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return ui(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=tW.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=hs(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);Yu(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(),ni.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(),RC(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Wh[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)};Ct(this.options.events,i=>r(i,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,u)=>{n.addEventListener(this,l,u),t[l]=u},o=(l,u)=>{t[l]&&(n.removeEventListener(this,l,u),delete t[l])},i=(l,u)=>{this.canvas&&this.resize(l,u)};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(){Ct(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Ct(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 u=s&&this.getDatasetMeta(s.datasetIndex).controller;u&&u[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}});!hp(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,u)=>l.filter(d=>!u.some(f=>d.datasetIndex===f.datasetIndex&&d.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=hB(t),u=oU(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Pt(i.onHover,[t,a,this],this),l&&Pt(i.onClick,[t,a,this],this));const d=!hp(a,o);return(d||n)&&(this._active=a,this._updateHoverStyles(a,o,n)),this._lastEvent=u,d}_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)}}Ce(Vr,"defaults",qt),Ce(Vr,"instances",Wh),Ce(Vr,"overrides",Ea),Ce(Vr,"registry",bo),Ce(Vr,"version",eU),Ce(Vr,"getChart",aE);function lE(){return Ct(Vr.instances,e=>e._plugins.invalidate())}function sU(e,t,n){const{startAngle:r,pixelMargin:o,x:i,y:s,outerRadius:a,innerRadius:l}=t;let u=o/a;e.beginPath(),e.arc(i,s,a,r-u,n+u),l>o?(u=o/l,e.arc(i,s,l,n+u,r-u,!0)):e.arc(i,s,o,n+en,r-en),e.closePath(),e.clip()}function aU(e){return cx(e,["outerStart","outerEnd","innerStart","innerEnd"])}function lU(e,t,n,r){const o=aU(e.options.borderRadius),i=(n-t)/2,s=Math.min(i,r*t/2),a=l=>{const u=(n-Math.min(i,l))*r/2;return gn(l,0,Math.min(i,u))};return{outerStart:a(o.outerStart),outerEnd:a(o.outerEnd),innerStart:gn(o.innerStart,0,s),innerEnd:gn(o.innerEnd,0,s)}}function cl(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function yp(e,t,n,r,o,i){const{x:s,y:a,startAngle:l,pixelMargin:u,innerRadius:d}=t,f=Math.max(t.outerRadius+r+n-u,0),p=d>0?d+r+n+u:0;let g=0;const b=o-l;if(r){const F=d>0?d-r:0,Z=f>0?f-r:0,Y=(F+Z)/2,Q=Y!==0?b*Y/(Y+r):b;g=(b-Q)/2}const y=Math.max(.001,b*f-n/Vt)/f,x=(b-y)/2,_=l+x+g,w=o-x-g,{outerStart:C,outerEnd:R,innerStart:E,innerEnd:T}=lU(t,p,f,w-_),O=f-C,D=f-R,I=_+C/O,N=w-R/D,V=p+E,G=p+T,le=_+E/V,ee=w-T/G;if(e.beginPath(),i){const F=(I+N)/2;if(e.arc(s,a,f,I,F),e.arc(s,a,f,F,N),R>0){const ae=cl(D,N,s,a);e.arc(ae.x,ae.y,R,N,w+en)}const Z=cl(G,w,s,a);if(e.lineTo(Z.x,Z.y),T>0){const ae=cl(G,ee,s,a);e.arc(ae.x,ae.y,T,w+en,ee+Math.PI)}const Y=(w-T/p+(_+E/p))/2;if(e.arc(s,a,p,w-T/p,Y,!0),e.arc(s,a,p,Y,_+E/p,!0),E>0){const ae=cl(V,le,s,a);e.arc(ae.x,ae.y,E,le+Math.PI,_-en)}const Q=cl(O,_,s,a);if(e.lineTo(Q.x,Q.y),C>0){const ae=cl(O,I,s,a);e.arc(ae.x,ae.y,C,_-en,I)}}else{e.moveTo(s,a);const F=Math.cos(I)*f+s,Z=Math.sin(I)*f+a;e.lineTo(F,Z);const Y=Math.cos(N)*f+s,Q=Math.sin(N)*f+a;e.lineTo(Y,Q)}e.closePath()}function cU(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a}=t;let l=t.endAngle;if(i){yp(e,t,n,r,l,o);for(let u=0;u<i;++u)e.fill();isNaN(a)||(l=s+(a%jt||jt))}return yp(e,t,n,r,l,o),e.fill(),l}function uU(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a,options:l}=t,{borderWidth:u,borderJoinStyle:d,borderDash:f,borderDashOffset:p}=l,g=l.borderAlign==="inner";if(!u)return;e.setLineDash(f||[]),e.lineDashOffset=p,g?(e.lineWidth=u*2,e.lineJoin=d||"round"):(e.lineWidth=u,e.lineJoin=d||"bevel");let b=t.endAngle;if(i){yp(e,t,n,r,b,o);for(let y=0;y<i;++y)e.stroke();isNaN(a)||(b=s+(a%jt||jt))}g&&sU(e,t,b),i||(yp(e,t,n,r,b,o),e.stroke())}class Cl extends yi{constructor(n){super();Ce(this,"circumference");Ce(this,"endAngle");Ce(this,"fullCircles");Ce(this,"innerRadius");Ce(this,"outerRadius");Ce(this,"pixelMargin");Ce(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}=MO(i,{x:n,y:r}),{startAngle:l,endAngle:u,innerRadius:d,outerRadius:f,circumference:p}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),g=(this.options.spacing+this.options.borderWidth)/2,y=Ke(p,u-l)>=jt||Ku(s,l,u),x=li(a,d+g,f+g);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:u,spacing:d}=this.options,f=(i+s)/2,p=(a+l+d+u)/2;return{x:r+Math.cos(f)*p,y:o+Math.sin(f)*p}}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>jt?Math.floor(o/jt):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 u=1-Math.sin(Math.min(Vt,o||0)),d=i*u;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,cU(n,this,d,s,a),uU(n,this,d,s,a),n.restore()}}Ce(Cl,"id","arc"),Ce(Cl,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Ce(Cl,"defaultRoutes",{backgroundColor:"backgroundColor"}),Ce(Cl,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function c2(e,t,n=t){e.lineCap=Ke(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Ke(n.borderDash,t.borderDash)),e.lineDashOffset=Ke(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Ke(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ke(n.borderWidth,t.borderWidth),e.strokeStyle=Ke(n.borderColor,t.borderColor)}function dU(e,t,n){e.lineTo(n.x,n.y)}function fU(e){return e.stepped?kB:e.tension||e.cubicInterpolationMode==="monotone"?NB:dU}function u2(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),u=Math.min(i,a),d=o<s&&i<s||o>a&&i>a;return{count:r,start:l,loop:t.loop,ilen:u<l&&!d?r+u-l:u-l}}function hU(e,t,n,r){const{points:o,options:i}=t,{count:s,start:a,loop:l,ilen:u}=u2(o,n,r),d=fU(i);let{move:f=!0,reverse:p}=r||{},g,b,y;for(g=0;g<=u;++g)b=o[(a+(p?u-g:g))%s],!b.skip&&(f?(e.moveTo(b.x,b.y),f=!1):d(e,y,b,p,i.stepped),y=b);return l&&(b=o[(a+(p?u:0))%s],d(e,y,b,p,i.stepped)),!!l}function pU(e,t,n,r){const o=t.points,{count:i,start:s,ilen:a}=u2(o,n,r),{move:l=!0,reverse:u}=r||{};let d=0,f=0,p,g,b,y,x,_;const w=R=>(s+(u?a-R:R))%i,C=()=>{y!==x&&(e.lineTo(d,x),e.lineTo(d,y),e.lineTo(d,_))};for(l&&(g=o[w(0)],e.moveTo(g.x,g.y)),p=0;p<=a;++p){if(g=o[w(p)],g.skip)continue;const R=g.x,E=g.y,T=R|0;T===b?(E<y?y=E:E>x&&(x=E),d=(f*d+R)/++f):(C(),e.lineTo(R,E),b=T,f=0,y=x=E),_=E}C()}function $0(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?pU:hU}function gU(e){return e.stepped?pH:e.tension||e.cubicInterpolationMode==="monotone"?gH:Ks}function mU(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),c2(e,t.options),e.stroke(o)}function vU(e,t,n,r){const{segments:o,options:i}=t,s=$0(t);for(const a of o)c2(e,i,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const bU=typeof Path2D=="function";function yU(e,t,n,r){bU&&!t.options.segment?mU(e,t,n,r):vU(e,t,n,r)}class Qi extends yi{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;sH(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=wH(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=XO(this,{property:n,start:o,end:o});if(!s.length)return;const a=[],l=gU(r);let u,d;for(u=0,d=s.length;u<d;++u){const{start:f,end:p}=s[u],g=i[f],b=i[p];if(g===b){a.push(g);continue}const y=Math.abs((o-g[n])/(b[n]-g[n])),x=l(g,b,y,r.stepped);x[n]=t[n],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,n,r){return $0(this)(t,this,n,r)}path(t,n,r){const o=this.segments,i=$0(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(),yU(t,this,r,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ce(Qi,"id","line"),Ce(Qi,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Ce(Qi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Ce(Qi,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function cE(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class Pu extends yi{constructor(n){super();Ce(this,"parsed");Ce(this,"skip");Ce(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 cE(this,n,"x",r)}inYRange(n,r){return cE(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||!ui(this,r,this.size(o)/2)||(n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.fillStyle=o.backgroundColor,S0(n,o,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Ce(Pu,"id","point"),Ce(Pu,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Ce(Pu,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function d2(e,t){const{x:n,y:r,base:o,width:i,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,u,d,f;return e.horizontal?(f=s/2,a=Math.min(n,o),l=Math.max(n,o),u=r-f,d=r+f):(f=i/2,a=n-f,l=n+f,u=Math.min(r,o),d=Math.max(r,o)),{left:a,top:u,right:l,bottom:d}}function Zi(e,t,n,r){return e?0:gn(t,n,r)}function xU(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=zO(r);return{t:Zi(o.top,i.top,0,n),r:Zi(o.right,i.right,0,t),b:Zi(o.bottom,i.bottom,0,n),l:Zi(o.left,i.left,0,t)}}function wU(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=ga(o),s=Math.min(t,n),a=e.borderSkipped,l=r||ut(o);return{topLeft:Zi(!l||a.top||a.left,i.topLeft,0,s),topRight:Zi(!l||a.top||a.right,i.topRight,0,s),bottomLeft:Zi(!l||a.bottom||a.left,i.bottomLeft,0,s),bottomRight:Zi(!l||a.bottom||a.right,i.bottomRight,0,s)}}function _U(e){const t=d2(e),n=t.right-t.left,r=t.bottom-t.top,o=xU(e,n/2,r/2),i=wU(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 Vv(e,t,n,r){const o=t===null,i=n===null,a=e&&!(o&&i)&&d2(e,r);return a&&(o||li(t,a.left,a.right))&&(i||li(n,a.top,a.bottom))}function SU(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function CU(e,t){e.rect(t.x,t.y,t.w,t.h)}function Bv(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 Ou extends yi{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}=_U(this),a=SU(s.radius)?Xu:CU;t.save(),(s.w!==i.w||s.h!==i.h)&&(t.beginPath(),a(t,Bv(s,n,i)),t.clip(),a(t,Bv(i,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Bv(i,n)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,n,r){return Vv(this,t,n,r)}inXRange(t,n){return Vv(this,t,null,n)}inYRange(t,n){return Vv(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}}Ce(Ou,"id","bar"),Ce(Ou,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Ce(Ou,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var EU=Object.freeze({__proto__:null,ArcElement:Cl,BarElement:Ou,LineElement:Qi,PointElement:Pu});const P0=["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)"],uE=P0.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function f2(e){return P0[e%P0.length]}function h2(e){return uE[e%uE.length]}function RU(e,t){return e.borderColor=f2(t),e.backgroundColor=h2(t),++t}function $U(e,t){return e.backgroundColor=e.data.map(()=>f2(t++)),t}function PU(e,t){return e.backgroundColor=e.data.map(()=>h2(t++)),t}function OU(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof ra?t=$U(n,t):o instanceof $u?t=PU(n,t):o&&(t=RU(n,t))}}function dE(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function MU(e){return e&&(e.borderColor||e.backgroundColor)}var DU={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&&(dE(r)||MU(o)||i&&dE(i)))return;const s=OU(e);r.forEach(s)}};function TU(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 u=t+n-1;let d=t,f,p,g,b,y;for(s[l++]=e[d],f=0;f<i-2;f++){let x=0,_=0,w;const C=Math.floor((f+1)*a)+1+t,R=Math.min(Math.floor((f+2)*a)+1,n)+t,E=R-C;for(w=C;w<R;w++)x+=e[w].x,_+=e[w].y;x/=E,_/=E;const T=Math.floor(f*a)+1+t,O=Math.min(Math.floor((f+1)*a)+1,n)+t,{x:D,y:I}=e[d];for(g=b=-1,w=T;w<O;w++)b=.5*Math.abs((D-x)*(e[w].y-I)-(D-e[w].x)*(_-I)),b>g&&(g=b,p=e[w],y=w);s[l++]=p,d=y}return s[l++]=e[u],s}function AU(e,t,n,r){let o=0,i=0,s,a,l,u,d,f,p,g,b,y;const x=[],_=t+n-1,w=e[t].x,R=e[_].x-w;for(s=t;s<t+n;++s){a=e[s],l=(a.x-w)/R*r,u=a.y;const E=l|0;if(E===d)u<b?(b=u,f=s):u>y&&(y=u,p=s),o=(i*o+a.x)/++i;else{const T=s-1;if(!at(f)&&!at(p)){const O=Math.min(f,p),D=Math.max(f,p);O!==g&&O!==T&&x.push({...e[O],x:o}),D!==g&&D!==T&&x.push({...e[D],x:o})}s>0&&T!==g&&x.push(e[T]),x.push(a),d=E,i=0,b=y=u,f=p=g=s}}return x}function p2(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 fE(e){e.data.datasets.forEach(t=>{p2(t)})}function IU(e,t){const n=t.length;let r=0,o;const{iScale:i}=e,{min:s,max:a,minDefined:l,maxDefined:u}=i.getUserBounds();return l&&(r=gn(ci(t,i.axis,s).lo,0,n-1)),u?o=gn(ci(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){fE(e);return}const r=e.width;e.data.datasets.forEach((o,i)=>{const{_data:s,indexAxis:a}=o,l=e.getDatasetMeta(i),u=s||o.data;if(Ft([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const d=e.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||e.options.parsing)return;let{start:f,count:p}=IU(l,u);const g=n.threshold||4*r;if(p<=g){p2(o);return}at(s)&&(o._data=u,delete o.data,Object.defineProperty(o,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let b;switch(n.algorithm){case"lttb":b=TU(u,f,p,r,n);break;case"min-max":b=AU(u,f,p,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=b})},destroy(e){fE(e)}};function NU(e,t,n){const r=e.segments,o=e.points,i=t.points,s=[];for(const a of r){let{start:l,end:u}=a;u=mx(l,u,o);const d=O0(n,o[l],o[u],a.loop);if(!t.segments){s.push({source:a,target:d,start:o[l],end:o[u]});continue}const f=XO(t,d);for(const p of f){const g=O0(n,i[p.start],i[p.end],p.loop),b=KO(a,o,g);for(const y of b)s.push({source:y,target:p,start:{[n]:hE(d,g,"start",Math.max)},end:{[n]:hE(d,g,"end",Math.min)}})}}return s}function O0(e,t,n,r){if(r)return;let o=t[e],i=n[e];return e==="angle"&&(o=mr(o),i=mr(i)),{property:e,start:o,end:i}}function LU(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:s,end:a})=>{a=mx(s,a,o);const l=o[s],u=o[a];r!==null?(i.push({x:l.x,y:r}),i.push({x:u.x,y:r})):n!==null&&(i.push({x:n,y:l.y}),i.push({x:n,y:u.y}))}),i}function mx(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function hE(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function g2(e,t){let n=[],r=!1;return zt(e)?(r=!0,n=e):n=LU(e,t),n.length?new Qi({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function pE(e){return e&&e.fill!==!1}function FU(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(!Xt(o))return o;if(s=e[o],!s)return!1;if(s.visible)return o;i.push(o),o=s.fill}return!1}function zU(e,t,n){const r=HU(e);if(ut(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return Xt(o)&&Math.floor(o)===o?jU(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function jU(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function VU(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:ut(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function BU(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:ut(e)?r=e.value:r=t.getBaseValue(),r}function HU(e){const t=e.options,n=t.fill;let r=Ke(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function WU(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,s=r.points,a=UU(t,n);a.push(g2({x:null,y:t.bottom},r));for(let l=0;l<i.length;l++){const u=i[l];for(let d=u.start;d<=u.end;d++)qU(o,s[d],a)}return new Qi({points:o,options:{}})}function UU(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 qU(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:s,last:a,point:l}=GU(i,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function GU(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 u=0;u<i.length;u++){const d=i[u],f=s[d.start][n],p=s[d.end][n];if(li(o,f,p)){a=o===f,l=o===p;break}}return{first:a,last:l,point:r}}class m2{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:jt},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 YU(e){const{chart:t,fill:n,line:r}=e;if(Xt(n))return KU(t,n);if(n==="stack")return WU(e);if(n==="shape")return!0;const o=XU(e);return o instanceof m2?o:g2(o,r)}function KU(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function XU(e){return(e.scale||{}).getPointPositionForValue?ZU(e):QU(e)}function QU(e){const{scale:t={},fill:n}=e,r=VU(n,t);if(Xt(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function ZU(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,s=BU(n,t,i),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new m2({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 Hv(e,t,n){const r=YU(t),{line:o,scale:i,axis:s}=t,a=o.options,l=a.fill,u=a.backgroundColor,{above:d=u,below:f=u}=l||{};r&&o.points.length&&(pg(e,n),JU(e,{line:o,target:r,above:d,below:f,area:n,scale:i,axis:s}),gg(e))}function JU(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&&(gE(e,r,s.top),mE(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore(),e.save(),gE(e,r,s.bottom)),mE(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore()}function gE(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:u}=a,d=o[l],f=o[mx(l,u,o)];i?(e.moveTo(d.x,d.y),i=!1):(e.lineTo(d.x,n),e.lineTo(d.x,d.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 mE(e,t){const{line:n,target:r,property:o,color:i,scale:s}=t,a=NU(n,r,o);for(const{source:l,target:u,start:d,end:f}of a){const{style:{backgroundColor:p=i}={}}=l,g=r!==!0;e.save(),e.fillStyle=p,eq(e,s,g&&O0(o,d,f)),e.beginPath();const b=!!n.pathSegment(e,l);let y;if(g){b?e.closePath():vE(e,r,f,o);const x=!!r.pathSegment(e,u,{move:b,reverse:!0});y=b&&x,y||vE(e,r,d,o)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function eq(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 vE(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var tq={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 Qi&&(l={visible:e.isDatasetVisible(s),index:s,fill:zU(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=FU(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&&Hv(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;pE(i)&&Hv(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!pE(r)||n.drawTime!=="beforeDatasetDraw"||Hv(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const bE=(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)}},nq=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class yE extends yi{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=Pt(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=tn(r.font),i=o.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=bE(r,i);let u,d;n.font=o.string,this.isHorizontal()?(u=this.maxWidth,d=this._fitRows(s,i,a,l)+10):(d=this.maxHeight,u=this._fitCols(s,o,a,l)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,o){const{ctx:i,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],d=o+a;let f=t;i.textAlign="left",i.textBaseline="middle";let p=-1,g=-d;return this.legendItems.forEach((b,y)=>{const x=r+n/2+i.measureText(b.text).width;(y===0||u[u.length-1]+x+2*a>s)&&(f+=d,u[u.length-(y>0?0:1)]=0,g+=d,p++),l[y]={left:0,top:g,row:p,width:x,height:o},u[u.length-1]+=x+a}),f}_fitCols(t,n,r,o){const{ctx:i,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],d=s-t;let f=a,p=0,g=0,b=0,y=0;return this.legendItems.forEach((x,_)=>{const{itemWidth:w,itemHeight:C}=rq(r,n,i,x,o);_>0&&g+C+2*a>d&&(f+=p+a,u.push({width:p,height:g}),b+=p+a,y++,p=g=0),l[_]={left:b,top:g,col:y,width:w,height:C},p=Math.max(p,w),g+=C+a}),f+=p,u.push({width:p,height:g}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,s=Pl(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=Dn(r,this.left+o,this.right-this.lineWidths[a]);for(const u of n)a!==u.row&&(a=u.row,l=Dn(r,this.left+o,this.right-this.lineWidths[a])),u.top+=this.top+t+o,u.left=s.leftForLtr(s.x(l),u.width),l+=u.width+o}else{let a=0,l=Dn(r,this.top+t+o,this.bottom-this.columnSizes[a].height);for(const u of n)u.col!==a&&(a=u.col,l=Dn(r,this.top+t+o,this.bottom-this.columnSizes[a].height)),u.top=l,u.left+=this.left+o,u.left=s.leftForLtr(s.x(u.left),u.width),l+=u.height+o}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;pg(t,this),this._draw(),gg(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=t,a=qt.color,l=Pl(t.rtl,this.left,this.width),u=tn(s.font),{padding:d}=s,f=u.size,p=f/2;let g;this.drawTitle(),o.textAlign=l.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=u.string;const{boxWidth:b,boxHeight:y,itemHeight:x}=bE(s,f),_=function(T,O,D){if(isNaN(b)||b<=0||isNaN(y)||y<0)return;o.save();const I=Ke(D.lineWidth,1);if(o.fillStyle=Ke(D.fillStyle,a),o.lineCap=Ke(D.lineCap,"butt"),o.lineDashOffset=Ke(D.lineDashOffset,0),o.lineJoin=Ke(D.lineJoin,"miter"),o.lineWidth=I,o.strokeStyle=Ke(D.strokeStyle,a),o.setLineDash(Ke(D.lineDash,[])),s.usePointStyle){const N={radius:y*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:I},V=l.xPlus(T,b/2),G=O+p;FO(o,N,V,G,s.pointStyleWidth&&b)}else{const N=O+Math.max((f-y)/2,0),V=l.leftForLtr(T,b),G=ga(D.borderRadius);o.beginPath(),Object.values(G).some(le=>le!==0)?Xu(o,{x:V,y:N,w:b,h:y,radius:G}):o.rect(V,N,b,y),o.fill(),I!==0&&o.stroke()}o.restore()},w=function(T,O,D){Ra(o,D.text,T,O+x/2,u,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},C=this.isHorizontal(),R=this._computeTitleHeight();C?g={x:Dn(i,this.left+d,this.right-r[0]),y:this.top+d+R,line:0}:g={x:this.left+d,y:Dn(i,this.top+R+d,this.bottom-n[0].height),line:0},qO(this.ctx,t.textDirection);const E=x+d;this.legendItems.forEach((T,O)=>{o.strokeStyle=T.fontColor,o.fillStyle=T.fontColor;const D=o.measureText(T.text).width,I=l.textAlign(T.textAlign||(T.textAlign=s.textAlign)),N=b+p+D;let V=g.x,G=g.y;l.setWidth(this.width),C?O>0&&V+N+d>this.right&&(G=g.y+=E,g.line++,V=g.x=Dn(i,this.left+d,this.right-r[g.line])):O>0&&G+E>this.bottom&&(V=g.x=V+n[g.line].width+d,g.line++,G=g.y=Dn(i,this.top+R+d,this.bottom-n[g.line].height));const le=l.x(V);if(_(le,G,T),V=CB(I,V+b+p,C?V+N:this.right,t.rtl),w(l.x(V),G,T),C)g.x+=N+d;else if(typeof T.text!="string"){const ee=u.lineHeight;g.y+=v2(T,ee)+d}else g.y+=E}),GO(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=tn(n.font),o=Cn(n.padding);if(!n.display)return;const i=Pl(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,u=o.top+l;let d,f=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),d=this.top+u,f=Dn(t.align,f,this.right-p);else{const b=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);d=u+Dn(t.align,this.top,this.bottom-b-t.labels.padding-this._computeTitleHeight())}const g=Dn(a,f,f+p);s.textAlign=i.textAlign(ax(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Ra(s,n.text,g,d,r)}_computeTitleHeight(){const t=this.options.title,n=tn(t.font),r=Cn(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,o,i;if(li(t,this.left,this.right)&&li(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],li(t,o.left,o.left+o.width)&&li(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!sq(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=nq(o,r);o&&!i&&Pt(n.onLeave,[t,o,this],this),this._hoveredItem=r,r&&!i&&Pt(n.onHover,[t,r,this],this)}else r&&Pt(n.onClick,[t,r,this],this)}}function rq(e,t,n,r,o){const i=oq(r,e,t,n),s=iq(o,r,t.lineHeight);return{itemWidth:i,itemHeight:s}}function oq(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 iq(e,t,n){let r=e;return typeof t.text!="string"&&(r=v2(t,n)),r}function v2(e,t){const n=e.text?e.text.length:0;return t*n}function sq(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var aq={id:"legend",_element:yE,start(e,t,n){const r=e.legend=new yE({ctx:e.ctx,options:n,chart:e});An.configure(e,r,n),An.addBox(e,r)},stop(e){An.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;An.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 u=l.controller.getStyle(n?0:void 0),d=Cn(u.borderWidth);return{text:t[l.index].label,fillStyle:u.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:o||u.textAlign,borderRadius:s&&(a||u.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 vx extends yi{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=zt(r.text)?r.text.length:1;this._padding=Cn(r.padding);const i=o*tn(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,u,d,f;return this.isHorizontal()?(d=Dn(a,r,i),f=n+t,u=i-r):(s.position==="left"?(d=r+t,f=Dn(a,o,n),l=Vt*-.5):(d=i-t,f=Dn(a,n,o),l=Vt*.5),u=o-n),{titleX:d,titleY:f,maxWidth:u,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=tn(n.font),i=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:u}=this._drawArgs(i);Ra(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:ax(n.align),textBaseline:"middle",translation:[s,a]})}}function lq(e,t){const n=new vx({ctx:e.ctx,options:t,chart:e});An.configure(e,n,t),An.addBox(e,n),e.titleBlock=n}var cq={id:"title",_element:vx,start(e,t,n){lq(e,n)},stop(e){const t=e.titleBlock;An.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;An.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 uh=new WeakMap;var uq={id:"subtitle",start(e,t,n){const r=new vx({ctx:e.ctx,options:n,chart:e});An.configure(e,r,n),An.addBox(e,r),uh.set(e,r)},stop(e){An.removeBox(e,uh.get(e)),uh.delete(e)},beforeUpdate(e,t,n){const r=uh.get(e);An.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 vu={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 u=l.getCenterPoint(),d=w0(t,u);d<o&&(o=d,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function mo(e,t){return t&&(zt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function ri(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
125
- `)>-1?e.split(`
126
- `):e}function dq(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 xE(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:s,boxHeight:a}=t,l=tn(t.bodyFont),u=tn(t.titleFont),d=tn(t.footerFont),f=i.length,p=o.length,g=r.length,b=Cn(t.padding);let y=b.height,x=0,_=r.reduce((R,E)=>R+E.before.length+E.lines.length+E.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,f&&(y+=f*u.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),_){const R=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=g*R+(_-g)*l.lineHeight+(_-1)*t.bodySpacing}p&&(y+=t.footerMarginTop+p*d.lineHeight+(p-1)*t.footerSpacing);let w=0;const C=function(R){x=Math.max(x,n.measureText(R).width+w)};return n.save(),n.font=u.string,Ct(e.title,C),n.font=l.string,Ct(e.beforeBody.concat(e.afterBody),C),w=t.displayColors?s+2+t.boxPadding:0,Ct(r,R=>{Ct(R.before,C),Ct(R.lines,C),Ct(R.after,C)}),w=0,n.font=d.string,Ct(e.footer,C),n.restore(),x+=b.width,{width:x,height:y}}function fq(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function hq(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 pq(e,t,n,r){const{x:o,width:i}=n,{width:s,chartArea:{left:a,right:l}}=e;let u="center";return r==="center"?u=o<=(a+l)/2?"left":"right":o<=i/2?u="left":o>=s-i/2&&(u="right"),hq(u,e,t,n)&&(u="center"),u}function wE(e,t,n){const r=n.yAlign||t.yAlign||fq(e,n);return{xAlign:n.xAlign||t.xAlign||pq(e,t,n,r),yAlign:r}}function gq(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function mq(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function _E(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,u=o+i,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:g}=ga(s);let b=gq(t,a);const y=mq(t,l,u);return l==="center"?a==="left"?b+=u:a==="right"&&(b-=u):a==="left"?b-=Math.max(d,p)+o:a==="right"&&(b+=Math.max(f,g)+o),{x:gn(b,0,r.width-t.width),y:gn(y,0,r.height-t.height)}}function dh(e,t,n){const r=Cn(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function SE(e){return mo([],ri(e))}function vq(e,t,n){return hs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function CE(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const b2={beforeTitle:Zo,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:Zo,beforeBody:Zo,beforeLabel:Zo,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 at(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:Zo,afterBody:Zo,beforeFooter:Zo,footer:Zo,afterFooter:Zo};function Xn(e,t,n,r){const o=e[t].call(n,r);return typeof o>"u"?b2[t].call(n,r):o}var Cb;let EE=(Cb=class extends yi{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 QO(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=vq(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=Xn(r,"beforeTitle",this,t),i=Xn(r,"title",this,t),s=Xn(r,"afterTitle",this,t);let a=[];return a=mo(a,ri(o)),a=mo(a,ri(i)),a=mo(a,ri(s)),a}getBeforeBody(t,n){return SE(Xn(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return Ct(t,i=>{const s={before:[],lines:[],after:[]},a=CE(r,i);mo(s.before,ri(Xn(a,"beforeLabel",this,i))),mo(s.lines,Xn(a,"label",this,i)),mo(s.after,ri(Xn(a,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(t,n){return SE(Xn(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=Xn(r,"beforeFooter",this,t),i=Xn(r,"footer",this,t),s=Xn(r,"afterFooter",this,t);let a=[];return a=mo(a,ri(o)),a=mo(a,ri(i)),a=mo(a,ri(s)),a}_createItems(t){const n=this._active,r=this.chart.data,o=[],i=[],s=[];let a=[],l,u;for(l=0,u=n.length;l<u;++l)a.push(dq(this.chart,n[l]));return t.filter&&(a=a.filter((d,f,p)=>t.filter(d,f,p,r))),t.itemSort&&(a=a.sort((d,f)=>t.itemSort(d,f,r))),Ct(a,d=>{const f=CE(t.callbacks,d);o.push(Xn(f,"labelColor",this,d)),i.push(Xn(f,"labelPointStyle",this,d)),s.push(Xn(f,"labelTextColor",this,d))}),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=vu[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=xE(this,r),u=Object.assign({},a,l),d=wE(this.chart,r,u),f=_E(r,u,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.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:u,bottomLeft:d,bottomRight:f}=ga(a),{x:p,y:g}=t,{width:b,height:y}=n;let x,_,w,C,R,E;return i==="center"?(R=g+y/2,o==="left"?(x=p,_=x-s,C=R+s,E=R-s):(x=p+b,_=x+s,C=R-s,E=R+s),w=x):(o==="left"?_=p+Math.max(l,d)+s:o==="right"?_=p+b-Math.max(u,f)-s:_=this.caretX,i==="top"?(C=g,R=C-s,x=_-s,w=_+s):(C=g+y,R=C+s,x=_+s,w=_-s),E=C),{x1:x,x2:_,x3:w,y1:C,y2:R,y3:E}}drawTitle(t,n,r){const o=this.title,i=o.length;let s,a,l;if(i){const u=Pl(r.rtl,this.x,this.width);for(t.x=dh(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",s=tn(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<i;++l)n.fillText(o[l],u.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:u}=i,d=tn(i.bodyFont),f=dh(this,"left",i),p=o.x(f),g=l<d.lineHeight?(d.lineHeight-l)/2:0,b=n.y+g;if(i.usePointStyle){const y={radius:Math.min(u,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=o.leftForLtr(p,u)+u/2,_=b+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,S0(t,y,x,_),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,S0(t,y,x,_)}else{t.lineWidth=ut(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(p,u),x=o.leftForLtr(o.xPlus(p,1),u-2),_=ga(s.borderRadius);Object.values(_).some(w=>w!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,Xu(t,{x:y,y:b,w:u,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Xu(t,{x,y:b+1,w:u-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(y,b,u,l),t.strokeRect(y,b,u,l),t.fillStyle=s.backgroundColor,t.fillRect(x,b+1,u-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:u,boxPadding:d}=r,f=tn(r.bodyFont);let p=f.lineHeight,g=0;const b=Pl(r.rtl,this.x,this.width),y=function(D){n.fillText(D,b.x(t.x+g),t.y+p/2),t.y+=p+i},x=b.textAlign(s);let _,w,C,R,E,T,O;for(n.textAlign=s,n.textBaseline="middle",n.font=f.string,t.x=dh(this,x,r),n.fillStyle=r.bodyColor,Ct(this.beforeBody,y),g=a&&x!=="right"?s==="center"?u/2+d:u+2+d:0,R=0,T=o.length;R<T;++R){for(_=o[R],w=this.labelTextColors[R],n.fillStyle=w,Ct(_.before,y),C=_.lines,a&&C.length&&(this._drawColorBox(n,t,R,b,r),p=Math.max(f.lineHeight,l)),E=0,O=C.length;E<O;++E)y(C[E]),p=f.lineHeight;Ct(_.after,y)}g=0,p=f.lineHeight,Ct(this.afterBody,y),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let s,a;if(i){const l=Pl(r.rtl,this.x,this.width);for(t.x=dh(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=tn(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:u,height:d}=r,{topLeft:f,topRight:p,bottomLeft:g,bottomRight:b}=ga(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+u-p,l),n.quadraticCurveTo(a+u,l,a+u,l+p),s==="center"&&i==="right"&&this.drawCaret(t,n,r,o),n.lineTo(a+u,l+d-b),n.quadraticCurveTo(a+u,l+d,a+u-b,l+d),s==="bottom"&&this.drawCaret(t,n,r,o),n.lineTo(a+g,l+d),n.quadraticCurveTo(a,l+d,a,l+d-g),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=vu[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=xE(this,t),l=Object.assign({},s,this._size),u=wE(n,t,l),d=_E(t,l,u,n);(o._to!==d.x||i._to!==d.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,d))}}_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=Cn(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),qO(t,n.textDirection),i.y+=s.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),GO(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,o=t.map(({datasetIndex:a,index:l})=>{const u=this.chart.getDatasetMeta(a);if(!u)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:u.data[l],index:l}}),i=!hp(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||!hp(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=vu[i.position].call(this,t,n);return s!==!1&&(r!==s.x||o!==s.y)}},Ce(Cb,"positioners",vu),Cb);var bq={id:"tooltip",_element:EE,positioners:vu,afterInit(e,t,n){n&&(e.tooltip=new EE({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:b2},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"]},yq=Object.freeze({__proto__:null,Colors:DU,Decimation:kU,Filler:tq,Legend:aq,SubTitle:uq,Title:cq,Tooltip:bq});const xq=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function wq(e,t,n,r){const o=e.indexOf(t);if(o===-1)return xq(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const _q=(e,t)=>e===null?null:gn(Math.round(e),0,t);function RE(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class M0 extends Na{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(at(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:wq(r,t,Ke(n,t),this._addedLabels),_q(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 RE.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}}Ce(M0,"id","category"),Ce(M0,"defaults",{ticks:{callback:RE}});function Sq(e,t){const n=[],{bounds:o,step:i,min:s,max:a,precision:l,count:u,maxTicks:d,maxDigits:f,includeBounds:p}=e,g=i||1,b=d-1,{min:y,max:x}=t,_=!at(s),w=!at(a),C=!at(u),R=(x-y)/(f+1);let E=yC((x-y)/b/g)*g,T,O,D,I;if(E<1e-14&&!_&&!w)return[{value:y},{value:x}];I=Math.ceil(x/E)-Math.floor(y/E),I>b&&(E=yC(I*E/b/g)*g),at(l)||(T=Math.pow(10,l),E=Math.ceil(E*T)/T),o==="ticks"?(O=Math.floor(y/E)*E,D=Math.ceil(x/E)*E):(O=y,D=x),_&&w&&i&&vB((a-s)/i,E/1e3)?(I=Math.round(Math.min((a-s)/E,d)),E=(a-s)/I,O=s,D=a):C?(O=_?s:O,D=w?a:D,I=u-1,E=(D-O)/I):(I=(D-O)/E,Cu(I,Math.round(I),E/1e3)?I=Math.round(I):I=Math.ceil(I));const N=Math.max(xC(E),xC(O));T=Math.pow(10,at(l)?N:l),O=Math.round(O*T)/T,D=Math.round(D*T)/T;let V=0;for(_&&(p&&O!==s?(n.push({value:s}),O<s&&V++,Cu(Math.round((O+V*E)*T)/T,s,$E(s,R,e))&&V++):O<s&&V++);V<I;++V){const G=Math.round((O+V*E)*T)/T;if(w&&G>a)break;n.push({value:G})}return w&&p&&D!==a?n.length&&Cu(n[n.length-1].value,a,$E(a,R,e))?n[n.length-1].value=a:n.push({value:a}):(!w||D===a)&&n.push({value:D}),n}function $E(e,t,{horizontal:n,minRotation:r}){const o=no(r),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*t*(""+e).length;return Math.min(t/i,s)}class xp extends Na{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 at(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=Ro(o),u=Ro(i);l<0&&u<0?a(0):l>0&&u>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=Sq(o,i);return t.bounds==="ticks"&&OO(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 kd(t,this.chart.options.locale,this.options.ticks.format)}}class D0 extends xp{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Xt(t)?t:0,this.max=Xt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=no(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}}Ce(D0,"id","linear"),Ce(D0,"defaults",{ticks:{callback:hg.formatters.numeric}});const Zu=e=>Math.floor(Xi(e)),Us=(e,t)=>Math.pow(10,Zu(e)+t);function PE(e){return e/Math.pow(10,Zu(e))===1}function OE(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function Cq(e,t){const n=t-e;let r=Zu(n);for(;OE(e,t,r)>10;)r++;for(;OE(e,t,r)<10;)r--;return Math.min(r,Zu(e))}function Eq(e,{min:t,max:n}){t=fr(e.min,t);const r=[],o=Zu(t);let i=Cq(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,u=Math.round((t-l)*s)/s,d=Math.floor((t-l)/a/10)*a*10;let f=Math.floor((u-d)/Math.pow(10,i)),p=fr(e.min,Math.round((l+d+f*Math.pow(10,i))*s)/s);for(;p<n;)r.push({value:p,major:PE(p),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(i++,f=2,s=i>=0?1:s),p=Math.round((l+d+f*Math.pow(10,i))*s)/s;const g=fr(e.max,p);return r.push({value:g,major:PE(g),significand:f}),r}class T0 extends Na{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=xp.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Xt(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Xt(t)?Math.max(0,t):null,this.max=Xt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Xt(this._userMin)&&(this.min=t===Us(this.min,0)?Us(this.min,-1):Us(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(Us(r,-1)),s(Us(o,1)))),r<=0&&i(Us(o,-1)),o<=0&&s(Us(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=Eq(n,this);return t.bounds==="ticks"&&OO(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":kd(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Xi(t),this._valueRange=Xi(this.max)-Xi(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Xi(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Ce(T0,"id","logarithmic"),Ce(T0,"defaults",{ticks:{callback:hg.formatters.logarithmic,major:{enabled:!0}}});function A0(e){const t=e.ticks;if(t.display&&e.display){const n=Cn(t.backdropPadding);return Ke(t.font&&t.font.size,qt.font.size)+n.height}return 0}function Rq(e,t,n){return n=zt(n)?n:[n],{w:IB(e,t.string,n),h:n.length*t.lineHeight}}function ME(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 $q(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?Vt/i:0;for(let l=0;l<i;l++){const u=s.setContext(e.getPointLabelContext(l));o[l]=u.padding;const d=e.getPointPosition(l,e.drawingArea+o[l],a),f=tn(u.font),p=Rq(e.ctx,f,e._pointLabels[l]);r[l]=p;const g=mr(e.getIndexAngle(l)+a),b=Math.round(ix(g)),y=ME(b,d.x,p.w,0,180),x=ME(b,d.y,p.h,90,270);Pq(n,t,g,y,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=Dq(e,r,o)}function Pq(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 Oq(e,t,n){const r=e.drawingArea,{extra:o,additionalAngle:i,padding:s,size:a}=n,l=e.getPointPosition(t,r+o+s,i),u=Math.round(ix(mr(l.angle+en))),d=Iq(l.y,a.h,u),f=Tq(u),p=Aq(l.x,a.w,f);return{visible:!0,x:l.x,y:d,textAlign:f,left:p,top:d,right:p+a.w,bottom:d+a.h}}function Mq(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(ui({x:n,y:r},t)||ui({x:n,y:i},t)||ui({x:o,y:r},t)||ui({x:o,y:i},t))}function Dq(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:s,display:a}=i.pointLabels,l={extra:A0(i)/2,additionalAngle:s?Vt/o:0};let u;for(let d=0;d<o;d++){l.padding=n[d],l.size=t[d];const f=Oq(e,d,l);r.push(f),a==="auto"&&(f.visible=Mq(f,u),f.visible&&(u=f))}return r}function Tq(e){return e===0||e===180?"center":e<180?"left":"right"}function Aq(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function Iq(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(!at(a)){const l=ga(t.borderRadius),u=Cn(t.backdropPadding);e.fillStyle=a;const d=r-u.left,f=o-u.top,p=i-r+u.width,g=s-o+u.height;Object.values(l).some(b=>b!==0)?(e.beginPath(),Xu(e,{x:d,y:f,w:p,h:g,radius:l}),e.fill()):e.fillRect(d,f,p,g)}}function Nq(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=tn(s.font),{x:l,y:u,textAlign:d}=i;Ra(n,e._pointLabels[o],l,u+a.lineHeight/2,a,{color:s.color,textAlign:d,textBaseline:"middle"})}}function y2(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,jt);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 Lq(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(),y2(e,n,s,r),i.closePath(),i.stroke(),i.restore())}function Fq(e,t,n){return hs(e,{label:n,index:t,type:"pointLabel"})}class bu extends xp{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=Cn(A0(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=Xt(t)&&!isNaN(t)?t:0,this.max=Xt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/A0(this.options))}generateTickLabels(t){xp.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const o=Pt(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?$q(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=jt/(this._pointLabels.length||1),r=this.options.startAngle||0;return mr(t*n+no(r))}getDistanceFromCenterForValue(t){if(at(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(at(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 Fq(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const o=this.getIndexAngle(t)-en+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(),y2(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,u;if(n.pointLabels.display&&Nq(this,s),o.display&&this.ticks.forEach((d,f)=>{if(f!==0){l=this.getDistanceFromCenterForValue(d.value);const p=this.getContext(f),g=o.setContext(p),b=i.setContext(p);Lq(this,g,l,s,b)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const d=r.setContext(this.getPointLabelContext(a)),{color:f,lineWidth:p}=d;!p||!f||(t.lineWidth=p,t.strokeStyle=f,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),u=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.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 u=r.setContext(this.getContext(l)),d=tn(u.font);if(i=this.getDistanceFromCenterForValue(this.ticks[l].value),u.showLabelBackdrop){t.font=d.string,s=t.measureText(a.label).width,t.fillStyle=u.backdropColor;const f=Cn(u.backdropPadding);t.fillRect(-s/2-f.left,-i-d.size/2-f.top,s+f.width,d.size+f.height)}Ra(t,a.label,0,-i,d,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}Ce(bu,"id","radialLinear"),Ce(bu,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:hg.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Ce(bu,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Ce(bu,"descriptors",{angleLines:{_fallback:"grid"}});const vg={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}},er=Object.keys(vg);function DE(e,t){return e-t}function TE(e,t){if(at(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)),Xt(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(o&&(s=o==="week"&&(oc(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function AE(e,t,n,r){const o=er.length;for(let i=er.indexOf(e);i<o-1;++i){const s=vg[er[i]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return er[i]}return er[o-1]}function zq(e,t,n,r,o){for(let i=er.length-1;i>=er.indexOf(n);i--){const s=er[i];if(vg[s].common&&e._adapter.diff(o,r,s)>=t-1)return s}return er[n?er.indexOf(n):0]}function jq(e){for(let t=er.indexOf(e)+1,n=er.length;t<n;++t)if(vg[er[t]].common)return er[t]}function IE(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=sx(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function Vq(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 kE(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:Vq(e,r,o,n)}class Ju extends Na{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 XH._date(t.adapters.date);o.init(n),Su(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:TE(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(u){!s&&!isNaN(u.min)&&(o=Math.min(o,u.min)),!a&&!isNaN(u.max)&&(i=Math.max(i,u.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),o=Xt(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=Xt(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=wB(o,i,s);return this._unit=n.unit||(r.autoSkip?AE(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):zq(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:jq(this._unit),this.initOffsets(o),t.reverse&&a.reverse(),kE(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=gn(n,0,s),r=gn(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||AE(i.minUnit,n,r,this._getLabelCapacity(n)),a=Ke(o.ticks.stepSize,1),l=s==="week"?i.isoWeekday:!1,u=oc(l)||l===!0,d={};let f=n,p,g;if(u&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,u?"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 b=o.ticks.source==="data"&&this.getDataTimestamps();for(p=f,g=0;p<r;p=+t.add(p,a,s),g++)IE(d,p,b);return(p===r||o.bounds==="ticks"||g===1)&&IE(d,p,b),Object.keys(d).sort(DE).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 Pt(s,[t,n,r],this);const a=i.time.displayFormats,l=this._unit,u=this._majorUnit,d=l&&a[l],f=u&&a[u],p=r[n],g=u&&f&&p&&p.major;return this._adapter.format(t,o||(g?f:d))}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=no(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,kE(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(TE(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return TO(t.sort(DE))}}Ce(Ju,"id","time"),Ce(Ju,"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 fh(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}=ci(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}=ci(e,"time",t)),{time:i,pos:a}=e[r],{time:s,pos:l}=e[o]);const u=s-i;return u?a+(l-a)*(t-i)/u:a}class I0 extends Ju{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=fh(n,this.min),this._tableRange=fh(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,o=[],i=[];let s,a,l,u,d;for(s=0,a=t.length;s<a;++s)u=t[s],u>=n&&u<=r&&o.push(u);if(o.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=o.length;s<a;++s)d=o[s+1],l=o[s-1],u=o[s],Math.round((d+l)/2)!==u&&i.push({time:u,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(fh(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return fh(this._table,r*this._tableRange+this._minPos,!0)}}Ce(I0,"id","timeseries"),Ce(I0,"defaults",Ju.defaults);var Bq=Object.freeze({__proto__:null,CategoryScale:M0,LinearScale:D0,LogarithmicScale:T0,RadialLinearScale:bu,TimeScale:Ju,TimeSeriesScale:I0});const Hq=[KH,EU,yq,Bq];/*!
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 NE=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}(),Mu={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):at(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*NE)/NE}};function Wv(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 Wq(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 Uq=0,x2=1,w2=2,_2=4,S2=8;function hh(e,t,n){var r=Uq;return e<n.left?r|=x2:e>n.right&&(r|=w2),t<n.top?r|=S2:t>n.bottom&&(r|=_2),r}function qq(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=hh(n,r,t),a=hh(o,i,t),l,u,d;!(!(s|a)||s&a);)l=s||a,l&S2?(u=n+(o-n)*(t.top-r)/(i-r),d=t.top):l&_2?(u=n+(o-n)*(t.bottom-r)/(i-r),d=t.bottom):l&w2?(d=r+(i-r)*(t.right-n)/(o-n),u=t.right):l&x2&&(d=r+(i-r)*(t.left-n)/(o-n),u=t.left),l===s?(n=u,r=d,s=hh(n,r,t)):(o=u,i=d,a=hh(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function ph(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=qq(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),Wq(o,i,e.vx,e.vy,t.align)}var gh={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 ph({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=Wv(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return ph({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=Wv(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)),ph({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=Wv(e,t.origin);return ph({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=Mu.rasterize;function Gq(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 Yq(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 Kq(e){return e instanceof Cl?gh.arc:e instanceof Pu?gh.point:e instanceof Ou?gh.bar:gh.fallback}function Xq(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,u=n+a,d=t+r-a,f=n+o-a;e.moveTo(t,u),l<d&&u<f?(e.arc(l,u,a,-Math.PI,-s),e.arc(d,u,a,-s,0),e.arc(d,f,a,0,s),e.arc(l,f,a,s,Math.PI)):l<d?(e.moveTo(l,n),e.arc(d,u,a,-s,s),e.arc(l,u,a,s,Math.PI+s)):u<f?(e.arc(l,u,a,-Math.PI,0),e.arc(l,f,a,0,Math.PI)):e.arc(l,u,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,o)}function Qq(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),Xq(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 Zq(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 Jq(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 eG(e,t,n,r){var o=r.textAlign,i=r.color,s=!!i,a=r.font,l=t.length,u=r.textStrokeColor,d=r.textStrokeWidth,f=u&&d,p;if(!(!l||!s&&!f))for(n=Zq(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=d,e.strokeStyle=u),p=0,l=t.length;p<l;++p)Jq(e,t[p],{stroked:f,filled:s,w:n.w,x:n.x,y:n.y+n.h*p})}var C2=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};Mo(C2.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=tn(Ft([n.font,{}],r,i)),a=Ft([n.color,qt.color],r,i);return{align:Ft([n.align,"center"],r,i),anchor:Ft([n.anchor,"center"],r,i),area:r.chart.chartArea,backgroundColor:Ft([n.backgroundColor,null],r,i),borderColor:Ft([n.borderColor,null],r,i),borderRadius:Ft([n.borderRadius,0],r,i),borderWidth:Ft([n.borderWidth,0],r,i),clamp:Ft([n.clamp,!1],r,i),clip:Ft([n.clip,!1],r,i),color:a,display:e,font:s,lines:t,offset:Ft([n.offset,4],r,i),opacity:Ft([n.opacity,1],r,i),origin:Yq(o._el,r),padding:Cn(Ft([n.padding,4],r,i)),positioner:Kq(o._el),rotation:Ft([n.rotation,0],r,i)*(Math.PI/180),size:Mu.textSize(o._ctx,t,s),textAlign:Ft([n.textAlign,"start"],r,i),textShadowBlur:Ft([n.textShadowBlur,0],r,i),textShadowColor:Ft([n.textShadowColor,a],r,i),textStrokeColor:Ft([n.textStrokeColor,a],r,i),textStrokeWidth:Ft([n.textStrokeWidth,0],r,i)}},update:function(e){var t=this,n=null,r=null,o=t._index,i=t._config,s,a,l,u=Ft([i.display,!0],e,o);u&&(s=e.dataset.data[o],a=Ke(Pt(i.formatter,[s,e]),s),l=at(a)?[]:Mu.toTextLines(a),l.length&&(n=t._modelize(u,l,i,e),r=Gq(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=Mu.bound(0,o.opacity,1),r.translate(di(t.x),di(t.y)),r.rotate(o.rotation),Qq(r,i.frame,o),eG(r,o.lines,i.text,o),r.restore())}});var tG=Number.MIN_SAFE_INTEGER||-9007199254740991,nG=Number.MAX_SAFE_INTEGER||9007199254740991;function ru(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 LE(e,t){var n=nG,r=tG,o=t.origin,i,s,a,l,u;for(i=0;i<e.length;++i)s=e[i],a=s.x-o.x,l=s.y-o.y,u=t.vx*a+t.vy*l,n=Math.min(n,u),r=Math.max(r,u);return{min:n,max:r}}function mh(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 E2=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};Mo(E2.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=ru(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=[mh(t[0],t[1]),mh(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(mh(n[0],n[1]),mh(n[0],n[3])),o=0;o<r.length;++o)if(i=LE(t,r[o]),s=LE(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[ru({x:t.x,y:t.y},r,n),ru({x:t.x+t.w,y:t.y},r,n),ru({x:t.x+t.w,y:t.y+t.h},r,n),ru({x:t.x,y:t.y+t.h},r,n)]}});function R2(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,u=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),d=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 u*=o*f,d*=i*f,u+=t.offset*o,d+=t.offset*i,{x:r.x+u,y:r.y+d}}function rG(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 oG(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,u)=>l.getProps([u],!0)[u]}),i=r.geometry(),s=R2(a,r.model(),i),o._box.update(s,i,r.rotation()));return rG(e,function(l,u){var d=l._hidable,f=u._hidable;d&&f||f?u._visible=!1:d&&(l._visible=!1)})}var Du={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 E2,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var u=a.$layout,d=l.$layout;return u._idx===d._idx?d._set-u._set:d._idx-u._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&&oG(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=R2(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},iG=function(e){if(at(e))return null;var t=e,n,r,o;if(ut(e))if(!at(e.label))t=e.label;else if(!at(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},sG={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:iG,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},Qn="$datalabels",$2="$default";function aG(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=Mo({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(Mo({},[t,i[a],{_key:a}]))}):o.push(t),r=o.reduce(function(a,l){return Ct(l.listeners||{},function(u,d){a[d]=a[d]||{},a[d][l._key||$2]=u}),delete l.listeners,a},{}),{labels:o,listeners:r})}function k0(e,t,n,r){if(t){var o=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&Pt(s,[o,r])===!0&&(e[Qn]._dirty=!0,n.update(o)))}}function lG(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&k0(e,t.leave,n,o),i&&k0(e,t.enter,r,o))}function cG(e,t){var n=e[Qn],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=Du.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,lG(e,r,o,i,t)}}function uG(e,t){var n=e[Qn],r=n._listeners.click,o=r&&Du.lookup(n._labels,t);o&&k0(e,r,o,t)}var dG={id:"datalabels",defaults:sG,beforeInit:function(e){e[Qn]={_actives:[]}},beforeUpdate:function(e){var t=e[Qn];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[Qn],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=aG(a,n),u=t.meta.data||[],d=e.ctx,f,p,g,b,y,x,_,w;for(d.save(),f=0,g=u.length;f<g;++f)if(_=u[f],_[Qn]=[],s&&_&&e.getDataVisibility(f)&&!_.skip)for(p=0,b=l.labels.length;p<b;++p)y=l.labels[p],x=y._key,w=new C2(y,d,_,f),w.$groups={_set:r,_key:x||$2},w.$context={active:!1,chart:e,dataIndex:f,dataset:a,datasetIndex:r},w.update(w.$context),_[Qn].push(w),i.push(w);d.restore(),Mo(o._listeners,l.listeners,{merger:function(C,R,E){R[C]=R[C]||{},R[C][t.index]=E[C],o._listened=!0}})},afterUpdate:function(e){e[Qn]._labels=Du.prepare(e[Qn]._datasets)},afterDatasetsDraw:function(e){Du.draw(e,e[Qn]._labels)},beforeEvent:function(e,t){if(e[Qn]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":cG(e,n);break;case"click":uG(e,n);break}}},afterEvent:function(e){var t=e[Qn],n=t._actives,r=t._actives=e.getActiveElements(),o=Mu.arrayDiff(n,r),i,s,a,l,u,d,f;for(i=0,s=o.length;i<s;++i)if(u=o[i],u[1])for(f=u[0].element[Qn]||[],a=0,l=f.length;a<l;++a)d=f[a],d.$context.active=u[1]===1,d.update(d.$context);(t._dirty||o.length)&&(Du.update(t._labels),e.render()),delete t._dirty}};Vr.register(...Hq);Vr.register(dG);function P2({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,o]=m.useState(),i=Ee(l=>l.themeStyle);m.useEffect(()=>{var d,f,p,g;(f=(d=i==null?void 0:i.chart)==null?void 0:d.font)!=null&&f.family&&(Vr.defaults.font={...Vr.defaults.font,...(p=i==null?void 0:i.chart)==null?void 0:p.font}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const l=(g=n==null?void 0:n.current)==null?void 0:g.getContext("2d");if(!l)return;let u;try{u=new Vr(l,e),o(u)}catch(b){console.log("error creating chart",b)}return()=>{u&&u.destroy()}},[(a=i==null?void 0:i.chart)==null?void 0:a.font]);function s(l){var d,f;if(!r)return;const u=r==null?void 0:r.getElementsAtEventForMode(l,"nearest",{intersect:!0},!0);if(u&&u.length>0){const p=u[0].datasetIndex,g=u[0].index,b=(f=(d=u[0].element)==null?void 0:d.$context)==null?void 0:f.raw;t==null||t(r,p,g,b)}}return k.jsx("div",{onClick:s,className:"relative h-[99%]",children:k.jsx("canvas",{ref:n})})}function Ur(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 fG=["color"],O2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(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:"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"}))}),hG=["color"],pG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(e,hG);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"}))}),gG=["color"],mG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(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:"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"}))}),vG=["color"],M2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(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:"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"}))}),bG=["color"],yG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(e,bG);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"}))}),xG=["color"],wG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(e,xG);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"}))}),_G=["color"],SG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(e,_G);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"}))}),CG=["color"],EG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(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:"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"}))}),RG=["color"],$G=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(e,RG);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"}))}),PG=["color"],OG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(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:"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"}))}),MG=["color"],bx=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(e,MG);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}))}),DG=["color"],yx=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(e,DG);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}))});function TG(e,t,n){var l,u,d,f;const r=n==null?void 0:n.datasetOptions,o=Ee.getState().themeStyle,i=(u=(l=o==null?void 0:o.chart)==null?void 0:l.dataset)==null?void 0:u.backgroundColor,s=(f=(d=o==null?void 0:o.chart)==null?void 0:d.dataset)==null?void 0:f.borderColor;return e.map((p,g)=>{var w;const b=r==null?void 0:r.find(C=>C.idx===g),y=i==null?void 0:i[g%i.length],x=s==null?void 0:s[g%s.length];return{label:p.charAt(0).toUpperCase()+p.slice(1),data:t.map(C=>C[p]),...b,datalabels:{...b==null?void 0:b.datalabels,color:AG((w=b==null?void 0:b.datalabels)==null?void 0:w.align,y)},backgroundColor:y,borderColor:x}})}function AG(e,t){return Jh(e==="end"||e==="start"?Zh():t)}function IG(e){var a,l,u,d;const{metricKeys:t,dimensionKeys:n}=Hr(e);let r=[];const o=Ee.getState().themeStyle,i=(l=(a=o==null?void 0:o.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(d=(u=o==null?void 0:o.chart)==null?void 0:u.dataset)==null?void 0:d.borderColor;if((n==null?void 0:n.length)===1){const f=e.map(p=>({x:p[t[0]],y:p[t[1]],r:p[t[2]],label:p[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(p=>p[n==null?void 0:n[1]]))].map((p,g)=>{const b=e.filter(y=>y[n==null?void 0:n[1]]===p);return{label:p,data:b.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[g%i.length],borderColor:s==null?void 0:s[g%s.length]}})),r}function kG(e,t){var s,a,l,u;const n=Ee.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,o=(u=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:u.borderColor;return e.map(d=>({label:d.charAt(0).toUpperCase()+d.slice(1),data:t.map(f=>f[d]),backgroundColor:t.map((f,p)=>r==null?void 0:r[p%r.length]),borderColor:t.map((f,p)=>o==null?void 0:o[p%o.length])}))}function NG(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 Hr(e){if(e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=NG(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,u,d,f,p,g;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((u=e==null?void 0:e[0])==null?void 0:u[i])=="string"||typeof((d=e==null?void 0:e[1])==null?void 0:d[i])&&typeof((f=e==null?void 0:e[1])==null?void 0:f[i])=="string"||typeof((p=e==null?void 0:e[2])==null?void 0:p[i])&&typeof((g=e==null?void 0:e[2])==null?void 0:g[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 N0(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],u=s[r];return i[a]||(i[a]={[t]:a}),i[a][l]=u,i},{});return Object.values(o)}function L0(e,t){var s;const n=Ee.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=Sa.cloneDeep(r);return Sa.merge(o,e,t)}function D2(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}function LG({frame:e}){const t=Ee(w=>w.isDashboardEditing),n=Ee(w=>w.filterValues),r=Ee(w=>w.isVisualEditing),o=Ee(w=>w.selectedSheetId);Ee(w=>w.currentBreakpoint);const{removeFrame:i}=Ee(w=>w.actions),s=Ee(w=>w.actions.setIsVisualEditing),a=Kt(w=>w.actions.setFilterValues),l=Kt(w=>w.actions.setApplyFilters),{setCard:u,setFrame:d,setQueryResultColumns:f}=Kt(w=>w.actions),p=Kt(w=>w.actions.setSelectedConnectionId),g=Kt(w=>w.actions.setSelectedDatabaseName),b=Kt(w=>w.actions.setSelectedSchemaName),y=Kt(w=>w.actions.setSelectedTableName),x=e.cards.find(w=>w.id===e.activeCardId);function _(){s(!r),u(x);const{dimensionKeys:w}=Hr((x==null?void 0:x.data)||[]);f(w),d(e),x!=null&&x.connectionId&&p(x==null?void 0:x.connectionId),x!=null&&x.lastSelectedDatabase&&g(x==null?void 0:x.lastSelectedDatabase),x!=null&&x.lastSelectedSchema&&b(x==null?void 0:x.lastSelectedSchema),x!=null&&x.lastSelectedTable&&y(x==null?void 0:x.lastSelectedTable),n&&(a(n),l(!0))}return k.jsx("section",{className:"absolute right-2 top-2 z-10",children:t&&k.jsxs("div",{className:"flex items-center gap-2",children:[r?k.jsx(yG,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}):k.jsx(wG,{role:"edit-visual",onClick:_,className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}),k.jsx(M2,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"})]})})}function FG(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 F0="dismissableLayer.update",zG="dismissableLayer.pointerDownOutside",jG="dismissableLayer.focusOutside";let FE;const VG=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),yc=m.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...u}=e,d=m.useContext(VG),[f,p]=m.useState(null),g=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,b]=m.useState({}),y=Xe(t,D=>p(D)),x=Array.from(d.layers),[_]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),w=x.indexOf(_),C=f?x.indexOf(f):-1,R=d.layersWithOutsidePointerEventsDisabled.size>0,E=C>=w,T=BG(D=>{const I=D.target,N=[...d.branches].some(V=>V.contains(I));!E||N||(i==null||i(D),a==null||a(D),D.defaultPrevented||l==null||l())},g),O=HG(D=>{const I=D.target;[...d.branches].some(V=>V.contains(I))||(s==null||s(D),a==null||a(D),D.defaultPrevented||l==null||l())},g);return FG(D=>{C===d.layers.size-1&&(o==null||o(D),!D.defaultPrevented&&l&&(D.preventDefault(),l()))},g),m.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(FE=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),zE(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=FE)}},[f,g,r,d]),m.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),zE())},[f,d]),m.useEffect(()=>{const D=()=>b({});return document.addEventListener(F0,D),()=>document.removeEventListener(F0,D)},[]),m.createElement(ke.div,ne({},u,{ref:y,style:{pointerEvents:R?E?"auto":"none":void 0,...e.style},onFocusCapture:we(e.onFocusCapture,O.onFocusCapture),onBlurCapture:we(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:we(e.onPointerDownCapture,T.onPointerDownCapture)}))});function BG(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 u=function(){T2(zG,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}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 HG(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&&T2(jG,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 zE(){const e=new CustomEvent(F0);document.dispatchEvent(e)}function T2(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?_P(o,i):o.dispatchEvent(i)}const WG=["top","right","bottom","left"],ls=Math.min,br=Math.max,wp=Math.round,vh=Math.floor,cs=e=>({x:e,y:e}),UG={left:"right",right:"left",bottom:"top",top:"bottom"},qG={start:"end",end:"start"};function z0(e,t,n){return br(e,ls(t,n))}function gi(e,t){return typeof e=="function"?e(t):e}function mi(e){return e.split("-")[0]}function xc(e){return e.split("-")[1]}function wx(e){return e==="x"?"y":"x"}function _x(e){return e==="y"?"height":"width"}function wc(e){return["top","bottom"].includes(mi(e))?"y":"x"}function Sx(e){return wx(wc(e))}function GG(e,t,n){n===void 0&&(n=!1);const r=xc(e),o=Sx(e),i=_x(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=_p(s)),[s,_p(s)]}function YG(e){const t=_p(e);return[j0(e),t,j0(t)]}function j0(e){return e.replace(/start|end/g,t=>qG[t])}function KG(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 XG(e,t,n,r){const o=xc(e);let i=KG(mi(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(j0)))),i}function _p(e){return e.replace(/left|right|bottom|top/g,t=>UG[t])}function QG(e){return{top:0,right:0,bottom:0,left:0,...e}}function A2(e){return typeof e!="number"?QG(e):{top:e,right:e,bottom:e,left:e}}function Sp(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function jE(e,t,n){let{reference:r,floating:o}=e;const i=wc(t),s=Sx(t),a=_x(s),l=mi(t),u=i==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let g;switch(l){case"top":g={x:d,y:r.y-o.height};break;case"bottom":g={x:d,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-o.width,y:f};break;default:g={x:r.x,y:r.y}}switch(xc(t)){case"start":g[s]-=p*(n&&u?-1:1);break;case"end":g[s]+=p*(n&&u?-1:1);break}return g}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 u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=jE(u,r,l),p=r,g={},b=0;for(let y=0;y<a.length;y++){const{name:x,fn:_}=a[y],{x:w,y:C,data:R,reset:E}=await _({x:d,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:g,rects:u,platform:s,elements:{reference:e,floating:t}});if(d=w??d,f=C??f,g={...g,[x]:{...g[x],...R}},E&&b<=50){b++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(u=E.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:d,y:f}=jE(u,p,l)),y=-1;continue}}return{x:d,y:f,placement:p,strategy:o,middlewareData:g}};async function ed(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:g=0}=gi(t,e),b=A2(g),x=a[p?f==="floating"?"reference":"floating":f],_=Sp(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:u,rootBoundary:d,strategy:l})),w=f==="floating"?{...s.floating,x:r,y:o}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),R=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},E=Sp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:w,offsetParent:C,strategy:l}):w);return{top:(_.top-E.top+b.top)/R.y,bottom:(E.bottom-_.bottom+b.bottom)/R.y,left:(_.left-E.left+b.left)/R.x,right:(E.right-_.right+b.right)/R.x}}const VE=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:u,padding:d=0}=gi(e,t)||{};if(u==null)return{};const f=A2(d),p={x:n,y:r},g=Sx(o),b=_x(g),y=await s.getDimensions(u),x=g==="y",_=x?"top":"left",w=x?"bottom":"right",C=x?"clientHeight":"clientWidth",R=i.reference[b]+i.reference[g]-p[g]-i.floating[b],E=p[g]-i.reference[g],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let O=T?T[C]:0;(!O||!await(s.isElement==null?void 0:s.isElement(T)))&&(O=a.floating[C]||i.floating[b]);const D=R/2-E/2,I=O/2-y[b]/2-1,N=ls(f[_],I),V=ls(f[w],I),G=N,le=O-y[b]-V,ee=O/2-y[b]/2+D,F=z0(G,ee,le),Z=!l.arrow&&xc(o)!=null&&ee!=F&&i.reference[b]/2-(ee<G?N:V)-y[b]/2<0,Y=Z?ee<G?ee-G:ee-le:0;return{[g]:p[g]+Y,data:{[g]:F,centerOffset:ee-F-Y,...Z&&{alignmentOffset:Y}},reset:Z}}}),JG=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:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:y=!0,...x}=gi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const _=mi(o),w=mi(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),R=p||(w||!y?[_p(a)]:YG(a));!p&&b!=="none"&&R.push(...XG(a,y,b,C));const E=[a,...R],T=await ed(t,x),O=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&O.push(T[_]),f){const G=GG(o,s,C);O.push(T[G[0]],T[G[1]])}if(D=[...D,{placement:o,overflows:O}],!O.every(G=>G<=0)){var I,N;const G=(((I=i.flip)==null?void 0:I.index)||0)+1,le=E[G];if(le)return{data:{index:G,overflows:D},reset:{placement:le}};let ee=(N=D.filter(F=>F.overflows[0]<=0).sort((F,Z)=>F.overflows[1]-Z.overflows[1])[0])==null?void 0:N.placement;if(!ee)switch(g){case"bestFit":{var V;const F=(V=D.map(Z=>[Z.placement,Z.overflows.filter(Y=>Y>0).reduce((Y,Q)=>Y+Q,0)]).sort((Z,Y)=>Z[1]-Y[1])[0])==null?void 0:V[0];F&&(ee=F);break}case"initialPlacement":ee=a;break}if(o!==ee)return{reset:{placement:ee}}}return{}}}};function BE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function HE(e){return WG.some(t=>e[t]>=0)}const eY=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=gi(e,t);switch(r){case"referenceHidden":{const i=await ed(t,{...o,elementContext:"reference"}),s=BE(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:HE(s)}}}case"escaped":{const i=await ed(t,{...o,altBoundary:!0}),s=BE(i,n.floating);return{data:{escapedOffsets:s,escaped:HE(s)}}}default:return{}}}}};async function tY(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=mi(n),a=xc(n),l=wc(n)==="y",u=["left","top"].includes(s)?-1:1,d=i&&l?-1:1,f=gi(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:b}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof b=="number"&&(g=a==="end"?b*-1:b),l?{x:g*d,y:p*u}:{x:p*u,y:g*d}}const nY=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 tY(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}}}}},rY=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:_,y:w}=x;return{x:_,y:w}}},...l}=gi(e,t),u={x:n,y:r},d=await ed(t,l),f=wc(mi(o)),p=wx(f);let g=u[p],b=u[f];if(i){const x=p==="y"?"top":"left",_=p==="y"?"bottom":"right",w=g+d[x],C=g-d[_];g=z0(w,g,C)}if(s){const x=f==="y"?"top":"left",_=f==="y"?"bottom":"right",w=b+d[x],C=b-d[_];b=z0(w,b,C)}const y=a.fn({...t,[p]:g,[f]:b});return{...y,data:{x:y.x-n,y:y.y-r}}}}},oY=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:u=!0}=gi(e,t),d={x:n,y:r},f=wc(o),p=wx(f);let g=d[p],b=d[f];const y=gi(a,t),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(l){const C=p==="y"?"height":"width",R=i.reference[p]-i.floating[C]+x.mainAxis,E=i.reference[p]+i.reference[C]-x.mainAxis;g<R?g=R:g>E&&(g=E)}if(u){var _,w;const C=p==="y"?"width":"height",R=["top","left"].includes(mi(o)),E=i.reference[f]-i.floating[C]+(R&&((_=s.offset)==null?void 0:_[f])||0)+(R?0:x.crossAxis),T=i.reference[f]+i.reference[C]+(R?0:((w=s.offset)==null?void 0:w[f])||0)-(R?x.crossAxis:0);b<E?b=E:b>T&&(b=T)}return{[p]:g,[f]:b}}}},iY=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}=gi(e,t),l=await ed(t,a),u=mi(n),d=xc(n),f=wc(n)==="y",{width:p,height:g}=r.floating;let b,y;u==="top"||u==="bottom"?(b=u,y=d===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(y=u,b=d==="end"?"top":"bottom");const x=g-l[b],_=p-l[y],w=!t.middlewareData.shift;let C=x,R=_;if(f){const T=p-l.left-l.right;R=d||w?ls(_,T):T}else{const T=g-l.top-l.bottom;C=d||w?ls(x,T):T}if(w&&!d){const T=br(l.left,0),O=br(l.right,0),D=br(l.top,0),I=br(l.bottom,0);f?R=p-2*(T!==0||O!==0?T+O:br(l.left,l.right)):C=g-2*(D!==0||I!==0?D+I:br(l.top,l.bottom))}await s({...t,availableWidth:R,availableHeight:C});const E=await o.getDimensions(i.floating);return p!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}};function us(e){return I2(e)?(e.nodeName||"").toLowerCase():"#document"}function wr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xi(e){var t;return(t=(I2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function I2(e){return e instanceof Node||e instanceof wr(e).Node}function vi(e){return e instanceof Element||e instanceof wr(e).Element}function Do(e){return e instanceof HTMLElement||e instanceof wr(e).HTMLElement}function WE(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wr(e).ShadowRoot}function Ld(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Wr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function sY(e){return["table","td","th"].includes(us(e))}function Cx(e){const t=Ex(),n=Wr(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 aY(e){let t=ac(e);for(;Do(t)&&!bg(t);){if(Cx(t))return t;t=ac(t)}return null}function Ex(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function bg(e){return["html","body","#document"].includes(us(e))}function Wr(e){return wr(e).getComputedStyle(e)}function yg(e){return vi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ac(e){if(us(e)==="html")return e;const t=e.assignedSlot||e.parentNode||WE(e)&&e.host||xi(e);return WE(t)?t.host:t}function k2(e){const t=ac(e);return bg(t)?e.ownerDocument?e.ownerDocument.body:e.body:Do(t)&&Ld(t)?t:k2(t)}function td(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=k2(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=wr(o);return i?t.concat(s,s.visualViewport||[],Ld(o)?o:[],s.frameElement&&n?td(s.frameElement):[]):t.concat(o,td(o,[],n))}function N2(e){const t=Wr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Do(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=wp(n)!==i||wp(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Rx(e){return vi(e)?e:e.contextElement}function Ol(e){const t=Rx(e);if(!Do(t))return cs(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=N2(t);let s=(i?wp(n.width):n.width)/r,a=(i?wp(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const lY=cs(0);function L2(e){const t=wr(e);return!Ex()||!t.visualViewport?lY:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cY(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==wr(e)?!1:t}function $a(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Rx(e);let s=cs(1);t&&(r?vi(r)&&(s=Ol(r)):s=Ol(e));const a=cY(i,n,r)?L2(i):cs(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,d=o.width/s.x,f=o.height/s.y;if(i){const p=wr(i),g=r&&vi(r)?wr(r):r;let b=p.frameElement;for(;b&&r&&g!==p;){const y=Ol(b),x=b.getBoundingClientRect(),_=Wr(b),w=x.left+(b.clientLeft+parseFloat(_.paddingLeft))*y.x,C=x.top+(b.clientTop+parseFloat(_.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,f*=y.y,l+=w,u+=C,b=wr(b).frameElement}}return Sp({width:d,height:f,x:l,y:u})}function uY(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Do(n),i=xi(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=cs(1);const l=cs(0);if((o||!o&&r!=="fixed")&&((us(n)!=="body"||Ld(i))&&(s=yg(n)),Do(n))){const u=$a(n);a=Ol(n),l.x=u.x+n.clientLeft,l.y=u.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 dY(e){return Array.from(e.getClientRects())}function F2(e){return $a(xi(e)).left+yg(e).scrollLeft}function fY(e){const t=xi(e),n=yg(e),r=e.ownerDocument.body,o=br(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=br(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+F2(e);const a=-n.scrollTop;return Wr(r).direction==="rtl"&&(s+=br(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function hY(e,t){const n=wr(e),r=xi(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=Ex();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function pY(e,t){const n=$a(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Do(e)?Ol(e):cs(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function UE(e,t,n){let r;if(t==="viewport")r=hY(e,n);else if(t==="document")r=fY(xi(e));else if(vi(t))r=pY(t,n);else{const o=L2(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Sp(r)}function z2(e,t){const n=ac(e);return n===t||!vi(n)||bg(n)?!1:Wr(n).position==="fixed"||z2(n,t)}function gY(e,t){const n=t.get(e);if(n)return n;let r=td(e,[],!1).filter(a=>vi(a)&&us(a)!=="body"),o=null;const i=Wr(e).position==="fixed";let s=i?ac(e):e;for(;vi(s)&&!bg(s);){const a=Wr(s),l=Cx(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ld(s)&&!l&&z2(e,s))?r=r.filter(d=>d!==s):o=a,s=ac(s)}return t.set(e,r),r}function mY(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?gY(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,d)=>{const f=UE(t,d,o);return u.top=br(f.top,u.top),u.right=ls(f.right,u.right),u.bottom=ls(f.bottom,u.bottom),u.left=br(f.left,u.left),u},UE(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function vY(e){return N2(e)}function bY(e,t,n){const r=Do(t),o=xi(t),i=n==="fixed",s=$a(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=cs(0);if(r||!r&&!i)if((us(t)!=="body"||Ld(o))&&(a=yg(t)),r){const u=$a(t,!0,i,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else o&&(l.x=F2(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function qE(e,t){return!Do(e)||Wr(e).position==="fixed"?null:t?t(e):e.offsetParent}function j2(e,t){const n=wr(e);if(!Do(e))return n;let r=qE(e,t);for(;r&&sY(r)&&Wr(r).position==="static";)r=qE(r,t);return r&&(us(r)==="html"||us(r)==="body"&&Wr(r).position==="static"&&!Cx(r))?n:r||aY(e)||n}const yY=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||j2,i=this.getDimensions;return{reference:bY(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function xY(e){return Wr(e).direction==="rtl"}const wY={convertOffsetParentRelativeRectToViewportRelativeRect:uY,getDocumentElement:xi,getClippingRect:mY,getOffsetParent:j2,getElementRects:yY,getClientRects:dY,getDimensions:vY,getScale:Ol,isElement:vi,isRTL:xY};function _Y(e,t){let n=null,r;const o=xi(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:u,top:d,width:f,height:p}=e.getBoundingClientRect();if(a||t(),!f||!p)return;const g=vh(d),b=vh(o.clientWidth-(u+f)),y=vh(o.clientHeight-(d+p)),x=vh(u),w={rootMargin:-g+"px "+-b+"px "+-y+"px "+-x+"px",threshold:br(0,ls(1,l))||1};let C=!0;function R(E){const T=E[0].intersectionRatio;if(T!==l){if(!C)return s();T?s(!1,T):r=setTimeout(()=>{s(!1,1e-7)},100)}C=!1}try{n=new IntersectionObserver(R,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,w)}n.observe(e)}return s(!0),i}function SY(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,u=Rx(e),d=o||i?[...u?td(u):[],...td(t)]:[];d.forEach(_=>{o&&_.addEventListener("scroll",n,{passive:!0}),i&&_.addEventListener("resize",n)});const f=u&&a?_Y(u,n):null;let p=-1,g=null;s&&(g=new ResizeObserver(_=>{let[w]=_;w&&w.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{g&&g.observe(t)})),n()}),u&&!l&&g.observe(u),g.observe(t));let b,y=l?$a(e):null;l&&x();function x(){const _=$a(e);y&&(_.x!==y.x||_.y!==y.y||_.width!==y.width||_.height!==y.height)&&n(),y=_,b=requestAnimationFrame(x)}return n(),()=>{d.forEach(_=>{o&&_.removeEventListener("scroll",n),i&&_.removeEventListener("resize",n)}),f&&f(),g&&g.disconnect(),g=null,l&&cancelAnimationFrame(b)}}const CY=(e,t,n)=>{const r=new Map,o={platform:wY,...n},i={...o.platform,_c:r};return ZG(e,t,{...o,platform:i})},EY=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?VE({element:r.current,padding:o}).fn(n):{}:r?VE({element:r,padding:o}).fn(n):{}}}};var Uh=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Cp(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(!Cp(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)&&!Cp(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function V2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function GE(e,t){const n=V2(e);return Math.round(t*n)/n}function YE(e){const t=ie.useRef(e);return Uh(()=>{t.current=e}),t}function RY(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:u}=e,[d,f]=ie.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=ie.useState(r);Cp(p,r)||g(r);const[b,y]=ie.useState(null),[x,_]=ie.useState(null),w=ie.useCallback(Z=>{Z!=T.current&&(T.current=Z,y(Z))},[y]),C=ie.useCallback(Z=>{Z!==O.current&&(O.current=Z,_(Z))},[_]),R=i||b,E=s||x,T=ie.useRef(null),O=ie.useRef(null),D=ie.useRef(d),I=YE(l),N=YE(o),V=ie.useCallback(()=>{if(!T.current||!O.current)return;const Z={placement:t,strategy:n,middleware:p};N.current&&(Z.platform=N.current),CY(T.current,O.current,Z).then(Y=>{const Q={...Y,isPositioned:!0};G.current&&!Cp(D.current,Q)&&(D.current=Q,xL.flushSync(()=>{f(Q)}))})},[p,t,n,N]);Uh(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,f(Z=>({...Z,isPositioned:!1})))},[u]);const G=ie.useRef(!1);Uh(()=>(G.current=!0,()=>{G.current=!1}),[]),Uh(()=>{if(R&&(T.current=R),E&&(O.current=E),R&&E){if(I.current)return I.current(R,E,V);V()}},[R,E,V,I]);const le=ie.useMemo(()=>({reference:T,floating:O,setReference:w,setFloating:C}),[w,C]),ee=ie.useMemo(()=>({reference:R,floating:E}),[R,E]),F=ie.useMemo(()=>{const Z={position:n,left:0,top:0};if(!ee.floating)return Z;const Y=GE(ee.floating,d.x),Q=GE(ee.floating,d.y);return a?{...Z,transform:"translate("+Y+"px, "+Q+"px)",...V2(ee.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:Q}},[n,a,ee.floating,d.x,d.y]);return ie.useMemo(()=>({...d,update:V,refs:le,elements:ee,floatingStyles:F}),[d,V,le,ee,F])}function xg(e){const[t,n]=m.useState(void 0);return kn(()=>{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,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.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 B2="Popper",[H2,Lo]=mn(B2),[$Y,W2]=H2(B2),PY=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return m.createElement($Y,{scope:t,anchor:r,onAnchorChange:o},n)},OY="PopperAnchor",MY=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=W2(OY,n),s=m.useRef(null),a=Xe(t,s);return m.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:m.createElement(ke.div,ne({},o,{ref:a}))}),U2="PopperContent",[DY,ple]=H2(U2),TY=m.forwardRef((e,t)=>{var n,r,o,i,s,a,l,u;const{__scopePopper:d,side:f="bottom",sideOffset:p=0,align:g="center",alignOffset:b=0,arrowPadding:y=0,avoidCollisions:x=!0,collisionBoundary:_=[],collisionPadding:w=0,sticky:C="partial",hideWhenDetached:R=!1,updatePositionStrategy:E="optimized",onPlaced:T,...O}=e,D=W2(U2,d),[I,N]=m.useState(null),V=Xe(t,Ve=>N(Ve)),[G,le]=m.useState(null),ee=xg(G),F=(n=ee==null?void 0:ee.width)!==null&&n!==void 0?n:0,Z=(r=ee==null?void 0:ee.height)!==null&&r!==void 0?r:0,Y=f+(g!=="center"?"-"+g:""),Q=typeof w=="number"?w:{top:0,right:0,bottom:0,left:0,...w},ae=Array.isArray(_)?_:[_],j=ae.length>0,B={padding:Q,boundary:ae.filter(AY),altBoundary:j},{refs:te,floatingStyles:ce,placement:ue,isPositioned:ge,middlewareData:ve}=RY({strategy:"fixed",placement:Y,whileElementsMounted:(...Ve)=>SY(...Ve,{animationFrame:E==="always"}),elements:{reference:D.anchor},middleware:[nY({mainAxis:p+Z,alignmentAxis:b}),x&&rY({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?oY():void 0,...B}),x&&JG({...B}),iY({...B,apply:({elements:Ve,rects:qe,availableWidth:gt,availableHeight:ft})=>{const{width:ht,height:Gt}=qe.reference,Wt=Ve.floating.style;Wt.setProperty("--radix-popper-available-width",`${gt}px`),Wt.setProperty("--radix-popper-available-height",`${ft}px`),Wt.setProperty("--radix-popper-anchor-width",`${ht}px`),Wt.setProperty("--radix-popper-anchor-height",`${Gt}px`)}}),G&&EY({element:G,padding:y}),IY({arrowWidth:F,arrowHeight:Z}),R&&eY({strategy:"referenceHidden",...B})]}),[de,J]=q2(ue),X=cn(T);kn(()=>{ge&&(X==null||X())},[ge,X]);const re=(o=ve.arrow)===null||o===void 0?void 0:o.x,be=(i=ve.arrow)===null||i===void 0?void 0:i.y,H=((s=ve.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[De,Ne]=m.useState();return kn(()=>{I&&Ne(window.getComputedStyle(I).zIndex)},[I]),m.createElement("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...ce,transform:ge?ce.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:De,"--radix-popper-transform-origin":[(a=ve.transformOrigin)===null||a===void 0?void 0:a.x,(l=ve.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},m.createElement(DY,{scope:d,placedSide:de,onArrowChange:le,arrowX:re,arrowY:be,shouldHideArrow:H},m.createElement(ke.div,ne({"data-side":de,"data-align":J},O,{ref:V,style:{...O.style,animation:ge?void 0:"none",opacity:(u=ve.hide)!==null&&u!==void 0&&u.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:u}=t,f=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,p=f?0:e.arrowWidth,g=f?0:e.arrowHeight,[b,y]=q2(a),x={start:"0%",center:"50%",end:"100%"}[y],_=((r=(o=u.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+p/2,w=((i=(s=u.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+g/2;let C="",R="";return b==="bottom"?(C=f?x:`${_}px`,R=`${-g}px`):b==="top"?(C=f?x:`${_}px`,R=`${l.floating.height+g}px`):b==="right"?(C=`${-g}px`,R=f?x:`${w}px`):b==="left"&&(C=`${l.floating.width+g}px`,R=f?x:`${w}px`),{data:{x:C,y:R}}}});function q2(e){const[t,n="center"]=e.split("-");return[t,n]}const Fd=PY,zd=MY,jd=TY,wg=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?Ao.createPortal(m.createElement(ke.div,ne({},o,{ref:t})),r):null}),G2=m.forwardRef((e,t)=>m.createElement(ke.span,ne({},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}}))),kY=G2,[_g,gle]=mn("Tooltip",[Lo]),$x=Lo(),NY="TooltipProvider",LY=700,V0="tooltip.open",[FY,Px]=_g(NY),zY=e=>{const{__scopeTooltip:t,delayDuration:n=LY,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=m.useState(!0),l=m.useRef(!1),u=m.useRef(0);return m.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),m.createElement(FY,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:m.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:m.useCallback(d=>{l.current=d},[]),disableHoverableContent:o},i)},Ox="Tooltip",[jY,Sg]=_g(Ox),VY=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=Px(Ox,e.__scopeTooltip),u=$x(t),[d,f]=m.useState(null),p=nr(),g=m.useRef(0),b=s??l.disableHoverableContent,y=a??l.delayDuration,x=m.useRef(!1),[_=!1,w]=Nn({prop:r,defaultProp:o,onChange:O=>{O?(l.onOpen(),document.dispatchEvent(new CustomEvent(V0))):l.onClose(),i==null||i(O)}}),C=m.useMemo(()=>_?x.current?"delayed-open":"instant-open":"closed",[_]),R=m.useCallback(()=>{window.clearTimeout(g.current),x.current=!1,w(!0)},[w]),E=m.useCallback(()=>{window.clearTimeout(g.current),w(!1)},[w]),T=m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,w(!0)},y)},[y,w]);return m.useEffect(()=>()=>window.clearTimeout(g.current),[]),m.createElement(Fd,u,m.createElement(jY,{scope:t,contentId:p,open:_,stateAttribute:C,trigger:d,onTriggerChange:f,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?T():R()},[l.isOpenDelayed,T,R]),onTriggerLeave:m.useCallback(()=>{b?E():window.clearTimeout(g.current)},[E,b]),onOpen:R,onClose:E,disableHoverableContent:b},n))},KE="TooltipTrigger",Y2=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Sg(KE,n),i=Px(KE,n),s=$x(n),a=m.useRef(null),l=Xe(t,a,o.onTriggerChange),u=m.useRef(!1),d=m.useRef(!1),f=m.useCallback(()=>u.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),m.createElement(zd,ne({asChild:!0},s),m.createElement(ke.button,ne({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:we(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:we(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:we(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:we(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:we(e.onBlur,o.onClose),onClick:we(e.onClick,o.onClose)})))}),BY="TooltipPortal",[mle,HY]=_g(BY,{forceMount:void 0}),nd="TooltipContent",WY=m.forwardRef((e,t)=>{const n=HY(nd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=Sg(nd,e.__scopeTooltip);return m.createElement(nn,{present:r||s.open},s.disableHoverableContent?m.createElement(K2,ne({side:o},i,{ref:t})):m.createElement(UY,ne({side:o},i,{ref:t})))}),UY=m.forwardRef((e,t)=>{const n=Sg(nd,e.__scopeTooltip),r=Px(nd,e.__scopeTooltip),o=m.useRef(null),i=Xe(t,o),[s,a]=m.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:f}=r,p=m.useCallback(()=>{a(null),f(!1)},[f]),g=m.useCallback((b,y)=>{const x=b.currentTarget,_={x:b.clientX,y:b.clientY},w=GY(_,x.getBoundingClientRect()),C=YY(_,w),R=KY(y.getBoundingClientRect()),E=QY([...C,...R]);a(E),f(!0)},[f]);return m.useEffect(()=>()=>p(),[p]),m.useEffect(()=>{if(l&&d){const b=x=>g(x,d),y=x=>g(x,l);return l.addEventListener("pointerleave",b),d.addEventListener("pointerleave",y),()=>{l.removeEventListener("pointerleave",b),d.removeEventListener("pointerleave",y)}}},[l,d,g,p]),m.useEffect(()=>{if(s){const b=y=>{const x=y.target,_={x:y.clientX,y:y.clientY},w=(l==null?void 0:l.contains(x))||(d==null?void 0:d.contains(x)),C=!XY(_,s);w?p():C&&(p(),u())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,d,s,u,p]),m.createElement(K2,ne({},e,{ref:i}))}),[qY,vle]=_g(Ox,{isInside:!1}),K2=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=Sg(nd,n),u=$x(n),{onClose:d}=l;return m.useEffect(()=>(document.addEventListener(V0,d),()=>document.removeEventListener(V0,d)),[d]),m.useEffect(()=>{if(l.trigger){const f=p=>{const g=p.target;g!=null&&g.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),m.createElement(yc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:d},m.createElement(jd,ne({"data-state":l.stateAttribute},u,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(wP,null,r),m.createElement(qY,{scope:n,isInside:!0},m.createElement(kY,{id:l.contentId,role:"tooltip"},o||r))))});function GY(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 YY(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 KY(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 XY(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,u=t[s].x,d=t[s].y;l>r!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function QY(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 JY=zY,eK=VY,tK=Y2,X2=WY,nK=JY,Q2=eK,Z2=tK,Mx=ie.forwardRef(({className:e,sideOffset:t=4,...n},r)=>k.jsx(X2,{ref:r,sideOffset:t,className:Se("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}));Mx.displayName=X2.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 rK=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),J2=(...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 oK={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 iK=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,...oK,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:J2("lucide",o),...a},[...s.map(([u,d])=>m.createElement(u,d)),...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 Rr=(e,t)=>{const n=m.forwardRef(({className:r,...o},i)=>m.createElement(iK,{ref:i,iconNode:t,className:J2(`lucide-${rK(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 eM=Rr("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 Vd=Rr("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 Cg=Rr("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 sK=Rr("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 tM=Rr("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 aK=Rr("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 nM=Rr("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 lK=Rr("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 Dx=Rr("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 rM=Rr("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"}]]);/**
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 cK=Rr("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"}]]);/**
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 oM=Rr("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function XE({number:e,format:t,useSuffix:n=!1,customSuffix:r="",currency:o="",locale:i="en-US"}){let s=1,a=r,l=i;const u=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 d=e/s,f={maximumFractionDigits:u,minimumFractionDigits:u};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 g=new Intl.NumberFormat(l,f).format(d);return n&&(g+=a),g}function iM({card:e,isLoading:t}){var x,_,w,C,R,E,T,O,D,I,N,V,G,le,ee,F,Z,Y;const n=Ee(Q=>Q.actions.setCardTitle),r=Ee(Q=>Q.actions.setCardDescription),o=Ee(Q=>Q.isVisualEditing),i=Kt(Q=>Q.card),s=Kt(Q=>Q.actions.setCard);Kt(Q=>Q.actions.setNumberFormat);const a=Ee(Q=>Q.selectedSheetId),l=e.data,{metricKeys:u}=Hr(l||[]),d=(x=l==null?void 0:l[0])==null?void 0:x[u==null?void 0:u[0]],f=(_=l==null?void 0:l[0])==null?void 0:_[u==null?void 0:u[1]],p=!!e.data&&e.data.length>0;function g(Q){o?s({...i,title:Q}):n(a,e.id,Q)}function b(Q){o?s({...i,description:Q}):r(a,e.id,Q)}const y=f&&f-d!==0?(d-f)/f:null;return k.jsxs("div",{className:"kpi-card flex grow flex-col overflow-scroll",children:[k.jsxs(ug,{className:"grow pb-3",children:[k.jsx(Ca,{text:o?i.title:e.title,onSave:g,children:k.jsxs("div",{className:"flex items-center gap-2",children:[k.jsx(dg,{className:"text-base font-medium text-muted-foreground",children:e.title}),!e.refreshInterval&&t&&k.jsx(Dx,{className:"h-4 w-4 animate-spin text-muted-foreground"})]})}),p&&k.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[k.jsx("p",{className:"text-3xl font-semibold",children:XE({number:d,format:((C=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:C.format)||"",useSuffix:!!((E=(R=e.preferences)==null?void 0:R.formatNumber)!=null&&E.suffix),customSuffix:"",locale:((O=(T=e.preferences)==null?void 0:T.formatNumber)==null?void 0:O.locale)||"",currency:((I=(D=e.preferences)==null?void 0:D.formatNumber)==null?void 0:I.currency)||""})}),f&&k.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from  ",XE({number:f,format:((V=(N=e.preferences)==null?void 0:N.formatNumber)==null?void 0:V.format)||"",useSuffix:!!((le=(G=e.preferences)==null?void 0:G.formatNumber)!=null&&le.suffix),customSuffix:"",locale:((F=(ee=e.preferences)==null?void 0:ee.formatNumber)==null?void 0:F.locale)||"",currency:((Y=(Z=e.preferences)==null?void 0:Z.formatNumber)==null?void 0:Y.currency)||""})]})]})]}),y&&k.jsxs(fg,{className:"grow items-start gap-1 pb-4 text-sm",children:[k.jsx(uK,{children:y}),k.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[y>0?"up ":"down ",k.jsx(Ca,{text:e.description||"",onSave:b,children:e.description})]})]})]})}function uK({children:e}){const t=e>0?k.jsx(yx,{className:"h-4 w-4"}):k.jsx(bx,{className:"h-4 w-4"}),n=`${Math.abs(e*100).toFixed(0)}%`;return k.jsxs("div",{className:Se("flex items-center",{"text-green-600":e>0,"text-destructive":e<0}),children:[t,k.jsx("span",{className:"ml-[1px]",children:n})]})}var lc=1e3,cc=lc*60,uc=cc*60,Pa=uc*24,dK=Pa*7,fK=Pa*365.25,hK=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return pK(e);if(n==="number"&&isFinite(e))return t.long?mK(e):gK(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function pK(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*fK;case"weeks":case"week":case"w":return n*dK;case"days":case"day":case"d":return n*Pa;case"hours":case"hour":case"hrs":case"hr":case"h":return n*uc;case"minutes":case"minute":case"mins":case"min":case"m":return n*cc;case"seconds":case"second":case"secs":case"sec":case"s":return n*lc;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function gK(e){var t=Math.abs(e);return t>=Pa?Math.round(e/Pa)+"d":t>=uc?Math.round(e/uc)+"h":t>=cc?Math.round(e/cc)+"m":t>=lc?Math.round(e/lc)+"s":e+"ms"}function mK(e){var t=Math.abs(e);return t>=Pa?bh(e,t,Pa,"day"):t>=uc?bh(e,t,uc,"hour"):t>=cc?bh(e,t,cc,"minute"):t>=lc?bh(e,t,lc,"second"):e+" ms"}function bh(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const vK=Od(hK);function bK(e){Ee(u=>u.bookmarkKey);const t=Ee(u=>u.dashboard.baseQueries),{authToken:n}=Da(),r=Ee(u=>u.authToken),o=Ee(u=>u.filterValues),i=Ee(u=>u.isDashboardEditing),s=vK((e==null?void 0:e.refreshInterval)||"0"),a=u$(e.sql,t);return So({queryKey:[e.id,a],queryFn:()=>jp("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===C$?"":e.python,active_filters:o}),refetchInterval:s,enabled:!!e.connectionId&&!i})}function ul({data:e,cfg:t,customCfg:n,preferences:r}){const{dimensionKeys:o,metricKeys:i}=Hr(e),s=TG(i,e,r),a=N0(s,n),l=o[0],u=D2(e,l);Sa.merge((t==null?void 0:t.options)||{},r==null?void 0:r.chartOptions);const d=L0((t==null?void 0:t.options)||{},(n==null?void 0:n.options)||{});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:u,datasets:a},options:d}}function yK(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}}}}}function xK(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function wK(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 _K(e){return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function SK(e,t){return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}}}}}function CK(e){return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}}}}}function sM({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s}){if(t==="bar"){const a=xK(n);return ul({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="horizontalBar"){const a=yK(n);return ul({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="stackedBar"){const a=wK(n),{dimensionKeys:l,metricKeys:u}=Hr(e),d=xx({dataArray:e,groupKey:l[0],pivotKey:l[1],valueKey:u[0]});return ul({data:d,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="line"){const a=_K(n);return ul({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="pie"||t==="doughnut"||t==="polarArea"){const a=SK(t,n),{dimensionKeys:l,metricKeys:u}=Hr(e),d=kG(u,e),f=N0(d,r),p=l[0],g=D2(e,p),b=L0((a==null?void 0:a.options)||{},(r==null?void 0:r.options)||{});return{type:t,data:{labels:g,datasets:f},options:b}}if(t==="radar"){const a=CK(n);return ul({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:a}=Hr(e);if(a.length<3){console.log("Bubble charts require 3 numeric columns");return}const l=IG(e),u=N0(l,r),d={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=L0(d,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:u},options:f}}return ul({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}function EK({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const s=Ee.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)&&$K(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&PK(e,t,o,i,a),r==="stackedBar"&&RK({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function RK(e){var a,l,u,d;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,p)=>{var g,b;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=(g=f==null?void 0:f.backgroundColor)==null?void 0:g.map((y,x)=>x===n&&p===r?y:s),f.borderColor=(b=f==null?void 0:f.borderColor)==null?void 0:b.map((y,x)=>x===n&&p===r?y:s)}):(d=(u=t==null?void 0:t.data)==null?void 0:u.datasets)==null||d.forEach((f,p)=>{var g,b,y,x,_,w;f.backgroundColor=new Array(f.data.length).fill((y=(b=(g=o==null?void 0:o.data)==null?void 0:g.datasets)==null?void 0:b[p])==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:_[p])==null?void 0:w.borderColor)}),t==null||t.update()}function $K(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(u=>{var d,f;typeof u.backgroundColor=="string"&&(u.backgroundColor=new Array(u.data.length).fill(u.backgroundColor),u.borderColor=new Array(u.data.length).fill(u.borderColor)),u.backgroundColor=(d=u==null?void 0:u.backgroundColor)==null?void 0:d.map((p,g)=>g===t?p:o),u.borderColor=(f=u==null?void 0:u.borderColor)==null?void 0:f.map((p,g)=>g===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((u,d)=>{var f,p,g,b,y,x;u.backgroundColor=new Array(u.data.length).fill((g=(p=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:p[d])==null?void 0:g.backgroundColor),u.borderColor=new Array(u.data.length).fill((x=(y=(b=n==null?void 0:n.data)==null?void 0:b.datasets)==null?void 0:y[d])==null?void 0:x.borderColor)}),e==null||e.update()}function PK(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(u=>{var d,f;u.backgroundColor=(d=u==null?void 0:u.backgroundColor)==null?void 0:d.map((p,g)=>g===t?p:o),u.borderColor=(f=u==null?void 0:u.borderColor)==null?void 0:f.map((p,g)=>g===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((u,d)=>{var f,p,g,b,y,x,_,w;typeof u.backgroundColor=="string"&&(u.backgroundColor=(g=(p=(f=n==null?void 0:n.data)==null?void 0:f.datasets)==null?void 0:p[d])==null?void 0:g.backgroundColor,u.borderColor=(x=(y=(b=n==null?void 0:n.data)==null?void 0:b.datasets)==null?void 0:y[d])==null?void 0:x.borderColor),u.backgroundColor=(_=u==null?void 0:u.backgroundColor)==null?void 0:_.map((C,R)=>{var E;return(E=n.data.datasets[d].backgroundColor)==null?void 0:E[R]}),u.borderColor=(w=u==null?void 0:u.borderColor)==null?void 0:w.map((C,R)=>{var E;return(E=n.data.datasets[d].borderColor)==null?void 0:E[R]})}),e==null||e.update()}function OK(e,t,n,r){var o,i;try{if(!e||!e.data)return;const{dimensionKeys:s,metricKeys:a}=Hr(e.data);if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const l=s[0],u=(o=e.data[n])==null?void 0:o[l];return[{columnName:l,columnValue:u,metric:a[t],value:r}]}if(e.type==="stackedBar"){const l=xx({dataArray:e.data,groupKey:s[0],pivotKey:s[1],valueKey:a[0]}),u=s[0],d=(i=l[n])==null?void 0:i[u],f=s[1],{metricKeys:p}=Hr(l),g=p[t];return[{columnName:u,columnValue:d,metric:a[0],value:r},{columnName:f,columnValue:g,metric:a[0],value:r}]}if(e.type==="bubble"||e.type==="scatter"){const l=s[0],u=r.label;return[{columnName:l,columnValue:u,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 MK(e){var s,a;const[t]=m.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=Ta(),r=n(e),o=Tx(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 Tx(e){var V,G,le;const{onChartElementClicked:t}=Da(),[n,r]=m.useState(0),o=((V=e==null?void 0:e.preferences)==null?void 0:V.filterOnClickColumnIndex)===void 0?0:(G=e.preferences)==null?void 0:G.filterOnClickColumnIndex,i=Ee(ee=>ee.bookmarkKey);Ee(ee=>ee.isVisualEditing);const s=Ee(ee=>ee.filteringCards),a=Ee(ee=>ee.selectedSheetId);Ee(ee=>ee.selectedCardId),Ee(ee=>ee.isDashboardEditing);const l=Ee(ee=>ee.themeStyle),u=Ee(ee=>ee.filterValues),d=(le=e==null?void 0:e.preferences)==null?void 0:le.onClickFilter,{addFrame:f,addFilteringCard:p,setFrameCardData:g,getSelectedFrame:b,addOrUpdateFilterValue:y,addOrUpdateFilterValues:x,removeFilterValue:_,removeFilteringCard:w}=Ta(),{data:C,isLoading:R,isFetching:E,isError:T,refetch:O}=bK(e),D=s==null?void 0:s.find(ee=>ee.id===e.id);let I;e.data&&e.data.length>0&&(I=sM({data:e.data,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences})),m.useEffect(()=>{!C||!C.records||g(a,e.id,(C==null?void 0:C.records)||[])},[C,a,e.id,g,u]),m.useEffect(()=>{e.data&&r(n+1)},[e.data,e.type,e.cfg,e.customCfg,e.preferences,l]),m.useEffect(()=>{e.connectionId&&!D&&O()},[u,i]);function N(ee,F,Z,Y){var j,B;let Q=!1;if(!e.data)return;const ae=OK(e,F,Z,Y);if(console.log("fieldValues",ae),t==null||t(e,ae),!!(((j=e==null?void 0:e.preferences)==null?void 0:j.onClickFilter)??[]).length){if(D){const te=e.id;_(te),w(e)}else{if(Q=!0,!ae)return;const te=[];ae.forEach((ce,ue)=>{const ge=d==null?void 0:d.find(de=>de.columnIndex===ue);if(!ge)return;const ve={filterId:e.id+"-"+ce.columnName,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:ce.columnName,expression:ge.expression,valueType:qu(ae[ge.columnIndex].columnValue),operation:"=",values:[ae[ge.columnIndex].columnValue]};te.push(ve)}),e.id,e==null||e.connectionId,e.lastSelectedTable,ae[o].columnName,(B=e.preferences)==null||B.filterOnClickField,qu(ae[o].columnValue),ae[o].columnValue,x(te),p(e)}EK({chart:ee,elementIndex:Z,datasetIndex:F,cardType:e.type,cfg:I,apply:Q})}}return{isError:T,isLoading:R,isFetching:E,data:C,visualKey:n,handleDatapointClick:N,cfg:I}}function DK(e,t){const n=Ee(d=>d.selectedSheetId),r=Ee(d=>d.selectedFrameId),o=Ee(d=>d.isDashboardEditing),i=Ee(d=>d.isVisualEditing),{addFrame:s,getSelectedFrame:a,setSelectedFrameId:l}=Ee(d=>d.actions);m.useEffect(()=>{const d=p=>{if(o&&((p.metaKey||p.ctrlKey)&&p.key==="c"&&navigator.clipboard.writeText(JSON.stringify(a())),(p.ctrlKey||p.metaKey)&&p.key==="v"))try{navigator.clipboard.readText().then(g=>{try{const b=JSON.parse(g);if(b&&b.id){b.id=Vu();const y=b.activeCardId;b.cards.forEach(x=>{const _=x.id;x.id=Vu(),_===y&&(b.activeCardId=x.id,x.title=`${x.title} (Copy)`)}),s(n,b),l(b.id)}}catch(b){console.error("Failed to parse clipboard contents: ",b)}})}catch(g){console.error("Failed to read clipboard contents: ",g)}},f=t==null?void 0:t.current;return f==null||f.addEventListener("keydown",d),()=>{f==null||f.removeEventListener("keydown",d)}},[o,n,a,s,t,l]),m.useEffect(()=>{r===e.id&&o&&!i&&u()},[r,e.id,o,i]);function u(){const d=t==null?void 0:t.current;d==null||d.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}let Uv;const aM="HoverCard",[lM,ble]=mn(aM,[Lo]),Ax=Lo(),[TK,Ix]=lM(aM),AK=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=Ax(t),u=m.useRef(0),d=m.useRef(0),f=m.useRef(!1),p=m.useRef(!1),[g=!1,b]=Nn({prop:r,defaultProp:o,onChange:i}),y=m.useCallback(()=>{clearTimeout(d.current),u.current=window.setTimeout(()=>b(!0),s)},[s,b]),x=m.useCallback(()=>{clearTimeout(u.current),!f.current&&!p.current&&(d.current=window.setTimeout(()=>b(!1),a))},[a,b]),_=m.useCallback(()=>b(!1),[b]);return m.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(d.current)},[]),m.createElement(TK,{scope:t,open:g,onOpenChange:b,onOpen:y,onClose:x,onDismiss:_,hasSelectionRef:f,isPointerDownOnContentRef:p},m.createElement(Fd,l,n))},IK="HoverCardTrigger",kK=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=Ix(IK,n),i=Ax(n);return m.createElement(zd,ne({asChild:!0},i),m.createElement(ke.a,ne({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:we(e.onPointerEnter,Ep(o.onOpen)),onPointerLeave:we(e.onPointerLeave,Ep(o.onClose)),onFocus:we(e.onFocus,o.onOpen),onBlur:we(e.onBlur,o.onClose),onTouchStart:we(e.onTouchStart,s=>s.preventDefault())})))}),NK="HoverCardPortal",[yle,LK]=lM(NK,{forceMount:void 0}),B0="HoverCardContent",FK=m.forwardRef((e,t)=>{const n=LK(B0,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=Ix(B0,e.__scopeHoverCard);return m.createElement(nn,{present:r||i.open},m.createElement(zK,ne({"data-state":i.open?"open":"closed"},o,{onPointerEnter:we(e.onPointerEnter,Ep(i.onOpen)),onPointerLeave:we(e.onPointerLeave,Ep(i.onClose)),ref:t})))}),zK=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=Ix(B0,n),u=Ax(n),d=m.useRef(null),f=Xe(t,d),[p,g]=m.useState(!1);return m.useEffect(()=>{if(p){const b=document.body;return Uv=b.style.userSelect||b.style.webkitUserSelect,b.style.userSelect="none",b.style.webkitUserSelect="none",()=>{b.style.userSelect=Uv,b.style.webkitUserSelect=Uv}}},[p]),m.useEffect(()=>{if(d.current){const b=()=>{g(!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",b),()=>{document.removeEventListener("pointerup",b),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),m.useEffect(()=>{d.current&&jK(d.current).forEach(y=>y.setAttribute("tabindex","-1"))}),m.createElement(yc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:we(i,b=>{b.preventDefault()}),onDismiss:l.onDismiss},m.createElement(jd,ne({},u,a,{onPointerDown:we(a.onPointerDown,b=>{b.currentTarget.contains(b.target)&&g(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:f,style:{...a.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"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 Ep(e){return t=>t.pointerType==="touch"?void 0:e()}function jK(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 VK=AK,BK=kK,cM=FK,uM=VK,dM=BK,kx=ie.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>k.jsx(cM,{ref:o,align:t,sideOffset:n,className:Se("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}));kx.displayName=cM.displayName;function HK({card:e}){const{setCardInfo:t}=Ta();return k.jsxs(uM,{openDelay:0,children:[k.jsx(dM,{children:k.jsx(lK,{className:"size-4 text-muted-foreground/40"})}),k.jsx(kx,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:k.jsx(Ca,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:k.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Add Info"})})})]})}const Nx=ie.forwardRef(({className:e,...t},n)=>k.jsx("div",{className:"relative w-full overflow-auto",children:k.jsx("table",{ref:n,className:Se("w-full caption-bottom text-sm",e),...t})}));Nx.displayName="Table";const Lx=ie.forwardRef(({className:e,...t},n)=>k.jsx("thead",{ref:n,className:Se("[&_tr]:border-b",e),...t}));Lx.displayName="TableHeader";const Fx=ie.forwardRef(({className:e,...t},n)=>k.jsx("tbody",{ref:n,className:Se("[&_tr:last-child]:border-0",e),...t}));Fx.displayName="TableBody";const WK=ie.forwardRef(({className:e,...t},n)=>k.jsx("tfoot",{ref:n,className:Se("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));WK.displayName="TableFooter";const Tu=ie.forwardRef(({className:e,...t},n)=>k.jsx("tr",{ref:n,className:Se("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Tu.displayName="TableRow";const zx=ie.forwardRef(({className:e,...t},n)=>k.jsx("th",{ref:n,className:Se("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));zx.displayName="TableHead";const Rp=ie.forwardRef(({className:e,...t},n)=>k.jsx("td",{ref:n,className:Se("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Rp.displayName="TableCell";const UK=ie.forwardRef(({className:e,...t},n)=>k.jsx("caption",{ref:n,className:Se("mt-4 text-sm text-muted-foreground",e),...t}));UK.displayName="TableCaption";/**
213
- * table-core
214
- *
215
- * Copyright (c) TanStack
216
- *
217
- * This source code is licensed under the MIT license found in the
218
- * LICENSE.md file in the root directory of this source tree.
219
- *
220
- * @license MIT
221
- */function Ji(e,t){return typeof e=="function"?e(t):e}function Cr(e,t){return n=>{t.setState(r=>({...r,[e]:Ji(n,r[e])}))}}function $p(e){return e instanceof Function}function qK(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function GK(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 We(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((u,d)=>r[d]!==u)))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 u=Math.round((Date.now()-i)*100)/100,d=Math.round((Date.now()-l)*100)/100,f=d/16,p=(g,b)=>{for(g=String(g);g.length<b;)g=" "+g;return g};console.info(`%c⏱ ${p(d,5)} /${p(u,5)} ms`,`
222
- font-size: .6rem;
223
- font-weight: bold;
224
- color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function YK(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let u=(o=(i=a.id)!=null?i:l?l.replace(".","_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,d;if(a.accessorFn?d=a.accessorFn:l&&(l.includes(".")?d=p=>{let g=p;for(const y of l.split(".")){var b;g=(b=g)==null?void 0:b[y],process.env.NODE_ENV!=="production"&&g===void 0&&console.warn(`"${y}" in deeply nested key "${l}" returned undefined.`)}return g}:d=p=>p[a.accessorKey]),!u)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(u)}`,accessorFn:d,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:We(()=>[!0],()=>{var p;return[f,...(p=f.columns)==null?void 0:p.flatMap(g=>g.getFlatColumns())]},{key:process.env.NODE_ENV==="production"&&"column.getFlatColumns",debug:()=>{var p;return(p=e.options.debugAll)!=null?p:e.options.debugColumns}}),getLeafColumns:We(()=>[e._getOrderColumnsFn()],p=>{var g;if((g=f.columns)!=null&&g.length){let b=f.columns.flatMap(y=>y.getLeafColumns());return p(b)}return[f]},{key:process.env.NODE_ENV==="production"&&"column.getLeafColumns",debug:()=>{var p;return(p=e.options.debugAll)!=null?p:e.options.debugColumns}})};for(const p of e._features)p.createColumn==null||p.createColumn(f,e);return f}function QE(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 KK={createTable:e=>{e.getHeaderGroups=We(()=>[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(p=>p.id===f)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(f=>n.find(p=>p.id===f)).filter(Boolean))!=null?s:[],u=n.filter(f=>!(r!=null&&r.includes(f.id))&&!(o!=null&&o.includes(f.id)));return yh(t,[...a,...u,...l],e)},{key:process.env.NODE_ENV==="development"&&"getHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterHeaderGroups=We(()=>[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))),yh(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=We(()=>[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 yh(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=We(()=>[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 yh(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=We(()=>[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=We(()=>[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=We(()=>[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=We(()=>[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=We(()=>[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=We(()=>[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=We(()=>[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=We(()=>[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=We(()=>[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=We(()=>[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=We(()=>[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=We(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,u;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(u=r[0])==null?void 0:u.headers)!=null?l:[]].map(d=>d.getLeafHeaders()).flat()},{key:process.env.NODE_ENV==="development"&&"getLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})}};function yh(e,t,n,r){var o,i;let s=0;const a=function(p,g){g===void 0&&(g=1),s=Math.max(s,g),p.filter(b=>b.getIsVisible()).forEach(b=>{var y;(y=b.columns)!=null&&y.length&&a(b.columns,g+1)},0)};a(e);let l=[];const u=(p,g)=>{const b={depth:g,id:[r,`${g}`].filter(Boolean).join("_"),headers:[]},y=[];p.forEach(x=>{const _=[...y].reverse()[0],w=x.column.depth===b.depth;let C,R=!1;if(w&&x.column.parent?C=x.column.parent:(C=x.column,R=!0),_&&(_==null?void 0:_.column)===C)_.subHeaders.push(x);else{const E=QE(n,C,{id:[r,g,C.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${y.filter(T=>T.column===C).length}`:void 0,depth:g,index:y.length});E.subHeaders.push(x),y.push(E)}b.headers.push(x),x.headerGroup=b}),l.push(b),g>0&&u(y,g-1)},d=t.map((p,g)=>QE(n,p,{depth:s,index:g}));u(d,s-1),l.reverse();const f=p=>p.filter(b=>b.column.getIsVisible()).map(b=>{let y=0,x=0,_=[0];b.subHeaders&&b.subHeaders.length?(_=[],f(b.subHeaders).forEach(C=>{let{colSpan:R,rowSpan:E}=C;y+=R,_.push(E)})):y=1;const w=Math.min(..._);return x=x+w,b.colSpan=y,b.rowSpan=x,{colSpan:y,rowSpan:x}});return f((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const xh={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},qv=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),XK={getDefaultColumnDef:()=>xh,getInitialState:e=>({columnSizing:{},columnSizingInfo:qv(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Cr("columnSizing",e),onColumnSizingInfoChange:Cr("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:xh.minSize,(r=i??e.columnDef.size)!=null?r:xh.size),(o=e.columnDef.maxSize)!=null?o:xh.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(),Gv(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(_=>[_.column.id,_.column.getSize()]):[[r.id,r.getSize()]],l=Gv(i)?Math.round(i.touches[0].clientX):i.clientX,u={},d=(_,w)=>{typeof w=="number"&&(t.setColumnSizingInfo(C=>{var R,E;const T=t.options.columnResizeDirection==="rtl"?-1:1,O=(w-((R=C==null?void 0:C.startOffset)!=null?R:0))*T,D=Math.max(O/((E=C==null?void 0:C.startSize)!=null?E:0),-.999999);return C.columnSizingStart.forEach(I=>{let[N,V]=I;u[N]=Math.round(Math.max(V+V*D,0)*100)/100}),{...C,deltaOffset:O,deltaPercentage:D}}),(t.options.columnResizeMode==="onChange"||_==="end")&&t.setColumnSizing(C=>({...C,...u})))},f=_=>d("move",_),p=_=>{d("end",_),t.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=n||typeof document<"u"?document:null,b={moveHandler:_=>f(_.clientX),upHandler:_=>{g==null||g.removeEventListener("mousemove",b.moveHandler),g==null||g.removeEventListener("mouseup",b.upHandler),p(_.clientX)}},y={moveHandler:_=>(_.cancelable&&(_.preventDefault(),_.stopPropagation()),f(_.touches[0].clientX),!1),upHandler:_=>{var w;g==null||g.removeEventListener("touchmove",y.moveHandler),g==null||g.removeEventListener("touchend",y.upHandler),_.cancelable&&(_.preventDefault(),_.stopPropagation()),p((w=_.touches[0])==null?void 0:w.clientX)}},x=QK()?{passive:!1}:!1;Gv(i)?(g==null||g.addEventListener("touchmove",y.moveHandler,x),g==null||g.addEventListener("touchend",y.upHandler,x)):(g==null||g.addEventListener("mousemove",b.moveHandler,x),g==null||g.addEventListener("mouseup",b.upHandler,x)),t.setColumnSizingInfo(_=>({..._,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?qv():(n=e.initialState.columnSizingInfo)!=null?n:qv())},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 wh=null;function QK(){if(typeof wh=="boolean")return wh;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 wh=e,wh}function Gv(e){return e.type==="touchstart"}const ZK={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Cr("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()}}}},fM=(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))};fM.autoRemove=e=>oo(e);const hM=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};hM.autoRemove=e=>oo(e);const pM=(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())};pM.autoRemove=e=>oo(e);const gM=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};gM.autoRemove=e=>oo(e)||!(e!=null&&e.length);const mM=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});mM.autoRemove=e=>oo(e)||!(e!=null&&e.length);const vM=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});vM.autoRemove=e=>oo(e)||!(e!=null&&e.length);const bM=(e,t,n)=>e.getValue(t)===n;bM.autoRemove=e=>oo(e);const yM=(e,t,n)=>e.getValue(t)==n;yM.autoRemove=e=>oo(e);const jx=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};jx.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]};jx.autoRemove=e=>oo(e)||oo(e[0])&&oo(e[1]);const Jo={includesString:fM,includesStringSensitive:hM,equalsString:pM,arrIncludes:gM,arrIncludesAll:mM,arrIncludesSome:vM,equals:bM,weakEquals:yM,inNumberRange:jx};function oo(e){return e==null||e===""}const JK={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Cr("columnFilters",e),onGlobalFilterChange:Cr("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"?Jo.includesString:typeof r=="number"?Jo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Jo.equals:Array.isArray(r)?Jo.arrIncludes:Jo.weakEquals},e.getFilterFn=()=>{var n,r;return $p(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:Jo[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(d=>d.id===e.id),s=Ji(n,i?i.value:void 0);if(ZE(o,s,e)){var a;return(a=r==null?void 0:r.filter(d=>d.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var u;return(u=r==null?void 0:r.map(d=>d.id===e.id?l:d))!=null?u:[]}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=()=>Jo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return $p(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Jo[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=Ji(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(ZE(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 ZE(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const eX=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),tX=(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},nX=(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},rX=(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]},oX=(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},iX=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!qK(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},sX=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),aX=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,lX=(e,t)=>t.length,Yv={sum:eX,min:tX,max:nX,extent:rX,mean:oX,median:iX,unique:sX,uniqueCount:aX,count:lX},cX={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:Cr("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 Yv.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Yv.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return $p(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:Yv[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 uX(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 dX={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Cr("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=We(()=>[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(),u=a.findIndex(d=>d.id===l);u>-1&&i.push(a.splice(u,1)[0])}i=[...i,...a]}return uX(i,n,r)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},H0=0,W0=10,Kv=()=>({pageIndex:H0,pageSize:W0}),fX={getInitialState:e=>({...e,pagination:{...Kv(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Cr("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=>Ji(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Kv():(o=e.initialState.pagination)!=null?o:Kv())},e.setPageIndex=r=>{e.setPagination(o=>{let i=Ji(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?H0:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:H0)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?W0:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:W0)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,Ji(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=Ji(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=We(()=>[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)}}},Xv=()=>({left:[],right:[]}),Qv=()=>({top:[],bottom:[]}),hX={getInitialState:e=>({columnPinning:Xv(),rowPinning:Qv(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Cr("columnPinning",e),onRowPinningChange:Cr("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 u,d;return{left:[...((u=o==null?void 0:o.left)!=null?u:[]).filter(f=>!(r!=null&&r.includes(f))),...r],right:((d=o==null?void 0:o.right)!=null?d:[]).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:u}=l;return u}):[],s=o?e.getParentRows().map(l=>{let{id:u}=l;return u}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var u,d;if(n==="bottom"){var f,p;return{top:((f=l==null?void 0:l.top)!=null?f:[]).filter(y=>!(a!=null&&a.has(y))),bottom:[...((p=l==null?void 0:l.bottom)!=null?p:[]).filter(y=>!(a!=null&&a.has(y))),...Array.from(a)]}}if(n==="top"){var g,b;return{top:[...((g=l==null?void 0:l.top)!=null?g:[]).filter(y=>!(a!=null&&a.has(y))),...Array.from(a)],bottom:((b=l==null?void 0:l.bottom)!=null?b:[]).filter(y=>!(a!=null&&a.has(y)))}}return{top:((u=l==null?void 0:l.top)!=null?u:[]).filter(y=>!(a!=null&&a.has(y))),bottom:((d=l==null?void 0:l.bottom)!=null?d:[]).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=We(()=>[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=We(()=>[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=We(()=>[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?Xv():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Xv())},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=We(()=>[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=We(()=>[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=We(()=>[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?Qv():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Qv())},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=>We(()=>[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=We(()=>[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}})}},pX={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Cr("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=>{U0(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=We(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Zv(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=We(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Zv(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=We(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Zv(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 U0(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Vx(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return q0(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return q0(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)}}}},U0=(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=>U0(e,a.id,n,r,o))};function Zv(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var u;const d=Vx(l,n);if(d&&(r.push(l),o[l.id]=l),(u=l.subRows)!=null&&u.length&&(l={...l,subRows:i(l.subRows)}),d)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function Vx(e,t){var n;return(n=t[e.id])!=null?n:!1}function q0(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()&&(Vx(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=q0(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const G0=/([0-9]+)/gm,gX=(e,t,n)=>xM(ds(e.getValue(n)).toLowerCase(),ds(t.getValue(n)).toLowerCase()),mX=(e,t,n)=>xM(ds(e.getValue(n)),ds(t.getValue(n))),vX=(e,t,n)=>Bx(ds(e.getValue(n)).toLowerCase(),ds(t.getValue(n)).toLowerCase()),bX=(e,t,n)=>Bx(ds(e.getValue(n)),ds(t.getValue(n))),yX=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},xX=(e,t,n)=>Bx(e.getValue(n),t.getValue(n));function Bx(e,t){return e===t?0:e>t?1:-1}function ds(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function xM(e,t){const n=e.split(G0).filter(Boolean),r=t.split(G0).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 ou={alphanumeric:gX,alphanumericCaseSensitive:mX,text:vX,textCaseSensitive:bX,datetime:yX,basic:xX},wX={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Cr("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 ou.datetime;if(typeof i=="string"&&(r=!0,i.split(G0).length>1))return ou.alphanumeric}return r?ou.text:ou.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 $p(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:ou[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(g=>g.id===e.id),l=s==null?void 0:s.findIndex(g=>g.id===e.id);let u=[],d,f=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?d="toggle":d="add":s!=null&&s.length&&l!==s.length-1?d="replace":a?d="toggle":d="replace",d==="toggle"&&(i||o||(d="remove")),d==="add"){var p;u=[...s,{id:e.id,desc:f}],u.splice(0,u.length-((p=t.options.maxMultiSortColCount)!=null?p:Number.MAX_SAFE_INTEGER))}else d==="toggle"?u=s.map(g=>g.id===e.id?{...g,desc:f}:g):d==="remove"?u=s.filter(g=>g.id!==e.id):u=[{id:e.id,desc:f}];return u})},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())}},_X={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Cr("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=We(()=>[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=We(()=>[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)=>We(()=>[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)}}},JE=[KK,_X,dX,hX,JK,wX,cX,ZK,fX,pX,XK];function SX(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:JE};const r=n._features.reduce((d,f)=>Object.assign(d,f.getDefaultOptions==null?void 0:f.getDefaultOptions(n)),{}),o=d=>n.options.mergeOptions?n.options.mergeOptions(r,d):{...r,...d};let s={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(d=>{var f;s=(f=d.getInitialState==null?void 0:d.getInitialState(s))!=null?f:s});const a=[];let l=!1;const u={_features:JE,options:{...r,...e},initialState:s,_queue:d=>{a.push(d),l||(l=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();l=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{n.setState(n.initialState)},setOptions:d=>{const f=Ji(d,n.options);n.options=o(f)},getState:()=>n.options.state,setState:d=>{n.options.onStateChange==null||n.options.onStateChange(d)},_getRowId:(d,f,p)=>{var g;return(g=n.options.getRowId==null?void 0:n.options.getRowId(d,f,p))!=null?g:`${p?[p.id,f].join("."):f}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(d,f)=>{let p=(f?n.getPrePaginationRowModel():n.getRowModel()).rowsById[d];if(!p&&(p=n.getCoreRowModel().rowsById[d],!p))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${d}`):new Error;return p},_getDefaultColumnDef:We(()=>[n.options.defaultColumn],d=>{var f;return d=(f=d)!=null?f:{},{header:p=>{const g=p.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:p=>{var g,b;return(g=(b=p.renderValue())==null||b.toString==null?void 0:b.toString())!=null?g:null},...n._features.reduce((p,g)=>Object.assign(p,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...d}},{debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns},key:process.env.NODE_ENV==="development"&&"getDefaultColumnDef"}),_getColumnDefs:()=>n.options.columns,getAllColumns:We(()=>[n._getColumnDefs()],d=>{const f=function(p,g,b){return b===void 0&&(b=0),p.map(y=>{const x=YK(n,y,b,g),_=y;return x.columns=_.columns?f(_.columns,x,b+1):[],x})};return f(d)},{key:process.env.NODE_ENV==="development"&&"getAllColumns",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),getAllFlatColumns:We(()=>[n.getAllColumns()],d=>d.flatMap(f=>f.getFlatColumns()),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumns",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),_getAllFlatColumnsById:We(()=>[n.getAllFlatColumns()],d=>d.reduce((f,p)=>(f[p.id]=p,f),{}),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumnsById",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),getAllLeafColumns:We(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(d,f)=>{let p=d.flatMap(g=>g.getLeafColumns());return f(p)},{key:process.env.NODE_ENV==="development"&&"getAllLeafColumns",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),getColumn:d=>{const f=n._getAllFlatColumnsById()[d];return process.env.NODE_ENV!=="production"&&!f&&console.error(`[Table] Column with id '${d}' does not exist.`),f}};Object.assign(n,u);for(let d=0;d<n._features.length;d++){const f=n._features[d];f==null||f.createTable==null||f.createTable(n)}return n}function CX(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:We(()=>[e,n,t,i],(s,a,l,u)=>({table:s,column:a,row:l,cell:u,getValue:u.getValue,renderValue:u.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 EX=(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 u=e.getColumn(l);if(u!=null&&u.accessorFn)return a._valuesCache[l]=u.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=u.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var u;return(u=a.getValue(l))!=null?u:e.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>GK(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],u=a;for(;;){const d=u.getParentRow();if(!d)break;l.push(d),u=d}return l.reverse()},getAllCells:We(()=>[e.getAllLeafColumns()],l=>l.map(u=>CX(e,a,u,u.id)),{key:process.env.NODE_ENV==="development"&&"row.getAllCells",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}}),_getAllCellsByColumnId:We(()=>[a.getAllCells()],l=>l.reduce((u,d)=>(u[d.column.id]=d,u),{}),{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 u=e._features[l];u==null||u.createRow==null||u.createRow(a,e)}return a};function wM(){return e=>We(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let u=0;u<o.length;u++){const d=EX(e,e._getRowId(o[u],u,s),o[u],u,i,void 0,s==null?void 0:s.id);if(n.flatRows.push(d),n.rowsById[d.id]=d,a.push(d),e.options.getSubRows){var l;d.originalSubRows=e.options.getSubRows(o[u],u),(l=d.originalSubRows)!=null&&l.length&&(d.subRows=r(d.originalSubRows,i+1,d))}}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 _M(){return e=>We(()=>[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 u;return(u=e.getColumn(l.id))==null?void 0:u.getCanSort()}),s={};i.forEach(l=>{const u=e.getColumn(l.id);u&&(s[l.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const a=l=>{const u=l.map(d=>({...d}));return u.sort((d,f)=>{for(let g=0;g<i.length;g+=1){var p;const b=i[g],y=s[b.id],x=(p=b==null?void 0:b.desc)!=null?p:!1;let _=0;if(y.sortUndefined){const w=d.getValue(b.id),C=f.getValue(b.id),R=w===void 0,E=C===void 0;(R||E)&&(_=R&&E?0:R?y.sortUndefined:-y.sortUndefined)}if(_===0&&(_=y.sortingFn(d,f,b.id)),_!==0)return x&&(_*=-1),y.invertSorting&&(_*=-1),_}return d.index-f.index}),u.forEach(d=>{var f;o.push(d),(f=d.subRows)!=null&&f.length&&(d.subRows=a(d.subRows))}),u};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 RX(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 SM(e){return t=>We(()=>[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 u=o*i,d=u+o;s=s.slice(u,d);let f;t.options.paginateExpandedRows?f={rows:s,flatRows:a,rowsById:l}:f=RX({rows:s,flatRows:a,rowsById:l}),f.flatRows=[];const p=g=>{f.flatRows.push(g),g.subRows.length&&g.subRows.forEach(p)};return f.rows.forEach(p),f},{key:process.env.NODE_ENV==="development"&&"getPaginationRowModel",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugTable}})}/**
225
- * react-table
226
- *
227
- * Copyright (c) TanStack
228
- *
229
- * This source code is licensed under the MIT license found in the
230
- * LICENSE.md file in the root directory of this source tree.
231
- *
232
- * @license MIT
233
- */function Y0(e,t){return e?$X(e)?ie.createElement(e,t):e:null}function $X(e){return PX(e)||typeof e=="function"||OX(e)}function PX(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function OX(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function CM(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=ie.useState(()=>({current:SX(t)})),[r,o]=ie.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 EM({data:e,card:t}){var x,_;const[n,r]=m.useState([]),{keys:o}=Hr(e),i=Ee(w=>w.filteringCards),s=i==null?void 0:i.find(w=>w.id===t.id),a=(x=t==null?void 0:t.preferences)==null?void 0:x.onClickFilter,{addOrUpdateFilterValues:l,addFilteringCard:u,removeFilterValue:d,removeFilteringCard:f}=Ta(),p=o.map(w=>({accessorKey:w,header:({column:C})=>{const R=C.getIsSorted();return k.jsx("div",{className:"flex gap-2",children:k.jsxs("div",{className:"flex cursor-pointer items-center",onClick:()=>C.toggleSorting(C.getIsSorted()==="asc"),children:[w,R==="asc"?k.jsx(yx,{className:"ml-2 h-5 w-5"}):R==="desc"?k.jsx(bx,{className:"ml-2 h-5 w-5"}):null]})})}})),g=CM({data:e,columns:p,getCoreRowModel:wM(),getPaginationRowModel:SM(),onSortingChange:r,getSortedRowModel:_M(),manualPagination:!0,state:{sorting:n}}),b=g.getSelectedRowModel().rows;m.useEffect(()=>{if(b.length===0){if(s){const w=t.id;d(w),f(t)}return}if(a){const{dimensionKeys:w}=Hr(e),C=a.map(R=>{const E=w==null?void 0:w[R.columnIndex],T=b.map(D=>D.getValue(E));return{filterId:t.id+"-"+E,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:E,expression:R.expression,valueType:qu(T[0]===void 0?"":T[0]),operation:"in",values:T}});l(C),u(t)}},[u,l,t,e,s,a,d,f,b]);function y(w){w.toggleSelected()}return k.jsxs(Nx,{onMouseDown:w=>w.stopPropagation(),children:[k.jsx(Lx,{children:g.getHeaderGroups().map(w=>k.jsx(Tu,{children:w.headers.map(C=>k.jsx(zx,{className:"sticky top-0 h-8 border-x bg-muted-foreground px-2 py-1 text-background",children:C.isPlaceholder?null:Y0(C.column.columnDef.header,C.getContext())},C.id))},w.id))}),k.jsx(Fx,{children:(_=g.getRowModel().rows)!=null&&_.length?g.getRowModel().rows.map(w=>k.jsx(Tu,{onClick:()=>y(w),className:Se("whitespace-nowrap p-1",{"cursor-pointer":a&&(a==null?void 0:a.length)>0}),"data-state":w.getIsSelected()&&"selected",children:w.getVisibleCells().map(C=>k.jsx(Rp,{className:"border px-2 py-1",children:Y0(C.column.columnDef.cell,C.getContext())},C.id))},w.id)):k.jsx(Tu,{children:k.jsx(Rp,{colSpan:p.length,className:"p-1 text-center",children:"No results."})})})]})}function MX({frame:e,footer:t,className:n,...r}){const{customCards:o}=Da(),i=m.useRef(null),s=Ee(I=>I.themeStyle),a=Ee(I=>I.selectedSheetId),l=Ee(I=>I.selectedFrameId),u=Ee(I=>I.isDashboardEditing),d=e.cards.find(I=>I.id===e.activeCardId);DK(e,i);const{isError:f,isLoading:p,isFetching:g,cfg:b,visualKey:y,handleDatapointClick:x}=Tx(d),{setCardTitle:_,setCardDescription:w,setSelectedFrameId:C}=Ta();function R(I){I.stopPropagation(),C(e.id)}function E(){if(o&&o.length>0){const I=o.find(N=>N.cardId===d.id);if(I&&I.replaceDefault){const N=I.content;if(N)return k.jsx(N,{card:d})}}return d.type==="kpi"?k.jsx(iM,{isLoading:p||g,card:d}):D}function T(){if(f)return k.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(d.type==="table"&&d.data&&d.data.length>0)return k.jsx("div",{className:"relative flex min-h-0 flex-1 grow basis-0",children:k.jsx(EM,{card:d,data:d.data})});if(o&&o.length>0){const I=o.find(N=>N.cardId===d.id);if(I&&I.content){const N=I.content;return k.jsx(N,{card:d})}}if(b)return k.jsx(P2,{cfg:b,onDatapointClick:x},y)}function O(){if(o&&o.length>0){const I=o.find(N=>N.cardId===d.id);if(I&&I.footer){const N=I.footer;if(N)return k.jsx(N,{card:d})}}return t||null}if(!d.id)return null;const D=k.jsxs(k.Fragment,{children:[k.jsxs(ug,{className:"pb-4",children:[k.jsxs("div",{className:"flex items-center gap-2",children:[k.jsx(Ca,{text:d.title,onSave:I=>_(a,d.id,I),children:k.jsx(dg,{className:"text-base",children:d.title})}),(u||d.info)&&k.jsx(HK,{card:d}),d.refreshInterval&&k.jsxs(Q2,{children:[k.jsx(Z2,{className:"pr-1",children:k.jsx("div",{className:Se("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":p||g})})}),k.jsx(Mx,{side:"right",align:"center",children:k.jsx("p",{className:"text-xs",children:`Realtime (${d==null?void 0:d.refreshInterval})`})})]}),!d.refreshInterval&&(p||g)&&k.jsx(Dx,{className:"h-4 w-4 animate-spin text-muted-foreground"})]}),k.jsx(Ca,{text:(d==null?void 0:d.description)||"",onSave:I=>w(a,d.id,I),children:k.jsxs(Jy,{children:[" ",d.description]})})]}),k.jsx(fg,{className:"relative flex grow flex-col",children:T()}),k.jsx(ex,{children:O()})]});return k.jsxs(Zy,{tabIndex:-1,ref:i,role:"card-frame",onClick:R,className:Se("relative flex h-full flex-col rounded-sm",{"border-dashed border-foreground/50":l===e.id&&u},s==null?void 0:s.dashboardCard,n,"semaphor-card-frame"),...r,children:[k.jsx(LG,{frame:e}),E()]})}const DX=dC.WidthProvider(dC.Responsive);function TX(){var x,_,w,C;const e=Ee(R=>R.isDashboardEditing);Ee(R=>R.currentBreakpoint);const t=Ee(R=>R.themeStyle),n=Ee(R=>R.selectedSheetId);(x=Ee(R=>{var E,T;return(T=(E=R.dashboard)==null?void 0:E.sheets)==null?void 0:T.filter(O=>O.id===n)}))==null||x[0].layout;const r=(_=Ee(R=>{var E,T;return(T=(E=R.dashboard)==null?void 0:E.sheets)==null?void 0:T.filter(O=>O.id===n)}))==null?void 0:_[0].layouts,o=Ee(R=>{var E,T,O;return(O=(T=(E=R.dashboard)==null?void 0:E.sheets)==null?void 0:T.find(D=>D.id===n))==null?void 0:O.frames}),{getSelectedSheet:i,getSelectedSheetLayout:s,getSelectedSheetLayouts:a,setSheetLayout:l,setSheetLayouts:u,setCurrentBreakpoint:d}=Ee(R=>R.actions),f=i(),p=m.useCallback(R=>{d(R)},[]),g=m.useCallback((R,E)=>{f!=null&&f.id&&u(f.id,E)},[f==null?void 0:f.id,u]);if(!n)return null;const b=(R,E)=>k.jsx(RM,{className:"after:content-none",ref:E,handleAxis:R});function y(){return o==null?void 0:o.map(R=>k.jsx("div",{role:"dashboard-frame-container",className:Se("group",t==null?void 0:t.dashboardCardContainer),children:k.jsx(MX,{frame:R})},R.id))}return k.jsx(k.Fragment,{children:k.jsx(DX,{margin:((w=t==null?void 0:t.gridLayout)==null?void 0:w.margin)||[10,10],isDraggable:e,resizeHandles:e?["sw","nw","ne","se","e","w"]:[],className:Se((C=t==null?void 0:t.gridLayout)==null?void 0:C.className),layouts:r,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:48,onBreakpointChange:p,onLayoutChange:g,resizeHandle:b,children:y()})})}const RM=m.forwardRef(({className:e,handleAxis:t,...n},r)=>k.jsx("div",{ref:r,className:Se(`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}));RM.displayName="ResizeHandle";/**
234
- * react-virtual
235
- *
236
- * Copyright (c) TanStack
237
- *
238
- * This source code is licensed under the MIT license found in the
239
- * LICENSE.md file in the root directory of this source tree.
240
- *
241
- * @license MIT
242
- */function Pp(){return Pp=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},Pp.apply(this,arguments)}/**
243
- * virtual-core
244
- *
245
- * Copyright (c) TanStack
246
- *
247
- * This source code is licensed under the MIT license found in the
248
- * LICENSE.md file in the root directory of this source tree.
249
- *
250
- * @license MIT
251
- */function Op(){return Op=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},Op.apply(this,arguments)}/**
252
- * virtual-core
253
- *
254
- * Copyright (c) TanStack
255
- *
256
- * This source code is licensed under the MIT license found in the
257
- * LICENSE.md file in the root directory of this source tree.
258
- *
259
- * @license MIT
260
- */function dl(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(b,y){return o[y]!==b});if(!l)return i;o=a;var u;if(n.key&&n.debug!=null&&n.debug()&&(u=Date.now()),i=t.apply(void 0,a),n.key&&n.debug!=null&&n.debug()){var d=Math.round((Date.now()-s)*100)/100,f=Math.round((Date.now()-u)*100)/100,p=f/16,g=function(y,x){for(y=String(y);y.length<x;)y=" "+y;return y};console.info("%c⏱ "+g(f,5)+" /"+g(d,5)+" ms",`
261
- font-size: .6rem;
262
- font-weight: bold;
263
- color: hsl(`+Math.max(0,Math.min(120-120*p,120))+"deg 100% 31%);",n==null?void 0:n.key)}return n==null||n.onChange==null||n.onChange(i),i}}function Jv(e,t){if(e===void 0)throw new Error("Unexpected undefined"+(t?": "+t:""));return e}var AX=function(t,n){return Math.abs(t-n)<1};/**
264
- * virtual-core
265
- *
266
- * Copyright (c) TanStack
267
- *
268
- * This source code is licensed under the MIT license found in the
269
- * LICENSE.md file in the root directory of this source tree.
270
- *
271
- * @license MIT
272
- */var IX=function(t){return t},kX=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},NX=function(t,n){var r=t.scrollElement;if(r){var o=function(a){var l=a.width,u=a.height;n({width:Math.round(l),height:Math.round(u)})};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)}}},LX=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)}}},FX=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"])},zX=function(t,n,r){var o,i,s=n.adjustments,a=s===void 0?0:s,l=n.behavior,u=t+a;(o=r.scrollElement)==null||o.scrollTo==null||o.scrollTo((i={},i[r.options.horizontal?"left":"top"]=u,i.behavior=l,i))},jX=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=Op({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:IX,rangeExtractor:kX,onChange:function(){},measureElement:FX,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=dl(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=dl(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 u=s.get(l.lane);if(u==null||l.end>u.end?s.set(l.lane,l):l.end<u.end&&i.set(l.lane,!0),i.size===n.options.lanes)break}}return s.size===n.options.lanes?Array.from(s.values()).sort(function(d,f){return d.end-f.end})[0]:void 0},this.getMeasurements=dl(function(){return[n.memoOptions(),n.itemSizeCache]},function(r,o){var i=r.count,s=r.paddingStart,a=r.scrollMargin,l=r.getItemKey,u=n.pendingMeasuredCacheIndexes.length>0?Math.min.apply(Math,n.pendingMeasuredCacheIndexes):0;n.pendingMeasuredCacheIndexes=[];for(var d=n.measurementsCache.slice(0,u),f=u;f<i;f++){var p=l(f),g=n.options.lanes===1?d[f-1]:n.getFurthestMeasurement(d,f),b=g?g.end:s+a,y=o.get(p),x=typeof y=="number"?y:n.options.estimateSize(f),_=b+x,w=g?g.lane:f%n.options.lanes;d[f]={index:f,start:b,size:x,end:_,key:p,lane:w}}return n.measurementsCache=d,d},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:function(){return n.options.debug}}),this.calculateRange=dl(function(){return[n.getMeasurements(),n.getSize(),n.scrollOffset]},function(r,o,i){return n.range=r.length>0&&o>0?VX({measurements:r,outerSize:o,scrollOffset:i}):null},{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:function(){return n.options.debug}}),this.getIndexes=dl(function(){return[n.options.rangeExtractor,n.calculateRange(),n.options.overscan,n.options.count]},function(r,o,i,s){return o===null?[]:r(Op({},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,u){l===r&&(n.observer.unobserve(r),n.measureElementCache.delete(u))});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=dl(function(){return[n.getIndexes(),n.getMeasurements()]},function(r,o){for(var i=[],s=0,a=r.length;s<a;s++){var l=r[s],u=o[l];i.push(u)}return i},{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:function(){return n.options.debug}}),this.getVirtualItemForOffset=function(r){var o=n.getMeasurements();return Jv(o[$M(0,o.length-1,function(i){return Jv(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=Jv(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 u=n.getOffsetForIndex(r,a),d=u[0],f=u[1];n._scrollToOffset(d,{adjustments:void 0,behavior:l}),l!=="smooth"&&n.isDynamicMode()&&(n.scrollToIndexTimeoutId=setTimeout(function(){n.scrollToIndexTimeoutId=null;var p=n.measureElementCache.has(n.options.getItemKey(r));if(p){var g=n.getOffsetForIndex(r,f),b=g[0];AX(b,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()},$M=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 VX(e){for(var t=e.measurements,n=e.outerSize,r=e.scrollOffset,o=t.length-1,i=function(u){return t[u].start},s=$M(0,o,i,r),a=s;a<o&&t[a].end<r+n;)a++;return{startIndex:s,endIndex:a}}/**
273
- * react-virtual
274
- *
275
- * Copyright (c) TanStack
276
- *
277
- * This source code is licensed under the MIT license found in the
278
- * LICENSE.md file in the root directory of this source tree.
279
- *
280
- * @license MIT
281
- */var BX=typeof document<"u"?ie.useLayoutEffect:ie.useEffect;function HX(e){var t=ie.useReducer(function(){return{}},{})[1],n=Pp({},e,{onChange:function(s,a){a?Ao.flushSync(t):t(),e.onChange==null||e.onChange(s,a)}}),r=ie.useState(function(){return new jX(n)}),o=r[0];return o.setOptions(n),ie.useEffect(function(){return o._didMount()},[]),BX(function(){return o._willUpdate()}),o}function WX(e){return HX(Pp({observeElementRect:NX,observeElementOffset:LX,scrollToFn:zX},e))}var UX=Object.defineProperty,qX=(e,t,n)=>t in e?UX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,eb=(e,t,n)=>(qX(e,typeof t!="symbol"?t+"":t,n),n);let GX=class{constructor(){eb(this,"current",this.detect()),eb(this,"handoffState","pending"),eb(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"}},va=new GX,un=(e,t)=>{va.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function $o(e){let t=m.useRef(e);return un(()=>{t.current=e},[e]),t}function Hx(e,t){let[n,r]=m.useState(e),o=$o(e);return un(()=>r(o.current),[o,r,...t]),n}let st=function(e){let t=$o(e);return m.useCallback((...n)=>t.current(...n),[t])};function YX(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,st(u=>(i||o(u),t==null?void 0:t(u)))]}function KX(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Oa(){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 KX(()=>{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=Oa();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 Bd(){let[e]=m.useState(Oa);return m.useEffect(()=>()=>e.dispose(),[e]),e}function XX(){let e=typeof document>"u";return"useSyncExternalStore"in ie?(t=>t.useSyncExternalStore)(ie)(()=>()=>{},()=>!1,()=>!e):!1}function Wx(){let e=XX(),[t,n]=ie.useState(va.isHandoffComplete);return t&&va.isHandoffComplete===!1&&n(!1),ie.useEffect(()=>{t!==!0&&n(!0)},[t]),ie.useEffect(()=>va.handoff(),[]),e?!1:t}var eR;let Hd=(eR=m.useId)!=null?eR:function(){let e=Wx(),[t,n]=m.useState(e?()=>va.nextId():null);return un(()=>{t===null&&n(va.nextId())},[t]),t!=null?""+t:void 0};function Sn(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,Sn),r}function Ux(e){return va.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let tR=["[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 QX=(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))(QX||{}),ZX=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(ZX||{}),JX=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(JX||{}),PM=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(PM||{});function eQ(e,t=0){var n;return e===((n=Ux(e))==null?void 0:n.body)?!1:Sn(t,{0(){return e.matches(tR)},1(){let r=e;for(;r!==null;){if(r.matches(tR))return!0;r=r.parentElement}return!1}})}var tQ=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(tQ||{});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 nQ(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 rQ(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function oQ(){return/Android/gi.test(window.navigator.userAgent)}function OM(){return rQ()||oQ()}function _h(e,t,n){let r=$o(t);m.useEffect(()=>{function o(i){r.current(i)}return document.addEventListener(e,o,n),()=>document.removeEventListener(e,o,n)},[e,n])}function iQ(e,t,n){let r=$o(t);m.useEffect(()=>{function o(i){r.current(i)}return window.addEventListener(e,o,n),()=>window.removeEventListener(e,o,n)},[e,n])}function sQ(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 u=function d(f){return typeof f=="function"?d(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let d of u){if(d===null)continue;let f=d instanceof HTMLElement?d:d.current;if(f!=null&&f.contains(l)||s.composed&&s.composedPath().includes(f))return}return!eQ(l,PM.Loose)&&l.tabIndex!==-1&&s.preventDefault(),t(s,l)}let i=m.useRef(null);_h("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),_h("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),_h("click",s=>{OM()||i.current&&(o(s,()=>i.current),i.current=null)},!0),_h("touchend",s=>o(s,()=>s.target instanceof HTMLElement?s.target:null),!0),iQ("blur",s=>o(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function aQ(...e){return m.useMemo(()=>Ux(...e),[...e])}function nR(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 lQ(e,t){let[n,r]=m.useState(()=>nR(e));return un(()=>{r(nR(e))},[e.type,e.as]),un(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let cQ=Symbol();function La(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=st(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[cQ]))?void 0:n}function rR(e){return[e.screenX,e.screenY]}function uQ(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=rR(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=rR(t)}}}function dQ({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]),un(()=>{if(!e||!r)return;let s=Ux(e);if(!s)return;let a=o.current,l=i.current,u=Object.assign(f=>a(f),{acceptNode:a}),d=s.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,u,!1);for(;d.nextNode();)l(d.currentNode)},[e,r,o,i])}function oR(e,t){let n=m.useRef([]),r=st(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 Mp(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Dp=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Dp||{}),es=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(es||{});function wi({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??fQ;let l=MM(t,e);if(i)return Sh(l,n,r,s,a);let u=o??0;if(u&2){let{static:d=!1,...f}=l;if(d)return Sh(f,n,r,s,a)}if(u&1){let{unmount:d=!0,...f}=l;return Sn(d?0:1,{0(){return null},1(){return Sh({...f,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Sh(l,n,r,s,a)}function Sh(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=tb(e,["unmount","static"]),u=e.ref!==void 0?{[a]:e.ref}:{},d=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 p=!1,g=[];for(let[b,y]of Object.entries(t))typeof y=="boolean"&&(p=!0),y===!0&&g.push(b);p&&(f["data-headlessui-state"]=g.join(" "))}if(i===m.Fragment&&Object.keys(K0(l)).length>0){if(!m.isValidElement(d)||Array.isArray(d)&&d.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(`
282
- `),"","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(`
283
- `)].join(`
284
- `));let p=d.props,g=typeof(p==null?void 0:p.className)=="function"?(...y)=>Mp(p==null?void 0:p.className(...y),l.className):Mp(p==null?void 0:p.className,l.className),b=g?{className:g}:{};return m.cloneElement(d,Object.assign({},MM(d.props,K0(tb(l,["ref"]))),f,u,{ref:o(d.ref,u.ref)},b))}return m.createElement(i,Object.assign({},tb(l,["ref"]),i!==m.Fragment&&u,i!==m.Fragment&&f),d)}function fQ(...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 MM(...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 Fo(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function K0(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function tb(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let hQ="div";var DM=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(DM||{});function pQ(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 wi({ourProps:i,theirProps:o,slot:{},defaultTag:hQ,name:"Hidden"})}let gQ=Fo(pQ),qx=m.createContext(null);qx.displayName="OpenClosedContext";var yr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(yr||{});function Gx(){return m.useContext(qx)}function TM({value:e,children:t}){return m.createElement(qx.Provider,{value:e},t)}function mQ(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Js=[];mQ(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&Js[0]!==t.target&&(Js.unshift(t.target),Js=Js.filter(n=>n!=null&&n.isConnected),Js.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 vQ(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&&bQ(n)?!1:r}function bQ(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function yQ(e){throw new Error("Unexpected object: "+e)}var ln=(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))(ln||{});function iR(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:yQ(e)}}function AM(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))kM(n,IM(t,r),o);return n}function IM(e,t){return e?e+"["+t+"]":t}function kM(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())kM(e,IM(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,""]):AM(n,t,e)}var pr=(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))(pr||{}),xQ=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(xQ||{}),wQ=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(wQ||{}),_Q=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(_Q||{}),SQ=(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))(SQ||{});function nb(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):nQ(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let CQ={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 d=t.focus===ln.Specific?t.idx:iR(t,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var p,g;return(g=(p=e.activeOptionIndex)!=null?p:e.virtual.options.findIndex(b=>!e.virtual.disabled(b)))!=null?g:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),f=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===d&&e.activationTrigger===f?e:{...e,activeOptionIndex:d,activationTrigger:f}}let a=nb(e);if(a.activeOptionIndex===null){let d=a.options.findIndex(f=>!f.dataRef.current.disabled);d!==-1&&(a.activeOptionIndex=d)}let l=t.focus===ln.Specific?t.idx:iR(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled}),u=(s=t.trigger)!=null?s:2;return e.activeOptionIndex===l&&e.activationTrigger===u?e:{...e,...a,activeOptionIndex:l,activationTrigger:u}},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=nb(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=nb(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})}}},Yx=m.createContext(null);Yx.displayName="ComboboxActionsContext";function Wd(e){let t=m.useContext(Yx);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Wd),n}return t}let NM=m.createContext(null);function EQ(e){var t;let n=Fa("VirtualProvider"),[r,o]=m.useMemo(()=>{let l=n.optionsRef.current;if(!l)return[0,0];let u=window.getComputedStyle(l);return[parseFloat(u.paddingBlockStart||u.paddingTop),parseFloat(u.paddingBlockEnd||u.paddingBottom)]},[n.optionsRef.current]),i=WX({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 un(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(NM.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 u;return m.createElement(m.Fragment,{key:l.key},m.cloneElement((u=e.children)==null?void 0:u.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 Kx=m.createContext(null);Kx.displayName="ComboboxDataContext";function Fa(e){let t=m.useContext(Kx);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Fa),n}return t}function RQ(e,t){return Sn(t.type,CQ,e,t)}let $Q=m.Fragment;function PQ(e,t){let{value:n,defaultValue:r,onChange:o,form:i,name:s,by:a=null,disabled:l=!1,__demoMode:u=!1,nullable:d=!1,multiple:f=!1,immediate:p=!1,virtual:g=null,...b}=e,y=!1,x=null,[_=f?[]:void 0,w]=YX(n,o,r),[C,R]=m.useReducer(RQ,{dataRef:m.createRef(),comboboxState:u?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),E=m.useRef(!1),T=m.useRef({static:!1,hold:!1}),O=m.useRef(null),D=m.useRef(null),I=m.useRef(null),N=m.useRef(null),V=st(typeof a=="string"?(X,re)=>{let be=a;return(X==null?void 0:X[be])===(re==null?void 0:re[be])}:a??((X,re)=>X===re)),G=st(X=>C.options.findIndex(re=>V(re.dataRef.current.value,X))),le=m.useCallback(X=>Sn(F.mode,{1:()=>_.some(re=>V(re,X)),0:()=>V(_,X)}),[_]),ee=st(X=>C.activeOptionIndex===G(X)),F=m.useMemo(()=>({...C,immediate:y,optionsPropsRef:T,labelRef:O,inputRef:D,buttonRef:I,optionsRef:N,value:_,defaultValue:r,disabled:l,mode:f?1:0,virtual:C.virtual,get activeOptionIndex(){if(E.current&&C.activeOptionIndex===null&&C.options.length>0){let X=C.options.findIndex(re=>!re.dataRef.current.disabled);if(X!==-1)return X}return C.activeOptionIndex},calculateIndex:G,compare:V,isSelected:le,isActive:ee,nullable:d,__demoMode:u}),[_,r,l,f,d,u,C,x]);un(()=>{},[x,void 0]),un(()=>{C.dataRef.current=F},[F]),sQ([F.buttonRef,F.inputRef,F.optionsRef],()=>ge.closeCombobox(),F.comboboxState===0);let Z=m.useMemo(()=>{var X,re,be;return{open:F.comboboxState===0,disabled:l,activeIndex:F.activeOptionIndex,activeOption:F.activeOptionIndex===null?null:F.virtual?F.virtual.options[(X=F.activeOptionIndex)!=null?X:0]:(be=(re=F.options[F.activeOptionIndex])==null?void 0:re.dataRef.current.value)!=null?be:null,value:_}},[F,l,_]),Y=st(()=>{if(F.activeOptionIndex!==null){if(F.virtual)ce(F.virtual.options[F.activeOptionIndex]);else{let{dataRef:X}=F.options[F.activeOptionIndex];ce(X.current.value)}ge.goToOption(ln.Specific,F.activeOptionIndex)}}),Q=st(()=>{R({type:0}),E.current=!0}),ae=st(()=>{R({type:1}),E.current=!1}),j=st((X,re,be)=>(E.current=!1,X===ln.Specific?R({type:2,focus:ln.Specific,idx:re,trigger:be}):R({type:2,focus:X,trigger:be}))),B=st((X,re)=>(R({type:3,payload:{id:X,dataRef:re}}),()=>{F.isActive(re.current.value)&&(E.current=!0),R({type:4,id:X})})),te=st(X=>(R({type:5,id:X}),()=>R({type:5,id:null}))),ce=st(X=>Sn(F.mode,{0(){return w==null?void 0:w(X)},1(){let re=F.value.slice(),be=re.findIndex(H=>V(H,X));return be===-1?re.push(X):re.splice(be,1),w==null?void 0:w(re)}})),ue=st(X=>{R({type:6,trigger:X})}),ge=m.useMemo(()=>({onChange:ce,registerOption:B,registerLabel:te,goToOption:j,closeCombobox:ae,openCombobox:Q,setActivationTrigger:ue,selectActiveOption:Y}),[]),ve=t===null?{}:{ref:t},de=m.useRef(null),J=Bd();return m.useEffect(()=>{de.current&&r!==void 0&&J.addEventListener(de.current,"reset",()=>{w==null||w(r)})},[de,w]),m.createElement(Yx.Provider,{value:ge},m.createElement(Kx.Provider,{value:F},m.createElement(TM,{value:Sn(F.comboboxState,{0:yr.Open,1:yr.Closed})},s!=null&&_!=null&&AM({[s]:_}).map(([X,re],be)=>m.createElement(gQ,{features:DM.Hidden,ref:be===0?H=>{var De;de.current=(De=H==null?void 0:H.closest("form"))!=null?De:null}:void 0,...K0({key:X,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:X,value:re})})),wi({ourProps:ve,theirProps:b,slot:Z,defaultTag:$Q,name:"Combobox"}))))}let OQ="input";function MQ(e,t){var n,r,o,i,s;let a=Hd(),{id:l=`headlessui-combobox-input-${a}`,onChange:u,displayValue:d,type:f="text",...p}=e,g=Fa("Combobox.Input"),b=Wd("Combobox.Input"),y=La(g.inputRef,t),x=aQ(g.inputRef),_=m.useRef(!1),w=Bd(),C=st(()=>{b.onChange(null),g.optionsRef.current&&(g.optionsRef.current.scrollTop=0),b.goToOption(ln.Nothing)}),R=function(){var F;return typeof d=="function"&&g.value!==void 0?(F=d(g.value))!=null?F:"":typeof g.value=="string"?g.value:""}();oR(([F,Z],[Y,Q])=>{if(_.current)return;let ae=g.inputRef.current;ae&&((Q===0&&Z===1||F!==Y)&&(ae.value=F),requestAnimationFrame(()=>{if(_.current||!ae||(x==null?void 0:x.activeElement)!==ae)return;let{selectionStart:j,selectionEnd:B}=ae;Math.abs((B??0)-(j??0))===0&&j===0&&ae.setSelectionRange(ae.value.length,ae.value.length)}))},[R,g.comboboxState,x]),oR(([F],[Z])=>{if(F===0&&Z===1){if(_.current)return;let Y=g.inputRef.current;if(!Y)return;let Q=Y.value,{selectionStart:ae,selectionEnd:j,selectionDirection:B}=Y;Y.value="",Y.value=Q,B!==null?Y.setSelectionRange(ae,j,B):Y.setSelectionRange(ae,j)}},[g.comboboxState]);let E=m.useRef(!1),T=st(()=>{E.current=!0}),O=st(()=>{w.nextFrame(()=>{E.current=!1})}),D=st(F=>{switch(_.current=!0,F.key){case pr.Enter:if(_.current=!1,g.comboboxState!==0||E.current)return;if(F.preventDefault(),F.stopPropagation(),g.activeOptionIndex===null){b.closeCombobox();return}b.selectActiveOption(),g.mode===0&&b.closeCombobox();break;case pr.ArrowDown:return _.current=!1,F.preventDefault(),F.stopPropagation(),Sn(g.comboboxState,{0:()=>b.goToOption(ln.Next),1:()=>b.openCombobox()});case pr.ArrowUp:return _.current=!1,F.preventDefault(),F.stopPropagation(),Sn(g.comboboxState,{0:()=>b.goToOption(ln.Previous),1:()=>{b.openCombobox(),w.nextFrame(()=>{g.value||b.goToOption(ln.Last)})}});case pr.Home:if(F.shiftKey)break;return _.current=!1,F.preventDefault(),F.stopPropagation(),b.goToOption(ln.First);case pr.PageUp:return _.current=!1,F.preventDefault(),F.stopPropagation(),b.goToOption(ln.First);case pr.End:if(F.shiftKey)break;return _.current=!1,F.preventDefault(),F.stopPropagation(),b.goToOption(ln.Last);case pr.PageDown:return _.current=!1,F.preventDefault(),F.stopPropagation(),b.goToOption(ln.Last);case pr.Escape:return _.current=!1,g.comboboxState!==0?void 0:(F.preventDefault(),g.optionsRef.current&&!g.optionsPropsRef.current.static&&F.stopPropagation(),g.nullable&&g.mode===0&&g.value===null&&C(),b.closeCombobox());case pr.Tab:if(_.current=!1,g.comboboxState!==0)return;g.mode===0&&g.activationTrigger!==1&&b.selectActiveOption(),b.closeCombobox();break}}),I=st(F=>{u==null||u(F),g.nullable&&g.mode===0&&F.target.value===""&&C(),b.openCombobox()}),N=st(F=>{var Z,Y,Q;let ae=(Z=F.relatedTarget)!=null?Z:Js.find(j=>j!==F.currentTarget);if(_.current=!1,!((Y=g.optionsRef.current)!=null&&Y.contains(ae))&&!((Q=g.buttonRef.current)!=null&&Q.contains(ae))&&g.comboboxState===0)return F.preventDefault(),g.mode===0&&(g.nullable&&g.value===null?C():g.activationTrigger!==1&&b.selectActiveOption()),b.closeCombobox()}),V=st(F=>{var Z,Y,Q;let ae=(Z=F.relatedTarget)!=null?Z:Js.find(j=>j!==F.currentTarget);(Y=g.buttonRef.current)!=null&&Y.contains(ae)||(Q=g.optionsRef.current)!=null&&Q.contains(ae)||g.disabled||g.immediate&&g.comboboxState!==0&&(b.openCombobox(),w.nextFrame(()=>{b.setActivationTrigger(1)}))}),G=Hx(()=>{if(g.labelId)return[g.labelId].join(" ")},[g.labelId]),le=m.useMemo(()=>({open:g.comboboxState===0,disabled:g.disabled}),[g]),ee={ref:y,id:l,role:"combobox",type:f,"aria-controls":(n=g.optionsRef.current)==null?void 0:n.id,"aria-expanded":g.comboboxState===0,"aria-activedescendant":g.activeOptionIndex===null?void 0:g.virtual?(r=g.options.find(F=>{var Z;return!((Z=g.virtual)!=null&&Z.disabled(F.dataRef.current.value))&&g.compare(F.dataRef.current.value,g.virtual.options[g.activeOptionIndex])}))==null?void 0:r.id:(o=g.options[g.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":G,"aria-autocomplete":"list",defaultValue:(s=(i=e.defaultValue)!=null?i:g.defaultValue!==void 0?d==null?void 0:d(g.defaultValue):null)!=null?s:g.defaultValue,disabled:g.disabled,onCompositionStart:T,onCompositionEnd:O,onKeyDown:D,onChange:I,onFocus:V,onBlur:N};return wi({ourProps:ee,theirProps:p,slot:le,defaultTag:OQ,name:"Combobox.Input"})}let DQ="button";function TQ(e,t){var n;let r=Fa("Combobox.Button"),o=Wd("Combobox.Button"),i=La(r.buttonRef,t),s=Hd(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,u=Bd(),d=st(y=>{switch(y.key){case pr.ArrowDown:return y.preventDefault(),y.stopPropagation(),r.comboboxState===1&&o.openCombobox(),u.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case pr.ArrowUp:return y.preventDefault(),y.stopPropagation(),r.comboboxState===1&&(o.openCombobox(),u.nextFrame(()=>{r.value||o.goToOption(ln.Last)})),u.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case pr.Escape:return r.comboboxState!==0?void 0:(y.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&y.stopPropagation(),o.closeCombobox(),u.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})}));default:return}}),f=st(y=>{if(vQ(y.currentTarget))return y.preventDefault();r.comboboxState===0?o.closeCombobox():(y.preventDefault(),o.openCombobox()),u.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})})}),p=Hx(()=>{if(r.labelId)return[r.labelId,a].join(" ")},[r.labelId,a]),g=m.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),b={ref:i,id:a,type:lQ(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":p,disabled:r.disabled,onClick:f,onKeyDown:d};return wi({ourProps:b,theirProps:l,slot:g,defaultTag:DQ,name:"Combobox.Button"})}let AQ="label";function IQ(e,t){let n=Hd(),{id:r=`headlessui-combobox-label-${n}`,...o}=e,i=Fa("Combobox.Label"),s=Wd("Combobox.Label"),a=La(i.labelRef,t);un(()=>s.registerLabel(r),[r]);let l=st(()=>{var d;return(d=i.inputRef.current)==null?void 0:d.focus({preventScroll:!0})}),u=m.useMemo(()=>({open:i.comboboxState===0,disabled:i.disabled}),[i]);return wi({ourProps:{ref:a,id:r,onClick:l},theirProps:o,slot:u,defaultTag:AQ,name:"Combobox.Label"})}let kQ="ul",NQ=Dp.RenderStrategy|Dp.Static;function LQ(e,t){let n=Hd(),{id:r=`headlessui-combobox-options-${n}`,hold:o=!1,...i}=e,s=Fa("Combobox.Options"),a=La(s.optionsRef,t),l=Gx(),u=l!==null?(l&yr.Open)===yr.Open:s.comboboxState===0;un(()=>{var g;s.optionsPropsRef.current.static=(g=e.static)!=null?g:!1},[s.optionsPropsRef,e.static]),un(()=>{s.optionsPropsRef.current.hold=o},[s.optionsPropsRef,o]),dQ({container:s.optionsRef.current,enabled:s.comboboxState===0,accept(g){return g.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:g.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(g){g.setAttribute("role","none")}});let d=Hx(()=>{var g,b;return(b=s.labelId)!=null?b:(g=s.buttonRef.current)==null?void 0:g.id},[s.labelId,s.buttonRef.current]),f=m.useMemo(()=>({open:s.comboboxState===0,option:void 0}),[s]),p={"aria-labelledby":d,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(EQ,null,i.children)}),wi({ourProps:p,theirProps:i,slot:f,defaultTag:kQ,features:NQ,visible:u,name:"Combobox.Options"})}let FQ="li";function zQ(e,t){var n;let r=Hd(),{id:o=`headlessui-combobox-option-${r}`,disabled:i=!1,value:s,order:a=null,...l}=e,u=Fa("Combobox.Option"),d=Wd("Combobox.Option"),f=u.virtual?u.activeOptionIndex===u.calculateIndex(s):u.activeOptionIndex===null?!1:((n=u.options[u.activeOptionIndex])==null?void 0:n.id)===o,p=u.isSelected(s),g=m.useRef(null),b=$o({disabled:i,value:s,domRef:g,order:a}),y=m.useContext(NM),x=La(t,g,y?y.measureElement:null),_=st(()=>d.onChange(s));un(()=>d.registerOption(o,b),[b,o]);let w=m.useRef(!(u.virtual||u.__demoMode));un(()=>{if(!u.virtual||!u.__demoMode)return;let N=Oa();return N.requestAnimationFrame(()=>{w.current=!0}),N.dispose},[u.virtual,u.__demoMode]),un(()=>{if(!w.current||u.comboboxState!==0||!f||u.activationTrigger===0)return;let N=Oa();return N.requestAnimationFrame(()=>{var V,G;(G=(V=g.current)==null?void 0:V.scrollIntoView)==null||G.call(V,{block:"nearest"})}),N.dispose},[g,f,u.comboboxState,u.activationTrigger,u.activeOptionIndex]);let C=st(N=>{var V;if(i||(V=u.virtual)!=null&&V.disabled(s))return N.preventDefault();_(),OM()||requestAnimationFrame(()=>{var G;return(G=u.inputRef.current)==null?void 0:G.focus({preventScroll:!0})}),u.mode===0&&requestAnimationFrame(()=>d.closeCombobox())}),R=st(()=>{var N;if(i||(N=u.virtual)!=null&&N.disabled(s))return d.goToOption(ln.Nothing);let V=u.calculateIndex(s);d.goToOption(ln.Specific,V)}),E=uQ(),T=st(N=>E.update(N)),O=st(N=>{var V;if(!E.wasMoved(N)||i||(V=u.virtual)!=null&&V.disabled(s)||f)return;let G=u.calculateIndex(s);d.goToOption(ln.Specific,G,0)}),D=st(N=>{var V;E.wasMoved(N)&&(i||(V=u.virtual)!=null&&V.disabled(s)||f&&(u.optionsPropsRef.current.hold||d.goToOption(ln.Nothing)))}),I=m.useMemo(()=>({active:f,selected:p,disabled:i}),[f,p,i]);return wi({ourProps:{id:o,ref:x,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":p,disabled:void 0,onClick:C,onFocus:R,onPointerEnter:T,onMouseEnter:T,onPointerMove:O,onMouseMove:O,onPointerLeave:D,onMouseLeave:D},theirProps:l,slot:I,defaultTag:FQ,name:"Combobox.Option"})}let jQ=Fo(PQ),VQ=Fo(TQ),BQ=Fo(MQ),HQ=Fo(IQ),WQ=Fo(LQ),UQ=Fo(zQ),fl=Object.assign(jQ,{Input:BQ,Button:VQ,Label:HQ,Options:WQ,Option:UQ});function Xx(){let e=m.useRef(!1);return un(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function qQ(e=0){let[t,n]=m.useState(e),r=Xx(),o=m.useCallback(l=>{r.current&&n(u=>u|l)},[t,r]),i=m.useCallback(l=>!!(t&l),[t]),s=m.useCallback(l=>{r.current&&n(u=>u&~l)},[n,r]),a=m.useCallback(l=>{r.current&&n(u=>u^l)},[n]);return{flags:t,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}function GQ(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function rb(e,...t){e&&t.length>0&&e.classList.add(...t)}function ob(e,...t){e&&t.length>0&&e.classList.remove(...t)}function YQ(e,t){let n=Oa();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,s]=[r,o].map(l=>{let[u=0]=l.split(",").filter(Boolean).map(d=>d.includes("ms")?parseFloat(d):parseFloat(d)*1e3).sort((d,f)=>f-d);return u}),a=i+s;if(a!==0){n.group(u=>{u.setTimeout(()=>{t(),u.dispose()},a),u.addEventListener(e,"transitionrun",d=>{d.target===d.currentTarget&&u.dispose()})});let l=n.addEventListener(e,"transitionend",u=>{u.target===u.currentTarget&&(t(),l())})}else t();return n.add(()=>t()),n.dispose}function KQ(e,t,n,r){let o=n?"enter":"leave",i=Oa(),s=r!==void 0?GQ(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Sn(o,{enter:()=>t.enter,leave:()=>t.leave}),l=Sn(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),u=Sn(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),rb(e,...t.base,...a,...u),i.nextFrame(()=>{ob(e,...t.base,...a,...u),rb(e,...t.base,...a,...l),YQ(e,()=>(ob(e,...t.base,...a),rb(e,...t.base,...t.entered),s()))}),i.dispose}function XQ({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let s=Xx(),a=Bd(),l=$o(n);un(()=>{e&&(l.current="enter")},[e]),un(()=>{let u=Oa();a.add(u.dispose);let d=t.current;if(d&&l.current!=="idle"&&s.current)return u.dispose(),o.current(l.current),u.add(KQ(d,r.current,l.current==="enter",()=>{u.dispose(),i.current(l.current)})),u.dispose},[n])}function Ni(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Eg=m.createContext(null);Eg.displayName="TransitionContext";var QQ=(e=>(e.Visible="visible",e.Hidden="hidden",e))(QQ||{});function ZQ(){let e=m.useContext(Eg);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function JQ(){let e=m.useContext(Rg);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Rg=m.createContext(null);Rg.displayName="NestingContext";function $g(e){return"children"in e?$g(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function LM(e,t){let n=$o(e),r=m.useRef([]),o=Xx(),i=Bd(),s=st((g,b=es.Hidden)=>{let y=r.current.findIndex(({el:x})=>x===g);y!==-1&&(Sn(b,{[es.Unmount](){r.current.splice(y,1)},[es.Hidden](){r.current[y].state="hidden"}}),i.microTask(()=>{var x;!$g(r)&&o.current&&((x=n.current)==null||x.call(n))}))}),a=st(g=>{let b=r.current.find(({el:y})=>y===g);return b?b.state!=="visible"&&(b.state="visible"):r.current.push({el:g,state:"visible"}),()=>s(g,es.Unmount)}),l=m.useRef([]),u=m.useRef(Promise.resolve()),d=m.useRef({enter:[],leave:[],idle:[]}),f=st((g,b,y)=>{l.current.splice(0),t&&(t.chains.current[b]=t.chains.current[b].filter(([x])=>x!==g)),t==null||t.chains.current[b].push([g,new Promise(x=>{l.current.push(x)})]),t==null||t.chains.current[b].push([g,new Promise(x=>{Promise.all(d.current[b].map(([_,w])=>w)).then(()=>x())})]),b==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(b)):y(b)}),p=st((g,b,y)=>{Promise.all(d.current[b].splice(0).map(([x,_])=>_)).then(()=>{var x;(x=l.current.shift())==null||x()}).then(()=>y(b))});return m.useMemo(()=>({children:r,register:a,unregister:s,onStart:f,onStop:p,wait:u,chains:d}),[a,s,r,f,p,d,u])}function eZ(){}let tZ=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function sR(e){var t;let n={};for(let r of tZ)n[r]=(t=e[r])!=null?t:eZ;return n}function nZ(e){let t=m.useRef(sR(e));return m.useEffect(()=>{t.current=sR(e)},[e]),t}let rZ="div",FM=Dp.RenderStrategy;function oZ(e,t){var n,r;let{beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a,enter:l,enterFrom:u,enterTo:d,entered:f,leave:p,leaveFrom:g,leaveTo:b,...y}=e,x=m.useRef(null),_=La(x,t),w=(n=y.unmount)==null||n?es.Unmount:es.Hidden,{show:C,appear:R,initial:E}=ZQ(),[T,O]=m.useState(C?"visible":"hidden"),D=JQ(),{register:I,unregister:N}=D;m.useEffect(()=>I(x),[I,x]),m.useEffect(()=>{if(w===es.Hidden&&x.current){if(C&&T!=="visible"){O("visible");return}return Sn(T,{hidden:()=>N(x),visible:()=>I(x)})}},[T,x,I,N,C,w]);let V=$o({base:Ni(y.className),enter:Ni(l),enterFrom:Ni(u),enterTo:Ni(d),entered:Ni(f),leave:Ni(p),leaveFrom:Ni(g),leaveTo:Ni(b)}),G=nZ({beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a}),le=Wx();m.useEffect(()=>{if(le&&T==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,T,le]);let ee=E&&!R,F=R&&C&&E,Z=!le||ee?"idle":C?"enter":"leave",Y=qQ(0),Q=st(ue=>Sn(ue,{enter:()=>{Y.addFlag(yr.Opening),G.current.beforeEnter()},leave:()=>{Y.addFlag(yr.Closing),G.current.beforeLeave()},idle:()=>{}})),ae=st(ue=>Sn(ue,{enter:()=>{Y.removeFlag(yr.Opening),G.current.afterEnter()},leave:()=>{Y.removeFlag(yr.Closing),G.current.afterLeave()},idle:()=>{}})),j=LM(()=>{O("hidden"),N(x)},D),B=m.useRef(!1);XQ({immediate:F,container:x,classes:V,direction:Z,onStart:$o(ue=>{B.current=!0,j.onStart(x,ue,Q)}),onStop:$o(ue=>{B.current=!1,j.onStop(x,ue,ae),ue==="leave"&&!$g(j)&&(O("hidden"),N(x))})});let te=y,ce={ref:_};return F?te={...te,className:Mp(y.className,...V.current.enter,...V.current.enterFrom)}:B.current&&(te.className=Mp(y.className,(r=x.current)==null?void 0:r.className),te.className===""&&delete te.className),m.createElement(Rg.Provider,{value:j},m.createElement(TM,{value:Sn(T,{visible:yr.Open,hidden:yr.Closed})|Y.flags},wi({ourProps:ce,theirProps:te,defaultTag:rZ,features:FM,visible:T==="visible",name:"Transition.Child"})))}function iZ(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=m.useRef(null),a=La(s,t);Wx();let l=Gx();if(n===void 0&&l!==null&&(n=(l&yr.Open)===yr.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=m.useState(n?"visible":"hidden"),f=LM(()=>{d("hidden")}),[p,g]=m.useState(!0),b=m.useRef([n]);un(()=>{p!==!1&&b.current[b.current.length-1]!==n&&(b.current.push(n),g(!1))},[b,n]);let y=m.useMemo(()=>({show:n,appear:r,initial:p}),[n,r,p]);m.useEffect(()=>{if(n)d("visible");else if(!$g(f))d("hidden");else{let C=s.current;if(!C)return;let R=C.getBoundingClientRect();R.x===0&&R.y===0&&R.width===0&&R.height===0&&d("hidden")}},[n,f]);let x={unmount:o},_=st(()=>{var C;p&&g(!1),(C=e.beforeEnter)==null||C.call(e)}),w=st(()=>{var C;p&&g(!1),(C=e.beforeLeave)==null||C.call(e)});return m.createElement(Rg.Provider,{value:f},m.createElement(Eg.Provider,{value:y},wi({ourProps:{...x,as:m.Fragment,children:m.createElement(zM,{ref:a,...x,...i,beforeEnter:_,beforeLeave:w})},theirProps:{},defaultTag:m.Fragment,features:FM,visible:u==="visible",name:"Transition"})))}function sZ(e,t){let n=m.useContext(Eg)!==null,r=Gx()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(X0,{ref:t,...e}):m.createElement(zM,{ref:t,...e}))}let X0=Fo(iZ),zM=Fo(oZ),aZ=Fo(sZ),lZ=Object.assign(X0,{Child:aZ,Root:X0});const Pg=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],dc=["number","integer","int","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8"],Ud=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],Qx=["boolean"];function jM(e){return e.match(/[A-Z]/)?`"${e}"`:e}function cZ(e,t,n){const{measures:r,dimensions:o}=e,i=r==null?void 0:r.map(u=>`${u.calc}(${u.name}) as ${u.calc}_${u.name.replace(/"/g,"")}`).join(", "),s=(o==null?void 0:o.join(", "))||"";let a="";const l=VM(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 uZ(e,t,n="AVG"){var i,s,a,l;let r={};const o=jM(e.column_name);return Pg.includes(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(d=>d!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),dc.includes(e.data_type)&&(((a=t.measures)==null?void 0:a.some(d=>d.name===o&&d.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(d=>!(d.name===o&&d.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function Tp(e){return Pg.includes(e.dataType)?"string":dc.includes(e.dataType)?"number":Ud.includes(e.dataType)?"date":Qx.includes(e.dataType)?"boolean":"string"}function dZ(e){let t;const n=e.data_type.toLowerCase();return Pg.includes(n)?t="T":dc.includes(n)?t="#":Ud.includes(n)?t="D":Qx.includes(n)?t="B":t="?",t}function fZ(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 VM(e,t){return t==="api"||t==="s3"||e==="public"?t:e?`${e}.${t}`:`${t}`}function hZ(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 pZ(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 Ud.includes(e)?o:r}const aR=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,lR=Kh,Zx=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return lR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],f=i==null?void 0:i[u];if(d===null)return null;const p=aR(d)||aR(f);return o[u][p]}),a=n&&Object.entries(n).reduce((u,d)=>{let[f,p]=d;return p===void 0||(u[f]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:p,...g}=d;return Object.entries(g).every(b=>{let[y,x]=b;return Array.isArray(x)?x.includes({...i,...a}[y]):{...i,...a}[y]===x})?[...u,f,p]:u},[]);return lR(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Q0=Zx("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"}}),ba=ie.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?pi:"button";return k.jsx(s,{className:Se(Q0({variant:t,size:n,className:e})),ref:i,...o})});ba.displayName="Button";function gZ({filter:e}){const[t,n]=m.useState([]),[r,o]=m.useState(""),[i,s]=m.useState(""),a=m.useRef(null),{authToken:l}=Da(),u=Ee(D=>D.filterValues),d=Ee(D=>D.actions.addOrUpdateFilterValue),f=Ee(D=>D.actions.removeFilterValue),p=C(u),{data:g,isLoading:b,isFetching:y,isError:x,refetch:_}=So({queryKey:["filter",e.id,e.sql,JSON.stringify(p)],queryFn:()=>jp("https://semaphor.cloud/api/v1/query",(l==null?void 0:l.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:p}),enabled:!!e.sql&&!!e.connectionId&&!!e.database}),w=m.useMemo(()=>{var D;return(D=g==null?void 0:g.records)==null?void 0:D.map(I=>{let N=e.column.split(".").slice(-1)[0].replace(/"/g,"");return I[N]===void 0&&(N=N.toLowerCase()),{id:I[N],value:I[N]}})},[g,e.column]);m.useEffect(()=>{if(u){const D=u.find(I=>I.filterId===e.id);if(!D){n([]);return}if(D.operation==="in"){const I=w==null?void 0:w.filter(N=>D.values.includes(N.value));I&&n(I)}else o(`${D.operation} ${D.values[0]}`)}},[g]),m.useEffect(()=>{if(u&&!u.find(I=>I.filterId===e.id)){n([]);return}},[u,e.id]);function C(D){return D?D.filter(I=>{const V=I.name.split(".");if(V.slice(0,V.length-1).join(".")===e.table&&I.name!==e.column)return!0}):[]}function R(D){const I=hZ(D[0].toString());if(!(I!=null&&I.value)||!(I!=null&&I.operation))return;const N={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Tp(e),name:e.column,operation:I.operation,values:[Number(I.value)]};d(N)}function E(D){if(console.log("onComboBoxChange",D),D.length===1&&w.find(N=>N.value===D[0].value)===void 0){R(D);return}if(n(D),D.length===0){f(e.id);return}const I={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Tp(e),operation:e.operation,values:D.map(N=>N.value)};d(I)}function T(){var D;o(""),f(e.id),console.log(e.id),(D=a.current)==null||D.click()}if(b)return k.jsx("div",{children:k.jsx(_y,{className:"h-8 w-[250px] bg-foreground/10"})});if(x)return k.jsx("div",{className:"flex h-8 w-[250px] items-center bg-muted px-2 text-sm",children:"Error"});if(!g)return null;let O=[];return dc.includes(e.dataType)?O=w:O=i===""?w:w.filter(D=>D.value.toLowerCase().replace(/\s+/g,"").includes(i.toLowerCase().replace(/\s+/g,""))),k.jsx("div",{className:"w-[250px]",children:k.jsx(fl,{value:t,onChange:E,multiple:!0,children:k.jsxs("div",{className:"relative",children:[k.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:[k.jsx(fl.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:D=>D.map(N=>N.value).join(", ")||r,onChange:D=>{o(D.target.value),s(D.target.value)}}),k.jsx(fl.Button,{ref:a,className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:k.jsx(pG,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),k.jsx(lZ,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:k.jsxs(fl.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:[dc.includes(e.dataType)&&k.jsxs(fl.Option,{value:r,className:"flex items-center justify-between gap-2 px-3 py-2",children:[k.jsxs("div",{className:"flex items-center gap-2",children:[k.jsx("span",{className:"font-thin",children:"#"}),k.jsx("span",{children:r})]}),r&&k.jsx(ba,{variant:"link",className:"h-4 w-3 cursor-pointer text-foreground/50 hover:text-foreground/100",onClick:D=>{D.stopPropagation(),T()},children:"Clear"})]},"custom"),O.length===0&&i!==""?k.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):O.map(D=>k.jsx(fl.Option,{className:({active:I})=>`relative cursor-default select-none border-b border-muted py-2 pl-10 pr-4 ${I?"bg-muted":"text-foreground-900"}`,value:D,children:({selected:I,active:N})=>(I&&console.log("record",D,I),k.jsxs("div",{className:"",children:[k.jsx("span",{className:`block ${I?"font-medium":"font-normal"}`,children:typeof D.value=="boolean"?D.value?"True":"False":D.value}),I?k.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:k.jsx(O2,{className:"h-5 w-5","aria-hidden":"true"})}):null]}))},D.value))]})})]})})})}const mZ=m.forwardRef((e,t)=>m.createElement(ke.label,ne({},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()}}))),BM=mZ,vZ=Zx("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),si=ie.forwardRef(({className:e,...t},n)=>k.jsx(BM,{ref:n,className:Se(vZ(),e),...t}));si.displayName=BM.displayName;function vt(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 Er(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Bn(e,t){const n=vt(e);return isNaN(t)?Er(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function so(e,t){const n=vt(e);if(isNaN(t))return Er(e,NaN);if(!t)return n;const r=n.getDate(),o=Er(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 Jx=6048e5,bZ=864e5;let yZ={};function qd(){return yZ}function To(e,t){var a,l,u,d;const n=qd(),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??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,o=vt(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 Ma(e){return To(e,{weekStartsOn:1})}function HM(e){const t=vt(e),n=t.getFullYear(),r=Er(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=Ma(r),i=Er(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=Ma(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function fc(e){const t=vt(e);return t.setHours(0,0,0,0),t}function Ap(e){const t=vt(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 Eo(e,t){const n=fc(e),r=fc(t),o=+n-Ap(n),i=+r-Ap(r);return Math.round((o-i)/bZ)}function xZ(e){const t=HM(e),n=Er(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Ma(n)}function Z0(e,t){const n=t*7;return Bn(e,n)}function wZ(e,t){return so(e,t*12)}function _Z(e){let t;return e.forEach(function(n){const r=vt(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function SZ(e){let t;return e.forEach(n=>{const r=vt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function tr(e,t){const n=fc(e),r=fc(t);return+n==+r}function ew(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function CZ(e){if(!ew(e)&&typeof e!="number")return!1;const t=vt(e);return!isNaN(Number(t))}function rd(e,t){const n=vt(e),r=vt(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function EZ(e,t,n){const r=To(e,n),o=To(t,n),i=+r-Ap(r),s=+o-Ap(o);return Math.round((i-s)/Jx)}function tw(e){const t=vt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function rr(e){const t=vt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function WM(e){const t=vt(e),n=Er(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function nw(e,t){var a,l,u,d;const n=qd(),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??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,o=vt(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 UM(e){return nw(e,{weekStartsOn:1})}const RZ={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"}},$Z=(e,t,n)=>{let r;const o=RZ[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 ib(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const PZ={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},OZ={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},MZ={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},DZ={date:ib({formats:PZ,defaultWidth:"full"}),time:ib({formats:OZ,defaultWidth:"full"}),dateTime:ib({formats:MZ,defaultWidth:"full"})},TZ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},AZ=(e,t,n,r)=>TZ[e];function iu(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 IZ={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},kZ={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},NZ={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"]},LZ={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"]},FZ={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"}},zZ={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"}},jZ=(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"},VZ={ordinalNumber:jZ,era:iu({values:IZ,defaultWidth:"wide"}),quarter:iu({values:kZ,defaultWidth:"wide",argumentCallback:e=>e-1}),month:iu({values:NZ,defaultWidth:"wide"}),day:iu({values:LZ,defaultWidth:"wide"}),dayPeriod:iu({values:FZ,defaultWidth:"wide",formattingValues:zZ,defaultFormattingWidth:"wide"})};function su(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)?HZ(a,f=>f.test(s)):BZ(a,f=>f.test(s));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(s.length);return{value:u,rest:d}}}function BZ(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function HZ(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function WZ(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 UZ=/^(\d+)(th|st|nd|rd)?/i,qZ=/\d+/i,GZ={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},YZ={any:[/^b/i,/^(a|c)/i]},KZ={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},XZ={any:[/1/i,/2/i,/3/i,/4/i]},QZ={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},ZZ={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]},JZ={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},eJ={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]},tJ={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},nJ={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}},rJ={ordinalNumber:WZ({matchPattern:UZ,parsePattern:qZ,valueCallback:e=>parseInt(e,10)}),era:su({matchPatterns:GZ,defaultMatchWidth:"wide",parsePatterns:YZ,defaultParseWidth:"any"}),quarter:su({matchPatterns:KZ,defaultMatchWidth:"wide",parsePatterns:XZ,defaultParseWidth:"any",valueCallback:e=>e+1}),month:su({matchPatterns:QZ,defaultMatchWidth:"wide",parsePatterns:ZZ,defaultParseWidth:"any"}),day:su({matchPatterns:JZ,defaultMatchWidth:"wide",parsePatterns:eJ,defaultParseWidth:"any"}),dayPeriod:su({matchPatterns:tJ,defaultMatchWidth:"any",parsePatterns:nJ,defaultParseWidth:"any"})},qM={code:"en-US",formatDistance:$Z,formatLong:DZ,formatRelative:AZ,localize:VZ,match:rJ,options:{weekStartsOn:0,firstWeekContainsDate:1}};function oJ(e){const t=vt(e);return Eo(t,WM(t))+1}function GM(e){const t=vt(e),n=+Ma(t)-+xZ(t);return Math.round(n/Jx)+1}function YM(e,t){var d,f,p,g;const n=vt(e),r=n.getFullYear(),o=qd(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??o.firstWeekContainsDate??((g=(p=o.locale)==null?void 0:p.options)==null?void 0:g.firstWeekContainsDate)??1,s=Er(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=To(s,t),l=Er(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const u=To(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function iJ(e,t){var a,l,u,d;const n=qd(),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??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,o=YM(e,t),i=Er(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),To(i,t)}function KM(e,t){const n=vt(e),r=+To(n,t)-+iJ(n,t);return Math.round(r/Jx)+1}function Rt(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Li={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Rt(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Rt(n+1,2)},d(e,t){return Rt(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 Rt(e.getHours()%12||12,t.length)},H(e,t){return Rt(e.getHours(),t.length)},m(e,t){return Rt(e.getMinutes(),t.length)},s(e,t){return Rt(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Rt(o,t.length)}},hl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},cR={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 Li.y(e,t)},Y:function(e,t,n,r){const o=YM(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return Rt(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Rt(i,t.length)},R:function(e,t){const n=HM(e);return Rt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Rt(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 Rt(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 Rt(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 Li.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 Rt(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=KM(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Rt(o,t.length)},I:function(e,t,n){const r=GM(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Rt(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Li.d(e,t)},D:function(e,t,n){const r=oJ(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Rt(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 Rt(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 Rt(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 Rt(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=hl.noon:r===0?o=hl.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=hl.evening:r>=12?o=hl.afternoon:r>=4?o=hl.morning:o=hl.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 Li.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Li.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Rt(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Rt(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Li.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Li.s(e,t)},S:function(e,t){return Li.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return dR(r);case"XXXX":case"XX":return Xs(r);case"XXXXX":case"XXX":default:return Xs(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return dR(r);case"xxxx":case"xx":return Xs(r);case"xxxxx":case"xxx":default:return Xs(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+uR(r,":");case"OOOO":default:return"GMT"+Xs(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+uR(r,":");case"zzzz":default:return"GMT"+Xs(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Rt(r,t.length)},T:function(e,t,n){const r=e.getTime();return Rt(r,t.length)}};function uR(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+Rt(i,2)}function dR(e,t){return e%60===0?(e>0?"-":"+")+Rt(Math.abs(e)/60,2):Xs(e,t)}function Xs(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Rt(Math.trunc(r/60),2),i=Rt(r%60,2);return n+o+t+i}const fR=(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"})}},XM=(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"})}},sJ=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return fR(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}}",fR(r,t)).replace("{{time}}",XM(o,t))},aJ={p:XM,P:sJ},lJ=/^D+$/,cJ=/^Y+$/,uJ=["D","DD","YY","YYYY"];function dJ(e){return lJ.test(e)}function fJ(e){return cJ.test(e)}function hJ(e,t,n){const r=pJ(e,t,n);if(console.warn(r),uJ.includes(e))throw new RangeError(r)}function pJ(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 gJ=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,mJ=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,vJ=/^'([^]*?)'?$/,bJ=/''/g,yJ=/[a-zA-Z]/;function Po(e,t,n){var d,f,p,g,b,y,x,_;const r=qd(),o=(n==null?void 0:n.locale)??r.locale??qM,i=(n==null?void 0:n.firstWeekContainsDate)??((f=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((g=(p=r.locale)==null?void 0:p.options)==null?void 0:g.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((y=(b=n==null?void 0:n.locale)==null?void 0:b.options)==null?void 0:y.weekStartsOn)??r.weekStartsOn??((_=(x=r.locale)==null?void 0:x.options)==null?void 0:_.weekStartsOn)??0,a=vt(e);if(!CZ(a))throw new RangeError("Invalid time value");let l=t.match(mJ).map(w=>{const C=w[0];if(C==="p"||C==="P"){const R=aJ[C];return R(w,o.formatLong)}return w}).join("").match(gJ).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const C=w[0];if(C==="'")return{isToken:!1,value:xJ(w)};if(cR[C])return{isToken:!0,value:w};if(C.match(yJ))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:w}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const u={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(w=>{if(!w.isToken)return w.value;const C=w.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&fJ(C)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&dJ(C))&&hJ(C,t,String(e));const R=cR[C[0]];return R(a,C,o.localize,u)}).join("")}function xJ(e){const t=e.match(vJ);return t?t[1].replace(bJ,"'"):e}function wJ(e){const t=vt(e),n=t.getFullYear(),r=t.getMonth(),o=Er(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function _J(e){return Math.trunc(+vt(e)/1e3)}function SJ(e){const t=vt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function CJ(e,t){return EZ(SJ(e),rr(e),t)+1}function J0(e,t){const n=vt(e),r=vt(t);return n.getTime()>r.getTime()}function QM(e,t){const n=vt(e),r=vt(t);return+n<+r}function rw(e,t){const n=vt(e),r=vt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function EJ(e,t){const n=vt(e),r=vt(t);return n.getFullYear()===r.getFullYear()}function sb(e,t){return Bn(e,-t)}function ab(e,t){const n=vt(e),r=n.getFullYear(),o=n.getDate(),i=Er(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=wJ(i);return n.setMonth(t,Math.min(o,s)),n}function hR(e,t){const n=vt(e);return isNaN(+n)?Er(e,NaN):(n.setFullYear(t),n)}var je=function(){return je=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},je.apply(this,arguments)};function RJ(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 ZM(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 ey={exports:{}},au={};/**
285
- * @license React
286
- * react-jsx-runtime.development.js
287
- *
288
- * Copyright (c) Facebook, Inc. and its affiliates.
289
- *
290
- * This source code is licensed under the MIT license found in the
291
- * LICENSE file in the root directory of this source tree.
292
- */var pR;function $J(){return pR||(pR=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"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),b=Symbol.iterator,y="@@iterator";function x($){if($===null||typeof $!="object")return null;var U=b&&$[b]||$[y];return typeof U=="function"?U:null}var _=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w($){{for(var U=arguments.length,oe=new Array(U>1?U-1:0),xe=1;xe<U;xe++)oe[xe-1]=arguments[xe];C("error",$,oe)}}function C($,U,oe){{var xe=_.ReactDebugCurrentFrame,Te=xe.getStackAddendum();Te!==""&&(U+="%s",oe=oe.concat([Te]));var Ie=oe.map(function(Pe){return String(Pe)});Ie.unshift("Warning: "+U),Function.prototype.apply.call(console[$],console,Ie)}}var R=!1,E=!1,T=!1,O=!1,D=!1,I;I=Symbol.for("react.module.reference");function N($){return!!(typeof $=="string"||typeof $=="function"||$===r||$===i||D||$===o||$===u||$===d||O||$===g||R||E||T||typeof $=="object"&&$!==null&&($.$$typeof===p||$.$$typeof===f||$.$$typeof===s||$.$$typeof===a||$.$$typeof===l||$.$$typeof===I||$.getModuleId!==void 0))}function V($,U,oe){var xe=$.displayName;if(xe)return xe;var Te=U.displayName||U.name||"";return Te!==""?oe+"("+Te+")":oe}function G($){return $.displayName||"Context"}function le($){if($==null)return null;if(typeof $.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof $=="function")return $.displayName||$.name||null;if(typeof $=="string")return $;switch($){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof $=="object")switch($.$$typeof){case a:var U=$;return G(U)+".Consumer";case s:var oe=$;return G(oe._context)+".Provider";case l:return V($,$.render,"ForwardRef");case f:var xe=$.displayName||null;return xe!==null?xe:le($.type)||"Memo";case p:{var Te=$,Ie=Te._payload,Pe=Te._init;try{return le(Pe(Ie))}catch{return null}}}return null}var ee=Object.assign,F=0,Z,Y,Q,ae,j,B,te;function ce(){}ce.__reactDisabledLog=!0;function ue(){{if(F===0){Z=console.log,Y=console.info,Q=console.warn,ae=console.error,j=console.group,B=console.groupCollapsed,te=console.groupEnd;var $={configurable:!0,enumerable:!0,value:ce,writable:!0};Object.defineProperties(console,{info:$,log:$,warn:$,error:$,group:$,groupCollapsed:$,groupEnd:$})}F++}}function ge(){{if(F--,F===0){var $={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ee({},$,{value:Z}),info:ee({},$,{value:Y}),warn:ee({},$,{value:Q}),error:ee({},$,{value:ae}),group:ee({},$,{value:j}),groupCollapsed:ee({},$,{value:B}),groupEnd:ee({},$,{value:te})})}F<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ve=_.ReactCurrentDispatcher,de;function J($,U,oe){{if(de===void 0)try{throw Error()}catch(Te){var xe=Te.stack.trim().match(/\n( *(at )?)/);de=xe&&xe[1]||""}return`
293
- `+de+$}}var X=!1,re;{var be=typeof WeakMap=="function"?WeakMap:Map;re=new be}function H($,U){if(!$||X)return"";{var oe=re.get($);if(oe!==void 0)return oe}var xe;X=!0;var Te=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ie;Ie=ve.current,ve.current=null,ue();try{if(U){var Pe=function(){throw Error()};if(Object.defineProperty(Pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Pe,[])}catch(Bt){xe=Bt}Reflect.construct($,[],Pe)}else{try{Pe.call()}catch(Bt){xe=Bt}$.call(Pe.prototype)}}else{try{throw Error()}catch(Bt){xe=Bt}$()}}catch(Bt){if(Bt&&xe&&typeof Bt.stack=="string"){for(var Re=Bt.stack.split(`
294
- `),mt=xe.stack.split(`
295
- `),He=Re.length-1,Ge=mt.length-1;He>=1&&Ge>=0&&Re[He]!==mt[Ge];)Ge--;for(;He>=1&&Ge>=0;He--,Ge--)if(Re[He]!==mt[Ge]){if(He!==1||Ge!==1)do if(He--,Ge--,Ge<0||Re[He]!==mt[Ge]){var Ot=`
296
- `+Re[He].replace(" at new "," at ");return $.displayName&&Ot.includes("<anonymous>")&&(Ot=Ot.replace("<anonymous>",$.displayName)),typeof $=="function"&&re.set($,Ot),Ot}while(He>=1&&Ge>=0);break}}}finally{X=!1,ve.current=Ie,ge(),Error.prepareStackTrace=Te}var fn=$?$.displayName||$.name:"",Ms=fn?J(fn):"";return typeof $=="function"&&re.set($,Ms),Ms}function De($,U,oe){return H($,!1)}function Ne($){var U=$.prototype;return!!(U&&U.isReactComponent)}function Ve($,U,oe){if($==null)return"";if(typeof $=="function")return H($,Ne($));if(typeof $=="string")return J($);switch($){case u:return J("Suspense");case d:return J("SuspenseList")}if(typeof $=="object")switch($.$$typeof){case l:return De($.render);case f:return Ve($.type,U,oe);case p:{var xe=$,Te=xe._payload,Ie=xe._init;try{return Ve(Ie(Te),U,oe)}catch{}}}return""}var qe=Object.prototype.hasOwnProperty,gt={},ft=_.ReactDebugCurrentFrame;function ht($){if($){var U=$._owner,oe=Ve($.type,$._source,U?U.type:null);ft.setExtraStackFrame(oe)}else ft.setExtraStackFrame(null)}function Gt($,U,oe,xe,Te){{var Ie=Function.call.bind(qe);for(var Pe in $)if(Ie($,Pe)){var Re=void 0;try{if(typeof $[Pe]!="function"){var mt=Error((xe||"React class")+": "+oe+" type `"+Pe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof $[Pe]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw mt.name="Invariant Violation",mt}Re=$[Pe](U,Pe,xe,oe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(He){Re=He}Re&&!(Re instanceof Error)&&(ht(Te),w("%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).",xe||"React class",oe,Pe,typeof Re),ht(null)),Re instanceof Error&&!(Re.message in gt)&&(gt[Re.message]=!0,ht(Te),w("Failed %s type: %s",oe,Re.message),ht(null))}}}var Wt=Array.isArray;function En($){return Wt($)}function rn($){{var U=typeof Symbol=="function"&&Symbol.toStringTag,oe=U&&$[Symbol.toStringTag]||$.constructor.name||"Object";return oe}}function Cc($){try{return Gr($),!1}catch{return!0}}function Gr($){return""+$}function gs($){if(Cc($))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",rn($)),Gr($)}var vn=_.ReactCurrentOwner,co={key:!0,ref:!0,__self:!0,__source:!0},zo,jo,Yr;Yr={};function ms($){if(qe.call($,"ref")){var U=Object.getOwnPropertyDescriptor($,"ref").get;if(U&&U.isReactWarning)return!1}return $.ref!==void 0}function vs($){if(qe.call($,"key")){var U=Object.getOwnPropertyDescriptor($,"key").get;if(U&&U.isReactWarning)return!1}return $.key!==void 0}function bs($,U){if(typeof $.ref=="string"&&vn.current&&U&&vn.current.stateNode!==U){var oe=le(vn.current.type);Yr[oe]||(w('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',le(vn.current.type),$.ref),Yr[oe]=!0)}}function ys($,U){{var oe=function(){zo||(zo=!0,w("%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)",U))};oe.isReactWarning=!0,Object.defineProperty($,"key",{get:oe,configurable:!0})}}function xs($,U){{var oe=function(){jo||(jo=!0,w("%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)",U))};oe.isReactWarning=!0,Object.defineProperty($,"ref",{get:oe,configurable:!0})}}var ws=function($,U,oe,xe,Te,Ie,Pe){var Re={$$typeof:t,type:$,key:U,ref:oe,props:Pe,_owner:Ie};return Re._store={},Object.defineProperty(Re._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Re,"_self",{configurable:!1,enumerable:!1,writable:!1,value:xe}),Object.defineProperty(Re,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Te}),Object.freeze&&(Object.freeze(Re.props),Object.freeze(Re)),Re};function Ec($,U,oe,xe,Te){{var Ie,Pe={},Re=null,mt=null;oe!==void 0&&(gs(oe),Re=""+oe),vs(U)&&(gs(U.key),Re=""+U.key),ms(U)&&(mt=U.ref,bs(U,Te));for(Ie in U)qe.call(U,Ie)&&!co.hasOwnProperty(Ie)&&(Pe[Ie]=U[Ie]);if($&&$.defaultProps){var He=$.defaultProps;for(Ie in He)Pe[Ie]===void 0&&(Pe[Ie]=He[Ie])}if(Re||mt){var Ge=typeof $=="function"?$.displayName||$.name||"Unknown":$;Re&&ys(Pe,Ge),mt&&xs(Pe,Ge)}return ws($,Re,mt,Te,xe,vn.current,Pe)}}var Vo=_.ReactCurrentOwner,_s=_.ReactDebugCurrentFrame;function Rn($){if($){var U=$._owner,oe=Ve($.type,$._source,U?U.type:null);_s.setExtraStackFrame(oe)}else _s.setExtraStackFrame(null)}var uo;uo=!1;function Bo($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function Ss(){{if(Vo.current){var $=le(Vo.current.type);if($)return`
297
-
298
- Check the render method of \``+$+"`."}return""}}function Rc($){{if($!==void 0){var U=$.fileName.replace(/^.*[\\\/]/,""),oe=$.lineNumber;return`
299
-
300
- Check your code at `+U+":"+oe+"."}return""}}var Cs={};function Ha($){{var U=Ss();if(!U){var oe=typeof $=="string"?$:$.displayName||$.name;oe&&(U=`
301
-
302
- Check the top-level render call using <`+oe+">.")}return U}}function Es($,U){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var oe=Ha(U);if(Cs[oe])return;Cs[oe]=!0;var xe="";$&&$._owner&&$._owner!==Vo.current&&(xe=" It was passed a child from "+le($._owner.type)+"."),Rn($),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',oe,xe),Rn(null)}}function Rs($,U){{if(typeof $!="object")return;if(En($))for(var oe=0;oe<$.length;oe++){var xe=$[oe];Bo(xe)&&Es(xe,U)}else if(Bo($))$._store&&($._store.validated=!0);else if($){var Te=x($);if(typeof Te=="function"&&Te!==$.entries)for(var Ie=Te.call($),Pe;!(Pe=Ie.next()).done;)Bo(Pe.value)&&Es(Pe.value,U)}}}function $c($){{var U=$.type;if(U==null||typeof U=="string")return;var oe;if(typeof U=="function")oe=U.propTypes;else if(typeof U=="object"&&(U.$$typeof===l||U.$$typeof===f))oe=U.propTypes;else return;if(oe){var xe=le(U);Gt(oe,$.props,"prop",xe,$)}else if(U.PropTypes!==void 0&&!uo){uo=!0;var Te=le(U);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Te||"Unknown")}typeof U.getDefaultProps=="function"&&!U.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function $s($){{for(var U=Object.keys($.props),oe=0;oe<U.length;oe++){var xe=U[oe];if(xe!=="children"&&xe!=="key"){Rn($),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",xe),Rn(null);break}}$.ref!==null&&(Rn($),w("Invalid attribute `ref` supplied to `React.Fragment`."),Rn(null))}}function Ps($,U,oe,xe,Te,Ie){{var Pe=N($);if(!Pe){var Re="";($===void 0||typeof $=="object"&&$!==null&&Object.keys($).length===0)&&(Re+=" 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 mt=Rc(Te);mt?Re+=mt:Re+=Ss();var He;$===null?He="null":En($)?He="array":$!==void 0&&$.$$typeof===t?(He="<"+(le($.type)||"Unknown")+" />",Re=" Did you accidentally export a JSX literal instead of a component?"):He=typeof $,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",He,Re)}var Ge=Ec($,U,oe,Te,Ie);if(Ge==null)return Ge;if(Pe){var Ot=U.children;if(Ot!==void 0)if(xe)if(En(Ot)){for(var fn=0;fn<Ot.length;fn++)Rs(Ot[fn],$);Object.freeze&&Object.freeze(Ot)}else w("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 Rs(Ot,$)}return $===r?$s(Ge):$c(Ge),Ge}}function Os($,U,oe){return Ps($,U,oe,!0)}function Pc($,U,oe){return Ps($,U,oe,!1)}var Oc=Pc,Mc=Os;au.Fragment=r,au.jsx=Oc,au.jsxs=Mc}()),au}var lu={};/**
303
- * @license React
304
- * react-jsx-runtime.production.min.js
305
- *
306
- * Copyright (c) Facebook, Inc. and its affiliates.
307
- *
308
- * This source code is licensed under the MIT license found in the
309
- * LICENSE file in the root directory of this source tree.
310
- */var gR;function PJ(){if(gR)return lu;gR=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,u){var d,f={},p=null,g=null;u!==void 0&&(p=""+u),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(g=l.ref);for(d in l)r.call(l,d)&&!i.hasOwnProperty(d)&&(f[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)f[d]===void 0&&(f[d]=l[d]);return{$$typeof:t,type:a,key:p,ref:g,props:f,_owner:o.current}}return lu.Fragment=n,lu.jsx=s,lu.jsxs=s,lu}process.env.NODE_ENV==="production"?ey.exports=PJ():ey.exports=$J();var me=ey.exports;function Gd(e){return e.mode==="multiple"}function Yd(e){return e.mode==="range"}function Og(e){return e.mode==="single"}var OJ={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 MJ(e,t){return Po(e,"LLLL y",t)}function DJ(e,t){return Po(e,"d",t)}function TJ(e,t){return Po(e,"LLLL",t)}function AJ(e){return"".concat(e)}function IJ(e,t){return Po(e,"cccccc",t)}function kJ(e,t){return Po(e,"yyyy",t)}var NJ=Object.freeze({__proto__:null,formatCaption:MJ,formatDay:DJ,formatMonthCaption:TJ,formatWeekNumber:AJ,formatWeekdayName:IJ,formatYearCaption:kJ}),LJ=function(e,t,n){return Po(e,"do MMMM (EEEE)",n)},FJ=function(){return"Month: "},zJ=function(){return"Go to next month"},jJ=function(){return"Go to previous month"},VJ=function(e,t){return Po(e,"cccc",t)},BJ=function(e){return"Week n. ".concat(e)},HJ=function(){return"Year: "},WJ=Object.freeze({__proto__:null,labelDay:LJ,labelMonthDropdown:FJ,labelNext:zJ,labelPrevious:jJ,labelWeekNumber:BJ,labelWeekday:VJ,labelYearDropdown:HJ});function UJ(){var e="buttons",t=OJ,n=qM,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:NJ,labels:WJ,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function qJ(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=rr(r):t&&(i=new Date(t,0,1)),o?s=tw(o):n&&(s=new Date(n,11,31)),{fromDate:i?fc(i):void 0,toDate:s?fc(s):void 0}}var JM=m.createContext(void 0);function GJ(e){var t,n=e.initialProps,r=UJ(),o=qJ(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;(Og(n)||Gd(n)||Yd(n))&&(l=n.onSelect);var u=je(je(je({},r),n),{captionLayout:a,classNames:je(je({},r.classNames),n.classNames),components:je({},n.components),formatters:je(je({},r.formatters),n.formatters),fromDate:i,labels:je(je({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:je(je({},r.modifiers),n.modifiers),modifiersClassNames:je(je({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:je(je({},r.styles),n.styles),toDate:s});return me.jsx(JM.Provider,{value:u,children:e.children})}function At(){var e=m.useContext(JM);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function eD(e){var t=At(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return me.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 YJ(e){return me.jsx("svg",je({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:me.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 tD(e){var t,n,r=e.onChange,o=e.value,i=e.children,s=e.caption,a=e.className,l=e.style,u=At(),d=(n=(t=u.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:YJ;return me.jsxs("div",{className:a,style:l,children:[me.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),me.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:o,onChange:r,children:i}),me.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[s,me.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function KJ(e){var t,n=At(),r=n.fromDate,o=n.toDate,i=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,u=n.components,d=n.labels.labelMonthDropdown;if(!r)return me.jsx(me.Fragment,{});if(!o)return me.jsx(me.Fragment,{});var f=[];if(EJ(r,o))for(var p=rr(r),g=r.getMonth();g<=o.getMonth();g++)f.push(ab(p,g));else for(var p=rr(new Date),g=0;g<=11;g++)f.push(ab(p,g));var b=function(x){var _=Number(x.target.value),w=ab(rr(e.displayMonth),_);e.onChange(w)},y=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:tD;return me.jsx(y,{name:"months","aria-label":d(),className:l.dropdown_month,style:i.dropdown_month,onChange:b,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:f.map(function(x){return me.jsx("option",{value:x.getMonth(),children:a(x,{locale:s})},x.getMonth())})})}function XJ(e){var t,n=e.displayMonth,r=At(),o=r.fromDate,i=r.toDate,s=r.locale,a=r.styles,l=r.classNames,u=r.components,d=r.formatters.formatYearCaption,f=r.labels.labelYearDropdown,p=[];if(!o)return me.jsx(me.Fragment,{});if(!i)return me.jsx(me.Fragment,{});for(var g=o.getFullYear(),b=i.getFullYear(),y=g;y<=b;y++)p.push(hR(WM(new Date),y));var x=function(w){var C=hR(rr(n),Number(w.target.value));e.onChange(C)},_=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:tD;return me.jsx(_,{name:"years","aria-label":f(),className:l.dropdown_year,style:a.dropdown_year,onChange:x,value:n.getFullYear(),caption:d(n,{locale:s}),children:p.map(function(w){return me.jsx("option",{value:w.getFullYear(),children:d(w,{locale:s})},w.getFullYear())})})}function QJ(e,t){var n=m.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function ZJ(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&&rd(i,o)<0){var u=-1*(l-1);o=so(i,u)}return s&&rd(o,s)<0&&(o=s),rr(o)}function JJ(){var e=At(),t=ZJ(e),n=QJ(t,e.month),r=n[0],o=n[1],i=function(s){var a;if(!e.disableNavigation){var l=rr(s);o(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,i]}function eee(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=rr(e),i=rr(so(o,r)),s=rd(i,o),a=[],l=0;l<s;l++){var u=so(o,l);a.push(u)}return n&&(a=a.reverse()),a}function tee(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=rr(e);if(!n)return so(a,s);var l=rd(n,e);if(!(l<i))return so(a,s)}}function nee(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=rr(e);if(!n)return so(a,-s);var l=rd(a,n);if(!(l<=0))return so(a,-s)}}var nD=m.createContext(void 0);function ree(e){var t=At(),n=JJ(),r=n[0],o=n[1],i=eee(r,t),s=tee(r,t),a=nee(r,t),l=function(f){return i.some(function(p){return rw(f,p)})},u=function(f,p){l(f)||(p&&QM(f,p)?o(so(f,1+t.numberOfMonths*-1)):o(f))},d={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:u,previousMonth:a,nextMonth:s,isDateDisplayed:l};return me.jsx(nD.Provider,{value:d,children:e.children})}function Kd(){var e=m.useContext(nD);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function mR(e){var t,n=At(),r=n.classNames,o=n.styles,i=n.components,s=Kd().goToMonth,a=function(d){s(so(d,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:eD,u=me.jsx(l,{id:e.id,displayMonth:e.displayMonth});return me.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[me.jsx("div",{className:r.vhidden,children:u}),me.jsx(KJ,{onChange:a,displayMonth:e.displayMonth}),me.jsx(XJ,{onChange:a,displayMonth:e.displayMonth})]})}function oee(e){return me.jsx("svg",je({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:me.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 iee(e){return me.jsx("svg",je({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:me.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 Ip=m.forwardRef(function(e,t){var n=At(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var s=i.join(" "),a=je(je({},o.button_reset),o.button);return e.style&&Object.assign(a,e.style),me.jsx("button",je({},e,{ref:t,type:"button",className:s,style:a}))});function see(e){var t,n,r=At(),o=r.dir,i=r.locale,s=r.classNames,a=r.styles,l=r.labels,u=l.labelPrevious,d=l.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return me.jsx(me.Fragment,{});var p=u(e.previousMonth,{locale:i}),g=[s.nav_button,s.nav_button_previous].join(" "),b=d(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:iee,_=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:oee;return me.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&me.jsx(Ip,{name:"previous-month","aria-label":p,className:g,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?me.jsx(x,{className:s.nav_icon,style:a.nav_icon}):me.jsx(_,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&me.jsx(Ip,{name:"next-month","aria-label":b,className:y,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?me.jsx(_,{className:s.nav_icon,style:a.nav_icon}):me.jsx(x,{className:s.nav_icon,style:a.nav_icon})})]})}function vR(e){var t=At().numberOfMonths,n=Kd(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(b){return rw(e.displayMonth,b)}),l=a===0,u=a===s.length-1,d=t>1&&(l||!u),f=t>1&&(u||!l),p=function(){r&&i(r)},g=function(){o&&i(o)};return me.jsx(see,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:f,nextMonth:o,previousMonth:r,onPreviousClick:p,onNextClick:g})}function aee(e){var t,n=At(),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:eD,u;return o?u=me.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?u=me.jsx(mR,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?u=me.jsxs(me.Fragment,{children:[me.jsx(mR,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),me.jsx(vR,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):u=me.jsxs(me.Fragment,{children:[me.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),me.jsx(vR,{displayMonth:e.displayMonth,id:e.id})]}),me.jsx("div",{className:r.caption,style:i.caption,children:u})}function lee(e){var t=At(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?me.jsx("tfoot",{className:o,style:r.tfoot,children:me.jsx("tr",{children:me.jsx("td",{colSpan:8,children:n})})}):me.jsx(me.Fragment,{})}function cee(e,t,n){for(var r=n?Ma(new Date):To(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=Bn(r,i);o.push(s)}return o}function uee(){var e=At(),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,u=cee(o,i,s);return me.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&me.jsx("td",{style:n.head_cell,className:t.head_cell}),u.map(function(d,f){return me.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(d,{locale:o}),children:a(d,{locale:o})},f)})]})}function dee(){var e,t=At(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:uee;return me.jsx("thead",{style:r.head,className:n.head,children:me.jsx(i,{})})}function fee(e){var t=At(),n=t.locale,r=t.formatters.formatDay;return me.jsx(me.Fragment,{children:r(e.date,{locale:n})})}var ow=m.createContext(void 0);function hee(e){if(!Gd(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return me.jsx(ow.Provider,{value:t,children:e.children})}return me.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(u,d,f){var p,g;(p=t.onDayClick)===null||p===void 0||p.call(t,u,d,f);var b=!!(d.selected&&o&&(r==null?void 0:r.length)===o);if(!b){var y=!!(!d.selected&&i&&(r==null?void 0:r.length)===i);if(!y){var x=r?ZM([],r,!0):[];if(d.selected){var _=x.findIndex(function(w){return tr(u,w)});x.splice(_,1)}else x.push(u);(g=t.onSelect)===null||g===void 0||g.call(t,x,u,d,f)}}},a={disabled:[]};r&&a.disabled.push(function(u){var d=i&&r.length>i-1,f=r.some(function(p){return tr(p,u)});return!!(d&&!f)});var l={selected:r,onDayClick:s,modifiers:a};return me.jsx(ow.Provider,{value:l,children:n})}function iw(){var e=m.useContext(ow);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function gee(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?tr(o,e)&&tr(r,e)?void 0:tr(o,e)?{from:o,to:void 0}:tr(r,e)?void 0:J0(r,e)?{from:e,to:o}:{from:r,to:e}:o?J0(e,o)?{from:o,to:e}:{from:e,to:o}:r?QM(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var sw=m.createContext(void 0);function mee(e){if(!Yd(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return me.jsx(sw.Provider,{value:t,children:e.children})}return me.jsx(vee,{initialProps:e.initialProps,children:e.children})}function vee(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,u=function(g,b,y){var x,_;(x=t.onDayClick)===null||x===void 0||x.call(t,g,b,y);var w=gee(g,r);(_=t.onSelect)===null||_===void 0||_.call(t,w,g,b,y)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(d.range_start=[i],s?(d.range_end=[s],tr(i,s)||(d.range_middle=[{after:i,before:s}])):d.range_end=[i]):s&&(d.range_start=[s],d.range_end=[s]),a&&(i&&!s&&d.disabled.push({after:sb(i,a-1),before:Bn(i,a-1)}),i&&s&&d.disabled.push({after:i,before:Bn(i,a-1)}),!i&&s&&d.disabled.push({after:sb(s,a-1),before:Bn(s,a-1)})),l){if(i&&!s&&(d.disabled.push({before:Bn(i,-l+1)}),d.disabled.push({after:Bn(i,l-1)})),i&&s){var f=Eo(s,i)+1,p=l-f;d.disabled.push({before:sb(i,p)}),d.disabled.push({after:Bn(s,p)})}!i&&s&&(d.disabled.push({before:Bn(s,-l+1)}),d.disabled.push({after:Bn(s,l-1)}))}return me.jsx(sw.Provider,{value:{selected:r,onDayClick:u,modifiers:d},children:n})}function aw(){var e=m.useContext(sw);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function qh(e){return Array.isArray(e)?ZM([],e,!0):e!==void 0?[e]:[]}function bee(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=qh(o)}),t}var ao;(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"})(ao||(ao={}));var yee=ao.Selected,ei=ao.Disabled,xee=ao.Hidden,wee=ao.Today,lb=ao.RangeEnd,cb=ao.RangeMiddle,ub=ao.RangeStart,_ee=ao.Outside;function See(e,t,n){var r,o=(r={},r[yee]=qh(e.selected),r[ei]=qh(e.disabled),r[xee]=qh(e.hidden),r[wee]=[e.today],r[lb]=[],r[cb]=[],r[ub]=[],r[_ee]=[],r);return e.fromDate&&o[ei].push({before:e.fromDate}),e.toDate&&o[ei].push({after:e.toDate}),Gd(e)?o[ei]=o[ei].concat(t.modifiers[ei]):Yd(e)&&(o[ei]=o[ei].concat(n.modifiers[ei]),o[ub]=n.modifiers[ub],o[cb]=n.modifiers[cb],o[lb]=n.modifiers[lb]),o}var rD=m.createContext(void 0);function Cee(e){var t=At(),n=iw(),r=aw(),o=See(t,n,r),i=bee(t.modifiers),s=je(je({},o),i);return me.jsx(rD.Provider,{value:s,children:e.children})}function oD(){var e=m.useContext(rD);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function Eee(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function Ree(e){return!!(e&&typeof e=="object"&&"from"in e)}function $ee(e){return!!(e&&typeof e=="object"&&"after"in e)}function Pee(e){return!!(e&&typeof e=="object"&&"before"in e)}function Oee(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function Mee(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=Eo(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var s=Eo(e,r)>=0&&Eo(o,e)>=0;return s}return o?tr(o,e):r?tr(r,e):!1}function Dee(e){return ew(e)}function Tee(e){return Array.isArray(e)&&e.every(ew)}function Aee(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(Dee(n))return tr(e,n);if(Tee(n))return n.includes(e);if(Ree(n))return Mee(e,n);if(Oee(n))return n.dayOfWeek.includes(e.getDay());if(Eee(n)){var r=Eo(n.before,e),o=Eo(n.after,e),i=r>0,s=o<0,a=J0(n.before,n.after);return a?s&&i:i||s}return $ee(n)?Eo(e,n.after)>0:Pee(n)?Eo(n.before,e)>0:typeof n=="function"?n(e):!1})}function lw(e,t,n){var r=Object.keys(t).reduce(function(i,s){var a=t[s];return Aee(e,a)&&i.push(s),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!rw(e,n)&&(o.outside=!0),o}function Iee(e,t){for(var n=rr(e[0]),r=tw(e[e.length-1]),o,i,s=n;s<=r;){var a=lw(s,t),l=!a.disabled&&!a.hidden;if(!l){s=Bn(s,1);continue}if(a.selected)return s;a.today&&!i&&(i=s),o||(o=s),s=Bn(s,1)}return i||o}var kee=365;function iD(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,u=o.fromDate,d=o.toDate,f=o.locale,p={day:Bn,week:Z0,month:so,year:wZ,startOfWeek:function(x){return o.ISOWeek?Ma(x):To(x,{locale:f,weekStartsOn:l})},endOfWeek:function(x){return o.ISOWeek?UM(x):nw(x,{locale:f,weekStartsOn:l})}},g=p[n](e,r==="after"?1:-1);r==="before"&&u?g=_Z([u,g]):r==="after"&&d&&(g=SZ([d,g]));var b=!0;if(i){var y=lw(g,i);b=!y.disabled&&!y.hidden}return b?g:a.count>kee?a.lastFocused:iD(g,{moveBy:n,direction:r,context:o,modifiers:i,retry:je(je({},a),{count:a.count+1})})}var sD=m.createContext(void 0);function Nee(e){var t=Kd(),n=oD(),r=m.useState(),o=r[0],i=r[1],s=m.useState(),a=s[0],l=s[1],u=Iee(t.displayMonths,n),d=o??(a&&t.isDateDisplayed(a))?a:u,f=function(){l(o),i(void 0)},p=function(x){i(x)},g=At(),b=function(x,_){if(o){var w=iD(o,{moveBy:x,direction:_,context:g,modifiers:n});tr(o,w)||(t.goToDate(w,o),p(w))}},y={focusedDay:o,focusTarget:d,blur:f,focus:p,focusDayAfter:function(){return b("day","after")},focusDayBefore:function(){return b("day","before")},focusWeekAfter:function(){return b("week","after")},focusWeekBefore:function(){return b("week","before")},focusMonthBefore:function(){return b("month","before")},focusMonthAfter:function(){return b("month","after")},focusYearBefore:function(){return b("year","before")},focusYearAfter:function(){return b("year","after")},focusStartOfWeek:function(){return b("startOfWeek","before")},focusEndOfWeek:function(){return b("endOfWeek","after")}};return me.jsx(sD.Provider,{value:y,children:e.children})}function cw(){var e=m.useContext(sD);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Lee(e,t){var n=oD(),r=lw(e,n,t);return r}var uw=m.createContext(void 0);function Fee(e){if(!Og(e.initialProps)){var t={selected:void 0};return me.jsx(uw.Provider,{value:t,children:e.children})}return me.jsx(zee,{initialProps:e.initialProps,children:e.children})}function zee(e){var t=e.initialProps,n=e.children,r=function(i,s,a){var l,u,d;if((l=t.onDayClick)===null||l===void 0||l.call(t,i,s,a),s.selected&&!t.required){(u=t.onSelect)===null||u===void 0||u.call(t,void 0,i,s,a);return}(d=t.onSelect)===null||d===void 0||d.call(t,i,i,s,a)},o={selected:t.selected,onDayClick:r};return me.jsx(uw.Provider,{value:o,children:n})}function aD(){var e=m.useContext(uw);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function jee(e,t){var n=At(),r=aD(),o=iw(),i=aw(),s=cw(),a=s.focusDayAfter,l=s.focusDayBefore,u=s.focusWeekAfter,d=s.focusWeekBefore,f=s.blur,p=s.focus,g=s.focusMonthBefore,b=s.focusMonthAfter,y=s.focusYearBefore,x=s.focusYearAfter,_=s.focusStartOfWeek,w=s.focusEndOfWeek,C=function(Y){var Q,ae,j,B;Og(n)?(Q=r.onDayClick)===null||Q===void 0||Q.call(r,e,t,Y):Gd(n)?(ae=o.onDayClick)===null||ae===void 0||ae.call(o,e,t,Y):Yd(n)?(j=i.onDayClick)===null||j===void 0||j.call(i,e,t,Y):(B=n.onDayClick)===null||B===void 0||B.call(n,e,t,Y)},R=function(Y){var Q;p(e),(Q=n.onDayFocus)===null||Q===void 0||Q.call(n,e,t,Y)},E=function(Y){var Q;f(),(Q=n.onDayBlur)===null||Q===void 0||Q.call(n,e,t,Y)},T=function(Y){var Q;(Q=n.onDayMouseEnter)===null||Q===void 0||Q.call(n,e,t,Y)},O=function(Y){var Q;(Q=n.onDayMouseLeave)===null||Q===void 0||Q.call(n,e,t,Y)},D=function(Y){var Q;(Q=n.onDayPointerEnter)===null||Q===void 0||Q.call(n,e,t,Y)},I=function(Y){var Q;(Q=n.onDayPointerLeave)===null||Q===void 0||Q.call(n,e,t,Y)},N=function(Y){var Q;(Q=n.onDayTouchCancel)===null||Q===void 0||Q.call(n,e,t,Y)},V=function(Y){var Q;(Q=n.onDayTouchEnd)===null||Q===void 0||Q.call(n,e,t,Y)},G=function(Y){var Q;(Q=n.onDayTouchMove)===null||Q===void 0||Q.call(n,e,t,Y)},le=function(Y){var Q;(Q=n.onDayTouchStart)===null||Q===void 0||Q.call(n,e,t,Y)},ee=function(Y){var Q;(Q=n.onDayKeyUp)===null||Q===void 0||Q.call(n,e,t,Y)},F=function(Y){var Q;switch(Y.key){case"ArrowLeft":Y.preventDefault(),Y.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":Y.preventDefault(),Y.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":Y.preventDefault(),Y.stopPropagation(),u();break;case"ArrowUp":Y.preventDefault(),Y.stopPropagation(),d();break;case"PageUp":Y.preventDefault(),Y.stopPropagation(),Y.shiftKey?y():g();break;case"PageDown":Y.preventDefault(),Y.stopPropagation(),Y.shiftKey?x():b();break;case"Home":Y.preventDefault(),Y.stopPropagation(),_();break;case"End":Y.preventDefault(),Y.stopPropagation(),w();break}(Q=n.onDayKeyDown)===null||Q===void 0||Q.call(n,e,t,Y)},Z={onClick:C,onFocus:R,onBlur:E,onKeyDown:F,onKeyUp:ee,onMouseEnter:T,onMouseLeave:O,onPointerEnter:D,onPointerLeave:I,onTouchCancel:N,onTouchEnd:V,onTouchMove:G,onTouchStart:le};return Z}function Vee(){var e=At(),t=aD(),n=iw(),r=aw(),o=Og(e)?t.selected:Gd(e)?n.selected:Yd(e)?r.selected:void 0;return o}function Bee(e){return Object.values(ao).includes(e)}function Hee(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(Bee(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function Wee(e,t){var n=je({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=je(je({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function Uee(e,t,n){var r,o,i,s=At(),a=cw(),l=Lee(e,t),u=jee(e,l),d=Vee(),f=!!(s.onDayClick||s.mode!=="default");m.useEffect(function(){var T;l.outside||a.focusedDay&&f&&tr(a.focusedDay,e)&&((T=n.current)===null||T===void 0||T.focus())},[a.focusedDay,e,n,f,l.outside]);var p=Hee(s,l).join(" "),g=Wee(s,l),b=!!(l.outside&&!s.showOutsideDays||l.hidden),y=(i=(o=s.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:fee,x=me.jsx(y,{date:e,displayMonth:t,activeModifiers:l}),_={style:g,className:p,children:x,role:"gridcell"},w=a.focusTarget&&tr(a.focusTarget,e)&&!l.outside,C=a.focusedDay&&tr(a.focusedDay,e),R=je(je(je({},_),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=C||w?0:-1,r)),u),E={isButton:f,isHidden:b,activeModifiers:l,selectedDays:d,buttonProps:R,divProps:_};return E}function qee(e){var t=m.useRef(null),n=Uee(e.date,e.displayMonth,t);return n.isHidden?me.jsx("div",{role:"gridcell"}):n.isButton?me.jsx(Ip,je({name:"day",ref:t},n.buttonProps)):me.jsx("div",je({},n.divProps))}function Gee(e){var t=e.number,n=e.dates,r=At(),o=r.onWeekNumberClick,i=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,d=u(Number(t),{locale:a});if(!o)return me.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:d});var f=l(Number(t),{locale:a}),p=function(g){o(t,n,g)};return me.jsx(Ip,{name:"week-number","aria-label":f,className:s.weeknumber,style:i.weeknumber,onClick:p,children:d})}function Yee(e){var t,n,r=At(),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:qee,u=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:Gee,d;return s&&(d=me.jsx("td",{className:i.cell,style:o.cell,children:me.jsx(u,{number:e.weekNumber,dates:e.dates})})),me.jsxs("tr",{className:i.row,style:o.row,children:[d,e.dates.map(function(f){return me.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:me.jsx(l,{displayMonth:e.displayMonth,date:f})},_J(f))})]})}function bR(e,t,n){for(var r=n!=null&&n.ISOWeek?UM(t):nw(t,n),o=n!=null&&n.ISOWeek?Ma(e):To(e,n),i=Eo(r,o),s=[],a=0;a<=i;a++)s.push(Bn(o,a));var l=s.reduce(function(u,d){var f=n!=null&&n.ISOWeek?GM(d):KM(d,n),p=u.find(function(g){return g.weekNumber===f});return p?(p.dates.push(d),u):(u.push({weekNumber:f,dates:[d]}),u)},[]);return l}function Kee(e,t){var n=bR(rr(e),tw(e),t);if(t!=null&&t.useFixedWeeks){var r=CJ(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=Z0(i,6-r),a=bR(Z0(i,1),s,t);n.push.apply(n,a)}}return n}function Xee(e){var t,n,r,o=At(),i=o.locale,s=o.classNames,a=o.styles,l=o.hideHead,u=o.fixedWeeks,d=o.components,f=o.weekStartsOn,p=o.firstWeekContainsDate,g=o.ISOWeek,b=Kee(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:g,locale:i,weekStartsOn:f,firstWeekContainsDate:p}),y=(t=d==null?void 0:d.Head)!==null&&t!==void 0?t:dee,x=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:Yee,_=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:lee;return me.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&me.jsx(y,{}),me.jsx("tbody",{className:s.tbody,style:a.tbody,children:b.map(function(w){return me.jsx(x,{displayMonth:e.displayMonth,dates:w.dates,weekNumber:w.weekNumber},w.weekNumber)})}),me.jsx(_,{displayMonth:e.displayMonth})]})}function Qee(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Zee=Qee()?m.useLayoutEffect:m.useEffect,db=!1,Jee=0;function yR(){return"react-day-picker-".concat(++Jee)}function ete(e){var t,n=e??(db?yR():null),r=m.useState(n),o=r[0],i=r[1];return Zee(function(){o===null&&i(yR())},[]),m.useEffect(function(){db===!1&&(db=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function tte(e){var t,n,r=At(),o=r.dir,i=r.classNames,s=r.styles,a=r.components,l=Kd().displayMonths,u=ete(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[i.month],p=s.month,g=e.displayIndex===0,b=e.displayIndex===l.length-1,y=!g&&!b;o==="rtl"&&(t=[g,b],b=t[0],g=t[1]),g&&(f.push(i.caption_start),p=je(je({},p),s.caption_start)),b&&(f.push(i.caption_end),p=je(je({},p),s.caption_end)),y&&(f.push(i.caption_between),p=je(je({},p),s.caption_between));var x=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:aee;return me.jsxs("div",{className:f.join(" "),style:p,children:[me.jsx(x,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),me.jsx(Xee,{id:d,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function nte(e){var t=At(),n=t.classNames,r=t.styles;return me.jsx("div",{className:n.months,style:r.months,children:e.children})}function rte(e){var t,n,r=e.initialProps,o=At(),i=cw(),s=Kd(),a=m.useState(!1),l=a[0],u=a[1];m.useEffect(function(){o.initialFocus&&i.focusTarget&&(l||(i.focus(i.focusTarget),u(!0)))},[o.initialFocus,l,i.focus,i.focusTarget,i]);var d=[o.classNames.root,o.className];o.numberOfMonths>1&&d.push(o.classNames.multiple_months),o.showWeekNumber&&d.push(o.classNames.with_weeknumber);var f=je(je({},o.styles.root),o.style),p=Object.keys(r).filter(function(b){return b.startsWith("data-")}).reduce(function(b,y){var x;return je(je({},b),(x={},x[y]=r[y],x))},{}),g=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:nte;return me.jsx("div",je({className:d.join(" "),style:f,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},p,{children:me.jsx(g,{children:s.displayMonths.map(function(b,y){return me.jsx(tte,{displayIndex:y,displayMonth:b},y)})})}))}function ote(e){var t=e.children,n=RJ(e,["children"]);return me.jsx(GJ,{initialProps:n,children:me.jsx(ree,{children:me.jsx(Fee,{initialProps:n,children:me.jsx(hee,{initialProps:n,children:me.jsx(mee,{initialProps:n,children:me.jsx(Cee,{children:me.jsx(Nee,{children:t})})})})})})})}function ite(e){return me.jsx(ote,je({},e,{children:me.jsx(rte,{initialProps:e})}))}function lD({className:e,classNames:t,showOutsideDays:n=!0,...r}){return k.jsx(ite,{showOutsideDays:n,className:Se("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:Se(Q0({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:Se(Q0({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})=>k.jsx(sK,{...o,className:"h-4 w-4"}),IconRight:({...o})=>k.jsx(tM,{...o,className:"h-4 w-4"})},...r})}lD.displayName="Calendar";let fb=0;function Mg(){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:xR()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:xR()),fb++,()=>{fb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),fb--}},[])}function xR(){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 hb="focusScope.autoFocusOnMount",pb="focusScope.autoFocusOnUnmount",wR={bubbles:!1,cancelable:!0},Dg=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=m.useState(null),u=cn(o),d=cn(i),f=m.useRef(null),p=Xe(t,y=>l(y)),g=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let y=function(C){if(g.paused||!a)return;const R=C.target;a.contains(R)?f.current=R:ji(f.current,{select:!0})},x=function(C){if(g.paused||!a)return;const R=C.relatedTarget;R!==null&&(a.contains(R)||ji(f.current,{select:!0}))},_=function(C){if(document.activeElement===document.body)for(const E of C)E.removedNodes.length>0&&ji(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const w=new MutationObserver(_);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),w.disconnect()}}},[r,a,g.paused]),m.useEffect(()=>{if(a){SR.add(g);const y=document.activeElement;if(!a.contains(y)){const _=new CustomEvent(hb,wR);a.addEventListener(hb,u),a.dispatchEvent(_),_.defaultPrevented||(ste(dte(cD(a)),{select:!0}),document.activeElement===y&&ji(a))}return()=>{a.removeEventListener(hb,u),setTimeout(()=>{const _=new CustomEvent(pb,wR);a.addEventListener(pb,d),a.dispatchEvent(_),_.defaultPrevented||ji(y??document.body,{select:!0}),a.removeEventListener(pb,d),SR.remove(g)},0)}}},[a,u,d,g]);const b=m.useCallback(y=>{if(!n&&!r||g.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,_=document.activeElement;if(x&&_){const w=y.currentTarget,[C,R]=ate(w);C&&R?!y.shiftKey&&_===R?(y.preventDefault(),n&&ji(C,{select:!0})):y.shiftKey&&_===C&&(y.preventDefault(),n&&ji(R,{select:!0})):_===w&&y.preventDefault()}},[n,r,g.paused]);return m.createElement(ke.div,ne({tabIndex:-1},s,{ref:p,onKeyDown:b}))});function ste(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ji(r,{select:t}),document.activeElement!==n)return}function ate(e){const t=cD(e),n=_R(t,e),r=_R(t.reverse(),e);return[n,r]}function cD(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 _R(e,t){for(const n of e)if(!lte(n,{upTo:t}))return n}function lte(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 cte(e){return e instanceof HTMLInputElement&&"select"in e}function ji(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&cte(e)&&t&&e.select()}}const SR=ute();function ute(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=CR(e,t),e.unshift(t)},remove(t){var n;e=CR(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function CR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function dte(e){return e.filter(t=>t.tagName!=="A")}var fte=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},pl=new WeakMap,Ch=new WeakMap,Eh={},gb=0,uD=function(e){return e&&(e.host||uD(e.parentNode))},hte=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=uD(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})},pte=function(e,t,n,r){var o=hte(t,Array.isArray(e)?e:[e]);Eh[n]||(Eh[n]=new WeakMap);var i=Eh[n],s=[],a=new Set,l=new Set(o),u=function(f){!f||a.has(f)||(a.add(f),u(f.parentNode))};o.forEach(u);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(a.has(p))d(p);else{var g=p.getAttribute(r),b=g!==null&&g!=="false",y=(pl.get(p)||0)+1,x=(i.get(p)||0)+1;pl.set(p,y),i.set(p,x),s.push(p),y===1&&b&&Ch.set(p,!0),x===1&&p.setAttribute(n,"true"),b||p.setAttribute(r,"true")}})};return d(t),a.clear(),gb++,function(){s.forEach(function(f){var p=pl.get(f)-1,g=i.get(f)-1;pl.set(f,p),i.set(f,g),p||(Ch.has(f)||f.removeAttribute(r),Ch.delete(f)),g||f.removeAttribute(n)}),gb--,gb||(pl=new WeakMap,pl=new WeakMap,Ch=new WeakMap,Eh={})}},Tg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||fte(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),pte(r,o,n,"aria-hidden")):function(){return null}},Co=function(){return Co=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},Co.apply(this,arguments)};function dD(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 gte(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 Gh="right-scroll-bar-position",Yh="width-before-scroll-bar",mte="with-scroll-bars-hidden",vte="--removed-body-scroll-bar-size";function bte(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function yte(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 xte(e,t){return yte(t||null,function(n){return e.forEach(function(r){return bte(r,n)})})}function wte(e){return e}function _te(e,t){t===void 0&&(t=wte);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 d=s;s=[],d.forEach(i)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(d){s.push(d),u()},filter:function(d){return s=s.filter(d),n}}}};return o}function Ste(e){e===void 0&&(e={});var t=_te(null);return t.options=Co({async:!0,ssr:!1},e),t}var fD=function(e){var t=e.sideCar,n=dD(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 ie.createElement(r,Co({},n))};fD.isSideCarExport=!0;function Cte(e,t){return e.useMedium(t),fD}var hD=Ste(),mb=function(){},Ag=ie.forwardRef(function(e,t){var n=ie.useRef(null),r=ie.useState({onScrollCapture:mb,onWheelCapture:mb,onTouchMoveCapture:mb}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,g=e.noIsolation,b=e.inert,y=e.allowPinchZoom,x=e.as,_=x===void 0?"div":x,w=dD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),C=p,R=xte([n,t]),E=Co(Co({},w),o);return ie.createElement(ie.Fragment,null,d&&ie.createElement(C,{sideCar:hD,removeScrollBar:u,shards:f,noIsolation:g,inert:b,setCallbacks:i,allowPinchZoom:!!y,lockRef:n}),s?ie.cloneElement(ie.Children.only(a),Co(Co({},E),{ref:R})):ie.createElement(_,Co({},E,{className:l,ref:R}),a))});Ag.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ag.classNames={fullWidth:Yh,zeroRight:Gh};var ER,Ete=function(){if(ER)return ER;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Rte(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ete();return t&&e.setAttribute("nonce",t),e}function $te(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Pte(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ote=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Rte())&&($te(t,n),Pte(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Mte=function(){var e=Ote();return function(t,n){ie.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pD=function(){var e=Mte(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Dte={left:0,top:0,right:0,gap:0},vb=function(e){return parseInt(e||"",10)||0},Tte=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[vb(n),vb(r),vb(o)]},Ate=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Dte;var t=Tte(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])}},Ite=pD(),kte=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
311
- .`.concat(mte,` {
312
- overflow: hidden `).concat(r,`;
313
- padding-right: `).concat(a,"px ").concat(r,`;
314
- }
315
- body {
316
- overflow: hidden `).concat(r,`;
317
- overscroll-behavior: contain;
318
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
319
- padding-left: `.concat(o,`px;
320
- padding-top: `).concat(i,`px;
321
- padding-right: `).concat(s,`px;
322
- margin-left:0;
323
- margin-top:0;
324
- margin-right: `).concat(a,"px ").concat(r,`;
325
- `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
326
- }
327
-
328
- .`).concat(Gh,` {
329
- right: `).concat(a,"px ").concat(r,`;
330
- }
331
-
332
- .`).concat(Yh,` {
333
- margin-right: `).concat(a,"px ").concat(r,`;
334
- }
335
-
336
- .`).concat(Gh," .").concat(Gh,` {
337
- right: 0 `).concat(r,`;
338
- }
339
-
340
- .`).concat(Yh," .").concat(Yh,` {
341
- margin-right: 0 `).concat(r,`;
342
- }
343
-
344
- body {
345
- `).concat(vte,": ").concat(a,`px;
346
- }
347
- `)},Nte=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=ie.useMemo(function(){return Ate(o)},[o]);return ie.createElement(Ite,{styles:kte(i,!t,o,n?"":"!important")})},ty=!1;if(typeof window<"u")try{var Rh=Object.defineProperty({},"passive",{get:function(){return ty=!0,!0}});window.addEventListener("test",Rh,Rh),window.removeEventListener("test",Rh,Rh)}catch{ty=!1}var gl=ty?{passive:!1}:!1,Lte=function(e){return e.tagName==="TEXTAREA"},gD=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Lte(e)&&n[t]==="visible")},Fte=function(e){return gD(e,"overflowY")},zte=function(e){return gD(e,"overflowX")},RR=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=mD(e,n);if(r){var o=vD(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},jte=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Vte=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},mD=function(e,t){return e==="v"?Fte(t):zte(t)},vD=function(e,t){return e==="v"?jte(t):Vte(t)},Bte=function(e,t){return e==="h"&&t==="rtl"?-1:1},Hte=function(e,t,n,r,o){var i=Bte(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),u=!1,d=s>0,f=0,p=0;do{var g=vD(e,a),b=g[0],y=g[1],x=g[2],_=y-x-i*b;(b||_)&&mD(e,a)&&(f+=_,p+=b),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(o&&f===0||!o&&s>f)||!d&&(o&&p===0||!o&&-s>p))&&(u=!0),u},$h=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$R=function(e){return[e.deltaX,e.deltaY]},PR=function(e){return e&&"current"in e?e.current:e},Wte=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ute=function(e){return`
348
- .block-interactivity-`.concat(e,` {pointer-events: none;}
349
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
350
- `)},qte=0,ml=[];function Gte(e){var t=ie.useRef([]),n=ie.useRef([0,0]),r=ie.useRef(),o=ie.useState(qte++)[0],i=ie.useState(function(){return pD()})[0],s=ie.useRef(e);ie.useEffect(function(){s.current=e},[e]),ie.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=gte([e.lockRef.current],(e.shards||[]).map(PR),!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=ie.useCallback(function(y,x){if("touches"in y&&y.touches.length===2)return!s.current.allowPinchZoom;var _=$h(y),w=n.current,C="deltaX"in y?y.deltaX:w[0]-_[0],R="deltaY"in y?y.deltaY:w[1]-_[1],E,T=y.target,O=Math.abs(C)>Math.abs(R)?"h":"v";if("touches"in y&&O==="h"&&T.type==="range")return!1;var D=RR(O,T);if(!D)return!0;if(D?E=O:(E=O==="v"?"h":"v",D=RR(O,T)),!D)return!1;if(!r.current&&"changedTouches"in y&&(C||R)&&(r.current=E),!E)return!0;var I=r.current||E;return Hte(I,x,y,I==="h"?C:R,!0)},[]),l=ie.useCallback(function(y){var x=y;if(!(!ml.length||ml[ml.length-1]!==i)){var _="deltaY"in x?$R(x):$h(x),w=t.current.filter(function(E){return E.name===x.type&&E.target===x.target&&Wte(E.delta,_)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var C=(s.current.shards||[]).map(PR).filter(Boolean).filter(function(E){return E.contains(x.target)}),R=C.length>0?a(x,C[0]):!s.current.noIsolation;R&&x.cancelable&&x.preventDefault()}}},[]),u=ie.useCallback(function(y,x,_,w){var C={name:y,delta:x,target:_,should:w};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(R){return R!==C})},1)},[]),d=ie.useCallback(function(y){n.current=$h(y),r.current=void 0},[]),f=ie.useCallback(function(y){u(y.type,$R(y),y.target,a(y,e.lockRef.current))},[]),p=ie.useCallback(function(y){u(y.type,$h(y),y.target,a(y,e.lockRef.current))},[]);ie.useEffect(function(){return ml.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,gl),document.addEventListener("touchmove",l,gl),document.addEventListener("touchstart",d,gl),function(){ml=ml.filter(function(y){return y!==i}),document.removeEventListener("wheel",l,gl),document.removeEventListener("touchmove",l,gl),document.removeEventListener("touchstart",d,gl)}},[]);var g=e.removeScrollBar,b=e.inert;return ie.createElement(ie.Fragment,null,b?ie.createElement(i,{styles:Ute(o)}):null,g?ie.createElement(Nte,{gapMode:"margin"}):null)}const Yte=Cte(hD,Gte);var bD=ie.forwardRef(function(e,t){return ie.createElement(Ag,Co({},e,{ref:t,sideCar:Yte}))});bD.classNames=Ag.classNames;const Ig=bD,yD="Popover",[xD,wle]=mn(yD,[Lo]),dw=Lo(),[Kte,_c]=xD(yD),Xte=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=dw(t),l=m.useRef(null),[u,d]=m.useState(!1),[f=!1,p]=Nn({prop:r,defaultProp:o,onChange:i});return m.createElement(Fd,a,m.createElement(Kte,{scope:t,contentId:nr(),triggerRef:l,open:f,onOpenChange:p,onOpenToggle:m.useCallback(()=>p(g=>!g),[p]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:s},n))},Qte="PopoverTrigger",Zte=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=_c(Qte,n),i=dw(n),s=Xe(t,o.triggerRef),a=m.createElement(ke.button,ne({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":SD(o.open)},r,{ref:s,onClick:we(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:m.createElement(zd,ne({asChild:!0},i),a)}),wD="PopoverPortal",[Jte,ene]=xD(wD,{forceMount:void 0}),tne=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=_c(wD,t);return m.createElement(Jte,{scope:t,forceMount:n},m.createElement(nn,{present:n||i.open},m.createElement(wg,{asChild:!0,container:o},r)))},od="PopoverContent",nne=m.forwardRef((e,t)=>{const n=ene(od,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=_c(od,e.__scopePopover);return m.createElement(nn,{present:r||i.open},i.modal?m.createElement(rne,ne({},o,{ref:t})):m.createElement(one,ne({},o,{ref:t})))}),rne=m.forwardRef((e,t)=>{const n=_c(od,e.__scopePopover),r=m.useRef(null),o=Xe(t,r),i=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return Tg(s)},[]),m.createElement(Ig,{as:pi,allowPinchZoom:!0},m.createElement(_D,ne({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,u=a.button===2||l;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:we(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})))}),one=m.forwardRef((e,t)=>{const n=_c(od,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(_D,ne({},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()}}))}),_D=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...f}=e,p=_c(od,n),g=dw(n);return Mg(),m.createElement(Dg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(yc,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1)},m.createElement(jd,ne({"data-state":SD(p.open),role:"dialog",id:p.contentId},g,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 SD(e){return e?"open":"closed"}const ine=Xte,sne=Zte,ane=tne,CD=nne,fw=ine,hw=sne,kg=ie.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>k.jsx(ane,{children:k.jsx(CD,{ref:o,align:t,sideOffset:n,className:Se("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})}));kg.displayName=CD.displayName;function lne({filter:e,className:t}){const[n,r]=m.useState(!1),[o,i]=m.useState(),[s,a]=m.useState(),l=Ee(C=>C.filterValues),{authToken:u}=Da(),d=Ee(C=>C.actions.addOrUpdateFilterValue),f=Ee(C=>C.actions.removeFilterValue),{data:p,isLoading:g,isFetching:b,isError:y,refetch:x}=So({queryKey:[e.sql],queryFn:()=>jp("https://semaphor.cloud/api/v1/query",(u==null?void 0:u.accessToken)||"",{connection_id:e.connectionId,sql:e.sql}),enabled:!!e.sql&&!!e.connectionId&&!!e.database});m.useEffect(()=>{var C;if(((C=p==null?void 0:p.records)==null?void 0:C.length)>0){const R=p.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)})}},[p]),m.useEffect(()=>{if(l&&!l.find(R=>R.filterId===e.id)){i(s);return}},[l,e.id,s]);function _(){f(e.id),i(s),r(!1)}function w(){if(!o)return;console.log(o);const C=[o==null?void 0:o.from,o==null?void 0:o.to];console.log(C);const R={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Tp(e),name:e.column,operation:"between",values:C};d(R),r(!1)}return g?k.jsx("div",{children:k.jsx(_y,{className:"h-8 w-[250px] bg-foreground/10"})}):y?k.jsx("div",{className:"h-8 w-[250px] bg-muted px-2",children:"Error"}):p?k.jsx("div",{className:Se("grid gap-2",t),children:k.jsxs(fw,{open:n,onOpenChange:r,children:[k.jsx(hw,{asChild:!0,children:k.jsxs(ba,{size:"sm",id:"date",variant:"outline",className:Se("h-[34px] w-[250px] justify-start rounded-sm text-left font-normal",!o&&"text-muted-foreground"),children:[k.jsx(eM,{className:"mr-2 h-4 w-4"}),o!=null&&o.from?o.to?k.jsxs(k.Fragment,{children:[Po(o.from,"LLL dd, y")," -"," ",Po(o.to,"LLL dd, y")]}):Po(o.from,"LLL dd, y"):k.jsx("span",{children:"Pick a date"})]})}),k.jsxs(kg,{className:"w-auto p-0",align:"start",children:[k.jsx(lD,{initialFocus:!0,mode:"range",defaultMonth:o==null?void 0:o.from,selected:o,onSelect:i,numberOfMonths:2}),k.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[k.jsx(ba,{size:"sm",variant:"outline",onClick:w,children:"Apply"}),k.jsx(ba,{size:"sm",variant:"outline",onClick:_,children:"Clear"})]})]})]})}):null}const pw=ie.forwardRef(({className:e,...t},n)=>k.jsx("textarea",{className:Se("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}));pw.displayName="Textarea";const ny="horizontal",cne=["horizontal","vertical"],ED=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=ny,...o}=e,i=RD(r)?r:ny,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return m.createElement(ke.div,ne({"data-orientation":i},a,o,{ref:t}))});ED.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!RD(r)?new Error(une(o,n)):null}};function une(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
351
- - horizontal
352
- - vertical
353
-
354
- Defaulting to \`${ny}\`.`}function RD(e){return cne.includes(e)}const $D=ED,gw=ie.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>k.jsx($D,{ref:o,decorative:n,orientation:t,className:Se("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));gw.displayName=$D.displayName;function ry(e,[t,n]){return Math.min(n,Math.max(t,e))}function Ng(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 dne=[" ","Enter","ArrowUp","ArrowDown"],fne=[" ","Enter"],Lg="Select",[Fg,zg,hne]=Qp(Lg),[Sc,_le]=mn(Lg,[hne,Lo]),mw=Lo(),[pne,za]=Sc(Lg),[gne,mne]=Sc(Lg),vne=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:g}=e,b=mw(t),[y,x]=m.useState(null),[_,w]=m.useState(null),[C,R]=m.useState(!1),E=Aa(u),[T=!1,O]=Nn({prop:r,defaultProp:o,onChange:i}),[D,I]=Nn({prop:s,defaultProp:a,onChange:l}),N=m.useRef(null),V=y?!!y.closest("form"):!0,[G,le]=m.useState(new Set),ee=Array.from(G).map(F=>F.props.value).join(";");return m.createElement(Fd,b,m.createElement(pne,{required:g,scope:t,trigger:y,onTriggerChange:x,valueNode:_,onValueNodeChange:w,valueNodeHasChildren:C,onValueNodeHasChildrenChange:R,contentId:nr(),value:D,onValueChange:I,open:T,onOpenChange:O,dir:E,triggerPointerDownPosRef:N,disabled:p},m.createElement(Fg.Provider,{scope:t},m.createElement(gne,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(F=>{le(Z=>new Set(Z).add(F))},[]),onNativeOptionRemove:m.useCallback(F=>{le(Z=>{const Y=new Set(Z);return Y.delete(F),Y})},[])},n)),V?m.createElement(TD,{key:ee,"aria-hidden":!0,required:g,tabIndex:-1,name:d,autoComplete:f,value:D,onChange:F=>I(F.target.value),disabled:p},D===void 0?m.createElement("option",{value:""}):null,Array.from(G)):null))},bne="SelectTrigger",yne=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=mw(n),s=za(bne,n),a=s.disabled||r,l=Xe(t,s.onTriggerChange),u=zg(n),[d,f,p]=AD(b=>{const y=u().filter(w=>!w.disabled),x=y.find(w=>w.value===s.value),_=ID(y,b,x);_!==void 0&&s.onValueChange(_.value)}),g=()=>{a||(s.onOpenChange(!0),p())};return m.createElement(zd,ne({asChild:!0},i),m.createElement(ke.button,ne({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":DD(s.value)?"":void 0},o,{ref:l,onClick:we(o.onClick,b=>{b.currentTarget.focus()}),onPointerDown:we(o.onPointerDown,b=>{const y=b.target;y.hasPointerCapture(b.pointerId)&&y.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&(g(),s.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)},b.preventDefault())}),onKeyDown:we(o.onKeyDown,b=>{const y=d.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&f(b.key),!(y&&b.key===" ")&&dne.includes(b.key)&&(g(),b.preventDefault())})})))}),xne="SelectValue",wne=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=za(xne,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,f=Xe(t,l.onValueNodeChange);return kn(()=>{u(d)},[u,d]),m.createElement(ke.span,ne({},a,{ref:f,style:{pointerEvents:"none"}}),DD(l.value)?m.createElement(m.Fragment,null,s):i)}),_ne=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.createElement(ke.span,ne({"aria-hidden":!0},o,{ref:t}),r||"▼")}),Sne=e=>m.createElement(wg,ne({asChild:!0},e)),hc="SelectContent",Cne=m.forwardRef((e,t)=>{const n=za(hc,e.__scopeSelect),[r,o]=m.useState();if(kn(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Ao.createPortal(m.createElement(PD,{scope:e.__scopeSelect},m.createElement(Fg.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),i):null}return m.createElement(Ene,ne({},e,{ref:t}))}),oi=10,[PD,ja]=Sc(hc),Ene=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:x,..._}=e,w=za(hc,n),[C,R]=m.useState(null),[E,T]=m.useState(null),O=Xe(t,de=>R(de)),[D,I]=m.useState(null),[N,V]=m.useState(null),G=zg(n),[le,ee]=m.useState(!1),F=m.useRef(!1);m.useEffect(()=>{if(C)return Tg(C)},[C]),Mg();const Z=m.useCallback(de=>{const[J,...X]=G().map(H=>H.ref.current),[re]=X.slice(-1),be=document.activeElement;for(const H of de)if(H===be||(H==null||H.scrollIntoView({block:"nearest"}),H===J&&E&&(E.scrollTop=0),H===re&&E&&(E.scrollTop=E.scrollHeight),H==null||H.focus(),document.activeElement!==be))return},[G,E]),Y=m.useCallback(()=>Z([D,C]),[Z,D,C]);m.useEffect(()=>{le&&Y()},[le,Y]);const{onOpenChange:Q,triggerPointerDownPosRef:ae}=w;m.useEffect(()=>{if(C){let de={x:0,y:0};const J=re=>{var be,H,De,Ne;de={x:Math.abs(Math.round(re.pageX)-((be=(H=ae.current)===null||H===void 0?void 0:H.x)!==null&&be!==void 0?be:0)),y:Math.abs(Math.round(re.pageY)-((De=(Ne=ae.current)===null||Ne===void 0?void 0:Ne.y)!==null&&De!==void 0?De:0))}},X=re=>{de.x<=10&&de.y<=10?re.preventDefault():C.contains(re.target)||Q(!1),document.removeEventListener("pointermove",J),ae.current=null};return ae.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",X,{capture:!0})}}},[C,Q,ae]),m.useEffect(()=>{const de=()=>Q(!1);return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[Q]);const[j,B]=AD(de=>{const J=G().filter(be=>!be.disabled),X=J.find(be=>be.ref.current===document.activeElement),re=ID(J,de,X);re&&setTimeout(()=>re.ref.current.focus())}),te=m.useCallback((de,J,X)=>{const re=!F.current&&!X;(w.value!==void 0&&w.value===J||re)&&(I(de),re&&(F.current=!0))},[w.value]),ce=m.useCallback(()=>C==null?void 0:C.focus(),[C]),ue=m.useCallback((de,J,X)=>{const re=!F.current&&!X;(w.value!==void 0&&w.value===J||re)&&V(de)},[w.value]),ge=r==="popper"?OR:Rne,ve=ge===OR?{side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:x}:{};return m.createElement(PD,{scope:n,content:C,viewport:E,onViewportChange:T,itemRefCallback:te,selectedItem:D,onItemLeave:ce,itemTextRefCallback:ue,focusSelectedItem:Y,selectedItemText:N,position:r,isPositioned:le,searchRef:j},m.createElement(Ig,{as:pi,allowPinchZoom:!0},m.createElement(Dg,{asChild:!0,trapped:w.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:we(o,de=>{var J;(J=w.trigger)===null||J===void 0||J.focus({preventScroll:!0}),de.preventDefault()})},m.createElement(yc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>w.onOpenChange(!1)},m.createElement(ge,ne({role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:de=>de.preventDefault()},_,ve,{onPlaced:()=>ee(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:we(_.onKeyDown,de=>{const J=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!J&&de.key.length===1&&B(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let re=G().filter(be=>!be.disabled).map(be=>be.ref.current);if(["ArrowUp","End"].includes(de.key)&&(re=re.slice().reverse()),["ArrowUp","ArrowDown"].includes(de.key)){const be=de.target,H=re.indexOf(be);re=re.slice(H+1)}setTimeout(()=>Z(re)),de.preventDefault()}})}))))))}),Rne=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=za(hc,n),s=ja(hc,n),[a,l]=m.useState(null),[u,d]=m.useState(null),f=Xe(t,O=>d(O)),p=zg(n),g=m.useRef(!1),b=m.useRef(!0),{viewport:y,selectedItem:x,selectedItemText:_,focusSelectedItem:w}=s,C=m.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&y&&x&&_){const O=i.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),I=i.valueNode.getBoundingClientRect(),N=_.getBoundingClientRect();if(i.dir!=="rtl"){const be=N.left-D.left,H=I.left-be,De=O.left-H,Ne=O.width+De,Ve=Math.max(Ne,D.width),qe=window.innerWidth-oi,gt=ry(H,[oi,qe-Ve]);a.style.minWidth=Ne+"px",a.style.left=gt+"px"}else{const be=D.right-N.right,H=window.innerWidth-I.right-be,De=window.innerWidth-O.right-H,Ne=O.width+De,Ve=Math.max(Ne,D.width),qe=window.innerWidth-oi,gt=ry(H,[oi,qe-Ve]);a.style.minWidth=Ne+"px",a.style.right=gt+"px"}const V=p(),G=window.innerHeight-oi*2,le=y.scrollHeight,ee=window.getComputedStyle(u),F=parseInt(ee.borderTopWidth,10),Z=parseInt(ee.paddingTop,10),Y=parseInt(ee.borderBottomWidth,10),Q=parseInt(ee.paddingBottom,10),ae=F+Z+le+Q+Y,j=Math.min(x.offsetHeight*5,ae),B=window.getComputedStyle(y),te=parseInt(B.paddingTop,10),ce=parseInt(B.paddingBottom,10),ue=O.top+O.height/2-oi,ge=G-ue,ve=x.offsetHeight/2,de=x.offsetTop+ve,J=F+Z+de,X=ae-J;if(J<=ue){const be=x===V[V.length-1].ref.current;a.style.bottom="0px";const H=u.clientHeight-y.offsetTop-y.offsetHeight,De=Math.max(ge,ve+(be?ce:0)+H+Y),Ne=J+De;a.style.height=Ne+"px"}else{const be=x===V[0].ref.current;a.style.top="0px";const De=Math.max(ue,F+y.offsetTop+(be?te:0)+ve)+X;a.style.height=De+"px",y.scrollTop=J-ue+y.offsetTop}a.style.margin=`${oi}px 0`,a.style.minHeight=j+"px",a.style.maxHeight=G+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[p,i.trigger,i.valueNode,a,u,y,x,_,i.dir,r]);kn(()=>C(),[C]);const[R,E]=m.useState();kn(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const T=m.useCallback(O=>{O&&b.current===!0&&(C(),w==null||w(),b.current=!1)},[C,w]);return m.createElement($ne,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:T},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R}},m.createElement(ke.div,ne({},o,{ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),OR=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=oi,...i}=e,s=mw(n);return m.createElement(jd,ne({},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)"}}))}),[$ne,vw]=Sc(hc,{}),MR="SelectViewport",Pne=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ja(MR,n),i=vw(MR,n),s=Xe(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(Fg.Slot,{scope:n},m.createElement(ke.div,ne({"data-radix-select-viewport":"",role:"presentation"},r,{ref:s,style:{position:"relative",flex:1,overflow:"auto",...r.style},onScroll:we(r.onScroll,l=>{const u=l.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=i;if(f!=null&&f.current&&d){const p=Math.abs(a.current-u.scrollTop);if(p>0){const g=window.innerHeight-oi*2,b=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),x=Math.max(b,y);if(x<g){const _=x+p,w=Math.min(g,_),C=_-w;d.style.height=w+"px",d.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}a.current=u.scrollTop})}))))}),One="SelectGroup",[Mne,Dne]=Sc(One),Tne=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=nr();return m.createElement(Mne,{scope:n,id:o},m.createElement(ke.div,ne({role:"group","aria-labelledby":o},r,{ref:t})))}),Ane="SelectLabel",Ine=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Dne(Ane,n);return m.createElement(ke.div,ne({id:o.id},r,{ref:t}))}),oy="SelectItem",[kne,OD]=Sc(oy),Nne=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=za(oy,n),l=ja(oy,n),u=a.value===r,[d,f]=m.useState(i??""),[p,g]=m.useState(!1),b=Xe(t,_=>{var w;return(w=l.itemRefCallback)===null||w===void 0?void 0:w.call(l,_,r,o)}),y=nr(),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(kne,{scope:n,value:r,disabled:o,textId:y,isSelected:u,onItemTextChange:m.useCallback(_=>{f(w=>{var C;return w||((C=_==null?void 0:_.textContent)!==null&&C!==void 0?C:"").trim()})},[])},m.createElement(Fg.ItemSlot,{scope:n,value:r,disabled:o,textValue:d},m.createElement(ke.div,ne({role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1},s,{ref:b,onFocus:we(s.onFocus,()=>g(!0)),onBlur:we(s.onBlur,()=>g(!1)),onPointerUp:we(s.onPointerUp,x),onPointerMove:we(s.onPointerMove,_=>{if(o){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}else _.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(s.onPointerLeave,_=>{if(_.currentTarget===document.activeElement){var w;(w=l.onItemLeave)===null||w===void 0||w.call(l)}}),onKeyDown:we(s.onKeyDown,_=>{var w;((w=l.searchRef)===null||w===void 0?void 0:w.current)!==""&&_.key===" "||(fne.includes(_.key)&&x(),_.key===" "&&_.preventDefault())})}))))}),Ph="SelectItemText",Lne=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=za(Ph,n),a=ja(Ph,n),l=OD(Ph,n),u=mne(Ph,n),[d,f]=m.useState(null),p=Xe(t,_=>f(_),l.onItemTextChange,_=>{var w;return(w=a.itemTextRefCallback)===null||w===void 0?void 0:w.call(a,_,l.value,l.disabled)}),g=d==null?void 0:d.textContent,b=m.useMemo(()=>m.createElement("option",{key:l.value,value:l.value,disabled:l.disabled},g),[l.disabled,l.value,g]),{onNativeOptionAdd:y,onNativeOptionRemove:x}=u;return kn(()=>(y(b),()=>x(b)),[y,x,b]),m.createElement(m.Fragment,null,m.createElement(ke.span,ne({id:l.textId},i,{ref:p})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ao.createPortal(i.children,s.valueNode):null)}),Fne="SelectItemIndicator",zne=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return OD(Fne,n).isSelected?m.createElement(ke.span,ne({"aria-hidden":!0},r,{ref:t})):null}),DR="SelectScrollUpButton",jne=m.forwardRef((e,t)=>{const n=ja(DR,e.__scopeSelect),r=vw(DR,e.__scopeSelect),[o,i]=m.useState(!1),s=Xe(t,r.onScrollButtonChange);return kn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=a.scrollTop>0;i(u)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(MD,ne({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),TR="SelectScrollDownButton",Vne=m.forwardRef((e,t)=>{const n=ja(TR,e.__scopeSelect),r=vw(TR,e.__scopeSelect),[o,i]=m.useState(!1),s=Xe(t,r.onScrollButtonChange);return kn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,d=Math.ceil(a.scrollTop)<u;i(d)};const a=n.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),o?m.createElement(MD,ne({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),MD=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=ja("SelectScrollButton",n),s=m.useRef(null),a=zg(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),kn(()=>{var u;const d=a().find(f=>f.ref.current===document.activeElement);d==null||(u=d.ref.current)===null||u===void 0||u.scrollIntoView({block:"nearest"})},[a]),m.createElement(ke.div,ne({"aria-hidden":!0},o,{ref:t,style:{flexShrink:0,...o.style},onPointerDown:we(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:we(o.onPointerMove,()=>{var u;(u=i.onItemLeave)===null||u===void 0||u.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:we(o.onPointerLeave,()=>{l()})}))}),Bne=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(ke.div,ne({"aria-hidden":!0},r,{ref:t}))});function DD(e){return e===""||e===void 0}const TD=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=m.useRef(null),i=Xe(t,o),s=Ng(n);return m.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&d){const f=new Event("change",{bubbles:!0});d.call(a,n),a.dispatchEvent(f)}},[s,n]),m.createElement(G2,{asChild:!0},m.createElement("select",ne({},r,{ref:i,defaultValue:n})))});TD.displayName="BubbleSelect";function AD(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(u){n.current=u,window.clearTimeout(r.current),u!==""&&(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 ID(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Hne(e,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Hne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Wne=vne,kD=yne,Une=wne,qne=_ne,Gne=Sne,ND=Cne,Yne=Pne,Kne=Tne,LD=Ine,FD=Nne,Xne=Lne,Qne=zne,zD=jne,jD=Vne,VD=Bne,BD=Wne,Zne=Kne,HD=Une,bw=ie.forwardRef(({className:e,children:t,...n},r)=>k.jsxs(kD,{ref:r,className:Se("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,k.jsx(qne,{asChild:!0,children:k.jsx(Cg,{className:"h-4 w-4 opacity-50"})})]}));bw.displayName=kD.displayName;const WD=ie.forwardRef(({className:e,...t},n)=>k.jsx(zD,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:k.jsx(aK,{className:"h-4 w-4"})}));WD.displayName=zD.displayName;const UD=ie.forwardRef(({className:e,...t},n)=>k.jsx(jD,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:k.jsx(Cg,{className:"h-4 w-4"})}));UD.displayName=jD.displayName;const yw=ie.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>k.jsx(Gne,{children:k.jsxs(ND,{ref:o,className:Se("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:[k.jsx(WD,{}),k.jsx(Yne,{className:Se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),k.jsx(UD,{})]})}));yw.displayName=ND.displayName;const qD=ie.forwardRef(({className:e,...t},n)=>k.jsx(LD,{ref:n,className:Se("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));qD.displayName=LD.displayName;const Au=ie.forwardRef(({className:e,children:t,...n},r)=>k.jsxs(FD,{ref:r,className:Se("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:[k.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:k.jsx(Qne,{children:k.jsx(Vd,{className:"h-4 w-4"})})}),k.jsx(Xne,{children:t})]}));Au.displayName=FD.displayName;const GD=ie.forwardRef(({className:e,...t},n)=>k.jsx(VD,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));GD.displayName=VD.displayName;function Jne({filter:e}){const[t,n]=m.useState(e.sql),[r,o]=m.useState(!1),{updateFilter:i}=Ta();function s(){const l={...e,sql:t};i(l),o(!1)}function a(l){console.log("operation",l);const u={...e,operation:l};i(u)}return k.jsxs(fw,{open:r,onOpenChange:o,children:[k.jsx(hw,{children:k.jsx(rM,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),k.jsxs(kg,{onDoubleClick:l=>l.stopPropagation(),className:"m-2 w-full min-w-[350px] space-y-4",children:[k.jsxs("div",{className:"space-y-2",children:[k.jsx("h4",{className:"font-medium leading-none",children:"Customize Filter"}),k.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize the filter operation and SQL"})]}),k.jsx(gw,{}),k.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[k.jsxs("div",{className:"col-span-2 space-y-1",children:[k.jsx(si,{children:"Table Column"}),k.jsx(si,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),k.jsxs("div",{className:"col-span-2 space-y-1",children:[k.jsx(si,{children:"Data Type"}),k.jsx(si,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),k.jsxs("div",{className:"col-span-2 space-y-1",children:[k.jsx(si,{className:"text-sm",children:"Filter Operation"}),k.jsx(ere,{updateFilterOperation:a,value:e.operation})]})]}),k.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[k.jsx(si,{className:"text-sm",children:"Values SQL"}),k.jsx(pw,{value:t,onChange:l=>n(l.target.value),className:`min-w-full grow resize font-mono text-xs ${i9}`})]}),k.jsx("div",{className:"flex justify-end gap-2",children:k.jsxs(ba,{onClick:s,size:"sm",variant:"outline",children:[k.jsx(Vd,{className:"mr-2 size-4"}),"Apply"]})})]})]})}function ere({value:e,updateFilterOperation:t}){return k.jsxs(BD,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[k.jsx(bw,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:k.jsx(HD,{placeholder:"Operation"})}),k.jsxs(yw,{children:[k.jsx(Au,{value:"=",children:"Equals"}),k.jsx(Au,{value:"in",children:"Contains"}),k.jsx(Au,{value:"like",children:"Like"})]})]})}function tre(){const e=Ee(s=>s.dashboard.filters),t=Ee(s=>s.isDashboardEditing),n=Ee(s=>s.actions.removeFilter),r=Ee(s=>s.actions.updateFilter),o=Ee(s=>s.actions.removeFilterValue);if(!e)return null;const i=s=>Ud.includes(s.dataType)?k.jsx(lne,{filter:s}):k.jsx(gZ,{filter:s});return k.jsx("section",{role:"dashboard-filters",className:"flex w-full grow flex-wrap items-center gap-2 px-[10px] pt-2",children:e.map(s=>k.jsxs("div",{className:"flex flex-col",children:[k.jsx(Ca,{className:"my-1",text:s.title||s.column,onSave:a=>r({...s,title:a}),children:k.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[k.jsxs("div",{className:"flex grow items-center gap-2",children:[k.jsx(si,{className:"inline-block text-sm",children:s.title}),t&&k.jsx(Jne,{filter:s})]}),k.jsxs("div",{className:"flex items-center gap-2",children:[k.jsx("div",{onClick:()=>o(s.id),className:"invisible cursor-pointer text-xs text-muted-foreground hover:text-foreground hover:underline group-hover:visible",children:"Clear"}),t&&k.jsx(cK,{onClick:()=>{o(s.id),n(s.id)},className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})]})]})}),i(s)]},s.id))})}function YD(){const e=Ee(o=>{var i;return(i=o.dashboard)==null?void 0:i.sheets});Ee(o=>o.isDashboardEditing);const t=Ee(o=>o.themeStyle);Ee(o=>o.isVisualEditing);const n=Ee(o=>o.selectedSheetId),r=Ee(o=>o.actions.setSelectedSheetId);return e?k.jsxs(TP,{role:"dashboard-tabs-container",className:Se("grow",t==null?void 0:t.dashboardTabsContainer),onValueChange:o=>{r(o)},value:n||e[0].id,children:[k.jsx(tre,{}),e==null?void 0:e.map(o=>k.jsx($y,{className:"mt-0",value:o.id,children:k.jsx(TX,{})},o.id))]}):null}function KD({children:e}){return k.jsx(b8,{defaultTheme:"system",storageKey:"vite-ui-theme",children:k.jsx(nK,{delayDuration:0,children:e})})}function XD(e){return k.jsx(mP,{dashboardProps:e,children:k.jsx(KD,{children:k.jsx(xP,{...e,children:k.jsx(YD,{})})})})}const iy=["Enter"," "],nre=["ArrowDown","PageUp","Home"],QD=["ArrowUp","PageDown","End"],rre=[...nre,...QD],ore={ltr:[...iy,"ArrowRight"],rtl:[...iy,"ArrowLeft"]},ire={ltr:["ArrowLeft"],rtl:["ArrowRight"]},jg="Menu",[id,sre,are]=Qp(jg),[Va,ZD]=mn(jg,[are,Lo,bc]),xw=Lo(),JD=bc(),[lre,Ba]=Va(jg),[cre,Xd]=Va(jg),ure=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=xw(t),[l,u]=m.useState(null),d=m.useRef(!1),f=cn(i),p=Aa(o);return m.useEffect(()=>{const g=()=>{d.current=!0,document.addEventListener("pointerdown",b,{capture:!0,once:!0}),document.addEventListener("pointermove",b,{capture:!0,once:!0})},b=()=>d.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",b,{capture:!0}),document.removeEventListener("pointermove",b,{capture:!0})}},[]),m.createElement(Fd,a,m.createElement(lre,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u},m.createElement(cre,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s},r)))},eT=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=xw(n);return m.createElement(zd,ne({},o,r,{ref:t}))}),tT="MenuPortal",[dre,nT]=Va(tT,{forceMount:void 0}),fre=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Ba(tT,t);return m.createElement(dre,{scope:t,forceMount:n},m.createElement(nn,{present:n||i.open},m.createElement(wg,{asChild:!0,container:o},r)))},io="MenuContent",[hre,ww]=Va(io),pre=m.forwardRef((e,t)=>{const n=nT(io,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Ba(io,e.__scopeMenu),s=Xd(io,e.__scopeMenu);return m.createElement(id.Provider,{scope:e.__scopeMenu},m.createElement(nn,{present:r||i.open},m.createElement(id.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(gre,ne({},o,{ref:t})):m.createElement(mre,ne({},o,{ref:t})))))}),gre=m.forwardRef((e,t)=>{const n=Ba(io,e.__scopeMenu),r=m.useRef(null),o=Xe(t,r);return m.useEffect(()=>{const i=r.current;if(i)return Tg(i)},[]),m.createElement(_w,ne({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:we(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)}))}),mre=m.forwardRef((e,t)=>{const n=Ba(io,e.__scopeMenu);return m.createElement(_w,ne({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),_w=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:g,disableOutsideScroll:b,...y}=e,x=Ba(io,n),_=Xd(io,n),w=xw(n),C=JD(n),R=sre(n),[E,T]=m.useState(null),O=m.useRef(null),D=Xe(t,O,x.onContentChange),I=m.useRef(0),N=m.useRef(""),V=m.useRef(0),G=m.useRef(null),le=m.useRef("right"),ee=m.useRef(0),F=b?Ig:m.Fragment,Z=b?{as:pi,allowPinchZoom:!0}:void 0,Y=ae=>{var j,B;const te=N.current+ae,ce=R().filter(X=>!X.disabled),ue=document.activeElement,ge=(j=ce.find(X=>X.ref.current===ue))===null||j===void 0?void 0:j.textValue,ve=ce.map(X=>X.textValue),de=kre(ve,te,ge),J=(B=ce.find(X=>X.textValue===de))===null||B===void 0?void 0:B.ref.current;(function X(re){N.current=re,window.clearTimeout(I.current),re!==""&&(I.current=window.setTimeout(()=>X(""),1e3))})(te),J&&setTimeout(()=>J.focus())};m.useEffect(()=>()=>window.clearTimeout(I.current),[]),Mg();const Q=m.useCallback(ae=>{var j,B;return le.current===((j=G.current)===null||j===void 0?void 0:j.side)&&Lre(ae,(B=G.current)===null||B===void 0?void 0:B.area)},[]);return m.createElement(hre,{scope:n,searchRef:N,onItemEnter:m.useCallback(ae=>{Q(ae)&&ae.preventDefault()},[Q]),onItemLeave:m.useCallback(ae=>{var j;Q(ae)||((j=O.current)===null||j===void 0||j.focus(),T(null))},[Q]),onTriggerLeave:m.useCallback(ae=>{Q(ae)&&ae.preventDefault()},[Q]),pointerGraceTimerRef:V,onPointerGraceIntentChange:m.useCallback(ae=>{G.current=ae},[])},m.createElement(F,Z,m.createElement(Dg,{asChild:!0,trapped:o,onMountAutoFocus:we(i,ae=>{var j;ae.preventDefault(),(j=O.current)===null||j===void 0||j.focus()}),onUnmountAutoFocus:s},m.createElement(yc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:g},m.createElement(Cy,ne({asChild:!0},C,{dir:_.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:T,onEntryFocus:we(l,ae=>{_.isUsingKeyboardRef.current||ae.preventDefault()})}),m.createElement(jd,ne({role:"menu","aria-orientation":"vertical","data-state":aT(x.open),"data-radix-menu-content":"",dir:_.dir},w,y,{ref:D,style:{outline:"none",...y.style},onKeyDown:we(y.onKeyDown,ae=>{const B=ae.target.closest("[data-radix-menu-content]")===ae.currentTarget,te=ae.ctrlKey||ae.altKey||ae.metaKey,ce=ae.key.length===1;B&&(ae.key==="Tab"&&ae.preventDefault(),!te&&ce&&Y(ae.key));const ue=O.current;if(ae.target!==ue||!rre.includes(ae.key))return;ae.preventDefault();const ve=R().filter(de=>!de.disabled).map(de=>de.ref.current);QD.includes(ae.key)&&ve.reverse(),Are(ve)}),onBlur:we(e.onBlur,ae=>{ae.currentTarget.contains(ae.target)||(window.clearTimeout(I.current),N.current="")}),onPointerMove:we(e.onPointerMove,sd(ae=>{const j=ae.target,B=ee.current!==ae.clientX;if(ae.currentTarget.contains(j)&&B){const te=ae.clientX>ee.current?"right":"left";le.current=te,ee.current=ae.clientX}}))})))))))}),vre=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(ke.div,ne({role:"group"},r,{ref:t}))}),bre=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(ke.div,ne({},r,{ref:t}))}),sy="MenuItem",AR="menu.itemSelect",Sw=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),s=Xd(sy,e.__scopeMenu),a=ww(sy,e.__scopeMenu),l=Xe(t,i),u=m.useRef(!1),d=()=>{const f=i.current;if(!n&&f){const p=new CustomEvent(AR,{bubbles:!0,cancelable:!0});f.addEventListener(AR,g=>r==null?void 0:r(g),{once:!0}),_P(f,p),p.defaultPrevented?u.current=!1:s.onClose()}};return m.createElement(rT,ne({},o,{ref:l,disabled:n,onClick:we(e.onClick,d),onPointerDown:f=>{var p;(p=e.onPointerDown)===null||p===void 0||p.call(e,f),u.current=!0},onPointerUp:we(e.onPointerUp,f=>{var p;u.current||(p=f.currentTarget)===null||p===void 0||p.click()}),onKeyDown:we(e.onKeyDown,f=>{const p=a.searchRef.current!=="";n||p&&f.key===" "||iy.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})}))}),rT=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=ww(sy,n),a=JD(n),l=m.useRef(null),u=Xe(t,l),[d,f]=m.useState(!1),[p,g]=m.useState("");return m.useEffect(()=>{const b=l.current;if(b){var y;g(((y=b.textContent)!==null&&y!==void 0?y:"").trim())}},[i.children]),m.createElement(id.ItemSlot,{scope:n,disabled:r,textValue:o??p},m.createElement(Ey,ne({asChild:!0},a,{focusable:!r}),m.createElement(ke.div,ne({role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0},i,{ref:u,onPointerMove:we(e.onPointerMove,sd(b=>{r?s.onItemLeave(b):(s.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:we(e.onPointerLeave,sd(b=>s.onItemLeave(b))),onFocus:we(e.onFocus,()=>f(!0)),onBlur:we(e.onBlur,()=>f(!1))}))))}),yre=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.createElement(iT,{scope:e.__scopeMenu,checked:n},m.createElement(Sw,ne({role:"menuitemcheckbox","aria-checked":kp(n)?"mixed":n},o,{ref:t,"data-state":Cw(n),onSelect:we(o.onSelect,()=>r==null?void 0:r(kp(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),xre="MenuRadioGroup",[wre,_re]=Va(xre,{value:void 0,onValueChange:()=>{}}),Sre=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=cn(r);return m.createElement(wre,{scope:e.__scopeMenu,value:n,onValueChange:i},m.createElement(vre,ne({},o,{ref:t})))}),Cre="MenuRadioItem",Ere=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=_re(Cre,e.__scopeMenu),i=n===o.value;return m.createElement(iT,{scope:e.__scopeMenu,checked:i},m.createElement(Sw,ne({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":Cw(i),onSelect:we(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),oT="MenuItemIndicator",[iT,Rre]=Va(oT,{checked:!1}),$re=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=Rre(oT,n);return m.createElement(nn,{present:r||kp(i.checked)||i.checked===!0},m.createElement(ke.span,ne({},o,{ref:t,"data-state":Cw(i.checked)})))}),Pre=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(ke.div,ne({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),Ore="MenuSub",[Sle,sT]=Va(Ore),Oh="MenuSubTrigger",Mre=m.forwardRef((e,t)=>{const n=Ba(Oh,e.__scopeMenu),r=Xd(Oh,e.__scopeMenu),o=sT(Oh,e.__scopeMenu),i=ww(Oh,e.__scopeMenu),s=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,u={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),m.createElement(eT,ne({asChild:!0},u),m.createElement(rT,ne({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":aT(n.open)},e,{ref:Xp(t,o.onTriggerChange),onClick:f=>{var p;(p=e.onClick)===null||p===void 0||p.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:we(e.onPointerMove,sd(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:we(e.onPointerLeave,sd(f=>{var p;d();const g=(p=n.content)===null||p===void 0?void 0:p.getBoundingClientRect();if(g){var b;const y=(b=n.content)===null||b===void 0?void 0:b.dataset.side,x=y==="right",_=x?-5:5,w=g[x?"left":"right"],C=g[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+_,y:f.clientY},{x:w,y:g.top},{x:C,y:g.top},{x:C,y:g.bottom},{x:w,y:g.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:we(e.onKeyDown,f=>{const p=i.searchRef.current!=="";if(!(e.disabled||p&&f.key===" ")&&ore[r.dir].includes(f.key)){var g;n.onOpenChange(!0),(g=n.content)===null||g===void 0||g.focus(),f.preventDefault()}})})))}),Dre="MenuSubContent",Tre=m.forwardRef((e,t)=>{const n=nT(io,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Ba(io,e.__scopeMenu),s=Xd(io,e.__scopeMenu),a=sT(Dre,e.__scopeMenu),l=m.useRef(null),u=Xe(t,l);return m.createElement(id.Provider,{scope:e.__scopeMenu},m.createElement(nn,{present:r||i.open},m.createElement(id.Slot,{scope:e.__scopeMenu},m.createElement(_w,ne({id:a.contentId,"aria-labelledby":a.triggerId},o,{ref:u,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;s.isUsingKeyboardRef.current&&((f=l.current)===null||f===void 0||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:we(e.onFocusOutside,d=>{d.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:we(e.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:we(e.onKeyDown,d=>{const f=d.currentTarget.contains(d.target),p=ire[s.dir].includes(d.key);if(f&&p){var g;i.onOpenChange(!1),(g=a.trigger)===null||g===void 0||g.focus(),d.preventDefault()}})})))))});function aT(e){return e?"open":"closed"}function kp(e){return e==="indeterminate"}function Cw(e){return kp(e)?"indeterminate":e?"checked":"unchecked"}function Are(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ire(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function kre(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Ire(e,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Nre(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,u=t[s].x,d=t[s].y;l>r!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function Lre(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Nre(n,t)}function sd(e){return t=>t.pointerType==="mouse"?e(t):void 0}const Fre=ure,zre=eT,jre=fre,Vre=pre,Bre=bre,Hre=Sw,Wre=yre,Ure=Sre,qre=Ere,Gre=$re,Yre=Pre,Kre=Mre,Xre=Tre,lT="DropdownMenu",[Qre,Cle]=mn(lT,[ZD]),$r=ZD(),[Zre,cT]=Qre(lT),Jre=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=$r(t),u=m.useRef(null),[d=!1,f]=Nn({prop:o,defaultProp:i,onChange:s});return m.createElement(Zre,{scope:t,triggerId:nr(),triggerRef:u,contentId:nr(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(p=>!p),[f]),modal:a},m.createElement(Fre,ne({},l,{open:d,onOpenChange:f,dir:r,modal:a}),n))},eoe="DropdownMenuTrigger",toe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=cT(eoe,n),s=$r(n);return m.createElement(zre,ne({asChild:!0},s),m.createElement(ke.button,ne({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:Xp(t,i.triggerRef),onPointerDown:we(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:we(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})))}),noe=e=>{const{__scopeDropdownMenu:t,...n}=e,r=$r(t);return m.createElement(jre,ne({},r,n))},roe="DropdownMenuContent",ooe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=cT(roe,n),i=$r(n),s=m.useRef(!1);return m.createElement(Vre,ne({id:o.contentId,"aria-labelledby":o.triggerId},i,r,{ref:t,onCloseAutoFocus:we(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)===null||l===void 0||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:we(e.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;(!o.modal||d)&&(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)"}}))}),ioe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(Bre,ne({},o,r,{ref:t}))}),soe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(Hre,ne({},o,r,{ref:t}))}),aoe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(Wre,ne({},o,r,{ref:t}))}),loe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(Ure,ne({},o,r,{ref:t}))}),coe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(qre,ne({},o,r,{ref:t}))}),uoe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(Gre,ne({},o,r,{ref:t}))}),doe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(Yre,ne({},o,r,{ref:t}))}),foe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(Kre,ne({},o,r,{ref:t}))}),hoe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(Xre,ne({},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)"}}))}),poe=Jre,goe=toe,moe=noe,uT=ooe,dT=ioe,fT=soe,hT=aoe,voe=loe,pT=coe,gT=uoe,mT=doe,vT=foe,bT=hoe,boe=poe,yoe=goe,xoe=voe,woe=ie.forwardRef(({className:e,inset:t,children:n,...r},o)=>k.jsxs(vT,{ref:o,className:Se("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,k.jsx(tM,{className:"ml-auto h-4 w-4"})]}));woe.displayName=vT.displayName;const _oe=ie.forwardRef(({className:e,...t},n)=>k.jsx(bT,{ref:n,className:Se("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}));_oe.displayName=bT.displayName;const yT=ie.forwardRef(({className:e,sideOffset:t=4,...n},r)=>k.jsx(moe,{children:k.jsx(uT,{ref:r,sideOffset:t,className:Se("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})}));yT.displayName=uT.displayName;const Soe=ie.forwardRef(({className:e,inset:t,...n},r)=>k.jsx(fT,{ref:r,className:Se("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}));Soe.displayName=fT.displayName;const Coe=ie.forwardRef(({className:e,children:t,checked:n,...r},o)=>k.jsxs(hT,{ref:o,className:Se("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:[k.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:k.jsx(gT,{children:k.jsx(Vd,{className:"h-4 w-4"})})}),t]}));Coe.displayName=hT.displayName;const xT=ie.forwardRef(({className:e,children:t,...n},r)=>k.jsxs(pT,{ref:r,className:Se("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:[k.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:k.jsx(gT,{children:k.jsx(nM,{className:"h-2 w-2 fill-current"})})}),t]}));xT.displayName=pT.displayName;const wT=ie.forwardRef(({className:e,inset:t,...n},r)=>k.jsx(dT,{ref:r,className:Se("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));wT.displayName=dT.displayName;const _T=ie.forwardRef(({className:e,...t},n)=>k.jsx(mT,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));_T.displayName=mT.displayName;function Eoe(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=>ST(s))}})}})}}function ST(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:Roe(e.customCfg),data:[]}}function Roe(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 CT(e){return`semaphor:bookmark:${e}`}const ET="Dialog",[RT,Ele]=mn(ET),[$oe,lo]=RT(ET),Poe=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=m.useRef(null),l=m.useRef(null),[u=!1,d]=Nn({prop:r,defaultProp:o,onChange:i});return m.createElement($oe,{scope:t,triggerRef:a,contentRef:l,contentId:nr(),titleId:nr(),descriptionId:nr(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(f=>!f),[d]),modal:s},n)},Ooe="DialogTrigger",Moe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=lo(Ooe,n),i=Xe(t,o.triggerRef);return m.createElement(ke.button,ne({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Ew(o.open)},r,{ref:i,onClick:we(e.onClick,o.onOpenToggle)}))}),$T="DialogPortal",[Doe,PT]=RT($T,{forceMount:void 0}),Toe=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=lo($T,t);return m.createElement(Doe,{scope:t,forceMount:n},m.Children.map(r,s=>m.createElement(nn,{present:n||i.open},m.createElement(wg,{asChild:!0,container:o},s))))},ay="DialogOverlay",Aoe=m.forwardRef((e,t)=>{const n=PT(ay,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=lo(ay,e.__scopeDialog);return i.modal?m.createElement(nn,{present:r||i.open},m.createElement(Ioe,ne({},o,{ref:t}))):null}),Ioe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=lo(ay,n);return m.createElement(Ig,{as:pi,allowPinchZoom:!0,shards:[o.contentRef]},m.createElement(ke.div,ne({"data-state":Ew(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),ad="DialogContent",koe=m.forwardRef((e,t)=>{const n=PT(ad,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=lo(ad,e.__scopeDialog);return m.createElement(nn,{present:r||i.open},i.modal?m.createElement(Noe,ne({},o,{ref:t})):m.createElement(Loe,ne({},o,{ref:t})))}),Noe=m.forwardRef((e,t)=>{const n=lo(ad,e.__scopeDialog),r=m.useRef(null),o=Xe(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return Tg(i)},[]),m.createElement(OT,ne({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:we(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:we(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:we(e.onFocusOutside,i=>i.preventDefault())}))}),Loe=m.forwardRef((e,t)=>{const n=lo(ad,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(OT,ne({},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()}}))}),OT=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=lo(ad,n),l=m.useRef(null),u=Xe(t,l);return Mg(),m.createElement(m.Fragment,null,m.createElement(Dg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(yc,ne({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Ew(a.open)},s,{ref:u,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),Foe="DialogTitle",zoe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=lo(Foe,n);return m.createElement(ke.h2,ne({id:o.titleId},r,{ref:t}))}),joe="DialogDescription",Voe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=lo(joe,n);return m.createElement(ke.p,ne({id:o.descriptionId},r,{ref:t}))}),Boe="DialogClose",Hoe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=lo(Boe,n);return m.createElement(ke.button,ne({type:"button"},r,{ref:t,onClick:we(e.onClick,()=>o.onOpenChange(!1))}))});function Ew(e){return e?"open":"closed"}const Woe=Poe,Uoe=Moe,qoe=Toe,MT=Aoe,DT=koe,TT=zoe,AT=Voe,Goe=Hoe,Yoe=Woe,Koe=Uoe,Xoe=qoe,IT=ie.forwardRef(({className:e,...t},n)=>k.jsx(MT,{ref:n,className:Se("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}));IT.displayName=MT.displayName;const kT=ie.forwardRef(({className:e,children:t,...n},r)=>k.jsxs(Xoe,{children:[k.jsx(IT,{}),k.jsxs(DT,{ref:r,className:Se("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,k.jsxs(Goe,{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:[k.jsx(oM,{className:"h-4 w-4"}),k.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));kT.displayName=DT.displayName;const NT=({className:e,...t})=>k.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});NT.displayName="DialogHeader";const LT=({className:e,...t})=>k.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});LT.displayName="DialogFooter";const FT=ie.forwardRef(({className:e,...t},n)=>k.jsx(TT,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",e),...t}));FT.displayName=TT.displayName;const zT=ie.forwardRef(({className:e,...t},n)=>k.jsx(AT,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));zT.displayName=AT.displayName;const jT=ie.forwardRef(({className:e,type:t,...n},r)=>k.jsx("input",{type:t,className:Se("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}));jT.displayName="Input";const VT="Checkbox",[Qoe,Rle]=mn(VT),[Zoe,Joe]=Qoe(VT),eie=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:u,...d}=e,[f,p]=m.useState(null),g=Xe(t,C=>p(C)),b=m.useRef(!1),y=f?!!f.closest("form"):!0,[x=!1,_]=Nn({prop:o,defaultProp:i,onChange:u}),w=m.useRef(x);return m.useEffect(()=>{const C=f==null?void 0:f.form;if(C){const R=()=>_(w.current);return C.addEventListener("reset",R),()=>C.removeEventListener("reset",R)}},[f,_]),m.createElement(Zoe,{scope:n,state:x,disabled:a},m.createElement(ke.button,ne({type:"button",role:"checkbox","aria-checked":ya(x)?"mixed":x,"aria-required":s,"data-state":BT(x),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:g,onKeyDown:we(e.onKeyDown,C=>{C.key==="Enter"&&C.preventDefault()}),onClick:we(e.onClick,C=>{_(R=>ya(R)?!0:!R),y&&(b.current=C.isPropagationStopped(),b.current||C.stopPropagation())})})),y&&m.createElement(rie,{control:f,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),tie="CheckboxIndicator",nie=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Joe(tie,n);return m.createElement(nn,{present:r||ya(i.state)||i.state===!0},m.createElement(ke.span,ne({"data-state":BT(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),rie=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Ng(n),a=xg(t);return m.useEffect(()=>{const l=i.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(s!==n&&f){const p=new Event("click",{bubbles:r});l.indeterminate=ya(n),f.call(l,ya(n)?!1:n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",ne({type:"checkbox","aria-hidden":!0,defaultChecked:ya(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function ya(e){return e==="indeterminate"}function BT(e){return ya(e)?"indeterminate":e?"checked":"unchecked"}const HT=eie,oie=nie,WT=ie.forwardRef(({className:e,...t},n)=>k.jsx(HT,{ref:n,className:Se("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:k.jsx(oie,{className:Se("flex items-center justify-center text-current"),children:k.jsx(Vd,{className:"h-4 w-4"})})}));WT.displayName=HT.displayName;const UT=m.forwardRef(({className:e,...t},n)=>k.jsx("div",{role:"editor-panel",ref:n,className:Se("flex grow h-full",e),...t}));UT.displayName="EditorPanel";const qT=m.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se(" flex flex-col space-y-2 w-[270px]",e),...t}));qT.displayName="EditorAside";const GT=m.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se(" grow",e),...t}));GT.displayName="EditorMain";function iie(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const YT="ScrollArea",[KT,$le]=mn(YT),[sie,qr]=KT(YT),XT=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=m.useState(null),[u,d]=m.useState(null),[f,p]=m.useState(null),[g,b]=m.useState(null),[y,x]=m.useState(null),[_,w]=m.useState(0),[C,R]=m.useState(0),[E,T]=m.useState(!1),[O,D]=m.useState(!1),I=Xe(t,V=>l(V)),N=Aa(o);return m.createElement(sie,{scope:n,type:r,dir:N,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:d,content:f,onContentChange:p,scrollbarX:g,onScrollbarXChange:b,scrollbarXEnabled:E,onScrollbarXEnabledChange:T,scrollbarY:y,onScrollbarYChange:x,scrollbarYEnabled:O,onScrollbarYEnabledChange:D,onCornerWidthChange:w,onCornerHeightChange:R},m.createElement(ke.div,ne({dir:N},s,{ref:I,style:{position:"relative","--radix-scroll-area-corner-width":_+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})))}),aie="ScrollAreaViewport",lie=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=qr(aie,n),s=m.useRef(null),a=Xe(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(ke.div,ne({"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)))}),_i="ScrollAreaScrollbar",QT=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=qr(_i,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(cie,ne({},r,{ref:t,forceMount:n})):o.type==="scroll"?m.createElement(uie,ne({},r,{ref:t,forceMount:n})):o.type==="auto"?m.createElement(ZT,ne({},r,{ref:t,forceMount:n})):o.type==="always"?m.createElement(Rw,ne({},r,{ref:t})):null}),cie=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=qr(_i,e.__scopeScrollArea),[i,s]=m.useState(!1);return m.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const u=()=>{window.clearTimeout(l),s(!0)},d=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",u),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",u),a.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),m.createElement(nn,{present:n||i},m.createElement(ZT,ne({"data-state":i?"visible":"hidden"},r,{ref:t})))}),uie=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=qr(_i,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Bg(()=>l("SCROLL_END"),100),[a,l]=iie("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 u=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,o.scrollHideDelay,l]),m.useEffect(()=>{const u=o.viewport,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const p=()=>{const g=u[d];f!==g&&(l("SCROLL"),s()),f=g};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[o.viewport,i,l,s]),m.createElement(nn,{present:n||a!=="hidden"},m.createElement(Rw,ne({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:we(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:we(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),ZT=m.forwardRef((e,t)=>{const n=qr(_i,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=m.useState(!1),a=e.orientation==="horizontal",l=Bg(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?u:d)}},10);return pc(n.viewport,l),pc(n.content,l),m.createElement(nn,{present:r||i},m.createElement(Rw,ne({"data-state":i?"visible":"hidden"},o,{ref:t})))}),Rw=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=qr(_i,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}}),u=nA(a.viewport,a.content),d={...r,sizes:a,onSizesChange:l,hasThumb:u>0&&u<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function f(p,g){return bie(p,s.current,a,g)}return n==="horizontal"?m.createElement(die,ne({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,g=IR(p,a,o.dir);i.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=f(p,o.dir))}})):n==="vertical"?m.createElement(fie,ne({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,g=IR(p,a);i.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=f(p))}})):null}),die=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=qr(_i,e.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),u=Xe(t,l,i.onScrollbarXChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(eA,ne({"data-orientation":"horizontal"},o,{ref:u,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":Vg(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(i.viewport){const p=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),oA(p,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Np(s.paddingLeft),paddingEnd:Np(s.paddingRight)}})}}))}),fie=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=qr(_i,e.__scopeScrollArea),[s,a]=m.useState(),l=m.useRef(null),u=Xe(t,l,i.onScrollbarYChange);return m.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),m.createElement(eA,ne({"data-orientation":"vertical"},o,{ref:u,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":Vg(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(i.viewport){const p=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),oA(p,f)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Np(s.paddingTop),paddingEnd:Np(s.paddingBottom)}})}}))}),[hie,JT]=KT(_i),eA=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:f,...p}=e,g=qr(_i,n),[b,y]=m.useState(null),x=Xe(t,I=>y(I)),_=m.useRef(null),w=m.useRef(""),C=g.viewport,R=r.content-r.viewport,E=cn(d),T=cn(l),O=Bg(f,10);function D(I){if(_.current){const N=I.clientX-_.current.left,V=I.clientY-_.current.top;u({x:N,y:V})}}return m.useEffect(()=>{const I=N=>{const V=N.target;(b==null?void 0:b.contains(V))&&E(N,R)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[C,b,R,E]),m.useEffect(T,[r,T]),pc(b,O),pc(g.content,O),m.createElement(hie,{scope:n,scrollbar:b,hasThumb:o,onThumbChange:cn(i),onThumbPointerUp:cn(s),onThumbPositionChange:T,onThumbPointerDown:cn(a)},m.createElement(ke.div,ne({},p,{ref:x,style:{position:"absolute",...p.style},onPointerDown:we(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),_.current=b.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),D(I))}),onPointerMove:we(e.onPointerMove,D),onPointerUp:we(e.onPointerUp,I=>{const N=I.target;N.hasPointerCapture(I.pointerId)&&N.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=w.current,g.viewport&&(g.viewport.style.scrollBehavior=""),_.current=null})})))}),ly="ScrollAreaThumb",pie=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=JT(ly,e.__scopeScrollArea);return m.createElement(nn,{present:n||o.hasThumb},m.createElement(gie,ne({ref:t},r)))}),gie=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=qr(ly,n),s=JT(ly,n),{onThumbPositionChange:a}=s,l=Xe(t,f=>s.onThumbChange(f)),u=m.useRef(),d=Bg(()=>{u.current&&(u.current(),u.current=void 0)},100);return m.useEffect(()=>{const f=i.viewport;if(f){const p=()=>{if(d(),!u.current){const g=yie(f,a);u.current=g,a()}};return a(),f.addEventListener("scroll",p),()=>f.removeEventListener("scroll",p)}},[i.viewport,d,a]),m.createElement(ke.div,ne({"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:we(e.onPointerDownCapture,f=>{const g=f.target.getBoundingClientRect(),b=f.clientX-g.left,y=f.clientY-g.top;s.onThumbPointerDown({x:b,y})}),onPointerUp:we(e.onPointerUp,s.onThumbPointerUp)}))}),tA="ScrollAreaCorner",mie=m.forwardRef((e,t)=>{const n=qr(tA,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.createElement(vie,ne({},e,{ref:t})):null}),vie=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=qr(tA,n),[i,s]=m.useState(0),[a,l]=m.useState(0),u=!!(i&&a);return pc(o.scrollbarX,()=>{var d;const f=((d=o.scrollbarX)===null||d===void 0?void 0:d.offsetHeight)||0;o.onCornerHeightChange(f),l(f)}),pc(o.scrollbarY,()=>{var d;const f=((d=o.scrollbarY)===null||d===void 0?void 0:d.offsetWidth)||0;o.onCornerWidthChange(f),s(f)}),u?m.createElement(ke.div,ne({},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 Np(e){return e?parseInt(e,10):0}function nA(e,t){const n=e/t;return isNaN(n)?0:n}function Vg(e){const t=nA(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function bie(e,t,n,r="ltr"){const o=Vg(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return rA([l,u],f)(e)}function IR(e,t,n="ltr"){const r=Vg(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],u=ry(e,l);return rA([0,s],[0,a])(u)}function rA(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 oA(e,t){return e>0&&e<t}const yie=(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 Bg(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 pc(e,t){const n=cn(t);kn(()=>{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 iA=XT,xie=lie,wie=mie,sA=ie.forwardRef(({className:e,children:t,...n},r)=>k.jsxs(iA,{ref:r,className:Se("relative overflow-hidden",e),...n,children:[k.jsx(xie,{className:"h-full w-full rounded-[inherit]",children:t}),k.jsx($w,{}),k.jsx(wie,{})]}));sA.displayName=iA.displayName;const $w=ie.forwardRef(({className:e,orientation:t="vertical",...n},r)=>k.jsx(QT,{ref:r,orientation:t,className:Se("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:k.jsx(pie,{className:"relative flex-1 rounded-full bg-border"})}));$w.displayName=QT.displayName;const{createElement:gc,createContext:_ie,createRef:Ple,forwardRef:aA,useCallback:dr,useContext:lA,useEffect:xa,useImperativeHandle:cA,useLayoutEffect:Sie,useMemo:Cie,useRef:Br,useState:Lp}=ie,kR=ie.useId,Hg=_ie(null);Hg.displayName="PanelGroupContext";const ld=Sie,Eie=typeof kR=="function"?kR:()=>null;let Rie=0;function Pw(e=null){const t=Eie(),n=Br(e||t||null);return n.current===null&&(n.current=""+Rie++),e??n.current}function uA({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:s,maxSize:a,minSize:l,onCollapse:u,onExpand:d,onResize:f,order:p,style:g,tagName:b="div",...y}){const x=lA(Hg);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:_,expandPanel:w,getPanelSize:C,getPanelStyle:R,groupId:E,isPanelCollapsed:T,registerPanel:O,resizePanel:D,unregisterPanel:I}=x,N=Pw(s),V=Br({callbacks:{onCollapse:u,onExpand:d,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:N,idIsFromProps:s!==void 0,order:p});Br({didLogMissingDefaultSizeWarning:!1}),ld(()=>{const{callbacks:le,constraints:ee}=V.current;V.current.id=N,V.current.idIsFromProps=s!==void 0,V.current.order=p,le.onCollapse=u,le.onExpand=d,le.onResize=f,ee.collapsedSize=n,ee.collapsible=r,ee.defaultSize=o,ee.maxSize=a,ee.minSize=l}),ld(()=>{const le=V.current;return O(le),()=>{I(le)}},[p,N,O,I]),cA(i,()=>({collapse:()=>{_(V.current)},expand:()=>{w(V.current)},getId(){return N},getSize(){return C(V.current)},isCollapsed(){return T(V.current)},isExpanded(){return!T(V.current)},resize:le=>{D(V.current,le)}}),[_,w,C,T,N,D]);const G=R(V.current,o);return gc(b,{...y,children:e,className:t,style:{...G,...g},"data-panel":"","data-panel-id":N,"data-panel-group-id":E,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const dA=aA((e,t)=>gc(uA,{...e,forwardedRef:t}));uA.displayName="Panel";dA.displayName="forwardRef(Panel)";function et(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const fA=10;function cd(e,t,n=fA){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function gr(e,t,n){return cd(e,t,n)===0}function El({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];et(r!=null);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(cd(n,a)<0)if(i){const l=(o+a)/2;cd(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(fA)),n}function yu({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:o}){if(gr(e,0))return t;const i=[...t],[s,a]=r;et(s!=null),et(a!=null);let l=0;if(o==="keyboard"){{const d=e<0?a:s,f=n[d];if(et(f),f.collapsible){const p=t[d];et(p!=null);const g=n[d];et(g);const{collapsedSize:b=0,minSize:y=0}=g;if(gr(p,b)){const x=y-p;cd(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const d=e<0?s:a,f=n[d];et(f);const{collapsible:p}=f;if(p){const g=t[d];et(g!=null);const b=n[d];et(b);const{collapsedSize:y=0,minSize:x=0}=b;if(gr(g,x)){const _=g-y;cd(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}}{const d=e<0?1:-1;let f=e<0?a:s,p=0;for(;;){const b=t[f];et(b!=null);const x=El({panelConstraints:n,panelIndex:f,size:100})-b;if(p+=x,f+=d,f<0||f>=n.length)break}const g=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-g:g}{let f=e<0?s:a;for(;f>=0&&f<n.length;){const p=Math.abs(e)-Math.abs(l),g=t[f];et(g!=null);const b=g-p,y=El({panelConstraints:n,panelIndex:f,size:b});if(!gr(g,y)&&(l+=g-y,i[f]=y,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(gr(l,0))return t;{const d=e<0?a:s,f=t[d];et(f!=null);const p=f+l,g=El({panelConstraints:n,panelIndex:d,size:p});if(i[d]=g,!gr(g,p)){let b=p-g,x=e<0?a:s;for(;x>=0&&x<n.length;){const _=i[x];et(_!=null);const w=_+b,C=El({panelConstraints:n,panelIndex:x,size:w});if(gr(_,C)||(b-=C-_,i[x]=C),gr(b,0))break;e>0?x--:x++}}}const u=i.reduce((d,f)=>f+d,0);return gr(u,100)?i:t}function $ie({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];et(a!=null),t.forEach((f,p)=>{const{constraints:g}=f,{maxSize:b=100,minSize:y=0}=g;p===a?(r=y,o=b):(i+=y,s+=b)});const l=Math.min(o,100-i),u=Math.max(r,100-s),d=e[a];return{valueMax:l,valueMin:u,valueNow:d}}function ud(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function hA(e,t){const r=ud(e).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return r??null}function pA(e,t){const n=hA(e,t);return n!=null?[n,n+1]:[-1,-1]}function gA(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function Wg(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function Pie(e,t,n){var r,o,i,s;const a=Wg(t),l=ud(e),u=a?l.indexOf(a):-1,d=(r=(o=n[u])===null||o===void 0?void 0:o.id)!==null&&r!==void 0?r:null,f=(i=(s=n[u+1])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null;return[d,f]}function Oie({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,setLayout:i}){Br({didWarnAboutMissingResizeHandle:!1}),ld(()=>{const s=ud(n);for(let a=0;a<o.length-1;a++){const{valueMax:l,valueMin:u,valueNow:d}=$ie({layout:r,panelsArray:o,pivotIndices:[a,a+1]}),f=s[a];if(f!=null){const p=o[a];et(p),f.setAttribute("aria-controls",p.id),f.setAttribute("aria-valuemax",""+Math.round(l)),f.setAttribute("aria-valuemin",""+Math.round(u)),f.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{s.forEach((a,l)=>{a.removeAttribute("aria-controls"),a.removeAttribute("aria-valuemax"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuenow")})}},[n,r,o]),xa(()=>{const s=t.current;et(s);const{panelDataArray:a}=s,l=gA(n);et(l!=null,`No group found for id "${n}"`);const u=ud(n);et(u);const d=u.map(f=>{const p=f.getAttribute("data-panel-resize-handle-id");et(p);const[g,b]=Pie(n,p,a);if(g==null||b==null)return()=>{};const y=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const _=a.findIndex(w=>w.id===g);if(_>=0){const w=a[_];et(w);const C=r[_],{collapsedSize:R=0,collapsible:E,minSize:T=0}=w.constraints;if(C!=null&&E){const O=yu({delta:gr(C,R)?T-R:R-C,layout:r,panelConstraints:a.map(D=>D.constraints),pivotIndices:pA(n,p),trigger:"keyboard"});r!==O&&i(O)}}break}}};return f.addEventListener("keydown",y),()=>{f.removeEventListener("keydown",y)}});return()=>{d.forEach(f=>f())}},[e,t,n,r,o,i])}function NR(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 mA(e){return e.type==="keydown"}function vA(e){return e.type.startsWith("mouse")}function bA(e){return e.type.startsWith("touch")}function yA(e,t){const n=e==="horizontal";if(vA(t))return n?t.clientX:t.clientY;if(bA(t)){const r=t.touches[0];return et(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function Mie(e,t,n,r){const o=n==="horizontal",i=Wg(t);et(i);const s=i.getAttribute("data-panel-group-id");et(s);let{initialCursorPosition:a}=r;const l=yA(n,e),u=gA(s);et(u);const d=u.getBoundingClientRect(),f=o?d.width:d.height;return(l-a)/f*100}function Die(e,t,n,r,o){if(mA(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:Mie(e,t,n,r)}function Tie({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];et(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];et(s);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,u=o/l;r++,t[i]=u,o-=u}return t}function vl(e,t,n){t.forEach((r,o)=>{const i=e[o];et(i);const{callbacks:s,constraints:a,id:l}=i,{collapsedSize:u=0,collapsible:d}=a,f=n[l];if(f==null||r!==f){n[l]=r;const{onCollapse:p,onExpand:g,onResize:b}=s;b&&b(r,f),d&&(p||g)&&(g&&(f==null||f===u)&&r!==u&&g(),p&&(f==null||f!==u)&&r===u&&p())}})}function Mh(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 Aie({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 cy=null,oa=null;function xA(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 Iie(){oa!==null&&(document.head.removeChild(oa),cy=null,oa=null)}function bb(e){if(cy===e)return;cy=e;const t=xA(e);oa===null&&(oa=document.createElement("style"),document.head.appendChild(oa)),oa.innerHTML=`*{cursor: ${t}!important;}`}function kie(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function LR(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 wA(e){return`react-resizable-panels:${e}`}function _A(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 SA(e,t){try{const n=wA(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Nie(e,t,n){var r,o;const i=(r=SA(e,n))!==null&&r!==void 0?r:{},s=_A(t);return(o=i[s])!==null&&o!==void 0?o:null}function Lie(e,t,n,r,o){var i;const s=wA(e),a=_A(t),l=(i=SA(e,o))!==null&&i!==void 0?i:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(l))}catch(u){console.error(u)}}function FR({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(!gr(r,100))for(let i=0;i<t.length;i++){const s=n[i];et(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];et(s!=null);const a=El({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!gr(o,0))for(let i=0;i<t.length;i++){const s=n[i];et(s!=null);const a=s+o,l=El({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,gr(o,0)))break}return n}const Fie=100,xu={getItem:e=>(LR(xu),xu.getItem(e)),setItem:(e,t)=>{LR(xu),xu.setItem(e,t)}},zR={};function CA({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=xu,style:u,tagName:d="div",...f}){const p=Pw(i),[g,b]=Lp(null),[y,x]=Lp([]),_=Br({}),w=Br(new Map),C=Br(0),R=Br({autoSaveId:e,direction:r,dragState:g,id:p,keyboardResizeBy:a,onLayout:s,storage:l}),E=Br({layout:y,panelDataArray:[],panelDataArrayChanged:!1});Br({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),cA(o,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:j}=E.current;return j},setLayout:j=>{const{onLayout:B}=R.current,{layout:te,panelDataArray:ce}=E.current,ue=FR({layout:j,panelConstraints:ce.map(ge=>ge.constraints)});NR(te,ue)||(x(ue),E.current.layout=ue,B&&B(ue),vl(ce,ue,_.current))}}),[]),ld(()=>{R.current.autoSaveId=e,R.current.direction=r,R.current.dragState=g,R.current.id=p,R.current.onLayout=s,R.current.storage=l}),Oie({committedValuesRef:R,eagerValuesRef:E,groupId:p,layout:y,panelDataArray:E.current.panelDataArray,setLayout:x}),xa(()=>{const{panelDataArray:j}=E.current;if(e){if(y.length===0||y.length!==j.length)return;let B=zR[e];B==null&&(B=kie(Lie,Fie),zR[e]=B);const te=[...j],ce=new Map(w.current);B(e,te,ce,y,l)}},[e,y,l]),xa(()=>{});const T=dr(j=>{const{onLayout:B}=R.current,{layout:te,panelDataArray:ce}=E.current;if(j.constraints.collapsible){const ue=ce.map(J=>J.constraints),{collapsedSize:ge=0,panelSize:ve,pivotIndices:de}=bl(ce,j,te);if(et(ve!=null),ve!==ge){w.current.set(j.id,ve);const X=wl(ce,j)===ce.length-1?ve-ge:ge-ve,re=yu({delta:X,layout:te,panelConstraints:ue,pivotIndices:de,trigger:"imperative-api"});Mh(te,re)||(x(re),E.current.layout=re,B&&B(re),vl(ce,re,_.current))}}},[]),O=dr(j=>{const{onLayout:B}=R.current,{layout:te,panelDataArray:ce}=E.current;if(j.constraints.collapsible){const ue=ce.map(X=>X.constraints),{collapsedSize:ge=0,panelSize:ve,minSize:de=0,pivotIndices:J}=bl(ce,j,te);if(ve===ge){const X=w.current.get(j.id),re=X!=null&&X>=de?X:de,H=wl(ce,j)===ce.length-1?ve-re:re-ve,De=yu({delta:H,layout:te,panelConstraints:ue,pivotIndices:J,trigger:"imperative-api"});Mh(te,De)||(x(De),E.current.layout=De,B&&B(De),vl(ce,De,_.current))}}},[]),D=dr(j=>{const{layout:B,panelDataArray:te}=E.current,{panelSize:ce}=bl(te,j,B);return et(ce!=null),ce},[]),I=dr((j,B)=>{const{panelDataArray:te}=E.current,ce=wl(te,j);return Aie({defaultSize:B,dragState:g,layout:y,panelData:te,panelIndex:ce})},[g,y]),N=dr(j=>{const{layout:B,panelDataArray:te}=E.current,{collapsedSize:ce=0,collapsible:ue,panelSize:ge}=bl(te,j,B);return ue===!0&&ge===ce},[]),V=dr(j=>{const{layout:B,panelDataArray:te}=E.current,{collapsedSize:ce=0,collapsible:ue,panelSize:ge}=bl(te,j,B);return et(ge!=null),!ue||ge>ce},[]),G=dr(j=>{const{panelDataArray:B}=E.current;B.push(j),B.sort((te,ce)=>{const ue=te.order,ge=ce.order;return ue==null&&ge==null?0:ue==null?-1:ge==null?1:ue-ge}),E.current.panelDataArrayChanged=!0},[]);ld(()=>{if(E.current.panelDataArrayChanged){E.current.panelDataArrayChanged=!1;const{autoSaveId:j,onLayout:B,storage:te}=R.current,{layout:ce,panelDataArray:ue}=E.current;let ge=null;if(j){const de=Nie(j,ue,te);de&&(w.current=new Map(Object.entries(de.expandToSizes)),ge=de.layout)}ge==null&&(ge=Tie({panelDataArray:ue}));const ve=FR({layout:ge,panelConstraints:ue.map(de=>de.constraints)});NR(ce,ve)||(x(ve),E.current.layout=ve,B&&B(ve),vl(ue,ve,_.current))}});const le=dr(j=>function(te){te.preventDefault();const{direction:ce,dragState:ue,id:ge,keyboardResizeBy:ve,onLayout:de}=R.current,{layout:J,panelDataArray:X}=E.current,{initialLayout:re}=ue??{},be=pA(ge,j);let H=Die(te,j,ce,ue,ve);if(H===0)return;const De=ce==="horizontal";document.dir==="rtl"&&De&&(H=-H);const Ne=X.map(gt=>gt.constraints),Ve=yu({delta:H,layout:re??J,panelConstraints:Ne,pivotIndices:be,trigger:mA(te)?"keyboard":"mouse-or-touch"}),qe=!Mh(J,Ve);(vA(te)||bA(te))&&C.current!=H&&(C.current=H,bb(qe?De?"horizontal":"vertical":De?H<0?"horizontal-min":"horizontal-max":H<0?"vertical-min":"vertical-max")),qe&&(x(Ve),E.current.layout=Ve,de&&de(Ve),vl(X,Ve,_.current))},[]),ee=dr((j,B)=>{const{onLayout:te}=R.current,{layout:ce,panelDataArray:ue}=E.current,ge=ue.map(be=>be.constraints),{panelSize:ve,pivotIndices:de}=bl(ue,j,ce);et(ve!=null);const X=wl(ue,j)===ue.length-1?ve-B:B-ve,re=yu({delta:X,layout:ce,panelConstraints:ge,pivotIndices:de,trigger:"imperative-api"});Mh(ce,re)||(x(re),E.current.layout=re,te&&te(re),vl(ue,re,_.current))},[]),F=dr((j,B)=>{const{direction:te}=R.current,{layout:ce}=E.current,ue=Wg(j);et(ue);const ge=yA(te,B);b({dragHandleId:j,dragHandleRect:ue.getBoundingClientRect(),initialCursorPosition:ge,initialLayout:ce})},[]),Z=dr(()=>{Iie(),b(null)},[]),Y=dr(j=>{const{panelDataArray:B}=E.current,te=wl(B,j);te>=0&&(B.splice(te,1),delete _.current[j.id],E.current.panelDataArrayChanged=!0)},[]),Q=Cie(()=>({collapsePanel:T,direction:r,dragState:g,expandPanel:O,getPanelSize:D,getPanelStyle:I,groupId:p,isPanelCollapsed:N,isPanelExpanded:V,registerPanel:G,registerResizeHandle:le,resizePanel:ee,startDragging:F,stopDragging:Z,unregisterPanel:Y}),[T,g,r,O,D,I,p,N,V,G,le,ee,F,Z,Y]),ae={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return gc(Hg.Provider,{value:Q},gc(d,{...f,children:t,className:n,style:{...ae,...u},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const EA=aA((e,t)=>gc(CA,{...e,forwardedRef:t}));CA.displayName="PanelGroup";EA.displayName="forwardRef(PanelGroup)";function wl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function bl(e,t,n){const r=e.map(u=>u.constraints),o=wl(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 zie({disabled:e,handleId:t,resizeHandler:n}){xa(()=>{if(e||n==null)return;const r=Wg(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");et(s);const a=ud(s),l=hA(s,t);et(l!==null);const u=i.shiftKey?l>0?l-1:a.length-1:l+1<a.length?l+1:0;a[u].focus();break}}};return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[e,t,n])}function RA({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:o,style:i={},tabIndex:s=0,tagName:a="div",...l}){const u=Br(null),d=Br({onDragging:o});xa(()=>{d.current.onDragging=o});const f=lA(Hg);if(f===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:p,dragState:g,groupId:b,registerResizeHandle:y,startDragging:x,stopDragging:_}=f,w=Pw(r),C=(g==null?void 0:g.dragHandleId)===w,[R,E]=Lp(!1),[T,O]=Lp(null),D=dr(()=>{const N=u.current;et(N),N.blur(),_();const{onDragging:V}=d.current;V&&V(!1)},[_]);xa(()=>{if(n)O(null);else{const N=y(w);O(()=>N)}},[n,w,y]),xa(()=>{if(n||T==null||!C)return;const N=ee=>{T(ee)},V=ee=>{T(ee)},G=u.current;et(G);const le=G.ownerDocument;return le.body.addEventListener("contextmenu",D),le.body.addEventListener("mousemove",N),le.body.addEventListener("touchmove",N),le.body.addEventListener("mouseleave",V),window.addEventListener("mouseup",D),window.addEventListener("touchend",D),()=>{le.body.removeEventListener("contextmenu",D),le.body.removeEventListener("mousemove",N),le.body.removeEventListener("touchmove",N),le.body.removeEventListener("mouseleave",V),window.removeEventListener("mouseup",D),window.removeEventListener("touchend",D)}},[p,n,C,T,D]),zie({disabled:n,handleId:w,resizeHandler:T});const I={cursor:xA(p),touchAction:"none",userSelect:"none"};return gc(a,{...l,children:e,className:t,onBlur:()=>E(!1),onFocus:()=>E(!0),onMouseDown:N=>{x(w,N.nativeEvent);const V=d.current;et(V);const{onDragging:G}=V;G&&G(!0)},onMouseUp:D,onTouchCancel:D,onTouchEnd:D,onTouchStart:N=>{x(w,N.nativeEvent);const V=d.current;et(V);const{onDragging:G}=V;G&&G(!0)},ref:u,role:"separator",style:{...I,...i},tabIndex:s,"data-panel-group-direction":p,"data-panel-group-id":b,"data-resize-handle":"","data-resize-handle-active":C?"pointer":R?"keyboard":void 0,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":w})}RA.displayName="PanelResizeHandle";function jie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jR(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 VR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?jR(Object(n),!0).forEach(function(r){jie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Vie(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 Bie(e,t){if(e==null)return{};var n=Vie(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 Hie(e,t){return Wie(e)||Uie(e,t)||qie(e,t)||Gie()}function Wie(e){if(Array.isArray(e))return e}function Uie(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 qie(e,t){if(e){if(typeof e=="string")return BR(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 BR(e,t)}}function BR(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 Gie(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
355
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HR(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 WR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?HR(Object(n),!0).forEach(function(r){Yie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kie(){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 wu(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 Fp(e){return{}.toString.call(e).includes("Object")}function Xie(e){return!Object.keys(e).length}function dd(e){return typeof e=="function"}function Qie(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Zie(e,t){return Fp(t)||os("changeType"),Object.keys(t).some(function(n){return!Qie(e,n)})&&os("changeField"),t}function Jie(e){dd(e)||os("selectorType")}function ese(e){dd(e)||Fp(e)||os("handlerType"),Fp(e)&&Object.values(e).some(function(t){return!dd(t)})&&os("handlersType")}function tse(e){e||os("initialIsRequired"),Fp(e)||os("initialType"),Xie(e)&&os("initialContent")}function nse(e,t){throw new Error(e[t]||e.default)}var rse={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"},os=wu(nse)(rse),Dh={changes:Zie,selector:Jie,handler:ese,initial:tse};function ose(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Dh.initial(e),Dh.handler(t);var n={current:e},r=wu(ase)(n,t),o=wu(sse)(n),i=wu(Dh.changes)(e),s=wu(ise)(n);function a(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return Dh.selector(u),u(n.current)}function l(u){Kie(r,o,i,s)(u)}return[a,l]}function ise(e,t){return dd(t)?t(e.current):t}function sse(e,t){return e.current=WR(WR({},e.current),t),t}function ase(e,t,n){return dd(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 lse={create:ose},cse={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function use(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 dse(e){return{}.toString.call(e).includes("Object")}function fse(e){return e||UR("configIsRequired"),dse(e)||UR("configType"),e.urls?(hse(),{paths:{vs:e.urls.monacoBase}}):e}function hse(){console.warn($A.deprecation)}function pse(e,t){throw new Error(e[t]||e.default)}var $A={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!
356
- You are using deprecated way of configuration.
357
-
358
- Instead of using
359
- monaco.config({ urls: { monacoBase: '...' } })
360
- use
361
- monaco.config({ paths: { vs: '...' } })
362
-
363
- For more please check the link https://github.com/suren-atoyan/monaco-loader#config
364
- `},UR=use(pse)($A),gse={config:fse},mse=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 PA(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],PA(e[n],t[n]))}),VR(VR({},e),t)}var vse={type:"cancelation",msg:"operation is manually canceled"};function yb(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(vse):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var bse=lse.create({config:cse,isInitialized:!1,resolve:null,reject:null,monaco:null}),OA=Hie(bse,2),Qd=OA[0],Ug=OA[1];function yse(e){var t=gse.config(e),n=t.monaco,r=Bie(t,["monaco"]);Ug(function(o){return{config:PA(o.config,r),monaco:n}})}function xse(){var e=Qd(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(Ug({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),yb(xb);if(window.monaco&&window.monaco.editor)return MA(window.monaco),e.resolve(window.monaco),yb(xb);mse(wse,Sse)(Cse)}return yb(xb)}function wse(e){return document.body.appendChild(e)}function _se(e){var t=document.createElement("script");return e&&(t.src=e),t}function Sse(e){var t=Qd(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=_se("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function Cse(){var e=Qd(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){MA(n),e.resolve(n)},function(n){e.reject(n)})}function MA(e){Qd().monaco||Ug({monaco:e})}function Ese(){return Qd(function(e){var t=e.monaco;return t})}var xb=new Promise(function(e,t){return Ug({resolve:e,reject:t})}),DA={config:yse,init:xse,__getMonacoInstance:Ese},Rse={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},wb=Rse,$se={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Pse=$se;function Ose({children:e}){return m.createElement("div",{style:Pse.container},e)}var Mse=Ose,Dse=Mse;function Tse({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return m.createElement("section",{style:{...wb.wrapper,width:e,height:t},...s},!n&&m.createElement(Dse,null,r),m.createElement("div",{ref:o,style:{...wb.fullWidth,...!n&&wb.hide},className:i}))}var Ase=Tse,TA=m.memo(Ase);function Ise(e){m.useEffect(e,[])}var AA=Ise;function kse(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var vr=kse;function Iu(){}function Rl(e,t,n,r){return Nse(e,r)||Lse(e,t,n,r)}function Nse(e,t){return e.editor.getModel(IA(e,t))}function Lse(e,t,n,r){return e.editor.createModel(t,n,r?IA(e,r):void 0)}function IA(e,t){return e.Uri.parse(t)}function Fse({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:u="light",loading:d="Loading...",options:f={},height:p="100%",width:g="100%",className:b,wrapperProps:y={},beforeMount:x=Iu,onMount:_=Iu}){let[w,C]=m.useState(!1),[R,E]=m.useState(!0),T=m.useRef(null),O=m.useRef(null),D=m.useRef(null),I=m.useRef(_),N=m.useRef(x),V=m.useRef(!1);AA(()=>{let F=DA.init();return F.then(Z=>(O.current=Z)&&E(!1)).catch(Z=>(Z==null?void 0:Z.type)!=="cancelation"&&console.error("Monaco initialization: error:",Z)),()=>T.current?ee():F.cancel()}),vr(()=>{if(T.current&&O.current){let F=T.current.getOriginalEditor(),Z=Rl(O.current,e||"",r||n||"text",i||"");Z!==F.getModel()&&F.setModel(Z)}},[i],w),vr(()=>{if(T.current&&O.current){let F=T.current.getModifiedEditor(),Z=Rl(O.current,t||"",o||n||"text",s||"");Z!==F.getModel()&&F.setModel(Z)}},[s],w),vr(()=>{let F=T.current.getModifiedEditor();F.getOption(O.current.editor.EditorOption.readOnly)?F.setValue(t||""):t!==F.getValue()&&(F.executeEdits("",[{range:F.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),F.pushUndoStop())},[t],w),vr(()=>{var F,Z;(Z=(F=T.current)==null?void 0:F.getModel())==null||Z.original.setValue(e||"")},[e],w),vr(()=>{let{original:F,modified:Z}=T.current.getModel();O.current.editor.setModelLanguage(F,r||n||"text"),O.current.editor.setModelLanguage(Z,o||n||"text")},[n,r,o],w),vr(()=>{var F;(F=O.current)==null||F.editor.setTheme(u)},[u],w),vr(()=>{var F;(F=T.current)==null||F.updateOptions(f)},[f],w);let G=m.useCallback(()=>{var Y;if(!O.current)return;N.current(O.current);let F=Rl(O.current,e||"",r||n||"text",i||""),Z=Rl(O.current,t||"",o||n||"text",s||"");(Y=T.current)==null||Y.setModel({original:F,modified:Z})},[n,t,o,e,r,i,s]),le=m.useCallback(()=>{var F;!V.current&&D.current&&(T.current=O.current.editor.createDiffEditor(D.current,{automaticLayout:!0,...f}),G(),(F=O.current)==null||F.editor.setTheme(u),C(!0),V.current=!0)},[f,u,G]);m.useEffect(()=>{w&&I.current(T.current,O.current)},[w]),m.useEffect(()=>{!R&&!w&&le()},[R,w,le]);function ee(){var Z,Y,Q,ae;let F=(Z=T.current)==null?void 0:Z.getModel();a||((Y=F==null?void 0:F.original)==null||Y.dispose()),l||((Q=F==null?void 0:F.modified)==null||Q.dispose()),(ae=T.current)==null||ae.dispose()}return m.createElement(TA,{width:g,height:p,isEditorReady:w,loading:d,_ref:D,className:b,wrapperProps:y})}var zse=Fse;m.memo(zse);function jse(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var Vse=jse,Th=new Map;function Bse({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,theme:s="light",line:a,loading:l="Loading...",options:u={},overrideServices:d={},saveViewState:f=!0,keepCurrentModel:p=!1,width:g="100%",height:b="100%",className:y,wrapperProps:x={},beforeMount:_=Iu,onMount:w=Iu,onChange:C,onValidate:R=Iu}){let[E,T]=m.useState(!1),[O,D]=m.useState(!0),I=m.useRef(null),N=m.useRef(null),V=m.useRef(null),G=m.useRef(w),le=m.useRef(_),ee=m.useRef(),F=m.useRef(r),Z=Vse(i),Y=m.useRef(!1),Q=m.useRef(!1);AA(()=>{let B=DA.init();return B.then(te=>(I.current=te)&&D(!1)).catch(te=>(te==null?void 0:te.type)!=="cancelation"&&console.error("Monaco initialization: error:",te)),()=>N.current?j():B.cancel()}),vr(()=>{var te,ce,ue,ge;let B=Rl(I.current,e||r||"",t||o||"",i||n||"");B!==((te=N.current)==null?void 0:te.getModel())&&(f&&Th.set(Z,(ce=N.current)==null?void 0:ce.saveViewState()),(ue=N.current)==null||ue.setModel(B),f&&((ge=N.current)==null||ge.restoreViewState(Th.get(i))))},[i],E),vr(()=>{var B;(B=N.current)==null||B.updateOptions(u)},[u],E),vr(()=>{!N.current||r===void 0||(N.current.getOption(I.current.editor.EditorOption.readOnly)?N.current.setValue(r):r!==N.current.getValue()&&(Q.current=!0,N.current.executeEdits("",[{range:N.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),N.current.pushUndoStop(),Q.current=!1))},[r],E),vr(()=>{var te,ce;let B=(te=N.current)==null?void 0:te.getModel();B&&o&&((ce=I.current)==null||ce.editor.setModelLanguage(B,o))},[o],E),vr(()=>{var B;a!==void 0&&((B=N.current)==null||B.revealLine(a))},[a],E),vr(()=>{var B;(B=I.current)==null||B.editor.setTheme(s)},[s],E);let ae=m.useCallback(()=>{var B;if(!(!V.current||!I.current)&&!Y.current){le.current(I.current);let te=i||n,ce=Rl(I.current,r||e||"",t||o||"",te||"");N.current=(B=I.current)==null?void 0:B.editor.create(V.current,{model:ce,automaticLayout:!0,...u},d),f&&N.current.restoreViewState(Th.get(te)),I.current.editor.setTheme(s),a!==void 0&&N.current.revealLine(a),T(!0),Y.current=!0}},[e,t,n,r,o,i,u,d,f,s,a]);m.useEffect(()=>{E&&G.current(N.current,I.current)},[E]),m.useEffect(()=>{!O&&!E&&ae()},[O,E,ae]),F.current=r,m.useEffect(()=>{var B,te;E&&C&&((B=ee.current)==null||B.dispose(),ee.current=(te=N.current)==null?void 0:te.onDidChangeModelContent(ce=>{Q.current||C(N.current.getValue(),ce)}))},[E,C]),m.useEffect(()=>{if(E){let B=I.current.editor.onDidChangeMarkers(te=>{var ue;let ce=(ue=N.current.getModel())==null?void 0:ue.uri;if(ce&&te.find(ge=>ge.path===ce.path)){let ge=I.current.editor.getModelMarkers({resource:ce});R==null||R(ge)}});return()=>{B==null||B.dispose()}}return()=>{}},[E,R]);function j(){var B,te;(B=ee.current)==null||B.dispose(),p?f&&Th.set(i,N.current.saveViewState()):(te=N.current.getModel())==null||te.dispose(),N.current.dispose()}return m.createElement(TA,{width:g,height:b,isEditorReady:E,loading:l,_ref:V,className:y,wrapperProps:x})}var Hse=Bse,kA=m.memo(Hse),Wse=kA;const Use=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=Nn({prop:n,onChange:o,defaultProp:r});return m.createElement(ke.button,ne({type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0},i,{ref:t,onClick:we(e.onClick,()=>{e.disabled||a(!s)})}))}),NA=Use,qse=Zx("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"}}),LA=ie.forwardRef(({className:e,variant:t,size:n,...r},o)=>k.jsx(NA,{ref:o,className:Se(qse({variant:t,size:n,className:e})),...r}));LA.displayName=NA.displayName;const FA="Switch",[Gse,Ole]=mn(FA),[Yse,Kse]=Gse(FA),Xse=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:u,...d}=e,[f,p]=m.useState(null),g=Xe(t,w=>p(w)),b=m.useRef(!1),y=f?!!f.closest("form"):!0,[x=!1,_]=Nn({prop:o,defaultProp:i,onChange:u});return m.createElement(Yse,{scope:n,checked:x,disabled:a},m.createElement(ke.button,ne({type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":zA(x),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:g,onClick:we(e.onClick,w=>{_(C=>!C),y&&(b.current=w.isPropagationStopped(),b.current||w.stopPropagation())})})),y&&m.createElement(Jse,{control:f,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),Qse="SwitchThumb",Zse=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=Kse(Qse,n);return m.createElement(ke.span,ne({"data-state":zA(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),Jse=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Ng(n),a=xg(t);return m.useEffect(()=>{const l=i.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(s!==n&&f){const p=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",ne({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 zA(e){return e?"checked":"unchecked"}const qg=Xse,jA=Zse,VA=ie.forwardRef(({className:e,...t},n)=>k.jsx(qg,{className:Se("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:k.jsx(jA,{className:Se("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")})}));VA.displayName=qg.displayName;const eae=ie.forwardRef(({className:e,...t},n)=>k.jsx(qg,{className:Se("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:k.jsx(jA,{className:Se("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")})}));eae.displayName=qg.displayName;const BA="Collapsible",[tae,HA]=mn(BA),[nae,Ow]=tae(BA),rae=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,u]=Nn({prop:r,defaultProp:o,onChange:s});return m.createElement(nae,{scope:n,disabled:i,contentId:nr(),open:l,onOpenToggle:m.useCallback(()=>u(d=>!d),[u])},m.createElement(ke.div,ne({"data-state":Mw(l),"data-disabled":i?"":void 0},a,{ref:t})))}),oae="CollapsibleTrigger",iae=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=Ow(oae,n);return m.createElement(ke.button,ne({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Mw(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:we(e.onClick,o.onOpenToggle)}))}),WA="CollapsibleContent",sae=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Ow(WA,e.__scopeCollapsible);return m.createElement(nn,{present:n||o.open},({present:i})=>m.createElement(aae,ne({},r,{ref:t,present:i})))}),aae=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=Ow(WA,n),[a,l]=m.useState(r),u=m.useRef(null),d=Xe(t,u),f=m.useRef(0),p=f.current,g=m.useRef(0),b=g.current,y=s.open||a,x=m.useRef(y),_=m.useRef();return m.useEffect(()=>{const w=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(w)},[]),kn(()=>{const w=u.current;if(w){_.current=_.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const C=w.getBoundingClientRect();f.current=C.height,g.current=C.width,x.current||(w.style.transitionDuration=_.current.transitionDuration,w.style.animationName=_.current.animationName),l(r)}},[s.open,r]),m.createElement(ke.div,ne({"data-state":Mw(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!y},i,{ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style}}),y&&o)});function Mw(e){return e?"open":"closed"}const lae=rae,cae=iae,uae=sae,ps="Accordion",dae=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Dw,fae,hae]=Qp(ps),[Gg,Mle]=mn(ps,[hae,HA]),Tw=HA(),UA=m.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return m.createElement(Dw.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(vae,ne({},i,{ref:t})):m.createElement(mae,ne({},o,{ref:t})))});UA.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[qA,pae]=Gg(ps),[GA,gae]=Gg(ps,{collapsible:!1}),mae=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=Nn({prop:n,defaultProp:r,onChange:o});return m.createElement(qA,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>i&&l(""),[i,l])},m.createElement(GA,{scope:e.__scopeAccordion,collapsible:i},m.createElement(YA,ne({},s,{ref:t}))))}),vae=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=Nn({prop:n,defaultProp:r,onChange:o}),l=m.useCallback(d=>a((f=[])=>[...f,d]),[a]),u=m.useCallback(d=>a((f=[])=>f.filter(p=>p!==d)),[a]);return m.createElement(qA,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:u},m.createElement(GA,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(YA,ne({},i,{ref:t}))))}),[bae,Yg]=Gg(ps),YA=m.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=m.useRef(null),l=Xe(a,t),u=fae(n),f=Aa(o)==="ltr",p=we(e.onKeyDown,g=>{var b;if(!dae.includes(g.key))return;const y=g.target,x=u().filter(I=>{var N;return!((N=I.ref.current)!==null&&N!==void 0&&N.disabled)}),_=x.findIndex(I=>I.ref.current===y),w=x.length;if(_===-1)return;g.preventDefault();let C=_;const R=0,E=w-1,T=()=>{C=_+1,C>E&&(C=R)},O=()=>{C=_-1,C<R&&(C=E)};switch(g.key){case"Home":C=R;break;case"End":C=E;break;case"ArrowRight":i==="horizontal"&&(f?T():O());break;case"ArrowDown":i==="vertical"&&T();break;case"ArrowLeft":i==="horizontal"&&(f?O():T());break;case"ArrowUp":i==="vertical"&&O();break}const D=C%w;(b=x[D].ref.current)===null||b===void 0||b.focus()});return m.createElement(bae,{scope:n,disabled:r,direction:o,orientation:i},m.createElement(Dw.Slot,{scope:n},m.createElement(ke.div,ne({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:p}))))}),uy="AccordionItem",[yae,Aw]=Gg(uy),xae=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Yg(uy,n),s=pae(uy,n),a=Tw(n),l=nr(),u=r&&s.value.includes(r)||!1,d=i.disabled||e.disabled;return m.createElement(yae,{scope:n,open:u,disabled:d,triggerId:l},m.createElement(lae,ne({"data-orientation":i.orientation,"data-state":KA(u)},a,o,{ref:t,disabled:d,open:u,onOpenChange:f=>{f?s.onItemOpen(r):s.onItemClose(r)}})))}),wae="AccordionHeader",_ae=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Yg(ps,n),i=Aw(wae,n);return m.createElement(ke.h3,ne({"data-orientation":o.orientation,"data-state":KA(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),qR="AccordionTrigger",Sae=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Yg(ps,n),i=Aw(qR,n),s=gae(qR,n),a=Tw(n);return m.createElement(Dw.ItemSlot,{scope:n},m.createElement(cae,ne({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:t})))}),Cae="AccordionContent",Eae=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Yg(ps,n),i=Aw(Cae,n),s=Tw(n);return m.createElement(uae,ne({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 KA(e){return e?"open":"closed"}const Rae=UA,$ae=xae,Pae=_ae,XA=Sae,QA=Eae,Oae=Rae,ZA=ie.forwardRef(({className:e,...t},n)=>k.jsx($ae,{ref:n,className:Se("border-b",e),...t}));ZA.displayName="AccordionItem";const JA=ie.forwardRef(({className:e,children:t,...n},r)=>k.jsx(Pae,{className:"flex",children:k.jsxs(XA,{ref:r,className:Se("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,k.jsx(Cg,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));JA.displayName=XA.displayName;const e5=ie.forwardRef(({className:e,children:t,...n},r)=>k.jsx(QA,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:k.jsx("div",{className:Se("pb-4 pt-0",e),children:t})}));e5.displayName=QA.displayName;const t5="Radio",[Mae,n5]=mn(t5),[Dae,Tae]=Mae(t5),Aae=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,...u}=e,[d,f]=m.useState(null),p=Xe(t,y=>f(y)),g=m.useRef(!1),b=d?!!d.closest("form"):!0;return m.createElement(Dae,{scope:n,checked:o,disabled:s},m.createElement(ke.button,ne({type:"button",role:"radio","aria-checked":o,"data-state":r5(o),"data-disabled":s?"":void 0,disabled:s,value:a},u,{ref:p,onClick:we(e.onClick,y=>{o||l==null||l(),b&&(g.current=y.isPropagationStopped(),g.current||y.stopPropagation())})})),b&&m.createElement(Nae,{control:d,bubbles:!g.current,name:r,value:a,checked:o,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))}),Iae="RadioIndicator",kae=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=Tae(Iae,n);return m.createElement(nn,{present:r||i.checked},m.createElement(ke.span,ne({"data-state":r5(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:t})))}),Nae=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Ng(n),a=xg(t);return m.useEffect(()=>{const l=i.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(s!==n&&f){const p=new Event("click",{bubbles:r});f.call(l,n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",ne({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 r5(e){return e?"checked":"unchecked"}const Lae=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],o5="RadioGroup",[Fae,Dle]=mn(o5,[bc,n5]),i5=bc(),s5=n5(),[zae,jae]=Fae(o5),Vae=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:u,loop:d=!0,onValueChange:f,...p}=e,g=i5(n),b=Aa(u),[y,x]=Nn({prop:i,defaultProp:o,onChange:f});return m.createElement(zae,{scope:n,name:r,required:s,disabled:a,value:y,onValueChange:x},m.createElement(Cy,ne({asChild:!0},g,{orientation:l,dir:b,loop:d}),m.createElement(ke.div,ne({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:b},p,{ref:t}))))}),Bae="RadioGroupItem",Hae=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=jae(Bae,n),s=i.disabled||r,a=i5(n),l=s5(n),u=m.useRef(null),d=Xe(t,u),f=i.value===o.value,p=m.useRef(!1);return m.useEffect(()=>{const g=y=>{Lae.includes(y.key)&&(p.current=!0)},b=()=>p.current=!1;return document.addEventListener("keydown",g),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",b)}},[]),m.createElement(Ey,ne({asChild:!0},a,{focusable:!s,active:f}),m.createElement(Aae,ne({disabled:s,required:i.required,checked:f},l,o,{name:i.name,ref:d,onCheck:()=>i.onValueChange(o.value),onKeyDown:we(g=>{g.key==="Enter"&&g.preventDefault()}),onFocus:we(o.onFocus,()=>{var g;p.current&&((g=u.current)===null||g===void 0||g.click())})})))}),Wae=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=s5(n);return m.createElement(kae,ne({},o,r,{ref:t}))}),a5=Vae,l5=Hae,Uae=Wae,c5=ie.forwardRef(({className:e,...t},n)=>k.jsx(a5,{className:Se("grid gap-2",e),...t,ref:n}));c5.displayName=a5.displayName;const u5=ie.forwardRef(({className:e,...t},n)=>k.jsx(l5,{ref:n,className:Se("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:k.jsx(Uae,{className:"flex items-center justify-center",children:k.jsx(nM,{className:"h-2.5 w-2.5 fill-current text-current"})})}));u5.displayName=l5.displayName;var qae=Object.defineProperty,Gae=(e,t,n)=>t in e?qae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ah=(e,t,n)=>(Gae(e,typeof t!="symbol"?t+"":t,n),n);const Yae={stringify:e=>e,parse:e=>e},Kae={stringify:e=>`${e}`,parse:e=>parseFloat(e)},Xae={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},Qae={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}},Zae={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},_b={string:Yae,number:Kae,boolean:Xae,function:Qae,json:Zae},Sb=Symbol.for("r2wc.render"),Ih=Symbol.for("r2wc.connected"),qs=Symbol.for("r2wc.context"),Fi=Symbol.for("r2wc.props");function Jae(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={},u={};for(const f of s){a[f]=Array.isArray(t.props)?"string":t.props[f];const p=ele(f);l[f]=p,u[p]=f}class d extends HTMLElement{constructor(){super(),Ah(this,r,!0),Ah(this,o),Ah(this,i,{}),Ah(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[Fi].container=this.container;for(const p of s){const g=l[p],b=this.getAttribute(g),y=a[p],x=_b[y];b&&x!=null&&x.parse&&(this[Fi][p]=x.parse(b,this))}}static get observedAttributes(){return Object.keys(u)}connectedCallback(){this[Ih]=!0,this[Sb]()}disconnectedCallback(){this[Ih]=!1,this[qs]&&n.unmount(this[qs]),delete this[qs]}attributeChangedCallback(p,g,b){const y=u[p],x=a[y],_=_b[x];y in a&&_!=null&&_.parse&&(this[Fi][y]=_.parse(b,this),this[Sb]())}[(r=Ih,o=qs,i=Fi,Sb)](){this[Ih]&&(this[qs]?n.update(this[qs],this[Fi]):this[qs]=n.mount(this.container,e,this[Fi]))}}for(const f of s){const p=l[f],g=a[f];Object.defineProperty(d.prototype,f,{enumerable:!0,configurable:!0,get(){return this[Fi][f]},set(b){this[Fi][f]=b;const y=_b[g];if(y!=null&&y.stringify){const x=y.stringify(b);this.getAttribute(p)!==x&&this.setAttribute(p,x)}}})}return d}function ele(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function tle(e,t,n){const r=Ib(e),o=m.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function nle({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function rle({root:e}){e.unmount()}function ole(e,t={}){return Jae(e,t,{mount:tle,update:nle,unmount:rle})}const ile={id:"string",version:"string",authToken:"json",currentTheme:"string",customCards:"json",style:"json",onChartElementClicked:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function"},sle=ole(XD,{props:ile});exports.$57acba87d6e25586$export$ccf8d8d7bbf3c2cc=XT;exports.$PROXY=Bu;exports.$TRACK=by;exports.$a093c7e1ec25a057$export$8c610744efcf8a1d=Y2;exports.Accordion=Oae;exports.AccordionContent=e5;exports.AccordionItem=ZA;exports.AccordionTrigger=JA;exports.BOOLEAN_DATA_TYPES=Qx;exports.Button=ba;exports.Calendar=eM;exports.Card=Zy;exports.CardContent=fg;exports.CardDescription=Jy;exports.CardFooter=ex;exports.CardHeader=ug;exports.CardTitle=dg;exports.ChartJsVisual=P2;exports.Check=Vd;exports.CheckIcon=O2;exports.Checkbox=WT;exports.ChevronDown=Cg;exports.ClipboardCopyIcon=mG;exports.Cross2Icon=M2;exports.DATE_DATA_TYPES=Ud;exports.Dashboard=XD;exports.DashboardPanel=xP;exports.DashboardTabs=YD;exports.DashboardWC=sle;exports.Dialog=Yoe;exports.DialogContent=kT;exports.DialogDescription=zT;exports.DialogFooter=LT;exports.DialogHeader=NT;exports.DialogTitle=FT;exports.DialogTrigger=Koe;exports.DropdownMenu=boe;exports.DropdownMenuContent=yT;exports.DropdownMenuLabel=wT;exports.DropdownMenuRadioGroup=xoe;exports.DropdownMenuRadioItem=xT;exports.DropdownMenuSeparator=_T;exports.DropdownMenuTrigger=yoe;exports.Dynamic=h4;exports.Editable=Ca;exports.EditorAside=qT;exports.EditorMain=GT;exports.EditorPanel=UT;exports.For=zF;exports.Ft=Wse;exports.HoverCard=uM;exports.HoverCardContent=kx;exports.HoverCardTrigger=dM;exports.Index=jF;exports.InfoCircledIcon=SG;exports.Input=jT;exports.KPICard=iM;exports.Label=si;exports.LoaderCircle=Dx;exports.Match=HF;exports.NUMBER_DATA_TYPES=dc;exports.PYTHON_DEFAULT_CODE=C$;exports.Panel=dA;exports.PanelGroup=EA;exports.PanelResizeHandle=RA;exports.PaperPlaneIcon=EG;exports.PlayIcon=$G;exports.Popover=fw;exports.PopoverContent=kg;exports.PopoverTrigger=hw;exports.Portal=f4;exports.RadioGroup=c5;exports.RadioGroupItem=u5;exports.ScrollArea=sA;exports.ScrollBar=$w;exports.Select=BD;exports.SelectContent=yw;exports.SelectGroup=Zne;exports.SelectItem=Au;exports.SelectLabel=qD;exports.SelectSeparator=GD;exports.SelectTrigger=bw;exports.SelectValue=HD;exports.SemaphorContextProvider=mP;exports.SemaphorQueryClient=I$;exports.Separator=gw;exports.Settings=rM;exports.Show=VF;exports.SliderIcon=OG;exports.Switch=BF;exports.Switch$1=VA;exports.TEXT_DATA_TYPES=Pg;exports.Table=Nx;exports.TableBody=Fx;exports.TableCell=Rp;exports.TableHead=zx;exports.TableHeader=Lx;exports.TableRow=Tu;exports.TableVisual=EM;exports.Tabs=TP;exports.TabsContent=$y;exports.TabsList=AP;exports.TabsTrigger=IP;exports.Textarea=pw;exports.Toggle=LA;exports.Tooltip=Q2;exports.TooltipContent=Mx;exports.TooltipTrigger=Z2;exports.TriangleDownIcon=bx;exports.TriangleUpIcon=yx;exports.UXProvider=KD;exports.X=oM;exports._=Sa;exports.addEventListener=K$;exports.batch=yF;exports.children=xy;exports.className=Y$;exports.cleanCard=ST;exports.cn=Se;exports.commonjsGlobal=Qs;exports.convertRemToPixels=s8;exports.copyToClipboard=n9;exports.createChartConfig=sM;exports.createComponent=H$;exports.createComputed=Yb;exports.createContext=RF;exports.createEffect=yy;exports.createLucideIcon=Rr;exports.createMemo=Hn;exports.createRenderEffect=ns;exports.createRoot=ts;exports.createSignal=Tn;exports.createSqlGenConfig=uZ;exports.createUniqueId=FF;exports.de=kA;exports.delegateEvents=G$;exports.deleteNestedDataByPath=fu;exports.displayValue=e8;exports.flexRender=Y0;exports.fmt=jM;exports.getBookmarkKey=CT;exports.getCanvasBackgroundColor=Zh;exports.getColumnDataType=dZ;exports.getContrastColor=Jh;exports.getCoreRowModel=wM;exports.getDashbaordStateWithoutData=Eoe;exports.getDefaultExportFromCjs=Od;exports.getDefaultFilterSql=pZ;exports.getFilterValueType=Tp;exports.getKeys=Hr;exports.getListener=wF;exports.getMutationStatusColor=Z4;exports.getPaginationRowModel=SM;exports.getPreferredColorScheme=a8;exports.getQualifiedTableName=VM;exports.getQueryStatusColor=Q4;exports.getQueryStatusColorByLabel=J4;exports.getQueryStatusLabel=K4;exports.getRequest=yl;exports.getSidedProp=X4;exports.getSortedRowModel=_M;exports.getSql=cZ;exports.insert=ap;exports.isColumnInSqlGen=fZ;exports.jsxRuntimeExports=k;exports.mergeProps=W$;exports.mutationSortFns=i8;exports.on=xF;exports.onCleanup=ec;exports.onMount=L$;exports.pivotData=xx;exports.postRequest=jp;exports.resolveBaseQuery=u$;exports.resolveDataType=qu;exports.setAttribute=sp;exports.sortFns=r8;exports.splitProps=U$;exports.spread=X$;exports.stringify=Y4;exports.template=t4;exports.titleCase=o9;exports.untrack=dn;exports.updateNestedDataByPath=du;exports.use=i4;exports.useCard=MK;exports.useContext=$F;exports.useDashboardActions=Ta;exports.useDashboardCard=Tx;exports.useDashboardStore=Ee;exports.useEditorActions=gF;exports.useEditorAside=h8;exports.useEditorStore=Kt;exports.useQuery=So;exports.useReactTable=CM;exports.useSemaphorContext=Da;exports.useTheme=bP;exports.useTransition=EF;exports.v4=Vu;