react-semaphor 0.0.146 → 0.0.147
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.
- package/dist/chunks/2DAFLIRC-PUl5B1ZY.js +1086 -0
- package/dist/{2DAFLIRC--9V0v77A.js → chunks/2DAFLIRC-_7BynW2U.js} +1 -1
- package/dist/chunks/dashboard-Gy15dhUc.js +1 -0
- package/dist/chunks/dashboard-UqB9qVFZ.js +7 -0
- package/dist/chunks/dashboard-plus-QJ-ukBl7.js +10547 -0
- package/dist/chunks/dashboard-plus-ofCcge3v.js +228 -0
- package/dist/chunks/index-Xg6YsJx_.js +45771 -0
- package/dist/chunks/index-YZr6TBMT.js +364 -0
- package/dist/dashboard/index.cjs +1 -0
- package/dist/dashboard/index.js +7 -0
- package/dist/index.cjs +1 -0
- package/dist/index.js +164 -0
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -0
- package/dist/surfboard/index.js +7 -0
- package/dist/types/dashboard.d.ts +314 -0
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.js +1 -0
- package/dist/{index.d.ts → types/main.d.ts} +2 -20
- package/dist/types/surfboard.d.ts +319 -0
- package/dist/types/types.d.ts +311 -0
- package/package.json +20 -8
- package/dist/index-sA_OCM2k.js +0 -56464
- package/dist/react-semaphor.js +0 -33
- package/dist/react-semaphor.umd.cjs +0 -1676
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
"use strict";var iL=Object.defineProperty;var sL=(e,t,n)=>t in e?iL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ce=(e,t,n)=>(sL(e,typeof t!="symbol"?t+"":t,n),n),ev=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var W=(e,t,n)=>(ev(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)=>(ev(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Lf=(e,t,n,r)=>({set _(o){_e(e,t,o,n)},get _(){return W(e,t,r)}}),it=(e,t,n)=>(ev(e,t,"access private method"),n);const m=require("react"),Ao=require("react-dom");function KR(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=KR(m),aL=KR(Ao);var Ks=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function oy(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 yb={exports:{}},Wc={};/**
|
|
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 Z_;function lL(){return Z_||(Z_=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"),h=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===h||$.$$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 h: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:"",Os=fn?J(fn):"";return typeof $=="function"&&re.set($,Os),Os}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 h: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 _c($){try{return Gr($),!1}catch{return!0}}function Gr($){return""+$}function ps($){if(_c($))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 gs($){if(qe.call($,"ref")){var U=Object.getOwnPropertyDescriptor($,"ref").get;if(U&&U.isReactWarning)return!1}return $.ref!==void 0}function ms($){if(qe.call($,"key")){var U=Object.getOwnPropertyDescriptor($,"key").get;if(U&&U.isReactWarning)return!1}return $.key!==void 0}function vs($,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 bs($,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 ys($,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 xs=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 Sc($,U,oe,xe,Te){{var Ie,Pe={},Re=null,mt=null;oe!==void 0&&(ps(oe),Re=""+oe),ms(U)&&(ps(U.key),Re=""+U.key),gs(U)&&(mt=U.ref,vs(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&&bs(Pe,Ge),mt&&ys(Pe,Ge)}return xs($,Re,mt,Te,xe,vn.current,Pe)}}var Vo=_.ReactCurrentOwner,ws=_.ReactDebugCurrentFrame;function Rn($){if($){var U=$._owner,oe=Ve($.type,$._source,U?U.type:null);ws.setExtraStackFrame(oe)}else ws.setExtraStackFrame(null)}var uo;uo=!1;function Bo($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function _s(){{if(Vo.current){var $=le(Vo.current.type);if($)return`
|
|
14
|
+
|
|
15
|
+
Check the render method of \``+$+"`."}return""}}function Cc($){{if($!==void 0){var U=$.fileName.replace(/^.*[\\\/]/,""),oe=$.lineNumber;return`
|
|
16
|
+
|
|
17
|
+
Check your code at `+U+":"+oe+"."}return""}}var Ss={};function Va($){{var U=_s();if(!U){var oe=typeof $=="string"?$:$.displayName||$.name;oe&&(U=`
|
|
18
|
+
|
|
19
|
+
Check the top-level render call using <`+oe+">.")}return U}}function Cs($,U){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var oe=Va(U);if(Ss[oe])return;Ss[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 Es($,U){{if(typeof $!="object")return;if(En($))for(var oe=0;oe<$.length;oe++){var xe=$[oe];Bo(xe)&&Cs(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)&&Cs(Pe.value,U)}}}function Ec($){{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===h))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 Rs($){{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 $s($,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=Cc(Te);mt?Re+=mt:Re+=_s();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=Sc($,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++)Es(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 Es(Ot,$)}return $===r?Rs(Ge):Ec(Ge),Ge}}function Ps($,U,oe){return $s($,U,oe,!0)}function Rc($,U,oe){return $s($,U,oe,!1)}var $c=Rc,Pc=Ps;Wc.Fragment=r,Wc.jsx=$c,Wc.jsxs=Pc}()),Wc}var Uc={};/**
|
|
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 J_;function cL(){if(J_)return Uc;J_=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,h={},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)&&(h[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)h[d]===void 0&&(h[d]=l[d]);return{$$typeof:t,type:a,key:p,ref:g,props:h,_owner:o.current}}return Uc.Fragment=n,Uc.jsx=s,Uc.jsxs=s,Uc}process.env.NODE_ENV==="production"?yb.exports=cL():yb.exports=lL();var k=yb.exports;function XR(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=XR(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Wh(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=XR(e))&&(r&&(r+=" "),r+=t);return r}const uL=Object.freeze(Object.defineProperty({__proto__:null,clsx:Wh,default:Wh},Symbol.toStringTag,{value:"Module"})),iy="-";function dL(e){const t=hL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(iy);return a[0]===""&&a.length!==1&&a.shift(),QR(a,t)||fL(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function QR(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?QR(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(iy);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const eS=/^\[(.+)\]$/;function fL(e){if(eS.test(e)){const t=eS.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function hL(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return gL(Object.entries(e.classGroups),n).forEach(([i,s])=>{xb(s,r,i,t)}),r}function xb(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:tS(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(pL(o)){xb(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{xb(s,tS(t,i),n,r)})})}function tS(e,t){let n=e;return t.split(iy).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function pL(e){return e.isThemeGetter}function gL(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 mL(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 ZR="!";function vL(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 h=a.length===0?s:s.substring(u),p=h.startsWith(ZR),g=p?h.substring(1):h,b=d&&d>u?d-u:void 0;return{modifiers:a,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:b}}}function bL(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 yL(e){return{cache:mL(e.cacheSize),splitModifiers:vL(e),...dL(e)}}const xL=/\s+/;function wL(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(xL).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(s);let h=r(d?u.substring(0,d):u),p=!!d;if(!h){if(!d)return{isTailwindClass:!1,originalClassName:s};if(h=r(u),!h)return{isTailwindClass:!1,originalClassName:s};p=!1}const g=bL(a).join(":");return{isTailwindClass:!0,modifierId:l?g+ZR:g,classGroupId:h,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(h=>i.add(a+h)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function _L(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=JR(t))&&(r&&(r+=" "),r+=n);return r}function JR(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=JR(e[r]))&&(n&&(n+=" "),n+=t);return n}function SL(e,...t){let n,r,o,i=s;function s(l){const u=t.reduce((d,h)=>h(d),e());return n=yL(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=wL(l,n);return o(l,d),d}return function(){return i(_L.apply(null,arguments))}}function kt(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const e$=/^\[(?:([a-z-]+):)?(.+)\]$/i,CL=/^\d+\/\d+$/,EL=new Set(["px","full","screen"]),RL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,$L=/\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$/,PL=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,OL=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Jr(e){return Zs(e)||EL.has(e)||CL.test(e)}function Ti(e){return pc(e,"length",LL)}function Zs(e){return!!e&&!Number.isNaN(Number(e))}function Ff(e){return pc(e,"number",Zs)}function qc(e){return!!e&&Number.isInteger(Number(e))}function ML(e){return e.endsWith("%")&&Zs(e.slice(0,-1))}function nt(e){return e$.test(e)}function Ai(e){return RL.test(e)}const DL=new Set(["length","size","percentage"]);function TL(e){return pc(e,DL,t$)}function AL(e){return pc(e,"position",t$)}const IL=new Set(["image","url"]);function kL(e){return pc(e,IL,zL)}function NL(e){return pc(e,"",FL)}function Gc(){return!0}function pc(e,t,n){const r=e$.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function LL(e){return $L.test(e)}function t$(){return!1}function FL(e){return PL.test(e)}function zL(e){return OL.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"),h=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",Zs,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=()=>[Zs,Ff],te=()=>[Zs,nt];return{cacheSize:500,separator:":",theme:{colors:[Gc],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:[ML,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",qc,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",qc,nt]}],"grid-cols":[{"grid-cols":[Gc]}],"col-start-end":[{col:["auto",{span:["full",qc,nt]},nt]}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":[Gc]}],"row-start-end":[{row:["auto",{span:[qc,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",Ff]}],"font-family":[{font:[Gc]}],"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",Zs,Ff]}],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(),AL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",TL]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},kL]}],"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,NL]}],"shadow-color":[{shadow:[Gc]}],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:[h]}],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":[h]}],"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:[qc,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,Ff]}],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 VL=SL(jL);class BL extends Error{}BL.prototype.name="InvalidTokenError";function Se(...e){return VL(Wh(e))}async function vl(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 kp(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 HL(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 n$(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(o,i)=>WL(i,t))}function WL(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 UL(e){return e.charAt(0).toUpperCase()+e.slice(1)}const qL="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";var GL={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const nS=e=>{let t;const n=new Set,r=(l,u)=>{const d=typeof l=="function"?l(t):l;if(!Object.is(d,t)){const h=t;t=u??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(p=>p(t,h))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(GL?"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},YL=e=>e?nS(e):nS;var wb={exports:{}},tv={},zf={exports:{}},nv={};/**
|
|
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 rS;function KL(){return rS||(rS=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,h=!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(!h){var O=R();i(T,O)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),h=!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:_;nv.useSyncExternalStore=w,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),nv}var rv={};/**
|
|
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 oS;function XL(){if(oS)return rv;oS=1;var e=m;function t(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&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(h,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})},[h,g,p]),o(function(){return l(y)&&x({inst:y}),h(function(){l(y)&&x({inst:y})})},[h]),s(g),g}function l(h){var p=h.getSnapshot;h=h.value;try{var g=p();return!n(h,g)}catch{return!0}}function u(h,p){return p()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return rv.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,rv}var iS;function r$(){return iS||(iS=1,process.env.NODE_ENV==="production"?zf.exports=XL():zf.exports=KL()),zf.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 sS;function QL(){return sS||(sS=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=r$();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}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,h,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(h())},V=I===null?void 0:function(){return D(I())};return[N,V]},[h,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}tv.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),tv}var ov={};/**
|
|
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 aS;function ZL(){if(aS)return ov;aS=1;var e=m,t=r$();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 ov.useSyncExternalStoreWithSelector=function(u,d,h,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=h===void 0?null:h;return[function(){return _(d())},E===null?void 0:function(){return _(E())}]},[d,h,p,g]);var x=o(u,b[0],b[1]);return s(function(){y.hasValue=!0,y.value=x},[x]),l(x),x},ov}process.env.NODE_ENV==="production"?wb.exports=ZL():wb.exports=QL();var JL=wb.exports;const e9=$d(JL);var o$={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:t9}=m,{useSyncExternalStoreWithSelector:n9}=e9;let lS=!1;function r9(e,t=e.getState,n){(o$?"production":void 0)!=="production"&&n&&!lS&&(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"),lS=!0);const r=n9(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return t9(r),r}const cS=e=>{(o$?"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"?YL(e):e,n=(r,o)=>r9(t,r,o);return Object.assign(n,t),n},i$=e=>e?cS(e):cS;var s$=Symbol.for("immer-nothing"),uS=Symbol.for("immer-draftable"),_r=Symbol.for("immer-state"),o9=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=o9[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 Kl=Object.getPrototypeOf;function Xl(e){return!!e&&!!e[_r]}function ya(e){var t;return e?a$(e)||Array.isArray(e)||!!e[uS]||!!((t=e.constructor)!=null&&t[uS])||Lp(e)||Fp(e):!1}var i9=Object.prototype.constructor.toString();function a$(e){if(!e||typeof e!="object")return!1;const t=Kl(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)===i9}function Au(e,t){Np(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Np(e){const t=e[_r];return t?t.type_:Array.isArray(e)?1:Lp(e)?2:Fp(e)?3:0}function _b(e,t){return Np(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function l$(e,t,n){const r=Np(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function s9(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Lp(e){return e instanceof Map}function Fp(e){return e instanceof Set}function Us(e){return e.copy_||e.base_}function Sb(e,t){if(Lp(e))return new Map(e);if(Fp(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&a$(e))return Kl(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(Kl(e),n)}function sy(e,t=!1){return zp(e)||Xl(e)||!ya(e)||(Np(e)>1&&(e.set=e.add=e.clear=e.delete=a9),Object.freeze(e),t&&Au(e,(n,r)=>sy(r,!0))),e}function a9(){Jn(2)}function zp(e){return Object.isFrozen(e)}var l9={};function xa(e){const t=l9[e];return t||Jn(0,e),t}var Iu;function c$(){return Iu}function c9(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function dS(e,t){t&&(xa("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Cb(e){Eb(e),e.drafts_.forEach(u9),e.drafts_=null}function Eb(e){e===Iu&&(Iu=e.parent_)}function fS(e){return Iu=c9(Iu,e)}function u9(e){const t=e[_r];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function hS(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[_r].modified_&&(Cb(t),Jn(4)),ya(e)&&(e=Uh(t,e),t.parent_||qh(t,e)),t.patches_&&xa("Patches").generateReplacementPatches_(n[_r].base_,e,t.patches_,t.inversePatches_)):e=Uh(t,n,[]),Cb(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==s$?e:void 0}function Uh(e,t,n){if(zp(t))return t;const r=t[_r];if(!r)return Au(t,(o,i)=>pS(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),Au(i,(a,l)=>pS(e,r,o,a,l,n,s)),qh(e,o,!1),n&&e.patches_&&xa("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function pS(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&Jn(5),Xl(o)){const a=i&&t&&t.type_!==3&&!_b(t.assigned_,r)?i.concat(r):void 0,l=Uh(e,o,a);if(l$(n,r,l),Xl(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(ya(o)&&!zp(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Uh(e,o),(!t||!t.scope_.parent_)&&qh(e,o)}}function qh(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&sy(t,n)}function d9(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:c$(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=ay;n&&(o=[r],i=ku);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var ay={get(e,t){if(t===_r)return e;const n=Us(e);if(!_b(n,t))return f9(e,n,t);const r=n[t];return e.finalized_||!ya(r)?r:r===iv(e.base_,t)?(sv(e),e.copy_[t]=$b(r,e)):r},has(e,t){return t in Us(e)},ownKeys(e){return Reflect.ownKeys(Us(e))},set(e,t,n){const r=u$(Us(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=iv(Us(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(s9(n,o)&&(n!==void 0||_b(e.base_,t)))return!0;sv(e),Rb(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 iv(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,sv(e),Rb(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Us(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 Kl(e.base_)},setPrototypeOf(){Jn(12)}},ku={};Au(ay,(e,t)=>{ku[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ku.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Jn(13),ku.set.call(this,e,t,void 0)};ku.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Jn(14),ay.set.call(this,e[0],t,n,e[0])};function iv(e,t){const n=e[_r];return(n?Us(n):e)[t]}function f9(e,t,n){var o;const r=u$(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function u$(e,t){if(!(t in e))return;let n=Kl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Kl(n)}}function Rb(e){e.modified_||(e.modified_=!0,e.parent_&&Rb(e.parent_))}function sv(e){e.copy_||(e.copy_=Sb(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var h9=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(ya(t)){const i=fS(this),s=$b(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?Cb(i):Eb(i)}return dS(i,r),hS(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===s$&&(o=void 0),this.autoFreeze_&&sy(o,!0),r){const i=[],s=[];xa("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){ya(e)||Jn(8),Xl(e)&&(e=p9(e));const t=fS(this),n=$b(e,void 0);return n[_r].isManual_=!0,Eb(t),n}finishDraft(e,t){const n=e&&e[_r];(!n||!n.isManual_)&&Jn(9);const{scope_:r}=n;return dS(r,t),hS(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=xa("Patches").applyPatches_;return Xl(e)?r(e,t):this.produce(e,o=>r(o,t))}};function $b(e,t){const n=Lp(e)?xa("MapSet").proxyMap_(e,t):Fp(e)?xa("MapSet").proxySet_(e,t):d9(e,t);return(t?t.scope_:c$()).drafts_.push(n),n}function p9(e){return Xl(e)||Jn(10,e),d$(e)}function d$(e){if(!ya(e)||zp(e))return e;const t=e[_r];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Sb(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Sb(e,!0);return Au(n,(r,o)=>{l$(n,r,d$(o))}),t&&(t.finalized_=!1),n}var Sr=new h9,g9=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 m9=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?g9(o):o;return t(a,i,...s)},e(r.setState,n,r)),f$=m9;var av=Ao;process.env.NODE_ENV==="production"?(av.createRoot,av.hydrateRoot):av.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;var h$={},p$={},ly={exports:{}},Nt=String,g$=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}};ly.exports=g$();ly.exports.createColors=g$;var v9=ly.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(v9);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(h=>console.warn(l,"-",h)))}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])}}})(p$);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(p$);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}}})(h$);let lv=h$;var b9=(lv.__esModule?lv:{default:lv}).default;const Tt=$d(b9),m$=`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
|
+
`,Pb={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:gS},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:gS}},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 gS(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=Gh()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Gh()),Yh(n)}function Gh(){return Ee.getState().theme==="dark"?"#000000":"#FFFFFF"}function Yh(e){let t=0,n=0,r=0,o=0;const i=d=>{const h=d.replace("#",""),p=parseInt(h.substring(0,2),16),g=parseInt(h.substring(2,4),16),b=parseInt(h.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 Pd=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(){}},Ql=typeof window>"u"||"Deno"in window;function jr(){}function y9(e,t){return typeof e=="function"?e(t):e}function Ob(e){return typeof e=="number"&&e>=0&&e!==1/0}function v$(e,t){return Math.max(e+(t||0)-Date.now(),0)}function mS(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==cy(s,t.options))return!1}else if(!Lu(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 vS(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Nu(t.options.mutationKey)!==Nu(i))return!1}else if(!Lu(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function cy(e,t){return((t==null?void 0:t.queryKeyHashFn)||Nu)(e)}function Nu(e){return JSON.stringify(e,(t,n)=>Db(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Lu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Lu(e[n],t[n])):!1}function b$(e,t){if(e===t)return e;const n=bS(e)&&bS(t);if(n||Db(e)&&Db(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]=b$(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function Mb(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function bS(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Db(e){if(!yS(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!yS(n)||!n.hasOwnProperty("isPrototypeOf"))}function yS(e){return Object.prototype.toString.call(e)==="[object Object]"}function x9(e){return new Promise(t=>{setTimeout(t,e)})}function Tb(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?b$(e,t):t}function w9(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function _9(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ra,ji,Pl,zR,S9=(zR=class extends Pd{constructor(){super();Oe(this,ra,void 0);Oe(this,ji,void 0);Oe(this,Pl,void 0);_e(this,Pl,t=>{if(!Ql&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){W(this,ji)||this.setEventListener(W(this,Pl))}onUnsubscribe(){var t;this.hasListeners()||((t=W(this,ji))==null||t.call(this),_e(this,ji,void 0))}setEventListener(t){var n;_e(this,Pl,t),(n=W(this,ji))==null||n.call(this),_e(this,ji,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){W(this,ra)!==t&&(_e(this,ra,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof W(this,ra)=="boolean"?W(this,ra):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ra=new WeakMap,ji=new WeakMap,Pl=new WeakMap,zR),Kh=new S9,Ol,Vi,Ml,jR,C9=(jR=class extends Pd{constructor(){super();Oe(this,Ol,!0);Oe(this,Vi,void 0);Oe(this,Ml,void 0);_e(this,Ml,t=>{if(!Ql&&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,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(this.setOnline.bind(this)))}setOnline(t){W(this,Ol)!==t&&(_e(this,Ol,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return W(this,Ol)}},Ol=new WeakMap,Vi=new WeakMap,Ml=new WeakMap,jR),Fu=new C9;function E9(e){return Math.min(1e3*2**e,3e4)}function jp(e){return(e??"online")==="online"?Fu.isOnline():!0}var y$=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function cv(e){return e instanceof y$}function x$(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 y$(x)),(_=e.abort)==null||_.call(e))},u=()=>{t=!0},d=()=>{t=!1},h=()=>!Kh.isFocused()||e.networkMode!=="always"&&!Fu.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||!h();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??(Ql?0:3),C=e.retryDelay??E9,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,_),x9(R).then(()=>{if(h())return b()}).then(()=>{t?g(_):y()})})};return jp(e.networkMode)?y():b().then(y),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:u,continueRetry:d}}function R9(){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=R9(),oa,VR,w$=(VR=class{constructor(){Oe(this,oa,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ob(this.gcTime)&&_e(this,oa,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ql?1/0:5*60*1e3))}clearGcTimeout(){W(this,oa)&&(clearTimeout(W(this,oa)),_e(this,oa,void 0))}},oa=new WeakMap,VR),Dl,Tl,Lr,Bi,Fr,pn,ud,ia,Al,Dh,to,ti,BR,$9=(BR=class extends w${constructor(t){super();Oe(this,Al);Oe(this,to);Oe(this,Dl,void 0);Oe(this,Tl,void 0);Oe(this,Lr,void 0);Oe(this,Bi,void 0);Oe(this,Fr,void 0);Oe(this,pn,void 0);Oe(this,ud,void 0);Oe(this,ia,void 0);_e(this,ia,!1),_e(this,ud,t.defaultOptions),it(this,Al,Dh).call(this,t.options),_e(this,pn,[]),_e(this,Lr,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,_e(this,Dl,t.state||P9(this.options)),this.state=W(this,Dl),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=Tb(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,Bi);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,Dl))}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||!v$(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,ia)?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,h,p;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(W(this,Bi))return(u=W(this,Fr))==null||u.continueRetry(),W(this,Bi)}if(t&&it(this,Al,Dh).call(this,t),!this.options.queryFn){const g=W(this,pn).find(b=>b.options.queryFn);g&&it(this,Al,Dh).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,ia,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(_e(this,ia,!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,Tl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=a.fetchOptions)==null?void 0:h.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,_;cv(g)&&g.silent||it(this,to,ti).call(this,{type:"error",error:g}),cv(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,x$({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,Bi,W(this,Fr).promise),W(this,Bi)}},Dl=new WeakMap,Tl=new WeakMap,Lr=new WeakMap,Bi=new WeakMap,Fr=new WeakMap,pn=new WeakMap,ud=new WeakMap,ia=new WeakMap,Al=new WeakSet,Dh=function(t){this.options={...W(this,ud),...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:jp(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 cv(o)&&o.revert&&W(this,Tl)?{...W(this,Tl),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})})},BR);function P9(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,HR,O9=(HR=class extends Pd{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??cy(o,n);let s=this.get(i);return s||(s=new $9({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=>mS(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>mS(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,HR),xo,dd,hr,Il,wo,Fi,WR,M9=(WR=class extends w${constructor(t){super();Oe(this,wo);Oe(this,xo,void 0);Oe(this,dd,void 0);Oe(this,hr,void 0);Oe(this,Il,void 0);this.mutationId=t.mutationId,_e(this,dd,t.defaultOptions),_e(this,hr,t.mutationCache),_e(this,xo,[]),this.state=t.state||D9(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...W(this,dd),...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,Il))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,u,d,h,p,g,b,y,x,_,w,C,R,E,T,O;const n=()=>(_e(this,Il,x$({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(D,I)=>{it(this,wo,Fi).call(this,{type:"failed",failureCount:D,error:I})},onPause:()=>{it(this,wo,Fi).call(this,{type:"pause"})},onContinue:()=>{it(this,wo,Fi).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),W(this,Il).promise),r=this.state.status==="pending";try{if(!r){it(this,wo,Fi).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,Fi).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((h=(d=this.options).onSuccess)==null?void 0:h.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,Fi).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,Fi).call(this,{type:"error",error:D})}}}},xo=new WeakMap,dd=new WeakMap,hr=new WeakMap,Il=new WeakMap,wo=new WeakSet,Fi=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:!jp(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})})},WR);function D9(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var zr,fd,sa,UR,T9=(UR=class extends Pd{constructor(t={}){super();Oe(this,zr,void 0);Oe(this,fd,void 0);Oe(this,sa,void 0);this.config=t,_e(this,zr,[]),_e(this,fd,0)}build(t,n,r){const o=new M9({mutationCache:this,mutationId:++Lf(this,fd)._,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=>vS(n,r))}findAll(t={}){return W(this,zr).filter(n=>vS(t,n))}notify(t){_n.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return _e(this,sa,(W(this,sa)??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,sa,void 0)})),W(this,sa)}},zr=new WeakMap,fd=new WeakMap,sa=new WeakMap,UR);function A9(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)})},h=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 h(T),{maxPages:D}=t.options,I=E?_9:w9;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?I9:xS,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=xS(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 xS(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function I9(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,Hi,Wi,kl,Nl,Ui,Ll,Fl,qR,k9=(qR=class{constructor(e={}){Oe(this,an,void 0);Oe(this,Hi,void 0);Oe(this,Wi,void 0);Oe(this,kl,void 0);Oe(this,Nl,void 0);Oe(this,Ui,void 0);Oe(this,Ll,void 0);Oe(this,Fl,void 0);_e(this,an,e.queryCache||new O9),_e(this,Hi,e.mutationCache||new T9),_e(this,Wi,e.defaultOptions||{}),_e(this,kl,new Map),_e(this,Nl,new Map),_e(this,Ui,0)}mount(){Lf(this,Ui)._++,W(this,Ui)===1&&(_e(this,Ll,Kh.subscribe(()=>{Kh.isFocused()&&(this.resumePausedMutations(),W(this,an).onFocus())})),_e(this,Fl,Fu.subscribe(()=>{Fu.isOnline()&&(this.resumePausedMutations(),W(this,an).onOnline())})))}unmount(){var e,t;Lf(this,Ui)._--,W(this,Ui)===0&&((e=W(this,Ll))==null||e.call(this),_e(this,Ll,void 0),(t=W(this,Fl))==null||t.call(this),_e(this,Fl,void 0))}isFetching(e){return W(this,an).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return W(this,Hi).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=y9(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=A9(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(jr).catch(jr)}resumePausedMutations(){return W(this,Hi).resumePausedMutations()}getQueryCache(){return W(this,an)}getMutationCache(){return W(this,Hi)}getDefaultOptions(){return W(this,Wi)}setDefaultOptions(e){_e(this,Wi,e)}setQueryDefaults(e,t){W(this,kl).set(Nu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...W(this,kl).values()];let n={};return t.forEach(r=>{Lu(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){W(this,Nl).set(Nu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...W(this,Nl).values()];let n={};return t.forEach(r=>{Lu(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...W(this,Wi).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=cy(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,Wi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){W(this,an).clear(),W(this,Hi).clear()}},an=new WeakMap,Hi=new WeakMap,Wi=new WeakMap,kl=new WeakMap,Nl=new WeakMap,Ui=new WeakMap,Ll=new WeakMap,Fl=new WeakMap,qR),Zn,Lt,hd,Vn,aa,zl,_o,pd,jl,Vl,la,ca,qi,Bl,ua,au,gd,Ab,md,Ib,vd,kb,bd,Nb,yd,Lb,xd,Fb,wd,zb,Ip,_$,GR,N9=(GR=class extends Pd{constructor(t,n){super();Oe(this,ua);Oe(this,gd);Oe(this,md);Oe(this,vd);Oe(this,bd);Oe(this,yd);Oe(this,xd);Oe(this,wd);Oe(this,Ip);Oe(this,Zn,void 0);Oe(this,Lt,void 0);Oe(this,hd,void 0);Oe(this,Vn,void 0);Oe(this,aa,void 0);Oe(this,zl,void 0);Oe(this,_o,void 0);Oe(this,pd,void 0);Oe(this,jl,void 0);Oe(this,Vl,void 0);Oe(this,la,void 0);Oe(this,ca,void 0);Oe(this,qi,void 0);Oe(this,Bl,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),wS(W(this,Lt),this.options)?it(this,ua,au).call(this):this.updateResult(),it(this,bd,Nb).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return jb(W(this,Lt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jb(W(this,Lt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,it(this,yd,Lb).call(this),it(this,xd,Fb).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),Mb(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,wd,zb).call(this);const i=this.hasListeners();i&&_S(W(this,Lt),o,this.options,r)&&it(this,ua,au).call(this),this.updateResult(n),i&&(W(this,Lt)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&it(this,gd,Ab).call(this);const s=it(this,md,Ib).call(this);i&&(W(this,Lt)!==o||this.options.enabled!==r.enabled||s!==W(this,qi))&&it(this,vd,kb).call(this,s)}getOptimisticResult(t){const n=W(this,Zn).getQueryCache().build(W(this,Zn),t),r=this.createResult(n,t);return F9(this,r)&&(_e(this,Vn,r),_e(this,zl,this.options),_e(this,aa,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,Bl).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,ua,au).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,aa),a=W(this,zl),u=t!==r?t.state:W(this,hd),{state:d}=t;let{error:h,errorUpdatedAt:p,fetchStatus:g,status:b}=d,y=!1,x;if(n._optimisticResults){const O=this.hasListeners(),D=!O&&wS(t,n),I=O&&_S(t,r,n,o);(D||I)&&(g=jp(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,pd))x=W(this,jl);else try{_e(this,pd,n.select),x=n.select(d.data),x=Tb(i==null?void 0:i.data,x,n),_e(this,jl,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,Vl))==null?void 0:T.state.data,W(this,Vl)):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=Tb(i==null?void 0:i.data,O,n),y=!0)}W(this,_o)&&(h=W(this,_o),x=W(this,jl),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:h,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:uy(t,n),refetch:this.refetch}}updateResult(t){const n=W(this,Vn),r=this.createResult(W(this,Lt),this.options);if(_e(this,aa,W(this,Lt).state),_e(this,zl,this.options),W(this,aa).data!==void 0&&_e(this,Vl,W(this,Lt)),Mb(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,Bl).size)return!0;const l=new Set(a??W(this,Bl));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,Ip,_$).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&it(this,bd,Nb).call(this)}},Zn=new WeakMap,Lt=new WeakMap,hd=new WeakMap,Vn=new WeakMap,aa=new WeakMap,zl=new WeakMap,_o=new WeakMap,pd=new WeakMap,jl=new WeakMap,Vl=new WeakMap,la=new WeakMap,ca=new WeakMap,qi=new WeakMap,Bl=new WeakMap,ua=new WeakSet,au=function(t){it(this,wd,zb).call(this);let n=W(this,Lt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(jr)),n},gd=new WeakSet,Ab=function(){if(it(this,yd,Lb).call(this),Ql||W(this,Vn).isStale||!Ob(this.options.staleTime))return;const n=v$(W(this,Vn).dataUpdatedAt,this.options.staleTime)+1;_e(this,la,setTimeout(()=>{W(this,Vn).isStale||this.updateResult()},n))},md=new WeakSet,Ib=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(W(this,Lt)):this.options.refetchInterval)??!1},vd=new WeakSet,kb=function(t){it(this,xd,Fb).call(this),_e(this,qi,t),!(Ql||this.options.enabled===!1||!Ob(W(this,qi))||W(this,qi)===0)&&_e(this,ca,setInterval(()=>{(this.options.refetchIntervalInBackground||Kh.isFocused())&&it(this,ua,au).call(this)},W(this,qi)))},bd=new WeakSet,Nb=function(){it(this,gd,Ab).call(this),it(this,vd,kb).call(this,it(this,md,Ib).call(this))},yd=new WeakSet,Lb=function(){W(this,la)&&(clearTimeout(W(this,la)),_e(this,la,void 0))},xd=new WeakSet,Fb=function(){W(this,ca)&&(clearInterval(W(this,ca)),_e(this,ca,void 0))},wd=new WeakSet,zb=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,hd,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Ip=new WeakSet,_$=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"})})},GR);function L9(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function wS(e,t){return L9(e,t)||e.state.dataUpdatedAt>0&&jb(e,t,t.refetchOnMount)}function jb(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&uy(e,t)}return!1}function _S(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&uy(e,n)}function uy(e,t){return e.isStaleByTime(t.staleTime)}function F9(e,t){return!Mb(e.getCurrentResult(),t)}var S$=ie.createContext(void 0),C$=e=>{const t=ie.useContext(S$);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(S$.Provider,{value:e},t)),E$=ie.createContext(!1),j9=()=>ie.useContext(E$);E$.Provider;function V9(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var B9=ie.createContext(V9()),H9=()=>ie.useContext(B9);function W9(e,t){return typeof e=="function"?e(...t):!!e}var U9=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},q9=e=>{ie.useEffect(()=>{e.clearReset()},[e])},G9=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&W9(n,[e.error,r]),Y9=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},K9=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,X9=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Q9(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=C$(n),o=j9(),i=H9(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",Y9(s),U9(s,i),q9(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]),K9(s,l))throw X9(s,a,i);if(G9({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 Q9(e,N9,t)}let jf;const Z9=new Uint8Array(16);function J9(){if(!jf&&(jf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!jf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return jf(Z9)}const wn=[];for(let e=0;e<256;++e)wn.push((e+256).toString(16).slice(1));function eF(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 tF=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),SS={randomUUID:tF};function zu(e,t,n){if(SS.randomUUID&&!t&&!e)return SS.randomUUID();e=e||{};const r=e.random||(e.rng||J9)();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 eF(r)}const Kt=i$()(f$((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:zu(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:zu(),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})}}}))),nF=()=>Kt(e=>e.actions);function R$({children:e}){const t=new k9;return k.jsx(z9,{client:t,children:e})}var Qe={context:void 0,registry:void 0};function lu(e){Qe.context=e}var rF=(e,t)=>e===t,ju=Symbol("solid-proxy"),dy=Symbol("solid-track"),Xh={equals:rF},$$=T$,bi=1,Qh=2,P$={owned:null,cleanups:null,context:null,owner:null},uv={},bt=null,dv=null,$t=null,In=null,fi=null,Vp=0;function es(e,t){const n=$t,r=bt,o=e.length===0,i=t===void 0?r:t,s=o?P$:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>dn(()=>Hp(s)));bt=s,$t=null;try{return Oo(a,!0)}finally{$t=n,bt=r}}function Tn(e,t){t=t?Object.assign({},Xh,t):Xh;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),D$(n,o));return[M$.bind(n),r]}function Vb(e,t,n){const r=Bp(e,t,!0,bi);gc(r)}function ts(e,t,n){const r=Bp(e,t,!1,bi);gc(r)}function fy(e,t,n){$$=bF;const r=Bp(e,t,!1,bi);(!n||!n.render)&&(r.user=!0),fi?fi.push(r):gc(r)}function Hn(e,t,n){n=n?Object.assign({},Xh,n):Xh;const r=Bp(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,gc(r),M$.bind(r)}function oF(e){return e&&typeof e=="object"&&"then"in e}function iF(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=uv,l=null,u=!1,d="initialValue"in i,h=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=uv,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=gF,N=g(),V=y();if(V!==void 0&&!s)throw V;return $t&&!$t.user&&I&&Vb(()=>{_(),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=h?h():r;if(N==null||N===!1){E(s,dn(g));return}const V=a!==uv?a:dn(()=>o(N,{value:g(),refetching:I}));return oF(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,I$(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()}}}),h?Vb(()=>D(!1)):D(!1),[O,{refetch:D,mutate:b}]}function sF(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 aF(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 O$(e){fy(()=>dn(e))}function Zl(e){return bt===null||(bt.cleanups===null?bt.cleanups=[e]:bt.cleanups.push(e)),e}function lF(){return $t}function CS(){return bt}function cF(e,t){const n=bt,r=$t;bt=e,$t=null;try{return Oo(t,!0)}catch(o){py(o)}finally{bt=n,$t=r}}function uF(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[dF,Fae]=Tn(!1);function fF(){return[dF,uF]}function hF(e,t){const n=Symbol("context");return{id:n,Provider:yF(n),defaultValue:e}}function pF(e){return bt&&bt.context&&bt.context[e.id]!==void 0?bt.context[e.id]:e.defaultValue}function hy(e){const t=Hn(e),n=Hn(()=>Bb(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}var gF;function M$(){if(this.sources&&this.state)if(this.state===bi)gc(this);else{const e=In;In=null,Oo(()=>Jh(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 D$(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=dv&&dv.running;s&&dv.disposed.has(i),(s?!i.tState:!i.state)&&(i.pure?In.push(i):fi.push(i),i.observers&&A$(i)),s||(i.state=bi)}if(In.length>1e6)throw In=[],new Error},!1)),t}function gc(e){if(!e.fn)return;Hp(e);const t=Vp;mF(e,e.value,t)}function mF(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(Hp),e.owned=null),e.updatedAt=n+1,py(s)}finally{$t=i,bt=o}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?D$(e,r):e.value=r,e.updatedAt=n)}function Bp(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!==P$&&(bt.owned?bt.owned.push(i):bt.owned=[i]),i}function Zh(e){if(e.state===0)return;if(e.state===Qh)return Jh(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<Vp);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if(e=t[n],e.state===bi)gc(e);else if(e.state===Qh){const r=In;In=null,Oo(()=>Jh(e,t[0]),!1),In=r}}function Oo(e,t){if(In)return e();let n=!1;t||(In=[]),fi?n=!0:fi=[],Vp++;try{const r=e();return vF(n),r}catch(r){n||(fi=null),In=null,py(r)}}function vF(e){if(In&&(T$(In),In=null),e)return;const t=fi;fi=null,t.length&&Oo(()=>$$(t),!1)}function T$(e){for(let t=0;t<e.length;t++)Zh(e[t])}function bF(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:Zh(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);lu()}for(t=0;t<n;t++)Zh(e[t])}function Jh(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<Vp)&&Zh(r):o===Qh&&Jh(r,t)}}}function A$(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=Qh,n.pure?In.push(n):fi.push(n),n.observers&&A$(n))}}function Hp(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--)Hp(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 I$(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function py(e,t=bt){throw I$(e)}function Bb(e){if(typeof e=="function"&&!e.length)return Bb(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=Bb(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function yF(e,t){return function(r){let o;return ts(()=>o=dn(()=>(bt.context={...bt.context,[e]:r.value},hy(()=>r.children))),void 0),o}}var Hb=Symbol("fallback");function ep(e){for(let t=0;t<e.length;t++)e[t]()}function xF(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return Zl(()=>ep(i)),()=>{let l=e()||[],u,d;return l[dy],dn(()=>{let p=l.length,g,b,y,x,_,w,C,R,E;if(p===0)s!==0&&(ep(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Hb],o[0]=es(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]=es(h);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]=es(h);o=o.slice(0,s=p),r=l.slice(0)}return o});function h(p){if(i[d]=p,a){const[g,b]=Tn(d);return a[d]=b,t(l[d],g)}return t(l[d])}}}function wF(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,l;return Zl(()=>ep(i)),()=>{const u=e()||[];return u[dy],dn(()=>{if(u.length===0)return a!==0&&(ep(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[Hb],o[0]=es(h=>(i[0]=h,n.fallback())),a=1),o;for(r[0]===Hb&&(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]=es(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(h){i[l]=h;const[p,g]=Tn(u[l]);return s[l]=g,t(p,l)}}}function k$(e,t){return dn(()=>e(t||{}))}function Vf(){return!0}var Wb={get(e,t,n){return t===ju?n:e.get(t)},has(e,t){return t===ju?!0:e.has(t)},set:Vf,deleteProperty:Vf,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Vf,deleteProperty:Vf}},ownKeys(e){return e.keys()}};function fv(e){return(e=typeof e=="function"?e():e)?e:{}}function _F(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function N$(...e){let t=!1;for(let i=0;i<e.length;i++){const s=e[i];t=t||!!s&&ju 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=fv(e[s])[i];if(a!==void 0)return a}},has(i){for(let s=e.length-1;s>=0;s--)if(i in fv(e[s]))return!0;return!1},keys(){const i=[];for(let s=0;s<e.length;s++)i.push(...Object.keys(fv(e[s])));return[...new Set(i)]}},Wb);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 h=Object.getOwnPropertyDescriptor(s,d);if(!o.has(d))h.get?(o.add(d),Object.defineProperty(n,d,{enumerable:!0,configurable:!0,get:_F.bind(r[d]=[h.get.bind(s)])})):(h.value!==void 0&&o.add(d),n[d]=h.value);else{const p=r[d];p?h.get?p.push(h.get.bind(s)):h.value!==void 0&&p.push(()=>h.value):n[d]===void 0&&(n[d]=h.value)}}}return n}function L$(e,...t){if(ju 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)}},Wb));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))}},Wb)),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 SF(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=>{lu(i),Qe.count--,l(()=>u.default),lu()}),t=a}else if(!t){const[a]=iF(()=>(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;lu(i);const l=s(o);return lu(a),l}))};return r.preload=()=>n||((n=e()).then(o=>t=()=>o.default),n),r}var CF=0;function EF(){const e=Qe.context;return e?`${e.id}${e.count++}`:`cl-${CF++}`}var F$=e=>`Stale read from <${e}>.`;function RF(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Hn(xF(()=>e.each,e.children,t||void 0))}function $F(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Hn(wF(()=>e.each,e.children,t||void 0))}function PF(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 F$("Show");return e.when})):o}return e.fallback},void 0,void 0)}function OF(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=hy(()=>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 F$("Match");return a.when})):l},void 0,void 0)}function MF(e){return e}var DF=["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"],TF=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...DF]),AF=new Set(["innerHTML","textContent","innerText","children"]),IF=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),kF=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 NF(e,t){const n=kF[e];return typeof n=="object"?n[t]?n.$:void 0:n}var LF=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),FF=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 h=a;for(;h<i;)u.set(n[h],h++)}const d=u.get(t[s]);if(d!=null)if(a<d&&d<i){let h=s,p=1,g;for(;++h<o&&h<i&&!((g=u.get(t[h]))==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 ES="_$DX_DELEGATE";function VF(e,t,n,r={}){let o;return es(i=>{o=i,t===document?e():np(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{o(),t.textContent=""}}function BF(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 z$(e,t=window.document){const n=t[ES]||(t[ES]=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,XF))}}function tp(e,t,n){Qe.context||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function HF(e,t,n,r){Qe.context||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function j$(e,t){Qe.context||(t==null?e.removeAttribute("class"):e.className=t)}function V$(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 WF(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]||(RS(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||(RS(e,a,!0),n[a]=l)}return n}function UF(e,t,n){if(!t)return n?tp(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 B$(e,t={},n,r){const o={};return r||ts(()=>o.children=Jl(e,t.children,o.children)),ts(()=>t.ref&&t.ref(e)),ts(()=>GF(e,t,n,!0,o,!0)),o}function qF(e,t,n){return dn(()=>e(t,n))}function np(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Jl(e,t,r,n);ts(o=>Jl(e,t(),o,n),r)}function GF(e,t,n,r,o={},i=!1){t||(t={});for(const s in o)if(!(s in t)){if(s==="children")continue;o[s]=$S(e,s,null,o[s],n,i)}for(const s in t){if(s==="children"){r||Jl(e,t.children);continue}const a=t[s];o[s]=$S(e,s,a,o[s],n,i)}}function YF(e){let t,n;return!Qe.context||!(t=Qe.registry.get(n=QF()))?e():(Qe.completed&&Qe.completed.add(t),Qe.registry.delete(n),t)}function KF(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function RS(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 $S(e,t,n,r,o,i){let s,a,l,u,d;if(t==="style")return UF(e,n,r);if(t==="classList")return WF(e,n,r);if(n===r)return r;if(t==="ref")i||n(e);else if(t.slice(0,3)==="on:"){const h=t.slice(3);r&&e.removeEventListener(h,r),n&&e.addEventListener(h,n)}else if(t.slice(0,10)==="oncapture:"){const h=t.slice(10);r&&e.removeEventListener(h,r,!0),n&&e.addEventListener(h,n,!0)}else if(t.slice(0,2)==="on"){const h=t.slice(2).toLowerCase(),p=LF.has(h);if(!p&&r){const g=Array.isArray(r)?r[0]:r;e.removeEventListener(h,g)}(p||n)&&(V$(e,h,n,p),p&&z$([h]))}else if(t.slice(0,5)==="attr:")tp(e,t.slice(5),n);else if((d=t.slice(0,5)==="prop:")||(l=AF.has(t))||!o&&((u=NF(t,e.tagName))||(a=TF.has(t)))||(s=e.nodeName.includes("-"))){if(d)t=t.slice(5),a=!0;else if(Qe.context)return n;t==="class"||t==="className"?j$(e,n):s&&!a&&!l?e[KF(t)]=n:e[u||t]=n}else{const h=o&&t.indexOf(":")>-1&&zF[t.split(":")[0]];h?HF(e,h,t,n):tp(e,IF[t]||t,n)}return n}function XF(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 Jl(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=nl(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=nl(e,n,r)}else{if(i==="function")return ts(()=>{let a=t();for(;typeof a=="function";)a=a();n=Jl(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],l=n&&Array.isArray(n);if(Ub(a,t,n,o))return ts(()=>n=Jl(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=nl(e,n,r),s)return n}else l?n.length===0?PS(e,a,r):jF(e,n,a):(n&&nl(e),PS(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=nl(e,n,r,t);nl(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Ub(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=Ub(e,a,l)||o;else if(u==="function")if(r){for(;typeof a=="function";)a=a();o=Ub(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 PS(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function nl(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 QF(){const e=Qe.context;return`${e.id}${e.count++}`}var ZF="http://www.w3.org/2000/svg";function H$(e,t=!1){return t?document.createElementNS(ZF,e):document.createElement(e)}function JF(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,o=CS();let i,s=!!Qe.context;return fy(()=>{s&&(CS().user=s=!1),i||(i=cF(o,()=>Hn(()=>e.children)));const a=r();if(a instanceof HTMLHeadElement){const[l,u]=Tn(!1),d=()=>u(!0);es(h=>np(a,()=>l()?h():i(),null)),Zl(d)}else{const l=H$(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}),np(u,i),a.appendChild(l),e.ref&&e.ref(l),Zl(()=>a.removeChild(l))}},void 0,{render:!s}),n}function e4(e){const[t,n]=L$(e,["component"]),r=Hn(()=>t.component);return Hn(()=>{const o=r();switch(typeof o){case"function":return dn(()=>o(n));case"string":const i=FF.has(o),s=Qe.context?YF():H$(o,i);return B$(s,n,i),s}})}var t4=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}(),W$=function(){function e(t){this.generateIdentifier=t,this.kv=new t4}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}(),n4=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)}}(),r4=function(e){n4(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}(W$),o4=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 i4(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 s4(e,t){var n=i4(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 ec(e,t){Object.entries(e).forEach(function(n){var r=o4(n,2),o=r[0],i=r[1];return t(i,o)})}function Th(e,t){return e.indexOf(t)!==-1}function OS(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(t(r))return r}}var a4=function(){function e(){this.transfomers={}}return e.prototype.register=function(t){this.transfomers[t.name]=t},e.prototype.findApplicable=function(t){return s4(this.transfomers,function(n){return n.isApplicable(t)})},e.prototype.findByName=function(t){return this.transfomers[t]},e}(),l4=function(e){return Object.prototype.toString.call(e).slice(8,-1)},U$=function(e){return typeof e>"u"},c4=function(e){return e===null},Vu=function(e){return typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype},qb=function(e){return Vu(e)&&Object.keys(e).length===0},os=function(e){return Array.isArray(e)},u4=function(e){return typeof e=="string"},d4=function(e){return typeof e=="number"&&!isNaN(e)},f4=function(e){return typeof e=="boolean"},h4=function(e){return e instanceof RegExp},Bu=function(e){return e instanceof Map},Hu=function(e){return e instanceof Set},q$=function(e){return l4(e)==="Symbol"},p4=function(e){return e instanceof Date&&!isNaN(e.valueOf())},g4=function(e){return e instanceof Error},MS=function(e){return typeof e=="number"&&isNaN(e)},m4=function(e){return f4(e)||c4(e)||U$(e)||d4(e)||u4(e)||q$(e)},v4=function(e){return typeof e=="bigint"},b4=function(e){return e===1/0||e===-1/0},y4=function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)},x4=function(e){return e instanceof URL},G$=function(e){return e.replace(/\./g,"\\.")},hv=function(e){return e.map(String).map(G$).join(".")},xu=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},Gb=function(){return Gb=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},Gb.apply(this,arguments)},Yb=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},Kb=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 Y$=[go(U$,"undefined",function(){return null},function(){}),go(v4,"bigint",function(e){return e.toString()},function(e){return typeof BigInt<"u"?BigInt(e):e}),go(p4,"Date",function(e){return e.toISOString()},function(e){return new Date(e)}),go(g4,"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(h4,"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(Hu,"set",function(e){return Kb([],Yb(e.values()))},function(e){return new Set(e)}),go(Bu,"map",function(e){return Kb([],Yb(e.entries()))},function(e){return new Map(e)}),go(function(e){return MS(e)||b4(e)},"number",function(e){return MS(e)?"NaN":e>0?"Infinity":"-Infinity"},Number),go(function(e){return e===0&&1/e===-1/0},"number",function(){return"-0"},Number),go(x4,"URL",function(e){return e.toString()},function(e){return new URL(e)})];function Wp(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var K$=Wp(function(e,t){if(q$(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}),w4=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce(function(e,t){return e[t.name]=t,e},{}),X$=Wp(y4,function(e){return["typed-array",e.constructor.name]},function(e){return Kb([],Yb(e))},function(e,t){var n=w4[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function Q$(e,t){if(e!=null&&e.constructor){var n=!!t.classRegistry.getIdentifier(e.constructor);return n}return!1}var Z$=Wp(Q$,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 Gb({},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)}),J$=Wp(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)}),_4=[Z$,K$,J$,X$],DS=function(e,t){var n=OS(_4,function(o){return o.isApplicable(e,t)});if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};var r=OS(Y$,function(o){return o.isApplicable(e,t)});if(r)return{value:r.transform(e,t),type:r.annotation}},eP={};Y$.forEach(function(e){eP[e.annotation]=e});var S4=function(e,t,n){if(os(t))switch(t[0]){case"symbol":return K$.untransform(e,t,n);case"class":return Z$.untransform(e,t,n);case"custom":return J$.untransform(e,t,n);case"typed-array":return X$.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{var r=eP[t];if(!r)throw new Error("Unknown transformation: "+t);return r.untransform(e,n)}},xl=function(e,t){for(var n=e.keys();t>0;)n.next(),t--;return n.next().value};function tP(e){if(Th(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Th(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Th(e,"constructor"))throw new Error("constructor is not allowed as a property")}var C4=function(e,t){tP(t);for(var n=0;n<t.length;n++){var r=t[n];if(Hu(e))e=xl(e,+r);else if(Bu(e)){var o=+r,i=+t[++n]==0?"key":"value",s=xl(e,o);switch(i){case"key":e=s;break;case"value":e=e.get(s);break}}else e=e[r]}return e},Xb=function(e,t,n){if(tP(t),t.length===0)return n(e);for(var r=e,o=0;o<t.length-1;o++){var i=t[o];if(os(r)){var s=+i;r=r[s]}else if(Vu(r))r=r[i];else if(Hu(r)){var a=+i;r=xl(r,a)}else if(Bu(r)){var l=o===t.length-2;if(l)break;var a=+i,u=+t[++o]==0?"key":"value",d=xl(r,a);switch(u){case"key":r=d;break;case"value":r=r.get(d);break}}}var h=t[t.length-1];if(os(r)?r[+h]=n(r[+h]):Vu(r)&&(r[h]=n(r[h])),Hu(r)){var p=xl(r,+h),g=n(p);p!==g&&(r.delete(p),r.add(g))}if(Bu(r)){var a=+t[t.length-2],b=xl(r,a),u=+h==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},Gi=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e};function Qb(e,t,n){if(n===void 0&&(n=[]),!!e){if(!os(e)){ec(e,function(s,a){return Qb(s,t,Gi(Gi([],ai(n)),ai(xu(a))))});return}var r=ai(e,2),o=r[0],i=r[1];i&&ec(i,function(s,a){Qb(s,t,Gi(Gi([],ai(n)),ai(xu(a))))}),t(o,n)}}function E4(e,t,n){return Qb(t,function(r,o){e=Xb(e,o,function(i){return S4(i,r,n)})}),e}function R4(e,t){function n(s,a){var l=C4(e,xu(a));s.map(xu).forEach(function(u){e=Xb(e,u,function(){return l})})}if(os(t)){var r=ai(t,2),o=r[0],i=r[1];o.forEach(function(s){e=Xb(e,xu(s),function(){return e})}),i&&ec(i,n)}else ec(t,n);return e}var $4=function(e,t){return Vu(e)||os(e)||Bu(e)||Hu(e)||Q$(e,t)};function P4(e,t,n){var r=n.get(e);r?r.push(t):n.set(e,[t])}function O4(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(hv):n[hv(s)]=a.map(hv)}}),r?qb(n)?[r]:[r,n]:qb(n)?void 0:n}var nP=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=m4(e);if(!l){P4(e,o,t);var u=s.get(e);if(u)return r?{transformedValue:null}:u}if(!$4(e,n)){var d=DS(e,n),h=d?{transformedValue:d.value,annotations:[d.type]}:{transformedValue:e};return l||s.set(e,h),h}if(Th(i,e))return{transformedValue:null};var p=DS(e,n),g=(a=p==null?void 0:p.value)!==null&&a!==void 0?a:e,b=os(g)?[]:{},y={};ec(g,function(_,w){var C=nP(_,t,n,r,Gi(Gi([],ai(o)),[w]),Gi(Gi([],ai(i)),[e]),s);b[w]=C.transformedValue,os(C.annotations)?y[w]=C.annotations:Vu(C.annotations)&&ec(C.annotations,function(R,E){y[G$(w)+"."+E]=R})});var x=qb(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 rP(e){return Object.prototype.toString.call(e).slice(8,-1)}function M4(e){if(rP(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function TS(e){return rP(e)==="Array"}function D4(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 Zb(e,t={}){if(TS(e))return e.map(o=>Zb(o,t));if(!M4(e))return e;const n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((o,i)=>{if(TS(t.props)&&!t.props.includes(i))return o;const s=e[i],a=Zb(s,t);return D4(o,i,a,e,t.nonenumerable),o},{})}var Xs=function(){return Xs=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},Xs.apply(this,arguments)},T4=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},A4=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},oP=function(){function e(t){var n=t===void 0?{}:t,r=n.dedupe,o=r===void 0?!1:r;this.classRegistry=new r4,this.symbolRegistry=new W$(function(i){var s;return(s=i.description)!==null&&s!==void 0?s:""}),this.customTransformerRegistry=new a4,this.allowedErrorProps=[],this.dedupe=o}return e.prototype.serialize=function(t){var n=new Map,r=nP(t,n,this,this.dedupe),o={json:r.transformedValue};r.annotations&&(o.meta=Xs(Xs({},o.meta),{values:r.annotations}));var i=O4(n,this.dedupe);return i&&(o.meta=Xs(Xs({},o.meta),{referentialEqualities:i})),o},e.prototype.deserialize=function(t){var n=t.json,r=t.meta,o=Zb(n);return r!=null&&r.values&&(o=E4(o,r.values,this)),r!=null&&r.referentialEqualities&&(o=R4(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(Xs({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,A4([],T4(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}(),I4=oP.serialize,k4=oP.stringify;function N4(e){return e.state.fetchStatus==="fetching"?"fetching":e.getObserversCount()?e.state.fetchStatus==="paused"?"paused":e.isStale()?"stale":"fresh":"inactive"}function L4(e,t){return`${e}${t.charAt(0).toUpperCase()+t.slice(1)}`}function F4({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 V4=(e,t=!1)=>{const{json:n}=I4(e);return JSON.stringify(n,null,t?2:void 0)},Bf=e=>e.state.fetchStatus!=="idle"?0:e.getObserversCount()?e.isStale()?2:1:3,B4=(e,t)=>e.queryHash.localeCompare(t.queryHash),iP=(e,t)=>e.state.dataUpdatedAt<t.state.dataUpdatedAt?1:-1,H4=(e,t)=>Bf(e)===Bf(t)?iP(e,t):Bf(e)>Bf(t)?1:-1,W4={status:H4,"query hash":B4,"last updated":iP},Hf=e=>e.state.isPaused?0:e.state.status==="error"?2:e.state.status==="pending"?1:3,sP=(e,t)=>e.state.submittedAt<t.state.submittedAt?1:-1,U4=(e,t)=>Hf(e)===Hf(t)?sP(e,t):Hf(e)>Hf(t)?1:-1,q4={status:U4,"last updated":sP},G4=e=>e*parseFloat(getComputedStyle(document.documentElement).fontSize),Y4=()=>{const[e,t]=Tn("dark");return O$(()=>{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),Zl(()=>n.removeEventListener("change",r))}),e},cu=(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,cu(r.get(o),i,n)),r}if(e instanceof Set){const r=cu(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]=cu(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]=cu(r[o],i,n),r}return e},uu=(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,uu(n.get(r),o)),n}if(e instanceof Set){const n=uu(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]=uu(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]=uu(n[r],o),n}return e},K4=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)},Hl,_d,Sd,Cd,da,Ed,Wl,Ul,ql,Gl,Yl,Rd,YR,X4=(YR=class{constructor(e){Oe(this,Hl,void 0);Oe(this,_d,void 0);Oe(this,Sd,void 0);Oe(this,Cd,void 0);Oe(this,da,!1);Oe(this,Ed,void 0);Oe(this,Wl,void 0);Oe(this,Ul,void 0);Oe(this,ql,void 0);Oe(this,Gl,void 0);Oe(this,Yl,void 0);Oe(this,Rd,void 0);const{client:t,queryFlavor:n,version:r,onlineManager:o,buttonPosition:i,position:s,initialIsOpen:a,errorTypes:l,styleNonce:u}=e;_e(this,Hl,Tn(t)),_e(this,Sd,n),_e(this,Cd,r),_e(this,_d,o),_e(this,Ed,u),_e(this,Wl,Tn(i)),_e(this,Ul,Tn(s)),_e(this,ql,Tn(a)),_e(this,Gl,Tn(l))}setButtonPosition(e){W(this,Wl)[1](e)}setPosition(e){W(this,Ul)[1](e)}setInitialIsOpen(e){W(this,ql)[1](e)}setErrorTypes(e){W(this,Gl)[1](e)}setClient(e){W(this,Hl)[1](e)}mount(e){if(W(this,da))throw new Error("Devtools is already mounted");const t=VF(()=>{const[n]=W(this,Wl),[r]=W(this,Ul),[o]=W(this,ql),[i]=W(this,Gl),[s]=W(this,Hl);let a;W(this,Yl)?a=W(this,Yl):(a=SF(()=>Promise.resolve().then(()=>require("./2DAFLIRC-PUl5B1ZY.js"))),_e(this,Yl,a)),K4(W(this,Ed));const l=this;return k$(a,N$({get queryFlavor(){return W(l,Sd)},get version(){return W(l,Cd)},get onlineManager(){return W(l,_d)}},{get client(){return s()},get buttonPosition(){return n()},get position(){return r()},get initialIsOpen(){return o()},get errorTypes(){return i()}}))},e);_e(this,da,!0),_e(this,Rd,t)}unmount(){var e;if(!W(this,da))throw new Error("Devtools is not mounted");(e=W(this,Rd))==null||e.call(this),_e(this,da,!1)}},Hl=new WeakMap,_d=new WeakMap,Sd=new WeakMap,Cd=new WeakMap,da=new WeakMap,Ed=new WeakMap,Wl=new WeakMap,Ul=new WeakMap,ql=new WeakMap,Gl=new WeakMap,Yl=new WeakMap,Rd=new WeakMap,YR);function Q4(e){const t=C$(),n=e.client||t,r=ie.useRef(null),{buttonPosition:o,position:i,initialIsOpen:s,errorTypes:a,styleNonce:l}=e,[u]=ie.useState(new X4({client:n,queryFlavor:"React Query",version:"5",onlineManager:Fu,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 Z4=process.env.NODE_ENV!=="development"?function(){return null}:Q4;const J4={id:"",authToken:void 0},aP=m.createContext(J4),e8=({children:e,dashboardProps:t})=>k.jsxs(R$,{children:[k.jsx(aP.Provider,{value:t,children:e}),k.jsx(Z4,{initialIsOpen:!1})]});function Oa(){const e=m.useContext(aP);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function t8(e,t){var be;let n=m.useMemo(()=>[],[]);const r=Oa().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),h=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:()=>vl("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:()=>vl("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:()=>vl("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:()=>vl("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:()=>vl("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"),h("NA"),p((H=_==null?void 0:_.type)==null?void 0:H.toLowerCase()))},[w,g,p,h,d,_]);const te=w?(be=_==null?void 0:_.type)==null?void 0:be.toLowerCase():a||"",ce=w?"":s||"";function ue(H){h(H),p("")}function ge(H){d(H),h(""),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 n8=e=>{const t=new Date(e);return!isNaN(t.getTime())},r8=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),Wu=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?n8(e)?t="date":r8(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function o8({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,h={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:Wu(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(h)}o(n),r(h)}var rp={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
|
+
*/rp.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__",h=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]",_c="[object Undefined]",Gr="[object WeakMap]",ps="[object WeakSet]",vn="[object ArrayBuffer]",co="[object DataView]",zo="[object Float32Array]",jo="[object Float64Array]",Yr="[object Int8Array]",gs="[object Int16Array]",ms="[object Int32Array]",vs="[object Uint8Array]",bs="[object Uint8ClampedArray]",ys="[object Uint16Array]",xs="[object Uint32Array]",Sc=/\b__p \+= '';/g,Vo=/\b(__p \+=) '' \+/g,ws=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Rn=/&(?:amp|lt|gt|quot|#39);/g,uo=/[&<>"']/g,Bo=RegExp(Rn.source),_s=RegExp(uo.source),Cc=/<%-([\s\S]+?)%>/g,Ss=/<%([\s\S]+?)%>/g,Va=/<%=([\s\S]+?)%>/g,Cs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Es=/^\w*$/,Ec=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Rs=/[\\^$.*+?()[\]{}|]/g,$s=RegExp(Rs.source),Ps=/^\s+/,Rc=/\s/,$c=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pc=/\{\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=/($^)/,Os=/['\n\r\u2028\u2029\\]/g,Bt="\\ud800-\\udfff",ZA="\\u0300-\\u036f",JA="\\ufe20-\\ufe2f",e5="\\u20d0-\\u20ff",$w=ZA+JA+e5,Pw="\\u2700-\\u27bf",Ow="a-z\\xdf-\\xf6\\xf8-\\xff",t5="\\xac\\xb1\\xd7\\xf7",n5="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",r5="\\u2000-\\u206f",o5=" \\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",Mw="A-Z\\xc0-\\xd6\\xd8-\\xde",Dw="\\ufe0e\\ufe0f",Tw=t5+n5+r5+o5,Wg="['’]",i5="["+Bt+"]",Aw="["+Tw+"]",Xd="["+$w+"]",Iw="\\d+",s5="["+Pw+"]",kw="["+Ow+"]",Nw="[^"+Bt+Tw+Iw+Pw+Ow+Mw+"]",Ug="\\ud83c[\\udffb-\\udfff]",a5="(?:"+Xd+"|"+Ug+")",Lw="[^"+Bt+"]",qg="(?:\\ud83c[\\udde6-\\uddff]){2}",Gg="[\\ud800-\\udbff][\\udc00-\\udfff]",Ba="["+Mw+"]",Fw="\\u200d",zw="(?:"+kw+"|"+Nw+")",l5="(?:"+Ba+"|"+Nw+")",jw="(?:"+Wg+"(?:d|ll|m|re|s|t|ve))?",Vw="(?:"+Wg+"(?:D|LL|M|RE|S|T|VE))?",Bw=a5+"?",Hw="["+Dw+"]?",c5="(?:"+Fw+"(?:"+[Lw,qg,Gg].join("|")+")"+Hw+Bw+")*",u5="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",d5="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Ww=Hw+Bw+c5,f5="(?:"+[s5,qg,Gg].join("|")+")"+Ww,h5="(?:"+[Lw+Xd+"?",Xd,qg,Gg,i5].join("|")+")",p5=RegExp(Wg,"g"),g5=RegExp(Xd,"g"),Yg=RegExp(Ug+"(?="+Ug+")|"+h5+Ww,"g"),m5=RegExp([Ba+"?"+kw+"+"+jw+"(?="+[Aw,Ba,"$"].join("|")+")",l5+"+"+Vw+"(?="+[Aw,Ba+zw,"$"].join("|")+")",Ba+"?"+zw+"+"+jw,Ba+"+"+Vw,d5,u5,Iw,f5].join("|"),"g"),v5=RegExp("["+Fw+Bt+$w+Dw+"]"),b5=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,y5=["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"],x5=-1,It={};It[zo]=It[jo]=It[Yr]=It[gs]=It[ms]=It[vs]=It[bs]=It[ys]=It[xs]=!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[gs]=Dt[ms]=Dt[Ne]=Dt[Ve]=Dt[gt]=Dt[Gt]=Dt[Wt]=Dt[En]=Dt[rn]=Dt[vs]=Dt[bs]=Dt[ys]=Dt[xs]=!0,Dt[be]=Dt[H]=Dt[Gr]=!1;var w5={À:"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"},_5={"&":"&","<":"<",">":">",'"':""","'":"'"},S5={"&":"&","<":"<",">":">",""":'"',"'":"'"},C5={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},E5=parseFloat,R5=parseInt,Uw=typeof Ks=="object"&&Ks&&Ks.Object===Object&&Ks,$5=typeof self=="object"&&self&&self.Object===Object&&self,bn=Uw||$5||Function("return this")(),Kg=t&&!t.nodeType&&t,Ms=Kg&&!0&&e&&!e.nodeType&&e,qw=Ms&&Ms.exports===Kg,Xg=qw&&Uw.process,Pr=function(){try{var q=Ms&&Ms.require&&Ms.require("util").types;return q||Xg&&Xg.binding&&Xg.binding("util")}catch{}}(),Gw=Pr&&Pr.isArrayBuffer,Yw=Pr&&Pr.isDate,Kw=Pr&&Pr.isMap,Xw=Pr&&Pr.isRegExp,Qw=Pr&&Pr.isSet,Zw=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 P5(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 O5(q,fe){for(var se=q==null?0:q.length;se--&&fe(q[se],se,q)!==!1;);return q}function Jw(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 Qd(q,fe){var se=q==null?0:q.length;return!!se&&Ha(q,fe,0)>-1}function Qg(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 Zg(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 M5(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 Jg(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 D5=em("length");function T5(q){return q.split("")}function A5(q){return q.match(U)||[]}function e1(q,fe,se){var Me;return se(q,function(Ue,yt,on){if(fe(Ue,yt,on))return Me=yt,!1}),Me}function Zd(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 Ha(q,fe,se){return fe===fe?U5(q,fe,se):Zd(q,t1,se)}function I5(q,fe,se,Me){for(var Ue=se-1,yt=q.length;++Ue<yt;)if(Me(q[Ue],fe))return Ue;return-1}function t1(q){return q!==q}function n1(q,fe){var se=q==null?0:q.length;return se?nm(q,fe)/se:j}function em(q){return function(fe){return fe==null?n:fe[q]}}function tm(q){return function(fe){return q==null?n:q[fe]}}function r1(q,fe,se,Me,Ue){return Ue(q,function(yt,on,Mt){se=Me?(Me=!1,yt):fe(se,yt,on,Mt)}),se}function k5(q,fe){var se=q.length;for(q.sort(fe);se--;)q[se]=q[se].value;return q}function nm(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 rm(q,fe){for(var se=-1,Me=Array(q);++se<q;)Me[se]=fe(se);return Me}function N5(q,fe){return Ht(fe,function(se){return[se,q[se]]})}function o1(q){return q&&q.slice(0,l1(q)+1).replace(Ps,"")}function ir(q){return function(fe){return q(fe)}}function om(q,fe){return Ht(fe,function(se){return q[se]})}function Oc(q,fe){return q.has(fe)}function i1(q,fe){for(var se=-1,Me=q.length;++se<Me&&Ha(fe,q[se],0)>-1;);return se}function s1(q,fe){for(var se=q.length;se--&&Ha(fe,q[se],0)>-1;);return se}function L5(q,fe){for(var se=q.length,Me=0;se--;)q[se]===fe&&++Me;return Me}var F5=tm(w5),z5=tm(_5);function j5(q){return"\\"+C5[q]}function V5(q,fe){return q==null?n:q[fe]}function Wa(q){return v5.test(q)}function B5(q){return b5.test(q)}function H5(q){for(var fe,se=[];!(fe=q.next()).done;)se.push(fe.value);return se}function im(q){var fe=-1,se=Array(q.size);return q.forEach(function(Me,Ue){se[++fe]=[Ue,Me]}),se}function a1(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 Jd(q){var fe=-1,se=Array(q.size);return q.forEach(function(Me){se[++fe]=Me}),se}function W5(q){var fe=-1,se=Array(q.size);return q.forEach(function(Me){se[++fe]=[Me,Me]}),se}function U5(q,fe,se){for(var Me=se-1,Ue=q.length;++Me<Ue;)if(q[Me]===fe)return Me;return-1}function q5(q,fe,se){for(var Me=se+1;Me--;)if(q[Me]===fe)return Me;return Me}function Ua(q){return Wa(q)?Y5(q):D5(q)}function Kr(q){return Wa(q)?K5(q):T5(q)}function l1(q){for(var fe=q.length;fe--&&Rc.test(q.charAt(fe)););return fe}var G5=tm(S5);function Y5(q){for(var fe=Yg.lastIndex=0;Yg.test(q);)++fe;return fe}function K5(q){return q.match(Yg)||[]}function X5(q){return q.match(m5)||[]}var Q5=function q(fe){fe=fe==null?bn:qa.defaults(bn.Object(),fe,qa.pick(bn,y5));var se=fe.Array,Me=fe.Date,Ue=fe.Error,yt=fe.Function,on=fe.Math,Mt=fe.Object,sm=fe.RegExp,Z5=fe.String,Mr=fe.TypeError,ef=se.prototype,J5=yt.prototype,Ga=Mt.prototype,tf=fe["__core-js_shared__"],nf=J5.toString,Et=Ga.hasOwnProperty,eI=0,c1=function(){var c=/[^.]+$/.exec(tf&&tf.keys&&tf.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}(),rf=Ga.toString,tI=nf.call(Mt),nI=bn._,rI=sm("^"+nf.call(Et).replace(Rs,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),of=qw?fe.Buffer:n,Ri=fe.Symbol,sf=fe.Uint8Array,u1=of?of.allocUnsafe:n,af=a1(Mt.getPrototypeOf,Mt),d1=Mt.create,f1=Ga.propertyIsEnumerable,lf=ef.splice,h1=Ri?Ri.isConcatSpreadable:n,Mc=Ri?Ri.iterator:n,Ds=Ri?Ri.toStringTag:n,cf=function(){try{var c=Ns(Mt,"defineProperty");return c({},"",{}),c}catch{}}(),oI=fe.clearTimeout!==bn.clearTimeout&&fe.clearTimeout,iI=Me&&Me.now!==bn.Date.now&&Me.now,sI=fe.setTimeout!==bn.setTimeout&&fe.setTimeout,uf=on.ceil,df=on.floor,am=Mt.getOwnPropertySymbols,aI=of?of.isBuffer:n,p1=fe.isFinite,lI=ef.join,cI=a1(Mt.keys,Mt),sn=on.max,$n=on.min,uI=Me.now,dI=fe.parseInt,g1=on.random,fI=ef.reverse,lm=Ns(fe,"DataView"),Dc=Ns(fe,"Map"),cm=Ns(fe,"Promise"),Ya=Ns(fe,"Set"),Tc=Ns(fe,"WeakMap"),Ac=Ns(Mt,"create"),ff=Tc&&new Tc,Ka={},hI=Ls(lm),pI=Ls(Dc),gI=Ls(cm),mI=Ls(Ya),vI=Ls(Tc),hf=Ri?Ri.prototype:n,Ic=hf?hf.valueOf:n,m1=hf?hf.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 v_(c)}return new Dr(c)}var Xa=function(){function c(){}return function(f){if(!Ut(f))return{};if(d1)return d1(f);c.prototype=f;var v=new c;return c.prototype=n,v}}();function pf(){}function Dr(c,f){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=n}M.templateSettings={escape:Cc,evaluate:Ss,interpolate:Va,variable:"",imports:{_:M}},M.prototype=pf.prototype,M.prototype.constructor=M,Dr.prototype=Xa(pf.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 bI(){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 yI(){if(this.__filtered__){var c=new dt(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}function xI(){var c=this.__wrapped__.value(),f=this.__dir__,v=Ye(c),S=f<0,P=v?c.length:0,A=Tk(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 j1(c,this.__actions__);var Fe=[];e:for(;K--&&$e<Ae;){he+=f;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=Xa(pf.prototype),dt.prototype.constructor=dt;function Ts(c){var f=-1,v=c==null?0:c.length;for(this.clear();++f<v;){var S=c[f];this.set(S[0],S[1])}}function wI(){this.__data__=Ac?Ac(null):{},this.size=0}function _I(c){var f=this.has(c)&&delete this.__data__[c];return this.size-=f?1:0,f}function SI(c){var f=this.__data__;if(Ac){var v=f[c];return v===l?n:v}return Et.call(f,c)?f[c]:n}function CI(c){var f=this.__data__;return Ac?f[c]!==n:Et.call(f,c)}function EI(c,f){var v=this.__data__;return this.size+=this.has(c)?0:1,v[c]=Ac&&f===n?l:f,this}Ts.prototype.clear=wI,Ts.prototype.delete=_I,Ts.prototype.get=SI,Ts.prototype.has=CI,Ts.prototype.set=EI;function Ho(c){var f=-1,v=c==null?0:c.length;for(this.clear();++f<v;){var S=c[f];this.set(S[0],S[1])}}function RI(){this.__data__=[],this.size=0}function $I(c){var f=this.__data__,v=gf(f,c);if(v<0)return!1;var S=f.length-1;return v==S?f.pop():lf.call(f,v,1),--this.size,!0}function PI(c){var f=this.__data__,v=gf(f,c);return v<0?n:f[v][1]}function OI(c){return gf(this.__data__,c)>-1}function MI(c,f){var v=this.__data__,S=gf(v,c);return S<0?(++this.size,v.push([c,f])):v[S][1]=f,this}Ho.prototype.clear=RI,Ho.prototype.delete=$I,Ho.prototype.get=PI,Ho.prototype.has=OI,Ho.prototype.set=MI;function Wo(c){var f=-1,v=c==null?0:c.length;for(this.clear();++f<v;){var S=c[f];this.set(S[0],S[1])}}function DI(){this.size=0,this.__data__={hash:new Ts,map:new(Dc||Ho),string:new Ts}}function TI(c){var f=$f(this,c).delete(c);return this.size-=f?1:0,f}function AI(c){return $f(this,c).get(c)}function II(c){return $f(this,c).has(c)}function kI(c,f){var v=$f(this,c),S=v.size;return v.set(c,f),this.size+=v.size==S?0:1,this}Wo.prototype.clear=DI,Wo.prototype.delete=TI,Wo.prototype.get=AI,Wo.prototype.has=II,Wo.prototype.set=kI;function As(c){var f=-1,v=c==null?0:c.length;for(this.__data__=new Wo;++f<v;)this.add(c[f])}function NI(c){return this.__data__.set(c,l),this}function LI(c){return this.__data__.has(c)}As.prototype.add=As.prototype.push=NI,As.prototype.has=LI;function Xr(c){var f=this.__data__=new Ho(c);this.size=f.size}function FI(){this.__data__=new Ho,this.size=0}function zI(c){var f=this.__data__,v=f.delete(c);return this.size=f.size,v}function jI(c){return this.__data__.get(c)}function VI(c){return this.__data__.has(c)}function BI(c,f){var v=this.__data__;if(v instanceof Ho){var S=v.__data__;if(!Dc||S.length<o-1)return S.push([c,f]),this.size=++v.size,this;v=this.__data__=new Wo(S)}return v.set(c,f),this.size=v.size,this}Xr.prototype.clear=FI,Xr.prototype.delete=zI,Xr.prototype.get=jI,Xr.prototype.has=VI,Xr.prototype.set=BI;function v1(c,f){var v=Ye(c),S=!v&&Fs(c),P=!v&&!S&&Di(c),A=!v&&!S&&!P&&el(c),L=v||S||P||A,z=L?rm(c.length,Z5):[],K=z.length;for(var he in c)(f||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 b1(c){var f=c.length;return f?c[xm(0,f-1)]:n}function HI(c,f){return Pf(Wn(c),Is(f,0,c.length))}function WI(c){return Pf(Wn(c))}function um(c,f,v){(v!==n&&!Qr(c[f],v)||v===n&&!(f in c))&&Uo(c,f,v)}function kc(c,f,v){var S=c[f];(!(Et.call(c,f)&&Qr(S,v))||v===n&&!(f in c))&&Uo(c,f,v)}function gf(c,f){for(var v=c.length;v--;)if(Qr(c[v][0],f))return v;return-1}function UI(c,f,v,S){return $i(c,function(P,A,L){f(S,P,v(P),L)}),S}function y1(c,f){return c&&ho(f,hn(f),c)}function qI(c,f){return c&&ho(f,qn(f),c)}function Uo(c,f,v){f=="__proto__"&&cf?cf(c,f,{configurable:!0,enumerable:!0,value:v,writable:!0}):c[f]=v}function dm(c,f){for(var v=-1,S=f.length,P=se(S),A=c==null;++v<S;)P[v]=A?n:Um(c,f[v]);return P}function Is(c,f,v){return c===c&&(v!==n&&(c=c<=v?c:v),f!==n&&(c=c>=f?c:f)),c}function Tr(c,f,v,S,P,A){var L,z=f&h,K=f&p,he=f&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=Ik(c),!z)return Wn(c,L)}else{var ye=Pn(c),$e=ye==H||ye==De;if(Di(c))return H1(c,z);if(ye==gt||ye==ge||$e&&!P){if(L=K||$e?{}:l_(c),!z)return K?Sk(c,qI(L,c)):_k(c,y1(L,c))}else{if(!Dt[ye])return P?c:{};L=kk(c,ye,z)}}A||(A=new Xr);var Ae=A.get(c);if(Ae)return Ae;A.set(c,L),L_(c)?c.forEach(function(ze){L.add(Tr(ze,f,v,ze,c,A))}):k_(c)&&c.forEach(function(ze,ct){L.set(ct,Tr(ze,f,v,ct,c,A))});var Fe=he?K?Dm:Mm:K?qn:hn,tt=pe?n:Fe(c);return Or(tt||c,function(ze,ct){tt&&(ct=ze,ze=c[ct]),kc(L,ct,Tr(ze,f,v,ct,c,A))}),L}function GI(c){var f=hn(c);return function(v){return x1(v,c,f)}}function x1(c,f,v){var S=v.length;if(c==null)return!S;for(c=Mt(c);S--;){var P=v[S],A=f[P],L=c[P];if(L===n&&!(P in c)||!A(L))return!1}return!0}function w1(c,f,v){if(typeof c!="function")throw new Mr(s);return Bc(function(){c.apply(n,v)},f)}function Nc(c,f,v,S){var P=-1,A=Qd,L=!0,z=c.length,K=[],he=f.length;if(!z)return K;v&&(f=Ht(f,ir(v))),S?(A=Qg,L=!1):f.length>=o&&(A=Oc,L=!1,f=new As(f));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(f[$e]===ye)continue e;K.push(pe)}else A(f,ye,S)||K.push(pe)}return K}var $i=Y1(fo),_1=Y1(hm,!0);function YI(c,f){var v=!0;return $i(c,function(S,P,A){return v=!!f(S,P,A),v}),v}function mf(c,f,v){for(var S=-1,P=c.length;++S<P;){var A=c[S],L=f(A);if(L!=null&&(z===n?L===L&&!ar(L):v(L,z)))var z=L,K=A}return K}function KI(c,f,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:z_(S);v<S;)c[v++]=f;return c}function S1(c,f){var v=[];return $i(c,function(S,P,A){f(S,P,A)&&v.push(S)}),v}function yn(c,f,v,S,P){var A=-1,L=c.length;for(v||(v=Lk),P||(P=[]);++A<L;){var z=c[A];f>0&&v(z)?f>1?yn(z,f-1,v,S,P):Ci(P,z):S||(P[P.length]=z)}return P}var fm=K1(),C1=K1(!0);function fo(c,f){return c&&fm(c,f,hn)}function hm(c,f){return c&&C1(c,f,hn)}function vf(c,f){return Si(f,function(v){return Ko(c[v])})}function ks(c,f){f=Oi(f,c);for(var v=0,S=f.length;c!=null&&v<S;)c=c[po(f[v++])];return v&&v==S?c:n}function E1(c,f,v){var S=f(c);return Ye(c)?S:Ci(S,v(c))}function Ln(c){return c==null?c===n?_c:qe:Ds&&Ds in Mt(c)?Dk(c):Wk(c)}function pm(c,f){return c>f}function XI(c,f){return c!=null&&Et.call(c,f)}function QI(c,f){return c!=null&&f in Mt(c)}function ZI(c,f,v){return c>=$n(f,v)&&c<sn(f,v)}function gm(c,f,v){for(var S=v?Qg:Qd,P=c[0].length,A=c.length,L=A,z=se(A),K=1/0,he=[];L--;){var pe=c[L];L&&f&&(pe=Ht(pe,ir(f))),K=$n(pe.length,K),z[L]=!v&&(f||P>=120&&pe.length>=120)?new As(L&&pe):n}pe=c[0];var ye=-1,$e=z[0];e:for(;++ye<P&&he.length<K;){var Ae=pe[ye],Fe=f?f(Ae):Ae;if(Ae=v||Ae!==0?Ae:0,!($e?Oc($e,Fe):S(he,Fe,v))){for(L=A;--L;){var tt=z[L];if(!(tt?Oc(tt,Fe):S(c[L],Fe,v)))continue e}$e&&$e.push(Fe),he.push(Ae)}}return he}function JI(c,f,v,S){return fo(c,function(P,A,L){f(S,v(P),A,L)}),S}function Lc(c,f,v){f=Oi(f,c),c=f_(c,f);var S=c==null?c:c[po(Ir(f))];return S==null?n:or(S,c,v)}function R1(c){return Yt(c)&&Ln(c)==ge}function ek(c){return Yt(c)&&Ln(c)==vn}function tk(c){return Yt(c)&&Ln(c)==X}function Fc(c,f,v,S,P){return c===f?!0:c==null||f==null||!Yt(c)&&!Yt(f)?c!==c&&f!==f:nk(c,f,v,S,Fc,P)}function nk(c,f,v,S,P,A){var L=Ye(c),z=Ye(f),K=L?ve:Pn(c),he=z?ve:Pn(f);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(f))return!1;L=!0,pe=!1}if($e&&!pe)return A||(A=new Xr),L||el(c)?i_(c,f,v,S,P,A):Ok(c,f,K,v,S,P,A);if(!(v&b)){var Ae=pe&&Et.call(c,"__wrapped__"),Fe=ye&&Et.call(f,"__wrapped__");if(Ae||Fe){var tt=Ae?c.value():c,ze=Fe?f.value():f;return A||(A=new Xr),P(tt,ze,v,S,A)}}return $e?(A||(A=new Xr),Mk(c,f,v,S,P,A)):!1}function rk(c){return Yt(c)&&Pn(c)==Ne}function mm(c,f,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,f,ye);if(!($e===n?Fc(pe,he,b|y,S,ye):$e))return!1}}return!0}function $1(c){if(!Ut(c)||zk(c))return!1;var f=Ko(c)?rI:mt;return f.test(Ls(c))}function ok(c){return Yt(c)&&Ln(c)==Gt}function ik(c){return Yt(c)&&Pn(c)==Wt}function sk(c){return Yt(c)&&If(c.length)&&!!It[Ln(c)]}function P1(c){return typeof c=="function"?c:c==null?Gn:typeof c=="object"?Ye(c)?D1(c[0],c[1]):M1(c):X_(c)}function vm(c){if(!Vc(c))return cI(c);var f=[];for(var v in Mt(c))Et.call(c,v)&&v!="constructor"&&f.push(v);return f}function ak(c){if(!Ut(c))return Hk(c);var f=Vc(c),v=[];for(var S in c)S=="constructor"&&(f||!Et.call(c,S))||v.push(S);return v}function bm(c,f){return c<f}function O1(c,f){var v=-1,S=Un(c)?se(c.length):[];return $i(c,function(P,A,L){S[++v]=f(P,A,L)}),S}function M1(c){var f=Am(c);return f.length==1&&f[0][2]?u_(f[0][0],f[0][1]):function(v){return v===c||mm(v,c,f)}}function D1(c,f){return km(c)&&c_(f)?u_(po(c),f):function(v){var S=Um(v,c);return S===n&&S===f?qm(v,c):Fc(f,S,b|y)}}function bf(c,f,v,S,P){c!==f&&fm(f,function(A,L){if(P||(P=new Xr),Ut(A))lk(c,f,L,v,bf,S,P);else{var z=S?S(Lm(c,L),A,L+"",c,f,P):n;z===n&&(z=A),um(c,L,z)}},qn)}function lk(c,f,v,S,P,A,L){var z=Lm(c,v),K=Lm(f,v),he=L.get(K);if(he){um(c,v,he);return}var pe=A?A(z,K,v+"",c,f,L):n,ye=pe===n;if(ye){var $e=Ye(K),Ae=!$e&&Di(K),Fe=!$e&&!Ae&&el(K);pe=K,$e||Ae||Fe?Ye(z)?pe=z:Zt(z)?pe=Wn(z):Ae?(ye=!1,pe=H1(K,!0)):Fe?(ye=!1,pe=W1(K,!0)):pe=[]:Hc(K)||Fs(K)?(pe=z,Fs(z)?pe=j_(z):(!Ut(z)||Ko(z))&&(pe=l_(K))):ye=!1}ye&&(L.set(K,pe),P(pe,K,S,A,L),L.delete(K)),um(c,v,pe)}function T1(c,f){var v=c.length;if(v)return f+=f<0?v:0,Yo(f,v)?c[f]:n}function A1(c,f,v){f.length?f=Ht(f,function(A){return Ye(A)?function(L){return ks(L,A.length===1?A[0]:A)}:A}):f=[Gn];var S=-1;f=Ht(f,ir(Le()));var P=O1(c,function(A,L,z){var K=Ht(f,function(he){return he(A)});return{criteria:K,index:++S,value:A}});return k5(P,function(A,L){return wk(A,L,v)})}function ck(c,f){return I1(c,f,function(v,S){return qm(c,S)})}function I1(c,f,v){for(var S=-1,P=f.length,A={};++S<P;){var L=f[S],z=ks(c,L);v(z,L)&&zc(A,Oi(L,c),z)}return A}function uk(c){return function(f){return ks(f,c)}}function ym(c,f,v,S){var P=S?I5:Ha,A=-1,L=f.length,z=c;for(c===f&&(f=Wn(f)),v&&(z=Ht(c,ir(v)));++A<L;)for(var K=0,he=f[A],pe=v?v(he):he;(K=P(z,pe,K,S))>-1;)z!==c&&lf.call(z,K,1),lf.call(c,K,1);return c}function k1(c,f){for(var v=c?f.length:0,S=v-1;v--;){var P=f[v];if(v==S||P!==A){var A=P;Yo(P)?lf.call(c,P,1):Sm(c,P)}}return c}function xm(c,f){return c+df(g1()*(f-c+1))}function dk(c,f,v,S){for(var P=-1,A=sn(uf((f-c)/(v||1)),0),L=se(A);A--;)L[S?A:++P]=c,c+=v;return L}function wm(c,f){var v="";if(!c||f<1||f>Q)return v;do f%2&&(v+=c),f=df(f/2),f&&(c+=c);while(f);return v}function ot(c,f){return Fm(d_(c,f,Gn),c+"")}function fk(c){return b1(tl(c))}function hk(c,f){var v=tl(c);return Pf(v,Is(f,0,v.length))}function zc(c,f,v,S){if(!Ut(c))return c;f=Oi(f,c);for(var P=-1,A=f.length,L=A-1,z=c;z!=null&&++P<A;){var K=po(f[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(f[P+1])?[]:{})}kc(z,K,he),z=z[K]}return c}var N1=ff?function(c,f){return ff.set(c,f),c}:Gn,pk=cf?function(c,f){return cf(c,"toString",{configurable:!0,enumerable:!1,value:Ym(f),writable:!0})}:Gn;function gk(c){return Pf(tl(c))}function Ar(c,f,v){var S=-1,P=c.length;f<0&&(f=-f>P?0:P+f),v=v>P?P:v,v<0&&(v+=P),P=f>v?0:v-f>>>0,f>>>=0;for(var A=se(P);++S<P;)A[S]=c[S+f];return A}function mk(c,f){var v;return $i(c,function(S,P,A){return v=f(S,P,A),!v}),!!v}function yf(c,f,v){var S=0,P=c==null?S:c.length;if(typeof f=="number"&&f===f&&P<=ce){for(;S<P;){var A=S+P>>>1,L=c[A];L!==null&&!ar(L)&&(v?L<=f:L<f)?S=A+1:P=A}return P}return _m(c,f,Gn,v)}function _m(c,f,v,S){var P=0,A=c==null?0:c.length;if(A===0)return 0;f=v(f);for(var L=f!==f,z=f===null,K=ar(f),he=f===n;P<A;){var pe=df((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<=f:ye<f;ze?P=pe+1:A=pe}return $n(A,te)}function L1(c,f){for(var v=-1,S=c.length,P=0,A=[];++v<S;){var L=c[v],z=f?f(L):L;if(!v||!Qr(z,K)){var K=z;A[P++]=L===0?0:L}}return A}function F1(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 m1?m1.call(c):"";var f=c+"";return f=="0"&&1/c==-Y?"-0":f}function Pi(c,f,v){var S=-1,P=Qd,A=c.length,L=!0,z=[],K=z;if(v)L=!1,P=Qg;else if(A>=o){var he=f?null:$k(c);if(he)return Jd(he);L=!1,P=Oc,K=new As}else K=f?[]:z;e:for(;++S<A;){var pe=c[S],ye=f?f(pe):pe;if(pe=v||pe!==0?pe:0,L&&ye===ye){for(var $e=K.length;$e--;)if(K[$e]===ye)continue e;f&&K.push(ye),z.push(pe)}else P(K,ye,v)||(K!==z&&K.push(ye),z.push(pe))}return z}function Sm(c,f){return f=Oi(f,c),c=f_(c,f),c==null||delete c[po(Ir(f))]}function z1(c,f,v,S){return zc(c,f,v(ks(c,f)),S)}function xf(c,f,v,S){for(var P=c.length,A=S?P:-1;(S?A--:++A<P)&&f(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 j1(c,f){var v=c;return v instanceof dt&&(v=v.value()),Zg(f,function(S,P){return P.func.apply(P.thisArg,Ci([S],P.args))},v)}function Cm(c,f,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]=Nc(A[P]||L,c[z],f,v));return Pi(yn(A,1),f,v)}function V1(c,f,v){for(var S=-1,P=c.length,A=f.length,L={};++S<P;){var z=S<A?f[S]:n;v(L,c[S],z)}return L}function Em(c){return Zt(c)?c:[]}function Rm(c){return typeof c=="function"?c:Gn}function Oi(c,f){return Ye(c)?c:km(c,f)?[c]:m_(wt(c))}var vk=ot;function Mi(c,f,v){var S=c.length;return v=v===n?S:v,!f&&v>=S?c:Ar(c,f,v)}var B1=oI||function(c){return bn.clearTimeout(c)};function H1(c,f){if(f)return c.slice();var v=c.length,S=u1?u1(v):new c.constructor(v);return c.copy(S),S}function $m(c){var f=new c.constructor(c.byteLength);return new sf(f).set(new sf(c)),f}function bk(c,f){var v=f?$m(c.buffer):c.buffer;return new c.constructor(v,c.byteOffset,c.byteLength)}function yk(c){var f=new c.constructor(c.source,Ie.exec(c));return f.lastIndex=c.lastIndex,f}function xk(c){return Ic?Mt(Ic.call(c)):{}}function W1(c,f){var v=f?$m(c.buffer):c.buffer;return new c.constructor(v,c.byteOffset,c.length)}function U1(c,f){if(c!==f){var v=c!==n,S=c===null,P=c===c,A=ar(c),L=f!==n,z=f===null,K=f===f,he=ar(f);if(!z&&!he&&!A&&c>f||A&&L&&K&&!z&&!he||S&&L&&K||!v&&K||!P)return 1;if(!S&&!A&&!he&&c<f||he&&v&&P&&!S&&!A||z&&v&&P||!L&&P||!K)return-1}return 0}function wk(c,f,v){for(var S=-1,P=c.criteria,A=f.criteria,L=P.length,z=v.length;++S<L;){var K=U1(P[S],A[S]);if(K){if(S>=z)return K;var he=v[S];return K*(he=="desc"?-1:1)}}return c.index-f.index}function q1(c,f,v,S){for(var P=-1,A=c.length,L=v.length,z=-1,K=f.length,he=sn(A-L,0),pe=se(K+he),ye=!S;++z<K;)pe[z]=f[z];for(;++P<L;)(ye||P<A)&&(pe[v[P]]=c[P]);for(;he--;)pe[z++]=c[P++];return pe}function G1(c,f,v,S){for(var P=-1,A=c.length,L=-1,z=v.length,K=-1,he=f.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]=f[K];for(;++L<z;)($e||P<A)&&(ye[Ae+v[L]]=c[P++]);return ye}function Wn(c,f){var v=-1,S=c.length;for(f||(f=se(S));++v<S;)f[v]=c[v];return f}function ho(c,f,v,S){var P=!v;v||(v={});for(var A=-1,L=f.length;++A<L;){var z=f[A],K=S?S(v[z],c[z],z,v,c):n;K===n&&(K=c[z]),P?Uo(v,z,K):kc(v,z,K)}return v}function _k(c,f){return ho(c,Im(c),f)}function Sk(c,f){return ho(c,s_(c),f)}function wf(c,f){return function(v,S){var P=Ye(v)?P5:UI,A=f?f():{};return P(v,c,Le(S,2),A)}}function Qa(c){return ot(function(f,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),f=Mt(f);++S<P;){var z=v[S];z&&c(f,z,S,A)}return f})}function Y1(c,f){return function(v,S){if(v==null)return v;if(!Un(v))return c(v,S);for(var P=v.length,A=f?P:-1,L=Mt(v);(f?A--:++A<P)&&S(L[A],A,L)!==!1;);return v}}function K1(c){return function(f,v,S){for(var P=-1,A=Mt(f),L=S(f),z=L.length;z--;){var K=L[c?z:++P];if(v(A[K],K,A)===!1)break}return f}}function Ck(c,f,v){var S=f&x,P=jc(c);function A(){var L=this&&this!==bn&&this instanceof A?P:c;return L.apply(S?v:this,arguments)}return A}function X1(c){return function(f){f=wt(f);var v=Wa(f)?Kr(f):n,S=v?v[0]:f.charAt(0),P=v?Mi(v,1).join(""):f.slice(1);return S[c]()+P}}function Za(c){return function(f){return Zg(Y_(G_(f).replace(p5,"")),c,"")}}function jc(c){return function(){var f=arguments;switch(f.length){case 0:return new c;case 1:return new c(f[0]);case 2:return new c(f[0],f[1]);case 3:return new c(f[0],f[1],f[2]);case 4:return new c(f[0],f[1],f[2],f[3]);case 5:return new c(f[0],f[1],f[2],f[3],f[4]);case 6:return new c(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new c(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var v=Xa(c.prototype),S=c.apply(v,f);return Ut(S)?S:v}}function Ek(c,f,v){var S=jc(c);function P(){for(var A=arguments.length,L=se(A),z=A,K=Ja(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 t_(c,f,_f,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 Q1(c){return function(f,v,S){var P=Mt(f);if(!Un(f)){var A=Le(v,3);f=hn(f),v=function(z){return A(P[z],z,P)}}var L=c(f,v,S);return L>-1?P[A?f[L]:L]:n}}function Z1(c){return Go(function(f){var v=f.length,S=v,P=Dr.prototype.thru;for(c&&f.reverse();S--;){var A=f[S];if(typeof A!="function")throw new Mr(s);if(P&&!L&&Rf(A)=="wrapper")var L=new Dr([],!0)}for(S=L?S:v;++S<v;){A=f[S];var z=Rf(A),K=z=="wrapper"?Tm(A):n;K&&Nm(K[0])&&K[1]==(O|C|E|D)&&!K[4].length&&K[9]==1?L=L[Rf(K[0])].apply(L,K[3]):L=A.length==1&&Nm(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?f[ye].apply(this,he):pe;++ye<v;)$e=f[ye].call(this,$e);return $e}})}function _f(c,f,v,S,P,A,L,z,K,he){var pe=f&O,ye=f&x,$e=f&_,Ae=f&(C|R),Fe=f&I,tt=$e?n:jc(c);function ze(){for(var ct=arguments.length,pt=se(ct),lr=ct;lr--;)pt[lr]=arguments[lr];if(Ae)var zn=Ja(ze),cr=L5(pt,zn);if(S&&(pt=q1(pt,S,P,Ae)),A&&(pt=G1(pt,A,L,Ae)),ct-=cr,Ae&&ct<he){var Jt=Ei(pt,zn);return t_(c,f,_f,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=Uk(pt,z):Fe&&ct>1&&pt.reverse(),pe&&K<ct&&(pt.length=K),this&&this!==bn&&this instanceof ze&&(Qo=tt||jc(Qo)),Qo.apply(Zr,pt)}return ze}function J1(c,f){return function(v,S){return JI(v,c,f(S),{})}}function Sf(c,f){return function(v,S){var P;if(v===n&&S===n)return f;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=F1(v),S=F1(S)),P=c(v,S)}return P}}function Pm(c){return Go(function(f){return f=Ht(f,ir(Le())),ot(function(v){var S=this;return c(f,function(P){return or(P,S,v)})})})}function Cf(c,f){f=f===n?" ":sr(f);var v=f.length;if(v<2)return v?wm(f,c):f;var S=wm(f,uf(c/Ua(f)));return Wa(f)?Mi(Kr(S),0,c).join(""):S.slice(0,c)}function Rk(c,f,v,S){var P=f&x,A=jc(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 e_(c){return function(f,v,S){return S&&typeof S!="number"&&Fn(f,v,S)&&(v=S=n),f=Xo(f),v===n?(v=f,f=0):v=Xo(v),S=S===n?f<v?1:-1:Xo(S),dk(f,v,S,c)}}function Ef(c){return function(f,v){return typeof f=="string"&&typeof v=="string"||(f=kr(f),v=kr(v)),c(f,v)}}function t_(c,f,v,S,P,A,L,z,K,he){var pe=f&C,ye=pe?L:n,$e=pe?n:L,Ae=pe?A:n,Fe=pe?n:A;f|=pe?E:T,f&=~(pe?T:E),f&w||(f&=~(x|_));var tt=[c,f,P,Ae,ye,Fe,$e,z,K,he],ze=v.apply(n,tt);return Nm(c)&&h_(ze,tt),ze.placeholder=S,p_(ze,c,f)}function Om(c){var f=on[c];return function(v,S){if(v=kr(v),S=S==null?0:$n(Ze(S),292),S&&p1(v)){var P=(wt(v)+"e").split("e"),A=f(P[0]+"e"+(+P[1]+S));return P=(wt(A)+"e").split("e"),+(P[0]+"e"+(+P[1]-S))}return f(v)}}var $k=Ya&&1/Jd(new Ya([,-0]))[1]==Y?function(c){return new Ya(c)}:Qm;function n_(c){return function(f){var v=Pn(f);return v==Ne?im(f):v==Wt?W5(f):N5(f,c(f))}}function qo(c,f,v,S,P,A,L,z){var K=f&_;if(!K&&typeof c!="function")throw new Mr(s);var he=S?S.length:0;if(he||(f&=~(E|T),S=P=n),L=L===n?L:sn(Ze(L),0),z=z===n?z:Ze(z),he-=P?P.length:0,f&T){var pe=S,ye=P;S=P=n}var $e=K?n:Tm(c),Ae=[c,f,v,S,P,pe,ye,A,L,z];if($e&&Bk(Ae,$e),c=Ae[0],f=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&&f&(C|R)&&(f&=~(C|R)),!f||f==x)var Fe=Ck(c,f,v);else f==C||f==R?Fe=Ek(c,f,z):(f==E||f==(x|E))&&!P.length?Fe=Rk(c,f,v,S):Fe=_f.apply(n,Ae);var tt=$e?N1:h_;return p_(tt(Fe,Ae),c,f)}function r_(c,f,v,S){return c===n||Qr(c,Ga[v])&&!Et.call(S,v)?f:c}function o_(c,f,v,S,P,A){return Ut(c)&&Ut(f)&&(A.set(f,c),bf(c,f,n,o_,A),A.delete(f)),c}function Pk(c){return Hc(c)?n:c}function i_(c,f,v,S,P,A){var L=v&b,z=c.length,K=f.length;if(z!=K&&!(L&&K>z))return!1;var he=A.get(c),pe=A.get(f);if(he&&pe)return he==f&&pe==c;var ye=-1,$e=!0,Ae=v&y?new As:n;for(A.set(c,f),A.set(f,c);++ye<z;){var Fe=c[ye],tt=f[ye];if(S)var ze=L?S(tt,Fe,ye,f,c,A):S(Fe,tt,ye,c,f,A);if(ze!==n){if(ze)continue;$e=!1;break}if(Ae){if(!Jg(f,function(ct,pt){if(!Oc(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(f),$e}function Ok(c,f,v,S,P,A,L){switch(v){case co:if(c.byteLength!=f.byteLength||c.byteOffset!=f.byteOffset)return!1;c=c.buffer,f=f.buffer;case vn:return!(c.byteLength!=f.byteLength||!A(new sf(c),new sf(f)));case J:case X:case Ve:return Qr(+c,+f);case be:return c.name==f.name&&c.message==f.message;case Gt:case En:return c==f+"";case Ne:var z=im;case Wt:var K=S&b;if(z||(z=Jd),c.size!=f.size&&!K)return!1;var he=L.get(c);if(he)return he==f;S|=y,L.set(c,f);var pe=i_(z(c),z(f),S,P,A,L);return L.delete(c),pe;case rn:if(Ic)return Ic.call(c)==Ic.call(f)}return!1}function Mk(c,f,v,S,P,A){var L=v&b,z=Mm(c),K=z.length,he=Mm(f),pe=he.length;if(K!=pe&&!L)return!1;for(var ye=K;ye--;){var $e=z[ye];if(!(L?$e in f:Et.call(f,$e)))return!1}var Ae=A.get(c),Fe=A.get(f);if(Ae&&Fe)return Ae==f&&Fe==c;var tt=!0;A.set(c,f),A.set(f,c);for(var ze=L;++ye<K;){$e=z[ye];var ct=c[$e],pt=f[$e];if(S)var lr=L?S(pt,ct,$e,f,c,A):S(ct,pt,$e,c,f,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=f.constructor;zn!=cr&&"constructor"in c&&"constructor"in f&&!(typeof zn=="function"&&zn instanceof zn&&typeof cr=="function"&&cr instanceof cr)&&(tt=!1)}return A.delete(c),A.delete(f),tt}function Go(c){return Fm(d_(c,n,x_),c+"")}function Mm(c){return E1(c,hn,Im)}function Dm(c){return E1(c,qn,s_)}var Tm=ff?function(c){return ff.get(c)}:Qm;function Rf(c){for(var f=c.name+"",v=Ka[f],S=Et.call(Ka,f)?v.length:0;S--;){var P=v[S],A=P.func;if(A==null||A==c)return P.name}return f}function Ja(c){var f=Et.call(M,"placeholder")?M:c;return f.placeholder}function Le(){var c=M.iteratee||Km;return c=c===Km?P1:c,arguments.length?c(arguments[0],arguments[1]):c}function $f(c,f){var v=c.__data__;return Fk(f)?v[typeof f=="string"?"string":"hash"]:v.map}function Am(c){for(var f=hn(c),v=f.length;v--;){var S=f[v],P=c[S];f[v]=[S,P,c_(P)]}return f}function Ns(c,f){var v=V5(c,f);return $1(v)?v:n}function Dk(c){var f=Et.call(c,Ds),v=c[Ds];try{c[Ds]=n;var S=!0}catch{}var P=rf.call(c);return S&&(f?c[Ds]=v:delete c[Ds]),P}var Im=am?function(c){return c==null?[]:(c=Mt(c),Si(am(c),function(f){return f1.call(c,f)}))}:Zm,s_=am?function(c){for(var f=[];c;)Ci(f,Im(c)),c=af(c);return f}:Zm,Pn=Ln;(lm&&Pn(new lm(new ArrayBuffer(1)))!=co||Dc&&Pn(new Dc)!=Ne||cm&&Pn(cm.resolve())!=ft||Ya&&Pn(new Ya)!=Wt||Tc&&Pn(new Tc)!=Gr)&&(Pn=function(c){var f=Ln(c),v=f==gt?c.constructor:n,S=v?Ls(v):"";if(S)switch(S){case hI:return co;case pI:return Ne;case gI:return ft;case mI:return Wt;case vI:return Gr}return f});function Tk(c,f,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":f-=L;break;case"take":f=$n(f,c+L);break;case"takeRight":c=sn(c,f-L);break}}return{start:c,end:f}}function Ak(c){var f=c.match(Pc);return f?f[1].split($):[]}function a_(c,f,v){f=Oi(f,c);for(var S=-1,P=f.length,A=!1;++S<P;){var L=po(f[S]);if(!(A=c!=null&&v(c,L)))break;c=c[L]}return A||++S!=P?A:(P=c==null?0:c.length,!!P&&If(P)&&Yo(L,P)&&(Ye(c)||Fs(c)))}function Ik(c){var f=c.length,v=new c.constructor(f);return f&&typeof c[0]=="string"&&Et.call(c,"index")&&(v.index=c.index,v.input=c.input),v}function l_(c){return typeof c.constructor=="function"&&!Vc(c)?Xa(af(c)):{}}function kk(c,f,v){var S=c.constructor;switch(f){case vn:return $m(c);case J:case X:return new S(+c);case co:return bk(c,v);case zo:case jo:case Yr:case gs:case ms:case vs:case bs:case ys:case xs:return W1(c,v);case Ne:return new S;case Ve:case En:return new S(c);case Gt:return yk(c);case Wt:return new S;case rn:return xk(c)}}function Nk(c,f){var v=f.length;if(!v)return c;var S=v-1;return f[S]=(v>1?"& ":"")+f[S],f=f.join(v>2?", ":" "),c.replace($c,`{
|
|
70
|
+
/* [wrapped with `+f+`] */
|
|
71
|
+
`)}function Lk(c){return Ye(c)||Fs(c)||!!(h1&&c&&c[h1])}function Yo(c,f){var v=typeof c;return f=f??Q,!!f&&(v=="number"||v!="symbol"&&Ge.test(c))&&c>-1&&c%1==0&&c<f}function Fn(c,f,v){if(!Ut(v))return!1;var S=typeof f;return(S=="number"?Un(v)&&Yo(f,v.length):S=="string"&&f in v)?Qr(v[f],c):!1}function km(c,f){if(Ye(c))return!1;var v=typeof c;return v=="number"||v=="symbol"||v=="boolean"||c==null||ar(c)?!0:Es.test(c)||!Cs.test(c)||f!=null&&c in Mt(f)}function Fk(c){var f=typeof c;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?c!=="__proto__":c===null}function Nm(c){var f=Rf(c),v=M[f];if(typeof v!="function"||!(f in dt.prototype))return!1;if(c===v)return!0;var S=Tm(v);return!!S&&c===S[0]}function zk(c){return!!c1&&c1 in c}var jk=tf?Ko:Jm;function Vc(c){var f=c&&c.constructor,v=typeof f=="function"&&f.prototype||Ga;return c===v}function c_(c){return c===c&&!Ut(c)}function u_(c,f){return function(v){return v==null?!1:v[c]===f&&(f!==n||c in Mt(v))}}function Vk(c){var f=Tf(c,function(S){return v.size===u&&v.clear(),S}),v=f.cache;return f}function Bk(c,f){var v=c[1],S=f[1],P=v|S,A=P<(x|_|O),L=S==O&&v==C||S==O&&v==D&&c[7].length<=f[8]||S==(O|D)&&f[7].length<=f[8]&&v==C;if(!(A||L))return c;S&x&&(c[2]=f[2],P|=v&x?0:w);var z=f[3];if(z){var K=c[3];c[3]=K?q1(K,z,f[4]):z,c[4]=K?Ei(c[3],d):f[4]}return z=f[5],z&&(K=c[5],c[5]=K?G1(K,z,f[6]):z,c[6]=K?Ei(c[5],d):f[6]),z=f[7],z&&(c[7]=z),S&O&&(c[8]=c[8]==null?f[8]:$n(c[8],f[8])),c[9]==null&&(c[9]=f[9]),c[0]=f[0],c[1]=P,c}function Hk(c){var f=[];if(c!=null)for(var v in Mt(c))f.push(v);return f}function Wk(c){return rf.call(c)}function d_(c,f,v){return f=sn(f===n?c.length-1:f,0),function(){for(var S=arguments,P=-1,A=sn(S.length-f,0),L=se(A);++P<A;)L[P]=S[f+P];P=-1;for(var z=se(f+1);++P<f;)z[P]=S[P];return z[f]=v(L),or(c,this,z)}}function f_(c,f){return f.length<2?c:ks(c,Ar(f,0,-1))}function Uk(c,f){for(var v=c.length,S=$n(f.length,v),P=Wn(c);S--;){var A=f[S];c[S]=Yo(A,v)?P[A]:n}return c}function Lm(c,f){if(!(f==="constructor"&&typeof c[f]=="function")&&f!="__proto__")return c[f]}var h_=g_(N1),Bc=sI||function(c,f){return bn.setTimeout(c,f)},Fm=g_(pk);function p_(c,f,v){var S=f+"";return Fm(c,Nk(S,qk(Ak(S),v)))}function g_(c){var f=0,v=0;return function(){var S=uI(),P=le-(S-v);if(v=S,P>0){if(++f>=G)return arguments[0]}else f=0;return c.apply(n,arguments)}}function Pf(c,f){var v=-1,S=c.length,P=S-1;for(f=f===n?S:f;++v<f;){var A=xm(v,P),L=c[A];c[A]=c[v],c[v]=L}return c.length=f,c}var m_=Vk(function(c){var f=[];return c.charCodeAt(0)===46&&f.push(""),c.replace(Ec,function(v,S,P,A){f.push(P?A.replace(xe,"$1"):S||v)}),f});function po(c){if(typeof c=="string"||ar(c))return c;var f=c+"";return f=="0"&&1/c==-Y?"-0":f}function Ls(c){if(c!=null){try{return nf.call(c)}catch{}try{return c+""}catch{}}return""}function qk(c,f){return Or(ue,function(v){var S="_."+v[0];f&v[1]&&!Qd(c,S)&&c.push(S)}),c.sort()}function v_(c){if(c instanceof dt)return c.clone();var f=new Dr(c.__wrapped__,c.__chain__);return f.__actions__=Wn(c.__actions__),f.__index__=c.__index__,f.__values__=c.__values__,f}function Gk(c,f,v){(v?Fn(c,f,v):f===n)?f=1:f=sn(Ze(f),0);var S=c==null?0:c.length;if(!S||f<1)return[];for(var P=0,A=0,L=se(uf(S/f));P<S;)L[A++]=Ar(c,P,P+=f);return L}function Yk(c){for(var f=-1,v=c==null?0:c.length,S=0,P=[];++f<v;){var A=c[f];A&&(P[S++]=A)}return P}function Kk(){var c=arguments.length;if(!c)return[];for(var f=se(c-1),v=arguments[0],S=c;S--;)f[S-1]=arguments[S];return Ci(Ye(v)?Wn(v):[v],yn(f,1))}var Xk=ot(function(c,f){return Zt(c)?Nc(c,yn(f,1,Zt,!0)):[]}),Qk=ot(function(c,f){var v=Ir(f);return Zt(v)&&(v=n),Zt(c)?Nc(c,yn(f,1,Zt,!0),Le(v,2)):[]}),Zk=ot(function(c,f){var v=Ir(f);return Zt(v)&&(v=n),Zt(c)?Nc(c,yn(f,1,Zt,!0),n,v):[]});function Jk(c,f,v){var S=c==null?0:c.length;return S?(f=v||f===n?1:Ze(f),Ar(c,f<0?0:f,S)):[]}function e7(c,f,v){var S=c==null?0:c.length;return S?(f=v||f===n?1:Ze(f),f=S-f,Ar(c,0,f<0?0:f)):[]}function t7(c,f){return c&&c.length?xf(c,Le(f,3),!0,!0):[]}function n7(c,f){return c&&c.length?xf(c,Le(f,3),!0):[]}function r7(c,f,v,S){var P=c==null?0:c.length;return P?(v&&typeof v!="number"&&Fn(c,f,v)&&(v=0,S=P),KI(c,f,v,S)):[]}function b_(c,f,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)),Zd(c,Le(f,3),P)}function y_(c,f,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)),Zd(c,Le(f,3),P,!0)}function x_(c){var f=c==null?0:c.length;return f?yn(c,1):[]}function o7(c){var f=c==null?0:c.length;return f?yn(c,Y):[]}function i7(c,f){var v=c==null?0:c.length;return v?(f=f===n?1:Ze(f),yn(c,f)):[]}function s7(c){for(var f=-1,v=c==null?0:c.length,S={};++f<v;){var P=c[f];S[P[0]]=P[1]}return S}function w_(c){return c&&c.length?c[0]:n}function a7(c,f,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)),Ha(c,f,P)}function l7(c){var f=c==null?0:c.length;return f?Ar(c,0,-1):[]}var c7=ot(function(c){var f=Ht(c,Em);return f.length&&f[0]===c[0]?gm(f):[]}),u7=ot(function(c){var f=Ir(c),v=Ht(c,Em);return f===Ir(v)?f=n:v.pop(),v.length&&v[0]===c[0]?gm(v,Le(f,2)):[]}),d7=ot(function(c){var f=Ir(c),v=Ht(c,Em);return f=typeof f=="function"?f:n,f&&v.pop(),v.length&&v[0]===c[0]?gm(v,n,f):[]});function f7(c,f){return c==null?"":lI.call(c,f)}function Ir(c){var f=c==null?0:c.length;return f?c[f-1]:n}function h7(c,f,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)),f===f?q5(c,f,P):Zd(c,t1,P,!0)}function p7(c,f){return c&&c.length?T1(c,Ze(f)):n}var g7=ot(__);function __(c,f){return c&&c.length&&f&&f.length?ym(c,f):c}function m7(c,f,v){return c&&c.length&&f&&f.length?ym(c,f,Le(v,2)):c}function v7(c,f,v){return c&&c.length&&f&&f.length?ym(c,f,n,v):c}var b7=Go(function(c,f){var v=c==null?0:c.length,S=dm(c,f);return k1(c,Ht(f,function(P){return Yo(P,v)?+P:P}).sort(U1)),S});function y7(c,f){var v=[];if(!(c&&c.length))return v;var S=-1,P=[],A=c.length;for(f=Le(f,3);++S<A;){var L=c[S];f(L,S,c)&&(v.push(L),P.push(S))}return k1(c,P),v}function zm(c){return c==null?c:fI.call(c)}function x7(c,f,v){var S=c==null?0:c.length;return S?(v&&typeof v!="number"&&Fn(c,f,v)?(f=0,v=S):(f=f==null?0:Ze(f),v=v===n?S:Ze(v)),Ar(c,f,v)):[]}function w7(c,f){return yf(c,f)}function _7(c,f,v){return _m(c,f,Le(v,2))}function S7(c,f){var v=c==null?0:c.length;if(v){var S=yf(c,f);if(S<v&&Qr(c[S],f))return S}return-1}function C7(c,f){return yf(c,f,!0)}function E7(c,f,v){return _m(c,f,Le(v,2),!0)}function R7(c,f){var v=c==null?0:c.length;if(v){var S=yf(c,f,!0)-1;if(Qr(c[S],f))return S}return-1}function $7(c){return c&&c.length?L1(c):[]}function P7(c,f){return c&&c.length?L1(c,Le(f,2)):[]}function O7(c){var f=c==null?0:c.length;return f?Ar(c,1,f):[]}function M7(c,f,v){return c&&c.length?(f=v||f===n?1:Ze(f),Ar(c,0,f<0?0:f)):[]}function D7(c,f,v){var S=c==null?0:c.length;return S?(f=v||f===n?1:Ze(f),f=S-f,Ar(c,f<0?0:f,S)):[]}function T7(c,f){return c&&c.length?xf(c,Le(f,3),!1,!0):[]}function A7(c,f){return c&&c.length?xf(c,Le(f,3)):[]}var I7=ot(function(c){return Pi(yn(c,1,Zt,!0))}),k7=ot(function(c){var f=Ir(c);return Zt(f)&&(f=n),Pi(yn(c,1,Zt,!0),Le(f,2))}),N7=ot(function(c){var f=Ir(c);return f=typeof f=="function"?f:n,Pi(yn(c,1,Zt,!0),n,f)});function L7(c){return c&&c.length?Pi(c):[]}function F7(c,f){return c&&c.length?Pi(c,Le(f,2)):[]}function z7(c,f){return f=typeof f=="function"?f:n,c&&c.length?Pi(c,n,f):[]}function jm(c){if(!(c&&c.length))return[];var f=0;return c=Si(c,function(v){if(Zt(v))return f=sn(v.length,f),!0}),rm(f,function(v){return Ht(c,em(v))})}function S_(c,f){if(!(c&&c.length))return[];var v=jm(c);return f==null?v:Ht(v,function(S){return or(f,n,S)})}var j7=ot(function(c,f){return Zt(c)?Nc(c,f):[]}),V7=ot(function(c){return Cm(Si(c,Zt))}),B7=ot(function(c){var f=Ir(c);return Zt(f)&&(f=n),Cm(Si(c,Zt),Le(f,2))}),H7=ot(function(c){var f=Ir(c);return f=typeof f=="function"?f:n,Cm(Si(c,Zt),n,f)}),W7=ot(jm);function U7(c,f){return V1(c||[],f||[],kc)}function q7(c,f){return V1(c||[],f||[],zc)}var G7=ot(function(c){var f=c.length,v=f>1?c[f-1]:n;return v=typeof v=="function"?(c.pop(),v):n,S_(c,v)});function C_(c){var f=M(c);return f.__chain__=!0,f}function Y7(c,f){return f(c),c}function Of(c,f){return f(c)}var K7=Go(function(c){var f=c.length,v=f?c[0]:0,S=this.__wrapped__,P=function(A){return dm(A,c)};return f>1||this.__actions__.length||!(S instanceof dt)||!Yo(v)?this.thru(P):(S=S.slice(v,+v+(f?1:0)),S.__actions__.push({func:Of,args:[P],thisArg:n}),new Dr(S,this.__chain__).thru(function(A){return f&&!A.length&&A.push(n),A}))});function X7(){return C_(this)}function Q7(){return new Dr(this.value(),this.__chain__)}function Z7(){this.__values__===n&&(this.__values__=F_(this.value()));var c=this.__index__>=this.__values__.length,f=c?n:this.__values__[this.__index__++];return{done:c,value:f}}function J7(){return this}function e3(c){for(var f,v=this;v instanceof pf;){var S=v_(v);S.__index__=0,S.__values__=n,f?P.__wrapped__=S:f=S;var P=S;v=v.__wrapped__}return P.__wrapped__=c,f}function t3(){var c=this.__wrapped__;if(c instanceof dt){var f=c;return this.__actions__.length&&(f=new dt(this)),f=f.reverse(),f.__actions__.push({func:Of,args:[zm],thisArg:n}),new Dr(f,this.__chain__)}return this.thru(zm)}function n3(){return j1(this.__wrapped__,this.__actions__)}var r3=wf(function(c,f,v){Et.call(c,v)?++c[v]:Uo(c,v,1)});function o3(c,f,v){var S=Ye(c)?Jw:YI;return v&&Fn(c,f,v)&&(f=n),S(c,Le(f,3))}function i3(c,f){var v=Ye(c)?Si:S1;return v(c,Le(f,3))}var s3=Q1(b_),a3=Q1(y_);function l3(c,f){return yn(Mf(c,f),1)}function c3(c,f){return yn(Mf(c,f),Y)}function u3(c,f,v){return v=v===n?1:Ze(v),yn(Mf(c,f),v)}function E_(c,f){var v=Ye(c)?Or:$i;return v(c,Le(f,3))}function R_(c,f){var v=Ye(c)?O5:_1;return v(c,Le(f,3))}var d3=wf(function(c,f,v){Et.call(c,v)?c[v].push(f):Uo(c,v,[f])});function f3(c,f,v,S){c=Un(c)?c:tl(c),v=v&&!S?Ze(v):0;var P=c.length;return v<0&&(v=sn(P+v,0)),kf(c)?v<=P&&c.indexOf(f,v)>-1:!!P&&Ha(c,f,v)>-1}var h3=ot(function(c,f,v){var S=-1,P=typeof f=="function",A=Un(c)?se(c.length):[];return $i(c,function(L){A[++S]=P?or(f,L,v):Lc(L,f,v)}),A}),p3=wf(function(c,f,v){Uo(c,v,f)});function Mf(c,f){var v=Ye(c)?Ht:O1;return v(c,Le(f,3))}function g3(c,f,v,S){return c==null?[]:(Ye(f)||(f=f==null?[]:[f]),v=S?n:v,Ye(v)||(v=v==null?[]:[v]),A1(c,f,v))}var m3=wf(function(c,f,v){c[v?0:1].push(f)},function(){return[[],[]]});function v3(c,f,v){var S=Ye(c)?Zg:r1,P=arguments.length<3;return S(c,Le(f,4),v,P,$i)}function b3(c,f,v){var S=Ye(c)?M5:r1,P=arguments.length<3;return S(c,Le(f,4),v,P,_1)}function y3(c,f){var v=Ye(c)?Si:S1;return v(c,Af(Le(f,3)))}function x3(c){var f=Ye(c)?b1:fk;return f(c)}function w3(c,f,v){(v?Fn(c,f,v):f===n)?f=1:f=Ze(f);var S=Ye(c)?HI:hk;return S(c,f)}function _3(c){var f=Ye(c)?WI:gk;return f(c)}function S3(c){if(c==null)return 0;if(Un(c))return kf(c)?Ua(c):c.length;var f=Pn(c);return f==Ne||f==Wt?c.size:vm(c).length}function C3(c,f,v){var S=Ye(c)?Jg:mk;return v&&Fn(c,f,v)&&(f=n),S(c,Le(f,3))}var E3=ot(function(c,f){if(c==null)return[];var v=f.length;return v>1&&Fn(c,f[0],f[1])?f=[]:v>2&&Fn(f[0],f[1],f[2])&&(f=[f[0]]),A1(c,yn(f,1),[])}),Df=iI||function(){return bn.Date.now()};function R3(c,f){if(typeof f!="function")throw new Mr(s);return c=Ze(c),function(){if(--c<1)return f.apply(this,arguments)}}function $_(c,f,v){return f=v?n:f,f=c&&f==null?c.length:f,qo(c,O,n,n,n,n,f)}function P_(c,f){var v;if(typeof f!="function")throw new Mr(s);return c=Ze(c),function(){return--c>0&&(v=f.apply(this,arguments)),c<=1&&(f=n),v}}var Vm=ot(function(c,f,v){var S=x;if(v.length){var P=Ei(v,Ja(Vm));S|=E}return qo(c,S,f,v,P)}),O_=ot(function(c,f,v){var S=x|_;if(v.length){var P=Ei(v,Ja(O_));S|=E}return qo(f,S,c,v,P)});function M_(c,f,v){f=v?n:f;var S=qo(c,C,n,n,n,n,n,f);return S.placeholder=M_.placeholder,S}function D_(c,f,v){f=v?n:f;var S=qo(c,R,n,n,n,n,n,f);return S.placeholder=D_.placeholder,S}function T_(c,f,v){var S,P,A,L,z,K,he=0,pe=!1,ye=!1,$e=!0;if(typeof c!="function")throw new Mr(s);f=kr(f)||0,Ut(v)&&(pe=!!v.leading,ye="maxWait"in v,A=ye?sn(kr(v.maxWait)||0,f):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=Bc(ct,f),pe?Ae(Jt):L}function tt(Jt){var Zr=Jt-K,Qo=Jt-he,Q_=f-Zr;return ye?$n(Q_,A-Qo):Q_}function ze(Jt){var Zr=Jt-K,Qo=Jt-he;return K===n||Zr>=f||Zr<0||ye&&Qo>=A}function ct(){var Jt=Df();if(ze(Jt))return pt(Jt);z=Bc(ct,tt(Jt))}function pt(Jt){return z=n,$e&&S?Ae(Jt):(S=P=n,L)}function lr(){z!==n&&B1(z),he=0,S=K=P=z=n}function zn(){return z===n?L:pt(Df())}function cr(){var Jt=Df(),Zr=ze(Jt);if(S=arguments,P=this,K=Jt,Zr){if(z===n)return Fe(K);if(ye)return B1(z),z=Bc(ct,f),Ae(K)}return z===n&&(z=Bc(ct,f)),L}return cr.cancel=lr,cr.flush=zn,cr}var $3=ot(function(c,f){return w1(c,1,f)}),P3=ot(function(c,f,v){return w1(c,kr(f)||0,v)});function O3(c){return qo(c,I)}function Tf(c,f){if(typeof c!="function"||f!=null&&typeof f!="function")throw new Mr(s);var v=function(){var S=arguments,P=f?f.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(Tf.Cache||Wo),v}Tf.Cache=Wo;function Af(c){if(typeof c!="function")throw new Mr(s);return function(){var f=arguments;switch(f.length){case 0:return!c.call(this);case 1:return!c.call(this,f[0]);case 2:return!c.call(this,f[0],f[1]);case 3:return!c.call(this,f[0],f[1],f[2])}return!c.apply(this,f)}}function M3(c){return P_(2,c)}var D3=vk(function(c,f){f=f.length==1&&Ye(f[0])?Ht(f[0],ir(Le())):Ht(yn(f,1),ir(Le()));var v=f.length;return ot(function(S){for(var P=-1,A=$n(S.length,v);++P<A;)S[P]=f[P].call(this,S[P]);return or(c,this,S)})}),Bm=ot(function(c,f){var v=Ei(f,Ja(Bm));return qo(c,E,n,f,v)}),A_=ot(function(c,f){var v=Ei(f,Ja(A_));return qo(c,T,n,f,v)}),T3=Go(function(c,f){return qo(c,D,n,n,n,f)});function A3(c,f){if(typeof c!="function")throw new Mr(s);return f=f===n?f:Ze(f),ot(c,f)}function I3(c,f){if(typeof c!="function")throw new Mr(s);return f=f==null?0:sn(Ze(f),0),ot(function(v){var S=v[f],P=Mi(v,0,f);return S&&Ci(P,S),or(c,this,P)})}function k3(c,f,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),T_(c,f,{leading:S,maxWait:f,trailing:P})}function N3(c){return $_(c,1)}function L3(c,f){return Bm(Rm(f),c)}function F3(){if(!arguments.length)return[];var c=arguments[0];return Ye(c)?c:[c]}function z3(c){return Tr(c,g)}function j3(c,f){return f=typeof f=="function"?f:n,Tr(c,g,f)}function V3(c){return Tr(c,h|g)}function B3(c,f){return f=typeof f=="function"?f:n,Tr(c,h|g,f)}function H3(c,f){return f==null||x1(c,f,hn(f))}function Qr(c,f){return c===f||c!==c&&f!==f}var W3=Ef(pm),U3=Ef(function(c,f){return c>=f}),Fs=R1(function(){return arguments}())?R1:function(c){return Yt(c)&&Et.call(c,"callee")&&!f1.call(c,"callee")},Ye=se.isArray,q3=Gw?ir(Gw):ek;function Un(c){return c!=null&&If(c.length)&&!Ko(c)}function Zt(c){return Yt(c)&&Un(c)}function G3(c){return c===!0||c===!1||Yt(c)&&Ln(c)==J}var Di=aI||Jm,Y3=Yw?ir(Yw):tk;function K3(c){return Yt(c)&&c.nodeType===1&&!Hc(c)}function X3(c){if(c==null)return!0;if(Un(c)&&(Ye(c)||typeof c=="string"||typeof c.splice=="function"||Di(c)||el(c)||Fs(c)))return!c.length;var f=Pn(c);if(f==Ne||f==Wt)return!c.size;if(Vc(c))return!vm(c).length;for(var v in c)if(Et.call(c,v))return!1;return!0}function Q3(c,f){return Fc(c,f)}function Z3(c,f,v){v=typeof v=="function"?v:n;var S=v?v(c,f):n;return S===n?Fc(c,f,n,v):!!S}function Hm(c){if(!Yt(c))return!1;var f=Ln(c);return f==be||f==re||typeof c.message=="string"&&typeof c.name=="string"&&!Hc(c)}function J3(c){return typeof c=="number"&&p1(c)}function Ko(c){if(!Ut(c))return!1;var f=Ln(c);return f==H||f==De||f==de||f==ht}function I_(c){return typeof c=="number"&&c==Ze(c)}function If(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=Q}function Ut(c){var f=typeof c;return c!=null&&(f=="object"||f=="function")}function Yt(c){return c!=null&&typeof c=="object"}var k_=Kw?ir(Kw):rk;function eN(c,f){return c===f||mm(c,f,Am(f))}function tN(c,f,v){return v=typeof v=="function"?v:n,mm(c,f,Am(f),v)}function nN(c){return N_(c)&&c!=+c}function rN(c){if(jk(c))throw new Ue(i);return $1(c)}function oN(c){return c===null}function iN(c){return c==null}function N_(c){return typeof c=="number"||Yt(c)&&Ln(c)==Ve}function Hc(c){if(!Yt(c)||Ln(c)!=gt)return!1;var f=af(c);if(f===null)return!0;var v=Et.call(f,"constructor")&&f.constructor;return typeof v=="function"&&v instanceof v&&nf.call(v)==tI}var Wm=Xw?ir(Xw):ok;function sN(c){return I_(c)&&c>=-Q&&c<=Q}var L_=Qw?ir(Qw):ik;function kf(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 el=Zw?ir(Zw):sk;function aN(c){return c===n}function lN(c){return Yt(c)&&Pn(c)==Gr}function cN(c){return Yt(c)&&Ln(c)==ps}var uN=Ef(bm),dN=Ef(function(c,f){return c<=f});function F_(c){if(!c)return[];if(Un(c))return kf(c)?Kr(c):Wn(c);if(Mc&&c[Mc])return H5(c[Mc]());var f=Pn(c),v=f==Ne?im:f==Wt?Jd:tl;return v(c)}function Xo(c){if(!c)return c===0?c:0;if(c=kr(c),c===Y||c===-Y){var f=c<0?-1:1;return f*ae}return c===c?c:0}function Ze(c){var f=Xo(c),v=f%1;return f===f?v?f-v:f:0}function z_(c){return c?Is(Ze(c),0,B):0}function kr(c){if(typeof c=="number")return c;if(ar(c))return j;if(Ut(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=Ut(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=o1(c);var v=Re.test(c);return v||He.test(c)?R5(c.slice(2),v?2:8):Pe.test(c)?j:+c}function j_(c){return ho(c,qn(c))}function fN(c){return c?Is(Ze(c),-Q,Q):c===0?c:0}function wt(c){return c==null?"":sr(c)}var hN=Qa(function(c,f){if(Vc(f)||Un(f)){ho(f,hn(f),c);return}for(var v in f)Et.call(f,v)&&kc(c,v,f[v])}),V_=Qa(function(c,f){ho(f,qn(f),c)}),Nf=Qa(function(c,f,v,S){ho(f,qn(f),c,S)}),pN=Qa(function(c,f,v,S){ho(f,hn(f),c,S)}),gN=Go(dm);function mN(c,f){var v=Xa(c);return f==null?v:y1(v,f)}var vN=ot(function(c,f){c=Mt(c);var v=-1,S=f.length,P=S>2?f[2]:n;for(P&&Fn(f[0],f[1],P)&&(S=1);++v<S;)for(var A=f[v],L=qn(A),z=-1,K=L.length;++z<K;){var he=L[z],pe=c[he];(pe===n||Qr(pe,Ga[he])&&!Et.call(c,he))&&(c[he]=A[he])}return c}),bN=ot(function(c){return c.push(n,o_),or(B_,n,c)});function yN(c,f){return e1(c,Le(f,3),fo)}function xN(c,f){return e1(c,Le(f,3),hm)}function wN(c,f){return c==null?c:fm(c,Le(f,3),qn)}function _N(c,f){return c==null?c:C1(c,Le(f,3),qn)}function SN(c,f){return c&&fo(c,Le(f,3))}function CN(c,f){return c&&hm(c,Le(f,3))}function EN(c){return c==null?[]:vf(c,hn(c))}function RN(c){return c==null?[]:vf(c,qn(c))}function Um(c,f,v){var S=c==null?n:ks(c,f);return S===n?v:S}function $N(c,f){return c!=null&&a_(c,f,XI)}function qm(c,f){return c!=null&&a_(c,f,QI)}var PN=J1(function(c,f,v){f!=null&&typeof f.toString!="function"&&(f=rf.call(f)),c[f]=v},Ym(Gn)),ON=J1(function(c,f,v){f!=null&&typeof f.toString!="function"&&(f=rf.call(f)),Et.call(c,f)?c[f].push(v):c[f]=[v]},Le),MN=ot(Lc);function hn(c){return Un(c)?v1(c):vm(c)}function qn(c){return Un(c)?v1(c,!0):ak(c)}function DN(c,f){var v={};return f=Le(f,3),fo(c,function(S,P,A){Uo(v,f(S,P,A),S)}),v}function TN(c,f){var v={};return f=Le(f,3),fo(c,function(S,P,A){Uo(v,P,f(S,P,A))}),v}var AN=Qa(function(c,f,v){bf(c,f,v)}),B_=Qa(function(c,f,v,S){bf(c,f,v,S)}),IN=Go(function(c,f){var v={};if(c==null)return v;var S=!1;f=Ht(f,function(A){return A=Oi(A,c),S||(S=A.length>1),A}),ho(c,Dm(c),v),S&&(v=Tr(v,h|p|g,Pk));for(var P=f.length;P--;)Sm(v,f[P]);return v});function kN(c,f){return H_(c,Af(Le(f)))}var NN=Go(function(c,f){return c==null?{}:ck(c,f)});function H_(c,f){if(c==null)return{};var v=Ht(Dm(c),function(S){return[S]});return f=Le(f),I1(c,v,function(S,P){return f(S,P[0])})}function LN(c,f,v){f=Oi(f,c);var S=-1,P=f.length;for(P||(P=1,c=n);++S<P;){var A=c==null?n:c[po(f[S])];A===n&&(S=P,A=v),c=Ko(A)?A.call(c):A}return c}function FN(c,f,v){return c==null?c:zc(c,f,v)}function zN(c,f,v,S){return S=typeof S=="function"?S:n,c==null?c:zc(c,f,v,S)}var W_=n_(hn),U_=n_(qn);function jN(c,f,v){var S=Ye(c),P=S||Di(c)||el(c);if(f=Le(f,4),v==null){var A=c&&c.constructor;P?v=S?new A:[]:Ut(c)?v=Ko(A)?Xa(af(c)):{}:v={}}return(P?Or:fo)(c,function(L,z,K){return f(v,L,z,K)}),v}function VN(c,f){return c==null?!0:Sm(c,f)}function BN(c,f,v){return c==null?c:z1(c,f,Rm(v))}function HN(c,f,v,S){return S=typeof S=="function"?S:n,c==null?c:z1(c,f,Rm(v),S)}function tl(c){return c==null?[]:om(c,hn(c))}function WN(c){return c==null?[]:om(c,qn(c))}function UN(c,f,v){return v===n&&(v=f,f=n),v!==n&&(v=kr(v),v=v===v?v:0),f!==n&&(f=kr(f),f=f===f?f:0),Is(kr(c),f,v)}function qN(c,f,v){return f=Xo(f),v===n?(v=f,f=0):v=Xo(v),c=kr(c),ZI(c,f,v)}function GN(c,f,v){if(v&&typeof v!="boolean"&&Fn(c,f,v)&&(f=v=n),v===n&&(typeof f=="boolean"?(v=f,f=n):typeof c=="boolean"&&(v=c,c=n)),c===n&&f===n?(c=0,f=1):(c=Xo(c),f===n?(f=c,c=0):f=Xo(f)),c>f){var S=c;c=f,f=S}if(v||c%1||f%1){var P=g1();return $n(c+P*(f-c+E5("1e-"+((P+"").length-1))),f)}return xm(c,f)}var YN=Za(function(c,f,v){return f=f.toLowerCase(),c+(v?q_(f):f)});function q_(c){return Gm(wt(c).toLowerCase())}function G_(c){return c=wt(c),c&&c.replace(Ot,F5).replace(g5,"")}function KN(c,f,v){c=wt(c),f=sr(f);var S=c.length;v=v===n?S:Is(Ze(v),0,S);var P=v;return v-=f.length,v>=0&&c.slice(v,P)==f}function XN(c){return c=wt(c),c&&_s.test(c)?c.replace(uo,z5):c}function QN(c){return c=wt(c),c&&$s.test(c)?c.replace(Rs,"\\$&"):c}var ZN=Za(function(c,f,v){return c+(v?"-":"")+f.toLowerCase()}),JN=Za(function(c,f,v){return c+(v?" ":"")+f.toLowerCase()}),e6=X1("toLowerCase");function t6(c,f,v){c=wt(c),f=Ze(f);var S=f?Ua(c):0;if(!f||S>=f)return c;var P=(f-S)/2;return Cf(df(P),v)+c+Cf(uf(P),v)}function n6(c,f,v){c=wt(c),f=Ze(f);var S=f?Ua(c):0;return f&&S<f?c+Cf(f-S,v):c}function r6(c,f,v){c=wt(c),f=Ze(f);var S=f?Ua(c):0;return f&&S<f?Cf(f-S,v)+c:c}function o6(c,f,v){return v||f==null?f=0:f&&(f=+f),dI(wt(c).replace(Ps,""),f||0)}function i6(c,f,v){return(v?Fn(c,f,v):f===n)?f=1:f=Ze(f),wm(wt(c),f)}function s6(){var c=arguments,f=wt(c[0]);return c.length<3?f:f.replace(c[1],c[2])}var a6=Za(function(c,f,v){return c+(v?"_":"")+f.toLowerCase()});function l6(c,f,v){return v&&typeof v!="number"&&Fn(c,f,v)&&(f=v=n),v=v===n?B:v>>>0,v?(c=wt(c),c&&(typeof f=="string"||f!=null&&!Wm(f))&&(f=sr(f),!f&&Wa(c))?Mi(Kr(c),0,v):c.split(f,v)):[]}var c6=Za(function(c,f,v){return c+(v?" ":"")+Gm(f)});function u6(c,f,v){return c=wt(c),v=v==null?0:Is(Ze(v),0,c.length),f=sr(f),c.slice(v,v+f.length)==f}function d6(c,f,v){var S=M.templateSettings;v&&Fn(c,f,v)&&(f=n),c=wt(c),f=Nf({},f,S,r_);var P=Nf({},f.imports,S.imports,r_),A=hn(P),L=om(P,A),z,K,he=0,pe=f.interpolate||fn,ye="__p += '",$e=sm((f.escape||fn).source+"|"+pe.source+"|"+(pe===Va?Te:fn).source+"|"+(f.evaluate||fn).source+"|$","g"),Ae="//# sourceURL="+(Et.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++x5+"]")+`
|
|
72
|
+
`;c.replace($e,function(ze,ct,pt,lr,zn,cr){return pt||(pt=lr),ye+=c.slice(he,cr).replace(Os,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(f,"variable")&&f.variable;if(!Fe)ye=`with (obj) {
|
|
80
|
+
`+ye+`
|
|
81
|
+
}
|
|
82
|
+
`;else if(oe.test(Fe))throw new Ue(a);ye=(K?ye.replace(Sc,""):ye).replace(Vo,"$1").replace(ws,"$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=K_(function(){return yt(A,Ae+"return "+ye).apply(n,L)});if(tt.source=ye,Hm(tt))throw tt;return tt}function f6(c){return wt(c).toLowerCase()}function h6(c){return wt(c).toUpperCase()}function p6(c,f,v){if(c=wt(c),c&&(v||f===n))return o1(c);if(!c||!(f=sr(f)))return c;var S=Kr(c),P=Kr(f),A=i1(S,P),L=s1(S,P)+1;return Mi(S,A,L).join("")}function g6(c,f,v){if(c=wt(c),c&&(v||f===n))return c.slice(0,l1(c)+1);if(!c||!(f=sr(f)))return c;var S=Kr(c),P=s1(S,Kr(f))+1;return Mi(S,0,P).join("")}function m6(c,f,v){if(c=wt(c),c&&(v||f===n))return c.replace(Ps,"");if(!c||!(f=sr(f)))return c;var S=Kr(c),P=i1(S,Kr(f));return Mi(S,P).join("")}function v6(c,f){var v=N,S=V;if(Ut(f)){var P="separator"in f?f.separator:P;v="length"in f?Ze(f.length):v,S="omission"in f?sr(f.omission):S}c=wt(c);var A=c.length;if(Wa(c)){var L=Kr(c);A=L.length}if(v>=A)return c;var z=v-Ua(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),Wm(P)){if(c.slice(z).search(P)){var he,pe=K;for(P.global||(P=sm(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 b6(c){return c=wt(c),c&&Bo.test(c)?c.replace(Rn,G5):c}var y6=Za(function(c,f,v){return c+(v?" ":"")+f.toUpperCase()}),Gm=X1("toUpperCase");function Y_(c,f,v){return c=wt(c),f=v?n:f,f===n?B5(c)?X5(c):A5(c):c.match(f)||[]}var K_=ot(function(c,f){try{return or(c,n,f)}catch(v){return Hm(v)?v:new Ue(v)}}),x6=Go(function(c,f){return Or(f,function(v){v=po(v),Uo(c,v,Vm(c[v],c))}),c});function w6(c){var f=c==null?0:c.length,v=Le();return c=f?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<f;){var A=c[P];if(or(A[0],this,S))return or(A[1],this,S)}})}function _6(c){return GI(Tr(c,h))}function Ym(c){return function(){return c}}function S6(c,f){return c==null||c!==c?f:c}var C6=Z1(),E6=Z1(!0);function Gn(c){return c}function Km(c){return P1(typeof c=="function"?c:Tr(c,h))}function R6(c){return M1(Tr(c,h))}function $6(c,f){return D1(c,Tr(f,h))}var P6=ot(function(c,f){return function(v){return Lc(v,c,f)}}),O6=ot(function(c,f){return function(v){return Lc(c,v,f)}});function Xm(c,f,v){var S=hn(f),P=vf(f,S);v==null&&!(Ut(f)&&(P.length||!S.length))&&(v=f,f=c,c=this,P=vf(f,hn(f)));var A=!(Ut(v)&&"chain"in v)||!!v.chain,L=Ko(c);return Or(P,function(z){var K=f[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 M6(){return bn._===this&&(bn._=nI),this}function Qm(){}function D6(c){return c=Ze(c),ot(function(f){return T1(f,c)})}var T6=Pm(Ht),A6=Pm(Jw),I6=Pm(Jg);function X_(c){return km(c)?em(po(c)):uk(c)}function k6(c){return function(f){return c==null?n:ks(c,f)}}var N6=e_(),L6=e_(!0);function Zm(){return[]}function Jm(){return!1}function F6(){return{}}function z6(){return""}function j6(){return!0}function V6(c,f){if(c=Ze(c),c<1||c>Q)return[];var v=B,S=$n(c,B);f=Le(f),c-=B;for(var P=rm(S,f);++v<c;)f(v);return P}function B6(c){return Ye(c)?Ht(c,po):ar(c)?[c]:Wn(m_(wt(c)))}function H6(c){var f=++eI;return wt(c)+f}var W6=Sf(function(c,f){return c+f},0),U6=Om("ceil"),q6=Sf(function(c,f){return c/f},1),G6=Om("floor");function Y6(c){return c&&c.length?mf(c,Gn,pm):n}function K6(c,f){return c&&c.length?mf(c,Le(f,2),pm):n}function X6(c){return n1(c,Gn)}function Q6(c,f){return n1(c,Le(f,2))}function Z6(c){return c&&c.length?mf(c,Gn,bm):n}function J6(c,f){return c&&c.length?mf(c,Le(f,2),bm):n}var eL=Sf(function(c,f){return c*f},1),tL=Om("round"),nL=Sf(function(c,f){return c-f},0);function rL(c){return c&&c.length?nm(c,Gn):0}function oL(c,f){return c&&c.length?nm(c,Le(f,2)):0}return M.after=R3,M.ary=$_,M.assign=hN,M.assignIn=V_,M.assignInWith=Nf,M.assignWith=pN,M.at=gN,M.before=P_,M.bind=Vm,M.bindAll=x6,M.bindKey=O_,M.castArray=F3,M.chain=C_,M.chunk=Gk,M.compact=Yk,M.concat=Kk,M.cond=w6,M.conforms=_6,M.constant=Ym,M.countBy=r3,M.create=mN,M.curry=M_,M.curryRight=D_,M.debounce=T_,M.defaults=vN,M.defaultsDeep=bN,M.defer=$3,M.delay=P3,M.difference=Xk,M.differenceBy=Qk,M.differenceWith=Zk,M.drop=Jk,M.dropRight=e7,M.dropRightWhile=t7,M.dropWhile=n7,M.fill=r7,M.filter=i3,M.flatMap=l3,M.flatMapDeep=c3,M.flatMapDepth=u3,M.flatten=x_,M.flattenDeep=o7,M.flattenDepth=i7,M.flip=O3,M.flow=C6,M.flowRight=E6,M.fromPairs=s7,M.functions=EN,M.functionsIn=RN,M.groupBy=d3,M.initial=l7,M.intersection=c7,M.intersectionBy=u7,M.intersectionWith=d7,M.invert=PN,M.invertBy=ON,M.invokeMap=h3,M.iteratee=Km,M.keyBy=p3,M.keys=hn,M.keysIn=qn,M.map=Mf,M.mapKeys=DN,M.mapValues=TN,M.matches=R6,M.matchesProperty=$6,M.memoize=Tf,M.merge=AN,M.mergeWith=B_,M.method=P6,M.methodOf=O6,M.mixin=Xm,M.negate=Af,M.nthArg=D6,M.omit=IN,M.omitBy=kN,M.once=M3,M.orderBy=g3,M.over=T6,M.overArgs=D3,M.overEvery=A6,M.overSome=I6,M.partial=Bm,M.partialRight=A_,M.partition=m3,M.pick=NN,M.pickBy=H_,M.property=X_,M.propertyOf=k6,M.pull=g7,M.pullAll=__,M.pullAllBy=m7,M.pullAllWith=v7,M.pullAt=b7,M.range=N6,M.rangeRight=L6,M.rearg=T3,M.reject=y3,M.remove=y7,M.rest=A3,M.reverse=zm,M.sampleSize=w3,M.set=FN,M.setWith=zN,M.shuffle=_3,M.slice=x7,M.sortBy=E3,M.sortedUniq=$7,M.sortedUniqBy=P7,M.split=l6,M.spread=I3,M.tail=O7,M.take=M7,M.takeRight=D7,M.takeRightWhile=T7,M.takeWhile=A7,M.tap=Y7,M.throttle=k3,M.thru=Of,M.toArray=F_,M.toPairs=W_,M.toPairsIn=U_,M.toPath=B6,M.toPlainObject=j_,M.transform=jN,M.unary=N3,M.union=I7,M.unionBy=k7,M.unionWith=N7,M.uniq=L7,M.uniqBy=F7,M.uniqWith=z7,M.unset=VN,M.unzip=jm,M.unzipWith=S_,M.update=BN,M.updateWith=HN,M.values=tl,M.valuesIn=WN,M.without=j7,M.words=Y_,M.wrap=L3,M.xor=V7,M.xorBy=B7,M.xorWith=H7,M.zip=W7,M.zipObject=U7,M.zipObjectDeep=q7,M.zipWith=G7,M.entries=W_,M.entriesIn=U_,M.extend=V_,M.extendWith=Nf,Xm(M,M),M.add=W6,M.attempt=K_,M.camelCase=YN,M.capitalize=q_,M.ceil=U6,M.clamp=UN,M.clone=z3,M.cloneDeep=V3,M.cloneDeepWith=B3,M.cloneWith=j3,M.conformsTo=H3,M.deburr=G_,M.defaultTo=S6,M.divide=q6,M.endsWith=KN,M.eq=Qr,M.escape=XN,M.escapeRegExp=QN,M.every=o3,M.find=s3,M.findIndex=b_,M.findKey=yN,M.findLast=a3,M.findLastIndex=y_,M.findLastKey=xN,M.floor=G6,M.forEach=E_,M.forEachRight=R_,M.forIn=wN,M.forInRight=_N,M.forOwn=SN,M.forOwnRight=CN,M.get=Um,M.gt=W3,M.gte=U3,M.has=$N,M.hasIn=qm,M.head=w_,M.identity=Gn,M.includes=f3,M.indexOf=a7,M.inRange=qN,M.invoke=MN,M.isArguments=Fs,M.isArray=Ye,M.isArrayBuffer=q3,M.isArrayLike=Un,M.isArrayLikeObject=Zt,M.isBoolean=G3,M.isBuffer=Di,M.isDate=Y3,M.isElement=K3,M.isEmpty=X3,M.isEqual=Q3,M.isEqualWith=Z3,M.isError=Hm,M.isFinite=J3,M.isFunction=Ko,M.isInteger=I_,M.isLength=If,M.isMap=k_,M.isMatch=eN,M.isMatchWith=tN,M.isNaN=nN,M.isNative=rN,M.isNil=iN,M.isNull=oN,M.isNumber=N_,M.isObject=Ut,M.isObjectLike=Yt,M.isPlainObject=Hc,M.isRegExp=Wm,M.isSafeInteger=sN,M.isSet=L_,M.isString=kf,M.isSymbol=ar,M.isTypedArray=el,M.isUndefined=aN,M.isWeakMap=lN,M.isWeakSet=cN,M.join=f7,M.kebabCase=ZN,M.last=Ir,M.lastIndexOf=h7,M.lowerCase=JN,M.lowerFirst=e6,M.lt=uN,M.lte=dN,M.max=Y6,M.maxBy=K6,M.mean=X6,M.meanBy=Q6,M.min=Z6,M.minBy=J6,M.stubArray=Zm,M.stubFalse=Jm,M.stubObject=F6,M.stubString=z6,M.stubTrue=j6,M.multiply=eL,M.nth=p7,M.noConflict=M6,M.noop=Qm,M.now=Df,M.pad=t6,M.padEnd=n6,M.padStart=r6,M.parseInt=o6,M.random=GN,M.reduce=v3,M.reduceRight=b3,M.repeat=i6,M.replace=s6,M.result=LN,M.round=tL,M.runInContext=q,M.sample=x3,M.size=S3,M.snakeCase=a6,M.some=C3,M.sortedIndex=w7,M.sortedIndexBy=_7,M.sortedIndexOf=S7,M.sortedLastIndex=C7,M.sortedLastIndexBy=E7,M.sortedLastIndexOf=R7,M.startCase=c6,M.startsWith=u6,M.subtract=nL,M.sum=rL,M.sumBy=oL,M.template=d6,M.times=V6,M.toFinite=Xo,M.toInteger=Ze,M.toLength=z_,M.toLower=f6,M.toNumber=kr,M.toSafeInteger=fN,M.toString=wt,M.toUpper=h6,M.trim=p6,M.trimEnd=g6,M.trimStart=m6,M.truncate=v6,M.unescape=b6,M.uniqueId=H6,M.upperCase=y6,M.upperFirst=Gm,M.each=E_,M.eachRight=R_,M.first=w_,Xm(M,function(){var c={};return fo(M,function(f,v){Et.call(M.prototype,v)||(c[v]=f)}),c}(),{chain:!1}),M.VERSION=r,Or(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){M[c].placeholder=M}),Or(["drop","take"],function(c,f){dt.prototype[c]=function(v){v=v===n?1:sn(Ze(v),0);var S=this.__filtered__&&!f?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,f){var v=f+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,f){var v="take"+(f?"Right":"");dt.prototype[c]=function(){return this[v](1).value()[0]}}),Or(["initial","tail"],function(c,f){var v="drop"+(f?"":"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,f){return typeof c=="function"?new dt(this):this.map(function(v){return Lc(v,c,f)})}),dt.prototype.reject=function(c){return this.filter(Af(Le(c)))},dt.prototype.slice=function(c,f){c=Ze(c);var v=this;return v.__filtered__&&(c>0||f<0)?new dt(v):(c<0?v=v.takeRight(-c):c&&(v=v.drop(c)),f!==n&&(f=Ze(f),v=f<0?v.dropRight(-f):v.take(f-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,f){var v=/^(?:filter|find|map|reject)|While$/.test(f),S=/^(?:head|last)$/.test(f),P=M[S?"take"+(f=="last"?"Right":""):f],A=S||/^find/.test(f);P&&(M.prototype[f]=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:Of,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 f=ef[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 f.apply(Ye(A)?A:[],P)}return this[v](function(L){return f.apply(Ye(L)?L:[],P)})}}),fo(dt.prototype,function(c,f){var v=M[f];if(v){var S=v.name+"";Et.call(Ka,S)||(Ka[S]=[]),Ka[S].push({name:f,func:v})}}),Ka[_f(n,_).name]=[{name:"wrapper",func:n}],dt.prototype.clone=bI,dt.prototype.reverse=yI,dt.prototype.value=xI,M.prototype.at=K7,M.prototype.chain=X7,M.prototype.commit=Q7,M.prototype.next=Z7,M.prototype.plant=e3,M.prototype.reverse=t3,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=n3,M.prototype.first=M.prototype.head,Mc&&(M.prototype[Mc]=J7),M},qa=Q5();Ms?((Ms.exports=qa)._=qa,Kg._=qa):bn._=qa}).call(Ks)})(rp,rp.exports);var bl=rp.exports;const wa=$d(bl),AS=["lg","md","sm","xs","xxs"],Ee=i$()(f$((e,t)=>({currentBreakpoint:"lg",dashboard:{id:"",style:Pb},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&&bl.forEach(i.frames,l=>{var d;const u=(d=l.cards)==null?void 0:d.find(h=>h.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&&bl.forEach(s.frames,u=>{var h;const d=(h=u.cards)==null?void 0:h.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&&bl.forEach(i.frames,l=>{var d;const u=(d=l.cards)==null?void 0:d.find(h=>h.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&&bl.forEach(s.frames,u=>{var h;const d=(h=u.cards)==null?void 0:h.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(h=>h.id===n);if(s){const h=(u=s.cards)==null?void 0:u.find(p=>p.id===r);h&&(h.sql=o,(d=i.onUpdateCard)==null||d.call(i,h,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&&bl.forEach(s.frames,u=>{var h;const d=(h=u.cards)==null?void 0:h.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,h,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=(h=a.cards)==null?void 0:h.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(h=>h.id===n);if(i){i.frames||(i.frames=[]),(l=i.frames)==null||l.push(r);const h={i:r.id,x:0,y:1/0,w:20,h:7,minW:6,minH:2};(u=i.layout)==null||u.push(h),i!=null&&i.layouts||(i.layouts={}),AS.forEach(p=>{i.layouts[p]||(i.layouts[p]=[]),i.layouts[p].push(h)}),(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(h=>h.id===n);if(i){const h=(l=i.frames)==null?void 0:l.findIndex(p=>p.id===r);console.log(h),typeof h=="number"&&h>-1&&((u=i.frames)==null||u.splice(h,1),(d=i.layout)==null||d.splice(h,1),i.layouts=AS.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(h=>h.id===n),s=(u=i==null?void 0:i.frames)==null?void 0:u.findIndex(h=>h.id===r.id);i&&((d=i.frames)==null||d.splice(s,1,r))})},updateCard:(n,r)=>{e(o=>{var a,l,u,d,h;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),(h=o.onUpdateCard)==null||h.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,u,d,h,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),(h=i.layout)==null||h.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)=>{o8({card:n,dataPoint:r,set:e,get:t})}}}))),Ma=()=>Ee(e=>e.actions),i8={theme:"system",setTheme:()=>null},lP=m.createContext(i8);function s8({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(lP.Provider,{...r,value:s,children:e})}const cP=()=>{const e=m.useContext(lP);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function a8(e,t,n){return await(await fetch(`https://semaphor.cloud/api/v1/dashboard?id=${e}&version=${t}`,{headers:{Authorization:`Bearer ${n}`}})).json()}function uP(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function IS(e,t){const n=uP(e);return n==="dark"?wa.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function l8({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:()=>a8(e,t||"",n==null?void 0:n.accessToken),enabled:!1}),{theme:h,setTheme:p}=cP(),{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(h){const O=uP(h);E(O)}},[h,E]),m.useEffect(()=>{o&&p(o)},[o,p]),m.useEffect(()=>{const O=wa.cloneDeep(Pb);if(r){const D=wa.merge(O,r),I=IS(h,D);R(I),y(D)}else{const D=IS(h,O);R(D),y(Pb)}},[h,r,y,R]),m.useEffect(()=>{var V;if(!a||!a.dashboard)return;const O=a.dashboard,D=dT(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 gy({className:e,...t}){return k.jsx("div",{className:Se("animate-pulse rounded-md bg-muted",e),...t})}function c8({className:e,style:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:u,version:d,customCards:h,...p}){Ee(_=>_.selectedSheetId);const g=Ee(_=>_.themeStyle),b=Ee(_=>_.onEvent),{isLoading:y,isError:x}=l8({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(gy,{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(h){const{scope:p,children:g,...b}=h,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(h,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(`\`${h}\` 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,u8(o,...t)]}function u8(...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 h=l(i)[`__scope${u}`];return{...a,...h}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function d8(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Up(...e){return t=>e.forEach(n=>d8(n,t))}function Xe(...e){return m.useCallback(Up(...e),e)}const pi=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(f8);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(Jb,ne({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(Jb,ne({},r,{ref:t}),n)});pi.displayName="Slot";const Jb=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...h8(r,n.props),ref:t?Up(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});Jb.displayName="SlotClone";const dP=({children:e})=>m.createElement(m.Fragment,null,e);function f8(e){return m.isValidElement(e)&&e.type===dP}function h8(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",h=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:h},p,r]}const kn=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},p8=ie.useId||(()=>{});let g8=0;function nr(e){const[t,n]=ie.useState(p8());return kn(()=>{e||n(r=>r??String(g8++))},[e]),e||(t?`radix-${t}`:"")}const m8=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ke=m8.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 fP(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]=v8({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=cn(n),l=m.useCallback(u=>{if(i){const h=typeof u=="function"?u(e):u;h!==e&&a(h)}else o(u)},[i,e,o,a]);return[s,l]}function v8({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 b8=m.createContext(void 0);function Da(e){const t=m.useContext(b8);return e||t||"ltr"}const pv="rovingFocusGroup.onEntryFocus",y8={bubbles:!1,cancelable:!0},my="RovingFocusGroup",[e0,hP,x8]=qp(my),[w8,mc]=mn(my,[x8]),[_8,S8]=w8(my),C8=m.forwardRef((e,t)=>m.createElement(e0.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(e0.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(E8,ne({},e,{ref:t}))))),E8=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,...d}=e,h=m.useRef(null),p=Xe(t,h),g=Da(i),[b=null,y]=Nn({prop:s,defaultProp:a,onChange:l}),[x,_]=m.useState(!1),w=cn(u),C=hP(n),R=m.useRef(!1),[E,T]=m.useState(0);return m.useEffect(()=>{const O=h.current;if(O)return O.addEventListener(pv,w),()=>O.removeEventListener(pv,w)},[w]),m.createElement(_8,{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(pv,y8);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);pP(ee)}}R.current=!1}),onBlur:we(e.onBlur,()=>_(!1))})))}),R8="RovingFocusGroupItem",$8=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=nr(),l=i||a,u=S8(R8,n),d=u.currentTabStopId===l,h=hP(n),{onFocusableItemAdd:p,onFocusableItemRemove:g}=u;return m.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),m.createElement(e0.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=M8(b,u.orientation,u.dir);if(y!==void 0){b.preventDefault();let _=h().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?D8(_,w+1):_.slice(w+1)}setTimeout(()=>pP(_))}})})))}),P8={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function O8(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function M8(e,t,n){const r=O8(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return P8[r]}function pP(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function D8(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const vy=C8,by=$8;function T8(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=A8(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 A8(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=T8(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=Wf(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=Wf(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=h=>{const g=Wf(r.current).includes(h.animationName);h.target===t&&g&&Ao.flushSync(()=>l("ANIMATION_END"))},d=h=>{h.target===t&&(i.current=Wf(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 Wf(e){return(e==null?void 0:e.animationName)||"none"}const gP="Tabs",[I8,zae]=mn(gP,[mc]),mP=mc(),[k8,yy]=I8(gP),N8=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...u}=e,d=Da(a),[h,p]=Nn({prop:r,onChange:o,defaultProp:i});return m.createElement(k8,{scope:n,baseId:nr(),value:h,onValueChange:p,orientation:s,dir:d,activationMode:l},m.createElement(ke.div,ne({dir:d,"data-orientation":s},u,{ref:t})))}),L8="TabsList",F8=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=yy(L8,n),s=mP(n);return m.createElement(vy,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})))}),z8="TabsTrigger",j8=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=yy(z8,n),a=mP(n),l=vP(s.baseId,r),u=bP(s.baseId,r),d=r===s.value;return m.createElement(by,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,h=>{!o&&h.button===0&&h.ctrlKey===!1?s.onValueChange(r):h.preventDefault()}),onKeyDown:we(e.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&s.onValueChange(r)}),onFocus:we(e.onFocus,()=>{const h=s.activationMode!=="manual";!d&&!o&&h&&s.onValueChange(r)})})))}),V8="TabsContent",B8=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=yy(V8,n),l=vP(a.baseId,r),u=bP(a.baseId,r),d=r===a.value,h=m.useRef(d);return m.useEffect(()=>{const p=requestAnimationFrame(()=>h.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:h.current?"0s":void 0}}),p&&i))});function vP(e,t){return`${e}-trigger-${t}`}function bP(e,t){return`${e}-content-${t}`}const H8=N8,yP=F8,xP=j8,wP=B8,_P=H8,SP=ie.forwardRef(({className:e,...t},n)=>k.jsx(yP,{ref:n,className:Se("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));SP.displayName=yP.displayName;const CP=ie.forwardRef(({className:e,...t},n)=>k.jsx(xP,{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}));CP.displayName=xP.displayName;const xy=ie.forwardRef(({className:e,...t},n)=>k.jsx(wP,{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}));xy.displayName=wP.displayName;var EP={exports:{}},Od={},t0={exports:{}};(function(e,t){(function(n,r){r(t)})(Ks,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]",h="[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===h?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})})})(t0,t0.exports);var wy=t0.exports;const _y=oy(uL);var lt={},W8=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=Sy;lt.childrenEqual=Y8;lt.cloneLayout=RP;lt.cloneLayoutItem=fa;lt.collides=Gp;lt.compact=PP;lt.compactItem=OP;lt.compactType=lz;lt.correctBounds=MP;lt.fastPositionEqual=X8;lt.fastRGLPropsEqual=void 0;lt.getAllCollisions=DP;lt.getFirstCollision=Js;lt.getLayoutItem=Cy;lt.getStatics=Ey;lt.modifyLayout=$P;lt.moveElement=fu;lt.moveElementAwayFromCollision=r0;lt.noop=void 0;lt.perc=Z8;lt.resizeItemInDirection=oz;lt.setTopLeft=sz;lt.setTransform=iz;lt.sortLayoutItems=Dy;lt.sortLayoutItemsByColRow=NP;lt.sortLayoutItemsByRowCol=kP;lt.synchronizeLayoutWithChildren=az;lt.validateLayout=LP;lt.withLayoutItem=G8;var kS=wy,du=U8(m);function U8(e){return e&&e.__esModule?e:{default:e}}const q8=process.env.NODE_ENV==="production";function Sy(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 RP(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=fa(e[n]);return t}function $P(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 G8(e,t,n){let r=Cy(e,t);return r?(r=n(fa(r)),e=$P(e,r),[e,r]):[e,null]}function fa(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 Y8(e,t){return(0,kS.deepEqual)(du.default.Children.map(e,n=>n==null?void 0:n.key),du.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,kS.deepEqual)(du.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),du.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const K8=W8;lt.fastRGLPropsEqual=K8;function X8(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Gp(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 PP(e,t,n,r){const o=Ey(e),i=Dy(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let u=fa(i[a]);u.static||(u=OP(o,u,t,n,i,r),o.push(u)),s[e.indexOf(i[a])]=u,u.moved=!1}return s}const Q8={x:"w",y:"h"};function n0(e,t,n,r){const o=Q8[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;Gp(t,a)&&n0(e,a,n+t[o],r)}}t[r]=n}function OP(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(Sy(e),t.y);t.y>0&&!Js(e,t);)t.y--;else if(a)for(;t.x>0&&!Js(e,t);)t.x--;let l;for(;(l=Js(e,t))&&!(n===null&&i);)if(a?n0(o,t,l.x+l.w,"x"):n0(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Js(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function MP(e,t){const n=Ey(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(;Js(n,i);)i.y++}return e}function Cy(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Js(e,t){for(let n=0,r=e.length;n<r;n++)if(Gp(e[n],t))return e[n]}function DP(e,t){return e.filter(n=>Gp(n,t))}function Ey(e){return e.filter(t=>t.static)}function fu(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 h=Dy(e,s);(s==="vertical"&&typeof r=="number"?d>=r:s==="horizontal"&&typeof n=="number"?u>=n:!1)&&(h=h.reverse());const g=DP(h,t),b=g.length>0;if(b&&l)return RP(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=r0(e,_,t,o,s):e=r0(e,t,_,o,s))}return e}function r0(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const h={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=Js(e,h),g=p&&p.y+p.h>t.y,b=p&&t.x+t.w>p.x;if(p){if(g&&a)return fu(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 fu(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(h.x,",").concat(h.y,"]."),fu(e,n,s?h.x:void 0,a?h.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:fu(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function Z8(e){return e*100+"%"}const TP=(e,t,n,r)=>e+n>r?t:n,AP=(e,t,n)=>e<0?t:n,IP=e=>Math.max(0,e),Ry=e=>Math.max(0,e),$y=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:AP(s,e.height,o),top:Ry(s)}},Py=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:TP(e.left,e.width,s,n),left:IP(o)}},Oy=(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:TP(e.left,e.width,i,n),top:Ry(r),left:IP(s)}},My=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:AP(r,e.height,i),top:Ry(r)}},J8=function(){return $y(arguments.length<=0?void 0:arguments[0],Py(...arguments))},ez=function(){return $y(arguments.length<=0?void 0:arguments[0],Oy(...arguments))},tz=function(){return My(arguments.length<=0?void 0:arguments[0],Py(...arguments))},nz=function(){return My(arguments.length<=0?void 0:arguments[0],Oy(...arguments))},rz={n:$y,ne:J8,e:Py,se:tz,s:My,sw:nz,w:Oy,nw:ez};function oz(e,t,n,r){const o=rz[e];return o?o(t,{...t,...n},r):n}function iz(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 sz(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 Dy(e,t){return t==="horizontal"?NP(e):t==="vertical"?kP(e):e}function kP(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 NP(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 az(e,t,n,r,o){e=e||[];const i=[];du.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=Cy(e,String(a.key)),u=a.props["data-grid"];l&&u==null?i.push(fa(l)):u?(q8||LP([u],"ReactGridLayout.children"),i.push(fa({...u,i:a.key}))):i.push(fa({w:1,h:1,x:0,y:Sy(i),i:String(a.key)}))});const s=MP(i,{cols:n});return o?s:PP(s,r,n)}function LP(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 lz(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const cz=()=>{};lt.noop=cz;var Io={};Object.defineProperty(Io,"__esModule",{value:!0});Io.calcGridColWidth=Yp;Io.calcGridItemPosition=uz;Io.calcGridItemWHPx=o0;Io.calcWH=fz;Io.calcXY=dz;Io.clamp=ea;function Yp(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function o0(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function uz(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,u=Yp(e),d={};return i&&i.resizing?(d.width=Math.round(i.resizing.width),d.height=Math.round(i.resizing.height)):(d.width=o0(r,u,s[0]),d.height=o0(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 dz(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,u=Yp(e);let d=Math.round((n-i[0])/(u+i[0])),h=Math.round((t-i[1])/(a+i[1]));return d=ea(d,0,s-r),h=ea(h,0,l-o),{x:d,y:h}}function fz(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:u}=e,d=Yp(e);let h=Math.round((t+s[0])/(d+s[0])),p=Math.round((n+s[1])/(u+s[1])),g=ea(h,0,l-r),b=ea(p,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(g=ea(h,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(b=ea(p,0,a)),{w:g,h:b}}function ea(e,t,n){return Math.max(Math.min(e,n),t)}var Kp={},i0={exports:{}},gv,NS;function Ty(){if(NS)return gv;NS=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return gv=e,gv}var mv,LS;function hz(){if(LS)return mv;LS=1;var e=Ty();function t(){}function n(){}return n.resetWarningCache=t,mv=function(){function r(s,a,l,u,d,h){if(h!==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},mv}var Uf={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 FS;function pz(){return FS||(FS=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,h=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===h||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 h: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=h,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)===h}_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 zS;function gz(){if(zS)return St;zS=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,h=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 h: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=h,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)===h},St.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===r||E===u||E===i||E===o||E===h||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 jS;function FP(){return jS||(jS=1,process.env.NODE_ENV==="production"?Uf.exports=gz():Uf.exports=pz()),Uf.exports}/*
|
|
103
|
+
object-assign
|
|
104
|
+
(c) Sindre Sorhus
|
|
105
|
+
@license MIT
|
|
106
|
+
*/var vv,VS;function mz(){if(VS)return vv;VS=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 vv=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 h in a)t.call(a,h)&&(l[h]=a[h]);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},vv}var bv,BS;function zP(){return BS||(BS=1,bv=Function.call.bind(Object.prototype.hasOwnProperty)),bv}var yv,HS;function vz(){if(HS)return yv;HS=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Ty(),n={},r=zP();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 h;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}h=i[d](s,d,l,a,null,t)}catch(b){h=b}if(h&&!(h 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 h+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),h instanceof Error&&!(h.message in n)){n[h.message]=!0;var g=u?u():"";e("Failed "+a+" type: "+h.message+(g??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},yv=o,yv}var xv,WS;function bz(){if(WS)return xv;WS=1;var e=FP(),t=mz(),n=Ty(),r=zP(),o=vz(),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 xv=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function h(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=h(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},xv}if(process.env.NODE_ENV!=="production"){var yz=FP(),xz=!0;i0.exports=bz()(yz.isElement,xz)}else i0.exports=hz()();var ds=i0.exports,Xp={exports:{}},jP={};function VP(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=VP(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function US(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=VP(e))&&(r&&(r+=" "),r+=t);return r}const wz=Object.freeze(Object.defineProperty({__proto__:null,clsx:US,default:US},Symbol.toStringTag,{value:"Module"})),_z=oy(wz);var Qt={},ko={};Object.defineProperty(ko,"__esModule",{value:!0});ko.dontSetMe=$z;ko.findInArray=Sz;ko.int=Rz;ko.isFunction=Cz;ko.isNum=Ez;function Sz(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function Cz(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Ez(e){return typeof e=="number"&&!isNaN(e)}function Rz(e){return parseInt(e,10)}function $z(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 Ta={};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.browserPrefixToKey=HP;Ta.browserPrefixToStyle=Pz;Ta.default=void 0;Ta.getPrefix=BP;const wv=["Moz","Webkit","O","ms"];function BP(){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<wv.length;r++)if(HP(t,wv[r])in n)return wv[r];return""}function HP(e,t){return t?"".concat(t).concat(Oz(e)):e}function Pz(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function Oz(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}Ta.default=BP();Object.defineProperty(Qt,"__esModule",{value:!0});Qt.addClassName=qP;Qt.addEvent=Tz;Qt.addUserSelectStyles=Hz;Qt.createCSSTransform=zz;Qt.createSVGTransform=jz;Qt.getTouch=Vz;Qt.getTouchIdentifier=Bz;Qt.getTranslation=Ay;Qt.innerHeight=Nz;Qt.innerWidth=Lz;Qt.matchesSelector=UP;Qt.matchesSelectorAndParentsTo=Dz;Qt.offsetXYFromParent=Fz;Qt.outerHeight=Iz;Qt.outerWidth=kz;Qt.removeClassName=GP;Qt.removeEvent=Az;Qt.removeUserSelectStyles=Wz;var xr=ko,qS=Mz(Ta);function WP(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(WP=function(r){return r?n:t})(e)}function Mz(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=WP(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 qf="";function UP(e,t){return qf||(qf=(0,xr.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,xr.isFunction)(e[n])})),(0,xr.isFunction)(e[qf])?e[qf](t):!1}function Dz(e,t,n){let r=e;do{if(UP(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function Tz(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 Az(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 Iz(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 kz(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 Nz(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 Lz(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 Fz(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 zz(e,t){const n=Ay(e,t,"px");return{[(0,qS.browserPrefixToKey)("transform",qS.default)]:n}}function jz(e,t){return Ay(e,t,"")}function Ay(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 Vz(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 Bz(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Hz(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&&qP(e.body,"react-draggable-transparent-selection")}function Wz(e){if(e)try{if(e.body&&GP(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 qP(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function GP(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=Gz;No.canDragY=Yz;No.createCoreData=Xz;No.createDraggableData=Qz;No.getBoundPosition=Uz;No.getControlPosition=Kz;No.snapToGrid=qz;var ur=ko,wl=Qt;function Uz(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:Zz(r);const o=Iy(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,wl.innerWidth)(l)-(0,wl.outerWidth)(o)-o.offsetLeft+(0,ur.int)(d.paddingRight)-(0,ur.int)(u.marginRight),bottom:(0,wl.innerHeight)(l)-(0,wl.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 qz(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function Gz(e){return e.props.axis==="both"||e.props.axis==="x"}function Yz(e){return e.props.axis==="both"||e.props.axis==="y"}function Kz(e,t,n){const r=typeof t=="number"?(0,wl.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=Iy(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,wl.offsetXYFromParent)(r||e,i,n.props.scale)}function Xz(e,t,n){const r=!(0,ur.isNum)(e.lastX),o=Iy(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 Qz(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 Zz(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Iy(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Qp={},Zp={};Object.defineProperty(Zp,"__esModule",{value:!0});Zp.default=Jz;function Jz(){}Object.defineProperty(Qp,"__esModule",{value:!0});Qp.default=void 0;var _v=tj(m),Yn=ky(ds),ej=ky(Ao),On=Qt,Ii=No,Sv=ko,Yc=ky(Zp);function ky(e){return e&&e.__esModule?e:{default:e}}function YP(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(YP=function(r){return r?n:t})(e)}function tj(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=YP(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=nj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nj(e){var t=rj(e,"string");return typeof t=="symbol"?t:String(t)}function rj(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,Jp=class extends _v.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,Yc.default)("DraggableCore: handleDragStart: %j",l),(0,Yc.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,Yc.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,Yc.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Yc.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:ej.default.findDOMNode(this)}render(){return _v.cloneElement(_v.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Qp.default=Jp;jn(Jp,"displayName","DraggableCore");jn(Jp,"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:Sv.dontSetMe,style:Sv.dontSetMe,transform:Sv.dontSetMe});jn(Jp,"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(ds),r=d(Ao),o=d(_z),i=Qt,s=No,a=ko,l=d(Qp),u=d(Zp);function d(w){return w&&w.__esModule?w:{default:w}}function h(w){if(typeof WeakMap!="function")return null;var C=new WeakMap,R=new WeakMap;return(h=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=h(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})})(jP);const{default:KP,DraggableCore:oj}=jP;Xp.exports=KP;Xp.exports.default=KP;Xp.exports.DraggableCore=oj;var XP=Xp.exports,eg={exports:{}},Md={},Ny={};Ny.__esModule=!0;Ny.cloneElement=uj;var ij=sj(m);function sj(e){return e&&e.__esModule?e:{default:e}}function GS(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 YS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GS(Object(n),!0).forEach(function(r){aj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function aj(e,t,n){return t=lj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lj(e){var t=cj(e,"string");return typeof t=="symbol"?t:String(t)}function cj(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 uj(e,t){return t.style&&e.props.style&&(t.style=YS(YS({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),ij.default.cloneElement(e,t)}var Dd={};Dd.__esModule=!0;Dd.resizableProps=void 0;var Je=dj(ds);function dj(e){return e&&e.__esModule?e:{default:e}}var fj={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)}};Dd.resizableProps=fj;Md.__esModule=!0;Md.default=void 0;var Kc=vj(m),hj=XP,pj=Ny,gj=Dd,mj=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function QP(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(QP=function(o){return o?n:t})(e)}function vj(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=QP(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 s0(){return s0=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},s0.apply(this,arguments)}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 KS(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 Cv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?KS(Object(n),!0).forEach(function(r){yj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):KS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yj(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=wj(e,"string");return typeof t=="symbol"?t:String(t)}function wj(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 _j(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,a0(e,t)}function a0(e,t){return a0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},a0(e,t)}var Ly=function(e){_j(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,h=o-this.props.width,p=i-this.props.height;Math.abs(h)>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,h=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;h+=w}}s.lastHandleRect=x,y==="w"&&(d=-d),b==="n"&&(h=-h);var C=s.props.width+(p?d/s.props.transformScale:0),R=s.props.height+(g?h/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 Kc.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=Cv({ref:i},a?{}:{handleAxis:o});return Kc.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=bj(i,mj);return(0,pj.cloneElement)(s,Cv(Cv({},d),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,u.map(function(h){var p,g=(p=o.handleRefs[h])!=null?p:o.handleRefs[h]=Kc.createRef();return Kc.createElement(hj.DraggableCore,s0({},l,{nodeRef:g,key:"resizableHandle-"+h,onStop:o.resizeHandler("onResizeStop",h),onStart:o.resizeHandler("onResizeStart",h),onDrag:o.resizeHandler("onResize",h)}),o.renderResizeHandle(h,g))}))}))},t}(Kc.Component);Md.default=Ly;Ly.propTypes=gj.resizableProps;Ly.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var tg={};tg.__esModule=!0;tg.default=void 0;var Ev=$j(m),Sj=ZP(ds),Cj=ZP(Md),Ej=Dd,Rj=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function ZP(e){return e&&e.__esModule?e:{default:e}}function JP(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(JP=function(o){return o?n:t})(e)}function $j(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=JP(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 l0(){return l0=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},l0.apply(this,arguments)}function XS(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 op(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XS(Object(n),!0).forEach(function(r){Pj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pj(e,t,n){return t=Oj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oj(e){var t=Mj(e,"string");return typeof t=="symbol"?t:String(t)}function Mj(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Dj(e,t){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 Tj(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,c0(e,t)}function c0(e,t){return c0=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},c0(e,t)}var eO=function(e){Tj(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,h=o.maxConstraints,p=o.lockAspectRatio,g=o.axis;o.width,o.height;var b=o.resizeHandles,y=o.style,x=o.transformScale,_=Dj(o,Rj);return Ev.createElement(Cj.default,{axis:g,draggableOpts:u,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:p,maxConstraints:h,minConstraints:d,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:b,transformScale:x,width:this.state.width},Ev.createElement("div",l0({},_,{style:op(op({},y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Ev.Component);tg.default=eO;eO.propTypes=op(op({},Ej.resizableProps),{},{children:Sj.default.element});eg.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};eg.exports.Resizable=Md.default;eg.exports.ResizableBox=tg.default;var Aj=eg.exports,hi={};Object.defineProperty(hi,"__esModule",{value:!0});hi.resizeHandleType=hi.resizeHandleAxesType=hi.default=void 0;var rt=tO(ds),Ij=tO(m);function tO(e){return e&&e.__esModule?e:{default:e}}const nO=rt.default.arrayOf(rt.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));hi.resizeHandleAxesType=nO;const rO=rt.default.oneOfType([rt.default.node,rt.default.func]);hi.resizeHandleType=rO;var kj={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&<.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:nO,resizeHandle:rO,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={};Ij.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=kj;Object.defineProperty(Kp,"__esModule",{value:!0});Kp.default=void 0;var rl=Fy(m),xt=Fy(ds),Nj=XP,Lj=Aj,ol=lt,xn=Io,QS=hi,Fj=Fy(_y);function Fy(e){return e&&e.__esModule?e:{default:e}}function vo(e,t,n){return t=zj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zj(e){var t=jj(e,"string");return typeof t=="symbol"?t:String(t)}function jj(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 zy extends rl.default.Component{constructor(){super(...arguments),vo(this,"state",{resizing:null,dragging:null,className:""}),vo(this,"elementRef",rl.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,h=l.left/i,p=u.top/i,g=l.top/i;s.left=d-h+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:h,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)(h,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,h,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:h,y:p}=(0,xn.calcXY)(this.getPositionParams(),u,l,i,s);return o.call(this,a,h,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,ol.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,ol.setTransform)(t):(i=(0,ol.setTopLeft)(t),n&&(i.left=(0,ol.perc)(t.left/r),i.width=(0,ol.perc)(t.width/r))),i}mixinDraggable(t,n){return rl.default.createElement(Nj.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:h}=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 rl.default.createElement(Lj.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:h},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:h,maxH:p,minH:g,containerWidth:b}=this.props,{minW:y,maxW:x}=this.props;let _=s;i&&(_=(0,ol.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,h,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=rl.default.Children.only(this.props.children);let h=rl.default.cloneElement(d,{ref:this.elementRef,className:(0,Fj.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 h=this.mixinResizable(h,u,s),h=this.mixinDraggable(h,i),h}}Kp.default=zy;vo(zy,"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:QS.resizeHandleAxesType,resizeHandle:QS.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(zy,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(Od,"__esModule",{value:!0});Od.default=void 0;var zs=Wj(m),Rv=wy,Vj=jy(_y),Be=lt,Bj=Io,ZS=jy(Kp),Hj=jy(hi);function jy(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 Wj(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 Mn(e,t,n){return t=Uj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uj(e){var t=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)}const JS="react-grid-layout";let iO=!1;try{iO=/firefox/i.test(navigator.userAgent)}catch{}class ng extends zs.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:h}=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,h,(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:h}=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,h);const b=h?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:h,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),h,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),h),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,h=(0,Be.getLayoutItem)(a,t),p=d?a:(0,Be.compact)(a,(0,Be.compactType)(this.props),u);this.props.onResizeStop(p,l,h,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(),iO&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(JS)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:s,rowHeight:a,maxRows:l,width:u,containerPadding:d,transformScale:h}=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/h,top:x/h,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,Bj.calcXY)(w,x,y,g.w,g.h);this.setState({droppingDOMNode:zs.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,Rv.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,Rv.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,Rv.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 zs.createElement(ZS.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},zs.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:h,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&&h,O=r.resizeHandles||_,D=E&&p&&r.isBounded!==!1;return zs.createElement(ZS.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,Vj.default)(JS,t),s={height:this.containerHeight(),...n};return zs.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},zs.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Od.default=ng;Mn(ng,"displayName","ReactGridLayout");Mn(ng,"propTypes",Hj.default);Mn(ng,"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 rg={},Aa={};Object.defineProperty(Aa,"__esModule",{value:!0});Aa.findOrGenerateResponsiveLayout=Kj;Aa.getBreakpointFromWidth=Gj;Aa.getColsFromBreakpoint=Yj;Aa.sortBreakpoints=Vy;var Gf=lt;function Gj(e,t){const n=Vy(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 Yj(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function Kj(e,t,n,r,o,i){if(e[n])return(0,Gf.cloneLayout)(e[n]);let s=e[r];const a=Vy(t),l=a.slice(a.indexOf(n));for(let u=0,d=l.length;u<d;u++){const h=l[u];if(e[h]){s=e[h];break}}return s=(0,Gf.cloneLayout)(s||[]),(0,Gf.compact)((0,Gf.correctBounds)(s,{cols:o}),i,o)}function Vy(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(rg,"__esModule",{value:!0});rg.default=void 0;var eC=Qj(m),Kn=sO(ds),$v=wy,El=lt,js=Aa,Xj=sO(Od);function sO(e){return e&&e.__esModule?e:{default:e}}function aO(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(aO=function(r){return r?n:t})(e)}function Qj(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 u0(){return u0=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},u0.apply(this,arguments)}function ip(e,t,n){return t=Zj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zj(e){var t=Jj(e,"string");return typeof t=="symbol"?t:String(t)}function Jj(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 tC=e=>Object.prototype.toString.call(e);function Yf(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class By extends eC.Component{constructor(){super(...arguments),ip(this,"state",this.generateInitialState()),ip(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,js.getBreakpointFromWidth)(n,t),s=(0,js.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,js.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,$v.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,js.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,$v.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,$v.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,js.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,js.getColsFromBreakpoint)(s,r),u={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in u||(u[a]=(0,El.cloneLayout)(this.state.layout));let p=(0,js.findOrGenerateResponsiveLayout)(u,n,s,a,l,i);p=(0,El.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=Yf(this.props.margin,s),h=Yf(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,d,l,h)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:u,...d}=this.props;return eC.createElement(Xj.default,u0({},d,{margin:Yf(i,this.state.breakpoint),containerPadding:Yf(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}rg.default=By;ip(By,"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(tC(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+tC(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,El.validateLayout)(e.layouts[n],"layouts."+n)})},width:Kn.default.number.isRequired,onBreakpointChange:Kn.default.func,onLayoutChange:Kn.default.func,onWidthChange:Kn.default.func});ip(By,"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:El.noop,onLayoutChange:El.noop,onWidthChange:El.noop});var Hy={},lO=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}()}(),d0=typeof window<"u"&&typeof document<"u"&&window.document===document,sp=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")()}(),eV=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(sp):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),tV=2;function nV(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){eV(i)}function a(){var l=Date.now();if(n){if(l-o<tV)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var rV=20,oV=["top","right","bottom","left","width","height","size","weight"],iV=typeof MutationObserver<"u",sV=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=nV(this.refresh.bind(this),rV)}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(){!d0||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),iV?(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(){!d0||!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=oV.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}(),cO=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},tc=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||sp},uO=og(0,0,0,0);function ap(e){return parseFloat(e)||0}function nC(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+ap(i)},0)}function aV(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]=ap(s)}return n}function lV(e){var t=e.getBBox();return og(0,0,t.width,t.height)}function cV(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return uO;var r=tc(e).getComputedStyle(e),o=aV(r),i=o.left+o.right,s=o.top+o.bottom,a=ap(r.width),l=ap(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=nC(r,"left","right")+i),Math.round(l+s)!==n&&(l-=nC(r,"top","bottom")+s)),!dV(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 og(o.left,o.top,a,l)}var uV=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof tc(e).SVGGraphicsElement}:function(e){return e instanceof tc(e).SVGElement&&typeof e.getBBox=="function"}}();function dV(e){return e===tc(e).document.documentElement}function fV(e){return d0?uV(e)?lV(e):cV(e):uO}function hV(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 cO(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function og(e,t,n,r){return{x:e,y:t,width:n,height:r}}var pV=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=og(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=fV(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}(),gV=function(){function e(t,n){var r=hV(n);cO(this,{target:t,contentRect:r})}return e}(),mV=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new lO,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 tc(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new pV(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 tc(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 gV(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}(),dO=typeof WeakMap<"u"?new WeakMap:new lO,fO=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=sV.getInstance(),r=new mV(t,n,this);dO.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){fO.prototype[e]=function(){var t;return(t=dO.get(this))[e].apply(t,arguments)}});var vV=function(){return typeof sp.ResizeObserver<"u"?sp.ResizeObserver:fO}();const bV=Object.freeze(Object.defineProperty({__proto__:null,default:vV},Symbol.toStringTag,{value:"Module"})),yV=oy(bV);Object.defineProperty(Hy,"__esModule",{value:!0});Hy.default=$V;var Kf=SV(m),xV=Wy(ds),wV=Wy(yV),_V=Wy(_y);function Wy(e){return e&&e.__esModule?e:{default:e}}function hO(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(hO=function(r){return r?n:t})(e)}function SV(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=hO(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 f0(){return f0=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},f0.apply(this,arguments)}function il(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=EV(e,"string");return typeof t=="symbol"?t:String(t)}function EV(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 RV="react-grid-layout";function $V(e){var t;return t=class extends Kf.Component{constructor(){super(...arguments),il(this,"state",{width:1280}),il(this,"elementRef",Kf.createRef()),il(this,"mounted",!1),il(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new wV.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?Kf.createElement("div",{className:(0,_V.default)(this.props.className,RV),style:this.props.style,ref:this.elementRef}):Kf.createElement(e,f0({innerRef:this.elementRef},o,this.state))}},il(t,"defaultProps",{measureBeforeMount:!1}),il(t,"propTypes",{measureBeforeMount:xV.default.bool}),t}(function(e){e.exports=Od.default,e.exports.utils=lt,e.exports.calculateUtils=Io,e.exports.Responsive=rg.default,e.exports.Responsive.utils=Aa,e.exports.WidthProvider=Hy.default})(EP);var rC=EP.exports;function _a({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 h(){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?h():e})}const Uy=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}));Uy.displayName="Card";const ig=ie.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se("flex flex-col space-y-1.5 p-6",e),...t}));ig.displayName="CardHeader";const sg=ie.forwardRef(({className:e,...t},n)=>k.jsx("h3",{ref:n,className:Se("text-2xl font-semibold leading-none tracking-tight",e),...t}));sg.displayName="CardTitle";const qy=ie.forwardRef(({className:e,...t},n)=>k.jsx("p",{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));qy.displayName="CardDescription";const ag=ie.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se("px-6 pb-6 pt-0",e),...t}));ag.displayName="CardContent";const Gy=ie.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se("flex items-center p-6 pt-0",e),...t}));Gy.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 Td(e){return e+.5|0}const Yi=(e,t,n)=>Math.max(Math.min(e,n),t);function hu(e){return Yi(Td(e*2.55),0,255)}function ns(e){return Yi(Td(e*255),0,255)}function ii(e){return Yi(Td(e/2.55)/100,0,1)}function oC(e){return Yi(Td(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},h0=[..."0123456789ABCDEF"],PV=e=>h0[e&15],OV=e=>h0[(e&240)>>4]+h0[e&15],Xf=e=>(e&240)>>4===(e&15),MV=e=>Xf(e.r)&&Xf(e.g)&&Xf(e.b)&&Xf(e.a);function DV(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 TV=(e,t)=>e<255?t(e):"";function AV(e){var t=MV(e)?PV:OV;return e?"#"+t(e.r)+t(e.g)+t(e.b)+TV(e.a,t):void 0}const IV=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function pO(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 kV(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 NV(e,t,n){const r=pO(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 LV(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 Yy(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=LV(n,r,o,d,i),l=l*60+.5),[l|0,u||0,a]}function Ky(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(ns)}function Xy(e,t,n){return Ky(pO,e,t,n)}function FV(e,t,n){return Ky(NV,e,t,n)}function zV(e,t,n){return Ky(kV,e,t,n)}function gO(e){return(e%360+360)%360}function jV(e){const t=IV.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?hu(+t[5]):ns(+t[5]));const o=gO(+t[2]),i=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=FV(o,i,s):t[1]==="hsv"?r=zV(o,i,s):r=Xy(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function VV(e,t){var n=Yy(e);n[0]=gO(n[0]+t),n=Xy(n),e.r=n[0],e.g=n[1],e.b=n[2]}function BV(e){if(!e)return;const t=Yy(e),n=t[0],r=oC(t[1]),o=oC(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${ii(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const iC={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"},sC={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 HV(){const e={},t=Object.keys(sC),n=Object.keys(iC);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,iC[i]);i=parseInt(sC[s],16),e[a]=[i>>16&255,i>>8&255,i&255]}return e}let Qf;function WV(e){Qf||(Qf=HV(),Qf.transparent=[0,0,0,0]);const t=Qf[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const UV=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function qV(e){const t=UV.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?hu(s):Yi(s*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?hu(r):Yi(r,0,255)),o=255&(t[4]?hu(o):Yi(o,0,255)),i=255&(t[6]?hu(i):Yi(i,0,255)),{r,g:o,b:i,a:n}}}function GV(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${ii(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Pv=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,sl=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function YV(e,t,n){const r=sl(ii(e.r)),o=sl(ii(e.g)),i=sl(ii(e.b));return{r:ns(Pv(r+n*(sl(ii(t.r))-r))),g:ns(Pv(o+n*(sl(ii(t.g))-o))),b:ns(Pv(i+n*(sl(ii(t.b))-i))),a:e.a+n*(t.a-e.a)}}function Zf(e,t,n){if(e){let r=Yy(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=Xy(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function mO(e,t){return e&&Object.assign(t||{},e)}function aC(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=ns(e[3]))):(t=mO(e,{r:0,g:0,b:0,a:1}),t.a=ns(t.a)),t}function KV(e){return e.charAt(0)==="r"?qV(e):jV(e)}class Uu{constructor(t){if(t instanceof Uu)return t;const n=typeof t;let r;n==="object"?r=aC(t):n==="string"&&(r=DV(t)||WV(t)||KV(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=mO(this._rgb);return t&&(t.a=ii(t.a)),t}set rgb(t){this._rgb=aC(t)}rgbString(){return this._valid?GV(this._rgb):void 0}hexString(){return this._valid?AV(this._rgb):void 0}hslString(){return this._valid?BV(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=YV(this._rgb,t._rgb,n)),this}clone(){return new Uu(this.rgb)}alpha(t){return this._rgb.a=ns(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Td(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 Zf(this._rgb,2,t),this}darken(t){return Zf(this._rgb,2,-t),this}saturate(t){return Zf(this._rgb,1,t),this}desaturate(t){return Zf(this._rgb,1,-t),this}rotate(t){return VV(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 XV=(()=>{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 QV=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,vO=(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 lp(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 cp(e){if(zt(e))return e.map(cp);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]]=cp(e[n[o]]);return t}return e}function bO(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function ZV(e,t,n,r){if(!bO(e))return;const o=t[e],i=n[e];ut(o)&&ut(i)?Mo(o,i,r):t[e]=cp(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||ZV;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 wu(e,t){return Mo(e,t,{merger:JV})}function JV(e,t,n){if(!bO(e))return;const r=t[e],o=n[e];ut(r)&&ut(o)?wu(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=cp(o))}const lC={"":e=>e,x:e=>e.x,y:e=>e.y};function eB(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 tB(e){const t=eB(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function is(e,t){return(lC[t]||(lC[t]=tB(t)))(e)}function Qy(e){return e.charAt(0).toUpperCase()+e.slice(1)}const qu=e=>typeof e<"u",ss=e=>typeof e=="function",cC=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function nB(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Vt=Math.PI,jt=2*Vt,rB=jt+Vt,up=Number.POSITIVE_INFINITY,oB=Vt/180,en=Vt/2,Vs=Vt/4,uC=Vt*2/3,Ki=Math.log10,Ro=Math.sign;function _u(e,t,n){return Math.abs(e-t)<n}function dC(e){const t=Math.round(e);e=_u(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Ki(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function iB(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 nc(e){return!isNaN(parseFloat(e))&&isFinite(e)}function sB(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function yO(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 Zy(e){return e*(180/Vt)}function fC(e){if(!Xt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function xO(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 p0(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function aB(e,t){return(e-t+rB)%jt-Vt}function mr(e){return(e%jt+jt)%jt}function Gu(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 lB(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 Jy(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)=>Jy(e,n,r?o=>{const i=e[o][t];return i<n||i===n&&e[o+1][t]===n}:o=>e[o][t]<n),cB=(e,t,n)=>Jy(e,n,r=>e[r][t]>=n);function uB(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 wO=["push","pop","shift","splice","unshift"];function dB(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),wO.forEach(n=>{const r="_onData"+Qy(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 hC(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)&&(wO.forEach(i=>{delete e[i]}),delete e._chartjs)}function _O(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const SO=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function CO(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,SO.call(window,()=>{r=!1,e.apply(t,n)}))}}function fB(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const ex=e=>e==="start"?"left":e==="end"?"right":"center",Dn=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,hB=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function EO(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:h,maxDefined:p}=s.getUserBounds();h&&(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 RO(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 Jf=e=>e===0||e===1,pC=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*jt/n)),gC=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*jt/n)+1,Su={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=>Jf(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=>Jf(e)?e:pC(e,.075,.3),easeOutElastic:e=>Jf(e)?e:gC(e,.075,.3),easeInOutElastic(e){return Jf(e)?e:e<.5?.5*pC(e*2,.1125,.45):.5+.5*gC(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-Su.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?Su.easeInBounce(e*2)*.5:Su.easeOutBounce(e*2-1)*.5+.5};function tx(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function mC(e){return tx(e)?e:new Uu(e)}function Ov(e){return tx(e)?e:new Uu(e).saturate(.5).darken(.1).hexString()}const pB=["x","y","borderWidth","radius","tension"],gB=["color","borderColor","backgroundColor"];function mB(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:gB},numbers:{type:"number",properties:pB}}),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 vB(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const vC=new Map;function bB(e,t){t=t||{};const n=e+JSON.stringify(t);let r=vC.get(n);return r||(r=new Intl.NumberFormat(e,t),vC.set(n,r)),r}function Ad(e,t,n){return bB(t,n).format(e)}const $O={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=yB(e,n)}const s=Ki(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),Ad(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Ki(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?$O.numeric.call(this,e,t,n):""}};function yB(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 lg={formatters:$O};function xB(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:lg.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 Sa=Object.create(null),g0=Object.create(null);function Cu(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 Mv(e,t,n){return typeof t=="string"?Mo(Cu(e,t),n):Mo(Cu(e,""),t)}class wB{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)=>Ov(o.backgroundColor),this.hoverBorderColor=(r,o)=>Ov(o.borderColor),this.hoverColor=(r,o)=>Ov(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 Mv(this,t,n)}get(t){return Cu(this,t)}describe(t,n){return Mv(g0,t,n)}override(t,n){return Mv(Sa,t,n)}route(t,n,r,o){const i=Cu(this,t),s=Cu(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 wB({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[mB,vB,xB]);function _B(e){return!e||at(e.size)||at(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function dp(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 SB(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,h,p;for(l=0;l<a;l++)if(h=n[l],h!=null&&!zt(h))s=dp(e,o,i,s,h);else if(zt(h))for(u=0,d=h.length;u<d;u++)p=h[u],p!=null&&!zt(p)&&(s=dp(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 Bs(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 bC(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function m0(e,t,n,r){PO(e,t,n,r,null)}function PO(e,t,n,r,o){let i,s,a,l,u,d,h,p;const g=t.pointStyle,b=t.rotation,y=t.radius;let x=(b||0)*oB;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+=uC,e.lineTo(n+Math.sin(x)*d,r-Math.cos(x)*y),x+=uC,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+Vs)*l,h=Math.cos(x+Vs)*(o?o/2-u:l),a=Math.sin(x+Vs)*l,p=Math.sin(x+Vs)*(o?o/2-u:l),e.arc(n-h,r-a,u,x-Vt,x-en),e.arc(n+p,r-s,u,x-en,x),e.arc(n+h,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+=Vs;case"rectRot":h=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-h,r-a),e.lineTo(n+p,r-s),e.lineTo(n+h,r+a),e.lineTo(n-p,r+s),e.closePath();break;case"crossRot":x+=Vs;case"cross":h=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-h,r-a),e.lineTo(n+h,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s);break;case"star":h=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-h,r-a),e.lineTo(n+h,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s),x+=Vs,h=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-h,r-a),e.lineTo(n+h,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 cg(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function ug(e){e.restore()}function CB(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 EB(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 RB(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 $B(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 PB(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Ca(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,RB(e,i),l=0;l<s.length;++l)u=s[l],i.backdrop&&PB(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),$B(e,n,r,u,i),r+=Number(o.lineHeight);e.restore()}function Yu(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 OB=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,MB=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function DB(e,t){const n=(""+e).match(OB);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 TB=e=>+e||0;function nx(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]=TB(i(s));return n}function OO(e){return nx(e,{top:"y",right:"x",bottom:"y",left:"x"})}function ha(e){return nx(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Cn(e){const t=OO(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(MB)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:Ke(e.family,t.family),lineHeight:DB(Ke(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Ke(e.weight,t.weight),string:""};return o.string=_B(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 AB(e,t,n){const{min:r,max:o}=e,i=vO(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 fs(e,t){return Object.assign(Object.create(e),t)}function rx(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=AO("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:a=>rx([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 DO(a,l,()=>VB(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return xC(a).includes(l)},ownKeys(a){return xC(a)},set(a,l,u){const d=a._storage||(a._storage=o());return a[l]=d[l]=u,delete a._keys,!0}})}function rc(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:MO(e,r),setContext:i=>rc(e,i,n,r),override:i=>rc(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 DO(i,s,()=>kB(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 MO(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:ss(n)?n:()=>n,isIndexable:ss(r)?r:()=>r}}const IB=(e,t)=>e?e+Qy(t):t,ox=(e,t)=>ut(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function DO(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function kB(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=e;let a=r[t];return ss(a)&&s.isScriptable(t)&&(a=NB(t,a,e,n)),zt(a)&&a.length&&(a=LB(t,a,e,s.isIndexable)),ox(t,a)&&(a=rc(a,o,i&&i[t],s)),a}function NB(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),ox(e,l)&&(l=ix(o._scopes,o,e,l)),l}function LB(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 h=ix(u,o,e,d);t.push(rc(h,i,s&&s[e],a))}}return t}function TO(e,t,n){return ss(e)?e(t,n):e}const FB=(e,t)=>e===!0?t:typeof e=="string"?is(t,e):void 0;function zB(e,t,n,r,o){for(const i of t){const s=FB(n,i);if(s){e.add(s);const a=TO(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 ix(e,t,n,r){const o=t._rootScopes,i=TO(t._fallback,n,r),s=[...e,...o],a=new Set;a.add(r);let l=yC(a,s,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=yC(a,s,i,l,r),l===null)?!1:rx(Array.from(a),[""],o,i,()=>jB(t,n,r))}function yC(e,t,n,r,o){for(;n;)n=zB(e,t,n,r,o);return n}function jB(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return zt(o)&&ut(n)?n:o||{}}function VB(e,t,n,r){let o;for(const i of t)if(o=AO(IB(i,e),n),typeof o<"u")return ox(e,o)?ix(n,r,e,o):o}function AO(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function xC(e){let t=e._keys;return t||(t=e._keys=BB(e._scopes)),t}function BB(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 IO(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(is(d,i),u)};return s}const HB=Number.EPSILON||1e-14,oc=(e,t)=>t<e.length&&!e[t].skip&&e[t],kO=e=>e==="x"?"y":"x";function WB(e,t,n,r){const o=e.skip?t:e,i=t,s=n.skip?t:n,a=p0(i,o),l=p0(s,i);let u=a/(a+l),d=l/(a+l);u=isNaN(u)?0:u,d=isNaN(d)?0:d;const h=r*u,p=r*d;return{previous:{x:i.x-h*(s.x-o.x),y:i.y-h*(s.y-o.y)},next:{x:i.x+p*(s.x-o.x),y:i.y+p*(s.y-o.y)}}}function UB(e,t,n){const r=e.length;let o,i,s,a,l,u=oc(e,0);for(let d=0;d<r-1;++d)if(l=u,u=oc(e,d+1),!(!l||!u)){if(_u(t[d],0,HB)){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 qB(e,t,n="x"){const r=kO(n),o=e.length;let i,s,a,l=oc(e,0);for(let u=0;u<o;++u){if(s=a,a=l,l=oc(e,u+1),!a)continue;const d=a[n],h=a[r];s&&(i=(d-s[n])/3,a[`cp1${n}`]=d-i,a[`cp1${r}`]=h-i*t[u]),l&&(i=(l[n]-d)/3,a[`cp2${n}`]=d+i,a[`cp2${r}`]=h+i*t[u])}}function GB(e,t="x"){const n=kO(t),r=e.length,o=Array(r).fill(0),i=Array(r);let s,a,l,u=oc(e,0);for(s=0;s<r;++s)if(a=l,l=u,u=oc(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]}UB(e,o,i),qB(e,i,t)}function eh(e,t,n){return Math.max(Math.min(e,n),t)}function YB(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=eh(o.cp1x,t.left,t.right),o.cp1y=eh(o.cp1y,t.top,t.bottom)),a&&(o.cp2x=eh(o.cp2x,t.left,t.right),o.cp2y=eh(o.cp2y,t.top,t.bottom)))}function KB(e,t,n,r,o){let i,s,a,l;if(t.spanGaps&&(e=e.filter(u=>!u.skip)),t.cubicInterpolationMode==="monotone")GB(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=WB(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&&YB(e,n)}function sx(){return typeof window<"u"&&typeof document<"u"}function ax(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function fp(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 dg=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function XB(e,t){return dg(e).getPropertyValue(t)}const QB=["top","right","bottom","left"];function pa(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=QB[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const ZB=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function JB(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let s=!1,a,l;if(ZB(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 qs(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=dg(n),i=o.boxSizing==="border-box",s=pa(o,"padding"),a=pa(o,"border","width"),{x:l,y:u,box:d}=JB(e,n),h=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-h)/g*n.width/r),y:Math.round((u-p)/b*n.height/r)}}function eH(e,t,n){let r,o;if(t===void 0||n===void 0){const i=ax(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const s=i.getBoundingClientRect(),a=dg(i),l=pa(a,"border","width"),u=pa(a,"padding");t=s.width-u.width-l.width,n=s.height-u.height-l.height,r=fp(a.maxWidth,i,"clientWidth"),o=fp(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||up,maxHeight:o||up}}const th=e=>Math.round(e*10)/10;function tH(e,t,n,r){const o=dg(e),i=pa(o,"margin"),s=fp(o.maxWidth,e,"clientWidth")||up,a=fp(o.maxHeight,e,"clientHeight")||up,l=eH(e,t,n);let{width:u,height:d}=l;if(o.boxSizing==="content-box"){const p=pa(o,"border","width"),g=pa(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=th(Math.min(u,s,l.maxWidth)),d=th(Math.min(d,a,l.maxHeight)),u&&!d&&(d=th(u/2)),(t!==void 0||n!==void 0)&&r&&l.height&&d>l.height&&(d=l.height,u=th(Math.floor(d*r))),{width:u,height:d}}function wC(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 nH=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};sx()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function _C(e,t){const n=XB(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Gs(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function rH(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 oH(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},s=Gs(e,o,n),a=Gs(o,i,n),l=Gs(i,t,n),u=Gs(s,a,n),d=Gs(a,l,n);return Gs(u,d,n)}const iH=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}}},sH=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Rl(e,t,n){return e?iH(t,n):sH()}function NO(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 LO(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function FO(e){return e==="angle"?{between:Gu,compare:aB,normalize:mr}:{between:li,compare:(t,n)=>t-n,normalize:t=>t}}function SC({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 aH(e,t,n){const{property:r,start:o,end:i}=n,{between:s,normalize:a}=FO(r),l=t.length;let{start:u,end:d,loop:h}=e,p,g;if(h){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:h,style:e.style}}function zO(e,t,n){if(!n)return[e];const{property:r,start:o,end:i}=n,s=t.length,{compare:a,between:l,normalize:u}=FO(r),{start:d,end:h,loop:p,style:g}=aH(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<=h;++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(SC({start:x,end:D,loop:p,count:s,style:g})),x=null),I=D,C=_));return x!==null&&b.push(SC({start:x,end:h,loop:p,count:s,style:g})),b}function jO(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const i=zO(r[o],e.points,t);i.length&&n.push(...i)}return n}function lH(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 cH(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 uH(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:s,end:a}=lH(n,o,i,r);if(r===!0)return CC(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 CC(e,cH(n,s,l,u),n,t)}function CC(e,t,n,r){return!r||!r.setContext||!n?t:dH(e,t,n,r)}function dH(e,t,n,r){const o=e._chart.getContext(),i=EC(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,u=[];let d=i,h=t[0].start,p=h;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=_,h=y%l)}}for(const b of t){h=a?h:b.start;let y=n[h%l],x;for(p=h+1;p<=b.end;p++){const _=n[p%l];x=EC(r.setContext(fs(o,{type:"segment",p0:y,p1:_,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:s}))),fH(x,d)&&g(h,p-1,b.loop,d),y=_,d=x}h<p-1&&g(h,p-1,b.loop,d)}return u}function EC(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function fH(e,t){if(!t)return!1;const n=[],r=function(o,i){return tx(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 hH{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=SO.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 hH;const RC="transparent",pH={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=mC(e||RC),o=r.valid&&mC(t||RC);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class gH{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||pH[t.type||typeof s],this._easing=Su[t.easing]||Su.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 VO{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=vH(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&mH(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 h=i[u];const p=r.get(u);if(h)if(p&&h.active()){h.update(p,d,a);continue}else h.cancel();if(!p||!p.duration){t[u]=d;continue}i[u]=h=new gH(p,t,u,d),o.push(h)}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 mH(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 vH(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 $C(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 bH(e,t,n){if(n===!1)return!1;const r=$C(e,n),o=$C(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function yH(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 BO(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 PC(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 xH(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 OC(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function wH(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function _H(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 SH(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function MC(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 DC(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=wH(i,s,r),h=t.length;let p;for(let g=0;g<h;++g){const b=t[g],{[l]:y,[u]:x}=b,_=b._stacks||(b._stacks={});p=_[u]=SH(o,d,y),p[a]=x,p._top=MC(p,s,!0,r.type),p._bottom=MC(p,s,!1,r.type);const w=p._visualValues||(p._visualValues={});w[a]=x}}function Dv(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function CH(e,t){return fs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function EH(e,t,n){return fs(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Xc(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 Tv=e=>e==="reset"||e==="none",TC=(e,t)=>t?e:Object.assign({},e),RH=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:BO(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=OC(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&&Xc(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(h,p,g,b)=>h==="x"?p:h==="r"?b:g,i=n.xAxisID=Ke(r.xAxisID,Dv(t,"x")),s=n.yAxisID=Ke(r.yAxisID,Dv(t,"y")),a=n.rAxisID=Ke(r.rAxisID,Dv(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&&hC(this._data,this),t._stacked&&Xc(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(ut(n))this._data=xH(n);else if(r!==n){if(r){hC(r,this);const o=this._cachedMeta;Xc(o),o._parsed=[]}n&&Object.isExtensible(n)&&dB(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=OC(n.vScale,n),n.stack!==r.stack&&(o=!0,Xc(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&DC(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,h,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=()=>h[a]===null||u&&h[a]<u[a];for(d=0;d<n;++d)r._parsed[d+t]=h=p[d],l&&(g()&&(l=!1),u=h);r._sorted=l}s&&DC(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,h=new Array(o);let p,g,b;for(p=0,g=o;p<g;++p)b=p+r,h[p]={[a]:d||i.parse(u[b],b),[l]:s.parse(n[b],b)};return h}parseArrayData(t,n,r,o){const{xScale:i,yScale:s}=t,a=new Array(o);let l,u,d,h;for(l=0,u=o;l<u;++l)d=l+r,h=n[d],a[l]={x:i.parse(h[0],d),y:s.parse(h[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,h,p,g;for(d=0,h=o;d<h;++d)p=d+r,g=n[p],u[d]={x:i.parse(is(g,a),p),y:s.parse(is(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:BO(o,!0),values:n._stacks[t.axis]._visualValues};return PC(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=PC(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=RH(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:h}=_H(a);let p,g;function b(){g=o[p];const y=g[a.axis];return!Xt(g[t.axis])||d>y||h<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=yH(Ke(this.options.clip,bH(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 h=o[d];h.hidden||(h.active&&u?s.push(h):h.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=EH(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=CH(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&&qu(r);if(a)return TC(a,l);const u=this.chart.config,d=u.datasetElementScopeKeys(this._type,t),h=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,h);return y.$shared&&(y.$shared=l,i[s]=Object.freeze(TC(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,h=d.datasetAnimationScopeKeys(this._type,n),p=d.getOptionScopes(this.getDataset(),h);l=d.createResolver(p,this.getContext(t,r,n))}const u=new VO(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||Tv(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){Tv(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!Tv(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&&Xc(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 $H(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=_O(r.sort((o,i)=>o-i))}return e._cache.$bar}function PH(e){const t=e.iScale,n=$H(t,e.type);let r=t._length,o,i,s,a;const l=()=>{s===32767||s===-32768||(qu(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 OH(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 MH(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 DH(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 HO(e,t,n,r){return zt(e)?DH(e,t,n,r):t[n.axis]=n.parse(e,r),t}function AC(e,t,n,r){const o=e.iScale,i=e.vScale,s=o.getLabels(),a=o===i,l=[];let u,d,h,p;for(u=n,d=n+r;u<d;++u)p=t[u],h={},h[o.axis]=a||o.parse(s[u],u),l.push(HO(p,h,i,u));return l}function Av(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function TH(e,t,n){return e!==0?Ro(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function AH(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 IH(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}=AH(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=u:(n._bottom||0)===r?o=d:(i[IC(d,s,a,l)]=!0,o=u)),i[IC(o,s,a,l)]=!0,e.borderSkipped=i}function IC(e,t,n,r){return r?(e=kH(e,t,n),e=kC(e,n,t)):e=kC(e,t,n),e}function kH(e,t,n){return e===t?n:e===n?t:e}function kC(e,t,n){return e==="start"?t:e==="end"?n:e}function NH(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Ah extends ro{parsePrimitiveData(t,n,r,o){return AC(t,n,r,o)}parseArrayData(t,n,r,o){return AC(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,h=[];let p,g,b,y;for(p=r,g=r+o;p<g;++p)y=n[p],b={},b[i.axis]=i.parse(is(y,u),p),h.push(HO(is(y,d),b,s,p));return h}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=Av(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:h,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:!_||Av(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=h||this.resolveDataElementOptions(g,t[g].active?"active":o));const C=w.options||t[g].options;IH(w,C,_,s),NH(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||PH(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=Av(u);let h=l[n.axis],p=0,g=r?this.applyStack(n,l,r):h,b,y;g!==h&&(p=g-h,g=h),d&&(h=u.barStart,g=u.barEnd-u.barStart,h!==0&&Ro(h)!==Ro(u.barEnd)&&(p=0),p+=h);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=TH(y,n,a)*s,h===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"?MH(t,n,o,u):OH(t,n,o,u),h=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0);a=d.start+d.chunk*h+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(Ah,"id","bar"),Ce(Ah,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Ce(Ah,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Ih 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,h=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[h]=i?a.getBasePixel():a.getPixelForValue(b[h]);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(Ih,"id","bubble"),Ce(Ih,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Ce(Ih,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function LH(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),h=Math.cos(l),p=Math.sin(l),g=(C,R,E)=>Gu(C,a,l,!0)?1:Math.max(R,R*n,E,E*n),b=(C,R,E)=>Gu(C,a,l,!0)?-1:Math.min(R,R*n,E,E*n),y=g(0,u,h),x=g(en,d,p),_=b(Vt,u,h),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 ta 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=>+is(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(QV(this.options.cutout,a),1),u=this._getRingWeight(this.index),{circumference:d,rotation:h}=this._getRotationExtents(),{ratioX:p,ratioY:g,offsetX:b,offsetY:y}=LH(h,d,l),x=(r.width-s)/p,_=(r.height-s)/g,w=Math.max(Math.min(x,_)/2,0),C=vO(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,h=(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:h+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=Ad(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(ta,"id","doughnut"),Ce(ta,"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(ta,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Ce(ta,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:r,color: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 kh 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}=EO(n,o,s);this._drawStart=a,this._drawCount=l,RO(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:h}=this._getSharedOptions(n,o),p=s.axis,g=a.axis,{spanGaps:b,segment:y}=this.options,x=nc(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]),h&&(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(kh,"id","line"),Ce(kh,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ce(kh,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Eu 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=Ad(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return IO.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,h=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:h,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(Eu,"id","polarArea"),Ce(Eu,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Ce(Eu,"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 v0 extends ta{}Ce(v0,"id","pie"),Ce(v0,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Nh 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 IO.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),h=s?i.xCenter:d.x,p=s?i.yCenter:d.y,g={x:h,y:p,angle:d.angle,skip:isNaN(h)||isNaN(p),options:u};this.updateElement(l,a,g,o)}}}Ce(Nh,"id","radar"),Ce(Nh,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Ce(Nh,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Lh 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}=EO(n,r,o);if(this._drawStart=i,this._drawCount=s,RO(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),h=this.getSharedOptions(d),p=this.includeOptions(o,h),g=s.axis,b=a.axis,{spanGaps:y,segment:x}=this.options,_=nc(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=h||this.resolveDataElementOptions(R,E.active?"active":o)),w||this.updateElement(E,R,O,o),C=T}this.updateSharedOptions(h,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(Lh,"id","scatter"),Ce(Lh,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Ce(Lh,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var FH=Object.freeze({__proto__:null,BarController:Ah,BubbleController:Ih,DoughnutController:ta,LineController:kh,PieController:v0,PolarAreaController:Eu,RadarController:Nh,ScatterController:Lh});function Hs(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class lx{constructor(t){Ce(this,"options");this.options=t||{}}static override(t){Object.assign(lx.prototype,t)}init(){}formats(){return Hs()}parse(){return Hs()}format(){return Hs()}add(){return Hs()}diff(){return Hs()}startOf(){return Hs()}endOf(){return Hs()}}var zH={_date:lx};function jH(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?cB:ci;if(r){if(o._sharedOptions){const u=i[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const h=l(i,t,n-d),p=l(i,t,n+d);return{lo:h.lo,hi:p.hi}}}}else return l(i,t,n)}return{lo:0,hi:i.length-1}}function Id(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:h,hi:p}=jH(i[a],t,s,o);for(let g=h;g<=p;++g){const b=d[g];b.skip||r(b,u,g)}}}function VH(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 Iv(e,t,n,r,o){const i=[];return!o&&!e.isPointInArea(t)||Id(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 BH(e,t,n,r){let o=[];function i(s,a,l){const{startAngle:u,endAngle:d}=s.getProps(["startAngle","endAngle"],r),{angle:h}=xO(s,{x:t.x,y:t.y});Gu(h,u,d)&&o.push({element:s,datasetIndex:a,index:l})}return Id(e,n,t,i),o}function HH(e,t,n,r,o,i){let s=[];const a=VH(n);let l=Number.POSITIVE_INFINITY;function u(d,h,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:h,index:p}],l=x):x===l&&s.push({element:d,datasetIndex:h,index:p})}return Id(e,n,t,u),s}function kv(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?BH(e,t,n,o):HH(e,t,n,r,o,i)}function NC(e,t,n,r,o){const i=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return Id(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 WH={evaluateInteractionItems:Id,modes:{index(e,t,n,r){const o=qs(t,e),i=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?Iv(e,o,i,r,s):kv(e,o,i,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const d=a[0].index,h=u.data[d];h&&!h.skip&&l.push({element:h,datasetIndex:u.index,index:d})}),l):[]},dataset(e,t,n,r){const o=qs(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?Iv(e,o,i,r,s):kv(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=qs(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return Iv(e,o,i,r,s)},nearest(e,t,n,r){const o=qs(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return kv(e,o,i,n.intersect,r,s)},x(e,t,n,r){const o=qs(t,e);return NC(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=qs(t,e);return NC(e,o,"y",n.intersect,r)}}};const WO=["left","top","right","bottom"];function Qc(e,t){return e.filter(n=>n.pos===t)}function LC(e,t){return e.filter(n=>WO.indexOf(n.pos)===-1&&n.box.axis===t)}function Zc(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 UH(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 qH(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!WO.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 GH(e,t){const n=qH(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 YH(e){const t=UH(e),n=Zc(t.filter(u=>u.box.fullSize),!0),r=Zc(Qc(t,"left"),!0),o=Zc(Qc(t,"right")),i=Zc(Qc(t,"top"),!0),s=Zc(Qc(t,"bottom")),a=LC(t,"x"),l=LC(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:Qc(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(s).concat(a)}}function FC(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function UO(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 KH(e,t,n,r){const{pos:o,box:i}=n,s=e.maxPadding;if(!ut(o)){n.size&&(e[o]-=n.size);const h=r[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?i.height:i.width),n.size=h.size/h.count,e[o]+=n.size}i.getPadding&&UO(s,i.getPadding());const a=Math.max(0,t.outerWidth-FC(s,e,"left","right")),l=Math.max(0,t.outerHeight-FC(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 XH(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 QH(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 pu(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,QH(a.horizontal,t));const{same:h,other:p}=KH(t,n,a,r);u|=h&&o.length,d=d||p,l.fullSize||o.push(a)}return u&&pu(o,t,n,r)||d}function nh(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 zC(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 h=t.w*d,p=u.size||l.height;qu(u.start)&&(s=u.start),l.fullSize?nh(l,o.left,s,n.outerWidth-o.right-o.left,p):nh(l,t.left+u.placed,s,h,p),u.start=s,u.placed+=h,s=l.bottom}else{const h=t.h*d,p=u.size||l.width;qu(u.start)&&(i=u.start),l.fullSize?nh(l,i,o.top,p,n.outerHeight-o.bottom-o.top):nh(l,i,t.top+u.placed,p,h),u.start=i,u.placed+=h,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=YH(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,h=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:s,vBoxMaxWidth:i/2/d,hBoxMaxHeight:s/2}),p=Object.assign({},o);UO(p,Cn(r));const g=Object.assign({maxPadding:p,w:i,h:s,x:o.left,y:o.top},o),b=GH(l.concat(u),h);pu(a.fullSize,g,h,b),pu(l,g,h,b),pu(u,g,h,b)&&pu(l,g,h,b),XH(g),zC(a.leftAndTop,g,h,b),g.x+=g.w,g.y+=g.h,zC(a.rightAndBottom,g,h,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 qO{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 ZH extends qO{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Fh="$chartjs",JH={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},jC=e=>e===null||e==="";function eW(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[Fh]={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",jC(o)){const i=_C(e,"width");i!==void 0&&(e.width=i)}if(jC(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=_C(e,"height");i!==void 0&&(e.height=i)}return e}const GO=nH?{passive:!0}:!1;function tW(e,t,n){e.addEventListener(t,n,GO)}function nW(e,t,n){e.canvas.removeEventListener(t,n,GO)}function rW(e,t){const n=JH[e.type]||e.type,{x:r,y:o}=qs(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function hp(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function oW(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||hp(a.addedNodes,r),s=s&&!hp(a.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function iW(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||hp(a.removedNodes,r),s=s&&!hp(a.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const Ku=new Map;let VC=0;function YO(){const e=window.devicePixelRatio;e!==VC&&(VC=e,Ku.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function sW(e,t){Ku.size||window.addEventListener("resize",YO),Ku.set(e,t)}function aW(e){Ku.delete(e),Ku.size||window.removeEventListener("resize",YO)}function lW(e,t,n){const r=e.canvas,o=r&&ax(r);if(!o)return;const i=CO((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),sW(e,i),s}function Nv(e,t,n){n&&n.disconnect(),t==="resize"&&aW(e)}function cW(e,t,n){const r=e.canvas,o=CO(i=>{e.ctx!==null&&n(rW(i,e))},e);return tW(r,t,o),o}class uW extends qO{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(eW(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Fh])return!1;const r=n[Fh].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[Fh],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),s={attach:oW,detach:iW,resize:lW}[n]||cW;o[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:Nv,detach:Nv,resize:Nv}[n]||nW)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return tH(t,n,r,o)}isAttached(t){const n=ax(t);return!!(n&&n.isConnected)}}function dW(e){return!sx()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?ZH:uW}var Mh;let yi=(Mh=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 nc(this.x)&&nc(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(Mh,"defaults",{}),Ce(Mh,"defaultRoutes"),Mh);function fW(e,t){const n=e.options.ticks,r=hW(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?gW(t):[],s=i.length,a=i[0],l=i[s-1],u=[];if(s>o)return mW(t,u,i,s/o),u;const d=pW(i,t,o);if(s>0){let h,p;const g=s>1?Math.round((l-a)/(s-1)):null;for(rh(t,u,d,at(g)?0:a-g,a),h=0,p=s-1;h<p;h++)rh(t,u,d,i[h],i[h+1]);return rh(t,u,d,l,at(g)?t.length:l+g),u}return rh(t,u,d),u}function hW(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 pW(e,t,n){const r=vW(e),o=t.length/n;if(!r)return Math.max(o,1);const i=iB(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 gW(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function mW(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 rh(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 vW(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 bW=e=>e==="left"?"right":e==="right"?"left":e,BC=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,HC=(e,t)=>Math.min(t||e,e);function WC(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 yW(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 xW(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 Jc(e){return e.drawTicks?e.tickLength:0}function UC(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 wW(e,t){return fs(e,{scale:t,type:"scale"})}function _W(e,t,n){return fs(e,{tick:n,index:t,type:"tick"})}function SW(e,t,n){let r=ex(e);return(n&&t!=="right"||!n&&t==="right")&&(r=bW(r)),r}function CW(e,t,n,r){const{top:o,left:i,bottom:s,right:a,chart:l}=e,{chartArea:u,scales:d}=l;let h=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=BC(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=BC(e,n,t);b=Dn(r,s,o),h=n==="left"?-en:en}return{titleX:g,titleY:b,maxWidth:p,rotation:h}}class Ia 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=AB(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?WC(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=fW(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=HC(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(),h=d.widest.width,p=d.highest.height,g=gn(this.chart.width-h,0,this.maxWidth);a=t.offset?this.maxWidth/r:g/(r-1),h+6>a&&(a=g/(r-(t.offset?.5:1)),l=this.maxHeight-Jc(t.grid)-n.padding-UC(t.title,this.chart.options.font),u=Math.sqrt(h*h+p*p),s=Zy(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=UC(o,n.options.font);if(a?(t.width=this.maxWidth,t.height=Jc(i)+l):(t.height=this.maxHeight,t.width=Jc(i)+l),r.display&&this.ticks.length){const{first:u,last:d,widest:h,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*h.width+y*p.height;t.height=Math.min(this.maxHeight,t.height+_+g)}else{const _=r.mirror?0:y*h.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,h=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-h+s)*this.width/(this.width-h),0)}else{let d=n.height/2,h=t.height/2;i==="start"?(d=0,h=t.height):i==="end"&&(d=n.height,h=0),this.paddingTop=d+s,this.paddingBottom=h+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=WC(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/HC(n,r));let u=0,d=0,h,p,g,b,y,x,_,w,C,R,E;for(h=0;h<n;h+=l){if(b=t[h].label,y=this._resolveTickFontOptions(h),o.font=x=y.string,_=i[x]=i[x]||{data:{},gc:[]},w=y.lineHeight,C=R=0,!at(b)&&!zt(b))C=dp(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=dp(o,_.data,_.gc,C,E),R+=w);s.push(C),a.push(R),u=Math.max(C,u),d=Math.max(R,d)}xW(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 lB(this._alignToPixels?Bs(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=_W(this.getContext(),t,r))}return this.$context||(this.$context=wW(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(),h=this.ticks.length+(l?1:0),p=Jc(i),g=[],b=a.setContext(this.getContext()),y=b.display?b.width:0,x=y/2,_=function(Z){return Bs(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,h),F=Math.max(1,Math.ceil(h/ee));for(C=0;C<h;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=yW(this,C,l),R!==void 0&&(E=Bs(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=h,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:h}=i,p=Jc(r.grid),g=p+d,b=h?-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,h&&(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,h,p;this.isHorizontal()?(u=Bs(t,this.left,s)-s/2,d=Bs(t,this.right,a)+a/2,h=p=l):(h=Bs(t,this.top,s)-s/2,p=Bs(t,this.bottom,a)+a/2,u=d=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(u,h),n.lineTo(d,p),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,o=this._computeLabelArea();o&&cg(r,o);const i=this.getLabelItems(t);for(const s of i){const a=s.options,l=s.font,u=s.label,d=s.textOffset;Ca(r,u,0,d,l,a)}o&&ug(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:h,rotation:p}=CW(this,l,n,a);Ca(t,r.text,0,0,i,{color:r.color,maxWidth:h,rotation:p,textAlign:SW(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!==Ia.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 oh{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;$W(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,EW(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 Sa[r])}}function EW(e,t,n){const r=Mo(Object.create(null),[n?qt.get(n):{},qt.get(t),e.defaults]);qt.set(t,r),e.defaultRoutes&&RW(t,e.defaultRoutes),e.descriptors&&qt.describe(t,e.descriptors)}function RW(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 $W(e){return"id"in e&&"defaults"in e}class PW{constructor(){this.controllers=new oh(ro,"datasets",!0),this.elements=new oh(yi,"elements"),this.plugins=new oh(Object,"plugins"),this.scales=new oh(Ia,"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=Qy(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 PW;class OW{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=MW(r);return o===!1&&!n?[]:TW(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 MW(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 DW(e,t){return!t&&e===!1?null:e===!0?{}:e}function TW(e,{plugins:t,localIds:n},r,o){const i=[],s=e.getContext();for(const a of t){const l=a.id,u=DW(r[l],o);u!==null&&i.push({plugin:a,options:AW(e.config,{plugin:a,local:n[l]},u,s)})}return i}function AW(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 b0(e,t){const n=qt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function IW(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function kW(e,t){return e===t?"_index_":"_value_"}function qC(e){if(e==="x"||e==="y"||e==="r")return e}function NW(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function y0(e,...t){if(qC(e))return e;for(const n of t){const r=n.axis||NW(n.position)||e.length>1&&qC(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function GC(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function LW(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 GC(e,"x",n[0])||GC(e,"y",n[0])}return{}}function FW(e,t){const n=Sa[e.type]||{scales:{}},r=t.scales||{},o=b0(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=y0(s,a,LW(s,e),qt.scales[a.type]),u=kW(l,o),d=n.scales||{};i[s]=wu(Object.create(null),[{axis:l},a,d[l],d[u]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||b0(a,t),d=(Sa[a]||{}).scales||{};Object.keys(d).forEach(h=>{const p=IW(h,l),g=s[p+"AxisID"]||p;i[g]=i[g]||Object.create(null),wu(i[g],[{axis:p},r[g],d[h]])})}),Object.keys(i).forEach(s=>{const a=i[s];wu(a,[qt.scales[a.type],qt.scale])}),i}function KO(e){const t=e.options||(e.options={});t.plugins=Ke(t.plugins,{}),t.scales=FW(e,t)}function XO(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function zW(e){return e=e||{},e.data=XO(e.data),KO(e),e}const YC=new Map,QO=new Set;function ih(e,t){let n=YC.get(e);return n||(n=t(),YC.set(e,n),QO.add(n)),n}const eu=(e,t,n)=>{const r=is(t,n);r!==void 0&&e.add(r)};class jW{constructor(t){this._config=zW(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=XO(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(),KO(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ih(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return ih(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return ih(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return ih(`${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(h=>eu(l,t,h))),d.forEach(h=>eu(l,o,h)),d.forEach(h=>eu(l,Sa[i]||{},h)),d.forEach(h=>eu(l,qt,h)),d.forEach(h=>eu(l,g0,h))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),QO.has(n)&&s.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,Sa[n]||{},qt.datasets[n]||{},{type:n},qt,g0]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:a}=KC(this._resolverCache,t,o);let l=s;if(BW(s,n)){i.$shared=!1,r=ss(r)?r():r;const u=this.createResolver(t,r,a);l=rc(s,r,u)}for(const u of n)i[u]=l[u];return i}createResolver(t,n,r=[""],o){const{resolver:i}=KC(this._resolverCache,t,r);return ut(n)?rc(i,n,void 0,o):i}}function KC(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:rx(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(o,i)),i}const VW=e=>ut(e)&&Object.getOwnPropertyNames(e).some(t=>ss(e[t]));function BW(e,t){const{isScriptable:n,isIndexable:r}=MO(e);for(const o of t){const i=n(o),s=r(o),a=(s||i)&&e[o];if(i&&(ss(a)||VW(a))||s&&zt(a))return!0}return!1}var HW="4.4.1";const WW=["top","bottom","left","right","chartArea"];function XC(e,t){return e==="top"||e==="bottom"||WW.indexOf(e)===-1&&t==="x"}function QC(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function ZC(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Pt(n&&n.onComplete,[e],t)}function UW(e){const t=e.chart,n=t.options.animation;Pt(n&&n.onProgress,[e],t)}function ZO(e){return sx()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const zh={},JC=e=>{const t=ZO(e);return Object.values(zh).filter(n=>n.canvas===t).pop()};function qW(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 GW(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function sh(e,t,n){return e.options.clip?e[n]:t[n]}function YW(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:sh(n,t,"left"),right:sh(n,t,"right"),top:sh(r,t,"top"),bottom:sh(r,t,"bottom")}:t}class Vr{static register(...t){bo.add(...t),eE()}static unregister(...t){bo.remove(...t),eE()}constructor(t,n){const r=this.config=new jW(n),o=ZO(t),i=JC(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||dW(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=XV(),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 OW,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=fB(h=>this.update(h),s.resizeDelay||0),this._dataChanges=[],zh[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}ni.listen(this,"complete",ZC),ni.listen(this,"progress",UW),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():wC(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return bC(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,wC(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=y0(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=y0(l,a),d=Ke(a.type,s.dtype);(a.position===void 0||XC(a.position,u)!==XC(s.dposition))&&(a.position=s.dposition),o[l]=!0;let h=null;if(l in r&&r[l].type===d)h=r[l];else{const p=bo.getScale(d);h=new p({id:l,type:d,ctx:this.ctx,chart:this}),r[h.id]=h}h.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(QC("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||b0(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:h}=this.getDatasetMeta(u),p=!o&&i.indexOf(h)===-1;h.buildOrUpdateElements(p),s=Math.max(+h.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(QC("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);(!cC(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;qW(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(!cC(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,ss(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(),ZC({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=YW(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(o&&cg(n,{left:r.left===!1?0:i.left-r.left,right:r.right===!1?this.width:i.right+r.right,top:r.top===!1?0:i.top-r.top,bottom:r.bottom===!1?this.height:i.bottom+r.bottom}),t.controller.draw(),o&&ug(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return ui(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=WH.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=fs(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);qu(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(),bC(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete zh[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}});!lp(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(h=>d.datasetIndex===h.datasetIndex&&d.index===h.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=nB(t),u=GW(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=!lp(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",zh),Ce(Vr,"overrides",Sa),Ce(Vr,"registry",bo),Ce(Vr,"version",HW),Ce(Vr,"getChart",JC);function eE(){return Ct(Vr.instances,e=>e._plugins.invalidate())}function KW(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 XW(e){return nx(e,["outerStart","outerEnd","innerStart","innerEnd"])}function QW(e,t,n,r){const o=XW(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 al(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function pp(e,t,n,r,o,i){const{x:s,y:a,startAngle:l,pixelMargin:u,innerRadius:d}=t,h=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=h>0?h-r:0,Y=(F+Z)/2,Q=Y!==0?b*Y/(Y+r):b;g=(b-Q)/2}const y=Math.max(.001,b*h-n/Vt)/h,x=(b-y)/2,_=l+x+g,w=o-x-g,{outerStart:C,outerEnd:R,innerStart:E,innerEnd:T}=QW(t,p,h,w-_),O=h-C,D=h-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,h,I,F),e.arc(s,a,h,F,N),R>0){const ae=al(D,N,s,a);e.arc(ae.x,ae.y,R,N,w+en)}const Z=al(G,w,s,a);if(e.lineTo(Z.x,Z.y),T>0){const ae=al(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=al(V,le,s,a);e.arc(ae.x,ae.y,E,le+Math.PI,_-en)}const Q=al(O,_,s,a);if(e.lineTo(Q.x,Q.y),C>0){const ae=al(O,I,s,a);e.arc(ae.x,ae.y,C,_-en,I)}}else{e.moveTo(s,a);const F=Math.cos(I)*h+s,Z=Math.sin(I)*h+a;e.lineTo(F,Z);const Y=Math.cos(N)*h+s,Q=Math.sin(N)*h+a;e.lineTo(Y,Q)}e.closePath()}function ZW(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a}=t;let l=t.endAngle;if(i){pp(e,t,n,r,l,o);for(let u=0;u<i;++u)e.fill();isNaN(a)||(l=s+(a%jt||jt))}return pp(e,t,n,r,l,o),e.fill(),l}function JW(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a,options:l}=t,{borderWidth:u,borderJoinStyle:d,borderDash:h,borderDashOffset:p}=l,g=l.borderAlign==="inner";if(!u)return;e.setLineDash(h||[]),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){pp(e,t,n,r,b,o);for(let y=0;y<i;++y)e.stroke();isNaN(a)||(b=s+(a%jt||jt))}g&&KW(e,t,b),i||(pp(e,t,n,r,b,o),e.stroke())}class _l 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}=xO(i,{x:n,y:r}),{startAngle:l,endAngle:u,innerRadius:d,outerRadius:h,circumference:p}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),g=(this.options.spacing+this.options.borderWidth)/2,y=Ke(p,u-l)>=jt||Gu(s,l,u),x=li(a,d+g,h+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,h=(i+s)/2,p=(a+l+d+u)/2;return{x:r+Math.cos(h)*p,y:o+Math.sin(h)*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,ZW(n,this,d,s,a),JW(n,this,d,s,a),n.restore()}}Ce(_l,"id","arc"),Ce(_l,"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(_l,"defaultRoutes",{backgroundColor:"backgroundColor"}),Ce(_l,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function JO(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 eU(e,t,n){e.lineTo(n.x,n.y)}function tU(e){return e.stepped?CB:e.tension||e.cubicInterpolationMode==="monotone"?EB:eU}function e2(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 nU(e,t,n,r){const{points:o,options:i}=t,{count:s,start:a,loop:l,ilen:u}=e2(o,n,r),d=tU(i);let{move:h=!0,reverse:p}=r||{},g,b,y;for(g=0;g<=u;++g)b=o[(a+(p?u-g:g))%s],!b.skip&&(h?(e.moveTo(b.x,b.y),h=!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 rU(e,t,n,r){const o=t.points,{count:i,start:s,ilen:a}=e2(o,n,r),{move:l=!0,reverse:u}=r||{};let d=0,h=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=(h*d+R)/++h):(C(),e.lineTo(R,E),b=T,h=0,y=x=E),_=E}C()}function x0(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?rU:nU}function oU(e){return e.stepped?rH:e.tension||e.cubicInterpolationMode==="monotone"?oH:Gs}function iU(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),JO(e,t.options),e.stroke(o)}function sU(e,t,n,r){const{segments:o,options:i}=t,s=x0(t);for(const a of o)JO(e,i,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const aU=typeof Path2D=="function";function lU(e,t,n,r){aU&&!t.options.segment?iU(e,t,n,r):sU(e,t,n,r)}class Xi 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;KB(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=uH(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=jO(this,{property:n,start:o,end:o});if(!s.length)return;const a=[],l=oU(r);let u,d;for(u=0,d=s.length;u<d;++u){const{start:h,end:p}=s[u],g=i[h],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 x0(this)(t,this,n,r)}path(t,n,r){const o=this.segments,i=x0(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(),lU(t,this,r,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ce(Xi,"id","line"),Ce(Xi,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Ce(Xi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Ce(Xi,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function tE(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class Ru 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 tE(this,n,"x",r)}inYRange(n,r){return tE(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,m0(n,o,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Ce(Ru,"id","point"),Ce(Ru,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Ce(Ru,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function t2(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,h;return e.horizontal?(h=s/2,a=Math.min(n,o),l=Math.max(n,o),u=r-h,d=r+h):(h=i/2,a=n-h,l=n+h,u=Math.min(r,o),d=Math.max(r,o)),{left:a,top:u,right:l,bottom:d}}function Qi(e,t,n,r){return e?0:gn(t,n,r)}function cU(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=OO(r);return{t:Qi(o.top,i.top,0,n),r:Qi(o.right,i.right,0,t),b:Qi(o.bottom,i.bottom,0,n),l:Qi(o.left,i.left,0,t)}}function uU(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=ha(o),s=Math.min(t,n),a=e.borderSkipped,l=r||ut(o);return{topLeft:Qi(!l||a.top||a.left,i.topLeft,0,s),topRight:Qi(!l||a.top||a.right,i.topRight,0,s),bottomLeft:Qi(!l||a.bottom||a.left,i.bottomLeft,0,s),bottomRight:Qi(!l||a.bottom||a.right,i.bottomRight,0,s)}}function dU(e){const t=t2(e),n=t.right-t.left,r=t.bottom-t.top,o=cU(e,n/2,r/2),i=uU(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 Lv(e,t,n,r){const o=t===null,i=n===null,a=e&&!(o&&i)&&t2(e,r);return a&&(o||li(t,a.left,a.right))&&(i||li(n,a.top,a.bottom))}function fU(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function hU(e,t){e.rect(t.x,t.y,t.w,t.h)}function Fv(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 $u 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}=dU(this),a=fU(s.radius)?Yu:hU;t.save(),(s.w!==i.w||s.h!==i.h)&&(t.beginPath(),a(t,Fv(s,n,i)),t.clip(),a(t,Fv(i,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Fv(i,n)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,n,r){return Lv(this,t,n,r)}inXRange(t,n){return Lv(this,t,null,n)}inYRange(t,n){return Lv(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($u,"id","bar"),Ce($u,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Ce($u,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var pU=Object.freeze({__proto__:null,ArcElement:_l,BarElement:$u,LineElement:Xi,PointElement:Ru});const w0=["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)"],nE=w0.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function n2(e){return w0[e%w0.length]}function r2(e){return nE[e%nE.length]}function gU(e,t){return e.borderColor=n2(t),e.backgroundColor=r2(t),++t}function mU(e,t){return e.backgroundColor=e.data.map(()=>n2(t++)),t}function vU(e,t){return e.backgroundColor=e.data.map(()=>r2(t++)),t}function bU(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof ta?t=mU(n,t):o instanceof Eu?t=vU(n,t):o&&(t=gU(n,t))}}function rE(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function yU(e){return e&&(e.borderColor||e.backgroundColor)}var xU={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&&(rE(r)||yU(o)||i&&rE(i)))return;const s=bU(e);r.forEach(s)}};function wU(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,h,p,g,b,y;for(s[l++]=e[d],h=0;h<i-2;h++){let x=0,_=0,w;const C=Math.floor((h+1)*a)+1+t,R=Math.min(Math.floor((h+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(h*a)+1+t,O=Math.min(Math.floor((h+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 _U(e,t,n,r){let o=0,i=0,s,a,l,u,d,h,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,h=s):u>y&&(y=u,p=s),o=(i*o+a.x)/++i;else{const T=s-1;if(!at(h)&&!at(p)){const O=Math.min(h,p),D=Math.max(h,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,h=p=g=s}}return x}function o2(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 oE(e){e.data.datasets.forEach(t=>{o2(t)})}function SU(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 CU={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){oE(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:h,count:p}=SU(l,u);const g=n.threshold||4*r;if(p<=g){o2(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=wU(u,h,p,r,n);break;case"min-max":b=_U(u,h,p,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=b})},destroy(e){oE(e)}};function EU(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=cx(l,u,o);const d=_0(n,o[l],o[u],a.loop);if(!t.segments){s.push({source:a,target:d,start:o[l],end:o[u]});continue}const h=jO(t,d);for(const p of h){const g=_0(n,i[p.start],i[p.end],p.loop),b=zO(a,o,g);for(const y of b)s.push({source:y,target:p,start:{[n]:iE(d,g,"start",Math.max)},end:{[n]:iE(d,g,"end",Math.min)}})}}return s}function _0(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 RU(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:s,end:a})=>{a=cx(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 cx(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function iE(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function i2(e,t){let n=[],r=!1;return zt(e)?(r=!0,n=e):n=RU(e,t),n.length?new Xi({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function sE(e){return e&&e.fill!==!1}function $U(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 PU(e,t,n){const r=TU(e);if(ut(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return Xt(o)&&Math.floor(o)===o?OU(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function OU(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function MU(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 DU(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 TU(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 AU(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,s=r.points,a=IU(t,n);a.push(i2({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++)kU(o,s[d],a)}return new Xi({points:o,options:{}})}function IU(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 kU(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:s,last:a,point:l}=NU(i,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function NU(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],h=s[d.start][n],p=s[d.end][n];if(li(o,h,p)){a=o===h,l=o===p;break}}return{first:a,last:l,point:r}}class s2{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 LU(e){const{chart:t,fill:n,line:r}=e;if(Xt(n))return FU(t,n);if(n==="stack")return AU(e);if(n==="shape")return!0;const o=zU(e);return o instanceof s2?o:i2(o,r)}function FU(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function zU(e){return(e.scale||{}).getPointPositionForValue?VU(e):jU(e)}function jU(e){const{scale:t={},fill:n}=e,r=MU(n,t);if(Xt(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function VU(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,s=DU(n,t,i),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new s2({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 zv(e,t,n){const r=LU(t),{line:o,scale:i,axis:s}=t,a=o.options,l=a.fill,u=a.backgroundColor,{above:d=u,below:h=u}=l||{};r&&o.points.length&&(cg(e,n),BU(e,{line:o,target:r,above:d,below:h,area:n,scale:i,axis:s}),ug(e))}function BU(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&&(aE(e,r,s.top),lE(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore(),e.save(),aE(e,r,s.bottom)),lE(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore()}function aE(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],h=o[cx(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(h.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function lE(e,t){const{line:n,target:r,property:o,color:i,scale:s}=t,a=EU(n,r,o);for(const{source:l,target:u,start:d,end:h}of a){const{style:{backgroundColor:p=i}={}}=l,g=r!==!0;e.save(),e.fillStyle=p,HU(e,s,g&&_0(o,d,h)),e.beginPath();const b=!!n.pathSegment(e,l);let y;if(g){b?e.closePath():cE(e,r,h,o);const x=!!r.pathSegment(e,u,{move:b,reverse:!0});y=b&&x,y||cE(e,r,d,o)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function HU(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 cE(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var WU={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 Xi&&(l={visible:e.isDatasetVisible(s),index:s,fill:PU(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=$U(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&&zv(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;sE(i)&&zv(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!sE(r)||n.drawTime!=="beforeDatasetDraw"||zv(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const uE=(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)}},UU=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class dE 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}=uE(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 h=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)&&(h+=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}),h}_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 h=a,p=0,g=0,b=0,y=0;return this.legendItems.forEach((x,_)=>{const{itemWidth:w,itemHeight:C}=qU(r,n,i,x,o);_>0&&g+C+2*a>d&&(h+=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}),h+=p,u.push({width:p,height:g}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,s=Rl(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;cg(t,this),this._draw(),ug(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=t,a=qt.color,l=Rl(t.rtl,this.left,this.width),u=tn(s.font),{padding:d}=s,h=u.size,p=h/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}=uE(s,h),_=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;PO(o,N,V,G,s.pointStyleWidth&&b)}else{const N=O+Math.max((h-y)/2,0),V=l.leftForLtr(T,b),G=ha(D.borderRadius);o.beginPath(),Object.values(G).some(le=>le!==0)?Yu(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){Ca(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},NO(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=hB(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+=a2(T,ee)+d}else g.y+=E}),LO(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=Rl(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,u=o.top+l;let d,h=this.left,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),d=this.top+u,h=Dn(t.align,h,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,h,h+p);s.textAlign=i.textAlign(ex(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Ca(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(!KU(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=UU(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 qU(e,t,n,r,o){const i=GU(r,e,t,n),s=YU(o,r,t.lineHeight);return{itemWidth:i,itemHeight:s}}function GU(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 YU(e,t,n){let r=e;return typeof t.text!="string"&&(r=a2(t,n)),r}function a2(e,t){const n=e.text?e.text.length:0;return t*n}function KU(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var XU={id:"legend",_element:dE,start(e,t,n){const r=e.legend=new dE({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 ux 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,h;return this.isHorizontal()?(d=Dn(a,r,i),h=n+t,u=i-r):(s.position==="left"?(d=r+t,h=Dn(a,o,n),l=Vt*-.5):(d=i-t,h=Dn(a,n,o),l=Vt*.5),u=o-n),{titleX:d,titleY:h,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);Ca(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:ex(n.align),textBaseline:"middle",translation:[s,a]})}}function QU(e,t){const n=new ux({ctx:e.ctx,options:t,chart:e});An.configure(e,n,t),An.addBox(e,n),e.titleBlock=n}var ZU={id:"title",_element:ux,start(e,t,n){QU(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 ah=new WeakMap;var JU={id:"subtitle",start(e,t,n){const r=new ux({ctx:e.ctx,options:n,chart:e});An.configure(e,r,n),An.addBox(e,r),ah.set(e,r)},stop(e){An.removeBox(e,ah.get(e)),ah.delete(e)},beforeUpdate(e,t,n){const r=ah.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 gu={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=p0(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 eq(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 fE(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),h=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,h&&(y+=h*u.lineHeight+(h-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 tq(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function nq(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 rq(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"),nq(u,e,t,n)&&(u="center"),u}function hE(e,t,n){const r=n.yAlign||t.yAlign||tq(e,n);return{xAlign:n.xAlign||t.xAlign||rq(e,t,n,r),yAlign:r}}function oq(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function iq(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function pE(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,u=o+i,{topLeft:d,topRight:h,bottomLeft:p,bottomRight:g}=ha(s);let b=oq(t,a);const y=iq(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(h,g)+o),{x:gn(b,0,r.width-t.width),y:gn(y,0,r.height-t.height)}}function lh(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 gE(e){return mo([],ri(e))}function sq(e,t,n){return fs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function mE(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const l2={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"?l2[t].call(n,r):o}var bb;let vE=(bb=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 VO(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=sq(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 gE(Xn(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return Ct(t,i=>{const s={before:[],lines:[],after:[]},a=mE(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 gE(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(eq(this.chart,n[l]));return t.filter&&(a=a.filter((d,h,p)=>t.filter(d,h,p,r))),t.itemSort&&(a=a.sort((d,h)=>t.itemSort(d,h,r))),Ct(a,d=>{const h=mE(t.callbacks,d);o.push(Xn(h,"labelColor",this,d)),i.push(Xn(h,"labelPointStyle",this,d)),s.push(Xn(h,"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=gu[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=fE(this,r),u=Object.assign({},a,l),d=hE(this.chart,r,u),h=pE(r,u,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,i={opacity:1,x:h.x,y:h.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:h}=ha(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,h)-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=Rl(r.rtl,this.x,this.width);for(t.x=lh(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),h=lh(this,"left",i),p=o.x(h),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,m0(t,y,x,_),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,m0(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),_=ha(s.borderRadius);Object.values(_).some(w=>w!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,Yu(t,{x:y,y:b,w:u,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Yu(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,h=tn(r.bodyFont);let p=h.lineHeight,g=0;const b=Rl(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=h.string,t.x=lh(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(h.lineHeight,l)),E=0,O=C.length;E<O;++E)y(C[E]),p=h.lineHeight;Ct(_.after,y)}g=0,p=h.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=Rl(r.rtl,this.x,this.width);for(t.x=lh(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:h,topRight:p,bottomLeft:g,bottomRight:b}=ha(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(a+h,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+h),n.quadraticCurveTo(a,l,a+h,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=gu[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=fE(this,t),l=Object.assign({},s,this._size),u=hE(n,t,l),d=pE(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),NO(t,n.textDirection),i.y+=s.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),LO(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=!lp(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||!lp(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=gu[i.position].call(this,t,n);return s!==!1&&(r!==s.x||o!==s.y)}},Ce(bb,"positioners",gu),bb);var aq={id:"tooltip",_element:vE,positioners:gu,afterInit(e,t,n){n&&(e.tooltip=new vE({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:l2},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"]},lq=Object.freeze({__proto__:null,Colors:xU,Decimation:CU,Filler:WU,Legend:XU,SubTitle:JU,Title:ZU,Tooltip:aq});const cq=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function uq(e,t,n,r){const o=e.indexOf(t);if(o===-1)return cq(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const dq=(e,t)=>e===null?null:gn(Math.round(e),0,t);function bE(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class S0 extends Ia{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:uq(r,t,Ke(n,t),this._addedLabels),dq(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 bE.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(S0,"id","category"),Ce(S0,"defaults",{ticks:{callback:bE}});function fq(e,t){const n=[],{bounds:o,step:i,min:s,max:a,precision:l,count:u,maxTicks:d,maxDigits:h,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)/(h+1);let E=dC((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=dC(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&&sB((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,_u(I,Math.round(I),E/1e3)?I=Math.round(I):I=Math.ceil(I));const N=Math.max(fC(E),fC(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++,_u(Math.round((O+V*E)*T)/T,s,yE(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&&_u(n[n.length-1].value,a,yE(a,R,e))?n[n.length-1].value=a:n.push({value:a}):(!w||D===a)&&n.push({value:D}),n}function yE(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 gp extends Ia{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=fq(o,i);return t.bounds==="ticks"&&yO(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 Ad(t,this.chart.options.locale,this.options.ticks.format)}}class C0 extends gp{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(C0,"id","linear"),Ce(C0,"defaults",{ticks:{callback:lg.formatters.numeric}});const Xu=e=>Math.floor(Ki(e)),Ws=(e,t)=>Math.pow(10,Xu(e)+t);function xE(e){return e/Math.pow(10,Xu(e))===1}function wE(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function hq(e,t){const n=t-e;let r=Xu(n);for(;wE(e,t,r)>10;)r++;for(;wE(e,t,r)<10;)r--;return Math.min(r,Xu(e))}function pq(e,{min:t,max:n}){t=fr(e.min,t);const r=[],o=Xu(t);let i=hq(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 h=Math.floor((u-d)/Math.pow(10,i)),p=fr(e.min,Math.round((l+d+h*Math.pow(10,i))*s)/s);for(;p<n;)r.push({value:p,major:xE(p),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(i++,h=2,s=i>=0?1:s),p=Math.round((l+d+h*Math.pow(10,i))*s)/s;const g=fr(e.max,p);return r.push({value:g,major:xE(g),significand:h}),r}class E0 extends Ia{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=gp.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===Ws(this.min,0)?Ws(this.min,-1):Ws(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(Ws(r,-1)),s(Ws(o,1)))),r<=0&&i(Ws(o,-1)),o<=0&&s(Ws(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=pq(n,this);return t.bounds==="ticks"&&yO(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":Ad(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ki(t),this._valueRange=Ki(this.max)-Ki(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ki(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Ce(E0,"id","logarithmic"),Ce(E0,"defaults",{ticks:{callback:lg.formatters.logarithmic,major:{enabled:!0}}});function R0(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 gq(e,t,n){return n=zt(n)?n:[n],{w:SB(e,t.string,n),h:n.length*t.lineHeight}}function _E(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 mq(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),h=tn(u.font),p=gq(e.ctx,h,e._pointLabels[l]);r[l]=p;const g=mr(e.getIndexAngle(l)+a),b=Math.round(Zy(g)),y=_E(b,d.x,p.w,0,180),x=_E(b,d.y,p.h,90,270);vq(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=xq(e,r,o)}function vq(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 bq(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(Zy(mr(l.angle+en))),d=Sq(l.y,a.h,u),h=wq(u),p=_q(l.x,a.w,h);return{visible:!0,x:l.x,y:d,textAlign:h,left:p,top:d,right:p+a.w,bottom:d+a.h}}function yq(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 xq(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:s,display:a}=i.pointLabels,l={extra:R0(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 h=bq(e,d,l);r.push(h),a==="auto"&&(h.visible=yq(h,u),h.visible&&(u=h))}return r}function wq(e){return e===0||e===180?"center":e<180?"left":"right"}function _q(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function Sq(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function Cq(e,t,n){const{left:r,top:o,right:i,bottom:s}=n,{backdropColor:a}=t;if(!at(a)){const l=ha(t.borderRadius),u=Cn(t.backdropPadding);e.fillStyle=a;const d=r-u.left,h=o-u.top,p=i-r+u.width,g=s-o+u.height;Object.values(l).some(b=>b!==0)?(e.beginPath(),Yu(e,{x:d,y:h,w:p,h:g,radius:l}),e.fill()):e.fillRect(d,h,p,g)}}function Eq(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));Cq(n,s,i);const a=tn(s.font),{x:l,y:u,textAlign:d}=i;Ca(n,e._pointLabels[o],l,u+a.lineHeight/2,a,{color:s.color,textAlign:d,textBaseline:"middle"})}}function c2(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 Rq(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(),c2(e,n,s,r),i.closePath(),i.stroke(),i.restore())}function $q(e,t,n){return fs(e,{label:n,index:t,type:"pointLabel"})}class mu extends gp{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(R0(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/R0(this.options))}generateTickLabels(t){gp.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?mq(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 $q(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(),c2(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&&Eq(this,s),o.display&&this.ticks.forEach((d,h)=>{if(h!==0){l=this.getDistanceFromCenterForValue(d.value);const p=this.getContext(h),g=o.setContext(p),b=i.setContext(p);Rq(this,g,l,s,b)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const d=r.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:p}=d;!p||!h||(t.lineWidth=p,t.strokeStyle=h,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 h=Cn(u.backdropPadding);t.fillRect(-s/2-h.left,-i-d.size/2-h.top,s+h.width,d.size+h.height)}Ca(t,a.label,0,-i,d,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}Ce(mu,"id","radialLinear"),Ce(mu,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:lg.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Ce(mu,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Ce(mu,"descriptors",{angleLines:{_fallback:"grid"}});const fg={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(fg);function SE(e,t){return e-t}function CE(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"&&(nc(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function EE(e,t,n,r){const o=er.length;for(let i=er.indexOf(e);i<o-1;++i){const s=fg[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 Pq(e,t,n,r,o){for(let i=er.length-1;i>=er.indexOf(n);i--){const s=er[i];if(fg[s].common&&e._adapter.diff(o,r,s)>=t-1)return s}return er[n?er.indexOf(n):0]}function Oq(e){for(let t=er.indexOf(e)+1,n=er.length;t<n;++t)if(fg[er[t]].common)return er[t]}function RE(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=Jy(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function Mq(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 $E(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:Mq(e,r,o,n)}class Qu extends Ia{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 zH._date(t.adapters.date);o.init(n),wu(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:CE(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=uB(o,i,s);return this._unit=n.unit||(r.autoSkip?EE(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):Pq(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Oq(this._unit),this.initOffsets(o),t.reverse&&a.reverse(),$E(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||EE(i.minUnit,n,r,this._getLabelCapacity(n)),a=Ke(o.ticks.stepSize,1),l=s==="week"?i.isoWeekday:!1,u=nc(l)||l===!0,d={};let h=n,p,g;if(u&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,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=h,g=0;p<r;p=+t.add(p,a,s),g++)RE(d,p,b);return(p===r||o.bounds==="ticks"||g===1)&&RE(d,p,b),Object.keys(d).sort(SE).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],h=u&&a[u],p=r[n],g=u&&h&&p&&p.major;return this._adapter.format(t,o||(g?h: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,$E(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(CE(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return _O(t.sort(SE))}}Ce(Qu,"id","time"),Ce(Qu,"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 ch(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 $0 extends Qu{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=ch(n,this.min),this._tableRange=ch(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(ch(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return ch(this._table,r*this._tableRange+this._minPos,!0)}}Ce($0,"id","timeseries"),Ce($0,"defaults",Qu.defaults);var Dq=Object.freeze({__proto__:null,CategoryScale:S0,LinearScale:C0,LogarithmicScale:E0,RadialLinearScale:mu,TimeScale:Qu,TimeSeriesScale:$0});const Tq=[FH,pU,lq,Dq];/*!
|
|
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 PE=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}(),Pu={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*PE)/PE}};function jv(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 Aq(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 Iq=0,u2=1,d2=2,f2=4,h2=8;function uh(e,t,n){var r=Iq;return e<n.left?r|=u2:e>n.right&&(r|=d2),t<n.top?r|=h2:t>n.bottom&&(r|=f2),r}function kq(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=uh(n,r,t),a=uh(o,i,t),l,u,d;!(!(s|a)||s&a);)l=s||a,l&h2?(u=n+(o-n)*(t.top-r)/(i-r),d=t.top):l&f2?(u=n+(o-n)*(t.bottom-r)/(i-r),d=t.bottom):l&d2?(d=r+(i-r)*(t.right-n)/(o-n),u=t.right):l&u2&&(d=r+(i-r)*(t.left-n)/(o-n),u=t.left),l===s?(n=u,r=d,s=uh(n,r,t)):(o=u,i=d,a=uh(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function dh(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=kq(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),Aq(o,i,e.vx,e.vy,t.align)}var fh={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 dh({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=jv(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return dh({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=jv(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)),dh({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=jv(e,t.origin);return dh({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=Pu.rasterize;function Nq(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 Lq(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 Fq(e){return e instanceof _l?fh.arc:e instanceof Ru?fh.point:e instanceof $u?fh.bar:fh.fallback}function zq(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,h=n+o-a;e.moveTo(t,u),l<d&&u<h?(e.arc(l,u,a,-Math.PI,-s),e.arc(d,u,a,-s,0),e.arc(d,h,a,0,s),e.arc(l,h,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<h?(e.arc(l,u,a,-Math.PI,0),e.arc(l,h,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 jq(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),zq(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 Vq(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 Bq(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 Hq(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,h=u&&d,p;if(!(!l||!s&&!h))for(n=Vq(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),h&&(e.lineJoin="round",e.lineWidth=d,e.strokeStyle=u),p=0,l=t.length;p<l;++p)Bq(e,t[p],{stroked:h,filled:s,w:n.w,x:n.x,y:n.y+n.h*p})}var p2=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(p2.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:Lq(o._el,r),padding:Cn(Ft([n.padding,4],r,i)),positioner:Fq(o._el),rotation:Ft([n.rotation,0],r,i)*(Math.PI/180),size:Pu.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)?[]:Pu.toTextLines(a),l.length&&(n=t._modelize(u,l,i,e),r=Nq(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=Pu.bound(0,o.opacity,1),r.translate(di(t.x),di(t.y)),r.rotate(o.rotation),jq(r,i.frame,o),Hq(r,o.lines,i.text,o),r.restore())}});var Wq=Number.MIN_SAFE_INTEGER||-9007199254740991,Uq=Number.MAX_SAFE_INTEGER||9007199254740991;function tu(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 OE(e,t){var n=Uq,r=Wq,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 hh(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 g2=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};Mo(g2.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=tu(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=[hh(t[0],t[1]),hh(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(hh(n[0],n[1]),hh(n[0],n[3])),o=0;o<r.length;++o)if(i=OE(t,r[o]),s=OE(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[tu({x:t.x,y:t.y},r,n),tu({x:t.x+t.w,y:t.y},r,n),tu({x:t.x+t.w,y:t.y+t.h},r,n),tu({x:t.x,y:t.y+t.h},r,n)]}});function m2(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)),h=1/Math.max(Math.abs(o),Math.abs(i));return u*=o*h,d*=i*h,u+=t.offset*o,d+=t.offset*i,{x:r.x+u,y:r.y+d}}function qq(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 Gq(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=m2(a,r.model(),i),o._box.update(s,i,r.rotation()));return qq(e,function(l,u){var d=l._hidable,h=u._hidable;d&&h||h?u._visible=!1:d&&(l._visible=!1)})}var Ou={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 g2,_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&&Gq(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=m2(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},Yq=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},Kq={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:Yq,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",v2="$default";function Xq(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||v2]=u}),delete l.listeners,a},{}),{labels:o,listeners:r})}function P0(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 Qq(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&P0(e,t.leave,n,o),i&&P0(e,t.enter,r,o))}function Zq(e,t){var n=e[Qn],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=Ou.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,Qq(e,r,o,i,t)}}function Jq(e,t){var n=e[Qn],r=n._listeners.click,o=r&&Ou.lookup(n._labels,t);o&&P0(e,r,o,t)}var eG={id:"datalabels",defaults:Kq,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=Xq(a,n),u=t.meta.data||[],d=e.ctx,h,p,g,b,y,x,_,w;for(d.save(),h=0,g=u.length;h<g;++h)if(_=u[h],_[Qn]=[],s&&_&&e.getDataVisibility(h)&&!_.skip)for(p=0,b=l.labels.length;p<b;++p)y=l.labels[p],x=y._key,w=new p2(y,d,_,h),w.$groups={_set:r,_key:x||v2},w.$context={active:!1,chart:e,dataIndex:h,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=Ou.prepare(e[Qn]._datasets)},afterDatasetsDraw:function(e){Ou.draw(e,e[Qn]._labels)},beforeEvent:function(e,t){if(e[Qn]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":Zq(e,n);break;case"click":Jq(e,n);break}}},afterEvent:function(e){var t=e[Qn],n=t._actives,r=t._actives=e.getActiveElements(),o=Pu.arrayDiff(n,r),i,s,a,l,u,d,h;for(i=0,s=o.length;i<s;++i)if(u=o[i],u[1])for(h=u[0].element[Qn]||[],a=0,l=h.length;a<l;++a)d=h[a],d.$context.active=u[1]===1,d.update(d.$context);(t._dirty||o.length)&&(Ou.update(t._labels),e.render()),delete t._dirty}};Vr.register(...Tq);Vr.register(eG);function b2({cfg:e,onDatapointClick:t}){var a;const n=m.useRef(null),[r,o]=m.useState(),i=Ee(l=>l.themeStyle);m.useEffect(()=>{var d,h,p,g;(h=(d=i==null?void 0:i.chart)==null?void 0:d.font)!=null&&h.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,h;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=(h=(d=u[0].element)==null?void 0:d.$context)==null?void 0:h.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 tG=["color"],y2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(e,tG);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"}))}),nG=["color"],rG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(e,nG);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"}))}),oG=["color"],iG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(e,oG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"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"}))}),sG=["color"],x2=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(e,sG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"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"}))}),aG=["color"],lG=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(e,aG);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"}))}),cG=["color"],uG=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:"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"}))}),dG=["color"],fG=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:"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"}))}),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:"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"}))}),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:"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"}))}),vG=["color"],bG=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:"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"}))}),yG=["color"],dx=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Ur(e,yG);return m.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),m.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),xG=["color"],fx=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:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});function wG(e,t,n){var l,u,d,h;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=(h=(d=o==null?void 0:o.chart)==null?void 0:d.dataset)==null?void 0:h.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:_G((w=b==null?void 0:b.datalabels)==null?void 0:w.align,y)},backgroundColor:y,borderColor:x}})}function _G(e,t){return Yh(e==="end"||e==="start"?Gh():t)}function SG(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 h=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:h}]}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 CG(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(h=>h[d]),backgroundColor:t.map((h,p)=>r==null?void 0:r[p%r.length]),borderColor:t.map((h,p)=>o==null?void 0:o[p%o.length])}))}function EG(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=EG(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,u,d,h,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((h=e==null?void 0:e[1])==null?void 0:h[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 O0(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 hx({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 M0(e,t){var s;const n=Ee.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=wa.cloneDeep(r);return wa.merge(o,e,t)}function w2(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}function RG({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:h}=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)||[]);h(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(lG,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}):k.jsx(uG,{role:"edit-visual",onClick:_,className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}),k.jsx(x2,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"})]})})}function $G(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 D0="dismissableLayer.update",PG="dismissableLayer.pointerDownOutside",OG="dismissableLayer.focusOutside";let ME;const MG=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vc=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(MG),[h,p]=m.useState(null),g=(n=h==null?void 0:h.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=h?x.indexOf(h):-1,R=d.layersWithOutsidePointerEventsDisabled.size>0,E=C>=w,T=DG(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=TG(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 $G(D=>{C===d.layers.size-1&&(o==null||o(D),!D.defaultPrevented&&l&&(D.preventDefault(),l()))},g),m.useEffect(()=>{if(h)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(ME=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),DE(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=ME)}},[h,g,r,d]),m.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),DE())},[h,d]),m.useEffect(()=>{const D=()=>b({});return document.addEventListener(D0,D),()=>document.removeEventListener(D0,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 DG(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(){_2(PG,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 TG(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&&_2(OG,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 DE(){const e=new CustomEvent(D0);document.dispatchEvent(e)}function _2(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?fP(o,i):o.dispatchEvent(i)}const AG=["top","right","bottom","left"],as=Math.min,br=Math.max,mp=Math.round,ph=Math.floor,ls=e=>({x:e,y:e}),IG={left:"right",right:"left",bottom:"top",top:"bottom"},kG={start:"end",end:"start"};function T0(e,t,n){return br(e,as(t,n))}function gi(e,t){return typeof e=="function"?e(t):e}function mi(e){return e.split("-")[0]}function bc(e){return e.split("-")[1]}function px(e){return e==="x"?"y":"x"}function gx(e){return e==="y"?"height":"width"}function yc(e){return["top","bottom"].includes(mi(e))?"y":"x"}function mx(e){return px(yc(e))}function NG(e,t,n){n===void 0&&(n=!1);const r=bc(e),o=mx(e),i=gx(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=vp(s)),[s,vp(s)]}function LG(e){const t=vp(e);return[A0(e),t,A0(t)]}function A0(e){return e.replace(/start|end/g,t=>kG[t])}function FG(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 zG(e,t,n,r){const o=bc(e);let i=FG(mi(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(A0)))),i}function vp(e){return e.replace(/left|right|bottom|top/g,t=>IG[t])}function jG(e){return{top:0,right:0,bottom:0,left:0,...e}}function S2(e){return typeof e!="number"?jG(e):{top:e,right:e,bottom:e,left:e}}function bp(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function TE(e,t,n){let{reference:r,floating:o}=e;const i=yc(t),s=mx(t),a=gx(s),l=mi(t),u=i==="y",d=r.x+r.width/2-o.width/2,h=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:h};break;case"left":g={x:r.x-o.width,y:h};break;default:g={x:r.x,y:r.y}}switch(bc(t)){case"start":g[s]-=p*(n&&u?-1:1);break;case"end":g[s]+=p*(n&&u?-1:1);break}return g}const VG=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:h}=TE(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:h,initialPlacement:r,placement:p,strategy:o,middlewareData:g,rects:u,platform:s,elements:{reference:e,floating:t}});if(d=w??d,h=C??h,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:h}=TE(u,p,l)),y=-1;continue}}return{x:d,y:h,placement:p,strategy:o,middlewareData:g}};async function Zu(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:h="floating",altBoundary:p=!1,padding:g=0}=gi(t,e),b=S2(g),x=a[p?h==="floating"?"reference":"floating":h],_=bp(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=h==="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=bp(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 AE=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 h=S2(d),p={x:n,y:r},g=mx(o),b=gx(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=as(h[_],I),V=as(h[w],I),G=N,le=O-y[b]-V,ee=O/2-y[b]/2+D,F=T0(G,ee,le),Z=!l.arrow&&bc(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}}}),BG=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:h=!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?[vp(a)]:LG(a));!p&&b!=="none"&&R.push(...zG(a,y,b,C));const E=[a,...R],T=await Zu(t,x),O=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&O.push(T[_]),h){const G=NG(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 IE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kE(e){return AG.some(t=>e[t]>=0)}const HG=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 Zu(t,{...o,elementContext:"reference"}),s=IE(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:kE(s)}}}case"escaped":{const i=await Zu(t,{...o,altBoundary:!0}),s=IE(i,n.floating);return{data:{escapedOffsets:s,escaped:kE(s)}}}default:return{}}}}};async function WG(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=bc(n),l=yc(n)==="y",u=["left","top"].includes(s)?-1:1,d=i&&l?-1:1,h=gi(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:b}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...h};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 UG=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 WG(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}}}}},qG=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 Zu(t,l),h=yc(mi(o)),p=px(h);let g=u[p],b=u[h];if(i){const x=p==="y"?"top":"left",_=p==="y"?"bottom":"right",w=g+d[x],C=g-d[_];g=T0(w,g,C)}if(s){const x=h==="y"?"top":"left",_=h==="y"?"bottom":"right",w=b+d[x],C=b-d[_];b=T0(w,b,C)}const y=a.fn({...t,[p]:g,[h]:b});return{...y,data:{x:y.x-n,y:y.y-r}}}}},GG=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},h=yc(o),p=px(h);let g=d[p],b=d[h];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[h]-i.floating[C]+(R&&((_=s.offset)==null?void 0:_[h])||0)+(R?0:x.crossAxis),T=i.reference[h]+i.reference[C]+(R?0:((w=s.offset)==null?void 0:w[h])||0)-(R?x.crossAxis:0);b<E?b=E:b>T&&(b=T)}return{[p]:g,[h]:b}}}},YG=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 Zu(t,a),u=mi(n),d=bc(n),h=yc(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(h){const T=p-l.left-l.right;R=d||w?as(_,T):T}else{const T=g-l.top-l.bottom;C=d||w?as(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);h?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 cs(e){return C2(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=(C2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function C2(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 NE(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wr(e).ShadowRoot}function kd(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 KG(e){return["table","td","th"].includes(cs(e))}function vx(e){const t=bx(),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 XG(e){let t=ic(e);for(;Do(t)&&!hg(t);){if(vx(t))return t;t=ic(t)}return null}function bx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function hg(e){return["html","body","#document"].includes(cs(e))}function Wr(e){return wr(e).getComputedStyle(e)}function pg(e){return vi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ic(e){if(cs(e)==="html")return e;const t=e.assignedSlot||e.parentNode||NE(e)&&e.host||xi(e);return NE(t)?t.host:t}function E2(e){const t=ic(e);return hg(t)?e.ownerDocument?e.ownerDocument.body:e.body:Do(t)&&kd(t)?t:E2(t)}function Ju(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=E2(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=wr(o);return i?t.concat(s,s.visualViewport||[],kd(o)?o:[],s.frameElement&&n?Ju(s.frameElement):[]):t.concat(o,Ju(o,[],n))}function R2(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=mp(n)!==i||mp(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function yx(e){return vi(e)?e:e.contextElement}function $l(e){const t=yx(e);if(!Do(t))return ls(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=R2(t);let s=(i?mp(n.width):n.width)/r,a=(i?mp(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const QG=ls(0);function $2(e){const t=wr(e);return!bx()||!t.visualViewport?QG:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ZG(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==wr(e)?!1:t}function Ea(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=yx(e);let s=ls(1);t&&(r?vi(r)&&(s=$l(r)):s=$l(e));const a=ZG(i,n,r)?$2(i):ls(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,d=o.width/s.x,h=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=$l(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,h*=y.y,l+=w,u+=C,b=wr(b).frameElement}}return bp({width:d,height:h,x:l,y:u})}function JG(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=ls(1);const l=ls(0);if((o||!o&&r!=="fixed")&&((cs(n)!=="body"||kd(i))&&(s=pg(n)),Do(n))){const u=Ea(n);a=$l(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 eY(e){return Array.from(e.getClientRects())}function P2(e){return Ea(xi(e)).left+pg(e).scrollLeft}function tY(e){const t=xi(e),n=pg(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+P2(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 nY(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=bx();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function rY(e,t){const n=Ea(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Do(e)?$l(e):ls(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 LE(e,t,n){let r;if(t==="viewport")r=nY(e,n);else if(t==="document")r=tY(xi(e));else if(vi(t))r=rY(t,n);else{const o=$2(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return bp(r)}function O2(e,t){const n=ic(e);return n===t||!vi(n)||hg(n)?!1:Wr(n).position==="fixed"||O2(n,t)}function oY(e,t){const n=t.get(e);if(n)return n;let r=Ju(e,[],!1).filter(a=>vi(a)&&cs(a)!=="body"),o=null;const i=Wr(e).position==="fixed";let s=i?ic(e):e;for(;vi(s)&&!hg(s);){const a=Wr(s),l=vx(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||kd(s)&&!l&&O2(e,s))?r=r.filter(d=>d!==s):o=a,s=ic(s)}return t.set(e,r),r}function iY(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?oY(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,d)=>{const h=LE(t,d,o);return u.top=br(h.top,u.top),u.right=as(h.right,u.right),u.bottom=as(h.bottom,u.bottom),u.left=br(h.left,u.left),u},LE(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function sY(e){return R2(e)}function aY(e,t,n){const r=Do(t),o=xi(t),i=n==="fixed",s=Ea(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=ls(0);if(r||!r&&!i)if((cs(t)!=="body"||kd(o))&&(a=pg(t)),r){const u=Ea(t,!0,i,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else o&&(l.x=P2(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function FE(e,t){return!Do(e)||Wr(e).position==="fixed"?null:t?t(e):e.offsetParent}function M2(e,t){const n=wr(e);if(!Do(e))return n;let r=FE(e,t);for(;r&&KG(r)&&Wr(r).position==="static";)r=FE(r,t);return r&&(cs(r)==="html"||cs(r)==="body"&&Wr(r).position==="static"&&!vx(r))?n:r||XG(e)||n}const lY=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||M2,i=this.getDimensions;return{reference:aY(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function cY(e){return Wr(e).direction==="rtl"}const uY={convertOffsetParentRelativeRectToViewportRelativeRect:JG,getDocumentElement:xi,getClippingRect:iY,getOffsetParent:M2,getElementRects:lY,getClientRects:eY,getDimensions:sY,getScale:$l,isElement:vi,isRTL:cY};function dY(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:h,height:p}=e.getBoundingClientRect();if(a||t(),!h||!p)return;const g=ph(d),b=ph(o.clientWidth-(u+h)),y=ph(o.clientHeight-(d+p)),x=ph(u),w={rootMargin:-g+"px "+-b+"px "+-y+"px "+-x+"px",threshold:br(0,as(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 fY(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=yx(e),d=o||i?[...u?Ju(u):[],...Ju(t)]:[];d.forEach(_=>{o&&_.addEventListener("scroll",n,{passive:!0}),i&&_.addEventListener("resize",n)});const h=u&&a?dY(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?Ea(e):null;l&&x();function x(){const _=Ea(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)}),h&&h(),g&&g.disconnect(),g=null,l&&cancelAnimationFrame(b)}}const hY=(e,t,n)=>{const r=new Map,o={platform:uY,...n},i={...o.platform,_c:r};return VG(e,t,{...o,platform:i})},pY=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?AE({element:r.current,padding:o}).fn(n):{}:r?AE({element:r,padding:o}).fn(n):{}}}};var jh=typeof document<"u"?m.useLayoutEffect:m.useEffect;function yp(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(!yp(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)&&!yp(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function D2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zE(e,t){const n=D2(e);return Math.round(t*n)/n}function jE(e){const t=ie.useRef(e);return jh(()=>{t.current=e}),t}function gY(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,h]=ie.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=ie.useState(r);yp(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=jE(l),N=jE(o),V=ie.useCallback(()=>{if(!T.current||!O.current)return;const Z={placement:t,strategy:n,middleware:p};N.current&&(Z.platform=N.current),hY(T.current,O.current,Z).then(Y=>{const Q={...Y,isPositioned:!0};G.current&&!yp(D.current,Q)&&(D.current=Q,aL.flushSync(()=>{h(Q)}))})},[p,t,n,N]);jh(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,h(Z=>({...Z,isPositioned:!1})))},[u]);const G=ie.useRef(!1);jh(()=>(G.current=!0,()=>{G.current=!1}),[]),jh(()=>{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=zE(ee.floating,d.x),Q=zE(ee.floating,d.y);return a?{...Z,transform:"translate("+Y+"px, "+Q+"px)",...D2(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 gg(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 T2="Popper",[A2,Lo]=mn(T2),[mY,I2]=A2(T2),vY=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return m.createElement(mY,{scope:t,anchor:r,onAnchorChange:o},n)},bY="PopperAnchor",yY=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=I2(bY,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}))}),k2="PopperContent",[xY,Wae]=A2(k2),wY=m.forwardRef((e,t)=>{var n,r,o,i,s,a,l,u;const{__scopePopper:d,side:h="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=I2(k2,d),[I,N]=m.useState(null),V=Xe(t,Ve=>N(Ve)),[G,le]=m.useState(null),ee=gg(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=h+(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(_Y),altBoundary:j},{refs:te,floatingStyles:ce,placement:ue,isPositioned:ge,middlewareData:ve}=gY({strategy:"fixed",placement:Y,whileElementsMounted:(...Ve)=>fY(...Ve,{animationFrame:E==="always"}),elements:{reference:D.anchor},middleware:[UG({mainAxis:p+Z,alignmentAxis:b}),x&&qG({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?GG():void 0,...B}),x&&BG({...B}),YG({...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&&pY({element:G,padding:y}),SY({arrowWidth:F,arrowHeight:Z}),R&&HG({strategy:"referenceHidden",...B})]}),[de,J]=N2(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(xY,{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 _Y(e){return e!==null}const SY=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:u}=t,h=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,p=h?0:e.arrowWidth,g=h?0:e.arrowHeight,[b,y]=N2(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=h?x:`${_}px`,R=`${-g}px`):b==="top"?(C=h?x:`${_}px`,R=`${l.floating.height+g}px`):b==="right"?(C=`${-g}px`,R=h?x:`${w}px`):b==="left"&&(C=`${l.floating.width+g}px`,R=h?x:`${w}px`),{data:{x:C,y:R}}}});function N2(e){const[t,n="center"]=e.split("-");return[t,n]}const Nd=vY,Ld=yY,Fd=wY,mg=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}),L2=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}}))),CY=L2,[vg,Uae]=mn("Tooltip",[Lo]),xx=Lo(),EY="TooltipProvider",RY=700,I0="tooltip.open",[$Y,wx]=vg(EY),PY=e=>{const{__scopeTooltip:t,delayDuration:n=RY,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($Y,{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)},_x="Tooltip",[OY,bg]=vg(_x),MY=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=wx(_x,e.__scopeTooltip),u=xx(t),[d,h]=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(I0))):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(Nd,u,m.createElement(OY,{scope:t,contentId:p,open:_,stateAttribute:C,trigger:d,onTriggerChange:h,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))},VE="TooltipTrigger",F2=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=bg(VE,n),i=wx(VE,n),s=xx(n),a=m.useRef(null),l=Xe(t,a,o.onTriggerChange),u=m.useRef(!1),d=m.useRef(!1),h=m.useCallback(()=>u.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),m.createElement(Ld,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",h,{once:!0})}),onFocus:we(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:we(e.onBlur,o.onClose),onClick:we(e.onClick,o.onClose)})))}),DY="TooltipPortal",[qae,TY]=vg(DY,{forceMount:void 0}),ed="TooltipContent",AY=m.forwardRef((e,t)=>{const n=TY(ed,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=bg(ed,e.__scopeTooltip);return m.createElement(nn,{present:r||s.open},s.disableHoverableContent?m.createElement(z2,ne({side:o},i,{ref:t})):m.createElement(IY,ne({side:o},i,{ref:t})))}),IY=m.forwardRef((e,t)=>{const n=bg(ed,e.__scopeTooltip),r=wx(ed,e.__scopeTooltip),o=m.useRef(null),i=Xe(t,o),[s,a]=m.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:h}=r,p=m.useCallback(()=>{a(null),h(!1)},[h]),g=m.useCallback((b,y)=>{const x=b.currentTarget,_={x:b.clientX,y:b.clientY},w=NY(_,x.getBoundingClientRect()),C=LY(_,w),R=FY(y.getBoundingClientRect()),E=jY([...C,...R]);a(E),h(!0)},[h]);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=!zY(_,s);w?p():C&&(p(),u())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,d,s,u,p]),m.createElement(z2,ne({},e,{ref:i}))}),[kY,Gae]=vg(_x,{isInside:!1}),z2=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=bg(ed,n),u=xx(n),{onClose:d}=l;return m.useEffect(()=>(document.addEventListener(I0,d),()=>document.removeEventListener(I0,d)),[d]),m.useEffect(()=>{if(l.trigger){const h=p=>{const g=p.target;g!=null&&g.contains(l.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,d]),m.createElement(vc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:d},m.createElement(Fd,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(dP,null,r),m.createElement(kY,{scope:n,isInside:!0},m.createElement(CY,{id:l.contentId,role:"tooltip"},o||r))))});function NY(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 LY(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 FY(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 zY(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 jY(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),VY(t)}function VY(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 BY=PY,HY=MY,WY=F2,j2=AY,UY=BY,V2=HY,B2=WY,Sx=ie.forwardRef(({className:e,sideOffset:t=4,...n},r)=>k.jsx(j2,{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}));Sx.displayName=j2.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 qY=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),H2=(...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 GY={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 YY=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,...GY,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:H2("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(YY,{ref:i,iconNode:t,className:H2(`lucide-${qY(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 W2=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 zd=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 yg=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 KY=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 U2=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 XY=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 q2=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 QY=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 Cx=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 G2=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 ZY=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 Y2=Rr("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function BE({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,h={maximumFractionDigits:u,minimumFractionDigits:u};if(o){h.style="currency",h.currency=o;try{new Intl.NumberFormat("en-US",h).format(0)}catch{h.currency="USD"}}try{new Intl.NumberFormat(i,h).format(0)}catch{l="en-US"}let g=new Intl.NumberFormat(l,h).format(d);return n&&(g+=a),g}function K2({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]],h=(_=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=h&&h-d!==0?(d-h)/h:null;return k.jsxs("div",{className:"kpi-card flex grow flex-col overflow-scroll",children:[k.jsxs(ig,{className:"grow pb-3",children:[k.jsx(_a,{text:o?i.title:e.title,onSave:g,children:k.jsxs("div",{className:"flex items-center gap-2",children:[k.jsx(sg,{className:"text-base font-medium text-muted-foreground",children:e.title}),!e.refreshInterval&&t&&k.jsx(Cx,{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:BE({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)||""})}),h&&k.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from ",BE({number:h,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(ag,{className:"grow items-start gap-1 pb-4 text-sm",children:[k.jsx(JY,{children:y}),k.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[y>0?"up ":"down ",k.jsx(_a,{text:e.description||"",onSave:b,children:e.description})]})]})]})}function JY({children:e}){const t=e>0?k.jsx(fx,{className:"h-4 w-4"}):k.jsx(dx,{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 sc=1e3,ac=sc*60,lc=ac*60,Ra=lc*24,eK=Ra*7,tK=Ra*365.25,nK=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return rK(e);if(n==="number"&&isFinite(e))return t.long?iK(e):oK(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function rK(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*tK;case"weeks":case"week":case"w":return n*eK;case"days":case"day":case"d":return n*Ra;case"hours":case"hour":case"hrs":case"hr":case"h":return n*lc;case"minutes":case"minute":case"mins":case"min":case"m":return n*ac;case"seconds":case"second":case"secs":case"sec":case"s":return n*sc;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function oK(e){var t=Math.abs(e);return t>=Ra?Math.round(e/Ra)+"d":t>=lc?Math.round(e/lc)+"h":t>=ac?Math.round(e/ac)+"m":t>=sc?Math.round(e/sc)+"s":e+"ms"}function iK(e){var t=Math.abs(e);return t>=Ra?gh(e,t,Ra,"day"):t>=lc?gh(e,t,lc,"hour"):t>=ac?gh(e,t,ac,"minute"):t>=sc?gh(e,t,sc,"second"):e+" ms"}function gh(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const sK=$d(nK);function aK(e){Ee(u=>u.bookmarkKey);const t=Ee(u=>u.dashboard.baseQueries),{authToken:n}=Oa(),r=Ee(u=>u.authToken),o=Ee(u=>u.filterValues),i=Ee(u=>u.isDashboardEditing),s=sK((e==null?void 0:e.refreshInterval)||"0"),a=n$(e.sql,t);return So({queryKey:[e.id,a],queryFn:()=>kp("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===m$?"":e.python,active_filters:o}),refetchInterval:s,enabled:!!e.connectionId&&!i})}function ll({data:e,cfg:t,customCfg:n,preferences:r}){const{dimensionKeys:o,metricKeys:i}=Hr(e),s=wG(i,e,r),a=O0(s,n),l=o[0],u=w2(e,l);wa.merge((t==null?void 0:t.options)||{},r==null?void 0:r.chartOptions);const d=M0((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 lK(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}}}}}function cK(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function uK(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 dK(e){return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function fK(e,t){return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}}}}}function hK(e){return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}}}}}function X2({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s}){if(t==="bar"){const a=cK(n);return ll({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="horizontalBar"){const a=lK(n);return ll({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="stackedBar"){const a=uK(n),{dimensionKeys:l,metricKeys:u}=Hr(e),d=hx({dataArray:e,groupKey:l[0],pivotKey:l[1],valueKey:u[0]});return ll({data:d,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="line"){const a=dK(n);return ll({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="pie"||t==="doughnut"||t==="polarArea"){const a=fK(t,n),{dimensionKeys:l,metricKeys:u}=Hr(e),d=CG(u,e),h=O0(d,r),p=l[0],g=w2(e,p),b=M0((a==null?void 0:a.options)||{},(r==null?void 0:r.options)||{});return{type:t,data:{labels:g,datasets:h},options:b}}if(t==="radar"){const a=hK(n);return ll({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=SG(e),u=O0(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}}}},h=M0(d,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:u},options:h}}return ll({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}function pK({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)&&mK(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&vK(e,t,o,i,a),r==="stackedBar"&&gK({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function gK(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((h,p)=>{var g,b;typeof h.backgroundColor=="string"&&(h.backgroundColor=new Array(h.data.length).fill(h.backgroundColor),h.borderColor=new Array(h.data.length).fill(h.borderColor)),h.backgroundColor=(g=h==null?void 0:h.backgroundColor)==null?void 0:g.map((y,x)=>x===n&&p===r?y:s),h.borderColor=(b=h==null?void 0:h.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((h,p)=>{var g,b,y,x,_,w;h.backgroundColor=new Array(h.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),h.borderColor=new Array(h.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 mK(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,h;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=(h=u==null?void 0:u.borderColor)==null?void 0:h.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 h,p,g,b,y,x;u.backgroundColor=new Array(u.data.length).fill((g=(p=(h=n==null?void 0:n.data)==null?void 0:h.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 vK(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,h;u.backgroundColor=(d=u==null?void 0:u.backgroundColor)==null?void 0:d.map((p,g)=>g===t?p:o),u.borderColor=(h=u==null?void 0:u.borderColor)==null?void 0:h.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 h,p,g,b,y,x,_,w;typeof u.backgroundColor=="string"&&(u.backgroundColor=(g=(p=(h=n==null?void 0:n.data)==null?void 0:h.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 bK(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=hx({dataArray:e.data,groupKey:s[0],pivotKey:s[1],valueKey:a[0]}),u=s[0],d=(i=l[n])==null?void 0:i[u],h=s[1],{metricKeys:p}=Hr(l),g=p[t];return[{columnName:u,columnValue:d,metric:a[0],value:r},{columnName:h,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 yK(e){var s,a;const[t]=m.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=Ma(),r=n(e),o=Ex(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 Ex(e){var V,G,le;const{onChartElementClicked:t}=Oa(),[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:h,addFilteringCard:p,setFrameCardData:g,getSelectedFrame:b,addOrUpdateFilterValue:y,addOrUpdateFilterValues:x,removeFilterValue:_,removeFilteringCard:w}=Ma(),{data:C,isLoading:R,isFetching:E,isError:T,refetch:O}=aK(e),D=s==null?void 0:s.find(ee=>ee.id===e.id);let I;e.data&&e.data.length>0&&(I=X2({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=bK(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:Wu(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,Wu(ae[o].columnValue),ae[o].columnValue,x(te),p(e)}pK({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 xK(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=zu();const y=b.activeCardId;b.cards.forEach(x=>{const _=x.id;x.id=zu(),_===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)}},h=t==null?void 0:t.current;return h==null||h.addEventListener("keydown",d),()=>{h==null||h.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 Vv;const Q2="HoverCard",[Z2,Yae]=mn(Q2,[Lo]),Rx=Lo(),[wK,$x]=Z2(Q2),_K=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=Rx(t),u=m.useRef(0),d=m.useRef(0),h=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),!h.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(wK,{scope:t,open:g,onOpenChange:b,onOpen:y,onClose:x,onDismiss:_,hasSelectionRef:h,isPointerDownOnContentRef:p},m.createElement(Nd,l,n))},SK="HoverCardTrigger",CK=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=$x(SK,n),i=Rx(n);return m.createElement(Ld,ne({asChild:!0},i),m.createElement(ke.a,ne({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:we(e.onPointerEnter,xp(o.onOpen)),onPointerLeave:we(e.onPointerLeave,xp(o.onClose)),onFocus:we(e.onFocus,o.onOpen),onBlur:we(e.onBlur,o.onClose),onTouchStart:we(e.onTouchStart,s=>s.preventDefault())})))}),EK="HoverCardPortal",[Kae,RK]=Z2(EK,{forceMount:void 0}),k0="HoverCardContent",$K=m.forwardRef((e,t)=>{const n=RK(k0,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=$x(k0,e.__scopeHoverCard);return m.createElement(nn,{present:r||i.open},m.createElement(PK,ne({"data-state":i.open?"open":"closed"},o,{onPointerEnter:we(e.onPointerEnter,xp(i.onOpen)),onPointerLeave:we(e.onPointerLeave,xp(i.onClose)),ref:t})))}),PK=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=$x(k0,n),u=Rx(n),d=m.useRef(null),h=Xe(t,d),[p,g]=m.useState(!1);return m.useEffect(()=>{if(p){const b=document.body;return Vv=b.style.userSelect||b.style.webkitUserSelect,b.style.userSelect="none",b.style.webkitUserSelect="none",()=>{b.style.userSelect=Vv,b.style.webkitUserSelect=Vv}}},[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&&OK(d.current).forEach(y=>y.setAttribute("tabindex","-1"))}),m.createElement(vc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:we(i,b=>{b.preventDefault()}),onDismiss:l.onDismiss},m.createElement(Fd,ne({},u,a,{onPointerDown:we(a.onPointerDown,b=>{b.currentTarget.contains(b.target)&&g(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:h,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 xp(e){return t=>t.pointerType==="touch"?void 0:e()}function OK(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 MK=_K,DK=CK,J2=$K,eM=MK,tM=DK,Px=ie.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>k.jsx(J2,{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}));Px.displayName=J2.displayName;function TK({card:e}){const{setCardInfo:t}=Ma();return k.jsxs(eM,{openDelay:0,children:[k.jsx(tM,{children:k.jsx(QY,{className:"size-4 text-muted-foreground/40"})}),k.jsx(Px,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:k.jsx(_a,{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 Ox=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})}));Ox.displayName="Table";const Mx=ie.forwardRef(({className:e,...t},n)=>k.jsx("thead",{ref:n,className:Se("[&_tr]:border-b",e),...t}));Mx.displayName="TableHeader";const Dx=ie.forwardRef(({className:e,...t},n)=>k.jsx("tbody",{ref:n,className:Se("[&_tr:last-child]:border-0",e),...t}));Dx.displayName="TableBody";const AK=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}));AK.displayName="TableFooter";const Mu=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}));Mu.displayName="TableRow";const Tx=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}));Tx.displayName="TableHead";const wp=ie.forwardRef(({className:e,...t},n)=>k.jsx("td",{ref:n,className:Se("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));wp.displayName="TableCell";const IK=ie.forwardRef(({className:e,...t},n)=>k.jsx("caption",{ref:n,className:Se("mt-4 text-sm text-muted-foreground",e),...t}));IK.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 Zi(e,t){return typeof e=="function"?e(t):e}function Cr(e,t){return n=>{t.setState(r=>({...r,[e]:Zi(n,r[e])}))}}function _p(e){return e instanceof Function}function kK(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function NK(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,h=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*h,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function LK(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 h={id:`${String(u)}`,accessorFn:d,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:We(()=>[!0],()=>{var p;return[h,...(p=h.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=h.columns)!=null&&g.length){let b=h.columns.flatMap(y=>y.getLeafColumns());return p(b)}return[h]},{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(h,e);return h}function HE(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 FK={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(h=>n.find(p=>p.id===h)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(h=>n.find(p=>p.id===h)).filter(Boolean))!=null?s:[],u=n.filter(h=>!(r!=null&&r.includes(h.id))&&!(o!=null&&o.includes(h.id)));return mh(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))),mh(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 mh(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 mh(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 mh(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=HE(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)=>HE(n,p,{depth:s,index:g}));u(d,s-1),l.reverse();const h=p=>p.filter(b=>b.column.getIsVisible()).map(b=>{let y=0,x=0,_=[0];b.subHeaders&&b.subHeaders.length?(_=[],h(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 h((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const vh={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Bv=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),zK={getDefaultColumnDef:()=>vh,getInitialState:e=>({columnSizing:{},columnSizingInfo:Bv(),...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:vh.minSize,(r=i??e.columnDef.size)!=null?r:vh.size),(o=e.columnDef.maxSize)!=null?o:vh.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(),Hv(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=Hv(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})))},h=_=>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:_=>h(_.clientX),upHandler:_=>{g==null||g.removeEventListener("mousemove",b.moveHandler),g==null||g.removeEventListener("mouseup",b.upHandler),p(_.clientX)}},y={moveHandler:_=>(_.cancelable&&(_.preventDefault(),_.stopPropagation()),h(_.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=jK()?{passive:!1}:!1;Hv(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?Bv():(n=e.initialState.columnSizingInfo)!=null?n:Bv())},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 bh=null;function jK(){if(typeof bh=="boolean")return bh;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 bh=e,bh}function Hv(e){return e.type==="touchstart"}const VK={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()}}}},nM=(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))};nM.autoRemove=e=>oo(e);const rM=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};rM.autoRemove=e=>oo(e);const oM=(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())};oM.autoRemove=e=>oo(e);const iM=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};iM.autoRemove=e=>oo(e)||!(e!=null&&e.length);const sM=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});sM.autoRemove=e=>oo(e)||!(e!=null&&e.length);const aM=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});aM.autoRemove=e=>oo(e)||!(e!=null&&e.length);const lM=(e,t,n)=>e.getValue(t)===n;lM.autoRemove=e=>oo(e);const cM=(e,t,n)=>e.getValue(t)==n;cM.autoRemove=e=>oo(e);const Ax=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};Ax.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]};Ax.autoRemove=e=>oo(e)||oo(e[0])&&oo(e[1]);const Jo={includesString:nM,includesStringSensitive:rM,equalsString:oM,arrIncludes:iM,arrIncludesAll:sM,arrIncludesSome:aM,equals:lM,weakEquals:cM,inNumberRange:Ax};function oo(e){return e==null||e===""}const BK={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=Zi(n,i?i.value:void 0);if(WE(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=Zi(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(WE(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 WE(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const HK=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),WK=(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},UK=(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},qK=(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]},GK=(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},YK=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!kK(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},KK=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),XK=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,QK=(e,t)=>t.length,Wv={sum:HK,min:WK,max:UK,extent:qK,mean:GK,median:YK,unique:KK,uniqueCount:XK,count:QK},ZK={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 Wv.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Wv.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:Wv[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 JK(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 eX={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 JK(i,n,r)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},N0=0,L0=10,Uv=()=>({pageIndex:N0,pageSize:L0}),tX={getInitialState:e=>({...e,pagination:{...Uv(),...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=>Zi(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Uv():(o=e.initialState.pagination)!=null?o:Uv())},e.setPageIndex=r=>{e.setPagination(o=>{let i=Zi(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?N0:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:N0)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?L0:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:L0)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,Zi(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=Zi(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)}}},qv=()=>({left:[],right:[]}),Gv=()=>({top:[],bottom:[]}),nX={getInitialState:e=>({columnPinning:qv(),rowPinning:Gv(),...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(h=>!(r!=null&&r.includes(h))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(h=>!(r!=null&&r.includes(h))),...r]}}if(n==="left"){var u,d;return{left:[...((u=o==null?void 0:o.left)!=null?u:[]).filter(h=>!(r!=null&&r.includes(h))),...r],right:((d=o==null?void 0:o.right)!=null?d:[]).filter(h=>!(r!=null&&r.includes(h)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(h=>!(r!=null&&r.includes(h))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(h=>!(r!=null&&r.includes(h)))}})},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 h,p;return{top:((h=l==null?void 0:l.top)!=null?h:[]).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?qv():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:qv())},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?Gv():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Gv())},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}})}},rX={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=>{F0(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?Yv(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?Yv(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?Yv(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 F0(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Ix(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return z0(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return z0(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)}}}},F0=(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=>F0(e,a.id,n,r,o))};function Yv(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var u;const d=Ix(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 Ix(e,t){var n;return(n=t[e.id])!=null?n:!1}function z0(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()&&(Ix(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=z0(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const j0=/([0-9]+)/gm,oX=(e,t,n)=>uM(us(e.getValue(n)).toLowerCase(),us(t.getValue(n)).toLowerCase()),iX=(e,t,n)=>uM(us(e.getValue(n)),us(t.getValue(n))),sX=(e,t,n)=>kx(us(e.getValue(n)).toLowerCase(),us(t.getValue(n)).toLowerCase()),aX=(e,t,n)=>kx(us(e.getValue(n)),us(t.getValue(n))),lX=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},cX=(e,t,n)=>kx(e.getValue(n),t.getValue(n));function kx(e,t){return e===t?0:e>t?1:-1}function us(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function uM(e,t){const n=e.split(j0).filter(Boolean),r=t.split(j0).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 nu={alphanumeric:oX,alphanumericCaseSensitive:iX,text:sX,textCaseSensitive:aX,datetime:lX,basic:cX},uX={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 nu.datetime;if(typeof i=="string"&&(r=!0,i.split(j0).length>1))return nu.alphanumeric}return r?nu.text:nu.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:nu[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,h=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:h}],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:h}:g):d==="remove"?u=s.filter(g=>g.id!==e.id):u=[{id:e.id,desc:h}];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())}},dX={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)}}},UE=[FK,dX,eX,nX,BK,uX,ZK,VK,tX,rX,zK];function fX(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:UE};const r=n._features.reduce((d,h)=>Object.assign(d,h.getDefaultOptions==null?void 0:h.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 h;s=(h=d.getInitialState==null?void 0:d.getInitialState(s))!=null?h:s});const a=[];let l=!1;const u={_features:UE,options:{...r,...e},initialState:s,_queue:d=>{a.push(d),l||(l=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();l=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{n.setState(n.initialState)},setOptions:d=>{const h=Zi(d,n.options);n.options=o(h)},getState:()=>n.options.state,setState:d=>{n.options.onStateChange==null||n.options.onStateChange(d)},_getRowId:(d,h,p)=>{var g;return(g=n.options.getRowId==null?void 0:n.options.getRowId(d,h,p))!=null?g:`${p?[p.id,h].join("."):h}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(d,h)=>{let p=(h?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 h;return d=(h=d)!=null?h:{},{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 h=function(p,g,b){return b===void 0&&(b=0),p.map(y=>{const x=LK(n,y,b,g),_=y;return x.columns=_.columns?h(_.columns,x,b+1):[],x})};return h(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(h=>h.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((h,p)=>(h[p.id]=p,h),{}),{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,h)=>{let p=d.flatMap(g=>g.getLeafColumns());return h(p)},{key:process.env.NODE_ENV==="development"&&"getAllLeafColumns",debug:()=>{var d;return(d=n.options.debugAll)!=null?d:n.options.debugColumns}}),getColumn:d=>{const h=n._getAllFlatColumnsById()[d];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${d}' does not exist.`),h}};Object.assign(n,u);for(let d=0;d<n._features.length;d++){const h=n._features[d];h==null||h.createTable==null||h.createTable(n)}return n}function hX(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 pX=(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:()=>NK(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=>hX(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 dM(){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=pX(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 fM(){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,h)=>{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=h.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,h,b.id)),_!==0)return x&&(_*=-1),y.invertSorting&&(_*=-1),_}return d.index-h.index}),u.forEach(d=>{var h;o.push(d),(h=d.subRows)!=null&&h.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 gX(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 hM(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 h;t.options.paginateExpandedRows?h={rows:s,flatRows:a,rowsById:l}:h=gX({rows:s,flatRows:a,rowsById:l}),h.flatRows=[];const p=g=>{h.flatRows.push(g),g.subRows.length&&g.subRows.forEach(p)};return h.rows.forEach(p),h},{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 V0(e,t){return e?mX(e)?ie.createElement(e,t):e:null}function mX(e){return vX(e)||typeof e=="function"||bX(e)}function vX(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function bX(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function pM(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=ie.useState(()=>({current:fX(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 gM({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:h}=Ma(),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(fx,{className:"ml-2 h-5 w-5"}):R==="desc"?k.jsx(dx,{className:"ml-2 h-5 w-5"}):null]})})}})),g=pM({data:e,columns:p,getCoreRowModel:dM(),getPaginationRowModel:hM(),onSortingChange:r,getSortedRowModel:fM(),manualPagination:!0,state:{sorting:n}}),b=g.getSelectedRowModel().rows;m.useEffect(()=>{if(b.length===0){if(s){const w=t.id;d(w),h(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:Wu(T[0]===void 0?"":T[0]),operation:"in",values:T}});l(C),u(t)}},[u,l,t,e,s,a,d,h,b]);function y(w){w.toggleSelected()}return k.jsxs(Ox,{onMouseDown:w=>w.stopPropagation(),children:[k.jsx(Mx,{children:g.getHeaderGroups().map(w=>k.jsx(Mu,{children:w.headers.map(C=>k.jsx(Tx,{className:"sticky top-0 h-8 border-x bg-muted-foreground px-2 py-1 text-background",children:C.isPlaceholder?null:V0(C.column.columnDef.header,C.getContext())},C.id))},w.id))}),k.jsx(Dx,{children:(_=g.getRowModel().rows)!=null&&_.length?g.getRowModel().rows.map(w=>k.jsx(Mu,{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(wp,{className:"border px-2 py-1",children:V0(C.column.columnDef.cell,C.getContext())},C.id))},w.id)):k.jsx(Mu,{children:k.jsx(wp,{colSpan:p.length,className:"p-1 text-center",children:"No results."})})})]})}function yX({frame:e,footer:t,className:n,...r}){const{customCards:o}=Oa(),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);xK(e,i);const{isError:h,isLoading:p,isFetching:g,cfg:b,visualKey:y,handleDatapointClick:x}=Ex(d),{setCardTitle:_,setCardDescription:w,setSelectedFrameId:C}=Ma();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(K2,{isLoading:p||g,card:d}):D}function T(){if(h)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(gM,{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(b2,{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(ig,{className:"pb-4",children:[k.jsxs("div",{className:"flex items-center gap-2",children:[k.jsx(_a,{text:d.title,onSave:I=>_(a,d.id,I),children:k.jsx(sg,{className:"text-base",children:d.title})}),(u||d.info)&&k.jsx(TK,{card:d}),d.refreshInterval&&k.jsxs(V2,{children:[k.jsx(B2,{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(Sx,{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(Cx,{className:"h-4 w-4 animate-spin text-muted-foreground"})]}),k.jsx(_a,{text:(d==null?void 0:d.description)||"",onSave:I=>w(a,d.id,I),children:k.jsxs(qy,{children:[" ",d.description]})})]}),k.jsx(ag,{className:"relative flex grow flex-col",children:T()}),k.jsx(Gy,{children:O()})]});return k.jsxs(Uy,{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(RG,{frame:e}),E()]})}const xX=rC.WidthProvider(rC.Responsive);function wX(){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),h=i(),p=m.useCallback(R=>{d(R)},[]),g=m.useCallback((R,E)=>{h!=null&&h.id&&u(h.id,E)},[h==null?void 0:h.id,u]);if(!n)return null;const b=(R,E)=>k.jsx(mM,{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(yX,{frame:R})},R.id))}return k.jsx(k.Fragment,{children:k.jsx(xX,{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 mM=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}));mM.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 Sp(){return Sp=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},Sp.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 Cp(){return Cp=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},Cp.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 cl(e,t,n){var r,o=(r=n.initialDeps)!=null?r:[],i;return function(){var s;n.key&&n.debug!=null&&n.debug()&&(s=Date.now());var a=e(),l=a.length!==o.length||a.some(function(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,h=Math.round((Date.now()-u)*100)/100,p=h/16,g=function(y,x){for(y=String(y);y.length<x;)y=" "+y;return y};console.info("%c⏱ "+g(h,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 Kv(e,t){if(e===void 0)throw new Error("Unexpected undefined"+(t?": "+t:""));return e}var _X=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 SX=function(t){return t},CX=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},EX=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)}}},RX=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)}}},$X=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"])},PX=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))},OX=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=Cp({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:SX,rangeExtractor:CX,onChange:function(){},measureElement:$X,initialRect:{width:0,height:0},scrollMargin:0,scrollingDelay:150,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1},r)},this.notify=function(r){n.options.onChange==null||n.options.onChange(n,r)},this.maybeNotify=cl(function(){return n.calculateRange(),[n.isScrolling,n.range?n.range.startIndex:null,n.range?n.range.endIndex:null]},function(r){n.notify(r)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:function(){return n.options.debug},initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=function(){n.unsubs.filter(Boolean).forEach(function(r){return r()}),n.unsubs=[],n.scrollElement=null},this._didMount=function(){return n.measureElementCache.forEach(n.observer.observe),function(){n.observer.disconnect(),n.cleanup()}},this._willUpdate=function(){var r=n.options.getScrollElement();n.scrollElement!==r&&(n.cleanup(),n.scrollElement=r,n._scrollToOffset(n.scrollOffset,{adjustments:void 0,behavior:void 0}),n.unsubs.push(n.options.observeElementRect(n,function(o){n.scrollRect=o,n.maybeNotify()})),n.unsubs.push(n.options.observeElementOffset(n,function(o){n.scrollAdjustments=0,n.scrollOffset!==o&&(n.isScrollingTimeoutId!==null&&(clearTimeout(n.isScrollingTimeoutId),n.isScrollingTimeoutId=null),n.isScrolling=!0,n.scrollDirection=n.scrollOffset<o?"forward":"backward",n.scrollOffset=o,n.maybeNotify(),n.isScrollingTimeoutId=setTimeout(function(){n.isScrollingTimeoutId=null,n.isScrolling=!1,n.scrollDirection=null,n.maybeNotify()},n.options.scrollingDelay))})))},this.getSize=function(){return n.scrollRect[n.options.horizontal?"width":"height"]},this.memoOptions=cl(function(){return[n.options.count,n.options.paddingStart,n.options.scrollMargin,n.options.getItemKey]},function(r,o,i,s){return n.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:o,scrollMargin:i,getItemKey:s}},{key:!1}),this.getFurthestMeasurement=function(r,o){for(var i=new Map,s=new Map,a=o-1;a>=0;a--){var l=r[a];if(!i.has(l.lane)){var 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,h){return d.end-h.end})[0]:void 0},this.getMeasurements=cl(function(){return[n.memoOptions(),n.itemSizeCache]},function(r,o){var i=r.count,s=r.paddingStart,a=r.scrollMargin,l=r.getItemKey,u=n.pendingMeasuredCacheIndexes.length>0?Math.min.apply(Math,n.pendingMeasuredCacheIndexes):0;n.pendingMeasuredCacheIndexes=[];for(var d=n.measurementsCache.slice(0,u),h=u;h<i;h++){var p=l(h),g=n.options.lanes===1?d[h-1]:n.getFurthestMeasurement(d,h),b=g?g.end:s+a,y=o.get(p),x=typeof y=="number"?y:n.options.estimateSize(h),_=b+x,w=g?g.lane:h%n.options.lanes;d[h]={index:h,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=cl(function(){return[n.getMeasurements(),n.getSize(),n.scrollOffset]},function(r,o,i){return n.range=r.length>0&&o>0?MX({measurements:r,outerSize:o,scrollOffset:i}):null},{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:function(){return n.options.debug}}),this.getIndexes=cl(function(){return[n.options.rangeExtractor,n.calculateRange(),n.options.overscan,n.options.count]},function(r,o,i,s){return o===null?[]:r(Cp({},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=cl(function(){return[n.getIndexes(),n.getMeasurements()]},function(r,o){for(var i=[],s=0,a=r.length;s<a;s++){var l=r[s],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 Kv(o[vM(0,o.length-1,function(i){return Kv(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=Kv(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],h=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,h),b=g[0];_X(b,n.scrollOffset)||n.scrollToIndex(r,{align:h,behavior:l})}else n.scrollToIndex(r,{align:h,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()},vM=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 MX(e){for(var t=e.measurements,n=e.outerSize,r=e.scrollOffset,o=t.length-1,i=function(u){return t[u].start},s=vM(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 DX=typeof document<"u"?ie.useLayoutEffect:ie.useEffect;function TX(e){var t=ie.useReducer(function(){return{}},{})[1],n=Sp({},e,{onChange:function(s,a){a?Ao.flushSync(t):t(),e.onChange==null||e.onChange(s,a)}}),r=ie.useState(function(){return new OX(n)}),o=r[0];return o.setOptions(n),ie.useEffect(function(){return o._didMount()},[]),DX(function(){return o._willUpdate()}),o}function AX(e){return TX(Sp({observeElementRect:EX,observeElementOffset:RX,scrollToFn:PX},e))}var IX=Object.defineProperty,kX=(e,t,n)=>t in e?IX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Xv=(e,t,n)=>(kX(e,typeof t!="symbol"?t+"":t,n),n);let NX=class{constructor(){Xv(this,"current",this.detect()),Xv(this,"handoffState","pending"),Xv(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"}},ga=new NX,un=(e,t)=>{ga.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 Nx(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 LX(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 FX(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function $a(){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 FX(()=>{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=$a();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 jd(){let[e]=m.useState($a);return m.useEffect(()=>()=>e.dispose(),[e]),e}function zX(){let e=typeof document>"u";return"useSyncExternalStore"in ie?(t=>t.useSyncExternalStore)(ie)(()=>()=>{},()=>!1,()=>!e):!1}function Lx(){let e=zX(),[t,n]=ie.useState(ga.isHandoffComplete);return t&&ga.isHandoffComplete===!1&&n(!1),ie.useEffect(()=>{t!==!0&&n(!0)},[t]),ie.useEffect(()=>ga.handoff(),[]),e?!1:t}var qE;let Vd=(qE=m.useId)!=null?qE:function(){let e=Lx(),[t,n]=m.useState(e?()=>ga.nextId():null);return un(()=>{t===null&&n(ga.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 Fx(e){return ga.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let GE=["[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 jX=(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))(jX||{}),VX=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(VX||{}),BX=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(BX||{}),bM=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(bM||{});function HX(e,t=0){var n;return e===((n=Fx(e))==null?void 0:n.body)?!1:Sn(t,{0(){return e.matches(GE)},1(){let r=e;for(;r!==null;){if(r.matches(GE))return!0;r=r.parentElement}return!1}})}var WX=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(WX||{});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 UX(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 qX(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function GX(){return/Android/gi.test(window.navigator.userAgent)}function yM(){return qX()||GX()}function yh(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 YX(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 KX(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(h){return typeof h=="function"?d(h()):Array.isArray(h)||h instanceof Set?h:[h]}(e);for(let d of u){if(d===null)continue;let h=d instanceof HTMLElement?d:d.current;if(h!=null&&h.contains(l)||s.composed&&s.composedPath().includes(h))return}return!HX(l,bM.Loose)&&l.tabIndex!==-1&&s.preventDefault(),t(s,l)}let i=m.useRef(null);yh("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),yh("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),yh("click",s=>{yM()||i.current&&(o(s,()=>i.current),i.current=null)},!0),yh("touchend",s=>o(s,()=>s.target instanceof HTMLElement?s.target:null),!0),YX("blur",s=>o(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function XX(...e){return m.useMemo(()=>Fx(...e),[...e])}function YE(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 QX(e,t){let[n,r]=m.useState(()=>YE(e));return un(()=>{r(YE(e))},[e.type,e.as]),un(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let ZX=Symbol();function ka(...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[ZX]))?void 0:n}function KE(e){return[e.screenX,e.screenY]}function JX(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=KE(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=KE(t)}}}function eQ({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=Fx(e);if(!s)return;let a=o.current,l=i.current,u=Object.assign(h=>a(h),{acceptNode:a}),d=s.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,u,!1);for(;d.nextNode();)l(d.currentNode)},[e,r,o,i])}function XE(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 Ep(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Rp=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Rp||{}),Ji=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Ji||{});function wi({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??tQ;let l=xM(t,e);if(i)return xh(l,n,r,s,a);let u=o??0;if(u&2){let{static:d=!1,...h}=l;if(d)return xh(h,n,r,s,a)}if(u&1){let{unmount:d=!0,...h}=l;return Sn(d?0:1,{0(){return null},1(){return xh({...h,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return xh(l,n,r,s,a)}function xh(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=Qv(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 h={};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&&(h["data-headlessui-state"]=g.join(" "))}if(i===m.Fragment&&Object.keys(B0(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)=>Ep(p==null?void 0:p.className(...y),l.className):Ep(p==null?void 0:p.className,l.className),b=g?{className:g}:{};return m.cloneElement(d,Object.assign({},xM(d.props,B0(Qv(l,["ref"]))),h,u,{ref:o(d.ref,u.ref)},b))}return m.createElement(i,Object.assign({},Qv(l,["ref"]),i!==m.Fragment&&u,i!==m.Fragment&&h),d)}function tQ(...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 xM(...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 B0(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Qv(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let nQ="div";var wM=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(wM||{});function rQ(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:nQ,name:"Hidden"})}let oQ=Fo(rQ),zx=m.createContext(null);zx.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 jx(){return m.useContext(zx)}function _M({value:e,children:t}){return m.createElement(zx.Provider,{value:e},t)}function iQ(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Qs=[];iQ(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&Qs[0]!==t.target&&(Qs.unshift(t.target),Qs=Qs.filter(n=>n!=null&&n.isConnected),Qs.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 sQ(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&&aQ(n)?!1:r}function aQ(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function lQ(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 QE(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:lQ(e)}}function SM(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))EM(n,CM(t,r),o);return n}function CM(e,t){return e?e+"["+t+"]":t}function EM(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())EM(e,CM(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,""]):SM(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||{}),cQ=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(cQ||{}),uQ=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(uQ||{}),dQ=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(dQ||{}),fQ=(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))(fQ||{});function Zv(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):UX(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let hQ={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:QE(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.")}}),h=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===d&&e.activationTrigger===h?e:{...e,activeOptionIndex:d,activationTrigger:h}}let a=Zv(e);if(a.activeOptionIndex===null){let d=a.options.findIndex(h=>!h.dataRef.current.disabled);d!==-1&&(a.activeOptionIndex=d)}let l=t.focus===ln.Specific?t.idx:QE(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=Zv(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=Zv(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})}}},Vx=m.createContext(null);Vx.displayName="ComboboxActionsContext";function Bd(e){let t=m.useContext(Vx);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Bd),n}return t}let RM=m.createContext(null);function pQ(e){var t;let n=Na("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=AX({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(RM.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 Bx=m.createContext(null);Bx.displayName="ComboboxDataContext";function Na(e){let t=m.useContext(Bx);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Na),n}return t}function gQ(e,t){return Sn(t.type,hQ,e,t)}let mQ=m.Fragment;function vQ(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:h=!1,immediate:p=!1,virtual:g=null,...b}=e,y=!1,x=null,[_=h?[]:void 0,w]=LX(n,o,r),[C,R]=m.useReducer(gQ,{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:h?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,h,d,u,C,x]);un(()=>{},[x,void 0]),un(()=>{C.dataRef.current=F},[F]),KX([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=jd();return m.useEffect(()=>{de.current&&r!==void 0&&J.addEventListener(de.current,"reset",()=>{w==null||w(r)})},[de,w]),m.createElement(Vx.Provider,{value:ge},m.createElement(Bx.Provider,{value:F},m.createElement(_M,{value:Sn(F.comboboxState,{0:yr.Open,1:yr.Closed})},s!=null&&_!=null&&SM({[s]:_}).map(([X,re],be)=>m.createElement(oQ,{features:wM.Hidden,ref:be===0?H=>{var De;de.current=(De=H==null?void 0:H.closest("form"))!=null?De:null}:void 0,...B0({key:X,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:X,value:re})})),wi({ourProps:ve,theirProps:b,slot:Z,defaultTag:mQ,name:"Combobox"}))))}let bQ="input";function yQ(e,t){var n,r,o,i,s;let a=Vd(),{id:l=`headlessui-combobox-input-${a}`,onChange:u,displayValue:d,type:h="text",...p}=e,g=Na("Combobox.Input"),b=Bd("Combobox.Input"),y=ka(g.inputRef,t),x=XX(g.inputRef),_=m.useRef(!1),w=jd(),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:""}();XE(([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]),XE(([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:Qs.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:Qs.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=Nx(()=>{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:h,"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:bQ,name:"Combobox.Input"})}let xQ="button";function wQ(e,t){var n;let r=Na("Combobox.Button"),o=Bd("Combobox.Button"),i=ka(r.buttonRef,t),s=Vd(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,u=jd(),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}}),h=st(y=>{if(sQ(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=Nx(()=>{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:QX(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:h,onKeyDown:d};return wi({ourProps:b,theirProps:l,slot:g,defaultTag:xQ,name:"Combobox.Button"})}let _Q="label";function SQ(e,t){let n=Vd(),{id:r=`headlessui-combobox-label-${n}`,...o}=e,i=Na("Combobox.Label"),s=Bd("Combobox.Label"),a=ka(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:_Q,name:"Combobox.Label"})}let CQ="ul",EQ=Rp.RenderStrategy|Rp.Static;function RQ(e,t){let n=Vd(),{id:r=`headlessui-combobox-options-${n}`,hold:o=!1,...i}=e,s=Na("Combobox.Options"),a=ka(s.optionsRef,t),l=jx(),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]),eQ({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=Nx(()=>{var g,b;return(b=s.labelId)!=null?b:(g=s.buttonRef.current)==null?void 0:g.id},[s.labelId,s.buttonRef.current]),h=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(pQ,null,i.children)}),wi({ourProps:p,theirProps:i,slot:h,defaultTag:CQ,features:EQ,visible:u,name:"Combobox.Options"})}let $Q="li";function PQ(e,t){var n;let r=Vd(),{id:o=`headlessui-combobox-option-${r}`,disabled:i=!1,value:s,order:a=null,...l}=e,u=Na("Combobox.Option"),d=Bd("Combobox.Option"),h=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(RM),x=ka(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=$a();return N.requestAnimationFrame(()=>{w.current=!0}),N.dispose},[u.virtual,u.__demoMode]),un(()=>{if(!w.current||u.comboboxState!==0||!h||u.activationTrigger===0)return;let N=$a();return N.requestAnimationFrame(()=>{var V,G;(G=(V=g.current)==null?void 0:V.scrollIntoView)==null||G.call(V,{block:"nearest"})}),N.dispose},[g,h,u.comboboxState,u.activationTrigger,u.activeOptionIndex]);let C=st(N=>{var V;if(i||(V=u.virtual)!=null&&V.disabled(s))return N.preventDefault();_(),yM()||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=JX(),T=st(N=>E.update(N)),O=st(N=>{var V;if(!E.wasMoved(N)||i||(V=u.virtual)!=null&&V.disabled(s)||h)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)||h&&(u.optionsPropsRef.current.hold||d.goToOption(ln.Nothing)))}),I=m.useMemo(()=>({active:h,selected:p,disabled:i}),[h,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:$Q,name:"Combobox.Option"})}let OQ=Fo(vQ),MQ=Fo(wQ),DQ=Fo(yQ),TQ=Fo(SQ),AQ=Fo(RQ),IQ=Fo(PQ),ul=Object.assign(OQ,{Input:DQ,Button:MQ,Label:TQ,Options:AQ,Option:IQ});function Hx(){let e=m.useRef(!1);return un(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function kQ(e=0){let[t,n]=m.useState(e),r=Hx(),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 NQ(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Jv(e,...t){e&&t.length>0&&e.classList.add(...t)}function eb(e,...t){e&&t.length>0&&e.classList.remove(...t)}function LQ(e,t){let n=$a();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,h)=>h-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 FQ(e,t,n,r){let o=n?"enter":"leave",i=$a(),s=r!==void 0?NQ(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 eb(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Jv(e,...t.base,...a,...u),i.nextFrame(()=>{eb(e,...t.base,...a,...u),Jv(e,...t.base,...a,...l),LQ(e,()=>(eb(e,...t.base,...a),Jv(e,...t.base,...t.entered),s()))}),i.dispose}function zQ({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let s=Hx(),a=jd(),l=$o(n);un(()=>{e&&(l.current="enter")},[e]),un(()=>{let u=$a();a.add(u.dispose);let d=t.current;if(d&&l.current!=="idle"&&s.current)return u.dispose(),o.current(l.current),u.add(FQ(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 xg=m.createContext(null);xg.displayName="TransitionContext";var jQ=(e=>(e.Visible="visible",e.Hidden="hidden",e))(jQ||{});function VQ(){let e=m.useContext(xg);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function BQ(){let e=m.useContext(wg);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let wg=m.createContext(null);wg.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 $M(e,t){let n=$o(e),r=m.useRef([]),o=Hx(),i=jd(),s=st((g,b=Ji.Hidden)=>{let y=r.current.findIndex(({el:x})=>x===g);y!==-1&&(Sn(b,{[Ji.Unmount](){r.current.splice(y,1)},[Ji.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,Ji.Unmount)}),l=m.useRef([]),u=m.useRef(Promise.resolve()),d=m.useRef({enter:[],leave:[],idle:[]}),h=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:h,onStop:p,wait:u,chains:d}),[a,s,r,h,p,d,u])}function HQ(){}let WQ=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function ZE(e){var t;let n={};for(let r of WQ)n[r]=(t=e[r])!=null?t:HQ;return n}function UQ(e){let t=m.useRef(ZE(e));return m.useEffect(()=>{t.current=ZE(e)},[e]),t}let qQ="div",PM=Rp.RenderStrategy;function GQ(e,t){var n,r;let{beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a,enter:l,enterFrom:u,enterTo:d,entered:h,leave:p,leaveFrom:g,leaveTo:b,...y}=e,x=m.useRef(null),_=ka(x,t),w=(n=y.unmount)==null||n?Ji.Unmount:Ji.Hidden,{show:C,appear:R,initial:E}=VQ(),[T,O]=m.useState(C?"visible":"hidden"),D=BQ(),{register:I,unregister:N}=D;m.useEffect(()=>I(x),[I,x]),m.useEffect(()=>{if(w===Ji.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(h),leave:Ni(p),leaveFrom:Ni(g),leaveTo:Ni(b)}),G=UQ({beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a}),le=Lx();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=kQ(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=$M(()=>{O("hidden"),N(x)},D),B=m.useRef(!1);zQ({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:Ep(y.className,...V.current.enter,...V.current.enterFrom)}:B.current&&(te.className=Ep(y.className,(r=x.current)==null?void 0:r.className),te.className===""&&delete te.className),m.createElement(wg.Provider,{value:j},m.createElement(_M,{value:Sn(T,{visible:yr.Open,hidden:yr.Closed})|Y.flags},wi({ourProps:ce,theirProps:te,defaultTag:qQ,features:PM,visible:T==="visible",name:"Transition.Child"})))}function YQ(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=m.useRef(null),a=ka(s,t);Lx();let l=jx();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"),h=$M(()=>{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(h))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,h]);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(wg.Provider,{value:h},m.createElement(xg.Provider,{value:y},wi({ourProps:{...x,as:m.Fragment,children:m.createElement(OM,{ref:a,...x,...i,beforeEnter:_,beforeLeave:w})},theirProps:{},defaultTag:m.Fragment,features:PM,visible:u==="visible",name:"Transition"})))}function KQ(e,t){let n=m.useContext(xg)!==null,r=jx()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(H0,{ref:t,...e}):m.createElement(OM,{ref:t,...e}))}let H0=Fo(YQ),OM=Fo(GQ),XQ=Fo(KQ),QQ=Object.assign(H0,{Child:XQ,Root:H0});const Sg=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],cc=["number","integer","int","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8"],Hd=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],Wx=["boolean"];function MM(e){return e.match(/[A-Z]/)?`"${e}"`:e}function ZQ(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=DM(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 JQ(e,t,n="AVG"){var i,s,a,l;let r={};const o=MM(e.column_name);return Sg.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]}),cc.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 $p(e){return Sg.includes(e.dataType)?"string":cc.includes(e.dataType)?"number":Hd.includes(e.dataType)?"date":Wx.includes(e.dataType)?"boolean":"string"}function eZ(e){let t;const n=e.data_type.toLowerCase();return Sg.includes(n)?t="T":cc.includes(n)?t="#":Hd.includes(n)?t="D":Wx.includes(n)?t="B":t="?",t}function tZ(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 DM(e,t){return t==="api"||t==="s3"||e==="public"?t:e?`${e}.${t}`:`${t}`}function nZ(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 rZ(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 Hd.includes(e)?o:r}const JE=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,eR=Wh,Ux=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return eR(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],h=i==null?void 0:i[u];if(d===null)return null;const p=JE(d)||JE(h);return o[u][p]}),a=n&&Object.entries(n).reduce((u,d)=>{let[h,p]=d;return p===void 0||(u[h]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,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,h,p]:u},[]);return eR(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},W0=Ux("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"}}),ma=ie.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?pi:"button";return k.jsx(s,{className:Se(W0({variant:t,size:n,className:e})),ref:i,...o})});ma.displayName="Button";function oZ({filter:e}){const[t,n]=m.useState([]),[r,o]=m.useState(""),[i,s]=m.useState(""),a=m.useRef(null),{authToken:l}=Oa(),u=Ee(D=>D.filterValues),d=Ee(D=>D.actions.addOrUpdateFilterValue),h=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:()=>kp("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=nZ(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:$p(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){h(e.id);return}const I={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:$p(e),operation:e.operation,values:D.map(N=>N.value)};d(I)}function T(){var D;o(""),h(e.id),console.log(e.id),(D=a.current)==null||D.click()}if(b)return k.jsx("div",{children:k.jsx(gy,{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 cc.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(ul,{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(ul.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(ul.Button,{ref:a,className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:k.jsx(rG,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),k.jsx(QQ,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:k.jsxs(ul.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:[cc.includes(e.dataType)&&k.jsxs(ul.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(ma,{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(ul.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(y2,{className:"h-5 w-5","aria-hidden":"true"})}):null]}))},D.value))]})})]})})})}const iZ=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()}}))),TM=iZ,sZ=Ux("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),si=ie.forwardRef(({className:e,...t},n)=>k.jsx(TM,{ref:n,className:Se(sZ(),e),...t}));si.displayName=TM.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 qx=6048e5,aZ=864e5;let lZ={};function Wd(){return lZ}function To(e,t){var a,l,u,d;const n=Wd(),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 Pa(e){return To(e,{weekStartsOn:1})}function AM(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=Pa(r),i=Er(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=Pa(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function uc(e){const t=vt(e);return t.setHours(0,0,0,0),t}function Pp(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=uc(e),r=uc(t),o=+n-Pp(n),i=+r-Pp(r);return Math.round((o-i)/aZ)}function cZ(e){const t=AM(e),n=Er(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Pa(n)}function U0(e,t){const n=t*7;return Bn(e,n)}function uZ(e,t){return so(e,t*12)}function dZ(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 fZ(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=uc(e),r=uc(t);return+n==+r}function Gx(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function hZ(e){if(!Gx(e)&&typeof e!="number")return!1;const t=vt(e);return!isNaN(Number(t))}function td(e,t){const n=vt(e),r=vt(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function pZ(e,t,n){const r=To(e,n),o=To(t,n),i=+r-Pp(r),s=+o-Pp(o);return Math.round((i-s)/qx)}function Yx(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 IM(e){const t=vt(e),n=Er(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Kx(e,t){var a,l,u,d;const n=Wd(),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 kM(e){return Kx(e,{weekStartsOn:1})}const gZ={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"}},mZ=(e,t,n)=>{let r;const o=gZ[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 tb(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const vZ={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},bZ={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},yZ={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},xZ={date:tb({formats:vZ,defaultWidth:"full"}),time:tb({formats:bZ,defaultWidth:"full"}),dateTime:tb({formats:yZ,defaultWidth:"full"})},wZ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},_Z=(e,t,n,r)=>wZ[e];function ru(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 SZ={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},CZ={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},EZ={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"]},RZ={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"]},$Z={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"}},PZ={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"}},OZ=(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"},MZ={ordinalNumber:OZ,era:ru({values:SZ,defaultWidth:"wide"}),quarter:ru({values:CZ,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ru({values:EZ,defaultWidth:"wide"}),day:ru({values:RZ,defaultWidth:"wide"}),dayPeriod:ru({values:$Z,defaultWidth:"wide",formattingValues:PZ,defaultFormattingWidth:"wide"})};function ou(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)?TZ(a,h=>h.test(s)):DZ(a,h=>h.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 DZ(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function TZ(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function AZ(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 IZ=/^(\d+)(th|st|nd|rd)?/i,kZ=/\d+/i,NZ={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},LZ={any:[/^b/i,/^(a|c)/i]},FZ={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zZ={any:[/1/i,/2/i,/3/i,/4/i]},jZ={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},VZ={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]},BZ={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},HZ={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},WZ={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},UZ={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}},qZ={ordinalNumber:AZ({matchPattern:IZ,parsePattern:kZ,valueCallback:e=>parseInt(e,10)}),era:ou({matchPatterns:NZ,defaultMatchWidth:"wide",parsePatterns:LZ,defaultParseWidth:"any"}),quarter:ou({matchPatterns:FZ,defaultMatchWidth:"wide",parsePatterns:zZ,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ou({matchPatterns:jZ,defaultMatchWidth:"wide",parsePatterns:VZ,defaultParseWidth:"any"}),day:ou({matchPatterns:BZ,defaultMatchWidth:"wide",parsePatterns:HZ,defaultParseWidth:"any"}),dayPeriod:ou({matchPatterns:WZ,defaultMatchWidth:"any",parsePatterns:UZ,defaultParseWidth:"any"})},NM={code:"en-US",formatDistance:mZ,formatLong:xZ,formatRelative:_Z,localize:MZ,match:qZ,options:{weekStartsOn:0,firstWeekContainsDate:1}};function GZ(e){const t=vt(e);return Eo(t,IM(t))+1}function LM(e){const t=vt(e),n=+Pa(t)-+cZ(t);return Math.round(n/qx)+1}function FM(e,t){var d,h,p,g;const n=vt(e),r=n.getFullYear(),o=Wd(),i=(t==null?void 0:t.firstWeekContainsDate)??((h=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:h.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 YZ(e,t){var a,l,u,d;const n=Wd(),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=FM(e,t),i=Er(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),To(i,t)}function zM(e,t){const n=vt(e),r=+To(n,t)-+YZ(n,t);return Math.round(r/qx)+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)}},dl={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},tR={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=FM(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=AM(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=zM(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Rt(o,t.length)},I:function(e,t,n){const r=LM(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=GZ(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=dl.noon:r===0?o=dl.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=dl.evening:r>=12?o=dl.afternoon:r>=4?o=dl.morning:o=dl.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 rR(r);case"XXXX":case"XX":return Ys(r);case"XXXXX":case"XXX":default:return Ys(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return rR(r);case"xxxx":case"xx":return Ys(r);case"xxxxx":case"xxx":default:return Ys(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+nR(r,":");case"OOOO":default:return"GMT"+Ys(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+nR(r,":");case"zzzz":default:return"GMT"+Ys(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 nR(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 rR(e,t){return e%60===0?(e>0?"-":"+")+Rt(Math.abs(e)/60,2):Ys(e,t)}function Ys(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 oR=(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"})}},jM=(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"})}},KZ=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return oR(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}}",oR(r,t)).replace("{{time}}",jM(o,t))},XZ={p:jM,P:KZ},QZ=/^D+$/,ZZ=/^Y+$/,JZ=["D","DD","YY","YYYY"];function eJ(e){return QZ.test(e)}function tJ(e){return ZZ.test(e)}function nJ(e,t,n){const r=rJ(e,t,n);if(console.warn(r),JZ.includes(e))throw new RangeError(r)}function rJ(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 oJ=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,iJ=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sJ=/^'([^]*?)'?$/,aJ=/''/g,lJ=/[a-zA-Z]/;function Po(e,t,n){var d,h,p,g,b,y,x,_;const r=Wd(),o=(n==null?void 0:n.locale)??r.locale??NM,i=(n==null?void 0:n.firstWeekContainsDate)??((h=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:h.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(!hZ(a))throw new RangeError("Invalid time value");let l=t.match(iJ).map(w=>{const C=w[0];if(C==="p"||C==="P"){const R=XZ[C];return R(w,o.formatLong)}return w}).join("").match(oJ).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const C=w[0];if(C==="'")return{isToken:!1,value:cJ(w)};if(tR[C])return{isToken:!0,value:w};if(C.match(lJ))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)&&tJ(C)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&eJ(C))&&nJ(C,t,String(e));const R=tR[C[0]];return R(a,C,o.localize,u)}).join("")}function cJ(e){const t=e.match(sJ);return t?t[1].replace(aJ,"'"):e}function uJ(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 dJ(e){return Math.trunc(+vt(e)/1e3)}function fJ(e){const t=vt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function hJ(e,t){return pZ(fJ(e),rr(e),t)+1}function q0(e,t){const n=vt(e),r=vt(t);return n.getTime()>r.getTime()}function VM(e,t){const n=vt(e),r=vt(t);return+n<+r}function Xx(e,t){const n=vt(e),r=vt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function pJ(e,t){const n=vt(e),r=vt(t);return n.getFullYear()===r.getFullYear()}function nb(e,t){return Bn(e,-t)}function rb(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=uJ(i);return n.setMonth(t,Math.min(o,s)),n}function iR(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 gJ(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 BM(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 G0={exports:{}},iu={};/**
|
|
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 sR;function mJ(){return sR||(sR=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"),h=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===h||$.$$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 h: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:"",Os=fn?J(fn):"";return typeof $=="function"&&re.set($,Os),Os}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 h: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 _c($){try{return Gr($),!1}catch{return!0}}function Gr($){return""+$}function ps($){if(_c($))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 gs($){if(qe.call($,"ref")){var U=Object.getOwnPropertyDescriptor($,"ref").get;if(U&&U.isReactWarning)return!1}return $.ref!==void 0}function ms($){if(qe.call($,"key")){var U=Object.getOwnPropertyDescriptor($,"key").get;if(U&&U.isReactWarning)return!1}return $.key!==void 0}function vs($,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 bs($,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 ys($,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 xs=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 Sc($,U,oe,xe,Te){{var Ie,Pe={},Re=null,mt=null;oe!==void 0&&(ps(oe),Re=""+oe),ms(U)&&(ps(U.key),Re=""+U.key),gs(U)&&(mt=U.ref,vs(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&&bs(Pe,Ge),mt&&ys(Pe,Ge)}return xs($,Re,mt,Te,xe,vn.current,Pe)}}var Vo=_.ReactCurrentOwner,ws=_.ReactDebugCurrentFrame;function Rn($){if($){var U=$._owner,oe=Ve($.type,$._source,U?U.type:null);ws.setExtraStackFrame(oe)}else ws.setExtraStackFrame(null)}var uo;uo=!1;function Bo($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function _s(){{if(Vo.current){var $=le(Vo.current.type);if($)return`
|
|
297
|
+
|
|
298
|
+
Check the render method of \``+$+"`."}return""}}function Cc($){{if($!==void 0){var U=$.fileName.replace(/^.*[\\\/]/,""),oe=$.lineNumber;return`
|
|
299
|
+
|
|
300
|
+
Check your code at `+U+":"+oe+"."}return""}}var Ss={};function Va($){{var U=_s();if(!U){var oe=typeof $=="string"?$:$.displayName||$.name;oe&&(U=`
|
|
301
|
+
|
|
302
|
+
Check the top-level render call using <`+oe+">.")}return U}}function Cs($,U){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var oe=Va(U);if(Ss[oe])return;Ss[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 Es($,U){{if(typeof $!="object")return;if(En($))for(var oe=0;oe<$.length;oe++){var xe=$[oe];Bo(xe)&&Cs(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)&&Cs(Pe.value,U)}}}function Ec($){{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===h))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 Rs($){{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 $s($,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=Cc(Te);mt?Re+=mt:Re+=_s();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=Sc($,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++)Es(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 Es(Ot,$)}return $===r?Rs(Ge):Ec(Ge),Ge}}function Ps($,U,oe){return $s($,U,oe,!0)}function Rc($,U,oe){return $s($,U,oe,!1)}var $c=Rc,Pc=Ps;iu.Fragment=r,iu.jsx=$c,iu.jsxs=Pc}()),iu}var su={};/**
|
|
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 aR;function vJ(){if(aR)return su;aR=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,h={},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)&&(h[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)h[d]===void 0&&(h[d]=l[d]);return{$$typeof:t,type:a,key:p,ref:g,props:h,_owner:o.current}}return su.Fragment=n,su.jsx=s,su.jsxs=s,su}process.env.NODE_ENV==="production"?G0.exports=vJ():G0.exports=mJ();var me=G0.exports;function Ud(e){return e.mode==="multiple"}function qd(e){return e.mode==="range"}function Cg(e){return e.mode==="single"}var bJ={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 yJ(e,t){return Po(e,"LLLL y",t)}function xJ(e,t){return Po(e,"d",t)}function wJ(e,t){return Po(e,"LLLL",t)}function _J(e){return"".concat(e)}function SJ(e,t){return Po(e,"cccccc",t)}function CJ(e,t){return Po(e,"yyyy",t)}var EJ=Object.freeze({__proto__:null,formatCaption:yJ,formatDay:xJ,formatMonthCaption:wJ,formatWeekNumber:_J,formatWeekdayName:SJ,formatYearCaption:CJ}),RJ=function(e,t,n){return Po(e,"do MMMM (EEEE)",n)},$J=function(){return"Month: "},PJ=function(){return"Go to next month"},OJ=function(){return"Go to previous month"},MJ=function(e,t){return Po(e,"cccc",t)},DJ=function(e){return"Week n. ".concat(e)},TJ=function(){return"Year: "},AJ=Object.freeze({__proto__:null,labelDay:RJ,labelMonthDropdown:$J,labelNext:PJ,labelPrevious:OJ,labelWeekNumber:DJ,labelWeekday:MJ,labelYearDropdown:TJ});function IJ(){var e="buttons",t=bJ,n=NM,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:EJ,labels:AJ,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function kJ(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=Yx(o):n&&(s=new Date(n,11,31)),{fromDate:i?uc(i):void 0,toDate:s?uc(s):void 0}}var HM=m.createContext(void 0);function NJ(e){var t,n=e.initialProps,r=IJ(),o=kJ(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;(Cg(n)||Ud(n)||qd(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(HM.Provider,{value:u,children:e.children})}function At(){var e=m.useContext(HM);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function WM(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 LJ(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 UM(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:LJ;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 FJ(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 h=[];if(pJ(r,o))for(var p=rr(r),g=r.getMonth();g<=o.getMonth();g++)h.push(rb(p,g));else for(var p=rr(new Date),g=0;g<=11;g++)h.push(rb(p,g));var b=function(x){var _=Number(x.target.value),w=rb(rr(e.displayMonth),_);e.onChange(w)},y=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:UM;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:h.map(function(x){return me.jsx("option",{value:x.getMonth(),children:a(x,{locale:s})},x.getMonth())})})}function zJ(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,h=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(iR(IM(new Date),y));var x=function(w){var C=iR(rr(n),Number(w.target.value));e.onChange(C)},_=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:UM;return me.jsx(_,{name:"years","aria-label":h(),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 jJ(e,t){var n=m.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function VJ(e){var t=e.month,n=e.defaultMonth,r=e.today,o=t||n||r||new Date,i=e.toDate,s=e.fromDate,a=e.numberOfMonths,l=a===void 0?1:a;if(i&&td(i,o)<0){var u=-1*(l-1);o=so(i,u)}return s&&td(o,s)<0&&(o=s),rr(o)}function BJ(){var e=At(),t=VJ(e),n=jJ(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 HJ(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=rr(e),i=rr(so(o,r)),s=td(i,o),a=[],l=0;l<s;l++){var u=so(o,l);a.push(u)}return n&&(a=a.reverse()),a}function WJ(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=td(n,e);if(!(l<i))return so(a,s)}}function UJ(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=td(a,n);if(!(l<=0))return so(a,-s)}}var qM=m.createContext(void 0);function qJ(e){var t=At(),n=BJ(),r=n[0],o=n[1],i=HJ(r,t),s=WJ(r,t),a=UJ(r,t),l=function(h){return i.some(function(p){return Xx(h,p)})},u=function(h,p){l(h)||(p&&VM(h,p)?o(so(h,1+t.numberOfMonths*-1)):o(h))},d={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:u,previousMonth:a,nextMonth:s,isDateDisplayed:l};return me.jsx(qM.Provider,{value:d,children:e.children})}function Gd(){var e=m.useContext(qM);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function lR(e){var t,n=At(),r=n.classNames,o=n.styles,i=n.components,s=Gd().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:WM,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(FJ,{onChange:a,displayMonth:e.displayMonth}),me.jsx(zJ,{onChange:a,displayMonth:e.displayMonth})]})}function GJ(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 YJ(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 Op=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 KJ(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,h=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=h==null?void 0:h.IconRight)!==null&&t!==void 0?t:YJ,_=(n=h==null?void 0:h.IconLeft)!==null&&n!==void 0?n:GJ;return me.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&me.jsx(Op,{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(Op,{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 cR(e){var t=At().numberOfMonths,n=Gd(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(b){return Xx(e.displayMonth,b)}),l=a===0,u=a===s.length-1,d=t>1&&(l||!u),h=t>1&&(u||!l),p=function(){r&&i(r)},g=function(){o&&i(o)};return me.jsx(KJ,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:h,nextMonth:o,previousMonth:r,onPreviousClick:p,onNextClick:g})}function XJ(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:WM,u;return o?u=me.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?u=me.jsx(lR,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?u=me.jsxs(me.Fragment,{children:[me.jsx(lR,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),me.jsx(cR,{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(cR,{displayMonth:e.displayMonth,id:e.id})]}),me.jsx("div",{className:r.caption,style:i.caption,children:u})}function QJ(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 ZJ(e,t,n){for(var r=n?Pa(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 JJ(){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=ZJ(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,h){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})},h)})]})}function eee(){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:JJ;return me.jsx("thead",{style:r.head,className:n.head,children:me.jsx(i,{})})}function tee(e){var t=At(),n=t.locale,r=t.formatters.formatDay;return me.jsx(me.Fragment,{children:r(e.date,{locale:n})})}var Qx=m.createContext(void 0);function nee(e){if(!Ud(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return me.jsx(Qx.Provider,{value:t,children:e.children})}return me.jsx(ree,{initialProps:e.initialProps,children:e.children})}function ree(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,s=function(u,d,h){var p,g;(p=t.onDayClick)===null||p===void 0||p.call(t,u,d,h);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?BM([],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,h)}}},a={disabled:[]};r&&a.disabled.push(function(u){var d=i&&r.length>i-1,h=r.some(function(p){return tr(p,u)});return!!(d&&!h)});var l={selected:r,onDayClick:s,modifiers:a};return me.jsx(Qx.Provider,{value:l,children:n})}function Zx(){var e=m.useContext(Qx);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function oee(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?tr(o,e)&&tr(r,e)?void 0:tr(o,e)?{from:o,to:void 0}:tr(r,e)?void 0:q0(r,e)?{from:e,to:o}:{from:r,to:e}:o?q0(e,o)?{from:o,to:e}:{from:e,to:o}:r?VM(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var Jx=m.createContext(void 0);function iee(e){if(!qd(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return me.jsx(Jx.Provider,{value:t,children:e.children})}return me.jsx(see,{initialProps:e.initialProps,children:e.children})}function see(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=oee(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:nb(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:nb(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 h=Eo(s,i)+1,p=l-h;d.disabled.push({before:nb(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(Jx.Provider,{value:{selected:r,onDayClick:u,modifiers:d},children:n})}function ew(){var e=m.useContext(Jx);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Vh(e){return Array.isArray(e)?BM([],e,!0):e!==void 0?[e]:[]}function aee(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=Vh(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 lee=ao.Selected,ei=ao.Disabled,cee=ao.Hidden,uee=ao.Today,ob=ao.RangeEnd,ib=ao.RangeMiddle,sb=ao.RangeStart,dee=ao.Outside;function fee(e,t,n){var r,o=(r={},r[lee]=Vh(e.selected),r[ei]=Vh(e.disabled),r[cee]=Vh(e.hidden),r[uee]=[e.today],r[ob]=[],r[ib]=[],r[sb]=[],r[dee]=[],r);return e.fromDate&&o[ei].push({before:e.fromDate}),e.toDate&&o[ei].push({after:e.toDate}),Ud(e)?o[ei]=o[ei].concat(t.modifiers[ei]):qd(e)&&(o[ei]=o[ei].concat(n.modifiers[ei]),o[sb]=n.modifiers[sb],o[ib]=n.modifiers[ib],o[ob]=n.modifiers[ob]),o}var GM=m.createContext(void 0);function hee(e){var t=At(),n=Zx(),r=ew(),o=fee(t,n,r),i=aee(t.modifiers),s=je(je({},o),i);return me.jsx(GM.Provider,{value:s,children:e.children})}function YM(){var e=m.useContext(GM);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function pee(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function gee(e){return!!(e&&typeof e=="object"&&"from"in e)}function mee(e){return!!(e&&typeof e=="object"&&"after"in e)}function vee(e){return!!(e&&typeof e=="object"&&"before"in e)}function bee(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function yee(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 xee(e){return Gx(e)}function wee(e){return Array.isArray(e)&&e.every(Gx)}function _ee(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(xee(n))return tr(e,n);if(wee(n))return n.includes(e);if(gee(n))return yee(e,n);if(bee(n))return n.dayOfWeek.includes(e.getDay());if(pee(n)){var r=Eo(n.before,e),o=Eo(n.after,e),i=r>0,s=o<0,a=q0(n.before,n.after);return a?s&&i:i||s}return mee(n)?Eo(e,n.after)>0:vee(n)?Eo(n.before,e)>0:typeof n=="function"?n(e):!1})}function tw(e,t,n){var r=Object.keys(t).reduce(function(i,s){var a=t[s];return _ee(e,a)&&i.push(s),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!Xx(e,n)&&(o.outside=!0),o}function See(e,t){for(var n=rr(e[0]),r=Yx(e[e.length-1]),o,i,s=n;s<=r;){var a=tw(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 Cee=365;function KM(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,h=o.locale,p={day:Bn,week:U0,month:so,year:uZ,startOfWeek:function(x){return o.ISOWeek?Pa(x):To(x,{locale:h,weekStartsOn:l})},endOfWeek:function(x){return o.ISOWeek?kM(x):Kx(x,{locale:h,weekStartsOn:l})}},g=p[n](e,r==="after"?1:-1);r==="before"&&u?g=dZ([u,g]):r==="after"&&d&&(g=fZ([d,g]));var b=!0;if(i){var y=tw(g,i);b=!y.disabled&&!y.hidden}return b?g:a.count>Cee?a.lastFocused:KM(g,{moveBy:n,direction:r,context:o,modifiers:i,retry:je(je({},a),{count:a.count+1})})}var XM=m.createContext(void 0);function Eee(e){var t=Gd(),n=YM(),r=m.useState(),o=r[0],i=r[1],s=m.useState(),a=s[0],l=s[1],u=See(t.displayMonths,n),d=o??(a&&t.isDateDisplayed(a))?a:u,h=function(){l(o),i(void 0)},p=function(x){i(x)},g=At(),b=function(x,_){if(o){var w=KM(o,{moveBy:x,direction:_,context:g,modifiers:n});tr(o,w)||(t.goToDate(w,o),p(w))}},y={focusedDay:o,focusTarget:d,blur:h,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(XM.Provider,{value:y,children:e.children})}function nw(){var e=m.useContext(XM);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function Ree(e,t){var n=YM(),r=tw(e,n,t);return r}var rw=m.createContext(void 0);function $ee(e){if(!Cg(e.initialProps)){var t={selected:void 0};return me.jsx(rw.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=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(rw.Provider,{value:o,children:n})}function QM(){var e=m.useContext(rw);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function Oee(e,t){var n=At(),r=QM(),o=Zx(),i=ew(),s=nw(),a=s.focusDayAfter,l=s.focusDayBefore,u=s.focusWeekAfter,d=s.focusWeekBefore,h=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;Cg(n)?(Q=r.onDayClick)===null||Q===void 0||Q.call(r,e,t,Y):Ud(n)?(ae=o.onDayClick)===null||ae===void 0||ae.call(o,e,t,Y):qd(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;h(),(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 Mee(){var e=At(),t=QM(),n=Zx(),r=ew(),o=Cg(e)?t.selected:Ud(e)?n.selected:qd(e)?r.selected:void 0;return o}function Dee(e){return Object.values(ao).includes(e)}function Tee(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(Dee(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function Aee(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 Iee(e,t,n){var r,o,i,s=At(),a=nw(),l=Ree(e,t),u=Oee(e,l),d=Mee(),h=!!(s.onDayClick||s.mode!=="default");m.useEffect(function(){var T;l.outside||a.focusedDay&&h&&tr(a.focusedDay,e)&&((T=n.current)===null||T===void 0||T.focus())},[a.focusedDay,e,n,h,l.outside]);var p=Tee(s,l).join(" "),g=Aee(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:tee,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:h,isHidden:b,activeModifiers:l,selectedDays:d,buttonProps:R,divProps:_};return E}function kee(e){var t=m.useRef(null),n=Iee(e.date,e.displayMonth,t);return n.isHidden?me.jsx("div",{role:"gridcell"}):n.isButton?me.jsx(Op,je({name:"day",ref:t},n.buttonProps)):me.jsx("div",je({},n.divProps))}function Nee(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 h=l(Number(t),{locale:a}),p=function(g){o(t,n,g)};return me.jsx(Op,{name:"week-number","aria-label":h,className:s.weeknumber,style:i.weeknumber,onClick:p,children:d})}function Lee(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:kee,u=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:Nee,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(h){return me.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:me.jsx(l,{displayMonth:e.displayMonth,date:h})},dJ(h))})]})}function uR(e,t,n){for(var r=n!=null&&n.ISOWeek?kM(t):Kx(t,n),o=n!=null&&n.ISOWeek?Pa(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 h=n!=null&&n.ISOWeek?LM(d):zM(d,n),p=u.find(function(g){return g.weekNumber===h});return p?(p.dates.push(d),u):(u.push({weekNumber:h,dates:[d]}),u)},[]);return l}function Fee(e,t){var n=uR(rr(e),Yx(e),t);if(t!=null&&t.useFixedWeeks){var r=hJ(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=U0(i,6-r),a=uR(U0(i,1),s,t);n.push.apply(n,a)}}return n}function zee(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,h=o.weekStartsOn,p=o.firstWeekContainsDate,g=o.ISOWeek,b=Fee(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:g,locale:i,weekStartsOn:h,firstWeekContainsDate:p}),y=(t=d==null?void 0:d.Head)!==null&&t!==void 0?t:eee,x=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:Lee,_=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:QJ;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 jee(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Vee=jee()?m.useLayoutEffect:m.useEffect,ab=!1,Bee=0;function dR(){return"react-day-picker-".concat(++Bee)}function Hee(e){var t,n=e??(ab?dR():null),r=m.useState(n),o=r[0],i=r[1];return Vee(function(){o===null&&i(dR())},[]),m.useEffect(function(){ab===!1&&(ab=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function Wee(e){var t,n,r=At(),o=r.dir,i=r.classNames,s=r.styles,a=r.components,l=Gd().displayMonths,u=Hee(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,h=[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&&(h.push(i.caption_start),p=je(je({},p),s.caption_start)),b&&(h.push(i.caption_end),p=je(je({},p),s.caption_end)),y&&(h.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:XJ;return me.jsxs("div",{className:h.join(" "),style:p,children:[me.jsx(x,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),me.jsx(zee,{id:d,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function Uee(e){var t=At(),n=t.classNames,r=t.styles;return me.jsx("div",{className:n.months,style:r.months,children:e.children})}function qee(e){var t,n,r=e.initialProps,o=At(),i=nw(),s=Gd(),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 h=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:Uee;return me.jsx("div",je({className:d.join(" "),style:h,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(Wee,{displayIndex:y,displayMonth:b},y)})})}))}function Gee(e){var t=e.children,n=gJ(e,["children"]);return me.jsx(NJ,{initialProps:n,children:me.jsx(qJ,{children:me.jsx($ee,{initialProps:n,children:me.jsx(nee,{initialProps:n,children:me.jsx(iee,{initialProps:n,children:me.jsx(hee,{children:me.jsx(Eee,{children:t})})})})})})})}function Yee(e){return me.jsx(Gee,je({},e,{children:me.jsx(qee,{initialProps:e})}))}function ZM({className:e,classNames:t,showOutsideDays:n=!0,...r}){return k.jsx(Yee,{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(W0({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(W0({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(KY,{...o,className:"h-4 w-4"}),IconRight:({...o})=>k.jsx(U2,{...o,className:"h-4 w-4"})},...r})}ZM.displayName="Calendar";let lb=0;function Eg(){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:fR()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:fR()),lb++,()=>{lb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),lb--}},[])}function fR(){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 cb="focusScope.autoFocusOnMount",ub="focusScope.autoFocusOnUnmount",hR={bubbles:!1,cancelable:!0},Rg=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),h=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)?h.current=R:zi(h.current,{select:!0})},x=function(C){if(g.paused||!a)return;const R=C.relatedTarget;R!==null&&(a.contains(R)||zi(h.current,{select:!0}))},_=function(C){if(document.activeElement===document.body)for(const E of C)E.removedNodes.length>0&&zi(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){gR.add(g);const y=document.activeElement;if(!a.contains(y)){const _=new CustomEvent(cb,hR);a.addEventListener(cb,u),a.dispatchEvent(_),_.defaultPrevented||(Kee(ete(JM(a)),{select:!0}),document.activeElement===y&&zi(a))}return()=>{a.removeEventListener(cb,u),setTimeout(()=>{const _=new CustomEvent(ub,hR);a.addEventListener(ub,d),a.dispatchEvent(_),_.defaultPrevented||zi(y??document.body,{select:!0}),a.removeEventListener(ub,d),gR.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]=Xee(w);C&&R?!y.shiftKey&&_===R?(y.preventDefault(),n&&zi(C,{select:!0})):y.shiftKey&&_===C&&(y.preventDefault(),n&&zi(R,{select:!0})):_===w&&y.preventDefault()}},[n,r,g.paused]);return m.createElement(ke.div,ne({tabIndex:-1},s,{ref:p,onKeyDown:b}))});function Kee(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zi(r,{select:t}),document.activeElement!==n)return}function Xee(e){const t=JM(e),n=pR(t,e),r=pR(t.reverse(),e);return[n,r]}function JM(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 pR(e,t){for(const n of e)if(!Qee(n,{upTo:t}))return n}function Qee(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 Zee(e){return e instanceof HTMLInputElement&&"select"in e}function zi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Zee(e)&&t&&e.select()}}const gR=Jee();function Jee(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=mR(e,t),e.unshift(t)},remove(t){var n;e=mR(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function mR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ete(e){return e.filter(t=>t.tagName!=="A")}var tte=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},fl=new WeakMap,wh=new WeakMap,_h={},db=0,eD=function(e){return e&&(e.host||eD(e.parentNode))},nte=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=eD(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})},rte=function(e,t,n,r){var o=nte(t,Array.isArray(e)?e:[e]);_h[n]||(_h[n]=new WeakMap);var i=_h[n],s=[],a=new Set,l=new Set(o),u=function(h){!h||a.has(h)||(a.add(h),u(h.parentNode))};o.forEach(u);var d=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(p){if(a.has(p))d(p);else{var g=p.getAttribute(r),b=g!==null&&g!=="false",y=(fl.get(p)||0)+1,x=(i.get(p)||0)+1;fl.set(p,y),i.set(p,x),s.push(p),y===1&&b&&wh.set(p,!0),x===1&&p.setAttribute(n,"true"),b||p.setAttribute(r,"true")}})};return d(t),a.clear(),db++,function(){s.forEach(function(h){var p=fl.get(h)-1,g=i.get(h)-1;fl.set(h,p),i.set(h,g),p||(wh.has(h)||h.removeAttribute(r),wh.delete(h)),g||h.removeAttribute(n)}),db--,db||(fl=new WeakMap,fl=new WeakMap,wh=new WeakMap,_h={})}},$g=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||tte(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),rte(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 tD(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 ote(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 Bh="right-scroll-bar-position",Hh="width-before-scroll-bar",ite="with-scroll-bars-hidden",ste="--removed-body-scroll-bar-size";function ate(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function lte(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 cte(e,t){return lte(t||null,function(n){return e.forEach(function(r){return ate(r,n)})})}function ute(e){return e}function dte(e,t){t===void 0&&(t=ute);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 fte(e){e===void 0&&(e={});var t=dte(null);return t.options=Co({async:!0,ssr:!1},e),t}var nD=function(e){var t=e.sideCar,n=tD(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))};nD.isSideCarExport=!0;function hte(e,t){return e.useMedium(t),nD}var rD=fte(),fb=function(){},Pg=ie.forwardRef(function(e,t){var n=ie.useRef(null),r=ie.useState({onScrollCapture:fb,onWheelCapture:fb,onTouchMoveCapture:fb}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,h=e.shards,p=e.sideCar,g=e.noIsolation,b=e.inert,y=e.allowPinchZoom,x=e.as,_=x===void 0?"div":x,w=tD(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),C=p,R=cte([n,t]),E=Co(Co({},w),o);return ie.createElement(ie.Fragment,null,d&&ie.createElement(C,{sideCar:rD,removeScrollBar:u,shards:h,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))});Pg.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Pg.classNames={fullWidth:Hh,zeroRight:Bh};var vR,pte=function(){if(vR)return vR;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function gte(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=pte();return t&&e.setAttribute("nonce",t),e}function mte(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function vte(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var bte=function(){var e=0,t=null;return{add:function(n){e==0&&(t=gte())&&(mte(t,n),vte(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},yte=function(){var e=bte();return function(t,n){ie.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},oD=function(){var e=yte(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},xte={left:0,top:0,right:0,gap:0},hb=function(e){return parseInt(e||"",10)||0},wte=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[hb(n),hb(r),hb(o)]},_te=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return xte;var t=wte(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])}},Ste=oD(),Cte=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(ite,` {
|
|
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(Bh,` {
|
|
329
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.`).concat(Hh,` {
|
|
333
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.`).concat(Bh," .").concat(Bh,` {
|
|
337
|
+
right: 0 `).concat(r,`;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.`).concat(Hh," .").concat(Hh,` {
|
|
341
|
+
margin-right: 0 `).concat(r,`;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
body {
|
|
345
|
+
`).concat(ste,": ").concat(a,`px;
|
|
346
|
+
}
|
|
347
|
+
`)},Ete=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=ie.useMemo(function(){return _te(o)},[o]);return ie.createElement(Ste,{styles:Cte(i,!t,o,n?"":"!important")})},Y0=!1;if(typeof window<"u")try{var Sh=Object.defineProperty({},"passive",{get:function(){return Y0=!0,!0}});window.addEventListener("test",Sh,Sh),window.removeEventListener("test",Sh,Sh)}catch{Y0=!1}var hl=Y0?{passive:!1}:!1,Rte=function(e){return e.tagName==="TEXTAREA"},iD=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Rte(e)&&n[t]==="visible")},$te=function(e){return iD(e,"overflowY")},Pte=function(e){return iD(e,"overflowX")},bR=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=sD(e,n);if(r){var o=aD(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Ote=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Mte=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},sD=function(e,t){return e==="v"?$te(t):Pte(t)},aD=function(e,t){return e==="v"?Ote(t):Mte(t)},Dte=function(e,t){return e==="h"&&t==="rtl"?-1:1},Tte=function(e,t,n,r,o){var i=Dte(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),u=!1,d=s>0,h=0,p=0;do{var g=aD(e,a),b=g[0],y=g[1],x=g[2],_=y-x-i*b;(b||_)&&sD(e,a)&&(h+=_,p+=b),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(o&&h===0||!o&&s>h)||!d&&(o&&p===0||!o&&-s>p))&&(u=!0),u},Ch=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},yR=function(e){return[e.deltaX,e.deltaY]},xR=function(e){return e&&"current"in e?e.current:e},Ate=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ite=function(e){return`
|
|
348
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
349
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
350
|
+
`)},kte=0,pl=[];function Nte(e){var t=ie.useRef([]),n=ie.useRef([0,0]),r=ie.useRef(),o=ie.useState(kte++)[0],i=ie.useState(function(){return oD()})[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=ote([e.lockRef.current],(e.shards||[]).map(xR),!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 _=Ch(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=bR(O,T);if(!D)return!0;if(D?E=O:(E=O==="v"?"h":"v",D=bR(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 Tte(I,x,y,I==="h"?C:R,!0)},[]),l=ie.useCallback(function(y){var x=y;if(!(!pl.length||pl[pl.length-1]!==i)){var _="deltaY"in x?yR(x):Ch(x),w=t.current.filter(function(E){return E.name===x.type&&E.target===x.target&&Ate(E.delta,_)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var C=(s.current.shards||[]).map(xR).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=Ch(y),r.current=void 0},[]),h=ie.useCallback(function(y){u(y.type,yR(y),y.target,a(y,e.lockRef.current))},[]),p=ie.useCallback(function(y){u(y.type,Ch(y),y.target,a(y,e.lockRef.current))},[]);ie.useEffect(function(){return pl.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",l,hl),document.addEventListener("touchmove",l,hl),document.addEventListener("touchstart",d,hl),function(){pl=pl.filter(function(y){return y!==i}),document.removeEventListener("wheel",l,hl),document.removeEventListener("touchmove",l,hl),document.removeEventListener("touchstart",d,hl)}},[]);var g=e.removeScrollBar,b=e.inert;return ie.createElement(ie.Fragment,null,b?ie.createElement(i,{styles:Ite(o)}):null,g?ie.createElement(Ete,{gapMode:"margin"}):null)}const Lte=hte(rD,Nte);var lD=ie.forwardRef(function(e,t){return ie.createElement(Pg,Co({},e,{ref:t,sideCar:Lte}))});lD.classNames=Pg.classNames;const Og=lD,cD="Popover",[uD,Qae]=mn(cD,[Lo]),ow=Lo(),[Fte,xc]=uD(cD),zte=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=ow(t),l=m.useRef(null),[u,d]=m.useState(!1),[h=!1,p]=Nn({prop:r,defaultProp:o,onChange:i});return m.createElement(Nd,a,m.createElement(Fte,{scope:t,contentId:nr(),triggerRef:l,open:h,onOpenChange:p,onOpenToggle:m.useCallback(()=>p(g=>!g),[p]),hasCustomAnchor:u,onCustomAnchorAdd:m.useCallback(()=>d(!0),[]),onCustomAnchorRemove:m.useCallback(()=>d(!1),[]),modal:s},n))},jte="PopoverTrigger",Vte=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=xc(jte,n),i=ow(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":hD(o.open)},r,{ref:s,onClick:we(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:m.createElement(Ld,ne({asChild:!0},i),a)}),dD="PopoverPortal",[Bte,Hte]=uD(dD,{forceMount:void 0}),Wte=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=xc(dD,t);return m.createElement(Bte,{scope:t,forceMount:n},m.createElement(nn,{present:n||i.open},m.createElement(mg,{asChild:!0,container:o},r)))},nd="PopoverContent",Ute=m.forwardRef((e,t)=>{const n=Hte(nd,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=xc(nd,e.__scopePopover);return m.createElement(nn,{present:r||i.open},i.modal?m.createElement(qte,ne({},o,{ref:t})):m.createElement(Gte,ne({},o,{ref:t})))}),qte=m.forwardRef((e,t)=>{const n=xc(nd,e.__scopePopover),r=m.useRef(null),o=Xe(t,r),i=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return $g(s)},[]),m.createElement(Og,{as:pi,allowPinchZoom:!0},m.createElement(fD,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})})))}),Gte=m.forwardRef((e,t)=>{const n=xc(nd,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(fD,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()}}))}),fD=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...h}=e,p=xc(nd,n),g=ow(n);return Eg(),m.createElement(Rg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(vc,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1)},m.createElement(Fd,ne({"data-state":hD(p.open),role:"dialog",id:p.contentId},g,h,{ref:t,style:{...h.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 hD(e){return e?"open":"closed"}const Yte=zte,Kte=Vte,Xte=Wte,pD=Ute,iw=Yte,sw=Kte,Mg=ie.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>k.jsx(Xte,{children:k.jsx(pD,{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})}));Mg.displayName=pD.displayName;function Qte({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}=Oa(),d=Ee(C=>C.actions.addOrUpdateFilterValue),h=Ee(C=>C.actions.removeFilterValue),{data:p,isLoading:g,isFetching:b,isError:y,refetch:x}=So({queryKey:[e.sql],queryFn:()=>kp("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 _(){h(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:$p(e),name:e.column,operation:"between",values:C};d(R),r(!1)}return g?k.jsx("div",{children:k.jsx(gy,{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(iw,{open:n,onOpenChange:r,children:[k.jsx(sw,{asChild:!0,children:k.jsxs(ma,{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(W2,{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(Mg,{className:"w-auto p-0",align:"start",children:[k.jsx(ZM,{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(ma,{size:"sm",variant:"outline",onClick:w,children:"Apply"}),k.jsx(ma,{size:"sm",variant:"outline",onClick:_,children:"Clear"})]})]})]})}):null}const aw=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}));aw.displayName="Textarea";const K0="horizontal",Zte=["horizontal","vertical"],gD=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=K0,...o}=e,i=mD(r)?r:K0,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}))});gD.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!mD(r)?new Error(Jte(o,n)):null}};function Jte(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
|
|
351
|
+
- horizontal
|
|
352
|
+
- vertical
|
|
353
|
+
|
|
354
|
+
Defaulting to \`${K0}\`.`}function mD(e){return Zte.includes(e)}const vD=gD,lw=ie.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>k.jsx(vD,{ref:o,decorative:n,orientation:t,className:Se("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));lw.displayName=vD.displayName;function X0(e,[t,n]){return Math.min(n,Math.max(t,e))}function Dg(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 ene=[" ","Enter","ArrowUp","ArrowDown"],tne=[" ","Enter"],Tg="Select",[Ag,Ig,nne]=qp(Tg),[wc,Zae]=mn(Tg,[nne,Lo]),cw=Lo(),[rne,La]=wc(Tg),[one,ine]=wc(Tg),sne=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:u,name:d,autoComplete:h,disabled:p,required:g}=e,b=cw(t),[y,x]=m.useState(null),[_,w]=m.useState(null),[C,R]=m.useState(!1),E=Da(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(Nd,b,m.createElement(rne,{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(Ag.Provider,{scope:t},m.createElement(one,{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(_D,{key:ee,"aria-hidden":!0,required:g,tabIndex:-1,name:d,autoComplete:h,value:D,onChange:F=>I(F.target.value),disabled:p},D===void 0?m.createElement("option",{value:""}):null,Array.from(G)):null))},ane="SelectTrigger",lne=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=cw(n),s=La(ane,n),a=s.disabled||r,l=Xe(t,s.onTriggerChange),u=Ig(n),[d,h,p]=SD(b=>{const y=u().filter(w=>!w.disabled),x=y.find(w=>w.value===s.value),_=CD(y,b,x);_!==void 0&&s.onValueChange(_.value)}),g=()=>{a||(s.onOpenChange(!0),p())};return m.createElement(Ld,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":wD(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&&h(b.key),!(y&&b.key===" ")&&ene.includes(b.key)&&(g(),b.preventDefault())})})))}),cne="SelectValue",une=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=La(cne,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,h=Xe(t,l.onValueNodeChange);return kn(()=>{u(d)},[u,d]),m.createElement(ke.span,ne({},a,{ref:h,style:{pointerEvents:"none"}}),wD(l.value)?m.createElement(m.Fragment,null,s):i)}),dne=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.createElement(ke.span,ne({"aria-hidden":!0},o,{ref:t}),r||"▼")}),fne=e=>m.createElement(mg,ne({asChild:!0},e)),dc="SelectContent",hne=m.forwardRef((e,t)=>{const n=La(dc,e.__scopeSelect),[r,o]=m.useState();if(kn(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Ao.createPortal(m.createElement(bD,{scope:e.__scopeSelect},m.createElement(Ag.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),i):null}return m.createElement(pne,ne({},e,{ref:t}))}),oi=10,[bD,Fa]=wc(dc),pne=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:h,collisionBoundary:p,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:x,..._}=e,w=La(dc,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=Ig(n),[le,ee]=m.useState(!1),F=m.useRef(!1);m.useEffect(()=>{if(C)return $g(C)},[C]),Eg();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]=SD(de=>{const J=G().filter(be=>!be.disabled),X=J.find(be=>be.ref.current===document.activeElement),re=CD(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"?wR:gne,ve=ge===wR?{side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:p,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:x}:{};return m.createElement(bD,{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(Og,{as:pi,allowPinchZoom:!0},m.createElement(Rg,{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(vc,{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()}})}))))))}),gne=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=La(dc,n),s=Fa(dc,n),[a,l]=m.useState(null),[u,d]=m.useState(null),h=Xe(t,O=>d(O)),p=Ig(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=X0(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=X0(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(mne,{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:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),wR=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=oi,...i}=e,s=cw(n);return m.createElement(Fd,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)"}}))}),[mne,uw]=wc(dc,{}),_R="SelectViewport",vne=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Fa(_R,n),i=uw(_R,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(Ag.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:h}=i;if(h!=null&&h.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})}))))}),bne="SelectGroup",[yne,xne]=wc(bne),wne=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=nr();return m.createElement(yne,{scope:n,id:o},m.createElement(ke.div,ne({role:"group","aria-labelledby":o},r,{ref:t})))}),_ne="SelectLabel",Sne=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=xne(_ne,n);return m.createElement(ke.div,ne({id:o.id},r,{ref:t}))}),Q0="SelectItem",[Cne,yD]=wc(Q0),Ene=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=La(Q0,n),l=Fa(Q0,n),u=a.value===r,[d,h]=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(Cne,{scope:n,value:r,disabled:o,textId:y,isSelected:u,onItemTextChange:m.useCallback(_=>{h(w=>{var C;return w||((C=_==null?void 0:_.textContent)!==null&&C!==void 0?C:"").trim()})},[])},m.createElement(Ag.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===" "||(tne.includes(_.key)&&x(),_.key===" "&&_.preventDefault())})}))))}),Eh="SelectItemText",Rne=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=La(Eh,n),a=Fa(Eh,n),l=yD(Eh,n),u=ine(Eh,n),[d,h]=m.useState(null),p=Xe(t,_=>h(_),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)}),$ne="SelectItemIndicator",Pne=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return yD($ne,n).isSelected?m.createElement(ke.span,ne({"aria-hidden":!0},r,{ref:t})):null}),SR="SelectScrollUpButton",One=m.forwardRef((e,t)=>{const n=Fa(SR,e.__scopeSelect),r=uw(SR,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(xD,ne({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),CR="SelectScrollDownButton",Mne=m.forwardRef((e,t)=>{const n=Fa(CR,e.__scopeSelect),r=uw(CR,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(xD,ne({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),xD=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=Fa("SelectScrollButton",n),s=m.useRef(null),a=Ig(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(h=>h.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()})}))}),Dne=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(ke.div,ne({"aria-hidden":!0},r,{ref:t}))});function wD(e){return e===""||e===void 0}const _D=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=m.useRef(null),i=Xe(t,o),s=Dg(n);return m.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&d){const h=new Event("change",{bubbles:!0});d.call(a,n),a.dispatchEvent(h)}},[s,n]),m.createElement(L2,{asChild:!0},m.createElement("select",ne({},r,{ref:i,defaultValue:n})))});_D.displayName="BubbleSelect";function SD(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 CD(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=Tne(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 Tne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Ane=sne,ED=lne,Ine=une,kne=dne,Nne=fne,RD=hne,Lne=vne,Fne=wne,$D=Sne,PD=Ene,zne=Rne,jne=Pne,OD=One,MD=Mne,DD=Dne,TD=Ane,Vne=Fne,AD=Ine,dw=ie.forwardRef(({className:e,children:t,...n},r)=>k.jsxs(ED,{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(kne,{asChild:!0,children:k.jsx(yg,{className:"h-4 w-4 opacity-50"})})]}));dw.displayName=ED.displayName;const ID=ie.forwardRef(({className:e,...t},n)=>k.jsx(OD,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:k.jsx(XY,{className:"h-4 w-4"})}));ID.displayName=OD.displayName;const kD=ie.forwardRef(({className:e,...t},n)=>k.jsx(MD,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:k.jsx(yg,{className:"h-4 w-4"})}));kD.displayName=MD.displayName;const fw=ie.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>k.jsx(Nne,{children:k.jsxs(RD,{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(ID,{}),k.jsx(Lne,{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(kD,{})]})}));fw.displayName=RD.displayName;const ND=ie.forwardRef(({className:e,...t},n)=>k.jsx($D,{ref:n,className:Se("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));ND.displayName=$D.displayName;const Du=ie.forwardRef(({className:e,children:t,...n},r)=>k.jsxs(PD,{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(jne,{children:k.jsx(zd,{className:"h-4 w-4"})})}),k.jsx(zne,{children:t})]}));Du.displayName=PD.displayName;const LD=ie.forwardRef(({className:e,...t},n)=>k.jsx(DD,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));LD.displayName=DD.displayName;function Bne({filter:e}){const[t,n]=m.useState(e.sql),[r,o]=m.useState(!1),{updateFilter:i}=Ma();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(iw,{open:r,onOpenChange:o,children:[k.jsx(sw,{children:k.jsx(G2,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),k.jsxs(Mg,{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(lw,{}),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(Hne,{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(aw,{value:t,onChange:l=>n(l.target.value),className:`min-w-full grow resize font-mono text-xs ${qL}`})]}),k.jsx("div",{className:"flex justify-end gap-2",children:k.jsxs(ma,{onClick:s,size:"sm",variant:"outline",children:[k.jsx(zd,{className:"mr-2 size-4"}),"Apply"]})})]})]})}function Hne({value:e,updateFilterOperation:t}){return k.jsxs(TD,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[k.jsx(dw,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:k.jsx(AD,{placeholder:"Operation"})}),k.jsxs(fw,{children:[k.jsx(Du,{value:"=",children:"Equals"}),k.jsx(Du,{value:"in",children:"Contains"}),k.jsx(Du,{value:"like",children:"Like"})]})]})}function Wne(){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=>Hd.includes(s.dataType)?k.jsx(Qte,{filter:s}):k.jsx(oZ,{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(_a,{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(Bne,{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(ZY,{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 Une(){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(_P,{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(Wne,{}),e==null?void 0:e.map(o=>k.jsx(xy,{className:"mt-0",value:o.id,children:k.jsx(wX,{})},o.id))]}):null}function qne({children:e}){return k.jsx(s8,{defaultTheme:"system",storageKey:"vite-ui-theme",children:k.jsx(UY,{delayDuration:0,children:e})})}const Z0=["Enter"," "],Gne=["ArrowDown","PageUp","Home"],FD=["ArrowUp","PageDown","End"],Yne=[...Gne,...FD],Kne={ltr:[...Z0,"ArrowRight"],rtl:[...Z0,"ArrowLeft"]},Xne={ltr:["ArrowLeft"],rtl:["ArrowRight"]},kg="Menu",[rd,Qne,Zne]=qp(kg),[za,zD]=mn(kg,[Zne,Lo,mc]),hw=Lo(),jD=mc(),[Jne,ja]=za(kg),[ere,Yd]=za(kg),tre=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=hw(t),[l,u]=m.useState(null),d=m.useRef(!1),h=cn(i),p=Da(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(Nd,a,m.createElement(Jne,{scope:t,open:n,onOpenChange:h,content:l,onContentChange:u},m.createElement(ere,{scope:t,onClose:m.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:p,modal:s},r)))},VD=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=hw(n);return m.createElement(Ld,ne({},o,r,{ref:t}))}),BD="MenuPortal",[nre,HD]=za(BD,{forceMount:void 0}),rre=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=ja(BD,t);return m.createElement(nre,{scope:t,forceMount:n},m.createElement(nn,{present:n||i.open},m.createElement(mg,{asChild:!0,container:o},r)))},io="MenuContent",[ore,pw]=za(io),ire=m.forwardRef((e,t)=>{const n=HD(io,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=ja(io,e.__scopeMenu),s=Yd(io,e.__scopeMenu);return m.createElement(rd.Provider,{scope:e.__scopeMenu},m.createElement(nn,{present:r||i.open},m.createElement(rd.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(sre,ne({},o,{ref:t})):m.createElement(are,ne({},o,{ref:t})))))}),sre=m.forwardRef((e,t)=>{const n=ja(io,e.__scopeMenu),r=m.useRef(null),o=Xe(t,r);return m.useEffect(()=>{const i=r.current;if(i)return $g(i)},[]),m.createElement(gw,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)}))}),are=m.forwardRef((e,t)=>{const n=ja(io,e.__scopeMenu);return m.createElement(gw,ne({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),gw=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:h,onInteractOutside:p,onDismiss:g,disableOutsideScroll:b,...y}=e,x=ja(io,n),_=Yd(io,n),w=hw(n),C=jD(n),R=Qne(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?Og: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=Rre(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),[]),Eg();const Q=m.useCallback(ae=>{var j,B;return le.current===((j=G.current)===null||j===void 0?void 0:j.side)&&Pre(ae,(B=G.current)===null||B===void 0?void 0:B.area)},[]);return m.createElement(ore,{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(Rg,{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(vc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,onDismiss:g},m.createElement(vy,ne({asChild:!0},C,{dir:_.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:T,onEntryFocus:we(l,ae=>{_.isUsingKeyboardRef.current||ae.preventDefault()})}),m.createElement(Fd,ne({role:"menu","aria-orientation":"vertical","data-state":YD(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||!Yne.includes(ae.key))return;ae.preventDefault();const ve=R().filter(de=>!de.disabled).map(de=>de.ref.current);FD.includes(ae.key)&&ve.reverse(),Cre(ve)}),onBlur:we(e.onBlur,ae=>{ae.currentTarget.contains(ae.target)||(window.clearTimeout(I.current),N.current="")}),onPointerMove:we(e.onPointerMove,od(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}}))})))))))}),lre=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(ke.div,ne({role:"group"},r,{ref:t}))}),cre=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(ke.div,ne({},r,{ref:t}))}),J0="MenuItem",ER="menu.itemSelect",mw=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),s=Yd(J0,e.__scopeMenu),a=pw(J0,e.__scopeMenu),l=Xe(t,i),u=m.useRef(!1),d=()=>{const h=i.current;if(!n&&h){const p=new CustomEvent(ER,{bubbles:!0,cancelable:!0});h.addEventListener(ER,g=>r==null?void 0:r(g),{once:!0}),fP(h,p),p.defaultPrevented?u.current=!1:s.onClose()}};return m.createElement(WD,ne({},o,{ref:l,disabled:n,onClick:we(e.onClick,d),onPointerDown:h=>{var p;(p=e.onPointerDown)===null||p===void 0||p.call(e,h),u.current=!0},onPointerUp:we(e.onPointerUp,h=>{var p;u.current||(p=h.currentTarget)===null||p===void 0||p.click()}),onKeyDown:we(e.onKeyDown,h=>{const p=a.searchRef.current!=="";n||p&&h.key===" "||Z0.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})}))}),WD=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=pw(J0,n),a=jD(n),l=m.useRef(null),u=Xe(t,l),[d,h]=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(rd.ItemSlot,{scope:n,disabled:r,textValue:o??p},m.createElement(by,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,od(b=>{r?s.onItemLeave(b):(s.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:we(e.onPointerLeave,od(b=>s.onItemLeave(b))),onFocus:we(e.onFocus,()=>h(!0)),onBlur:we(e.onBlur,()=>h(!1))}))))}),ure=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.createElement(qD,{scope:e.__scopeMenu,checked:n},m.createElement(mw,ne({role:"menuitemcheckbox","aria-checked":Mp(n)?"mixed":n},o,{ref:t,"data-state":vw(n),onSelect:we(o.onSelect,()=>r==null?void 0:r(Mp(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),dre="MenuRadioGroup",[fre,hre]=za(dre,{value:void 0,onValueChange:()=>{}}),pre=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=cn(r);return m.createElement(fre,{scope:e.__scopeMenu,value:n,onValueChange:i},m.createElement(lre,ne({},o,{ref:t})))}),gre="MenuRadioItem",mre=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=hre(gre,e.__scopeMenu),i=n===o.value;return m.createElement(qD,{scope:e.__scopeMenu,checked:i},m.createElement(mw,ne({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":vw(i),onSelect:we(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),UD="MenuItemIndicator",[qD,vre]=za(UD,{checked:!1}),bre=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=vre(UD,n);return m.createElement(nn,{present:r||Mp(i.checked)||i.checked===!0},m.createElement(ke.span,ne({},o,{ref:t,"data-state":vw(i.checked)})))}),yre=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(ke.div,ne({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),xre="MenuSub",[Jae,GD]=za(xre),Rh="MenuSubTrigger",wre=m.forwardRef((e,t)=>{const n=ja(Rh,e.__scopeMenu),r=Yd(Rh,e.__scopeMenu),o=GD(Rh,e.__scopeMenu),i=pw(Rh,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 h=a.current;return()=>{window.clearTimeout(h),l(null)}},[a,l]),m.createElement(VD,ne({asChild:!0},u),m.createElement(WD,ne({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":YD(n.open)},e,{ref:Up(t,o.onTriggerChange),onClick:h=>{var p;(p=e.onClick)===null||p===void 0||p.call(e,h),!(e.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:we(e.onPointerMove,od(h=>{i.onItemEnter(h),!h.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:we(e.onPointerLeave,od(h=>{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:h.clientX+_,y:h.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(h),h.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:we(e.onKeyDown,h=>{const p=i.searchRef.current!=="";if(!(e.disabled||p&&h.key===" ")&&Kne[r.dir].includes(h.key)){var g;n.onOpenChange(!0),(g=n.content)===null||g===void 0||g.focus(),h.preventDefault()}})})))}),_re="MenuSubContent",Sre=m.forwardRef((e,t)=>{const n=HD(io,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=ja(io,e.__scopeMenu),s=Yd(io,e.__scopeMenu),a=GD(_re,e.__scopeMenu),l=m.useRef(null),u=Xe(t,l);return m.createElement(rd.Provider,{scope:e.__scopeMenu},m.createElement(nn,{present:r||i.open},m.createElement(rd.Slot,{scope:e.__scopeMenu},m.createElement(gw,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 h;s.isUsingKeyboardRef.current&&((h=l.current)===null||h===void 0||h.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 h=d.currentTarget.contains(d.target),p=Xne[s.dir].includes(d.key);if(h&&p){var g;i.onOpenChange(!1),(g=a.trigger)===null||g===void 0||g.focus(),d.preventDefault()}})})))))});function YD(e){return e?"open":"closed"}function Mp(e){return e==="indeterminate"}function vw(e){return Mp(e)?"indeterminate":e?"checked":"unchecked"}function Cre(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ere(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Rre(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=Ere(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 $re(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 Pre(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return $re(n,t)}function od(e){return t=>t.pointerType==="mouse"?e(t):void 0}const Ore=tre,Mre=VD,Dre=rre,Tre=ire,Are=cre,Ire=mw,kre=ure,Nre=pre,Lre=mre,Fre=bre,zre=yre,jre=wre,Vre=Sre,KD="DropdownMenu",[Bre,ele]=mn(KD,[zD]),$r=zD(),[Hre,XD]=Bre(KD),Wre=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,h]=Nn({prop:o,defaultProp:i,onChange:s});return m.createElement(Hre,{scope:t,triggerId:nr(),triggerRef:u,contentId:nr(),open:d,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),modal:a},m.createElement(Ore,ne({},l,{open:d,onOpenChange:h,dir:r,modal:a}),n))},Ure="DropdownMenuTrigger",qre=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=XD(Ure,n),s=$r(n);return m.createElement(Mre,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:Up(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())})})))}),Gre=e=>{const{__scopeDropdownMenu:t,...n}=e,r=$r(t);return m.createElement(Dre,ne({},r,n))},Yre="DropdownMenuContent",Kre=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=XD(Yre,n),i=$r(n),s=m.useRef(!1);return m.createElement(Tre,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)"}}))}),Xre=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(Are,ne({},o,r,{ref:t}))}),Qre=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(Ire,ne({},o,r,{ref:t}))}),Zre=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(kre,ne({},o,r,{ref:t}))}),Jre=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(Nre,ne({},o,r,{ref:t}))}),eoe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(Lre,ne({},o,r,{ref:t}))}),toe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(Fre,ne({},o,r,{ref:t}))}),noe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(zre,ne({},o,r,{ref:t}))}),roe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(jre,ne({},o,r,{ref:t}))}),ooe=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=$r(n);return m.createElement(Vre,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)"}}))}),ioe=Wre,soe=qre,aoe=Gre,QD=Kre,ZD=Xre,JD=Qre,eT=Zre,loe=Jre,tT=eoe,nT=toe,rT=noe,oT=roe,iT=ooe,coe=ioe,uoe=soe,doe=loe,foe=ie.forwardRef(({className:e,inset:t,children:n,...r},o)=>k.jsxs(oT,{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(U2,{className:"ml-auto h-4 w-4"})]}));foe.displayName=oT.displayName;const hoe=ie.forwardRef(({className:e,...t},n)=>k.jsx(iT,{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}));hoe.displayName=iT.displayName;const sT=ie.forwardRef(({className:e,sideOffset:t=4,...n},r)=>k.jsx(aoe,{children:k.jsx(QD,{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})}));sT.displayName=QD.displayName;const poe=ie.forwardRef(({className:e,inset:t,...n},r)=>k.jsx(JD,{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}));poe.displayName=JD.displayName;const goe=ie.forwardRef(({className:e,children:t,checked:n,...r},o)=>k.jsxs(eT,{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(nT,{children:k.jsx(zd,{className:"h-4 w-4"})})}),t]}));goe.displayName=eT.displayName;const aT=ie.forwardRef(({className:e,children:t,...n},r)=>k.jsxs(tT,{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(nT,{children:k.jsx(q2,{className:"h-2 w-2 fill-current"})})}),t]}));aT.displayName=tT.displayName;const lT=ie.forwardRef(({className:e,inset:t,...n},r)=>k.jsx(ZD,{ref:r,className:Se("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));lT.displayName=ZD.displayName;const cT=ie.forwardRef(({className:e,...t},n)=>k.jsx(rT,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));cT.displayName=rT.displayName;function moe(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=>uT(s))}})}})}}function uT(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:voe(e.customCfg),data:[]}}function voe(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 dT(e){return`semaphor:bookmark:${e}`}const fT="Dialog",[hT,tle]=mn(fT),[boe,lo]=hT(fT),yoe=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(boe,{scope:t,triggerRef:a,contentRef:l,contentId:nr(),titleId:nr(),descriptionId:nr(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(h=>!h),[d]),modal:s},n)},xoe="DialogTrigger",woe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=lo(xoe,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":bw(o.open)},r,{ref:i,onClick:we(e.onClick,o.onOpenToggle)}))}),pT="DialogPortal",[_oe,gT]=hT(pT,{forceMount:void 0}),Soe=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=lo(pT,t);return m.createElement(_oe,{scope:t,forceMount:n},m.Children.map(r,s=>m.createElement(nn,{present:n||i.open},m.createElement(mg,{asChild:!0,container:o},s))))},ey="DialogOverlay",Coe=m.forwardRef((e,t)=>{const n=gT(ey,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=lo(ey,e.__scopeDialog);return i.modal?m.createElement(nn,{present:r||i.open},m.createElement(Eoe,ne({},o,{ref:t}))):null}),Eoe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=lo(ey,n);return m.createElement(Og,{as:pi,allowPinchZoom:!0,shards:[o.contentRef]},m.createElement(ke.div,ne({"data-state":bw(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),id="DialogContent",Roe=m.forwardRef((e,t)=>{const n=gT(id,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=lo(id,e.__scopeDialog);return m.createElement(nn,{present:r||i.open},i.modal?m.createElement($oe,ne({},o,{ref:t})):m.createElement(Poe,ne({},o,{ref:t})))}),$oe=m.forwardRef((e,t)=>{const n=lo(id,e.__scopeDialog),r=m.useRef(null),o=Xe(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return $g(i)},[]),m.createElement(mT,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())}))}),Poe=m.forwardRef((e,t)=>{const n=lo(id,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(mT,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()}}))}),mT=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=lo(id,n),l=m.useRef(null),u=Xe(t,l);return Eg(),m.createElement(m.Fragment,null,m.createElement(Rg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(vc,ne({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":bw(a.open)},s,{ref:u,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),Ooe="DialogTitle",Moe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=lo(Ooe,n);return m.createElement(ke.h2,ne({id:o.titleId},r,{ref:t}))}),Doe="DialogDescription",Toe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=lo(Doe,n);return m.createElement(ke.p,ne({id:o.descriptionId},r,{ref:t}))}),Aoe="DialogClose",Ioe=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=lo(Aoe,n);return m.createElement(ke.button,ne({type:"button"},r,{ref:t,onClick:we(e.onClick,()=>o.onOpenChange(!1))}))});function bw(e){return e?"open":"closed"}const koe=yoe,Noe=woe,Loe=Soe,vT=Coe,bT=Roe,yT=Moe,xT=Toe,Foe=Ioe,zoe=koe,joe=Noe,Voe=Loe,wT=ie.forwardRef(({className:e,...t},n)=>k.jsx(vT,{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}));wT.displayName=vT.displayName;const _T=ie.forwardRef(({className:e,children:t,...n},r)=>k.jsxs(Voe,{children:[k.jsx(wT,{}),k.jsxs(bT,{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(Foe,{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(Y2,{className:"h-4 w-4"}),k.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));_T.displayName=bT.displayName;const ST=({className:e,...t})=>k.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ST.displayName="DialogHeader";const CT=({className:e,...t})=>k.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});CT.displayName="DialogFooter";const ET=ie.forwardRef(({className:e,...t},n)=>k.jsx(yT,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",e),...t}));ET.displayName=yT.displayName;const RT=ie.forwardRef(({className:e,...t},n)=>k.jsx(xT,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));RT.displayName=xT.displayName;const $T=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}));$T.displayName="Input";const PT="Checkbox",[Boe,nle]=mn(PT),[Hoe,Woe]=Boe(PT),Uoe=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:u,...d}=e,[h,p]=m.useState(null),g=Xe(t,C=>p(C)),b=m.useRef(!1),y=h?!!h.closest("form"):!0,[x=!1,_]=Nn({prop:o,defaultProp:i,onChange:u}),w=m.useRef(x);return m.useEffect(()=>{const C=h==null?void 0:h.form;if(C){const R=()=>_(w.current);return C.addEventListener("reset",R),()=>C.removeEventListener("reset",R)}},[h,_]),m.createElement(Hoe,{scope:n,state:x,disabled:a},m.createElement(ke.button,ne({type:"button",role:"checkbox","aria-checked":va(x)?"mixed":x,"aria-required":s,"data-state":OT(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=>va(R)?!0:!R),y&&(b.current=C.isPropagationStopped(),b.current||C.stopPropagation())})})),y&&m.createElement(Yoe,{control:h,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),qoe="CheckboxIndicator",Goe=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Woe(qoe,n);return m.createElement(nn,{present:r||va(i.state)||i.state===!0},m.createElement(ke.span,ne({"data-state":OT(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),Yoe=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Dg(n),a=gg(t);return m.useEffect(()=>{const l=i.current,u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"checked").set;if(s!==n&&h){const p=new Event("click",{bubbles:r});l.indeterminate=va(n),h.call(l,va(n)?!1:n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",ne({type:"checkbox","aria-hidden":!0,defaultChecked:va(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function va(e){return e==="indeterminate"}function OT(e){return va(e)?"indeterminate":e?"checked":"unchecked"}const MT=Uoe,Koe=Goe,DT=ie.forwardRef(({className:e,...t},n)=>k.jsx(MT,{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(Koe,{className:Se("flex items-center justify-center text-current"),children:k.jsx(zd,{className:"h-4 w-4"})})}));DT.displayName=MT.displayName;const TT=m.forwardRef(({className:e,...t},n)=>k.jsx("div",{role:"editor-panel",ref:n,className:Se("flex grow h-full",e),...t}));TT.displayName="EditorPanel";const AT=m.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se(" flex flex-col space-y-2 w-[270px]",e),...t}));AT.displayName="EditorAside";const IT=m.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se(" grow",e),...t}));IT.displayName="EditorMain";function Xoe(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const kT="ScrollArea",[NT,rle]=mn(kT),[Qoe,qr]=NT(kT),LT=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),[h,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=Da(o);return m.createElement(Qoe,{scope:n,type:r,dir:N,scrollHideDelay:i,scrollArea:a,viewport:u,onViewportChange:d,content:h,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}})))}),Zoe="ScrollAreaViewport",Joe=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=qr(Zoe,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",FT=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(eie,ne({},r,{ref:t,forceMount:n})):o.type==="scroll"?m.createElement(tie,ne({},r,{ref:t,forceMount:n})):o.type==="auto"?m.createElement(zT,ne({},r,{ref:t,forceMount:n})):o.type==="always"?m.createElement(yw,ne({},r,{ref:t})):null}),eie=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})))}),tie=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=qr(_i,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Lg(()=>l("SCROLL_END"),100),[a,l]=Xoe("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 h=u[d];const p=()=>{const g=u[d];h!==g&&(l("SCROLL"),s()),h=g};return u.addEventListener("scroll",p),()=>u.removeEventListener("scroll",p)}},[o.viewport,i,l,s]),m.createElement(nn,{present:n||a!=="hidden"},m.createElement(yw,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=Lg(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?u:d)}},10);return fc(n.viewport,l),fc(n.content,l),m.createElement(nn,{present:r||i},m.createElement(yw,ne({"data-state":i?"visible":"hidden"},o,{ref:t})))}),yw=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=HT(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 h(p,g){return cie(p,s.current,a,g)}return n==="horizontal"?m.createElement(nie,ne({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,g=RR(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=h(p,o.dir))}})):n==="vertical"?m.createElement(rie,ne({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,g=RR(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=h(p))}})):null}),nie=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(VT,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":Ng(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(i.viewport){const p=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(p),UT(p,h)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Dp(s.paddingLeft),paddingEnd:Dp(s.paddingRight)}})}}))}),rie=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(VT,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":Ng(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(i.viewport){const p=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(p),UT(p,h)&&d.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Dp(s.paddingTop),paddingEnd:Dp(s.paddingBottom)}})}}))}),[oie,jT]=NT(_i),VT=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:d,onResize:h,...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=Lg(h,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]),fc(b,O),fc(g.content,O),m.createElement(oie,{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})})))}),ty="ScrollAreaThumb",iie=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=jT(ty,e.__scopeScrollArea);return m.createElement(nn,{present:n||o.hasThumb},m.createElement(sie,ne({ref:t},r)))}),sie=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=qr(ty,n),s=jT(ty,n),{onThumbPositionChange:a}=s,l=Xe(t,h=>s.onThumbChange(h)),u=m.useRef(),d=Lg(()=>{u.current&&(u.current(),u.current=void 0)},100);return m.useEffect(()=>{const h=i.viewport;if(h){const p=()=>{if(d(),!u.current){const g=uie(h,a);u.current=g,a()}};return a(),h.addEventListener("scroll",p),()=>h.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,h=>{const g=h.target.getBoundingClientRect(),b=h.clientX-g.left,y=h.clientY-g.top;s.onThumbPointerDown({x:b,y})}),onPointerUp:we(e.onPointerUp,s.onThumbPointerUp)}))}),BT="ScrollAreaCorner",aie=m.forwardRef((e,t)=>{const n=qr(BT,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.createElement(lie,ne({},e,{ref:t})):null}),lie=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=qr(BT,n),[i,s]=m.useState(0),[a,l]=m.useState(0),u=!!(i&&a);return fc(o.scrollbarX,()=>{var d;const h=((d=o.scrollbarX)===null||d===void 0?void 0:d.offsetHeight)||0;o.onCornerHeightChange(h),l(h)}),fc(o.scrollbarY,()=>{var d;const h=((d=o.scrollbarY)===null||d===void 0?void 0:d.offsetWidth)||0;o.onCornerWidthChange(h),s(h)}),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 Dp(e){return e?parseInt(e,10):0}function HT(e,t){const n=e/t;return isNaN(n)?0:n}function Ng(e){const t=HT(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function cie(e,t,n,r="ltr"){const o=Ng(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,h=r==="ltr"?[0,d]:[d*-1,0];return WT([l,u],h)(e)}function RR(e,t,n="ltr"){const r=Ng(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=X0(e,l);return WT([0,s],[0,a])(u)}function WT(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 UT(e,t){return e>0&&e<t}const uie=(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 Lg(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 fc(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 qT=LT,die=Joe,fie=aie,GT=ie.forwardRef(({className:e,children:t,...n},r)=>k.jsxs(qT,{ref:r,className:Se("relative overflow-hidden",e),...n,children:[k.jsx(die,{className:"h-full w-full rounded-[inherit]",children:t}),k.jsx(xw,{}),k.jsx(fie,{})]}));GT.displayName=qT.displayName;const xw=ie.forwardRef(({className:e,orientation:t="vertical",...n},r)=>k.jsx(FT,{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(iie,{className:"relative flex-1 rounded-full bg-border"})}));xw.displayName=FT.displayName;const{createElement:hc,createContext:hie,createRef:ole,forwardRef:YT,useCallback:dr,useContext:KT,useEffect:ba,useImperativeHandle:XT,useLayoutEffect:pie,useMemo:gie,useRef:Br,useState:Tp}=ie,$R=ie.useId,Fg=hie(null);Fg.displayName="PanelGroupContext";const sd=pie,mie=typeof $R=="function"?$R:()=>null;let vie=0;function ww(e=null){const t=mie(),n=Br(e||t||null);return n.current===null&&(n.current=""+vie++),e??n.current}function QT({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:s,maxSize:a,minSize:l,onCollapse:u,onExpand:d,onResize:h,order:p,style:g,tagName:b="div",...y}){const x=KT(Fg);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=ww(s),V=Br({callbacks:{onCollapse:u,onExpand:d,onResize:h},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:N,idIsFromProps:s!==void 0,order:p});Br({didLogMissingDefaultSizeWarning:!1}),sd(()=>{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=h,ee.collapsedSize=n,ee.collapsible=r,ee.defaultSize=o,ee.maxSize=a,ee.minSize=l}),sd(()=>{const le=V.current;return O(le),()=>{I(le)}},[p,N,O,I]),XT(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 hc(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 ZT=YT((e,t)=>hc(QT,{...e,forwardedRef:t}));QT.displayName="Panel";ZT.displayName="forwardRef(Panel)";function et(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const JT=10;function ad(e,t,n=JT){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 ad(e,t,n)===0}function Sl({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(ad(n,a)<0)if(i){const l=(o+a)/2;ad(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(JT)),n}function vu({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,h=n[d];if(et(h),h.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;ad(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const d=e<0?s:a,h=n[d];et(h);const{collapsible:p}=h;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;ad(_,Math.abs(e))>0&&(e=e<0?0-_:_)}}}}{const d=e<0?1:-1;let h=e<0?a:s,p=0;for(;;){const b=t[h];et(b!=null);const x=Sl({panelConstraints:n,panelIndex:h,size:100})-b;if(p+=x,h+=d,h<0||h>=n.length)break}const g=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-g:g}{let h=e<0?s:a;for(;h>=0&&h<n.length;){const p=Math.abs(e)-Math.abs(l),g=t[h];et(g!=null);const b=g-p,y=Sl({panelConstraints:n,panelIndex:h,size:b});if(!gr(g,y)&&(l+=g-y,i[h]=y,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?h--:h++}}if(gr(l,0))return t;{const d=e<0?a:s,h=t[d];et(h!=null);const p=h+l,g=Sl({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=Sl({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,h)=>h+d,0);return gr(u,100)?i:t}function bie({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];et(a!=null),t.forEach((h,p)=>{const{constraints:g}=h,{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 ld(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function eA(e,t){const r=ld(e).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return r??null}function tA(e,t){const n=eA(e,t);return n!=null?[n,n+1]:[-1,-1]}function nA(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function zg(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function yie(e,t,n){var r,o,i,s;const a=zg(t),l=ld(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,h=(i=(s=n[u+1])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null;return[d,h]}function xie({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,setLayout:i}){Br({didWarnAboutMissingResizeHandle:!1}),sd(()=>{const s=ld(n);for(let a=0;a<o.length-1;a++){const{valueMax:l,valueMin:u,valueNow:d}=bie({layout:r,panelsArray:o,pivotIndices:[a,a+1]}),h=s[a];if(h!=null){const p=o[a];et(p),h.setAttribute("aria-controls",p.id),h.setAttribute("aria-valuemax",""+Math.round(l)),h.setAttribute("aria-valuemin",""+Math.round(u)),h.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]),ba(()=>{const s=t.current;et(s);const{panelDataArray:a}=s,l=nA(n);et(l!=null,`No group found for id "${n}"`);const u=ld(n);et(u);const d=u.map(h=>{const p=h.getAttribute("data-panel-resize-handle-id");et(p);const[g,b]=yie(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=vu({delta:gr(C,R)?T-R:R-C,layout:r,panelConstraints:a.map(D=>D.constraints),pivotIndices:tA(n,p),trigger:"keyboard"});r!==O&&i(O)}}break}}};return h.addEventListener("keydown",y),()=>{h.removeEventListener("keydown",y)}});return()=>{d.forEach(h=>h())}},[e,t,n,r,o,i])}function PR(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 rA(e){return e.type==="keydown"}function oA(e){return e.type.startsWith("mouse")}function iA(e){return e.type.startsWith("touch")}function sA(e,t){const n=e==="horizontal";if(oA(t))return n?t.clientX:t.clientY;if(iA(t)){const r=t.touches[0];return et(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function wie(e,t,n,r){const o=n==="horizontal",i=zg(t);et(i);const s=i.getAttribute("data-panel-group-id");et(s);let{initialCursorPosition:a}=r;const l=sA(n,e),u=nA(s);et(u);const d=u.getBoundingClientRect(),h=o?d.width:d.height;return(l-a)/h*100}function _ie(e,t,n,r,o){if(rA(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:wie(e,t,n,r)}function Sie({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 gl(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,h=n[l];if(h==null||r!==h){n[l]=r;const{onCollapse:p,onExpand:g,onResize:b}=s;b&&b(r,h),d&&(p||g)&&(g&&(h==null||h===u)&&r!==u&&g(),p&&(h==null||h!==u)&&r===u&&p())}})}function $h(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 Cie({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 ny=null,na=null;function aA(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 Eie(){na!==null&&(document.head.removeChild(na),ny=null,na=null)}function pb(e){if(ny===e)return;ny=e;const t=aA(e);na===null&&(na=document.createElement("style"),document.head.appendChild(na)),na.innerHTML=`*{cursor: ${t}!important;}`}function Rie(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function OR(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 lA(e){return`react-resizable-panels:${e}`}function cA(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 uA(e,t){try{const n=lA(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function $ie(e,t,n){var r,o;const i=(r=uA(e,n))!==null&&r!==void 0?r:{},s=cA(t);return(o=i[s])!==null&&o!==void 0?o:null}function Pie(e,t,n,r,o){var i;const s=lA(e),a=cA(t),l=(i=uA(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 MR({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=Sl({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=Sl({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,gr(o,0)))break}return n}const Oie=100,bu={getItem:e=>(OR(bu),bu.getItem(e)),setItem:(e,t)=>{OR(bu),bu.setItem(e,t)}},DR={};function dA({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=bu,style:u,tagName:d="div",...h}){const p=ww(i),[g,b]=Tp(null),[y,x]=Tp([]),_=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:[]}),XT(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=MR({layout:j,panelConstraints:ce.map(ge=>ge.constraints)});PR(te,ue)||(x(ue),E.current.layout=ue,B&&B(ue),gl(ce,ue,_.current))}}),[]),sd(()=>{R.current.autoSaveId=e,R.current.direction=r,R.current.dragState=g,R.current.id=p,R.current.onLayout=s,R.current.storage=l}),xie({committedValuesRef:R,eagerValuesRef:E,groupId:p,layout:y,panelDataArray:E.current.panelDataArray,setLayout:x}),ba(()=>{const{panelDataArray:j}=E.current;if(e){if(y.length===0||y.length!==j.length)return;let B=DR[e];B==null&&(B=Rie(Pie,Oie),DR[e]=B);const te=[...j],ce=new Map(w.current);B(e,te,ce,y,l)}},[e,y,l]),ba(()=>{});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}=ml(ce,j,te);if(et(ve!=null),ve!==ge){w.current.set(j.id,ve);const X=yl(ce,j)===ce.length-1?ve-ge:ge-ve,re=vu({delta:X,layout:te,panelConstraints:ue,pivotIndices:de,trigger:"imperative-api"});$h(te,re)||(x(re),E.current.layout=re,B&&B(re),gl(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}=ml(ce,j,te);if(ve===ge){const X=w.current.get(j.id),re=X!=null&&X>=de?X:de,H=yl(ce,j)===ce.length-1?ve-re:re-ve,De=vu({delta:H,layout:te,panelConstraints:ue,pivotIndices:J,trigger:"imperative-api"});$h(te,De)||(x(De),E.current.layout=De,B&&B(De),gl(ce,De,_.current))}}},[]),D=dr(j=>{const{layout:B,panelDataArray:te}=E.current,{panelSize:ce}=ml(te,j,B);return et(ce!=null),ce},[]),I=dr((j,B)=>{const{panelDataArray:te}=E.current,ce=yl(te,j);return Cie({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}=ml(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}=ml(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},[]);sd(()=>{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=$ie(j,ue,te);de&&(w.current=new Map(Object.entries(de.expandToSizes)),ge=de.layout)}ge==null&&(ge=Sie({panelDataArray:ue}));const ve=MR({layout:ge,panelConstraints:ue.map(de=>de.constraints)});PR(ce,ve)||(x(ve),E.current.layout=ve,B&&B(ve),gl(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=tA(ge,j);let H=_ie(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=vu({delta:H,layout:re??J,panelConstraints:Ne,pivotIndices:be,trigger:rA(te)?"keyboard":"mouse-or-touch"}),qe=!$h(J,Ve);(oA(te)||iA(te))&&C.current!=H&&(C.current=H,pb(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),gl(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}=ml(ue,j,ce);et(ve!=null);const X=yl(ue,j)===ue.length-1?ve-B:B-ve,re=vu({delta:X,layout:ce,panelConstraints:ge,pivotIndices:de,trigger:"imperative-api"});$h(ce,re)||(x(re),E.current.layout=re,te&&te(re),gl(ue,re,_.current))},[]),F=dr((j,B)=>{const{direction:te}=R.current,{layout:ce}=E.current,ue=zg(j);et(ue);const ge=sA(te,B);b({dragHandleId:j,dragHandleRect:ue.getBoundingClientRect(),initialCursorPosition:ge,initialLayout:ce})},[]),Z=dr(()=>{Eie(),b(null)},[]),Y=dr(j=>{const{panelDataArray:B}=E.current,te=yl(B,j);te>=0&&(B.splice(te,1),delete _.current[j.id],E.current.panelDataArrayChanged=!0)},[]),Q=gie(()=>({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 hc(Fg.Provider,{value:Q},hc(d,{...h,children:t,className:n,style:{...ae,...u},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const fA=YT((e,t)=>hc(dA,{...e,forwardedRef:t}));dA.displayName="PanelGroup";fA.displayName="forwardRef(PanelGroup)";function yl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function ml(e,t,n){const r=e.map(u=>u.constraints),o=yl(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 Mie({disabled:e,handleId:t,resizeHandler:n}){ba(()=>{if(e||n==null)return;const r=zg(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=ld(s),l=eA(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 hA({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});ba(()=>{d.current.onDragging=o});const h=KT(Fg);if(h===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:p,dragState:g,groupId:b,registerResizeHandle:y,startDragging:x,stopDragging:_}=h,w=ww(r),C=(g==null?void 0:g.dragHandleId)===w,[R,E]=Tp(!1),[T,O]=Tp(null),D=dr(()=>{const N=u.current;et(N),N.blur(),_();const{onDragging:V}=d.current;V&&V(!1)},[_]);ba(()=>{if(n)O(null);else{const N=y(w);O(()=>N)}},[n,w,y]),ba(()=>{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]),Mie({disabled:n,handleId:w,resizeHandler:T});const I={cursor:aA(p),touchAction:"none",userSelect:"none"};return hc(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})}hA.displayName="PanelResizeHandle";function Die(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TR(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 AR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?TR(Object(n),!0).forEach(function(r){Die(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tie(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 Aie(e,t){if(e==null)return{};var n=Tie(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 Iie(e,t){return kie(e)||Nie(e,t)||Lie(e,t)||Fie()}function kie(e){if(Array.isArray(e))return e}function Nie(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 Lie(e,t){if(e){if(typeof e=="string")return IR(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 IR(e,t)}}function IR(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 Fie(){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 zie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kR(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 NR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?kR(Object(n),!0).forEach(function(r){zie(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jie(){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 yu(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 Ap(e){return{}.toString.call(e).includes("Object")}function Vie(e){return!Object.keys(e).length}function cd(e){return typeof e=="function"}function Bie(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Hie(e,t){return Ap(t)||rs("changeType"),Object.keys(t).some(function(n){return!Bie(e,n)})&&rs("changeField"),t}function Wie(e){cd(e)||rs("selectorType")}function Uie(e){cd(e)||Ap(e)||rs("handlerType"),Ap(e)&&Object.values(e).some(function(t){return!cd(t)})&&rs("handlersType")}function qie(e){e||rs("initialIsRequired"),Ap(e)||rs("initialType"),Vie(e)&&rs("initialContent")}function Gie(e,t){throw new Error(e[t]||e.default)}var Yie={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"},rs=yu(Gie)(Yie),Ph={changes:Hie,selector:Wie,handler:Uie,initial:qie};function Kie(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ph.initial(e),Ph.handler(t);var n={current:e},r=yu(Zie)(n,t),o=yu(Qie)(n),i=yu(Ph.changes)(e),s=yu(Xie)(n);function a(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return Ph.selector(u),u(n.current)}function l(u){jie(r,o,i,s)(u)}return[a,l]}function Xie(e,t){return cd(t)?t(e.current):t}function Qie(e,t){return e.current=NR(NR({},e.current),t),t}function Zie(e,t,n){return cd(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 Jie={create:Kie},ese={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function tse(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 nse(e){return{}.toString.call(e).includes("Object")}function rse(e){return e||LR("configIsRequired"),nse(e)||LR("configType"),e.urls?(ose(),{paths:{vs:e.urls.monacoBase}}):e}function ose(){console.warn(pA.deprecation)}function ise(e,t){throw new Error(e[t]||e.default)}var pA={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
|
+
`},LR=tse(ise)(pA),sse={config:rse},ase=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 gA(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],gA(e[n],t[n]))}),AR(AR({},e),t)}var lse={type:"cancelation",msg:"operation is manually canceled"};function gb(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(lse):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var cse=Jie.create({config:ese,isInitialized:!1,resolve:null,reject:null,monaco:null}),mA=Iie(cse,2),Kd=mA[0],jg=mA[1];function use(e){var t=sse.config(e),n=t.monaco,r=Aie(t,["monaco"]);jg(function(o){return{config:gA(o.config,r),monaco:n}})}function dse(){var e=Kd(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(jg({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),gb(mb);if(window.monaco&&window.monaco.editor)return vA(window.monaco),e.resolve(window.monaco),gb(mb);ase(fse,pse)(gse)}return gb(mb)}function fse(e){return document.body.appendChild(e)}function hse(e){var t=document.createElement("script");return e&&(t.src=e),t}function pse(e){var t=Kd(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=hse("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function gse(){var e=Kd(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){vA(n),e.resolve(n)},function(n){e.reject(n)})}function vA(e){Kd().monaco||jg({monaco:e})}function mse(){return Kd(function(e){var t=e.monaco;return t})}var mb=new Promise(function(e,t){return jg({resolve:e,reject:t})}),bA={config:use,init:dse,__getMonacoInstance:mse},vse={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},vb=vse,bse={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},yse=bse;function xse({children:e}){return m.createElement("div",{style:yse.container},e)}var wse=xse,_se=wse;function Sse({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return m.createElement("section",{style:{...vb.wrapper,width:e,height:t},...s},!n&&m.createElement(_se,null,r),m.createElement("div",{ref:o,style:{...vb.fullWidth,...!n&&vb.hide},className:i}))}var Cse=Sse,yA=m.memo(Cse);function Ese(e){m.useEffect(e,[])}var xA=Ese;function Rse(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var vr=Rse;function Tu(){}function Cl(e,t,n,r){return $se(e,r)||Pse(e,t,n,r)}function $se(e,t){return e.editor.getModel(wA(e,t))}function Pse(e,t,n,r){return e.editor.createModel(t,n,r?wA(e,r):void 0)}function wA(e,t){return e.Uri.parse(t)}function Ose({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:h={},height:p="100%",width:g="100%",className:b,wrapperProps:y={},beforeMount:x=Tu,onMount:_=Tu}){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);xA(()=>{let F=bA.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=Cl(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=Cl(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(h)},[h],w);let G=m.useCallback(()=>{var Y;if(!O.current)return;N.current(O.current);let F=Cl(O.current,e||"",r||n||"text",i||""),Z=Cl(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,...h}),G(),(F=O.current)==null||F.editor.setTheme(u),C(!0),V.current=!0)},[h,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(yA,{width:g,height:p,isEditorReady:w,loading:d,_ref:D,className:b,wrapperProps:y})}var Mse=Ose;m.memo(Mse);function Dse(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var Tse=Dse,Oh=new Map;function Ase({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:h=!0,keepCurrentModel:p=!1,width:g="100%",height:b="100%",className:y,wrapperProps:x={},beforeMount:_=Tu,onMount:w=Tu,onChange:C,onValidate:R=Tu}){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=Tse(i),Y=m.useRef(!1),Q=m.useRef(!1);xA(()=>{let B=bA.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=Cl(I.current,e||r||"",t||o||"",i||n||"");B!==((te=N.current)==null?void 0:te.getModel())&&(h&&Oh.set(Z,(ce=N.current)==null?void 0:ce.saveViewState()),(ue=N.current)==null||ue.setModel(B),h&&((ge=N.current)==null||ge.restoreViewState(Oh.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=Cl(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),h&&N.current.restoreViewState(Oh.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,h,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?h&&Oh.set(i,N.current.saveViewState()):(te=N.current.getModel())==null||te.dispose(),N.current.dispose()}return m.createElement(yA,{width:g,height:b,isEditorReady:E,loading:l,_ref:V,className:y,wrapperProps:x})}var Ise=Ase,_A=m.memo(Ise),kse=_A;const Nse=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)})}))}),SA=Nse,Lse=Ux("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"}}),CA=ie.forwardRef(({className:e,variant:t,size:n,...r},o)=>k.jsx(SA,{ref:o,className:Se(Lse({variant:t,size:n,className:e})),...r}));CA.displayName=SA.displayName;const EA="Switch",[Fse,ile]=mn(EA),[zse,jse]=Fse(EA),Vse=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:u,...d}=e,[h,p]=m.useState(null),g=Xe(t,w=>p(w)),b=m.useRef(!1),y=h?!!h.closest("form"):!0,[x=!1,_]=Nn({prop:o,defaultProp:i,onChange:u});return m.createElement(zse,{scope:n,checked:x,disabled:a},m.createElement(ke.button,ne({type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":RA(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(Wse,{control:h,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),Bse="SwitchThumb",Hse=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=jse(Bse,n);return m.createElement(ke.span,ne({"data-state":RA(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),Wse=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Dg(n),a=gg(t);return m.useEffect(()=>{const l=i.current,u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"checked").set;if(s!==n&&h){const p=new Event("click",{bubbles:r});h.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 RA(e){return e?"checked":"unchecked"}const Vg=Vse,$A=Hse,PA=ie.forwardRef(({className:e,...t},n)=>k.jsx(Vg,{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($A,{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")})}));PA.displayName=Vg.displayName;const Use=ie.forwardRef(({className:e,...t},n)=>k.jsx(Vg,{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($A,{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")})}));Use.displayName=Vg.displayName;const OA="Collapsible",[qse,MA]=mn(OA),[Gse,_w]=qse(OA),Yse=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(Gse,{scope:n,disabled:i,contentId:nr(),open:l,onOpenToggle:m.useCallback(()=>u(d=>!d),[u])},m.createElement(ke.div,ne({"data-state":Sw(l),"data-disabled":i?"":void 0},a,{ref:t})))}),Kse="CollapsibleTrigger",Xse=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=_w(Kse,n);return m.createElement(ke.button,ne({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":Sw(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:we(e.onClick,o.onOpenToggle)}))}),DA="CollapsibleContent",Qse=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=_w(DA,e.__scopeCollapsible);return m.createElement(nn,{present:n||o.open},({present:i})=>m.createElement(Zse,ne({},r,{ref:t,present:i})))}),Zse=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=_w(DA,n),[a,l]=m.useState(r),u=m.useRef(null),d=Xe(t,u),h=m.useRef(0),p=h.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();h.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":Sw(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 Sw(e){return e?"open":"closed"}const Jse=Yse,eae=Xse,tae=Qse,hs="Accordion",nae=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Cw,rae,oae]=qp(hs),[Bg,sle]=mn(hs,[oae,MA]),Ew=MA(),TA=m.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return m.createElement(Cw.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(lae,ne({},i,{ref:t})):m.createElement(aae,ne({},o,{ref:t})))});TA.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[AA,iae]=Bg(hs),[IA,sae]=Bg(hs,{collapsible:!1}),aae=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(AA,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>i&&l(""),[i,l])},m.createElement(IA,{scope:e.__scopeAccordion,collapsible:i},m.createElement(kA,ne({},s,{ref:t}))))}),lae=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((h=[])=>[...h,d]),[a]),u=m.useCallback(d=>a((h=[])=>h.filter(p=>p!==d)),[a]);return m.createElement(AA,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:u},m.createElement(IA,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(kA,ne({},i,{ref:t}))))}),[cae,Hg]=Bg(hs),kA=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=rae(n),h=Da(o)==="ltr",p=we(e.onKeyDown,g=>{var b;if(!nae.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"&&(h?T():O());break;case"ArrowDown":i==="vertical"&&T();break;case"ArrowLeft":i==="horizontal"&&(h?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(cae,{scope:n,disabled:r,direction:o,orientation:i},m.createElement(Cw.Slot,{scope:n},m.createElement(ke.div,ne({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:p}))))}),ry="AccordionItem",[uae,Rw]=Bg(ry),dae=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Hg(ry,n),s=iae(ry,n),a=Ew(n),l=nr(),u=r&&s.value.includes(r)||!1,d=i.disabled||e.disabled;return m.createElement(uae,{scope:n,open:u,disabled:d,triggerId:l},m.createElement(Jse,ne({"data-orientation":i.orientation,"data-state":NA(u)},a,o,{ref:t,disabled:d,open:u,onOpenChange:h=>{h?s.onItemOpen(r):s.onItemClose(r)}})))}),fae="AccordionHeader",hae=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Hg(hs,n),i=Rw(fae,n);return m.createElement(ke.h3,ne({"data-orientation":o.orientation,"data-state":NA(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),FR="AccordionTrigger",pae=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Hg(hs,n),i=Rw(FR,n),s=sae(FR,n),a=Ew(n);return m.createElement(Cw.ItemSlot,{scope:n},m.createElement(eae,ne({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:t})))}),gae="AccordionContent",mae=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Hg(hs,n),i=Rw(gae,n),s=Ew(n);return m.createElement(tae,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 NA(e){return e?"open":"closed"}const vae=TA,bae=dae,yae=hae,LA=pae,FA=mae,xae=vae,zA=ie.forwardRef(({className:e,...t},n)=>k.jsx(bae,{ref:n,className:Se("border-b",e),...t}));zA.displayName="AccordionItem";const jA=ie.forwardRef(({className:e,children:t,...n},r)=>k.jsx(yae,{className:"flex",children:k.jsxs(LA,{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(yg,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));jA.displayName=LA.displayName;const VA=ie.forwardRef(({className:e,children:t,...n},r)=>k.jsx(FA,{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})}));VA.displayName=FA.displayName;const BA="Radio",[wae,HA]=mn(BA),[_ae,Sae]=wae(BA),Cae=m.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,...u}=e,[d,h]=m.useState(null),p=Xe(t,y=>h(y)),g=m.useRef(!1),b=d?!!d.closest("form"):!0;return m.createElement(_ae,{scope:n,checked:o,disabled:s},m.createElement(ke.button,ne({type:"button",role:"radio","aria-checked":o,"data-state":WA(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($ae,{control:d,bubbles:!g.current,name:r,value:a,checked:o,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))}),Eae="RadioIndicator",Rae=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=Sae(Eae,n);return m.createElement(nn,{present:r||i.checked},m.createElement(ke.span,ne({"data-state":WA(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:t})))}),$ae=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Dg(n),a=gg(t);return m.useEffect(()=>{const l=i.current,u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"checked").set;if(s!==n&&h){const p=new Event("click",{bubbles:r});h.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 WA(e){return e?"checked":"unchecked"}const Pae=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],UA="RadioGroup",[Oae,ale]=mn(UA,[mc,HA]),qA=mc(),GA=HA(),[Mae,Dae]=Oae(UA),Tae=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:h,...p}=e,g=qA(n),b=Da(u),[y,x]=Nn({prop:i,defaultProp:o,onChange:h});return m.createElement(Mae,{scope:n,name:r,required:s,disabled:a,value:y,onValueChange:x},m.createElement(vy,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}))))}),Aae="RadioGroupItem",Iae=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=Dae(Aae,n),s=i.disabled||r,a=qA(n),l=GA(n),u=m.useRef(null),d=Xe(t,u),h=i.value===o.value,p=m.useRef(!1);return m.useEffect(()=>{const g=y=>{Pae.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(by,ne({asChild:!0},a,{focusable:!s,active:h}),m.createElement(Cae,ne({disabled:s,required:i.required,checked:h},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())})})))}),kae=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=GA(n);return m.createElement(Rae,ne({},o,r,{ref:t}))}),YA=Tae,KA=Iae,Nae=kae,XA=ie.forwardRef(({className:e,...t},n)=>k.jsx(YA,{className:Se("grid gap-2",e),...t,ref:n}));XA.displayName=YA.displayName;const QA=ie.forwardRef(({className:e,...t},n)=>k.jsx(KA,{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(Nae,{className:"flex items-center justify-center",children:k.jsx(q2,{className:"h-2.5 w-2.5 fill-current text-current"})})}));QA.displayName=KA.displayName;exports.$57acba87d6e25586$export$ccf8d8d7bbf3c2cc=LT;exports.$PROXY=ju;exports.$TRACK=dy;exports.$a093c7e1ec25a057$export$8c610744efcf8a1d=F2;exports.Accordion=xae;exports.AccordionContent=VA;exports.AccordionItem=zA;exports.AccordionTrigger=jA;exports.BOOLEAN_DATA_TYPES=Wx;exports.Button=ma;exports.Calendar=W2;exports.Card=Uy;exports.CardContent=ag;exports.CardDescription=qy;exports.CardFooter=Gy;exports.CardHeader=ig;exports.CardTitle=sg;exports.ChartJsVisual=b2;exports.Check=zd;exports.CheckIcon=y2;exports.Checkbox=DT;exports.ChevronDown=yg;exports.ClipboardCopyIcon=iG;exports.Cross2Icon=x2;exports.DATE_DATA_TYPES=Hd;exports.DashboardPanel=c8;exports.DashboardTabs=Une;exports.Dialog=zoe;exports.DialogContent=_T;exports.DialogDescription=RT;exports.DialogFooter=CT;exports.DialogHeader=ST;exports.DialogTitle=ET;exports.DialogTrigger=joe;exports.DropdownMenu=coe;exports.DropdownMenuContent=sT;exports.DropdownMenuLabel=lT;exports.DropdownMenuRadioGroup=doe;exports.DropdownMenuRadioItem=aT;exports.DropdownMenuSeparator=cT;exports.DropdownMenuTrigger=uoe;exports.Dynamic=e4;exports.Editable=_a;exports.EditorAside=AT;exports.EditorMain=IT;exports.EditorPanel=TT;exports.For=RF;exports.Ft=kse;exports.HoverCard=eM;exports.HoverCardContent=Px;exports.HoverCardTrigger=tM;exports.Index=$F;exports.InfoCircledIcon=fG;exports.Input=$T;exports.KPICard=K2;exports.Label=si;exports.LoaderCircle=Cx;exports.Match=MF;exports.NUMBER_DATA_TYPES=cc;exports.PYTHON_DEFAULT_CODE=m$;exports.Panel=ZT;exports.PanelGroup=fA;exports.PanelResizeHandle=hA;exports.PaperPlaneIcon=pG;exports.PlayIcon=mG;exports.Popover=iw;exports.PopoverContent=Mg;exports.PopoverTrigger=sw;exports.Portal=JF;exports.RadioGroup=XA;exports.RadioGroupItem=QA;exports.ScrollArea=GT;exports.ScrollBar=xw;exports.Select=TD;exports.SelectContent=fw;exports.SelectGroup=Vne;exports.SelectItem=Du;exports.SelectLabel=ND;exports.SelectSeparator=LD;exports.SelectTrigger=dw;exports.SelectValue=AD;exports.SemaphorContextProvider=e8;exports.SemaphorQueryClient=R$;exports.Separator=lw;exports.Settings=G2;exports.Show=PF;exports.SliderIcon=bG;exports.Switch=OF;exports.Switch$1=PA;exports.TEXT_DATA_TYPES=Sg;exports.Table=Ox;exports.TableBody=Dx;exports.TableCell=wp;exports.TableHead=Tx;exports.TableHeader=Mx;exports.TableRow=Mu;exports.TableVisual=gM;exports.Tabs=_P;exports.TabsContent=xy;exports.TabsList=SP;exports.TabsTrigger=CP;exports.Textarea=aw;exports.Toggle=CA;exports.Tooltip=V2;exports.TooltipContent=Sx;exports.TooltipTrigger=B2;exports.TriangleDownIcon=dx;exports.TriangleUpIcon=fx;exports.UXProvider=qne;exports.X=Y2;exports._=wa;exports.addEventListener=V$;exports.batch=sF;exports.children=hy;exports.className=j$;exports.cleanCard=uT;exports.cn=Se;exports.commonjsGlobal=Ks;exports.convertRemToPixels=G4;exports.copyToClipboard=HL;exports.createChartConfig=X2;exports.createComponent=k$;exports.createComputed=Vb;exports.createContext=hF;exports.createEffect=fy;exports.createLucideIcon=Rr;exports.createMemo=Hn;exports.createRenderEffect=ts;exports.createRoot=es;exports.createSignal=Tn;exports.createSqlGenConfig=JQ;exports.createUniqueId=EF;exports.de=_A;exports.delegateEvents=z$;exports.deleteNestedDataByPath=uu;exports.displayValue=V4;exports.flexRender=V0;exports.fmt=MM;exports.getBookmarkKey=dT;exports.getCanvasBackgroundColor=Gh;exports.getColumnDataType=eZ;exports.getContrastColor=Yh;exports.getCoreRowModel=dM;exports.getDashbaordStateWithoutData=moe;exports.getDefaultExportFromCjs=$d;exports.getDefaultFilterSql=rZ;exports.getFilterValueType=$p;exports.getKeys=Hr;exports.getListener=lF;exports.getMutationStatusColor=z4;exports.getPaginationRowModel=hM;exports.getPreferredColorScheme=Y4;exports.getQualifiedTableName=DM;exports.getQueryStatusColor=F4;exports.getQueryStatusColorByLabel=j4;exports.getQueryStatusLabel=N4;exports.getRequest=vl;exports.getSidedProp=L4;exports.getSortedRowModel=fM;exports.getSql=ZQ;exports.insert=np;exports.isColumnInSqlGen=tZ;exports.jsxRuntimeExports=k;exports.mergeProps=N$;exports.mutationSortFns=q4;exports.on=aF;exports.onCleanup=Zl;exports.onMount=O$;exports.pivotData=hx;exports.postRequest=kp;exports.resolveBaseQuery=n$;exports.resolveDataType=Wu;exports.setAttribute=tp;exports.sortFns=W4;exports.splitProps=L$;exports.spread=B$;exports.stringify=k4;exports.template=BF;exports.titleCase=UL;exports.untrack=dn;exports.updateNestedDataByPath=cu;exports.use=qF;exports.useCard=yK;exports.useContext=pF;exports.useDashboardActions=Ma;exports.useDashboardCard=Ex;exports.useDashboardStore=Ee;exports.useEditorActions=nF;exports.useEditorAside=t8;exports.useEditorStore=Kt;exports.useQuery=So;exports.useReactTable=pM;exports.useSemaphorContext=Oa;exports.useTheme=cP;exports.useTransition=fF;exports.v4=zu;
|