react-semaphor 0.0.148 → 0.0.150
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/{dashboard-plus-PXF4M2Zw.js → dashboard-plus-1qhhIbxX.js} +10 -10
- package/dist/chunks/{dashboard-plus-ucXms5nl.js → dashboard-plus-yoSVBMke.js} +1316 -1308
- package/dist/chunks/index-e4IBsALI.js +364 -0
- package/dist/chunks/{index-7tEMw5Sc.js → index-yLUZIbzY.js} +12616 -14926
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/main.d.ts +2 -1
- package/package.json +1 -1
- package/dist/chunks/2DAFLIRC-98edXt2R.js +0 -9088
- package/dist/chunks/2DAFLIRC-QEwj8O5E.js +0 -1086
- package/dist/chunks/index-nnROM_wm.js +0 -364
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
"use strict";var rN=Object.defineProperty;var oN=(e,t,n)=>t in e?rN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ce=(e,t,n)=>(oN(e,typeof t!="symbol"?t+"":t,n),n),tm=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var U=(e,t,n)=>(tm(e,t,"read from private field"),n?n.call(e):t.get(e)),Ne=(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)},Me=(e,t,n,r)=>(tm(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Yd=(e,t,n,r)=>({set _(o){Me(e,t,o,n)},get _(){return U(e,t,r)}}),ot=(e,t,n)=>(tm(e,t,"access private method"),n);const m=require("react"),Co=require("react-dom");function SE(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 ae=SE(m),iN=SE(Co);var ks=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ub(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 vv={exports:{}},mc={};/**
|
|
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 k1;function sN(){return k1||(k1=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 H=b&&$[b]||$[y];return typeof H=="function"?H:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _($){{for(var H=arguments.length,oe=new Array(H>1?H-1:0),xe=1;xe<H;xe++)oe[xe-1]=arguments[xe];C("error",$,oe)}}function C($,H,oe){{var xe=w.ReactDebugCurrentFrame,Te=xe.getStackAddendum();Te!==""&&(H+="%s",oe=oe.concat([Te]));var ke=oe.map(function(Pe){return String(Pe)});ke.unshift("Warning: "+H),Function.prototype.apply.call(console[$],console,ke)}}var R=!1,E=!1,D=!1,O=!1,T=!1,I;I=Symbol.for("react.module.reference");function N($){return!!(typeof $=="string"||typeof $=="function"||$===r||$===i||T||$===o||$===u||$===d||O||$===g||R||E||D||typeof $=="object"&&$!==null&&($.$$typeof===p||$.$$typeof===h||$.$$typeof===s||$.$$typeof===a||$.$$typeof===l||$.$$typeof===I||$.getModuleId!==void 0))}function W($,H,oe){var xe=$.displayName;if(xe)return xe;var Te=H.displayName||H.name||"";return Te!==""?oe+"("+Te+")":oe}function Y($){return $.displayName||"Context"}function ue($){if($==null)return null;if(typeof $.tag=="number"&&_("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 H=$;return Y(H)+".Consumer";case s:var oe=$;return Y(oe._context)+".Provider";case l:return W($,$.render,"ForwardRef");case h:var xe=$.displayName||null;return xe!==null?xe:ue($.type)||"Memo";case p:{var Te=$,ke=Te._payload,Pe=Te._init;try{return ue(Pe(ke))}catch{return null}}}return null}var J=Object.assign,F=0,Z,q,X,ie,j,V,te;function le(){}le.__reactDisabledLog=!0;function ce(){{if(F===0){Z=console.log,q=console.info,X=console.warn,ie=console.error,j=console.group,V=console.groupCollapsed,te=console.groupEnd;var $={configurable:!0,enumerable:!0,value:le,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:J({},$,{value:Z}),info:J({},$,{value:q}),warn:J({},$,{value:X}),error:J({},$,{value:ie}),group:J({},$,{value:j}),groupCollapsed:J({},$,{value:V}),groupEnd:J({},$,{value:te})})}F<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ve=w.ReactCurrentDispatcher,de;function ee($,H,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 K=!1,re;{var be=typeof WeakMap=="function"?WeakMap:Map;re=new be}function Q($,H){if(!$||K)return"";{var oe=re.get($);if(oe!==void 0)return oe}var xe;K=!0;var Te=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ke;ke=ve.current,ve.current=null,ce();try{if(H){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(zt){xe=zt}Reflect.construct($,[],Pe)}else{try{Pe.call()}catch(zt){xe=zt}$.call(Pe.prototype)}}else{try{throw Error()}catch(zt){xe=zt}$()}}catch(zt){if(zt&&xe&&typeof zt.stack=="string"){for(var Re=zt.stack.split(`
|
|
11
|
+
`),gt=xe.stack.split(`
|
|
12
|
+
`),Be=Re.length-1,Ge=gt.length-1;Be>=1&&Ge>=0&&Re[Be]!==gt[Ge];)Ge--;for(;Be>=1&&Ge>=0;Be--,Ge--)if(Re[Be]!==gt[Ge]){if(Be!==1||Ge!==1)do if(Be--,Ge--,Ge<0||Re[Be]!==gt[Ge]){var Rt=`
|
|
13
|
+
`+Re[Be].replace(" at new "," at ");return $.displayName&&Rt.includes("<anonymous>")&&(Rt=Rt.replace("<anonymous>",$.displayName)),typeof $=="function"&&re.set($,Rt),Rt}while(Be>=1&&Ge>=0);break}}}finally{K=!1,ve.current=ke,ge(),Error.prepareStackTrace=Te}var ln=$?$.displayName||$.name:"",ps=ln?ee(ln):"";return typeof $=="function"&&re.set($,ps),ps}function Oe($,H,oe){return Q($,!1)}function Ie($){var H=$.prototype;return!!(H&&H.isReactComponent)}function ze($,H,oe){if($==null)return"";if(typeof $=="function")return Q($,Ie($));if(typeof $=="string")return ee($);switch($){case u:return ee("Suspense");case d:return ee("SuspenseList")}if(typeof $=="object")switch($.$$typeof){case l:return Oe($.render);case h:return ze($.type,H,oe);case p:{var xe=$,Te=xe._payload,ke=xe._init;try{return ze(ke(Te),H,oe)}catch{}}}return""}var _e=Object.prototype.hasOwnProperty,pt={},dt=w.ReactDebugCurrentFrame;function ft($){if($){var H=$._owner,oe=ze($.type,$._source,H?H.type:null);dt.setExtraStackFrame(oe)}else dt.setExtraStackFrame(null)}function Bt($,H,oe,xe,Te){{var ke=Function.call.bind(_e);for(var Pe in $)if(ke($,Pe)){var Re=void 0;try{if(typeof $[Pe]!="function"){var gt=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 gt.name="Invariant Violation",gt}Re=$[Pe](H,Pe,xe,oe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Be){Re=Be}Re&&!(Re instanceof Error)&&(ft(Te),_("%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),ft(null)),Re instanceof Error&&!(Re.message in pt)&&(pt[Re.message]=!0,ft(Te),_("Failed %s type: %s",oe,Re.message),ft(null))}}}var Vt=Array.isArray;function wn($){return Vt($)}function en($){{var H=typeof Symbol=="function"&&Symbol.toStringTag,oe=H&&$[Symbol.toStringTag]||$.constructor.name||"Object";return oe}}function Yl($){try{return jr($),!1}catch{return!0}}function jr($){return""+$}function Ji($){if(Yl($))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",en($)),jr($)}var hn=w.ReactCurrentOwner,no={key:!0,ref:!0,__self:!0,__source:!0},Mo,Do,Vr;Vr={};function es($){if(_e.call($,"ref")){var H=Object.getOwnPropertyDescriptor($,"ref").get;if(H&&H.isReactWarning)return!1}return $.ref!==void 0}function ts($){if(_e.call($,"key")){var H=Object.getOwnPropertyDescriptor($,"key").get;if(H&&H.isReactWarning)return!1}return $.key!==void 0}function ns($,H){if(typeof $.ref=="string"&&hn.current&&H&&hn.current.stateNode!==H){var oe=ue(hn.current.type);Vr[oe]||(_('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',ue(hn.current.type),$.ref),Vr[oe]=!0)}}function rs($,H){{var oe=function(){Mo||(Mo=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",H))};oe.isReactWarning=!0,Object.defineProperty($,"key",{get:oe,configurable:!0})}}function os($,H){{var oe=function(){Do||(Do=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",H))};oe.isReactWarning=!0,Object.defineProperty($,"ref",{get:oe,configurable:!0})}}var is=function($,H,oe,xe,Te,ke,Pe){var Re={$$typeof:t,type:$,key:H,ref:oe,props:Pe,_owner:ke};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 Kl($,H,oe,xe,Te){{var ke,Pe={},Re=null,gt=null;oe!==void 0&&(Ji(oe),Re=""+oe),ts(H)&&(Ji(H.key),Re=""+H.key),es(H)&&(gt=H.ref,ns(H,Te));for(ke in H)_e.call(H,ke)&&!no.hasOwnProperty(ke)&&(Pe[ke]=H[ke]);if($&&$.defaultProps){var Be=$.defaultProps;for(ke in Be)Pe[ke]===void 0&&(Pe[ke]=Be[ke])}if(Re||gt){var Ge=typeof $=="function"?$.displayName||$.name||"Unknown":$;Re&&rs(Pe,Ge),gt&&os(Pe,Ge)}return is($,Re,gt,Te,xe,hn.current,Pe)}}var To=w.ReactCurrentOwner,ss=w.ReactDebugCurrentFrame;function _n($){if($){var H=$._owner,oe=ze($.type,$._source,H?H.type:null);ss.setExtraStackFrame(oe)}else ss.setExtraStackFrame(null)}var ro;ro=!1;function Ao($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function as(){{if(To.current){var $=ue(To.current.type);if($)return`
|
|
14
|
+
|
|
15
|
+
Check the render method of \``+$+"`."}return""}}function Xl($){{if($!==void 0){var H=$.fileName.replace(/^.*[\\\/]/,""),oe=$.lineNumber;return`
|
|
16
|
+
|
|
17
|
+
Check your code at `+H+":"+oe+"."}return""}}var ls={};function Ea($){{var H=as();if(!H){var oe=typeof $=="string"?$:$.displayName||$.name;oe&&(H=`
|
|
18
|
+
|
|
19
|
+
Check the top-level render call using <`+oe+">.")}return H}}function cs($,H){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var oe=Ea(H);if(ls[oe])return;ls[oe]=!0;var xe="";$&&$._owner&&$._owner!==To.current&&(xe=" It was passed a child from "+ue($._owner.type)+"."),_n($),_('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),_n(null)}}function us($,H){{if(typeof $!="object")return;if(wn($))for(var oe=0;oe<$.length;oe++){var xe=$[oe];Ao(xe)&&cs(xe,H)}else if(Ao($))$._store&&($._store.validated=!0);else if($){var Te=x($);if(typeof Te=="function"&&Te!==$.entries)for(var ke=Te.call($),Pe;!(Pe=ke.next()).done;)Ao(Pe.value)&&cs(Pe.value,H)}}}function Ql($){{var H=$.type;if(H==null||typeof H=="string")return;var oe;if(typeof H=="function")oe=H.propTypes;else if(typeof H=="object"&&(H.$$typeof===l||H.$$typeof===h))oe=H.propTypes;else return;if(oe){var xe=ue(H);Bt(oe,$.props,"prop",xe,$)}else if(H.PropTypes!==void 0&&!ro){ro=!0;var Te=ue(H);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Te||"Unknown")}typeof H.getDefaultProps=="function"&&!H.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ds($){{for(var H=Object.keys($.props),oe=0;oe<H.length;oe++){var xe=H[oe];if(xe!=="children"&&xe!=="key"){_n($),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",xe),_n(null);break}}$.ref!==null&&(_n($),_("Invalid attribute `ref` supplied to `React.Fragment`."),_n(null))}}function fs($,H,oe,xe,Te,ke){{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 gt=Xl(Te);gt?Re+=gt:Re+=as();var Be;$===null?Be="null":wn($)?Be="array":$!==void 0&&$.$$typeof===t?(Be="<"+(ue($.type)||"Unknown")+" />",Re=" Did you accidentally export a JSX literal instead of a component?"):Be=typeof $,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Be,Re)}var Ge=Kl($,H,oe,Te,ke);if(Ge==null)return Ge;if(Pe){var Rt=H.children;if(Rt!==void 0)if(xe)if(wn(Rt)){for(var ln=0;ln<Rt.length;ln++)us(Rt[ln],$);Object.freeze&&Object.freeze(Rt)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else us(Rt,$)}return $===r?ds(Ge):Ql(Ge),Ge}}function hs($,H,oe){return fs($,H,oe,!0)}function Zl($,H,oe){return fs($,H,oe,!1)}var Jl=Zl,ec=hs;mc.Fragment=r,mc.jsx=Jl,mc.jsxs=ec}()),mc}var vc={};/**
|
|
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 N1;function aN(){if(N1)return vc;N1=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 vc.Fragment=n,vc.jsx=s,vc.jsxs=s,vc}process.env.NODE_ENV==="production"?vv.exports=aN():vv.exports=sN();var k=vv.exports;function CE(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=CE(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function th(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=CE(e))&&(r&&(r+=" "),r+=t);return r}const lN=Object.freeze(Object.defineProperty({__proto__:null,clsx:th,default:th},Symbol.toStringTag,{value:"Module"})),qb="-";function cN(e){const t=dN(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(qb);return a[0]===""&&a.length!==1&&a.shift(),EE(a,t)||uN(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function EE(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?EE(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(qb);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const L1=/^\[(.+)\]$/;function uN(e){if(L1.test(e)){const t=L1.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function dN(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return hN(Object.entries(e.classGroups),n).forEach(([i,s])=>{bv(s,r,i,t)}),r}function bv(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:F1(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(fN(o)){bv(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{bv(s,F1(t,i),n,r)})})}function F1(e,t){let n=e;return t.split(qb).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function fN(e){return e.isThemeGetter}function hN(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 pN(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 RE="!";function gN(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(RE),g=p?h.substring(1):h,b=d&&d>u?d-u:void 0;return{modifiers:a,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:b}}}function mN(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 vN(e){return{cache:pN(e.cacheSize),splitModifiers:gN(e),...cN(e)}}const bN=/\s+/;function yN(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(bN).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=mN(a).join(":");return{isTailwindClass:!0,modifierId:l?g+RE: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 xN(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=$E(t))&&(r&&(r+=" "),r+=n);return r}function $E(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=$E(e[r]))&&(n&&(n+=" "),n+=t);return n}function wN(e,...t){let n,r,o,i=s;function s(l){const u=t.reduce((d,h)=>h(d),e());return n=vN(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=yN(l,n);return o(l,d),d}return function(){return i(xN.apply(null,arguments))}}function Tt(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const PE=/^\[(?:([a-z-]+):)?(.+)\]$/i,_N=/^\d+\/\d+$/,SN=new Set(["px","full","screen"]),CN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,EN=/\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$/,RN=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$N=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function qr(e){return Ls(e)||SN.has(e)||_N.test(e)}function xi(e){return Vl(e,"length",kN)}function Ls(e){return!!e&&!Number.isNaN(Number(e))}function Kd(e){return Vl(e,"number",Ls)}function bc(e){return!!e&&Number.isInteger(Number(e))}function PN(e){return e.endsWith("%")&&Ls(e.slice(0,-1))}function tt(e){return PE.test(e)}function wi(e){return CN.test(e)}const ON=new Set(["length","size","percentage"]);function MN(e){return Vl(e,ON,OE)}function DN(e){return Vl(e,"position",OE)}const TN=new Set(["image","url"]);function AN(e){return Vl(e,TN,LN)}function IN(e){return Vl(e,"",NN)}function yc(){return!0}function Vl(e,t,n){const r=PE.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function kN(e){return EN.test(e)}function OE(){return!1}function NN(e){return RN.test(e)}function LN(e){return $N.test(e)}function FN(){const e=Tt("colors"),t=Tt("spacing"),n=Tt("blur"),r=Tt("brightness"),o=Tt("borderColor"),i=Tt("borderRadius"),s=Tt("borderSpacing"),a=Tt("borderWidth"),l=Tt("contrast"),u=Tt("grayscale"),d=Tt("hueRotate"),h=Tt("invert"),p=Tt("gap"),g=Tt("gradientColorStops"),b=Tt("gradientColorStopPositions"),y=Tt("inset"),x=Tt("margin"),w=Tt("opacity"),_=Tt("padding"),C=Tt("saturate"),R=Tt("scale"),E=Tt("sepia"),D=Tt("skew"),O=Tt("space"),T=Tt("translate"),I=()=>["auto","contain","none"],N=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto",tt,t],Y=()=>[tt,t],ue=()=>["",qr,xi],J=()=>["auto",Ls,tt],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Z=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],X=()=>["start","end","center","between","around","evenly","stretch"],ie=()=>["","0",tt],j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],V=()=>[Ls,Kd],te=()=>[Ls,tt];return{cacheSize:500,separator:":",theme:{colors:[yc],spacing:[qr,xi],blur:["none","",wi,tt],brightness:V(),borderColor:[e],borderRadius:["none","","full",wi,tt],borderSpacing:Y(),borderWidth:ue(),contrast:V(),grayscale:ie(),hueRotate:te(),invert:ie(),gap:Y(),gradientColorStops:[e],gradientColorStopPositions:[PN,xi],inset:W(),margin:W(),opacity:V(),padding:Y(),saturate:V(),scale:V(),sepia:ie(),skew:te(),space:Y(),translate:Y()},classGroups:{aspect:[{aspect:["auto","square","video",tt]}],container:["container"],columns:[{columns:[wi]}],"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(),tt]}],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",bc,tt]}],basis:[{basis:W()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",tt]}],grow:[{grow:ie()}],shrink:[{shrink:ie()}],order:[{order:["first","last","none",bc,tt]}],"grid-cols":[{"grid-cols":[yc]}],"col-start-end":[{col:["auto",{span:["full",bc,tt]},tt]}],"col-start":[{"col-start":J()}],"col-end":[{"col-end":J()}],"grid-rows":[{"grid-rows":[yc]}],"row-start-end":[{row:["auto",{span:[bc,tt]},tt]}],"row-start":[{"row-start":J()}],"row-end":[{"row-end":J()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",tt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",tt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...X()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...X(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...X(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[_]}],px:[{px:[_]}],py:[{py:[_]}],ps:[{ps:[_]}],pe:[{pe:[_]}],pt:[{pt:[_]}],pr:[{pr:[_]}],pb:[{pb:[_]}],pl:[{pl:[_]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[O]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[O]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",tt,t]}],"min-w":[{"min-w":["min","max","fit",tt,qr]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[wi]},wi,tt]}],h:[{h:[tt,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",qr,tt]}],"max-h":[{"max-h":[tt,t,"min","max","fit"]}],"font-size":[{text:["base",wi,xi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Kd]}],"font-family":[{font:[yc]}],"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",tt]}],"line-clamp":[{"line-clamp":["none",Ls,Kd]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",qr,tt]}],"list-image":[{"list-image":["none",tt]}],"list-style-type":[{list:["none","disc","decimal",tt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",qr,xi]}],"underline-offset":[{"underline-offset":["auto",qr,tt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:Y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",tt]}],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",tt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),DN]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",MN]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},AN]}],"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":[w]}],"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":[w]}],"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":[qr,tt]}],"outline-w":[{outline:[qr,xi]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[qr,xi]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",wi,IN]}],"shadow-color":[{shadow:[yc]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":q()}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",wi,tt]}],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":[w]}],"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",tt]}],duration:[{duration:te()}],ease:[{ease:["linear","in","out","in-out",tt]}],delay:[{delay:te()}],animate:[{animate:["none","spin","ping","pulse","bounce",tt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[bc,tt]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[D]}],"skew-y":[{"skew-y":[D]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",tt]}],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",tt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Y()}],"scroll-mx":[{"scroll-mx":Y()}],"scroll-my":[{"scroll-my":Y()}],"scroll-ms":[{"scroll-ms":Y()}],"scroll-me":[{"scroll-me":Y()}],"scroll-mt":[{"scroll-mt":Y()}],"scroll-mr":[{"scroll-mr":Y()}],"scroll-mb":[{"scroll-mb":Y()}],"scroll-ml":[{"scroll-ml":Y()}],"scroll-p":[{"scroll-p":Y()}],"scroll-px":[{"scroll-px":Y()}],"scroll-py":[{"scroll-py":Y()}],"scroll-ps":[{"scroll-ps":Y()}],"scroll-pe":[{"scroll-pe":Y()}],"scroll-pt":[{"scroll-pt":Y()}],"scroll-pr":[{"scroll-pr":Y()}],"scroll-pb":[{"scroll-pb":Y()}],"scroll-pl":[{"scroll-pl":Y()}],"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",tt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[qr,xi,Kd]}],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 zN=wN(FN);class jN extends Error{}jN.prototype.name="InvalidTokenError";function Se(...e){return zN(th(e))}async function el(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 jh(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 VN(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 ME(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(o,i)=>HN(i,t))}function HN(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 WN(e){return e.charAt(0).toUpperCase()+e.slice(1)}const BN="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";var UN={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const z1=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:()=>{(UN?"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},qN=e=>e?z1(e):z1;var yv={exports:{}},nm={},Xd={exports:{}},rm={};/**
|
|
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 j1;function GN(){return j1||(j1=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),D=1;D<R;D++)E[D-1]=arguments[D];r("error",C,E)}}function r(C,R,E){{var D=t.ReactDebugCurrentFrame,O=D.getStackAddendum();O!==""&&(R+="%s",E=E.concat([O]));var T=E.map(function(I){return String(I)});T.unshift("Warning: "+R),Function.prototype.apply.call(console[C],console,T)}}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 D=R();if(!h){var O=R();i(D,O)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}var T=s({inst:{value:D,getSnapshot:R}}),I=T[0].inst,N=T[1];return l(function(){I.value=D,I.getSnapshot=R,g(I)&&N({inst:I})},[C,D,R]),a(function(){g(I)&&N({inst:I});var W=function(){g(I)&&N({inst:I})};return C(W)},[C]),u(D),D}function g(C){var R=C.getSnapshot,E=C.value;try{var D=R();return!i(E,D)}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,w=x?b:p,_=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w;rm.useSyncExternalStore=_,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),rm}var om={};/**
|
|
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 V1;function YN(){if(V1)return om;V1=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 om.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,om}var H1;function DE(){return H1||(H1=1,process.env.NODE_ENV==="production"?Xd.exports=YN():Xd.exports=GN()),Xd.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 W1;function KN(){return W1||(W1=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=DE();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 w=a(function(){var E=!1,D,O,T=function(Y){if(!E){E=!0,D=Y;var ue=g(Y);if(b!==void 0&&x.hasValue){var J=x.value;if(b(J,ue))return O=J,J}return O=ue,ue}var F=D,Z=O;if(r(F,Y))return Z;var q=g(Y);return b!==void 0&&b(Z,q)?Z:(D=Y,O=q,q)},I=p===void 0?null:p,N=function(){return T(h())},W=I===null?void 0:function(){return T(I())};return[N,W]},[h,p,g,b]),_=w[0],C=w[1],R=o(d,_,C);return s(function(){x.hasValue=!0,x.value=R},[R]),l(R),R}nm.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),nm}var im={};/**
|
|
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 B1;function XN(){if(B1)return im;B1=1;var e=m,t=DE();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 im.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 w(D){if(!_){if(_=!0,C=D,D=p(D),g!==void 0&&y.hasValue){var O=y.value;if(g(O,D))return R=O}return R=D}if(O=R,r(C,D))return O;var T=p(D);return g!==void 0&&g(O,T)?O:(C=D,R=T)}var _=!1,C,R,E=h===void 0?null:h;return[function(){return w(d())},E===null?void 0:function(){return w(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},im}process.env.NODE_ENV==="production"?yv.exports=XN():yv.exports=KN();var QN=yv.exports;const ZN=zu(QN);var TE={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:JN}=m,{useSyncExternalStoreWithSelector:e6}=ZN;let U1=!1;function t6(e,t=e.getState,n){(TE?"production":void 0)!=="production"&&n&&!U1&&(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"),U1=!0);const r=e6(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return JN(r),r}const q1=e=>{(TE?"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"?qN(e):e,n=(r,o)=>t6(t,r,o);return Object.assign(n,t),n},AE=e=>e?q1(e):q1;var IE=Symbol.for("immer-nothing"),G1=Symbol.for("immer-draftable"),gr=Symbol.for("immer-state"),n6=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 qn(e,...t){if(process.env.NODE_ENV!=="production"){const n=n6[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 El=Object.getPrototypeOf;function Rl(e){return!!e&&!!e[gr]}function ra(e){var t;return e?kE(e)||Array.isArray(e)||!!e[G1]||!!((t=e.constructor)!=null&&t[G1])||Hh(e)||Wh(e):!1}var r6=Object.prototype.constructor.toString();function kE(e){if(!e||typeof e!="object")return!1;const t=El(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)===r6}function tu(e,t){Vh(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Vh(e){const t=e[gr];return t?t.type_:Array.isArray(e)?1:Hh(e)?2:Wh(e)?3:0}function xv(e,t){return Vh(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function NE(e,t,n){const r=Vh(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function o6(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Hh(e){return e instanceof Map}function Wh(e){return e instanceof Set}function Ds(e){return e.copy_||e.base_}function wv(e,t){if(Hh(e))return new Map(e);if(Wh(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&kE(e))return El(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[gr];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(El(e),n)}function Gb(e,t=!1){return Bh(e)||Rl(e)||!ra(e)||(Vh(e)>1&&(e.set=e.add=e.clear=e.delete=i6),Object.freeze(e),t&&tu(e,(n,r)=>Gb(r,!0))),e}function i6(){qn(2)}function Bh(e){return Object.isFrozen(e)}var s6={};function oa(e){const t=s6[e];return t||qn(0,e),t}var nu;function LE(){return nu}function a6(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Y1(e,t){t&&(oa("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function _v(e){Sv(e),e.drafts_.forEach(l6),e.drafts_=null}function Sv(e){e===nu&&(nu=e.parent_)}function K1(e){return nu=a6(nu,e)}function l6(e){const t=e[gr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function X1(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[gr].modified_&&(_v(t),qn(4)),ra(e)&&(e=nh(t,e),t.parent_||rh(t,e)),t.patches_&&oa("Patches").generateReplacementPatches_(n[gr].base_,e,t.patches_,t.inversePatches_)):e=nh(t,n,[]),_v(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==IE?e:void 0}function nh(e,t,n){if(Bh(t))return t;const r=t[gr];if(!r)return tu(t,(o,i)=>Q1(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return rh(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),tu(i,(a,l)=>Q1(e,r,o,a,l,n,s)),rh(e,o,!1),n&&e.patches_&&oa("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Q1(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&qn(5),Rl(o)){const a=i&&t&&t.type_!==3&&!xv(t.assigned_,r)?i.concat(r):void 0,l=nh(e,o,a);if(NE(n,r,l),Rl(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(ra(o)&&!Bh(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;nh(e,o),(!t||!t.scope_.parent_)&&rh(e,o)}}function rh(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Gb(t,n)}function c6(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:LE(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Yb;n&&(o=[r],i=ru);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var Yb={get(e,t){if(t===gr)return e;const n=Ds(e);if(!xv(n,t))return u6(e,n,t);const r=n[t];return e.finalized_||!ra(r)?r:r===sm(e.base_,t)?(am(e),e.copy_[t]=Ev(r,e)):r},has(e,t){return t in Ds(e)},ownKeys(e){return Reflect.ownKeys(Ds(e))},set(e,t,n){const r=FE(Ds(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=sm(Ds(e),t),i=o==null?void 0:o[gr];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(o6(n,o)&&(n!==void 0||xv(e.base_,t)))return!0;am(e),Cv(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 sm(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,am(e),Cv(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ds(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){qn(11)},getPrototypeOf(e){return El(e.base_)},setPrototypeOf(){qn(12)}},ru={};tu(Yb,(e,t)=>{ru[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ru.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&qn(13),ru.set.call(this,e,t,void 0)};ru.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&qn(14),Yb.set.call(this,e[0],t,n,e[0])};function sm(e,t){const n=e[gr];return(n?Ds(n):e)[t]}function u6(e,t,n){var o;const r=FE(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function FE(e,t){if(!(t in e))return;let n=El(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=El(n)}}function Cv(e){e.modified_||(e.modified_=!0,e.parent_&&Cv(e.parent_))}function am(e){e.copy_||(e.copy_=wv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var d6=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"&&qn(6),r!==void 0&&typeof r!="function"&&qn(7);let o;if(ra(t)){const i=K1(this),s=Ev(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?_v(i):Sv(i)}return Y1(i,r),X1(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===IE&&(o=void 0),this.autoFreeze_&&Gb(o,!0),r){const i=[],s=[];oa("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else qn(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){ra(e)||qn(8),Rl(e)&&(e=f6(e));const t=K1(this),n=Ev(e,void 0);return n[gr].isManual_=!0,Sv(t),n}finishDraft(e,t){const n=e&&e[gr];(!n||!n.isManual_)&&qn(9);const{scope_:r}=n;return Y1(r,t),X1(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=oa("Patches").applyPatches_;return Rl(e)?r(e,t):this.produce(e,o=>r(o,t))}};function Ev(e,t){const n=Hh(e)?oa("MapSet").proxyMap_(e,t):Wh(e)?oa("MapSet").proxySet_(e,t):c6(e,t);return(t?t.scope_:LE()).drafts_.push(n),n}function f6(e){return Rl(e)||qn(10,e),zE(e)}function zE(e){if(!ra(e)||Bh(e))return e;const t=e[gr];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=wv(e,t.scope_.immer_.useStrictShallowCopy_)}else n=wv(e,!0);return tu(n,(r,o)=>{NE(n,r,zE(o))}),t&&(t.finalized_=!1),n}var mr=new d6,h6=mr.produce;mr.produceWithPatches.bind(mr);mr.setAutoFreeze.bind(mr);mr.setUseStrictShallowCopy.bind(mr);mr.applyPatches.bind(mr);mr.createDraft.bind(mr);mr.finishDraft.bind(mr);const p6=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?h6(o):o;return t(a,i,...s)},e(r.setState,n,r)),jE=p6;var Rv,Qd=Co;if(process.env.NODE_ENV==="production")Rv=Qd.createRoot,Qd.hydrateRoot;else{var Z1=Qd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Rv=function(e,t){Z1.usingClientEntryPoint=!0;try{return Qd.createRoot(e,t)}finally{Z1.usingClientEntryPoint=!1}}}var VE={},HE={},Kb={exports:{}},At=String,WE=function(){return{isColorSupported:!1,reset:At,bold:At,dim:At,italic:At,underline:At,inverse:At,hidden:At,strikethrough:At,black:At,red:At,green:At,yellow:At,blue:At,magenta:At,cyan:At,white:At,gray:At,bgBlack:At,bgRed:At,bgGreen:At,bgYellow:At,bgBlue:At,bgMagenta:At,bgCyan:At,bgWhite:At}};Kb.exports=WE();Kb.exports.createColors=WE;var g6=Kb.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(g6);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])}}})(HE);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(HE);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}}})(VE);let lm=VE;var m6=(lm.__esModule?lm:{default:lm}).default;const Ot=zu(m6),BE=`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
|
+
`,$v={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[Ot.blue[500],Ot.teal[500],Ot.amber[500],Ot.red[500],Ot.indigo[500],Ot.green[500]],borderColor:[Ot.blue[500],Ot.teal[500],Ot.amber[500],Ot.red[500],Ot.indigo[500],Ot.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:J1},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:[Ot.blue[500],Ot.teal[500],Ot.amber[500],Ot.red[500],Ot.indigo[500],Ot.green[500]],borderColor:[Ot.blue[500],Ot.teal[500],Ot.amber[500],Ot.red[500],Ot.indigo[500],Ot.green[500]],datalables:{color:J1}},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:Ot.slate[800]}},y:{grid:{display:!0,color:Ot.slate[800]}}}}}}};function J1(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=oh()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=oh()),ih(n)}function oh(){return Ee.getState().theme==="dark"?"#000000":"#FFFFFF"}function ih(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 ju=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(){}},$l=typeof window>"u"||"Deno"in window;function Ar(){}function v6(e,t){return typeof e=="function"?e(t):e}function Pv(e){return typeof e=="number"&&e>=0&&e!==1/0}function UE(e,t){return Math.max(e+(t||0)-Date.now(),0)}function e_(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Xb(s,t.options))return!1}else if(!iu(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 t_(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ou(t.options.mutationKey)!==ou(i))return!1}else if(!iu(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Xb(e,t){return((t==null?void 0:t.queryKeyHashFn)||ou)(e)}function ou(e){return JSON.stringify(e,(t,n)=>Mv(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function iu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!iu(e[n],t[n])):!1}function qE(e,t){if(e===t)return e;const n=n_(e)&&n_(t);if(n||Mv(e)&&Mv(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]=qE(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function Ov(e,t){if(e&&!t||t&&!e)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function n_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Mv(e){if(!r_(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!r_(n)||!n.hasOwnProperty("isPrototypeOf"))}function r_(e){return Object.prototype.toString.call(e)==="[object Object]"}function b6(e){return new Promise(t=>{setTimeout(t,e)})}function Dv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?qE(e,t):t}function y6(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function x6(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Hs,Oi,ul,pE,w6=(pE=class extends ju{constructor(){super();Ne(this,Hs,void 0);Ne(this,Oi,void 0);Ne(this,ul,void 0);Me(this,ul,t=>{if(!$l&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){U(this,Oi)||this.setEventListener(U(this,ul))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,Oi))==null||t.call(this),Me(this,Oi,void 0))}setEventListener(t){var n;Me(this,ul,t),(n=U(this,Oi))==null||n.call(this),Me(this,Oi,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){U(this,Hs)!==t&&(Me(this,Hs,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof U(this,Hs)=="boolean"?U(this,Hs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Hs=new WeakMap,Oi=new WeakMap,ul=new WeakMap,pE),sh=new w6,dl,Mi,fl,gE,_6=(gE=class extends ju{constructor(){super();Ne(this,dl,!0);Ne(this,Mi,void 0);Ne(this,fl,void 0);Me(this,fl,t=>{if(!$l&&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(){U(this,Mi)||this.setEventListener(U(this,fl))}onUnsubscribe(){var t;this.hasListeners()||((t=U(this,Mi))==null||t.call(this),Me(this,Mi,void 0))}setEventListener(t){var n;Me(this,fl,t),(n=U(this,Mi))==null||n.call(this),Me(this,Mi,t(this.setOnline.bind(this)))}setOnline(t){U(this,dl)!==t&&(Me(this,dl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return U(this,dl)}},dl=new WeakMap,Mi=new WeakMap,fl=new WeakMap,gE),ah=new _6;function S6(e){return Math.min(1e3*2**e,3e4)}function Uh(e){return(e??"online")==="online"?ah.isOnline():!0}var GE=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function cm(e){return e instanceof GE}function YE(e){let t=!1,n=0,r=!1,o,i,s;const a=new Promise((x,w)=>{i=x,s=w}),l=x=>{var w;r||(g(new GE(x)),(w=e.abort)==null||w.call(e))},u=()=>{t=!0},d=()=>{t=!1},h=()=>!sh.isFocused()||e.networkMode!=="always"&&!ah.isOnline(),p=x=>{var w;r||(r=!0,(w=e.onSuccess)==null||w.call(e,x),o==null||o(),i(x))},g=x=>{var w;r||(r=!0,(w=e.onError)==null||w.call(e,x),o==null||o(),s(x))},b=()=>new Promise(x=>{var w;o=_=>{const C=r||!h();return C&&x(_),C},(w=e.onPause)==null||w.call(e)}).then(()=>{var x;o=void 0,r||(x=e.onContinue)==null||x.call(e)}),y=()=>{if(r)return;let x;try{x=e.fn()}catch(w){x=Promise.reject(w)}Promise.resolve(x).then(p).catch(w=>{var D;if(r)return;const _=e.retry??($l?0:3),C=e.retryDelay??S6,R=typeof C=="function"?C(n,w):C,E=_===!0||typeof _=="number"&&n<_||typeof _=="function"&&_(n,w);if(t||!E){g(w);return}n++,(D=e.onFail)==null||D.call(e,n,w),b6(R).then(()=>{if(h())return b()}).then(()=>{t?g(w):y()})})};return Uh(e.networkMode)?y():b().then(y),{promise:a,cancel:l,continue:()=>(o==null?void 0:o())?a:Promise.resolve(),cancelRetry:u,continueRetry:d}}function C6(){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 bn=C6(),Ws,mE,KE=(mE=class{constructor(){Ne(this,Ws,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Pv(this.gcTime)&&Me(this,Ws,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??($l?1/0:5*60*1e3))}clearGcTimeout(){U(this,Ws)&&(clearTimeout(U(this,Ws)),Me(this,Ws,void 0))}},Ws=new WeakMap,mE),hl,pl,Mr,Di,Dr,un,$u,Bs,gl,Wf,Yr,qo,vE,E6=(vE=class extends KE{constructor(t){super();Ne(this,gl);Ne(this,Yr);Ne(this,hl,void 0);Ne(this,pl,void 0);Ne(this,Mr,void 0);Ne(this,Di,void 0);Ne(this,Dr,void 0);Ne(this,un,void 0);Ne(this,$u,void 0);Ne(this,Bs,void 0);Me(this,Bs,!1),Me(this,$u,t.defaultOptions),ot(this,gl,Wf).call(this,t.options),Me(this,un,[]),Me(this,Mr,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Me(this,hl,t.state||R6(this.options)),this.state=U(this,hl),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!U(this,un).length&&this.state.fetchStatus==="idle"&&U(this,Mr).remove(this)}setData(t,n){const r=Dv(this.state.data,t,this.options);return ot(this,Yr,qo).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ot(this,Yr,qo).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r;const n=U(this,Di);return(r=U(this,Dr))==null||r.cancel(t),n?n.then(Ar).catch(Ar):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(U(this,hl))}isActive(){return U(this,un).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||U(this,un).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!UE(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=U(this,un).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,Dr))==null||n.continue()}onOnline(){var n;const t=U(this,un).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=U(this,Dr))==null||n.continue()}addObserver(t){U(this,un).includes(t)||(U(this,un).push(t),this.clearGcTimeout(),U(this,Mr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){U(this,un).includes(t)&&(Me(this,un,U(this,un).filter(n=>n!==t)),U(this,un).length||(U(this,Dr)&&(U(this,Bs)?U(this,Dr).cancel({revert:!0}):U(this,Dr).cancelRetry()),this.scheduleGc()),U(this,Mr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return U(this,un).length}invalidate(){this.state.isInvalidated||ot(this,Yr,qo).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(U(this,Di))return(u=U(this,Dr))==null||u.continueRetry(),U(this,Di)}if(t&&ot(this,gl,Wf).call(this,t),!this.options.queryFn){const g=U(this,un).find(b=>b.options.queryFn);g&&ot(this,gl,Wf).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:()=>(Me(this,Bs,!0),r.signal)})};i(o);const s=()=>this.options.queryFn?(Me(this,Bs,!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),Me(this,pl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=a.fetchOptions)==null?void 0:h.meta))&&ot(this,Yr,qo).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=g=>{var b,y,x,w;cm(g)&&g.silent||ot(this,Yr,qo).call(this,{type:"error",error:g}),cm(g)||((y=(b=U(this,Mr).config).onError)==null||y.call(b,g,this),(w=(x=U(this,Mr).config).onSettled)==null||w.call(x,this.state.data,g,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return Me(this,Dr,YE({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:g=>{var b,y,x,w;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=U(this,Mr).config).onSuccess)==null||y.call(b,g,this),(w=(x=U(this,Mr).config).onSettled)==null||w.call(x,g,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(g,b)=>{ot(this,Yr,qo).call(this,{type:"failed",failureCount:g,error:b})},onPause:()=>{ot(this,Yr,qo).call(this,{type:"pause"})},onContinue:()=>{ot(this,Yr,qo).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),Me(this,Di,U(this,Dr).promise),U(this,Di)}},hl=new WeakMap,pl=new WeakMap,Mr=new WeakMap,Di=new WeakMap,Dr=new WeakMap,un=new WeakMap,$u=new WeakMap,Bs=new WeakMap,gl=new WeakSet,Wf=function(t){this.options={...U(this,$u),...t},this.updateGcTime(this.options.gcTime)},Yr=new WeakSet,qo=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:Uh(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 cm(o)&&o.revert&&U(this,pl)?{...U(this,pl),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),bn.batch(()=>{U(this,un).forEach(r=>{r.onQueryUpdate()}),U(this,Mr).notify({query:this,type:"updated",action:t})})},vE);function R6(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 uo,bE,$6=(bE=class extends ju{constructor(t={}){super();Ne(this,uo,void 0);this.config=t,Me(this,uo,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Xb(o,n);let s=this.get(i);return s||(s=new E6({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){U(this,uo).has(t.queryHash)||(U(this,uo).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=U(this,uo).get(t.queryHash);n&&(t.destroy(),n===t&&U(this,uo).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){bn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return U(this,uo).get(t)}getAll(){return[...U(this,uo).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>e_(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>e_(t,r)):n}notify(t){bn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){bn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){bn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},uo=new WeakMap,bE),fo,Pu,sr,ml,ho,$i,yE,P6=(yE=class extends KE{constructor(t){super();Ne(this,ho);Ne(this,fo,void 0);Ne(this,Pu,void 0);Ne(this,sr,void 0);Ne(this,ml,void 0);this.mutationId=t.mutationId,Me(this,Pu,t.defaultOptions),Me(this,sr,t.mutationCache),Me(this,fo,[]),this.state=t.state||O6(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...U(this,Pu),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){U(this,fo).includes(t)||(U(this,fo).push(t),this.clearGcTimeout(),U(this,sr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Me(this,fo,U(this,fo).filter(n=>n!==t)),this.scheduleGc(),U(this,sr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){U(this,fo).length||(this.state.status==="pending"?this.scheduleGc():U(this,sr).remove(this))}continue(){var t;return((t=U(this,ml))==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,D,O;const n=()=>(Me(this,ml,YE({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,I)=>{ot(this,ho,$i).call(this,{type:"failed",failureCount:T,error:I})},onPause:()=>{ot(this,ho,$i).call(this,{type:"pause"})},onContinue:()=>{ot(this,ho,$i).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),U(this,ml).promise),r=this.state.status==="pending";try{if(!r){ot(this,ho,$i).call(this,{type:"pending",variables:t}),await((i=(o=U(this,sr).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&&ot(this,ho,$i).call(this,{type:"pending",context:I,variables:t})}const T=await n();return await((u=(l=U(this,sr).config).onSuccess)==null?void 0:u.call(l,T,t,this.state.context,this)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,T,t,this.state.context)),await((g=(p=U(this,sr).config).onSettled)==null?void 0:g.call(p,T,null,this.state.variables,this.state.context,this)),await((y=(b=this.options).onSettled)==null?void 0:y.call(b,T,null,t,this.state.context)),ot(this,ho,$i).call(this,{type:"success",data:T}),T}catch(T){try{throw await((w=(x=U(this,sr).config).onError)==null?void 0:w.call(x,T,t,this.state.context,this)),await((C=(_=this.options).onError)==null?void 0:C.call(_,T,t,this.state.context)),await((E=(R=U(this,sr).config).onSettled)==null?void 0:E.call(R,void 0,T,this.state.variables,this.state.context,this)),await((O=(D=this.options).onSettled)==null?void 0:O.call(D,void 0,T,t,this.state.context)),T}finally{ot(this,ho,$i).call(this,{type:"error",error:T})}}}},fo=new WeakMap,Pu=new WeakMap,sr=new WeakMap,ml=new WeakMap,ho=new WeakSet,$i=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:!Uh(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),bn.batch(()=>{U(this,fo).forEach(r=>{r.onMutationUpdate(t)}),U(this,sr).notify({mutation:this,type:"updated",action:t})})},yE);function O6(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Tr,Ou,Us,xE,M6=(xE=class extends ju{constructor(t={}){super();Ne(this,Tr,void 0);Ne(this,Ou,void 0);Ne(this,Us,void 0);this.config=t,Me(this,Tr,[]),Me(this,Ou,0)}build(t,n,r){const o=new P6({mutationCache:this,mutationId:++Yd(this,Ou)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){U(this,Tr).push(t),this.notify({type:"added",mutation:t})}remove(t){Me(this,Tr,U(this,Tr).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){bn.batch(()=>{U(this,Tr).forEach(t=>{this.remove(t)})})}getAll(){return U(this,Tr)}find(t){const n={exact:!0,...t};return U(this,Tr).find(r=>t_(n,r))}findAll(t={}){return U(this,Tr).filter(n=>t_(t,n))}notify(t){bn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return Me(this,Us,(U(this,Us)??Promise.resolve()).then(()=>{const t=U(this,Tr).filter(n=>n.state.isPaused);return bn.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Ar)),Promise.resolve()))}).then(()=>{Me(this,Us,void 0)})),U(this,Us)}},Tr=new WeakMap,Ou=new WeakMap,Us=new WeakMap,xE);function D6(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=((w=t.state.data)==null?void 0:w.pages)||[],a=((_=t.state.data)==null?void 0:_.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 D={queryKey:t.queryKey,pageParam:R,direction:E?"backward":"forward",meta:t.options.meta};d(D);const O=await h(D),{maxPages:T}=t.options,I=E?x6:y6;return{pages:I(C.pages,O,T),pageParams:I(C.pageParams,R,T)}};let g;if(i&&s.length){const C=i==="backward",R=C?T6:o_,E={pages:s,pageParams:a},D=R(o,E);g=await p(E,D,C)}else{g=await p(l,a[0]??o.initialPageParam);const C=e??s.length;for(let R=1;R<C;R++){const E=o_(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 o_(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function T6(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var rn,Ti,Ai,vl,bl,Ii,yl,xl,wE,A6=(wE=class{constructor(e={}){Ne(this,rn,void 0);Ne(this,Ti,void 0);Ne(this,Ai,void 0);Ne(this,vl,void 0);Ne(this,bl,void 0);Ne(this,Ii,void 0);Ne(this,yl,void 0);Ne(this,xl,void 0);Me(this,rn,e.queryCache||new $6),Me(this,Ti,e.mutationCache||new M6),Me(this,Ai,e.defaultOptions||{}),Me(this,vl,new Map),Me(this,bl,new Map),Me(this,Ii,0)}mount(){Yd(this,Ii)._++,U(this,Ii)===1&&(Me(this,yl,sh.subscribe(()=>{sh.isFocused()&&(this.resumePausedMutations(),U(this,rn).onFocus())})),Me(this,xl,ah.subscribe(()=>{ah.isOnline()&&(this.resumePausedMutations(),U(this,rn).onOnline())})))}unmount(){var e,t;Yd(this,Ii)._--,U(this,Ii)===0&&((e=U(this,yl))==null||e.call(this),Me(this,yl,void 0),(t=U(this,xl))==null||t.call(this),Me(this,xl,void 0))}isFetching(e){return U(this,rn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return U(this,Ti).findAll({...e,status:"pending"}).length}getQueryData(e){var t;return(t=U(this,rn).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=U(this,rn).find({queryKey:e}),o=r==null?void 0:r.state.data,i=v6(t,o);if(typeof i>"u")return;const s=this.defaultQueryOptions({queryKey:e});return U(this,rn).build(this,s).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return bn.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var t;return(t=U(this,rn).find({queryKey:e}))==null?void 0:t.state}removeQueries(e){const t=U(this,rn);bn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=U(this,rn),r={type:"active",...e};return bn.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=bn.batch(()=>U(this,rn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ar).catch(Ar)}invalidateQueries(e={},t={}){return bn.batch(()=>{if(U(this,rn).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=bn.batch(()=>U(this,rn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ar)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ar)}fetchQuery(e){const t=this.defaultQueryOptions(e);typeof t.retry>"u"&&(t.retry=!1);const n=U(this,rn).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ar).catch(Ar)}fetchInfiniteQuery(e){return e.behavior=D6(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ar).catch(Ar)}resumePausedMutations(){return U(this,Ti).resumePausedMutations()}getQueryCache(){return U(this,rn)}getMutationCache(){return U(this,Ti)}getDefaultOptions(){return U(this,Ai)}setDefaultOptions(e){Me(this,Ai,e)}setQueryDefaults(e,t){U(this,vl).set(ou(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...U(this,vl).values()];let n={};return t.forEach(r=>{iu(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){U(this,bl).set(ou(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...U(this,bl).values()];let n={};return t.forEach(r=>{iu(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const t={...U(this,Ai).queries,...(e==null?void 0:e.queryKey)&&this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Xb(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:{...U(this,Ai).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){U(this,rn).clear(),U(this,Ti).clear()}},rn=new WeakMap,Ti=new WeakMap,Ai=new WeakMap,vl=new WeakMap,bl=new WeakMap,Ii=new WeakMap,yl=new WeakMap,xl=new WeakMap,wE),Un,It,Mu,kn,qs,wl,po,Du,_l,Sl,Gs,Ys,ki,Cl,Ks,Ac,Tu,Tv,Au,Av,Iu,Iv,ku,kv,Nu,Nv,Lu,Lv,Fu,Fv,zh,XE,_E,I6=(_E=class extends ju{constructor(t,n){super();Ne(this,Ks);Ne(this,Tu);Ne(this,Au);Ne(this,Iu);Ne(this,ku);Ne(this,Nu);Ne(this,Lu);Ne(this,Fu);Ne(this,zh);Ne(this,Un,void 0);Ne(this,It,void 0);Ne(this,Mu,void 0);Ne(this,kn,void 0);Ne(this,qs,void 0);Ne(this,wl,void 0);Ne(this,po,void 0);Ne(this,Du,void 0);Ne(this,_l,void 0);Ne(this,Sl,void 0);Ne(this,Gs,void 0);Ne(this,Ys,void 0);Ne(this,ki,void 0);Ne(this,Cl,new Set);this.options=n,Me(this,Un,t),Me(this,po,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(U(this,It).addObserver(this),i_(U(this,It),this.options)?ot(this,Ks,Ac).call(this):this.updateResult(),ot(this,ku,kv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return zv(U(this,It),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return zv(U(this,It),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ot(this,Nu,Nv).call(this),ot(this,Lu,Lv).call(this),U(this,It).removeObserver(this)}setOptions(t,n){const r=this.options,o=U(this,It);if(this.options=U(this,Un).defaultQueryOptions(t),Ov(r,this.options)||U(this,Un).getQueryCache().notify({type:"observerOptionsUpdated",query:U(this,It),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),ot(this,Fu,Fv).call(this);const i=this.hasListeners();i&&s_(U(this,It),o,this.options,r)&&ot(this,Ks,Ac).call(this),this.updateResult(n),i&&(U(this,It)!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&ot(this,Tu,Tv).call(this);const s=ot(this,Au,Av).call(this);i&&(U(this,It)!==o||this.options.enabled!==r.enabled||s!==U(this,ki))&&ot(this,Iu,Iv).call(this,s)}getOptimisticResult(t){const n=U(this,Un).getQueryCache().build(U(this,Un),t),r=this.createResult(n,t);return N6(this,r)&&(Me(this,kn,r),Me(this,wl,this.options),Me(this,qs,U(this,It).state)),r}getCurrentResult(){return U(this,kn)}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(U(this,Cl).add(r),t[r])})}),n}getCurrentQuery(){return U(this,It)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=U(this,Un).defaultQueryOptions(t),r=U(this,Un).getQueryCache().build(U(this,Un),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ot(this,Ks,Ac).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),U(this,kn)))}createResult(t,n){var D;const r=U(this,It),o=this.options,i=U(this,kn),s=U(this,qs),a=U(this,wl),u=t!==r?t.state:U(this,Mu),{state:d}=t;let{error:h,errorUpdatedAt:p,fetchStatus:g,status:b}=d,y=!1,x;if(n._optimisticResults){const O=this.hasListeners(),T=!O&&i_(t,n),I=O&&s_(t,r,n,o);(T||I)&&(g=Uh(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===U(this,Du))x=U(this,_l);else try{Me(this,Du,n.select),x=n.select(d.data),x=Dv(i==null?void 0:i.data,x,n),Me(this,_l,x),Me(this,po,null)}catch(O){Me(this,po,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((D=U(this,Sl))==null?void 0:D.state.data,U(this,Sl)):n.placeholderData,n.select&&typeof O<"u")try{O=n.select(O),Me(this,po,null)}catch(T){Me(this,po,T)}typeof O<"u"&&(b="success",x=Dv(i==null?void 0:i.data,O,n),y=!0)}U(this,po)&&(h=U(this,po),x=U(this,_l),p=Date.now(),b="error");const w=g==="fetching",_=b==="pending",C=b==="error",R=_&&w;return{status:b,fetchStatus:g,isPending:_,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:w,isRefetching:w&&!_,isLoadingError:C&&d.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:y,isRefetchError:C&&d.dataUpdatedAt!==0,isStale:Qb(t,n),refetch:this.refetch}}updateResult(t){const n=U(this,kn),r=this.createResult(U(this,It),this.options);if(Me(this,qs,U(this,It).state),Me(this,wl,this.options),U(this,qs).data!==void 0&&Me(this,Sl,U(this,It)),Ov(r,n))return;Me(this,kn,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!U(this,Cl).size)return!0;const l=new Set(a??U(this,Cl));return this.options.throwOnError&&l.add("error"),Object.keys(U(this,kn)).some(u=>{const d=u;return U(this,kn)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),ot(this,zh,XE).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ot(this,ku,kv).call(this)}},Un=new WeakMap,It=new WeakMap,Mu=new WeakMap,kn=new WeakMap,qs=new WeakMap,wl=new WeakMap,po=new WeakMap,Du=new WeakMap,_l=new WeakMap,Sl=new WeakMap,Gs=new WeakMap,Ys=new WeakMap,ki=new WeakMap,Cl=new WeakMap,Ks=new WeakSet,Ac=function(t){ot(this,Fu,Fv).call(this);let n=U(this,It).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ar)),n},Tu=new WeakSet,Tv=function(){if(ot(this,Nu,Nv).call(this),$l||U(this,kn).isStale||!Pv(this.options.staleTime))return;const n=UE(U(this,kn).dataUpdatedAt,this.options.staleTime)+1;Me(this,Gs,setTimeout(()=>{U(this,kn).isStale||this.updateResult()},n))},Au=new WeakSet,Av=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(U(this,It)):this.options.refetchInterval)??!1},Iu=new WeakSet,Iv=function(t){ot(this,Lu,Lv).call(this),Me(this,ki,t),!($l||this.options.enabled===!1||!Pv(U(this,ki))||U(this,ki)===0)&&Me(this,Ys,setInterval(()=>{(this.options.refetchIntervalInBackground||sh.isFocused())&&ot(this,Ks,Ac).call(this)},U(this,ki)))},ku=new WeakSet,kv=function(){ot(this,Tu,Tv).call(this),ot(this,Iu,Iv).call(this,ot(this,Au,Av).call(this))},Nu=new WeakSet,Nv=function(){U(this,Gs)&&(clearTimeout(U(this,Gs)),Me(this,Gs,void 0))},Lu=new WeakSet,Lv=function(){U(this,Ys)&&(clearInterval(U(this,Ys)),Me(this,Ys,void 0))},Fu=new WeakSet,Fv=function(){const t=U(this,Un).getQueryCache().build(U(this,Un),this.options);if(t===U(this,It))return;const n=U(this,It);Me(this,It,t),Me(this,Mu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},zh=new WeakSet,XE=function(t){bn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(U(this,kn))}),U(this,Un).getQueryCache().notify({query:U(this,It),type:"observerResultsUpdated"})})},_E);function k6(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function i_(e,t){return k6(e,t)||e.state.dataUpdatedAt>0&&zv(e,t,t.refetchOnMount)}function zv(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Qb(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")&&Qb(e,n)}function Qb(e,t){return e.isStaleByTime(t.staleTime)}function N6(e,t){return!Ov(e.getCurrentResult(),t)}var QE=ae.createContext(void 0),L6=e=>{const t=ae.useContext(QE);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},F6=({client:e,children:t})=>(ae.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),ae.createElement(QE.Provider,{value:e},t)),ZE=ae.createContext(!1),z6=()=>ae.useContext(ZE);ZE.Provider;function j6(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var V6=ae.createContext(j6()),H6=()=>ae.useContext(V6);function W6(e,t){return typeof e=="function"?e(...t):!!e}var B6=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},U6=e=>{ae.useEffect(()=>{e.clearReset()},[e])},q6=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&W6(n,[e.error,r]),G6=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},Y6=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,K6=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function X6(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=L6(n),o=z6(),i=H6(),s=r.defaultQueryOptions(e);s._optimisticResults=o?"isRestoring":"optimistic",G6(s),B6(s,i),U6(i);const[a]=ae.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(ae.useSyncExternalStore(ae.useCallback(u=>{const d=o?()=>{}:a.subscribe(bn.batchCalls(u));return a.updateResult(),d},[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),ae.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),Y6(s,l))throw K6(s,a,i);if(q6({result:l,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function go(e,t){return X6(e,I6,t)}let Zd;const Q6=new Uint8Array(16);function Z6(){if(!Zd&&(Zd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Zd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Zd(Q6)}const vn=[];for(let e=0;e<256;++e)vn.push((e+256).toString(16).slice(1));function J6(e,t=0){return vn[e[t+0]]+vn[e[t+1]]+vn[e[t+2]]+vn[e[t+3]]+"-"+vn[e[t+4]]+vn[e[t+5]]+"-"+vn[e[t+6]]+vn[e[t+7]]+"-"+vn[e[t+8]]+vn[e[t+9]]+"-"+vn[e[t+10]]+vn[e[t+11]]+vn[e[t+12]]+vn[e[t+13]]+vn[e[t+14]]+vn[e[t+15]]}const e9=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),a_={randomUUID:e9};function su(e,t,n){if(a_.randomUUID&&!t&&!e)return a_.randomUUID();e=e||{};const r=e.random||(e.rng||Z6)();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 J6(r)}const qt=AE()(jE((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:su(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:su(),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})}}}))),t9=()=>qt(e=>e.actions);function JE({children:e}){const t=new A6;return k.jsx(F6,{client:t,children:e})}const n9={id:"",authToken:void 0},eR=m.createContext(n9),tR=({children:e,dashboardProps:t})=>k.jsx(JE,{children:k.jsx(eR.Provider,{value:t,children:e})});function ha(){const e=m.useContext(eR);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function r9(e,t){var Q,Oe,Ie,ze;let n=m.useMemo(()=>[],[]);const r=ha().authToken||e,o=qt(_e=>_e.selectedConnectionId),i=qt(_e=>_e.selectedDatabaseName),s=qt(_e=>_e.selectedSchemaName),a=qt(_e=>_e.selectedTableName),l=qt(_e=>_e.actions.setCurrentColumns),u=qt(_e=>_e.actions.setSelectedConnectionId),d=qt(_e=>_e.actions.setSelectedDatabaseName),h=qt(_e=>_e.actions.setSelectedSchemaName),p=qt(_e=>_e.actions.setSelectedTableName),g=qt(_e=>_e.actions.setCardSql),{data:b,isLoading:y,isError:x}=go({queryKey:["connections"],queryFn:()=>el("https://semaphor.cloud/api/v1/connections",(r==null?void 0:r.accessToken)||""),enabled:!!(r!=null&&r.accessToken)}),w=b==null?void 0:b.connections.find(_e=>_e.id===o),_=w==null?void 0:w.type,C=(w==null?void 0:w.type)==="API"||(w==null?void 0:w.type)==="S3",{data:R,isLoading:E,isFetching:D,isError:O,refetch:T}=go({queryKey:["databases",o],queryFn:()=>el("https://semaphor.cloud/api/v1/databases",(r==null?void 0:r.accessToken)||"",{connection_id:o}),enabled:!!o&&!C}),{data:I,isLoading:N,isFetching:W,isError:Y,refetch:ue}=go({queryKey:["schemas",o,i],queryFn:()=>el("https://semaphor.cloud/api/v1/schemas",(r==null?void 0:r.accessToken)||"",{connection_id:o,database_name:i}),enabled:!!o&&!!i&&!C}),{data:J,isLoading:F,isFetching:Z,isError:q,refetch:X}=go({queryKey:["tables",o,i,s],queryFn:()=>el("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&&_!=="API"}),{data:ie,isLoading:j,isFetching:V,isError:te}=go({queryKey:["columns",o,i,s,a],queryFn:()=>el("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||C});m.useEffect(()=>{l(n)},[ie,l,n]),m.useEffect(()=>{var _e;C&&(d("NA"),h("NA"),p((_e=w==null?void 0:w.type)==null?void 0:_e.toLowerCase()))},[C,g,p,h,d,w]);const le=C?(Q=w==null?void 0:w.type)==null?void 0:Q.toLowerCase():a||"",ce=C?"":s||"";function ge(_e){h(_e),p("")}function ve(_e){d(_e),h(""),p("")}function de(_e){u(_e)}R&&((Oe=R==null?void 0:R.databases)==null?void 0:Oe.length)>0,I&&((Ie=I==null?void 0:I.schemas)==null?void 0:Ie.length)>0,ie&&((ze=ie==null?void 0:ie.columns)==null?void 0:ze.length)>0&&(n=ie.columns.map(_e=>({..._e,data_type:_e.data_type.toLowerCase()}))),O&&(n=[]),(te||x)&&(n=[]);const ee=b==null?void 0:b.connections.map(_e=>({id:_e.id,name:_e.name,type:_e.type})),K=R==null?void 0:R.databases.map(_e=>({id:_e.database_name,name:_e.database_name})),re=I==null?void 0:I.schemas.map(_e=>({id:_e.schema_name,name:_e.schema_name})),be=J==null?void 0:J.tables.map(_e=>({id:_e.table_name,name:_e.table_name}));return{connectionItems:ee,isConnectionsLoading:y,isConnectionsError:x,databaseItems:K,isDatabasesLoadingOrFetching:E||D,isDatabaseError:O,schemaItems:re,isSchemaLoadingOrFetching:N||W,isSchemaError:Y,tableItems:be,isTableLoadingOrFetching:F||Z,isTableError:q,columns:n,isColumnsLoadingOrFetching:j||V,isColumnsError:te,isNonDbConnection:C,connectionType:_,tableName:le,schemaName:ce,handleConnectionChange:de,handleDatabaseChange:ve,handleSchemaChange:ge}}const o9=e=>{const t=new Date(e);return!isNaN(t.getTime())},i9=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),au=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?o9(e)?t="date":i9(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function s9({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:au(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 lh={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
|
+
*/lh.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,w=2,_=4,C=8,R=16,E=32,D=64,O=128,T=256,I=512,N=30,W="...",Y=800,ue=16,J=1,F=2,Z=3,q=1/0,X=9007199254740991,ie=17976931348623157e292,j=NaN,V=4294967295,te=V-1,le=V>>>1,ce=[["ary",O],["bind",x],["bindKey",w],["curry",C],["curryRight",R],["flip",I],["partial",E],["partialRight",D],["rearg",T]],ge="[object Arguments]",ve="[object Array]",de="[object AsyncFunction]",ee="[object Boolean]",K="[object Date]",re="[object DOMException]",be="[object Error]",Q="[object Function]",Oe="[object GeneratorFunction]",Ie="[object Map]",ze="[object Number]",_e="[object Null]",pt="[object Object]",dt="[object Promise]",ft="[object Proxy]",Bt="[object RegExp]",Vt="[object Set]",wn="[object String]",en="[object Symbol]",Yl="[object Undefined]",jr="[object WeakMap]",Ji="[object WeakSet]",hn="[object ArrayBuffer]",no="[object DataView]",Mo="[object Float32Array]",Do="[object Float64Array]",Vr="[object Int8Array]",es="[object Int16Array]",ts="[object Int32Array]",ns="[object Uint8Array]",rs="[object Uint8ClampedArray]",os="[object Uint16Array]",is="[object Uint32Array]",Kl=/\b__p \+= '';/g,To=/\b(__p \+=) '' \+/g,ss=/(__e\(.*?\)|\b__t\)) \+\n'';/g,_n=/&(?:amp|lt|gt|quot|#39);/g,ro=/[&<>"']/g,Ao=RegExp(_n.source),as=RegExp(ro.source),Xl=/<%-([\s\S]+?)%>/g,ls=/<%([\s\S]+?)%>/g,Ea=/<%=([\s\S]+?)%>/g,cs=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,us=/^\w*$/,Ql=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ds=/[\\^$.*+?()[\]{}|]/g,fs=RegExp(ds.source),hs=/^\s+/,Zl=/\s/,Jl=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ec=/\{\n\/\* \[wrapped with (.+)\] \*/,$=/,? & /,H=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,oe=/[()=,{}\[\]\/\s]/,xe=/\\(\\)?/g,Te=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ke=/\w*$/,Pe=/^[-+]0x[0-9a-f]+$/i,Re=/^0b[01]+$/i,gt=/^\[object .+?Constructor\]$/,Be=/^0o[0-7]+$/i,Ge=/^(?:0|[1-9]\d*)$/,Rt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ln=/($^)/,ps=/['\n\r\u2028\u2029\\]/g,zt="\\ud800-\\udfff",XD="\\u0300-\\u036f",QD="\\ufe20-\\ufe2f",ZD="\\u20d0-\\u20ff",ux=XD+QD+ZD,dx="\\u2700-\\u27bf",fx="a-z\\xdf-\\xf6\\xf8-\\xff",JD="\\xac\\xb1\\xd7\\xf7",eT="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",tT="\\u2000-\\u206f",nT=" \\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",hx="A-Z\\xc0-\\xd6\\xd8-\\xde",px="\\ufe0e\\ufe0f",gx=JD+eT+tT+nT,Up="['’]",rT="["+zt+"]",mx="["+gx+"]",ld="["+ux+"]",vx="\\d+",oT="["+dx+"]",bx="["+fx+"]",yx="[^"+zt+gx+vx+dx+fx+hx+"]",qp="\\ud83c[\\udffb-\\udfff]",iT="(?:"+ld+"|"+qp+")",xx="[^"+zt+"]",Gp="(?:\\ud83c[\\udde6-\\uddff]){2}",Yp="[\\ud800-\\udbff][\\udc00-\\udfff]",Ra="["+hx+"]",wx="\\u200d",_x="(?:"+bx+"|"+yx+")",sT="(?:"+Ra+"|"+yx+")",Sx="(?:"+Up+"(?:d|ll|m|re|s|t|ve))?",Cx="(?:"+Up+"(?:D|LL|M|RE|S|T|VE))?",Ex=iT+"?",Rx="["+px+"]?",aT="(?:"+wx+"(?:"+[xx,Gp,Yp].join("|")+")"+Rx+Ex+")*",lT="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",cT="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",$x=Rx+Ex+aT,uT="(?:"+[oT,Gp,Yp].join("|")+")"+$x,dT="(?:"+[xx+ld+"?",ld,Gp,Yp,rT].join("|")+")",fT=RegExp(Up,"g"),hT=RegExp(ld,"g"),Kp=RegExp(qp+"(?="+qp+")|"+dT+$x,"g"),pT=RegExp([Ra+"?"+bx+"+"+Sx+"(?="+[mx,Ra,"$"].join("|")+")",sT+"+"+Cx+"(?="+[mx,Ra+_x,"$"].join("|")+")",Ra+"?"+_x+"+"+Sx,Ra+"+"+Cx,cT,lT,vx,uT].join("|"),"g"),gT=RegExp("["+wx+zt+ux+px+"]"),mT=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,vT=["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"],bT=-1,Dt={};Dt[Mo]=Dt[Do]=Dt[Vr]=Dt[es]=Dt[ts]=Dt[ns]=Dt[rs]=Dt[os]=Dt[is]=!0,Dt[ge]=Dt[ve]=Dt[hn]=Dt[ee]=Dt[no]=Dt[K]=Dt[be]=Dt[Q]=Dt[Ie]=Dt[ze]=Dt[pt]=Dt[Bt]=Dt[Vt]=Dt[wn]=Dt[jr]=!1;var Pt={};Pt[ge]=Pt[ve]=Pt[hn]=Pt[no]=Pt[ee]=Pt[K]=Pt[Mo]=Pt[Do]=Pt[Vr]=Pt[es]=Pt[ts]=Pt[Ie]=Pt[ze]=Pt[pt]=Pt[Bt]=Pt[Vt]=Pt[wn]=Pt[en]=Pt[ns]=Pt[rs]=Pt[os]=Pt[is]=!0,Pt[be]=Pt[Q]=Pt[jr]=!1;var yT={À:"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"},xT={"&":"&","<":"<",">":">",'"':""","'":"'"},wT={"&":"&","<":"<",">":">",""":'"',"'":"'"},_T={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ST=parseFloat,CT=parseInt,Px=typeof ks=="object"&&ks&&ks.Object===Object&&ks,ET=typeof self=="object"&&self&&self.Object===Object&&self,pn=Px||ET||Function("return this")(),Xp=t&&!t.nodeType&&t,gs=Xp&&!0&&e&&!e.nodeType&&e,Ox=gs&&gs.exports===Xp,Qp=Ox&&Px.process,wr=function(){try{var B=gs&&gs.require&&gs.require("util").types;return B||Qp&&Qp.binding&&Qp.binding("util")}catch{}}(),Mx=wr&&wr.isArrayBuffer,Dx=wr&&wr.isDate,Tx=wr&&wr.isMap,Ax=wr&&wr.isRegExp,Ix=wr&&wr.isSet,kx=wr&&wr.isTypedArray;function Qn(B,fe,se){switch(se.length){case 0:return B.call(fe);case 1:return B.call(fe,se[0]);case 2:return B.call(fe,se[0],se[1]);case 3:return B.call(fe,se[0],se[1],se[2])}return B.apply(fe,se)}function RT(B,fe,se,De){for(var qe=-1,vt=B==null?0:B.length;++qe<vt;){var tn=B[qe];fe(De,tn,se(tn),B)}return De}function _r(B,fe){for(var se=-1,De=B==null?0:B.length;++se<De&&fe(B[se],se,B)!==!1;);return B}function $T(B,fe){for(var se=B==null?0:B.length;se--&&fe(B[se],se,B)!==!1;);return B}function Nx(B,fe){for(var se=-1,De=B==null?0:B.length;++se<De;)if(!fe(B[se],se,B))return!1;return!0}function di(B,fe){for(var se=-1,De=B==null?0:B.length,qe=0,vt=[];++se<De;){var tn=B[se];fe(tn,se,B)&&(vt[qe++]=tn)}return vt}function cd(B,fe){var se=B==null?0:B.length;return!!se&&$a(B,fe,0)>-1}function Zp(B,fe,se){for(var De=-1,qe=B==null?0:B.length;++De<qe;)if(se(fe,B[De]))return!0;return!1}function jt(B,fe){for(var se=-1,De=B==null?0:B.length,qe=Array(De);++se<De;)qe[se]=fe(B[se],se,B);return qe}function fi(B,fe){for(var se=-1,De=fe.length,qe=B.length;++se<De;)B[qe+se]=fe[se];return B}function Jp(B,fe,se,De){var qe=-1,vt=B==null?0:B.length;for(De&&vt&&(se=B[++qe]);++qe<vt;)se=fe(se,B[qe],qe,B);return se}function PT(B,fe,se,De){var qe=B==null?0:B.length;for(De&&qe&&(se=B[--qe]);qe--;)se=fe(se,B[qe],qe,B);return se}function eg(B,fe){for(var se=-1,De=B==null?0:B.length;++se<De;)if(fe(B[se],se,B))return!0;return!1}var OT=tg("length");function MT(B){return B.split("")}function DT(B){return B.match(H)||[]}function Lx(B,fe,se){var De;return se(B,function(qe,vt,tn){if(fe(qe,vt,tn))return De=vt,!1}),De}function ud(B,fe,se,De){for(var qe=B.length,vt=se+(De?1:-1);De?vt--:++vt<qe;)if(fe(B[vt],vt,B))return vt;return-1}function $a(B,fe,se){return fe===fe?WT(B,fe,se):ud(B,Fx,se)}function TT(B,fe,se,De){for(var qe=se-1,vt=B.length;++qe<vt;)if(De(B[qe],fe))return qe;return-1}function Fx(B){return B!==B}function zx(B,fe){var se=B==null?0:B.length;return se?rg(B,fe)/se:j}function tg(B){return function(fe){return fe==null?n:fe[B]}}function ng(B){return function(fe){return B==null?n:B[fe]}}function jx(B,fe,se,De,qe){return qe(B,function(vt,tn,$t){se=De?(De=!1,vt):fe(se,vt,tn,$t)}),se}function AT(B,fe){var se=B.length;for(B.sort(fe);se--;)B[se]=B[se].value;return B}function rg(B,fe){for(var se,De=-1,qe=B.length;++De<qe;){var vt=fe(B[De]);vt!==n&&(se=se===n?vt:se+vt)}return se}function og(B,fe){for(var se=-1,De=Array(B);++se<B;)De[se]=fe(se);return De}function IT(B,fe){return jt(fe,function(se){return[se,B[se]]})}function Vx(B){return B&&B.slice(0,Ux(B)+1).replace(hs,"")}function Zn(B){return function(fe){return B(fe)}}function ig(B,fe){return jt(fe,function(se){return B[se]})}function tc(B,fe){return B.has(fe)}function Hx(B,fe){for(var se=-1,De=B.length;++se<De&&$a(fe,B[se],0)>-1;);return se}function Wx(B,fe){for(var se=B.length;se--&&$a(fe,B[se],0)>-1;);return se}function kT(B,fe){for(var se=B.length,De=0;se--;)B[se]===fe&&++De;return De}var NT=ng(yT),LT=ng(xT);function FT(B){return"\\"+_T[B]}function zT(B,fe){return B==null?n:B[fe]}function Pa(B){return gT.test(B)}function jT(B){return mT.test(B)}function VT(B){for(var fe,se=[];!(fe=B.next()).done;)se.push(fe.value);return se}function sg(B){var fe=-1,se=Array(B.size);return B.forEach(function(De,qe){se[++fe]=[qe,De]}),se}function Bx(B,fe){return function(se){return B(fe(se))}}function hi(B,fe){for(var se=-1,De=B.length,qe=0,vt=[];++se<De;){var tn=B[se];(tn===fe||tn===d)&&(B[se]=d,vt[qe++]=se)}return vt}function dd(B){var fe=-1,se=Array(B.size);return B.forEach(function(De){se[++fe]=De}),se}function HT(B){var fe=-1,se=Array(B.size);return B.forEach(function(De){se[++fe]=[De,De]}),se}function WT(B,fe,se){for(var De=se-1,qe=B.length;++De<qe;)if(B[De]===fe)return De;return-1}function BT(B,fe,se){for(var De=se+1;De--;)if(B[De]===fe)return De;return De}function Oa(B){return Pa(B)?qT(B):OT(B)}function Hr(B){return Pa(B)?GT(B):MT(B)}function Ux(B){for(var fe=B.length;fe--&&Zl.test(B.charAt(fe)););return fe}var UT=ng(wT);function qT(B){for(var fe=Kp.lastIndex=0;Kp.test(B);)++fe;return fe}function GT(B){return B.match(Kp)||[]}function YT(B){return B.match(pT)||[]}var KT=function B(fe){fe=fe==null?pn:Ma.defaults(pn.Object(),fe,Ma.pick(pn,vT));var se=fe.Array,De=fe.Date,qe=fe.Error,vt=fe.Function,tn=fe.Math,$t=fe.Object,ag=fe.RegExp,XT=fe.String,Sr=fe.TypeError,fd=se.prototype,QT=vt.prototype,Da=$t.prototype,hd=fe["__core-js_shared__"],pd=QT.toString,St=Da.hasOwnProperty,ZT=0,qx=function(){var c=/[^.]+$/.exec(hd&&hd.keys&&hd.keys.IE_PROTO||"");return c?"Symbol(src)_1."+c:""}(),gd=Da.toString,JT=pd.call($t),e5=pn._,t5=ag("^"+pd.call(St).replace(ds,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),md=Ox?fe.Buffer:n,pi=fe.Symbol,vd=fe.Uint8Array,Gx=md?md.allocUnsafe:n,bd=Bx($t.getPrototypeOf,$t),Yx=$t.create,Kx=Da.propertyIsEnumerable,yd=fd.splice,Xx=pi?pi.isConcatSpreadable:n,nc=pi?pi.iterator:n,ms=pi?pi.toStringTag:n,xd=function(){try{var c=ws($t,"defineProperty");return c({},"",{}),c}catch{}}(),n5=fe.clearTimeout!==pn.clearTimeout&&fe.clearTimeout,r5=De&&De.now!==pn.Date.now&&De.now,o5=fe.setTimeout!==pn.setTimeout&&fe.setTimeout,wd=tn.ceil,_d=tn.floor,lg=$t.getOwnPropertySymbols,i5=md?md.isBuffer:n,Qx=fe.isFinite,s5=fd.join,a5=Bx($t.keys,$t),nn=tn.max,Sn=tn.min,l5=De.now,c5=fe.parseInt,Zx=tn.random,u5=fd.reverse,cg=ws(fe,"DataView"),rc=ws(fe,"Map"),ug=ws(fe,"Promise"),Ta=ws(fe,"Set"),oc=ws(fe,"WeakMap"),ic=ws($t,"create"),Sd=oc&&new oc,Aa={},d5=_s(cg),f5=_s(rc),h5=_s(ug),p5=_s(Ta),g5=_s(oc),Cd=pi?pi.prototype:n,sc=Cd?Cd.valueOf:n,Jx=Cd?Cd.toString:n;function M(c){if(Ut(c)&&!Ye(c)&&!(c instanceof ut)){if(c instanceof Cr)return c;if(St.call(c,"__wrapped__"))return e1(c)}return new Cr(c)}var Ia=function(){function c(){}return function(f){if(!Ht(f))return{};if(Yx)return Yx(f);c.prototype=f;var v=new c;return c.prototype=n,v}}();function Ed(){}function Cr(c,f){this.__wrapped__=c,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=n}M.templateSettings={escape:Xl,evaluate:ls,interpolate:Ea,variable:"",imports:{_:M}},M.prototype=Ed.prototype,M.prototype.constructor=M,Cr.prototype=Ia(Ed.prototype),Cr.prototype.constructor=Cr;function ut(c){this.__wrapped__=c,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=V,this.__views__=[]}function m5(){var c=new ut(this.__wrapped__);return c.__actions__=Ln(this.__actions__),c.__dir__=this.__dir__,c.__filtered__=this.__filtered__,c.__iteratees__=Ln(this.__iteratees__),c.__takeCount__=this.__takeCount__,c.__views__=Ln(this.__views__),c}function v5(){if(this.__filtered__){var c=new ut(this);c.__dir__=-1,c.__filtered__=!0}else c=this.clone(),c.__dir__*=-1;return c}function b5(){var c=this.__wrapped__.value(),f=this.__dir__,v=Ye(c),S=f<0,P=v?c.length:0,A=MA(0,P,this.__views__),L=A.start,z=A.end,G=z-L,he=S?z:L-1,pe=this.__iteratees__,ye=pe.length,$e=0,Ae=Sn(G,this.__takeCount__);if(!v||!S&&P==G&&Ae==G)return Sw(c,this.__actions__);var je=[];e:for(;G--&&$e<Ae;){he+=f;for(var et=-1,Ve=c[he];++et<ye;){var lt=pe[et],ht=lt.iteratee,tr=lt.type,An=ht(Ve);if(tr==F)Ve=An;else if(!An){if(tr==J)continue e;break e}}je[$e++]=Ve}return je}ut.prototype=Ia(Ed.prototype),ut.prototype.constructor=ut;function vs(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 y5(){this.__data__=ic?ic(null):{},this.size=0}function x5(c){var f=this.has(c)&&delete this.__data__[c];return this.size-=f?1:0,f}function w5(c){var f=this.__data__;if(ic){var v=f[c];return v===l?n:v}return St.call(f,c)?f[c]:n}function _5(c){var f=this.__data__;return ic?f[c]!==n:St.call(f,c)}function S5(c,f){var v=this.__data__;return this.size+=this.has(c)?0:1,v[c]=ic&&f===n?l:f,this}vs.prototype.clear=y5,vs.prototype.delete=x5,vs.prototype.get=w5,vs.prototype.has=_5,vs.prototype.set=S5;function Io(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 C5(){this.__data__=[],this.size=0}function E5(c){var f=this.__data__,v=Rd(f,c);if(v<0)return!1;var S=f.length-1;return v==S?f.pop():yd.call(f,v,1),--this.size,!0}function R5(c){var f=this.__data__,v=Rd(f,c);return v<0?n:f[v][1]}function $5(c){return Rd(this.__data__,c)>-1}function P5(c,f){var v=this.__data__,S=Rd(v,c);return S<0?(++this.size,v.push([c,f])):v[S][1]=f,this}Io.prototype.clear=C5,Io.prototype.delete=E5,Io.prototype.get=R5,Io.prototype.has=$5,Io.prototype.set=P5;function ko(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 O5(){this.size=0,this.__data__={hash:new vs,map:new(rc||Io),string:new vs}}function M5(c){var f=Fd(this,c).delete(c);return this.size-=f?1:0,f}function D5(c){return Fd(this,c).get(c)}function T5(c){return Fd(this,c).has(c)}function A5(c,f){var v=Fd(this,c),S=v.size;return v.set(c,f),this.size+=v.size==S?0:1,this}ko.prototype.clear=O5,ko.prototype.delete=M5,ko.prototype.get=D5,ko.prototype.has=T5,ko.prototype.set=A5;function bs(c){var f=-1,v=c==null?0:c.length;for(this.__data__=new ko;++f<v;)this.add(c[f])}function I5(c){return this.__data__.set(c,l),this}function k5(c){return this.__data__.has(c)}bs.prototype.add=bs.prototype.push=I5,bs.prototype.has=k5;function Wr(c){var f=this.__data__=new Io(c);this.size=f.size}function N5(){this.__data__=new Io,this.size=0}function L5(c){var f=this.__data__,v=f.delete(c);return this.size=f.size,v}function F5(c){return this.__data__.get(c)}function z5(c){return this.__data__.has(c)}function j5(c,f){var v=this.__data__;if(v instanceof Io){var S=v.__data__;if(!rc||S.length<o-1)return S.push([c,f]),this.size=++v.size,this;v=this.__data__=new ko(S)}return v.set(c,f),this.size=v.size,this}Wr.prototype.clear=N5,Wr.prototype.delete=L5,Wr.prototype.get=F5,Wr.prototype.has=z5,Wr.prototype.set=j5;function ew(c,f){var v=Ye(c),S=!v&&Ss(c),P=!v&&!S&&yi(c),A=!v&&!S&&!P&&Fa(c),L=v||S||P||A,z=L?og(c.length,XT):[],G=z.length;for(var he in c)(f||St.call(c,he))&&!(L&&(he=="length"||P&&(he=="offset"||he=="parent")||A&&(he=="buffer"||he=="byteLength"||he=="byteOffset")||zo(he,G)))&&z.push(he);return z}function tw(c){var f=c.length;return f?c[wg(0,f-1)]:n}function V5(c,f){return zd(Ln(c),ys(f,0,c.length))}function H5(c){return zd(Ln(c))}function dg(c,f,v){(v!==n&&!Br(c[f],v)||v===n&&!(f in c))&&No(c,f,v)}function ac(c,f,v){var S=c[f];(!(St.call(c,f)&&Br(S,v))||v===n&&!(f in c))&&No(c,f,v)}function Rd(c,f){for(var v=c.length;v--;)if(Br(c[v][0],f))return v;return-1}function W5(c,f,v,S){return gi(c,function(P,A,L){f(S,P,v(P),L)}),S}function nw(c,f){return c&&io(f,cn(f),c)}function B5(c,f){return c&&io(f,zn(f),c)}function No(c,f,v){f=="__proto__"&&xd?xd(c,f,{configurable:!0,enumerable:!0,value:v,writable:!0}):c[f]=v}function fg(c,f){for(var v=-1,S=f.length,P=se(S),A=c==null;++v<S;)P[v]=A?n:qg(c,f[v]);return P}function ys(c,f,v){return c===c&&(v!==n&&(c=c<=v?c:v),f!==n&&(c=c>=f?c:f)),c}function Er(c,f,v,S,P,A){var L,z=f&h,G=f&p,he=f&g;if(v&&(L=P?v(c,S,P,A):v(c)),L!==n)return L;if(!Ht(c))return c;var pe=Ye(c);if(pe){if(L=TA(c),!z)return Ln(c,L)}else{var ye=Cn(c),$e=ye==Q||ye==Oe;if(yi(c))return Rw(c,z);if(ye==pt||ye==ge||$e&&!P){if(L=G||$e?{}:Uw(c),!z)return G?wA(c,B5(L,c)):xA(c,nw(L,c))}else{if(!Pt[ye])return P?c:{};L=AA(c,ye,z)}}A||(A=new Wr);var Ae=A.get(c);if(Ae)return Ae;A.set(c,L),x1(c)?c.forEach(function(Ve){L.add(Er(Ve,f,v,Ve,c,A))}):b1(c)&&c.forEach(function(Ve,lt){L.set(lt,Er(Ve,f,v,lt,c,A))});var je=he?G?Tg:Dg:G?zn:cn,et=pe?n:je(c);return _r(et||c,function(Ve,lt){et&&(lt=Ve,Ve=c[lt]),ac(L,lt,Er(Ve,f,v,lt,c,A))}),L}function U5(c){var f=cn(c);return function(v){return rw(v,c,f)}}function rw(c,f,v){var S=v.length;if(c==null)return!S;for(c=$t(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 ow(c,f,v){if(typeof c!="function")throw new Sr(s);return pc(function(){c.apply(n,v)},f)}function lc(c,f,v,S){var P=-1,A=cd,L=!0,z=c.length,G=[],he=f.length;if(!z)return G;v&&(f=jt(f,Zn(v))),S?(A=Zp,L=!1):f.length>=o&&(A=tc,L=!1,f=new bs(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;G.push(pe)}else A(f,ye,S)||G.push(pe)}return G}var gi=Dw(oo),iw=Dw(pg,!0);function q5(c,f){var v=!0;return gi(c,function(S,P,A){return v=!!f(S,P,A),v}),v}function $d(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&&!er(L):v(L,z)))var z=L,G=A}return G}function G5(c,f,v,S){var P=c.length;for(v=Qe(v),v<0&&(v=-v>P?0:P+v),S=S===n||S>P?P:Qe(S),S<0&&(S+=P),S=v>S?0:_1(S);v<S;)c[v++]=f;return c}function sw(c,f){var v=[];return gi(c,function(S,P,A){f(S,P,A)&&v.push(S)}),v}function gn(c,f,v,S,P){var A=-1,L=c.length;for(v||(v=kA),P||(P=[]);++A<L;){var z=c[A];f>0&&v(z)?f>1?gn(z,f-1,v,S,P):fi(P,z):S||(P[P.length]=z)}return P}var hg=Tw(),aw=Tw(!0);function oo(c,f){return c&&hg(c,f,cn)}function pg(c,f){return c&&aw(c,f,cn)}function Pd(c,f){return di(f,function(v){return jo(c[v])})}function xs(c,f){f=vi(f,c);for(var v=0,S=f.length;c!=null&&v<S;)c=c[so(f[v++])];return v&&v==S?c:n}function lw(c,f,v){var S=f(c);return Ye(c)?S:fi(S,v(c))}function Dn(c){return c==null?c===n?Yl:_e:ms&&ms in $t(c)?OA(c):HA(c)}function gg(c,f){return c>f}function Y5(c,f){return c!=null&&St.call(c,f)}function K5(c,f){return c!=null&&f in $t(c)}function X5(c,f,v){return c>=Sn(f,v)&&c<nn(f,v)}function mg(c,f,v){for(var S=v?Zp:cd,P=c[0].length,A=c.length,L=A,z=se(A),G=1/0,he=[];L--;){var pe=c[L];L&&f&&(pe=jt(pe,Zn(f))),G=Sn(pe.length,G),z[L]=!v&&(f||P>=120&&pe.length>=120)?new bs(L&&pe):n}pe=c[0];var ye=-1,$e=z[0];e:for(;++ye<P&&he.length<G;){var Ae=pe[ye],je=f?f(Ae):Ae;if(Ae=v||Ae!==0?Ae:0,!($e?tc($e,je):S(he,je,v))){for(L=A;--L;){var et=z[L];if(!(et?tc(et,je):S(c[L],je,v)))continue e}$e&&$e.push(je),he.push(Ae)}}return he}function Q5(c,f,v,S){return oo(c,function(P,A,L){f(S,v(P),A,L)}),S}function cc(c,f,v){f=vi(f,c),c=Kw(c,f);var S=c==null?c:c[so($r(f))];return S==null?n:Qn(S,c,v)}function cw(c){return Ut(c)&&Dn(c)==ge}function Z5(c){return Ut(c)&&Dn(c)==hn}function J5(c){return Ut(c)&&Dn(c)==K}function uc(c,f,v,S,P){return c===f?!0:c==null||f==null||!Ut(c)&&!Ut(f)?c!==c&&f!==f:eA(c,f,v,S,uc,P)}function eA(c,f,v,S,P,A){var L=Ye(c),z=Ye(f),G=L?ve:Cn(c),he=z?ve:Cn(f);G=G==ge?pt:G,he=he==ge?pt:he;var pe=G==pt,ye=he==pt,$e=G==he;if($e&&yi(c)){if(!yi(f))return!1;L=!0,pe=!1}if($e&&!pe)return A||(A=new Wr),L||Fa(c)?Hw(c,f,v,S,P,A):$A(c,f,G,v,S,P,A);if(!(v&b)){var Ae=pe&&St.call(c,"__wrapped__"),je=ye&&St.call(f,"__wrapped__");if(Ae||je){var et=Ae?c.value():c,Ve=je?f.value():f;return A||(A=new Wr),P(et,Ve,v,S,A)}}return $e?(A||(A=new Wr),PA(c,f,v,S,P,A)):!1}function tA(c){return Ut(c)&&Cn(c)==Ie}function vg(c,f,v,S){var P=v.length,A=P,L=!S;if(c==null)return!A;for(c=$t(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 G=z[0],he=c[G],pe=z[1];if(L&&z[2]){if(he===n&&!(G in c))return!1}else{var ye=new Wr;if(S)var $e=S(he,pe,G,c,f,ye);if(!($e===n?uc(pe,he,b|y,S,ye):$e))return!1}}return!0}function uw(c){if(!Ht(c)||LA(c))return!1;var f=jo(c)?t5:gt;return f.test(_s(c))}function nA(c){return Ut(c)&&Dn(c)==Bt}function rA(c){return Ut(c)&&Cn(c)==Vt}function oA(c){return Ut(c)&&Ud(c.length)&&!!Dt[Dn(c)]}function dw(c){return typeof c=="function"?c:c==null?jn:typeof c=="object"?Ye(c)?pw(c[0],c[1]):hw(c):A1(c)}function bg(c){if(!hc(c))return a5(c);var f=[];for(var v in $t(c))St.call(c,v)&&v!="constructor"&&f.push(v);return f}function iA(c){if(!Ht(c))return VA(c);var f=hc(c),v=[];for(var S in c)S=="constructor"&&(f||!St.call(c,S))||v.push(S);return v}function yg(c,f){return c<f}function fw(c,f){var v=-1,S=Fn(c)?se(c.length):[];return gi(c,function(P,A,L){S[++v]=f(P,A,L)}),S}function hw(c){var f=Ig(c);return f.length==1&&f[0][2]?Gw(f[0][0],f[0][1]):function(v){return v===c||vg(v,c,f)}}function pw(c,f){return Ng(c)&&qw(f)?Gw(so(c),f):function(v){var S=qg(v,c);return S===n&&S===f?Gg(v,c):uc(f,S,b|y)}}function Od(c,f,v,S,P){c!==f&&hg(f,function(A,L){if(P||(P=new Wr),Ht(A))sA(c,f,L,v,Od,S,P);else{var z=S?S(Fg(c,L),A,L+"",c,f,P):n;z===n&&(z=A),dg(c,L,z)}},zn)}function sA(c,f,v,S,P,A,L){var z=Fg(c,v),G=Fg(f,v),he=L.get(G);if(he){dg(c,v,he);return}var pe=A?A(z,G,v+"",c,f,L):n,ye=pe===n;if(ye){var $e=Ye(G),Ae=!$e&&yi(G),je=!$e&&!Ae&&Fa(G);pe=G,$e||Ae||je?Ye(z)?pe=z:Kt(z)?pe=Ln(z):Ae?(ye=!1,pe=Rw(G,!0)):je?(ye=!1,pe=$w(G,!0)):pe=[]:gc(G)||Ss(G)?(pe=z,Ss(z)?pe=S1(z):(!Ht(z)||jo(z))&&(pe=Uw(G))):ye=!1}ye&&(L.set(G,pe),P(pe,G,S,A,L),L.delete(G)),dg(c,v,pe)}function gw(c,f){var v=c.length;if(v)return f+=f<0?v:0,zo(f,v)?c[f]:n}function mw(c,f,v){f.length?f=jt(f,function(A){return Ye(A)?function(L){return xs(L,A.length===1?A[0]:A)}:A}):f=[jn];var S=-1;f=jt(f,Zn(Fe()));var P=fw(c,function(A,L,z){var G=jt(f,function(he){return he(A)});return{criteria:G,index:++S,value:A}});return AT(P,function(A,L){return yA(A,L,v)})}function aA(c,f){return vw(c,f,function(v,S){return Gg(c,S)})}function vw(c,f,v){for(var S=-1,P=f.length,A={};++S<P;){var L=f[S],z=xs(c,L);v(z,L)&&dc(A,vi(L,c),z)}return A}function lA(c){return function(f){return xs(f,c)}}function xg(c,f,v,S){var P=S?TT:$a,A=-1,L=f.length,z=c;for(c===f&&(f=Ln(f)),v&&(z=jt(c,Zn(v)));++A<L;)for(var G=0,he=f[A],pe=v?v(he):he;(G=P(z,pe,G,S))>-1;)z!==c&&yd.call(z,G,1),yd.call(c,G,1);return c}function bw(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;zo(P)?yd.call(c,P,1):Cg(c,P)}}return c}function wg(c,f){return c+_d(Zx()*(f-c+1))}function cA(c,f,v,S){for(var P=-1,A=nn(wd((f-c)/(v||1)),0),L=se(A);A--;)L[S?A:++P]=c,c+=v;return L}function _g(c,f){var v="";if(!c||f<1||f>X)return v;do f%2&&(v+=c),f=_d(f/2),f&&(c+=c);while(f);return v}function rt(c,f){return zg(Yw(c,f,jn),c+"")}function uA(c){return tw(za(c))}function dA(c,f){var v=za(c);return zd(v,ys(f,0,v.length))}function dc(c,f,v,S){if(!Ht(c))return c;f=vi(f,c);for(var P=-1,A=f.length,L=A-1,z=c;z!=null&&++P<A;){var G=so(f[P]),he=v;if(G==="__proto__"||G==="constructor"||G==="prototype")return c;if(P!=L){var pe=z[G];he=S?S(pe,G,z):n,he===n&&(he=Ht(pe)?pe:zo(f[P+1])?[]:{})}ac(z,G,he),z=z[G]}return c}var yw=Sd?function(c,f){return Sd.set(c,f),c}:jn,fA=xd?function(c,f){return xd(c,"toString",{configurable:!0,enumerable:!1,value:Kg(f),writable:!0})}:jn;function hA(c){return zd(za(c))}function Rr(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 pA(c,f){var v;return gi(c,function(S,P,A){return v=f(S,P,A),!v}),!!v}function Md(c,f,v){var S=0,P=c==null?S:c.length;if(typeof f=="number"&&f===f&&P<=le){for(;S<P;){var A=S+P>>>1,L=c[A];L!==null&&!er(L)&&(v?L<=f:L<f)?S=A+1:P=A}return P}return Sg(c,f,jn,v)}function Sg(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,G=er(f),he=f===n;P<A;){var pe=_d((P+A)/2),ye=v(c[pe]),$e=ye!==n,Ae=ye===null,je=ye===ye,et=er(ye);if(L)var Ve=S||je;else he?Ve=je&&(S||$e):z?Ve=je&&$e&&(S||!Ae):G?Ve=je&&$e&&!Ae&&(S||!et):Ae||et?Ve=!1:Ve=S?ye<=f:ye<f;Ve?P=pe+1:A=pe}return Sn(A,te)}function xw(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||!Br(z,G)){var G=z;A[P++]=L===0?0:L}}return A}function ww(c){return typeof c=="number"?c:er(c)?j:+c}function Jn(c){if(typeof c=="string")return c;if(Ye(c))return jt(c,Jn)+"";if(er(c))return Jx?Jx.call(c):"";var f=c+"";return f=="0"&&1/c==-q?"-0":f}function mi(c,f,v){var S=-1,P=cd,A=c.length,L=!0,z=[],G=z;if(v)L=!1,P=Zp;else if(A>=o){var he=f?null:EA(c);if(he)return dd(he);L=!1,P=tc,G=new bs}else G=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=G.length;$e--;)if(G[$e]===ye)continue e;f&&G.push(ye),z.push(pe)}else P(G,ye,v)||(G!==z&&G.push(ye),z.push(pe))}return z}function Cg(c,f){return f=vi(f,c),c=Kw(c,f),c==null||delete c[so($r(f))]}function _w(c,f,v,S){return dc(c,f,v(xs(c,f)),S)}function Dd(c,f,v,S){for(var P=c.length,A=S?P:-1;(S?A--:++A<P)&&f(c[A],A,c););return v?Rr(c,S?0:A,S?A+1:P):Rr(c,S?A+1:0,S?P:A)}function Sw(c,f){var v=c;return v instanceof ut&&(v=v.value()),Jp(f,function(S,P){return P.func.apply(P.thisArg,fi([S],P.args))},v)}function Eg(c,f,v){var S=c.length;if(S<2)return S?mi(c[0]):[];for(var P=-1,A=se(S);++P<S;)for(var L=c[P],z=-1;++z<S;)z!=P&&(A[P]=lc(A[P]||L,c[z],f,v));return mi(gn(A,1),f,v)}function Cw(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 Rg(c){return Kt(c)?c:[]}function $g(c){return typeof c=="function"?c:jn}function vi(c,f){return Ye(c)?c:Ng(c,f)?[c]:Jw(yt(c))}var gA=rt;function bi(c,f,v){var S=c.length;return v=v===n?S:v,!f&&v>=S?c:Rr(c,f,v)}var Ew=n5||function(c){return pn.clearTimeout(c)};function Rw(c,f){if(f)return c.slice();var v=c.length,S=Gx?Gx(v):new c.constructor(v);return c.copy(S),S}function Pg(c){var f=new c.constructor(c.byteLength);return new vd(f).set(new vd(c)),f}function mA(c,f){var v=f?Pg(c.buffer):c.buffer;return new c.constructor(v,c.byteOffset,c.byteLength)}function vA(c){var f=new c.constructor(c.source,ke.exec(c));return f.lastIndex=c.lastIndex,f}function bA(c){return sc?$t(sc.call(c)):{}}function $w(c,f){var v=f?Pg(c.buffer):c.buffer;return new c.constructor(v,c.byteOffset,c.length)}function Pw(c,f){if(c!==f){var v=c!==n,S=c===null,P=c===c,A=er(c),L=f!==n,z=f===null,G=f===f,he=er(f);if(!z&&!he&&!A&&c>f||A&&L&&G&&!z&&!he||S&&L&&G||!v&&G||!P)return 1;if(!S&&!A&&!he&&c<f||he&&v&&P&&!S&&!A||z&&v&&P||!L&&P||!G)return-1}return 0}function yA(c,f,v){for(var S=-1,P=c.criteria,A=f.criteria,L=P.length,z=v.length;++S<L;){var G=Pw(P[S],A[S]);if(G){if(S>=z)return G;var he=v[S];return G*(he=="desc"?-1:1)}}return c.index-f.index}function Ow(c,f,v,S){for(var P=-1,A=c.length,L=v.length,z=-1,G=f.length,he=nn(A-L,0),pe=se(G+he),ye=!S;++z<G;)pe[z]=f[z];for(;++P<L;)(ye||P<A)&&(pe[v[P]]=c[P]);for(;he--;)pe[z++]=c[P++];return pe}function Mw(c,f,v,S){for(var P=-1,A=c.length,L=-1,z=v.length,G=-1,he=f.length,pe=nn(A-z,0),ye=se(pe+he),$e=!S;++P<pe;)ye[P]=c[P];for(var Ae=P;++G<he;)ye[Ae+G]=f[G];for(;++L<z;)($e||P<A)&&(ye[Ae+v[L]]=c[P++]);return ye}function Ln(c,f){var v=-1,S=c.length;for(f||(f=se(S));++v<S;)f[v]=c[v];return f}function io(c,f,v,S){var P=!v;v||(v={});for(var A=-1,L=f.length;++A<L;){var z=f[A],G=S?S(v[z],c[z],z,v,c):n;G===n&&(G=c[z]),P?No(v,z,G):ac(v,z,G)}return v}function xA(c,f){return io(c,kg(c),f)}function wA(c,f){return io(c,Ww(c),f)}function Td(c,f){return function(v,S){var P=Ye(v)?RT:W5,A=f?f():{};return P(v,c,Fe(S,2),A)}}function ka(c){return rt(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&&Tn(v[0],v[1],L)&&(A=P<3?n:A,P=1),f=$t(f);++S<P;){var z=v[S];z&&c(f,z,S,A)}return f})}function Dw(c,f){return function(v,S){if(v==null)return v;if(!Fn(v))return c(v,S);for(var P=v.length,A=f?P:-1,L=$t(v);(f?A--:++A<P)&&S(L[A],A,L)!==!1;);return v}}function Tw(c){return function(f,v,S){for(var P=-1,A=$t(f),L=S(f),z=L.length;z--;){var G=L[c?z:++P];if(v(A[G],G,A)===!1)break}return f}}function _A(c,f,v){var S=f&x,P=fc(c);function A(){var L=this&&this!==pn&&this instanceof A?P:c;return L.apply(S?v:this,arguments)}return A}function Aw(c){return function(f){f=yt(f);var v=Pa(f)?Hr(f):n,S=v?v[0]:f.charAt(0),P=v?bi(v,1).join(""):f.slice(1);return S[c]()+P}}function Na(c){return function(f){return Jp(D1(M1(f).replace(fT,"")),c,"")}}function fc(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=Ia(c.prototype),S=c.apply(v,f);return Ht(S)?S:v}}function SA(c,f,v){var S=fc(c);function P(){for(var A=arguments.length,L=se(A),z=A,G=La(P);z--;)L[z]=arguments[z];var he=A<3&&L[0]!==G&&L[A-1]!==G?[]:hi(L,G);if(A-=he.length,A<v)return Fw(c,f,Ad,P.placeholder,n,L,he,n,n,v-A);var pe=this&&this!==pn&&this instanceof P?S:c;return Qn(pe,this,L)}return P}function Iw(c){return function(f,v,S){var P=$t(f);if(!Fn(f)){var A=Fe(v,3);f=cn(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 kw(c){return Fo(function(f){var v=f.length,S=v,P=Cr.prototype.thru;for(c&&f.reverse();S--;){var A=f[S];if(typeof A!="function")throw new Sr(s);if(P&&!L&&Ld(A)=="wrapper")var L=new Cr([],!0)}for(S=L?S:v;++S<v;){A=f[S];var z=Ld(A),G=z=="wrapper"?Ag(A):n;G&&Lg(G[0])&&G[1]==(O|C|E|T)&&!G[4].length&&G[9]==1?L=L[Ld(G[0])].apply(L,G[3]):L=A.length==1&&Lg(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 Ad(c,f,v,S,P,A,L,z,G,he){var pe=f&O,ye=f&x,$e=f&w,Ae=f&(C|R),je=f&I,et=$e?n:fc(c);function Ve(){for(var lt=arguments.length,ht=se(lt),tr=lt;tr--;)ht[tr]=arguments[tr];if(Ae)var An=La(Ve),nr=kT(ht,An);if(S&&(ht=Ow(ht,S,P,Ae)),A&&(ht=Mw(ht,A,L,Ae)),lt-=nr,Ae&<<he){var Xt=hi(ht,An);return Fw(c,f,Ad,Ve.placeholder,v,ht,Xt,z,G,he-lt)}var Ur=ye?v:this,Ho=$e?Ur[c]:c;return lt=ht.length,z?ht=WA(ht,z):je&<>1&&ht.reverse(),pe&&G<lt&&(ht.length=G),this&&this!==pn&&this instanceof Ve&&(Ho=et||fc(Ho)),Ho.apply(Ur,ht)}return Ve}function Nw(c,f){return function(v,S){return Q5(v,c,f(S),{})}}function Id(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=Jn(v),S=Jn(S)):(v=ww(v),S=ww(S)),P=c(v,S)}return P}}function Og(c){return Fo(function(f){return f=jt(f,Zn(Fe())),rt(function(v){var S=this;return c(f,function(P){return Qn(P,S,v)})})})}function kd(c,f){f=f===n?" ":Jn(f);var v=f.length;if(v<2)return v?_g(f,c):f;var S=_g(f,wd(c/Oa(f)));return Pa(f)?bi(Hr(S),0,c).join(""):S.slice(0,c)}function CA(c,f,v,S){var P=f&x,A=fc(c);function L(){for(var z=-1,G=arguments.length,he=-1,pe=S.length,ye=se(pe+G),$e=this&&this!==pn&&this instanceof L?A:c;++he<pe;)ye[he]=S[he];for(;G--;)ye[he++]=arguments[++z];return Qn($e,P?v:this,ye)}return L}function Lw(c){return function(f,v,S){return S&&typeof S!="number"&&Tn(f,v,S)&&(v=S=n),f=Vo(f),v===n?(v=f,f=0):v=Vo(v),S=S===n?f<v?1:-1:Vo(S),cA(f,v,S,c)}}function Nd(c){return function(f,v){return typeof f=="string"&&typeof v=="string"||(f=Pr(f),v=Pr(v)),c(f,v)}}function Fw(c,f,v,S,P,A,L,z,G,he){var pe=f&C,ye=pe?L:n,$e=pe?n:L,Ae=pe?A:n,je=pe?n:A;f|=pe?E:D,f&=~(pe?D:E),f&_||(f&=~(x|w));var et=[c,f,P,Ae,ye,je,$e,z,G,he],Ve=v.apply(n,et);return Lg(c)&&Xw(Ve,et),Ve.placeholder=S,Qw(Ve,c,f)}function Mg(c){var f=tn[c];return function(v,S){if(v=Pr(v),S=S==null?0:Sn(Qe(S),292),S&&Qx(v)){var P=(yt(v)+"e").split("e"),A=f(P[0]+"e"+(+P[1]+S));return P=(yt(A)+"e").split("e"),+(P[0]+"e"+(+P[1]-S))}return f(v)}}var EA=Ta&&1/dd(new Ta([,-0]))[1]==q?function(c){return new Ta(c)}:Zg;function zw(c){return function(f){var v=Cn(f);return v==Ie?sg(f):v==Vt?HT(f):IT(f,c(f))}}function Lo(c,f,v,S,P,A,L,z){var G=f&w;if(!G&&typeof c!="function")throw new Sr(s);var he=S?S.length:0;if(he||(f&=~(E|D),S=P=n),L=L===n?L:nn(Qe(L),0),z=z===n?z:Qe(z),he-=P?P.length:0,f&D){var pe=S,ye=P;S=P=n}var $e=G?n:Ag(c),Ae=[c,f,v,S,P,pe,ye,A,L,z];if($e&&jA(Ae,$e),c=Ae[0],f=Ae[1],v=Ae[2],S=Ae[3],P=Ae[4],z=Ae[9]=Ae[9]===n?G?0:c.length:nn(Ae[9]-he,0),!z&&f&(C|R)&&(f&=~(C|R)),!f||f==x)var je=_A(c,f,v);else f==C||f==R?je=SA(c,f,z):(f==E||f==(x|E))&&!P.length?je=CA(c,f,v,S):je=Ad.apply(n,Ae);var et=$e?yw:Xw;return Qw(et(je,Ae),c,f)}function jw(c,f,v,S){return c===n||Br(c,Da[v])&&!St.call(S,v)?f:c}function Vw(c,f,v,S,P,A){return Ht(c)&&Ht(f)&&(A.set(f,c),Od(c,f,n,Vw,A),A.delete(f)),c}function RA(c){return gc(c)?n:c}function Hw(c,f,v,S,P,A){var L=v&b,z=c.length,G=f.length;if(z!=G&&!(L&&G>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 bs:n;for(A.set(c,f),A.set(f,c);++ye<z;){var je=c[ye],et=f[ye];if(S)var Ve=L?S(et,je,ye,f,c,A):S(je,et,ye,c,f,A);if(Ve!==n){if(Ve)continue;$e=!1;break}if(Ae){if(!eg(f,function(lt,ht){if(!tc(Ae,ht)&&(je===lt||P(je,lt,v,S,A)))return Ae.push(ht)})){$e=!1;break}}else if(!(je===et||P(je,et,v,S,A))){$e=!1;break}}return A.delete(c),A.delete(f),$e}function $A(c,f,v,S,P,A,L){switch(v){case no:if(c.byteLength!=f.byteLength||c.byteOffset!=f.byteOffset)return!1;c=c.buffer,f=f.buffer;case hn:return!(c.byteLength!=f.byteLength||!A(new vd(c),new vd(f)));case ee:case K:case ze:return Br(+c,+f);case be:return c.name==f.name&&c.message==f.message;case Bt:case wn:return c==f+"";case Ie:var z=sg;case Vt:var G=S&b;if(z||(z=dd),c.size!=f.size&&!G)return!1;var he=L.get(c);if(he)return he==f;S|=y,L.set(c,f);var pe=Hw(z(c),z(f),S,P,A,L);return L.delete(c),pe;case en:if(sc)return sc.call(c)==sc.call(f)}return!1}function PA(c,f,v,S,P,A){var L=v&b,z=Dg(c),G=z.length,he=Dg(f),pe=he.length;if(G!=pe&&!L)return!1;for(var ye=G;ye--;){var $e=z[ye];if(!(L?$e in f:St.call(f,$e)))return!1}var Ae=A.get(c),je=A.get(f);if(Ae&&je)return Ae==f&&je==c;var et=!0;A.set(c,f),A.set(f,c);for(var Ve=L;++ye<G;){$e=z[ye];var lt=c[$e],ht=f[$e];if(S)var tr=L?S(ht,lt,$e,f,c,A):S(lt,ht,$e,c,f,A);if(!(tr===n?lt===ht||P(lt,ht,v,S,A):tr)){et=!1;break}Ve||(Ve=$e=="constructor")}if(et&&!Ve){var An=c.constructor,nr=f.constructor;An!=nr&&"constructor"in c&&"constructor"in f&&!(typeof An=="function"&&An instanceof An&&typeof nr=="function"&&nr instanceof nr)&&(et=!1)}return A.delete(c),A.delete(f),et}function Fo(c){return zg(Yw(c,n,r1),c+"")}function Dg(c){return lw(c,cn,kg)}function Tg(c){return lw(c,zn,Ww)}var Ag=Sd?function(c){return Sd.get(c)}:Zg;function Ld(c){for(var f=c.name+"",v=Aa[f],S=St.call(Aa,f)?v.length:0;S--;){var P=v[S],A=P.func;if(A==null||A==c)return P.name}return f}function La(c){var f=St.call(M,"placeholder")?M:c;return f.placeholder}function Fe(){var c=M.iteratee||Xg;return c=c===Xg?dw:c,arguments.length?c(arguments[0],arguments[1]):c}function Fd(c,f){var v=c.__data__;return NA(f)?v[typeof f=="string"?"string":"hash"]:v.map}function Ig(c){for(var f=cn(c),v=f.length;v--;){var S=f[v],P=c[S];f[v]=[S,P,qw(P)]}return f}function ws(c,f){var v=zT(c,f);return uw(v)?v:n}function OA(c){var f=St.call(c,ms),v=c[ms];try{c[ms]=n;var S=!0}catch{}var P=gd.call(c);return S&&(f?c[ms]=v:delete c[ms]),P}var kg=lg?function(c){return c==null?[]:(c=$t(c),di(lg(c),function(f){return Kx.call(c,f)}))}:Jg,Ww=lg?function(c){for(var f=[];c;)fi(f,kg(c)),c=bd(c);return f}:Jg,Cn=Dn;(cg&&Cn(new cg(new ArrayBuffer(1)))!=no||rc&&Cn(new rc)!=Ie||ug&&Cn(ug.resolve())!=dt||Ta&&Cn(new Ta)!=Vt||oc&&Cn(new oc)!=jr)&&(Cn=function(c){var f=Dn(c),v=f==pt?c.constructor:n,S=v?_s(v):"";if(S)switch(S){case d5:return no;case f5:return Ie;case h5:return dt;case p5:return Vt;case g5:return jr}return f});function MA(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=Sn(f,c+L);break;case"takeRight":c=nn(c,f-L);break}}return{start:c,end:f}}function DA(c){var f=c.match(ec);return f?f[1].split($):[]}function Bw(c,f,v){f=vi(f,c);for(var S=-1,P=f.length,A=!1;++S<P;){var L=so(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&&Ud(P)&&zo(L,P)&&(Ye(c)||Ss(c)))}function TA(c){var f=c.length,v=new c.constructor(f);return f&&typeof c[0]=="string"&&St.call(c,"index")&&(v.index=c.index,v.input=c.input),v}function Uw(c){return typeof c.constructor=="function"&&!hc(c)?Ia(bd(c)):{}}function AA(c,f,v){var S=c.constructor;switch(f){case hn:return Pg(c);case ee:case K:return new S(+c);case no:return mA(c,v);case Mo:case Do:case Vr:case es:case ts:case ns:case rs:case os:case is:return $w(c,v);case Ie:return new S;case ze:case wn:return new S(c);case Bt:return vA(c);case Vt:return new S;case en:return bA(c)}}function IA(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(Jl,`{
|
|
70
|
+
/* [wrapped with `+f+`] */
|
|
71
|
+
`)}function kA(c){return Ye(c)||Ss(c)||!!(Xx&&c&&c[Xx])}function zo(c,f){var v=typeof c;return f=f??X,!!f&&(v=="number"||v!="symbol"&&Ge.test(c))&&c>-1&&c%1==0&&c<f}function Tn(c,f,v){if(!Ht(v))return!1;var S=typeof f;return(S=="number"?Fn(v)&&zo(f,v.length):S=="string"&&f in v)?Br(v[f],c):!1}function Ng(c,f){if(Ye(c))return!1;var v=typeof c;return v=="number"||v=="symbol"||v=="boolean"||c==null||er(c)?!0:us.test(c)||!cs.test(c)||f!=null&&c in $t(f)}function NA(c){var f=typeof c;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?c!=="__proto__":c===null}function Lg(c){var f=Ld(c),v=M[f];if(typeof v!="function"||!(f in ut.prototype))return!1;if(c===v)return!0;var S=Ag(v);return!!S&&c===S[0]}function LA(c){return!!qx&&qx in c}var FA=hd?jo:em;function hc(c){var f=c&&c.constructor,v=typeof f=="function"&&f.prototype||Da;return c===v}function qw(c){return c===c&&!Ht(c)}function Gw(c,f){return function(v){return v==null?!1:v[c]===f&&(f!==n||c in $t(v))}}function zA(c){var f=Wd(c,function(S){return v.size===u&&v.clear(),S}),v=f.cache;return f}function jA(c,f){var v=c[1],S=f[1],P=v|S,A=P<(x|w|O),L=S==O&&v==C||S==O&&v==T&&c[7].length<=f[8]||S==(O|T)&&f[7].length<=f[8]&&v==C;if(!(A||L))return c;S&x&&(c[2]=f[2],P|=v&x?0:_);var z=f[3];if(z){var G=c[3];c[3]=G?Ow(G,z,f[4]):z,c[4]=G?hi(c[3],d):f[4]}return z=f[5],z&&(G=c[5],c[5]=G?Mw(G,z,f[6]):z,c[6]=G?hi(c[5],d):f[6]),z=f[7],z&&(c[7]=z),S&O&&(c[8]=c[8]==null?f[8]:Sn(c[8],f[8])),c[9]==null&&(c[9]=f[9]),c[0]=f[0],c[1]=P,c}function VA(c){var f=[];if(c!=null)for(var v in $t(c))f.push(v);return f}function HA(c){return gd.call(c)}function Yw(c,f,v){return f=nn(f===n?c.length-1:f,0),function(){for(var S=arguments,P=-1,A=nn(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),Qn(c,this,z)}}function Kw(c,f){return f.length<2?c:xs(c,Rr(f,0,-1))}function WA(c,f){for(var v=c.length,S=Sn(f.length,v),P=Ln(c);S--;){var A=f[S];c[S]=zo(A,v)?P[A]:n}return c}function Fg(c,f){if(!(f==="constructor"&&typeof c[f]=="function")&&f!="__proto__")return c[f]}var Xw=Zw(yw),pc=o5||function(c,f){return pn.setTimeout(c,f)},zg=Zw(fA);function Qw(c,f,v){var S=f+"";return zg(c,IA(S,BA(DA(S),v)))}function Zw(c){var f=0,v=0;return function(){var S=l5(),P=ue-(S-v);if(v=S,P>0){if(++f>=Y)return arguments[0]}else f=0;return c.apply(n,arguments)}}function zd(c,f){var v=-1,S=c.length,P=S-1;for(f=f===n?S:f;++v<f;){var A=wg(v,P),L=c[A];c[A]=c[v],c[v]=L}return c.length=f,c}var Jw=zA(function(c){var f=[];return c.charCodeAt(0)===46&&f.push(""),c.replace(Ql,function(v,S,P,A){f.push(P?A.replace(xe,"$1"):S||v)}),f});function so(c){if(typeof c=="string"||er(c))return c;var f=c+"";return f=="0"&&1/c==-q?"-0":f}function _s(c){if(c!=null){try{return pd.call(c)}catch{}try{return c+""}catch{}}return""}function BA(c,f){return _r(ce,function(v){var S="_."+v[0];f&v[1]&&!cd(c,S)&&c.push(S)}),c.sort()}function e1(c){if(c instanceof ut)return c.clone();var f=new Cr(c.__wrapped__,c.__chain__);return f.__actions__=Ln(c.__actions__),f.__index__=c.__index__,f.__values__=c.__values__,f}function UA(c,f,v){(v?Tn(c,f,v):f===n)?f=1:f=nn(Qe(f),0);var S=c==null?0:c.length;if(!S||f<1)return[];for(var P=0,A=0,L=se(wd(S/f));P<S;)L[A++]=Rr(c,P,P+=f);return L}function qA(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 GA(){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 fi(Ye(v)?Ln(v):[v],gn(f,1))}var YA=rt(function(c,f){return Kt(c)?lc(c,gn(f,1,Kt,!0)):[]}),KA=rt(function(c,f){var v=$r(f);return Kt(v)&&(v=n),Kt(c)?lc(c,gn(f,1,Kt,!0),Fe(v,2)):[]}),XA=rt(function(c,f){var v=$r(f);return Kt(v)&&(v=n),Kt(c)?lc(c,gn(f,1,Kt,!0),n,v):[]});function QA(c,f,v){var S=c==null?0:c.length;return S?(f=v||f===n?1:Qe(f),Rr(c,f<0?0:f,S)):[]}function ZA(c,f,v){var S=c==null?0:c.length;return S?(f=v||f===n?1:Qe(f),f=S-f,Rr(c,0,f<0?0:f)):[]}function JA(c,f){return c&&c.length?Dd(c,Fe(f,3),!0,!0):[]}function eI(c,f){return c&&c.length?Dd(c,Fe(f,3),!0):[]}function tI(c,f,v,S){var P=c==null?0:c.length;return P?(v&&typeof v!="number"&&Tn(c,f,v)&&(v=0,S=P),G5(c,f,v,S)):[]}function t1(c,f,v){var S=c==null?0:c.length;if(!S)return-1;var P=v==null?0:Qe(v);return P<0&&(P=nn(S+P,0)),ud(c,Fe(f,3),P)}function n1(c,f,v){var S=c==null?0:c.length;if(!S)return-1;var P=S-1;return v!==n&&(P=Qe(v),P=v<0?nn(S+P,0):Sn(P,S-1)),ud(c,Fe(f,3),P,!0)}function r1(c){var f=c==null?0:c.length;return f?gn(c,1):[]}function nI(c){var f=c==null?0:c.length;return f?gn(c,q):[]}function rI(c,f){var v=c==null?0:c.length;return v?(f=f===n?1:Qe(f),gn(c,f)):[]}function oI(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 o1(c){return c&&c.length?c[0]:n}function iI(c,f,v){var S=c==null?0:c.length;if(!S)return-1;var P=v==null?0:Qe(v);return P<0&&(P=nn(S+P,0)),$a(c,f,P)}function sI(c){var f=c==null?0:c.length;return f?Rr(c,0,-1):[]}var aI=rt(function(c){var f=jt(c,Rg);return f.length&&f[0]===c[0]?mg(f):[]}),lI=rt(function(c){var f=$r(c),v=jt(c,Rg);return f===$r(v)?f=n:v.pop(),v.length&&v[0]===c[0]?mg(v,Fe(f,2)):[]}),cI=rt(function(c){var f=$r(c),v=jt(c,Rg);return f=typeof f=="function"?f:n,f&&v.pop(),v.length&&v[0]===c[0]?mg(v,n,f):[]});function uI(c,f){return c==null?"":s5.call(c,f)}function $r(c){var f=c==null?0:c.length;return f?c[f-1]:n}function dI(c,f,v){var S=c==null?0:c.length;if(!S)return-1;var P=S;return v!==n&&(P=Qe(v),P=P<0?nn(S+P,0):Sn(P,S-1)),f===f?BT(c,f,P):ud(c,Fx,P,!0)}function fI(c,f){return c&&c.length?gw(c,Qe(f)):n}var hI=rt(i1);function i1(c,f){return c&&c.length&&f&&f.length?xg(c,f):c}function pI(c,f,v){return c&&c.length&&f&&f.length?xg(c,f,Fe(v,2)):c}function gI(c,f,v){return c&&c.length&&f&&f.length?xg(c,f,n,v):c}var mI=Fo(function(c,f){var v=c==null?0:c.length,S=fg(c,f);return bw(c,jt(f,function(P){return zo(P,v)?+P:P}).sort(Pw)),S});function vI(c,f){var v=[];if(!(c&&c.length))return v;var S=-1,P=[],A=c.length;for(f=Fe(f,3);++S<A;){var L=c[S];f(L,S,c)&&(v.push(L),P.push(S))}return bw(c,P),v}function jg(c){return c==null?c:u5.call(c)}function bI(c,f,v){var S=c==null?0:c.length;return S?(v&&typeof v!="number"&&Tn(c,f,v)?(f=0,v=S):(f=f==null?0:Qe(f),v=v===n?S:Qe(v)),Rr(c,f,v)):[]}function yI(c,f){return Md(c,f)}function xI(c,f,v){return Sg(c,f,Fe(v,2))}function wI(c,f){var v=c==null?0:c.length;if(v){var S=Md(c,f);if(S<v&&Br(c[S],f))return S}return-1}function _I(c,f){return Md(c,f,!0)}function SI(c,f,v){return Sg(c,f,Fe(v,2),!0)}function CI(c,f){var v=c==null?0:c.length;if(v){var S=Md(c,f,!0)-1;if(Br(c[S],f))return S}return-1}function EI(c){return c&&c.length?xw(c):[]}function RI(c,f){return c&&c.length?xw(c,Fe(f,2)):[]}function $I(c){var f=c==null?0:c.length;return f?Rr(c,1,f):[]}function PI(c,f,v){return c&&c.length?(f=v||f===n?1:Qe(f),Rr(c,0,f<0?0:f)):[]}function OI(c,f,v){var S=c==null?0:c.length;return S?(f=v||f===n?1:Qe(f),f=S-f,Rr(c,f<0?0:f,S)):[]}function MI(c,f){return c&&c.length?Dd(c,Fe(f,3),!1,!0):[]}function DI(c,f){return c&&c.length?Dd(c,Fe(f,3)):[]}var TI=rt(function(c){return mi(gn(c,1,Kt,!0))}),AI=rt(function(c){var f=$r(c);return Kt(f)&&(f=n),mi(gn(c,1,Kt,!0),Fe(f,2))}),II=rt(function(c){var f=$r(c);return f=typeof f=="function"?f:n,mi(gn(c,1,Kt,!0),n,f)});function kI(c){return c&&c.length?mi(c):[]}function NI(c,f){return c&&c.length?mi(c,Fe(f,2)):[]}function LI(c,f){return f=typeof f=="function"?f:n,c&&c.length?mi(c,n,f):[]}function Vg(c){if(!(c&&c.length))return[];var f=0;return c=di(c,function(v){if(Kt(v))return f=nn(v.length,f),!0}),og(f,function(v){return jt(c,tg(v))})}function s1(c,f){if(!(c&&c.length))return[];var v=Vg(c);return f==null?v:jt(v,function(S){return Qn(f,n,S)})}var FI=rt(function(c,f){return Kt(c)?lc(c,f):[]}),zI=rt(function(c){return Eg(di(c,Kt))}),jI=rt(function(c){var f=$r(c);return Kt(f)&&(f=n),Eg(di(c,Kt),Fe(f,2))}),VI=rt(function(c){var f=$r(c);return f=typeof f=="function"?f:n,Eg(di(c,Kt),n,f)}),HI=rt(Vg);function WI(c,f){return Cw(c||[],f||[],ac)}function BI(c,f){return Cw(c||[],f||[],dc)}var UI=rt(function(c){var f=c.length,v=f>1?c[f-1]:n;return v=typeof v=="function"?(c.pop(),v):n,s1(c,v)});function a1(c){var f=M(c);return f.__chain__=!0,f}function qI(c,f){return f(c),c}function jd(c,f){return f(c)}var GI=Fo(function(c){var f=c.length,v=f?c[0]:0,S=this.__wrapped__,P=function(A){return fg(A,c)};return f>1||this.__actions__.length||!(S instanceof ut)||!zo(v)?this.thru(P):(S=S.slice(v,+v+(f?1:0)),S.__actions__.push({func:jd,args:[P],thisArg:n}),new Cr(S,this.__chain__).thru(function(A){return f&&!A.length&&A.push(n),A}))});function YI(){return a1(this)}function KI(){return new Cr(this.value(),this.__chain__)}function XI(){this.__values__===n&&(this.__values__=w1(this.value()));var c=this.__index__>=this.__values__.length,f=c?n:this.__values__[this.__index__++];return{done:c,value:f}}function QI(){return this}function ZI(c){for(var f,v=this;v instanceof Ed;){var S=e1(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 JI(){var c=this.__wrapped__;if(c instanceof ut){var f=c;return this.__actions__.length&&(f=new ut(this)),f=f.reverse(),f.__actions__.push({func:jd,args:[jg],thisArg:n}),new Cr(f,this.__chain__)}return this.thru(jg)}function ek(){return Sw(this.__wrapped__,this.__actions__)}var tk=Td(function(c,f,v){St.call(c,v)?++c[v]:No(c,v,1)});function nk(c,f,v){var S=Ye(c)?Nx:q5;return v&&Tn(c,f,v)&&(f=n),S(c,Fe(f,3))}function rk(c,f){var v=Ye(c)?di:sw;return v(c,Fe(f,3))}var ok=Iw(t1),ik=Iw(n1);function sk(c,f){return gn(Vd(c,f),1)}function ak(c,f){return gn(Vd(c,f),q)}function lk(c,f,v){return v=v===n?1:Qe(v),gn(Vd(c,f),v)}function l1(c,f){var v=Ye(c)?_r:gi;return v(c,Fe(f,3))}function c1(c,f){var v=Ye(c)?$T:iw;return v(c,Fe(f,3))}var ck=Td(function(c,f,v){St.call(c,v)?c[v].push(f):No(c,v,[f])});function uk(c,f,v,S){c=Fn(c)?c:za(c),v=v&&!S?Qe(v):0;var P=c.length;return v<0&&(v=nn(P+v,0)),qd(c)?v<=P&&c.indexOf(f,v)>-1:!!P&&$a(c,f,v)>-1}var dk=rt(function(c,f,v){var S=-1,P=typeof f=="function",A=Fn(c)?se(c.length):[];return gi(c,function(L){A[++S]=P?Qn(f,L,v):cc(L,f,v)}),A}),fk=Td(function(c,f,v){No(c,v,f)});function Vd(c,f){var v=Ye(c)?jt:fw;return v(c,Fe(f,3))}function hk(c,f,v,S){return c==null?[]:(Ye(f)||(f=f==null?[]:[f]),v=S?n:v,Ye(v)||(v=v==null?[]:[v]),mw(c,f,v))}var pk=Td(function(c,f,v){c[v?0:1].push(f)},function(){return[[],[]]});function gk(c,f,v){var S=Ye(c)?Jp:jx,P=arguments.length<3;return S(c,Fe(f,4),v,P,gi)}function mk(c,f,v){var S=Ye(c)?PT:jx,P=arguments.length<3;return S(c,Fe(f,4),v,P,iw)}function vk(c,f){var v=Ye(c)?di:sw;return v(c,Bd(Fe(f,3)))}function bk(c){var f=Ye(c)?tw:uA;return f(c)}function yk(c,f,v){(v?Tn(c,f,v):f===n)?f=1:f=Qe(f);var S=Ye(c)?V5:dA;return S(c,f)}function xk(c){var f=Ye(c)?H5:hA;return f(c)}function wk(c){if(c==null)return 0;if(Fn(c))return qd(c)?Oa(c):c.length;var f=Cn(c);return f==Ie||f==Vt?c.size:bg(c).length}function _k(c,f,v){var S=Ye(c)?eg:pA;return v&&Tn(c,f,v)&&(f=n),S(c,Fe(f,3))}var Sk=rt(function(c,f){if(c==null)return[];var v=f.length;return v>1&&Tn(c,f[0],f[1])?f=[]:v>2&&Tn(f[0],f[1],f[2])&&(f=[f[0]]),mw(c,gn(f,1),[])}),Hd=r5||function(){return pn.Date.now()};function Ck(c,f){if(typeof f!="function")throw new Sr(s);return c=Qe(c),function(){if(--c<1)return f.apply(this,arguments)}}function u1(c,f,v){return f=v?n:f,f=c&&f==null?c.length:f,Lo(c,O,n,n,n,n,f)}function d1(c,f){var v;if(typeof f!="function")throw new Sr(s);return c=Qe(c),function(){return--c>0&&(v=f.apply(this,arguments)),c<=1&&(f=n),v}}var Hg=rt(function(c,f,v){var S=x;if(v.length){var P=hi(v,La(Hg));S|=E}return Lo(c,S,f,v,P)}),f1=rt(function(c,f,v){var S=x|w;if(v.length){var P=hi(v,La(f1));S|=E}return Lo(f,S,c,v,P)});function h1(c,f,v){f=v?n:f;var S=Lo(c,C,n,n,n,n,n,f);return S.placeholder=h1.placeholder,S}function p1(c,f,v){f=v?n:f;var S=Lo(c,R,n,n,n,n,n,f);return S.placeholder=p1.placeholder,S}function g1(c,f,v){var S,P,A,L,z,G,he=0,pe=!1,ye=!1,$e=!0;if(typeof c!="function")throw new Sr(s);f=Pr(f)||0,Ht(v)&&(pe=!!v.leading,ye="maxWait"in v,A=ye?nn(Pr(v.maxWait)||0,f):A,$e="trailing"in v?!!v.trailing:$e);function Ae(Xt){var Ur=S,Ho=P;return S=P=n,he=Xt,L=c.apply(Ho,Ur),L}function je(Xt){return he=Xt,z=pc(lt,f),pe?Ae(Xt):L}function et(Xt){var Ur=Xt-G,Ho=Xt-he,I1=f-Ur;return ye?Sn(I1,A-Ho):I1}function Ve(Xt){var Ur=Xt-G,Ho=Xt-he;return G===n||Ur>=f||Ur<0||ye&&Ho>=A}function lt(){var Xt=Hd();if(Ve(Xt))return ht(Xt);z=pc(lt,et(Xt))}function ht(Xt){return z=n,$e&&S?Ae(Xt):(S=P=n,L)}function tr(){z!==n&&Ew(z),he=0,S=G=P=z=n}function An(){return z===n?L:ht(Hd())}function nr(){var Xt=Hd(),Ur=Ve(Xt);if(S=arguments,P=this,G=Xt,Ur){if(z===n)return je(G);if(ye)return Ew(z),z=pc(lt,f),Ae(G)}return z===n&&(z=pc(lt,f)),L}return nr.cancel=tr,nr.flush=An,nr}var Ek=rt(function(c,f){return ow(c,1,f)}),Rk=rt(function(c,f,v){return ow(c,Pr(f)||0,v)});function $k(c){return Lo(c,I)}function Wd(c,f){if(typeof c!="function"||f!=null&&typeof f!="function")throw new Sr(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(Wd.Cache||ko),v}Wd.Cache=ko;function Bd(c){if(typeof c!="function")throw new Sr(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 Pk(c){return d1(2,c)}var Ok=gA(function(c,f){f=f.length==1&&Ye(f[0])?jt(f[0],Zn(Fe())):jt(gn(f,1),Zn(Fe()));var v=f.length;return rt(function(S){for(var P=-1,A=Sn(S.length,v);++P<A;)S[P]=f[P].call(this,S[P]);return Qn(c,this,S)})}),Wg=rt(function(c,f){var v=hi(f,La(Wg));return Lo(c,E,n,f,v)}),m1=rt(function(c,f){var v=hi(f,La(m1));return Lo(c,D,n,f,v)}),Mk=Fo(function(c,f){return Lo(c,T,n,n,n,f)});function Dk(c,f){if(typeof c!="function")throw new Sr(s);return f=f===n?f:Qe(f),rt(c,f)}function Tk(c,f){if(typeof c!="function")throw new Sr(s);return f=f==null?0:nn(Qe(f),0),rt(function(v){var S=v[f],P=bi(v,0,f);return S&&fi(P,S),Qn(c,this,P)})}function Ak(c,f,v){var S=!0,P=!0;if(typeof c!="function")throw new Sr(s);return Ht(v)&&(S="leading"in v?!!v.leading:S,P="trailing"in v?!!v.trailing:P),g1(c,f,{leading:S,maxWait:f,trailing:P})}function Ik(c){return u1(c,1)}function kk(c,f){return Wg($g(f),c)}function Nk(){if(!arguments.length)return[];var c=arguments[0];return Ye(c)?c:[c]}function Lk(c){return Er(c,g)}function Fk(c,f){return f=typeof f=="function"?f:n,Er(c,g,f)}function zk(c){return Er(c,h|g)}function jk(c,f){return f=typeof f=="function"?f:n,Er(c,h|g,f)}function Vk(c,f){return f==null||rw(c,f,cn(f))}function Br(c,f){return c===f||c!==c&&f!==f}var Hk=Nd(gg),Wk=Nd(function(c,f){return c>=f}),Ss=cw(function(){return arguments}())?cw:function(c){return Ut(c)&&St.call(c,"callee")&&!Kx.call(c,"callee")},Ye=se.isArray,Bk=Mx?Zn(Mx):Z5;function Fn(c){return c!=null&&Ud(c.length)&&!jo(c)}function Kt(c){return Ut(c)&&Fn(c)}function Uk(c){return c===!0||c===!1||Ut(c)&&Dn(c)==ee}var yi=i5||em,qk=Dx?Zn(Dx):J5;function Gk(c){return Ut(c)&&c.nodeType===1&&!gc(c)}function Yk(c){if(c==null)return!0;if(Fn(c)&&(Ye(c)||typeof c=="string"||typeof c.splice=="function"||yi(c)||Fa(c)||Ss(c)))return!c.length;var f=Cn(c);if(f==Ie||f==Vt)return!c.size;if(hc(c))return!bg(c).length;for(var v in c)if(St.call(c,v))return!1;return!0}function Kk(c,f){return uc(c,f)}function Xk(c,f,v){v=typeof v=="function"?v:n;var S=v?v(c,f):n;return S===n?uc(c,f,n,v):!!S}function Bg(c){if(!Ut(c))return!1;var f=Dn(c);return f==be||f==re||typeof c.message=="string"&&typeof c.name=="string"&&!gc(c)}function Qk(c){return typeof c=="number"&&Qx(c)}function jo(c){if(!Ht(c))return!1;var f=Dn(c);return f==Q||f==Oe||f==de||f==ft}function v1(c){return typeof c=="number"&&c==Qe(c)}function Ud(c){return typeof c=="number"&&c>-1&&c%1==0&&c<=X}function Ht(c){var f=typeof c;return c!=null&&(f=="object"||f=="function")}function Ut(c){return c!=null&&typeof c=="object"}var b1=Tx?Zn(Tx):tA;function Zk(c,f){return c===f||vg(c,f,Ig(f))}function Jk(c,f,v){return v=typeof v=="function"?v:n,vg(c,f,Ig(f),v)}function e7(c){return y1(c)&&c!=+c}function t7(c){if(FA(c))throw new qe(i);return uw(c)}function n7(c){return c===null}function r7(c){return c==null}function y1(c){return typeof c=="number"||Ut(c)&&Dn(c)==ze}function gc(c){if(!Ut(c)||Dn(c)!=pt)return!1;var f=bd(c);if(f===null)return!0;var v=St.call(f,"constructor")&&f.constructor;return typeof v=="function"&&v instanceof v&&pd.call(v)==JT}var Ug=Ax?Zn(Ax):nA;function o7(c){return v1(c)&&c>=-X&&c<=X}var x1=Ix?Zn(Ix):rA;function qd(c){return typeof c=="string"||!Ye(c)&&Ut(c)&&Dn(c)==wn}function er(c){return typeof c=="symbol"||Ut(c)&&Dn(c)==en}var Fa=kx?Zn(kx):oA;function i7(c){return c===n}function s7(c){return Ut(c)&&Cn(c)==jr}function a7(c){return Ut(c)&&Dn(c)==Ji}var l7=Nd(yg),c7=Nd(function(c,f){return c<=f});function w1(c){if(!c)return[];if(Fn(c))return qd(c)?Hr(c):Ln(c);if(nc&&c[nc])return VT(c[nc]());var f=Cn(c),v=f==Ie?sg:f==Vt?dd:za;return v(c)}function Vo(c){if(!c)return c===0?c:0;if(c=Pr(c),c===q||c===-q){var f=c<0?-1:1;return f*ie}return c===c?c:0}function Qe(c){var f=Vo(c),v=f%1;return f===f?v?f-v:f:0}function _1(c){return c?ys(Qe(c),0,V):0}function Pr(c){if(typeof c=="number")return c;if(er(c))return j;if(Ht(c)){var f=typeof c.valueOf=="function"?c.valueOf():c;c=Ht(f)?f+"":f}if(typeof c!="string")return c===0?c:+c;c=Vx(c);var v=Re.test(c);return v||Be.test(c)?CT(c.slice(2),v?2:8):Pe.test(c)?j:+c}function S1(c){return io(c,zn(c))}function u7(c){return c?ys(Qe(c),-X,X):c===0?c:0}function yt(c){return c==null?"":Jn(c)}var d7=ka(function(c,f){if(hc(f)||Fn(f)){io(f,cn(f),c);return}for(var v in f)St.call(f,v)&&ac(c,v,f[v])}),C1=ka(function(c,f){io(f,zn(f),c)}),Gd=ka(function(c,f,v,S){io(f,zn(f),c,S)}),f7=ka(function(c,f,v,S){io(f,cn(f),c,S)}),h7=Fo(fg);function p7(c,f){var v=Ia(c);return f==null?v:nw(v,f)}var g7=rt(function(c,f){c=$t(c);var v=-1,S=f.length,P=S>2?f[2]:n;for(P&&Tn(f[0],f[1],P)&&(S=1);++v<S;)for(var A=f[v],L=zn(A),z=-1,G=L.length;++z<G;){var he=L[z],pe=c[he];(pe===n||Br(pe,Da[he])&&!St.call(c,he))&&(c[he]=A[he])}return c}),m7=rt(function(c){return c.push(n,Vw),Qn(E1,n,c)});function v7(c,f){return Lx(c,Fe(f,3),oo)}function b7(c,f){return Lx(c,Fe(f,3),pg)}function y7(c,f){return c==null?c:hg(c,Fe(f,3),zn)}function x7(c,f){return c==null?c:aw(c,Fe(f,3),zn)}function w7(c,f){return c&&oo(c,Fe(f,3))}function _7(c,f){return c&&pg(c,Fe(f,3))}function S7(c){return c==null?[]:Pd(c,cn(c))}function C7(c){return c==null?[]:Pd(c,zn(c))}function qg(c,f,v){var S=c==null?n:xs(c,f);return S===n?v:S}function E7(c,f){return c!=null&&Bw(c,f,Y5)}function Gg(c,f){return c!=null&&Bw(c,f,K5)}var R7=Nw(function(c,f,v){f!=null&&typeof f.toString!="function"&&(f=gd.call(f)),c[f]=v},Kg(jn)),$7=Nw(function(c,f,v){f!=null&&typeof f.toString!="function"&&(f=gd.call(f)),St.call(c,f)?c[f].push(v):c[f]=[v]},Fe),P7=rt(cc);function cn(c){return Fn(c)?ew(c):bg(c)}function zn(c){return Fn(c)?ew(c,!0):iA(c)}function O7(c,f){var v={};return f=Fe(f,3),oo(c,function(S,P,A){No(v,f(S,P,A),S)}),v}function M7(c,f){var v={};return f=Fe(f,3),oo(c,function(S,P,A){No(v,P,f(S,P,A))}),v}var D7=ka(function(c,f,v){Od(c,f,v)}),E1=ka(function(c,f,v,S){Od(c,f,v,S)}),T7=Fo(function(c,f){var v={};if(c==null)return v;var S=!1;f=jt(f,function(A){return A=vi(A,c),S||(S=A.length>1),A}),io(c,Tg(c),v),S&&(v=Er(v,h|p|g,RA));for(var P=f.length;P--;)Cg(v,f[P]);return v});function A7(c,f){return R1(c,Bd(Fe(f)))}var I7=Fo(function(c,f){return c==null?{}:aA(c,f)});function R1(c,f){if(c==null)return{};var v=jt(Tg(c),function(S){return[S]});return f=Fe(f),vw(c,v,function(S,P){return f(S,P[0])})}function k7(c,f,v){f=vi(f,c);var S=-1,P=f.length;for(P||(P=1,c=n);++S<P;){var A=c==null?n:c[so(f[S])];A===n&&(S=P,A=v),c=jo(A)?A.call(c):A}return c}function N7(c,f,v){return c==null?c:dc(c,f,v)}function L7(c,f,v,S){return S=typeof S=="function"?S:n,c==null?c:dc(c,f,v,S)}var $1=zw(cn),P1=zw(zn);function F7(c,f,v){var S=Ye(c),P=S||yi(c)||Fa(c);if(f=Fe(f,4),v==null){var A=c&&c.constructor;P?v=S?new A:[]:Ht(c)?v=jo(A)?Ia(bd(c)):{}:v={}}return(P?_r:oo)(c,function(L,z,G){return f(v,L,z,G)}),v}function z7(c,f){return c==null?!0:Cg(c,f)}function j7(c,f,v){return c==null?c:_w(c,f,$g(v))}function V7(c,f,v,S){return S=typeof S=="function"?S:n,c==null?c:_w(c,f,$g(v),S)}function za(c){return c==null?[]:ig(c,cn(c))}function H7(c){return c==null?[]:ig(c,zn(c))}function W7(c,f,v){return v===n&&(v=f,f=n),v!==n&&(v=Pr(v),v=v===v?v:0),f!==n&&(f=Pr(f),f=f===f?f:0),ys(Pr(c),f,v)}function B7(c,f,v){return f=Vo(f),v===n?(v=f,f=0):v=Vo(v),c=Pr(c),X5(c,f,v)}function U7(c,f,v){if(v&&typeof v!="boolean"&&Tn(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=Vo(c),f===n?(f=c,c=0):f=Vo(f)),c>f){var S=c;c=f,f=S}if(v||c%1||f%1){var P=Zx();return Sn(c+P*(f-c+ST("1e-"+((P+"").length-1))),f)}return wg(c,f)}var q7=Na(function(c,f,v){return f=f.toLowerCase(),c+(v?O1(f):f)});function O1(c){return Yg(yt(c).toLowerCase())}function M1(c){return c=yt(c),c&&c.replace(Rt,NT).replace(hT,"")}function G7(c,f,v){c=yt(c),f=Jn(f);var S=c.length;v=v===n?S:ys(Qe(v),0,S);var P=v;return v-=f.length,v>=0&&c.slice(v,P)==f}function Y7(c){return c=yt(c),c&&as.test(c)?c.replace(ro,LT):c}function K7(c){return c=yt(c),c&&fs.test(c)?c.replace(ds,"\\$&"):c}var X7=Na(function(c,f,v){return c+(v?"-":"")+f.toLowerCase()}),Q7=Na(function(c,f,v){return c+(v?" ":"")+f.toLowerCase()}),Z7=Aw("toLowerCase");function J7(c,f,v){c=yt(c),f=Qe(f);var S=f?Oa(c):0;if(!f||S>=f)return c;var P=(f-S)/2;return kd(_d(P),v)+c+kd(wd(P),v)}function e3(c,f,v){c=yt(c),f=Qe(f);var S=f?Oa(c):0;return f&&S<f?c+kd(f-S,v):c}function t3(c,f,v){c=yt(c),f=Qe(f);var S=f?Oa(c):0;return f&&S<f?kd(f-S,v)+c:c}function n3(c,f,v){return v||f==null?f=0:f&&(f=+f),c5(yt(c).replace(hs,""),f||0)}function r3(c,f,v){return(v?Tn(c,f,v):f===n)?f=1:f=Qe(f),_g(yt(c),f)}function o3(){var c=arguments,f=yt(c[0]);return c.length<3?f:f.replace(c[1],c[2])}var i3=Na(function(c,f,v){return c+(v?"_":"")+f.toLowerCase()});function s3(c,f,v){return v&&typeof v!="number"&&Tn(c,f,v)&&(f=v=n),v=v===n?V:v>>>0,v?(c=yt(c),c&&(typeof f=="string"||f!=null&&!Ug(f))&&(f=Jn(f),!f&&Pa(c))?bi(Hr(c),0,v):c.split(f,v)):[]}var a3=Na(function(c,f,v){return c+(v?" ":"")+Yg(f)});function l3(c,f,v){return c=yt(c),v=v==null?0:ys(Qe(v),0,c.length),f=Jn(f),c.slice(v,v+f.length)==f}function c3(c,f,v){var S=M.templateSettings;v&&Tn(c,f,v)&&(f=n),c=yt(c),f=Gd({},f,S,jw);var P=Gd({},f.imports,S.imports,jw),A=cn(P),L=ig(P,A),z,G,he=0,pe=f.interpolate||ln,ye="__p += '",$e=ag((f.escape||ln).source+"|"+pe.source+"|"+(pe===Ea?Te:ln).source+"|"+(f.evaluate||ln).source+"|$","g"),Ae="//# sourceURL="+(St.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++bT+"]")+`
|
|
72
|
+
`;c.replace($e,function(Ve,lt,ht,tr,An,nr){return ht||(ht=tr),ye+=c.slice(he,nr).replace(ps,FT),lt&&(z=!0,ye+=`' +
|
|
73
|
+
__e(`+lt+`) +
|
|
74
|
+
'`),An&&(G=!0,ye+=`';
|
|
75
|
+
`+An+`;
|
|
76
|
+
__p += '`),ht&&(ye+=`' +
|
|
77
|
+
((__t = (`+ht+`)) == null ? '' : __t) +
|
|
78
|
+
'`),he=nr+Ve.length,Ve}),ye+=`';
|
|
79
|
+
`;var je=St.call(f,"variable")&&f.variable;if(!je)ye=`with (obj) {
|
|
80
|
+
`+ye+`
|
|
81
|
+
}
|
|
82
|
+
`;else if(oe.test(je))throw new qe(a);ye=(G?ye.replace(Kl,""):ye).replace(To,"$1").replace(ss,"$1;"),ye="function("+(je||"obj")+`) {
|
|
83
|
+
`+(je?"":`obj || (obj = {});
|
|
84
|
+
`)+"var __t, __p = ''"+(z?", __e = _.escape":"")+(G?`, __j = Array.prototype.join;
|
|
85
|
+
function print() { __p += __j.call(arguments, '') }
|
|
86
|
+
`:`;
|
|
87
|
+
`)+ye+`return __p
|
|
88
|
+
}`;var et=T1(function(){return vt(A,Ae+"return "+ye).apply(n,L)});if(et.source=ye,Bg(et))throw et;return et}function u3(c){return yt(c).toLowerCase()}function d3(c){return yt(c).toUpperCase()}function f3(c,f,v){if(c=yt(c),c&&(v||f===n))return Vx(c);if(!c||!(f=Jn(f)))return c;var S=Hr(c),P=Hr(f),A=Hx(S,P),L=Wx(S,P)+1;return bi(S,A,L).join("")}function h3(c,f,v){if(c=yt(c),c&&(v||f===n))return c.slice(0,Ux(c)+1);if(!c||!(f=Jn(f)))return c;var S=Hr(c),P=Wx(S,Hr(f))+1;return bi(S,0,P).join("")}function p3(c,f,v){if(c=yt(c),c&&(v||f===n))return c.replace(hs,"");if(!c||!(f=Jn(f)))return c;var S=Hr(c),P=Hx(S,Hr(f));return bi(S,P).join("")}function g3(c,f){var v=N,S=W;if(Ht(f)){var P="separator"in f?f.separator:P;v="length"in f?Qe(f.length):v,S="omission"in f?Jn(f.omission):S}c=yt(c);var A=c.length;if(Pa(c)){var L=Hr(c);A=L.length}if(v>=A)return c;var z=v-Oa(S);if(z<1)return S;var G=L?bi(L,0,z).join(""):c.slice(0,z);if(P===n)return G+S;if(L&&(z+=G.length-z),Ug(P)){if(c.slice(z).search(P)){var he,pe=G;for(P.global||(P=ag(P.source,yt(ke.exec(P))+"g")),P.lastIndex=0;he=P.exec(pe);)var ye=he.index;G=G.slice(0,ye===n?z:ye)}}else if(c.indexOf(Jn(P),z)!=z){var $e=G.lastIndexOf(P);$e>-1&&(G=G.slice(0,$e))}return G+S}function m3(c){return c=yt(c),c&&Ao.test(c)?c.replace(_n,UT):c}var v3=Na(function(c,f,v){return c+(v?" ":"")+f.toUpperCase()}),Yg=Aw("toUpperCase");function D1(c,f,v){return c=yt(c),f=v?n:f,f===n?jT(c)?YT(c):DT(c):c.match(f)||[]}var T1=rt(function(c,f){try{return Qn(c,n,f)}catch(v){return Bg(v)?v:new qe(v)}}),b3=Fo(function(c,f){return _r(f,function(v){v=so(v),No(c,v,Hg(c[v],c))}),c});function y3(c){var f=c==null?0:c.length,v=Fe();return c=f?jt(c,function(S){if(typeof S[1]!="function")throw new Sr(s);return[v(S[0]),S[1]]}):[],rt(function(S){for(var P=-1;++P<f;){var A=c[P];if(Qn(A[0],this,S))return Qn(A[1],this,S)}})}function x3(c){return U5(Er(c,h))}function Kg(c){return function(){return c}}function w3(c,f){return c==null||c!==c?f:c}var _3=kw(),S3=kw(!0);function jn(c){return c}function Xg(c){return dw(typeof c=="function"?c:Er(c,h))}function C3(c){return hw(Er(c,h))}function E3(c,f){return pw(c,Er(f,h))}var R3=rt(function(c,f){return function(v){return cc(v,c,f)}}),$3=rt(function(c,f){return function(v){return cc(c,v,f)}});function Qg(c,f,v){var S=cn(f),P=Pd(f,S);v==null&&!(Ht(f)&&(P.length||!S.length))&&(v=f,f=c,c=this,P=Pd(f,cn(f)));var A=!(Ht(v)&&"chain"in v)||!!v.chain,L=jo(c);return _r(P,function(z){var G=f[z];c[z]=G,L&&(c.prototype[z]=function(){var he=this.__chain__;if(A||he){var pe=c(this.__wrapped__),ye=pe.__actions__=Ln(this.__actions__);return ye.push({func:G,args:arguments,thisArg:c}),pe.__chain__=he,pe}return G.apply(c,fi([this.value()],arguments))})}),c}function P3(){return pn._===this&&(pn._=e5),this}function Zg(){}function O3(c){return c=Qe(c),rt(function(f){return gw(f,c)})}var M3=Og(jt),D3=Og(Nx),T3=Og(eg);function A1(c){return Ng(c)?tg(so(c)):lA(c)}function A3(c){return function(f){return c==null?n:xs(c,f)}}var I3=Lw(),k3=Lw(!0);function Jg(){return[]}function em(){return!1}function N3(){return{}}function L3(){return""}function F3(){return!0}function z3(c,f){if(c=Qe(c),c<1||c>X)return[];var v=V,S=Sn(c,V);f=Fe(f),c-=V;for(var P=og(S,f);++v<c;)f(v);return P}function j3(c){return Ye(c)?jt(c,so):er(c)?[c]:Ln(Jw(yt(c)))}function V3(c){var f=++ZT;return yt(c)+f}var H3=Id(function(c,f){return c+f},0),W3=Mg("ceil"),B3=Id(function(c,f){return c/f},1),U3=Mg("floor");function q3(c){return c&&c.length?$d(c,jn,gg):n}function G3(c,f){return c&&c.length?$d(c,Fe(f,2),gg):n}function Y3(c){return zx(c,jn)}function K3(c,f){return zx(c,Fe(f,2))}function X3(c){return c&&c.length?$d(c,jn,yg):n}function Q3(c,f){return c&&c.length?$d(c,Fe(f,2),yg):n}var Z3=Id(function(c,f){return c*f},1),J3=Mg("round"),eN=Id(function(c,f){return c-f},0);function tN(c){return c&&c.length?rg(c,jn):0}function nN(c,f){return c&&c.length?rg(c,Fe(f,2)):0}return M.after=Ck,M.ary=u1,M.assign=d7,M.assignIn=C1,M.assignInWith=Gd,M.assignWith=f7,M.at=h7,M.before=d1,M.bind=Hg,M.bindAll=b3,M.bindKey=f1,M.castArray=Nk,M.chain=a1,M.chunk=UA,M.compact=qA,M.concat=GA,M.cond=y3,M.conforms=x3,M.constant=Kg,M.countBy=tk,M.create=p7,M.curry=h1,M.curryRight=p1,M.debounce=g1,M.defaults=g7,M.defaultsDeep=m7,M.defer=Ek,M.delay=Rk,M.difference=YA,M.differenceBy=KA,M.differenceWith=XA,M.drop=QA,M.dropRight=ZA,M.dropRightWhile=JA,M.dropWhile=eI,M.fill=tI,M.filter=rk,M.flatMap=sk,M.flatMapDeep=ak,M.flatMapDepth=lk,M.flatten=r1,M.flattenDeep=nI,M.flattenDepth=rI,M.flip=$k,M.flow=_3,M.flowRight=S3,M.fromPairs=oI,M.functions=S7,M.functionsIn=C7,M.groupBy=ck,M.initial=sI,M.intersection=aI,M.intersectionBy=lI,M.intersectionWith=cI,M.invert=R7,M.invertBy=$7,M.invokeMap=dk,M.iteratee=Xg,M.keyBy=fk,M.keys=cn,M.keysIn=zn,M.map=Vd,M.mapKeys=O7,M.mapValues=M7,M.matches=C3,M.matchesProperty=E3,M.memoize=Wd,M.merge=D7,M.mergeWith=E1,M.method=R3,M.methodOf=$3,M.mixin=Qg,M.negate=Bd,M.nthArg=O3,M.omit=T7,M.omitBy=A7,M.once=Pk,M.orderBy=hk,M.over=M3,M.overArgs=Ok,M.overEvery=D3,M.overSome=T3,M.partial=Wg,M.partialRight=m1,M.partition=pk,M.pick=I7,M.pickBy=R1,M.property=A1,M.propertyOf=A3,M.pull=hI,M.pullAll=i1,M.pullAllBy=pI,M.pullAllWith=gI,M.pullAt=mI,M.range=I3,M.rangeRight=k3,M.rearg=Mk,M.reject=vk,M.remove=vI,M.rest=Dk,M.reverse=jg,M.sampleSize=yk,M.set=N7,M.setWith=L7,M.shuffle=xk,M.slice=bI,M.sortBy=Sk,M.sortedUniq=EI,M.sortedUniqBy=RI,M.split=s3,M.spread=Tk,M.tail=$I,M.take=PI,M.takeRight=OI,M.takeRightWhile=MI,M.takeWhile=DI,M.tap=qI,M.throttle=Ak,M.thru=jd,M.toArray=w1,M.toPairs=$1,M.toPairsIn=P1,M.toPath=j3,M.toPlainObject=S1,M.transform=F7,M.unary=Ik,M.union=TI,M.unionBy=AI,M.unionWith=II,M.uniq=kI,M.uniqBy=NI,M.uniqWith=LI,M.unset=z7,M.unzip=Vg,M.unzipWith=s1,M.update=j7,M.updateWith=V7,M.values=za,M.valuesIn=H7,M.without=FI,M.words=D1,M.wrap=kk,M.xor=zI,M.xorBy=jI,M.xorWith=VI,M.zip=HI,M.zipObject=WI,M.zipObjectDeep=BI,M.zipWith=UI,M.entries=$1,M.entriesIn=P1,M.extend=C1,M.extendWith=Gd,Qg(M,M),M.add=H3,M.attempt=T1,M.camelCase=q7,M.capitalize=O1,M.ceil=W3,M.clamp=W7,M.clone=Lk,M.cloneDeep=zk,M.cloneDeepWith=jk,M.cloneWith=Fk,M.conformsTo=Vk,M.deburr=M1,M.defaultTo=w3,M.divide=B3,M.endsWith=G7,M.eq=Br,M.escape=Y7,M.escapeRegExp=K7,M.every=nk,M.find=ok,M.findIndex=t1,M.findKey=v7,M.findLast=ik,M.findLastIndex=n1,M.findLastKey=b7,M.floor=U3,M.forEach=l1,M.forEachRight=c1,M.forIn=y7,M.forInRight=x7,M.forOwn=w7,M.forOwnRight=_7,M.get=qg,M.gt=Hk,M.gte=Wk,M.has=E7,M.hasIn=Gg,M.head=o1,M.identity=jn,M.includes=uk,M.indexOf=iI,M.inRange=B7,M.invoke=P7,M.isArguments=Ss,M.isArray=Ye,M.isArrayBuffer=Bk,M.isArrayLike=Fn,M.isArrayLikeObject=Kt,M.isBoolean=Uk,M.isBuffer=yi,M.isDate=qk,M.isElement=Gk,M.isEmpty=Yk,M.isEqual=Kk,M.isEqualWith=Xk,M.isError=Bg,M.isFinite=Qk,M.isFunction=jo,M.isInteger=v1,M.isLength=Ud,M.isMap=b1,M.isMatch=Zk,M.isMatchWith=Jk,M.isNaN=e7,M.isNative=t7,M.isNil=r7,M.isNull=n7,M.isNumber=y1,M.isObject=Ht,M.isObjectLike=Ut,M.isPlainObject=gc,M.isRegExp=Ug,M.isSafeInteger=o7,M.isSet=x1,M.isString=qd,M.isSymbol=er,M.isTypedArray=Fa,M.isUndefined=i7,M.isWeakMap=s7,M.isWeakSet=a7,M.join=uI,M.kebabCase=X7,M.last=$r,M.lastIndexOf=dI,M.lowerCase=Q7,M.lowerFirst=Z7,M.lt=l7,M.lte=c7,M.max=q3,M.maxBy=G3,M.mean=Y3,M.meanBy=K3,M.min=X3,M.minBy=Q3,M.stubArray=Jg,M.stubFalse=em,M.stubObject=N3,M.stubString=L3,M.stubTrue=F3,M.multiply=Z3,M.nth=fI,M.noConflict=P3,M.noop=Zg,M.now=Hd,M.pad=J7,M.padEnd=e3,M.padStart=t3,M.parseInt=n3,M.random=U7,M.reduce=gk,M.reduceRight=mk,M.repeat=r3,M.replace=o3,M.result=k7,M.round=J3,M.runInContext=B,M.sample=bk,M.size=wk,M.snakeCase=i3,M.some=_k,M.sortedIndex=yI,M.sortedIndexBy=xI,M.sortedIndexOf=wI,M.sortedLastIndex=_I,M.sortedLastIndexBy=SI,M.sortedLastIndexOf=CI,M.startCase=a3,M.startsWith=l3,M.subtract=eN,M.sum=tN,M.sumBy=nN,M.template=c3,M.times=z3,M.toFinite=Vo,M.toInteger=Qe,M.toLength=_1,M.toLower=u3,M.toNumber=Pr,M.toSafeInteger=u7,M.toString=yt,M.toUpper=d3,M.trim=f3,M.trimEnd=h3,M.trimStart=p3,M.truncate=g3,M.unescape=m3,M.uniqueId=V3,M.upperCase=v3,M.upperFirst=Yg,M.each=l1,M.eachRight=c1,M.first=o1,Qg(M,function(){var c={};return oo(M,function(f,v){St.call(M.prototype,v)||(c[v]=f)}),c}(),{chain:!1}),M.VERSION=r,_r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(c){M[c].placeholder=M}),_r(["drop","take"],function(c,f){ut.prototype[c]=function(v){v=v===n?1:nn(Qe(v),0);var S=this.__filtered__&&!f?new ut(this):this.clone();return S.__filtered__?S.__takeCount__=Sn(v,S.__takeCount__):S.__views__.push({size:Sn(v,V),type:c+(S.__dir__<0?"Right":"")}),S},ut.prototype[c+"Right"]=function(v){return this.reverse()[c](v).reverse()}}),_r(["filter","map","takeWhile"],function(c,f){var v=f+1,S=v==J||v==Z;ut.prototype[c]=function(P){var A=this.clone();return A.__iteratees__.push({iteratee:Fe(P,3),type:v}),A.__filtered__=A.__filtered__||S,A}}),_r(["head","last"],function(c,f){var v="take"+(f?"Right":"");ut.prototype[c]=function(){return this[v](1).value()[0]}}),_r(["initial","tail"],function(c,f){var v="drop"+(f?"":"Right");ut.prototype[c]=function(){return this.__filtered__?new ut(this):this[v](1)}}),ut.prototype.compact=function(){return this.filter(jn)},ut.prototype.find=function(c){return this.filter(c).head()},ut.prototype.findLast=function(c){return this.reverse().find(c)},ut.prototype.invokeMap=rt(function(c,f){return typeof c=="function"?new ut(this):this.map(function(v){return cc(v,c,f)})}),ut.prototype.reject=function(c){return this.filter(Bd(Fe(c)))},ut.prototype.slice=function(c,f){c=Qe(c);var v=this;return v.__filtered__&&(c>0||f<0)?new ut(v):(c<0?v=v.takeRight(-c):c&&(v=v.drop(c)),f!==n&&(f=Qe(f),v=f<0?v.dropRight(-f):v.take(f-c)),v)},ut.prototype.takeRightWhile=function(c){return this.reverse().takeWhile(c).reverse()},ut.prototype.toArray=function(){return this.take(V)},oo(ut.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,G=L instanceof ut,he=z[0],pe=G||Ye(L),ye=function(lt){var ht=P.apply(M,fi([lt],z));return S&&$e?ht[0]:ht};pe&&v&&typeof he=="function"&&he.length!=1&&(G=pe=!1);var $e=this.__chain__,Ae=!!this.__actions__.length,je=A&&!$e,et=G&&!Ae;if(!A&&pe){L=et?L:new ut(this);var Ve=c.apply(L,z);return Ve.__actions__.push({func:jd,args:[ye],thisArg:n}),new Cr(Ve,$e)}return je&&et?c.apply(this,z):(Ve=this.thru(ye),je?S?Ve.value()[0]:Ve.value():Ve)})}),_r(["pop","push","shift","sort","splice","unshift"],function(c){var f=fd[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)})}}),oo(ut.prototype,function(c,f){var v=M[f];if(v){var S=v.name+"";St.call(Aa,S)||(Aa[S]=[]),Aa[S].push({name:f,func:v})}}),Aa[Ad(n,w).name]=[{name:"wrapper",func:n}],ut.prototype.clone=m5,ut.prototype.reverse=v5,ut.prototype.value=b5,M.prototype.at=GI,M.prototype.chain=YI,M.prototype.commit=KI,M.prototype.next=XI,M.prototype.plant=ZI,M.prototype.reverse=JI,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=ek,M.prototype.first=M.prototype.head,nc&&(M.prototype[nc]=QI),M},Ma=KT();gs?((gs.exports=Ma)._=Ma,Xp._=Ma):pn._=Ma}).call(ks)})(lh,lh.exports);var tl=lh.exports;const ia=zu(tl),l_=["lg","md","sm","xs","xxs"],Ee=AE()(jE((e,t)=>({currentBreakpoint:"lg",dashboard:{id:"",style:$v},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&&tl.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&&tl.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&&tl.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&&tl.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&&tl.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={}),l_.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=l_.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)=>{s9({card:n,dataPoint:r,set:e,get:t})}}}))),pa=()=>Ee(e=>e.actions),a9={theme:"system",setTheme:()=>null},nR=m.createContext(a9);function l9({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(nR.Provider,{...r,value:s,children:e})}const rR=()=>{const e=m.useContext(nR);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};async function c9(e,t,n){return await(await fetch(`https://semaphor.cloud/api/v1/dashboard?id=${e}&version=${t}`,{headers:{Authorization:`Bearer ${n}`}})).json()}function oR(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function c_(e,t){const n=oR(e);return n==="dark"?ia.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function u9({id:e,version:t,authToken:n,customStyle:r,currentTheme:o,onSave:i,onEvent:s}){const{data:a,refetch:l,isLoading:u,isError:d}=go({queryKey:[e],queryFn:()=>c9(e,t||"",n==null?void 0:n.accessToken),enabled:!1}),{theme:h,setTheme:p}=rR(),{setDashboard:g,setSelectedSheetId:b,setStyle:y,setOnSaveFunction:x}=Ee(O=>O.actions);Ee(O=>O.actions.setCustomCards);const w=Ee(O=>O.actions.setFilterValues),_=Ee(O=>O.actions.setBookmarkKey),C=Ee(O=>O.actions.setAuthToken),R=Ee(O=>O.actions.setThemeStyle),E=Ee(O=>O.actions.setDashboardTheme),D=Ee(O=>O.actions.setOnEvent);return m.useEffect(()=>{if(h){const O=oR(h);E(O)}},[h,E]),m.useEffect(()=>{o&&p(o)},[o,p]),m.useEffect(()=>{const O=ia.cloneDeep($v);if(r){const T=ia.merge(O,r),I=c_(h,T);R(I),y(T)}else{const T=c_(h,O);R(T),y($v)}},[h,r,y,R]),m.useEffect(()=>{var W;if(!a||!a.dashboard)return;const O=a.dashboard,T=cM(O.id),I=JSON.parse(localStorage.getItem(T)||"[]"),N=I.find(Y=>Y.default===!0);if(N)g(N.template),_(N.name),N.filterValues&&w(N.filterValues);else{g(O);const Y=I.find(ue=>(ue==null?void 0:ue.name)==="Original");Y?Y.template=O:I.push({name:"Original",template:O,default:!1}),localStorage.setItem(T,JSON.stringify(I))}b((W=O.sheets)==null?void 0:W[0].id)},[a,g,b,w,_]),m.useEffect(()=>{i&&x(i),s&&D(s)},[i,x,s,D]),m.useEffect(()=>{n&&n.accessToken&&(C(n),l())},[n,l,C]),{isLoading:u,isError:d}}function Zb({className:e,...t}){return k.jsx("div",{className:Se("animate-pulse rounded-md bg-muted",e),...t})}function iR({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(w=>w.selectedSheetId);const g=Ee(w=>w.themeStyle),b=Ee(w=>w.onEvent),{isLoading:y,isError:x}=u9({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(Zb,{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 fn(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,d9(o,...t)]}function d9(...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 f9(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function qh(...e){return t=>e.forEach(n=>f9(n,t))}function Xe(...e){return m.useCallback(qh(...e),e)}const ri=m.forwardRef((e,t)=>{const{children:n,...r}=e,o=m.Children.toArray(n),i=o.find(h9);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(jv,ne({},r,{ref:t}),m.isValidElement(s)?m.cloneElement(s,void 0,a):null)}return m.createElement(jv,ne({},r,{ref:t}),n)});ri.displayName="Slot";const jv=m.forwardRef((e,t)=>{const{children:n,...r}=e;return m.isValidElement(n)?m.cloneElement(n,{...p9(r,n.props),ref:t?qh(t,n.ref):n.ref}):m.Children.count(n)>1?m.Children.only(null):null});jv.displayName="SlotClone";const sR=({children:e})=>m.createElement(m.Fragment,null,e);function h9(e){return m.isValidElement(e)&&e.type===sR}function p9(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 Gh(e){const t=e+"CollectionProvider",[n,r]=fn(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=g=>{const{scope:b,children:y}=g,x=m.useRef(null),w=m.useRef(new Map).current;return m.createElement(o,{scope:b,itemMap:w,collectionRef:x},y)},a=e+"CollectionSlot",l=m.forwardRef((g,b)=>{const{scope:y,children:x}=g,w=i(a,y),_=Xe(b,w.collectionRef);return m.createElement(ri,{ref:_},x)}),u=e+"CollectionItemSlot",d="data-radix-collection-item",h=m.forwardRef((g,b)=>{const{scope:y,children:x,...w}=g,_=m.useRef(null),C=Xe(b,_),R=i(u,y);return m.useEffect(()=>(R.itemMap.set(_,{ref:_,...w}),()=>void R.itemMap.delete(_))),m.createElement(ri,{[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 w=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((R,E)=>w.indexOf(R.ref.current)-w.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:s,Slot:l,ItemSlot:h},p,r]}const On=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},g9=ae.useId||(()=>{});let m9=0;function Kn(e){const[t,n]=ae.useState(g9());return On(()=>{e||n(r=>r??String(m9++))},[e]),e||(t?`radix-${t}`:"")}const v9=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Le=v9.reduce((e,t)=>{const n=m.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?ri: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 aR(e,t){e&&Co.flushSync(()=>e.dispatchEvent(t))}function sn(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 Mn({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=b9({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=sn(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 b9({defaultProp:e,onChange:t}){const n=m.useState(e),[r]=n,o=m.useRef(r),i=sn(t);return m.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const y9=m.createContext(void 0);function ga(e){const t=m.useContext(y9);return e||t||"ltr"}const um="rovingFocusGroup.onEntryFocus",x9={bubbles:!1,cancelable:!0},Jb="RovingFocusGroup",[Vv,lR,w9]=Gh(Jb),[_9,Hl]=fn(Jb,[w9]),[S9,C9]=_9(Jb),E9=m.forwardRef((e,t)=>m.createElement(Vv.Provider,{scope:e.__scopeRovingFocusGroup},m.createElement(Vv.Slot,{scope:e.__scopeRovingFocusGroup},m.createElement(R9,ne({},e,{ref:t}))))),R9=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=ga(i),[b=null,y]=Mn({prop:s,defaultProp:a,onChange:l}),[x,w]=m.useState(!1),_=sn(u),C=lR(n),R=m.useRef(!1),[E,D]=m.useState(0);return m.useEffect(()=>{const O=h.current;if(O)return O.addEventListener(um,_),()=>O.removeEventListener(um,_)},[_]),m.createElement(S9,{scope:n,orientation:r,dir:g,loop:o,currentTabStopId:b,onItemFocus:m.useCallback(O=>y(O),[y]),onItemShiftTab:m.useCallback(()=>w(!0),[]),onFocusableItemAdd:m.useCallback(()=>D(O=>O+1),[]),onFocusableItemRemove:m.useCallback(()=>D(O=>O-1),[])},m.createElement(Le.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 T=!R.current;if(O.target===O.currentTarget&&T&&!x){const I=new CustomEvent(um,x9);if(O.currentTarget.dispatchEvent(I),!I.defaultPrevented){const N=C().filter(F=>F.focusable),W=N.find(F=>F.active),Y=N.find(F=>F.id===b),J=[W,Y,...N].filter(Boolean).map(F=>F.ref.current);cR(J)}}R.current=!1}),onBlur:we(e.onBlur,()=>w(!1))})))}),$9="RovingFocusGroupItem",P9=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Kn(),l=i||a,u=C9($9,n),d=u.currentTabStopId===l,h=lR(n),{onFocusableItemAdd:p,onFocusableItemRemove:g}=u;return m.useEffect(()=>{if(r)return p(),()=>g()},[r,p,g]),m.createElement(Vv.ItemSlot,{scope:n,id:l,focusable:r,active:o},m.createElement(Le.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=D9(b,u.orientation,u.dir);if(y!==void 0){b.preventDefault();let w=h().filter(_=>_.focusable).map(_=>_.ref.current);if(y==="last")w.reverse();else if(y==="prev"||y==="next"){y==="prev"&&w.reverse();const _=w.indexOf(b.currentTarget);w=u.loop?T9(w,_+1):w.slice(_+1)}setTimeout(()=>cR(w))}})})))}),O9={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function M9(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function D9(e,t,n){const r=M9(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return O9[r]}function cR(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function T9(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const e0=E9,t0=P9;function A9(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const Jt=e=>{const{present:t,children:n}=e,r=I9(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};Jt.displayName="Presence";function I9(e){const[t,n]=m.useState(),r=m.useRef({}),o=m.useRef(e),i=m.useRef("none"),s=e?"mounted":"unmounted",[a,l]=A9(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const u=Jd(r.current);i.current=a==="mounted"?u:"none"},[a]),On(()=>{const u=r.current,d=o.current;if(d!==e){const p=i.current,g=Jd(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]),On(()=>{if(t){const u=h=>{const g=Jd(r.current).includes(h.animationName);h.target===t&&g&&Co.flushSync(()=>l("ANIMATION_END"))},d=h=>{h.target===t&&(i.current=Jd(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 Jd(e){return(e==null?void 0:e.animationName)||"none"}const uR="Tabs",[k9,Zre]=fn(uR,[Hl]),dR=Hl(),[N9,n0]=k9(uR),L9=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...u}=e,d=ga(a),[h,p]=Mn({prop:r,onChange:o,defaultProp:i});return m.createElement(N9,{scope:n,baseId:Kn(),value:h,onValueChange:p,orientation:s,dir:d,activationMode:l},m.createElement(Le.div,ne({dir:d,"data-orientation":s},u,{ref:t})))}),F9="TabsList",z9=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=n0(F9,n),s=dR(n);return m.createElement(e0,ne({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),m.createElement(Le.div,ne({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),j9="TabsTrigger",V9=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=n0(j9,n),a=dR(n),l=fR(s.baseId,r),u=hR(s.baseId,r),d=r===s.value;return m.createElement(t0,ne({asChild:!0},a,{focusable:!o,active:d}),m.createElement(Le.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)})})))}),H9="TabsContent",W9=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=n0(H9,n),l=fR(a.baseId,r),u=hR(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(Jt,{present:o||d},({present:p})=>m.createElement(Le.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 fR(e,t){return`${e}-trigger-${t}`}function hR(e,t){return`${e}-content-${t}`}const B9=L9,pR=z9,gR=V9,mR=W9,vR=B9,bR=ae.forwardRef(({className:e,...t},n)=>k.jsx(pR,{ref:n,className:Se("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));bR.displayName=pR.displayName;const yR=ae.forwardRef(({className:e,...t},n)=>k.jsx(gR,{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}));yR.displayName=gR.displayName;const r0=ae.forwardRef(({className:e,...t},n)=>k.jsx(mR,{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}));r0.displayName=mR.displayName;var xR={exports:{}},Vu={},Hv={exports:{}};(function(e,t){(function(n,r){r(t)})(ks,function(n){function r(ee){return function(re,be,Q,Oe,Ie,ze,_e){return ee(re,be,_e)}}function o(ee){return function(re,be,Q,Oe){if(!re||!be||typeof re!="object"||typeof be!="object")return ee(re,be,Q,Oe);var Ie=Oe.get(re),ze=Oe.get(be);if(Ie&&ze)return Ie===be&&ze===re;Oe.set(re,be),Oe.set(be,re);var _e=ee(re,be,Q,Oe);return Oe.delete(re),Oe.delete(be),_e}}function i(ee,K){var re={};for(var be in ee)re[be]=ee[be];for(var be in K)re[be]=K[be];return re}function s(ee){return ee.constructor===Object||ee.constructor==null}function a(ee){return typeof ee.then=="function"}function l(ee,K){return ee===K||ee!==ee&&K!==K}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]",w="[object String]",_=Object.prototype.toString;function C(ee){var K=ee.areArraysEqual,re=ee.areDatesEqual,be=ee.areMapsEqual,Q=ee.areObjectsEqual,Oe=ee.areRegExpsEqual,Ie=ee.areSetsEqual,ze=ee.createIsNestedEqual,_e=ze(pt);function pt(dt,ft,Bt){if(dt===ft)return!0;if(!dt||!ft||typeof dt!="object"||typeof ft!="object")return dt!==dt&&ft!==ft;if(s(dt)&&s(ft))return Q(dt,ft,_e,Bt);var Vt=Array.isArray(dt),wn=Array.isArray(ft);if(Vt||wn)return Vt===wn&&K(dt,ft,_e,Bt);var en=_.call(dt);return en!==_.call(ft)?!1:en===h?re(dt,ft,_e,Bt):en===p?Oe(dt,ft,_e,Bt):en===g?be(dt,ft,_e,Bt):en===x?Ie(dt,ft,_e,Bt):en===y||en===u?a(dt)||a(ft)?!1:Q(dt,ft,_e,Bt):en===d||en===b||en===w?l(dt.valueOf(),ft.valueOf()):!1}return pt}function R(ee,K,re,be){var Q=ee.length;if(K.length!==Q)return!1;for(;Q-- >0;)if(!re(ee[Q],K[Q],Q,Q,ee,K,be))return!1;return!0}var E=o(R);function D(ee,K){return l(ee.valueOf(),K.valueOf())}function O(ee,K,re,be){var Q=ee.size===K.size;if(!Q)return!1;if(!ee.size)return!0;var Oe={},Ie=0;return ee.forEach(function(ze,_e){if(Q){var pt=!1,dt=0;K.forEach(function(ft,Bt){!pt&&!Oe[dt]&&(pt=re(_e,Bt,Ie,dt,ee,K,be)&&re(ze,ft,_e,Bt,ee,K,be))&&(Oe[dt]=!0),dt++}),Ie++,Q=pt}}),Q}var T=o(O),I="_owner",N=Object.prototype.hasOwnProperty;function W(ee,K,re,be){var Q=Object.keys(ee),Oe=Q.length;if(Object.keys(K).length!==Oe)return!1;for(var Ie;Oe-- >0;){if(Ie=Q[Oe],Ie===I){var ze=!!ee.$$typeof,_e=!!K.$$typeof;if((ze||_e)&&ze!==_e)return!1}if(!N.call(K,Ie)||!re(ee[Ie],K[Ie],Ie,Ie,ee,K,be))return!1}return!0}var Y=o(W);function ue(ee,K){return ee.source===K.source&&ee.flags===K.flags}function J(ee,K,re,be){var Q=ee.size===K.size;if(!Q)return!1;if(!ee.size)return!0;var Oe={};return ee.forEach(function(Ie,ze){if(Q){var _e=!1,pt=0;K.forEach(function(dt,ft){!_e&&!Oe[pt]&&(_e=re(Ie,dt,ze,ft,ee,K,be))&&(Oe[pt]=!0),pt++}),Q=_e}}),Q}var F=o(J),Z=Object.freeze({areArraysEqual:R,areDatesEqual:D,areMapsEqual:O,areObjectsEqual:W,areRegExpsEqual:ue,areSetsEqual:J,createIsNestedEqual:r}),q=Object.freeze({areArraysEqual:E,areDatesEqual:D,areMapsEqual:T,areObjectsEqual:Y,areRegExpsEqual:ue,areSetsEqual:F,createIsNestedEqual:r}),X=C(Z);function ie(ee,K){return X(ee,K,void 0)}var j=C(i(Z,{createIsNestedEqual:function(){return l}}));function V(ee,K){return j(ee,K,void 0)}var te=C(q);function le(ee,K){return te(ee,K,new WeakMap)}var ce=C(i(q,{createIsNestedEqual:function(){return l}}));function ge(ee,K){return ce(ee,K,new WeakMap)}function ve(ee){return C(i(Z,ee(Z)))}function de(ee){var K=C(i(q,ee(q)));return function(re,be,Q){return Q===void 0&&(Q=new WeakMap),K(re,be,Q)}}n.circularDeepEqual=le,n.circularShallowEqual=ge,n.createCustomCircularEqual=de,n.createCustomEqual=ve,n.deepEqual=ie,n.sameValueZeroEqual=l,n.shallowEqual=V,Object.defineProperty(n,"__esModule",{value:!0})})})(Hv,Hv.exports);var o0=Hv.exports;const i0=Ub(lN);var at={},U9=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(at,"__esModule",{value:!0});at.bottom=s0;at.childrenEqual=K9;at.cloneLayout=wR;at.cloneLayoutItem=Xs;at.collides=Yh;at.compact=SR;at.compactItem=CR;at.compactType=cL;at.correctBounds=ER;at.fastPositionEqual=Q9;at.fastRGLPropsEqual=void 0;at.getAllCollisions=RR;at.getFirstCollision=Fs;at.getLayoutItem=a0;at.getStatics=l0;at.modifyLayout=_R;at.moveElement=kc;at.moveElementAwayFromCollision=Bv;at.noop=void 0;at.perc=J9;at.resizeItemInDirection=iL;at.setTopLeft=aL;at.setTransform=sL;at.sortLayoutItems=p0;at.sortLayoutItemsByColRow=DR;at.sortLayoutItemsByRowCol=MR;at.synchronizeLayoutWithChildren=lL;at.validateLayout=TR;at.withLayoutItem=Y9;var u_=o0,Ic=q9(m);function q9(e){return e&&e.__esModule?e:{default:e}}const G9=process.env.NODE_ENV==="production";function s0(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 wR(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=Xs(e[n]);return t}function _R(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 Y9(e,t,n){let r=a0(e,t);return r?(r=n(Xs(r)),e=_R(e,r),[e,r]):[e,null]}function Xs(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 K9(e,t){return(0,u_.deepEqual)(Ic.default.Children.map(e,n=>n==null?void 0:n.key),Ic.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,u_.deepEqual)(Ic.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),Ic.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const X9=U9;at.fastRGLPropsEqual=X9;function Q9(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function Yh(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 SR(e,t,n,r){const o=l0(e),i=p0(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let u=Xs(i[a]);u.static||(u=CR(o,u,t,n,i,r),o.push(u)),s[e.indexOf(i[a])]=u,u.moved=!1}return s}const Z9={x:"w",y:"h"};function Wv(e,t,n,r){const o=Z9[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;Yh(t,a)&&Wv(e,a,n+t[o],r)}}t[r]=n}function CR(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(s0(e),t.y);t.y>0&&!Fs(e,t);)t.y--;else if(a)for(;t.x>0&&!Fs(e,t);)t.x--;let l;for(;(l=Fs(e,t))&&!(n===null&&i);)if(a?Wv(o,t,l.x+l.w,"x"):Wv(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Fs(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function ER(e,t){const n=l0(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(;Fs(n,i);)i.y++}return e}function a0(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Fs(e,t){for(let n=0,r=e.length;n<r;n++)if(Yh(e[n],t))return e[n]}function RR(e,t){return e.filter(n=>Yh(n,t))}function l0(e){return e.filter(t=>t.static)}function kc(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=p0(e,s);(s==="vertical"&&typeof r=="number"?d>=r:s==="horizontal"&&typeof n=="number"?u>=n:!1)&&(h=h.reverse());const g=RR(h,t),b=g.length>0;if(b&&l)return wR(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 w=g[y];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(w.i," at [").concat(w.x,",").concat(w.y,"]"),!w.moved&&(w.static?e=Bv(e,w,t,o,s):e=Bv(e,t,w,o,s))}return e}function Bv(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=Fs(e,h),g=p&&p.y+p.h>t.y,b=p&&t.x+t.w>p.x;if(p){if(g&&a)return kc(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 kc(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,"]."),kc(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:kc(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function J9(e){return e*100+"%"}const $R=(e,t,n,r)=>e+n>r?t:n,PR=(e,t,n)=>e<0?t:n,OR=e=>Math.max(0,e),c0=e=>Math.max(0,e),u0=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:PR(s,e.height,o),top:c0(s)}},d0=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:$R(e.left,e.width,s,n),left:OR(o)}},f0=(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:$R(e.left,e.width,i,n),top:c0(r),left:OR(s)}},h0=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:PR(r,e.height,i),top:c0(r)}},eL=function(){return u0(arguments.length<=0?void 0:arguments[0],d0(...arguments))},tL=function(){return u0(arguments.length<=0?void 0:arguments[0],f0(...arguments))},nL=function(){return h0(arguments.length<=0?void 0:arguments[0],d0(...arguments))},rL=function(){return h0(arguments.length<=0?void 0:arguments[0],f0(...arguments))},oL={n:u0,ne:eL,e:d0,se:nL,s:h0,sw:rL,w:f0,nw:tL};function iL(e,t,n,r){const o=oL[e];return o?o(t,{...t,...n},r):n}function sL(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 aL(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 p0(e,t){return t==="horizontal"?DR(e):t==="vertical"?MR(e):e}function MR(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 DR(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 lL(e,t,n,r,o){e=e||[];const i=[];Ic.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=a0(e,String(a.key)),u=a.props["data-grid"];l&&u==null?i.push(Xs(l)):u?(G9||TR([u],"ReactGridLayout.children"),i.push(Xs({...u,i:a.key}))):i.push(Xs({w:1,h:1,x:0,y:s0(i),i:String(a.key)}))});const s=ER(i,{cols:n});return o?s:SR(s,r,n)}function TR(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 cL(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const uL=()=>{};at.noop=uL;var Eo={};Object.defineProperty(Eo,"__esModule",{value:!0});Eo.calcGridColWidth=Kh;Eo.calcGridItemPosition=dL;Eo.calcGridItemWHPx=Uv;Eo.calcWH=hL;Eo.calcXY=fL;Eo.clamp=zs;function Kh(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function Uv(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function dL(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,u=Kh(e),d={};return i&&i.resizing?(d.width=Math.round(i.resizing.width),d.height=Math.round(i.resizing.height)):(d.width=Uv(r,u,s[0]),d.height=Uv(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 fL(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,u=Kh(e);let d=Math.round((n-i[0])/(u+i[0])),h=Math.round((t-i[1])/(a+i[1]));return d=zs(d,0,s-r),h=zs(h,0,l-o),{x:d,y:h}}function hL(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:u}=e,d=Kh(e);let h=Math.round((t+s[0])/(d+s[0])),p=Math.round((n+s[1])/(u+s[1])),g=zs(h,0,l-r),b=zs(p,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(g=zs(h,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(b=zs(p,0,a)),{w:g,h:b}}function zs(e,t,n){return Math.max(Math.min(e,n),t)}var Xh={},qv={exports:{}},dm,d_;function g0(){if(d_)return dm;d_=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return dm=e,dm}var fm,f_;function pL(){if(f_)return fm;f_=1;var e=g0();function t(){}function n(){}return n.resetWarningCache=t,fm=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},fm}var ef={exports:{}},xt={};/** @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 h_;function gL(){return h_||(h_=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,w=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function C(Q){return typeof Q=="string"||typeof Q=="function"||Q===r||Q===u||Q===i||Q===o||Q===h||Q===p||typeof Q=="object"&&Q!==null&&(Q.$$typeof===b||Q.$$typeof===g||Q.$$typeof===s||Q.$$typeof===a||Q.$$typeof===d||Q.$$typeof===x||Q.$$typeof===w||Q.$$typeof===_||Q.$$typeof===y)}function R(Q){if(typeof Q=="object"&&Q!==null){var Oe=Q.$$typeof;switch(Oe){case t:var Ie=Q.type;switch(Ie){case l:case u:case r:case i:case o:case h:return Ie;default:var ze=Ie&&Ie.$$typeof;switch(ze){case a:case d:case b:case g:case s:return ze;default:return Oe}}case n:return Oe}}}var E=l,D=u,O=a,T=s,I=t,N=d,W=r,Y=b,ue=g,J=n,F=i,Z=o,q=h,X=!1;function ie(Q){return X||(X=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),j(Q)||R(Q)===l}function j(Q){return R(Q)===u}function V(Q){return R(Q)===a}function te(Q){return R(Q)===s}function le(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===t}function ce(Q){return R(Q)===d}function ge(Q){return R(Q)===r}function ve(Q){return R(Q)===b}function de(Q){return R(Q)===g}function ee(Q){return R(Q)===n}function K(Q){return R(Q)===i}function re(Q){return R(Q)===o}function be(Q){return R(Q)===h}xt.AsyncMode=E,xt.ConcurrentMode=D,xt.ContextConsumer=O,xt.ContextProvider=T,xt.Element=I,xt.ForwardRef=N,xt.Fragment=W,xt.Lazy=Y,xt.Memo=ue,xt.Portal=J,xt.Profiler=F,xt.StrictMode=Z,xt.Suspense=q,xt.isAsyncMode=ie,xt.isConcurrentMode=j,xt.isContextConsumer=V,xt.isContextProvider=te,xt.isElement=le,xt.isForwardRef=ce,xt.isFragment=ge,xt.isLazy=ve,xt.isMemo=de,xt.isPortal=ee,xt.isProfiler=K,xt.isStrictMode=re,xt.isSuspense=be,xt.isValidElementType=C,xt.typeOf=R}()),xt}var wt={};/** @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 p_;function mL(){if(p_)return wt;p_=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,w=e?Symbol.for("react.responder"):60118,_=e?Symbol.for("react.scope"):60119;function C(E){if(typeof E=="object"&&E!==null){var D=E.$$typeof;switch(D){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 D}}case n:return D}}}function R(E){return C(E)===u}return wt.AsyncMode=l,wt.ConcurrentMode=u,wt.ContextConsumer=a,wt.ContextProvider=s,wt.Element=t,wt.ForwardRef=d,wt.Fragment=r,wt.Lazy=b,wt.Memo=g,wt.Portal=n,wt.Profiler=i,wt.StrictMode=o,wt.Suspense=h,wt.isAsyncMode=function(E){return R(E)||C(E)===l},wt.isConcurrentMode=R,wt.isContextConsumer=function(E){return C(E)===a},wt.isContextProvider=function(E){return C(E)===s},wt.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===t},wt.isForwardRef=function(E){return C(E)===d},wt.isFragment=function(E){return C(E)===r},wt.isLazy=function(E){return C(E)===b},wt.isMemo=function(E){return C(E)===g},wt.isPortal=function(E){return C(E)===n},wt.isProfiler=function(E){return C(E)===i},wt.isStrictMode=function(E){return C(E)===o},wt.isSuspense=function(E){return C(E)===h},wt.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===w||E.$$typeof===_||E.$$typeof===y)},wt.typeOf=C,wt}var g_;function AR(){return g_||(g_=1,process.env.NODE_ENV==="production"?ef.exports=mL():ef.exports=gL()),ef.exports}/*
|
|
103
|
+
object-assign
|
|
104
|
+
(c) Sindre Sorhus
|
|
105
|
+
@license MIT
|
|
106
|
+
*/var hm,m_;function vL(){if(m_)return hm;m_=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 hm=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},hm}var pm,v_;function IR(){return v_||(v_=1,pm=Function.call.bind(Object.prototype.hasOwnProperty)),pm}var gm,b_;function bL(){if(b_)return gm;b_=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=g0(),n={},r=IR();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={})},gm=o,gm}var mm,y_;function yL(){if(y_)return mm;y_=1;var e=AR(),t=vL(),n=g0(),r=IR(),o=bL(),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 mm=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function h(j){var V=j&&(u&&j[u]||j[d]);if(typeof V=="function")return V}var p="<<anonymous>>",g={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:_(),arrayOf:C,element:R(),elementType:E(),instanceOf:D,node:N(),objectOf:T,oneOf:O,oneOfType:I,shape:Y,exact:ue};function b(j,V){return j===V?j!==0||1/j===1/V:j!==j&&V!==V}function y(j,V){this.message=j,this.data=V&&typeof V=="object"?V:{},this.stack=""}y.prototype=Error.prototype;function x(j){if(process.env.NODE_ENV!=="production")var V={},te=0;function le(ge,ve,de,ee,K,re,be){if(ee=ee||p,re=re||de,be!==n){if(l){var Q=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 Q.name="Invariant Violation",Q}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Oe=ee+":"+de;!V[Oe]&&te<3&&(i("You are manually calling a React.PropTypes validation function for the `"+re+"` prop on `"+ee+"`. 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."),V[Oe]=!0,te++)}}return ve[de]==null?ge?ve[de]===null?new y("The "+K+" `"+re+"` is marked as required "+("in `"+ee+"`, but its value is `null`.")):new y("The "+K+" `"+re+"` is marked as required in "+("`"+ee+"`, but its value is `undefined`.")):null:j(ve,de,ee,K,re)}var ce=le.bind(null,!1);return ce.isRequired=le.bind(null,!0),ce}function w(j){function V(te,le,ce,ge,ve,de){var ee=te[le],K=Z(ee);if(K!==j){var re=q(ee);return new y("Invalid "+ge+" `"+ve+"` of type "+("`"+re+"` supplied to `"+ce+"`, expected ")+("`"+j+"`."),{expectedType:j})}return null}return x(V)}function _(){return x(s)}function C(j){function V(te,le,ce,ge,ve){if(typeof j!="function")return new y("Property `"+ve+"` of component `"+ce+"` has invalid PropType notation inside arrayOf.");var de=te[le];if(!Array.isArray(de)){var ee=Z(de);return new y("Invalid "+ge+" `"+ve+"` of type "+("`"+ee+"` supplied to `"+ce+"`, expected an array."))}for(var K=0;K<de.length;K++){var re=j(de,K,ce,ge,ve+"["+K+"]",n);if(re instanceof Error)return re}return null}return x(V)}function R(){function j(V,te,le,ce,ge){var ve=V[te];if(!a(ve)){var de=Z(ve);return new y("Invalid "+ce+" `"+ge+"` of type "+("`"+de+"` supplied to `"+le+"`, expected a single ReactElement."))}return null}return x(j)}function E(){function j(V,te,le,ce,ge){var ve=V[te];if(!e.isValidElementType(ve)){var de=Z(ve);return new y("Invalid "+ce+" `"+ge+"` of type "+("`"+de+"` supplied to `"+le+"`, expected a single ReactElement type."))}return null}return x(j)}function D(j){function V(te,le,ce,ge,ve){if(!(te[le]instanceof j)){var de=j.name||p,ee=ie(te[le]);return new y("Invalid "+ge+" `"+ve+"` of type "+("`"+ee+"` supplied to `"+ce+"`, expected ")+("instance of `"+de+"`."))}return null}return x(V)}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 V(te,le,ce,ge,ve){for(var de=te[le],ee=0;ee<j.length;ee++)if(b(de,j[ee]))return null;var K=JSON.stringify(j,function(be,Q){var Oe=q(Q);return Oe==="symbol"?String(Q):Q});return new y("Invalid "+ge+" `"+ve+"` of value `"+String(de)+"` "+("supplied to `"+ce+"`, expected one of "+K+"."))}return x(V)}function T(j){function V(te,le,ce,ge,ve){if(typeof j!="function")return new y("Property `"+ve+"` of component `"+ce+"` has invalid PropType notation inside objectOf.");var de=te[le],ee=Z(de);if(ee!=="object")return new y("Invalid "+ge+" `"+ve+"` of type "+("`"+ee+"` supplied to `"+ce+"`, expected an object."));for(var K in de)if(r(de,K)){var re=j(de,K,ce,ge,ve+"."+K,n);if(re instanceof Error)return re}return null}return x(V)}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 V=0;V<j.length;V++){var te=j[V];if(typeof te!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+X(te)+" at index "+V+"."),s}function le(ce,ge,ve,de,ee){for(var K=[],re=0;re<j.length;re++){var be=j[re],Q=be(ce,ge,ve,de,ee,n);if(Q==null)return null;Q.data&&r(Q.data,"expectedType")&&K.push(Q.data.expectedType)}var Oe=K.length>0?", expected one of type ["+K.join(", ")+"]":"";return new y("Invalid "+de+" `"+ee+"` supplied to "+("`"+ve+"`"+Oe+"."))}return x(le)}function N(){function j(V,te,le,ce,ge){return J(V[te])?null:new y("Invalid "+ce+" `"+ge+"` supplied to "+("`"+le+"`, expected a ReactNode."))}return x(j)}function W(j,V,te,le,ce){return new y((j||"React class")+": "+V+" type `"+te+"."+le+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ce+"`.")}function Y(j){function V(te,le,ce,ge,ve){var de=te[le],ee=Z(de);if(ee!=="object")return new y("Invalid "+ge+" `"+ve+"` of type `"+ee+"` "+("supplied to `"+ce+"`, expected `object`."));for(var K in j){var re=j[K];if(typeof re!="function")return W(ce,ge,ve,K,q(re));var be=re(de,K,ce,ge,ve+"."+K,n);if(be)return be}return null}return x(V)}function ue(j){function V(te,le,ce,ge,ve){var de=te[le],ee=Z(de);if(ee!=="object")return new y("Invalid "+ge+" `"+ve+"` of type `"+ee+"` "+("supplied to `"+ce+"`, expected `object`."));var K=t({},te[le],j);for(var re in K){var be=j[re];if(r(j,re)&&typeof be!="function")return W(ce,ge,ve,re,q(be));if(!be)return new y("Invalid "+ge+" `"+ve+"` key `"+re+"` supplied to `"+ce+"`.\nBad object: "+JSON.stringify(te[le],null," ")+`
|
|
107
|
+
Valid keys: `+JSON.stringify(Object.keys(j),null," "));var Q=be(de,re,ce,ge,ve+"."+re,n);if(Q)return Q}return null}return x(V)}function J(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(J);if(j===null||a(j))return!0;var V=h(j);if(V){var te=V.call(j),le;if(V!==j.entries){for(;!(le=te.next()).done;)if(!J(le.value))return!1}else for(;!(le=te.next()).done;){var ce=le.value;if(ce&&!J(ce[1]))return!1}}else return!1;return!0;default:return!1}}function F(j,V){return j==="symbol"?!0:V?V["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&V instanceof Symbol:!1}function Z(j){var V=typeof j;return Array.isArray(j)?"array":j instanceof RegExp?"object":F(V,j)?"symbol":V}function q(j){if(typeof j>"u"||j===null)return""+j;var V=Z(j);if(V==="object"){if(j instanceof Date)return"date";if(j instanceof RegExp)return"regexp"}return V}function X(j){var V=q(j);switch(V){case"array":case"object":return"an "+V;case"boolean":case"date":case"regexp":return"a "+V;default:return V}}function ie(j){return!j.constructor||!j.constructor.name?p:j.constructor.name}return g.checkPropTypes=o,g.resetWarningCache=o.resetWarningCache,g.PropTypes=g,g},mm}if(process.env.NODE_ENV!=="production"){var xL=AR(),wL=!0;qv.exports=yL()(xL.isElement,wL)}else qv.exports=pL()();var Xi=qv.exports,Qh={exports:{}},kR={};function NR(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=NR(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function x_(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=NR(e))&&(r&&(r+=" "),r+=t);return r}const _L=Object.freeze(Object.defineProperty({__proto__:null,clsx:x_,default:x_},Symbol.toStringTag,{value:"Module"})),SL=Ub(_L);var Yt={},Ro={};Object.defineProperty(Ro,"__esModule",{value:!0});Ro.dontSetMe=PL;Ro.findInArray=CL;Ro.int=$L;Ro.isFunction=EL;Ro.isNum=RL;function CL(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function EL(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function RL(e){return typeof e=="number"&&!isNaN(e)}function $L(e){return parseInt(e,10)}function PL(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 ma={};Object.defineProperty(ma,"__esModule",{value:!0});ma.browserPrefixToKey=FR;ma.browserPrefixToStyle=OL;ma.default=void 0;ma.getPrefix=LR;const vm=["Moz","Webkit","O","ms"];function LR(){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<vm.length;r++)if(FR(t,vm[r])in n)return vm[r];return""}function FR(e,t){return t?"".concat(t).concat(ML(e)):e}function OL(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function ML(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}ma.default=LR();Object.defineProperty(Yt,"__esModule",{value:!0});Yt.addClassName=VR;Yt.addEvent=AL;Yt.addUserSelectStyles=BL;Yt.createCSSTransform=jL;Yt.createSVGTransform=VL;Yt.getTouch=HL;Yt.getTouchIdentifier=WL;Yt.getTranslation=m0;Yt.innerHeight=LL;Yt.innerWidth=FL;Yt.matchesSelector=jR;Yt.matchesSelectorAndParentsTo=TL;Yt.offsetXYFromParent=zL;Yt.outerHeight=kL;Yt.outerWidth=NL;Yt.removeClassName=HR;Yt.removeEvent=IL;Yt.removeUserSelectStyles=UL;var hr=Ro,w_=DL(ma);function zR(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(zR=function(r){return r?n:t})(e)}function DL(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=zR(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 tf="";function jR(e,t){return tf||(tf=(0,hr.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,hr.isFunction)(e[n])})),(0,hr.isFunction)(e[tf])?e[tf](t):!1}function TL(e,t,n){let r=e;do{if(jR(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function AL(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 IL(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 kL(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,hr.int)(n.borderTopWidth),t+=(0,hr.int)(n.borderBottomWidth),t}function NL(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,hr.int)(n.borderLeftWidth),t+=(0,hr.int)(n.borderRightWidth),t}function LL(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,hr.int)(n.paddingTop),t-=(0,hr.int)(n.paddingBottom),t}function FL(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,hr.int)(n.paddingLeft),t-=(0,hr.int)(n.paddingRight),t}function zL(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 jL(e,t){const n=m0(e,t,"px");return{[(0,w_.browserPrefixToKey)("transform",w_.default)]:n}}function VL(e,t){return m0(e,t,"")}function m0(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 HL(e,t){return e.targetTouches&&(0,hr.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,hr.findInArray)(e.changedTouches,n=>t===n.identifier)}function WL(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function BL(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&&VR(e.body,"react-draggable-transparent-selection")}function UL(e){if(e)try{if(e.body&&HR(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 VR(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function HR(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var $o={};Object.defineProperty($o,"__esModule",{value:!0});$o.canDragX=YL;$o.canDragY=KL;$o.createCoreData=QL;$o.createDraggableData=ZL;$o.getBoundPosition=qL;$o.getControlPosition=XL;$o.snapToGrid=GL;var rr=Ro,rl=Yt;function qL(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:JL(r);const o=v0(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,rr.int)(d.paddingLeft)+(0,rr.int)(u.marginLeft),top:-o.offsetTop+(0,rr.int)(d.paddingTop)+(0,rr.int)(u.marginTop),right:(0,rl.innerWidth)(l)-(0,rl.outerWidth)(o)-o.offsetLeft+(0,rr.int)(d.paddingRight)-(0,rr.int)(u.marginRight),bottom:(0,rl.innerHeight)(l)-(0,rl.outerHeight)(o)-o.offsetTop+(0,rr.int)(d.paddingBottom)-(0,rr.int)(u.marginBottom)}}return(0,rr.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,rr.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,rr.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,rr.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function GL(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function YL(e){return e.props.axis==="both"||e.props.axis==="x"}function KL(e){return e.props.axis==="both"||e.props.axis==="y"}function XL(e,t,n){const r=typeof t=="number"?(0,rl.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=v0(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,rl.offsetXYFromParent)(r||e,i,n.props.scale)}function QL(e,t,n){const r=!(0,rr.isNum)(e.lastX),o=v0(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 ZL(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 JL(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function v0(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var Zh={},Jh={};Object.defineProperty(Jh,"__esModule",{value:!0});Jh.default=eF;function eF(){}Object.defineProperty(Zh,"__esModule",{value:!0});Zh.default=void 0;var bm=nF(m),Vn=b0(Xi),tF=b0(Co),En=Yt,_i=$o,ym=Ro,xc=b0(Jh);function b0(e){return e&&e.__esModule?e:{default:e}}function WR(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(WR=function(r){return r?n:t})(e)}function nF(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=WR(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 In(e,t,n){return t=rF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rF(e){var t=oF(e,"string");return typeof t=="symbol"?t:String(t)}function oF(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 Gr={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let Si=Gr.mouse,ep=class extends bm.Component{constructor(){super(...arguments),In(this,"dragging",!1),In(this,"lastX",NaN),In(this,"lastY",NaN),In(this,"touchIdentifier",null),In(this,"mounted",!1),In(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,En.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,En.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,En.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,_i.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,_i.createCoreData)(this,s,a);(0,xc.default)("DraggableCore: handleDragStart: %j",l),(0,xc.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,En.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,En.addEvent)(r,Si.move,this.handleDrag),(0,En.addEvent)(r,Si.stop,this.handleDragStop))}),In(this,"handleDrag",t=>{const n=(0,_i.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,_i.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,_i.createCoreData)(this,r,o);if((0,xc.default)("DraggableCore: handleDrag: %j",i),this.props.onDrag(t,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const l=document.createEvent("MouseEvents");l.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(l)}return}this.lastX=r,this.lastY=o}),In(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,_i.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,_i.snapToGrid)(this.props.grid,l,u),r=this.lastX+l,o=this.lastY+u}const i=(0,_i.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,En.removeUserSelectStyles)(a.ownerDocument),(0,xc.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,xc.default)("DraggableCore: Removing handlers"),(0,En.removeEvent)(a.ownerDocument,Si.move,this.handleDrag),(0,En.removeEvent)(a.ownerDocument,Si.stop,this.handleDragStop))}),In(this,"onMouseDown",t=>(Si=Gr.mouse,this.handleDragStart(t))),In(this,"onMouseUp",t=>(Si=Gr.mouse,this.handleDragStop(t))),In(this,"onTouchStart",t=>(Si=Gr.touch,this.handleDragStart(t))),In(this,"onTouchEnd",t=>(Si=Gr.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,En.addEvent)(t,Gr.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,En.removeEvent)(n,Gr.mouse.move,this.handleDrag),(0,En.removeEvent)(n,Gr.touch.move,this.handleDrag),(0,En.removeEvent)(n,Gr.mouse.stop,this.handleDragStop),(0,En.removeEvent)(n,Gr.touch.stop,this.handleDragStop),(0,En.removeEvent)(t,Gr.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,En.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:tF.default.findDOMNode(this)}render(){return bm.cloneElement(bm.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Zh.default=ep;In(ep,"displayName","DraggableCore");In(ep,"propTypes",{allowAnyClick:Vn.default.bool,children:Vn.default.node.isRequired,disabled:Vn.default.bool,enableUserSelectHack:Vn.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:Vn.default.arrayOf(Vn.default.number),handle:Vn.default.string,cancel:Vn.default.string,nodeRef:Vn.default.object,onStart:Vn.default.func,onDrag:Vn.default.func,onStop:Vn.default.func,onMouseDown:Vn.default.func,scale:Vn.default.number,className:ym.dontSetMe,style:ym.dontSetMe,transform:ym.dontSetMe});In(ep,"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(Xi),r=d(Co),o=d(SL),i=Yt,s=$o,a=Ro,l=d(Zh),u=d(Jh);function d(_){return _&&_.__esModule?_:{default:_}}function h(_){if(typeof WeakMap!="function")return null;var C=new WeakMap,R=new WeakMap;return(h=function(E){return E?R:C})(_)}function p(_,C){if(!C&&_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var R=h(C);if(R&&R.has(_))return R.get(_);var E={},D=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var O in _)if(O!=="default"&&Object.prototype.hasOwnProperty.call(_,O)){var T=D?Object.getOwnPropertyDescriptor(_,O):null;T&&(T.get||T.set)?Object.defineProperty(E,O,T):E[O]=_[O]}return E.default=_,R&&R.set(_,E),E}function g(){return g=Object.assign?Object.assign.bind():function(_){for(var C=1;C<arguments.length;C++){var R=arguments[C];for(var E in R)Object.prototype.hasOwnProperty.call(R,E)&&(_[E]=R[E])}return _},g.apply(this,arguments)}function b(_,C,R){return C=y(C),C in _?Object.defineProperty(_,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):_[C]=R,_}function y(_){var C=x(_,"string");return typeof C=="symbol"?C:String(C)}function x(_,C){if(typeof _!="object"||_===null)return _;var R=_[Symbol.toPrimitive];if(R!==void 0){var E=R.call(_,C||"default");if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(_)}class w extends t.Component{static getDerivedStateFromProps(C,R){let{position:E}=C,{prevPropsPosition:D}=R;return E&&(!D||E.x!==D.x||E.y!==D.y)?((0,u.default)("Draggable: getDerivedStateFromProps %j",{position:E,prevPropsPosition:D}),{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 D=(0,s.createDraggableData)(this,E),O={x:D.x,y:D.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[W,Y]=(0,s.getBoundPosition)(this,O.x,O.y);O.x=W,O.y=Y,O.slackX=this.state.slackX+(I-O.x),O.slackY=this.state.slackY+(N-O.y),D.x=O.x,D.y=O.y,D.deltaX=O.x-this.state.x,D.deltaY=O.y-this.state.y}if(this.props.onDrag(R,D)===!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:D,defaultClassName:O,defaultClassNameDragging:T,defaultClassNameDragged:I,position:N,positionOffset:W,scale:Y,...ue}=this.props;let J={},F=null;const q=!!!N||this.state.dragging,X=N||D,ie={x:(0,s.canDragX)(this)&&q?this.state.x:X.x,y:(0,s.canDragY)(this)&&q?this.state.y:X.y};this.state.isElementSVG?F=(0,i.createSVGTransform)(ie,W):J=(0,i.createCSSTransform)(ie,W);const j=(0,o.default)(E.props.className||"",O,{[T]:this.state.dragging,[I]:this.state.dragged});return t.createElement(l.default,g({},ue,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(E),{className:j,style:{...E.props.style,...J},transform:F}))}}e.default=w,b(w,"displayName","Draggable"),b(w,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),b(w,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(kR);const{default:BR,DraggableCore:iF}=kR;Qh.exports=BR;Qh.exports.default=BR;Qh.exports.DraggableCore=iF;var UR=Qh.exports,tp={exports:{}},Hu={},y0={};y0.__esModule=!0;y0.cloneElement=dF;var sF=aF(m);function aF(e){return e&&e.__esModule?e:{default:e}}function __(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 S_(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?__(Object(n),!0).forEach(function(r){lF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):__(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function lF(e,t,n){return t=cF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cF(e){var t=uF(e,"string");return typeof t=="symbol"?t:String(t)}function uF(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 dF(e,t){return t.style&&e.props.style&&(t.style=S_(S_({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),sF.default.cloneElement(e,t)}var Wu={};Wu.__esModule=!0;Wu.resizableProps=void 0;var Ze=fF(Xi);function fF(e){return e&&e.__esModule?e:{default:e}}var hF={axis:Ze.default.oneOf(["both","x","y","none"]),className:Ze.default.string,children:Ze.default.element.isRequired,draggableOpts:Ze.default.shape({allowAnyClick:Ze.default.bool,cancel:Ze.default.string,children:Ze.default.node,disabled:Ze.default.bool,enableUserSelectHack:Ze.default.bool,offsetParent:Ze.default.node,grid:Ze.default.arrayOf(Ze.default.number),handle:Ze.default.string,nodeRef:Ze.default.object,onStart:Ze.default.func,onDrag:Ze.default.func,onStop:Ze.default.func,onMouseDown:Ze.default.func,scale:Ze.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=Ze.default.number).isRequired.apply(i,n)}return Ze.default.number.apply(Ze.default,n)},handle:Ze.default.oneOfType([Ze.default.node,Ze.default.func]),handleSize:Ze.default.arrayOf(Ze.default.number),lockAspectRatio:Ze.default.bool,maxConstraints:Ze.default.arrayOf(Ze.default.number),minConstraints:Ze.default.arrayOf(Ze.default.number),onResizeStop:Ze.default.func,onResizeStart:Ze.default.func,onResize:Ze.default.func,resizeHandles:Ze.default.arrayOf(Ze.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:Ze.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=Ze.default.number).isRequired.apply(i,n)}return Ze.default.number.apply(Ze.default,n)}};Wu.resizableProps=hF;Hu.__esModule=!0;Hu.default=void 0;var wc=bF(m),pF=UR,gF=y0,mF=Wu,vF=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function qR(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(qR=function(o){return o?n:t})(e)}function bF(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=qR(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 Gv(){return Gv=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},Gv.apply(this,arguments)}function yF(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 C_(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 xm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C_(Object(n),!0).forEach(function(r){xF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xF(e,t,n){return t=wF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wF(e){var t=_F(e,"string");return typeof t=="symbol"?t:String(t)}function _F(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 SF(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Yv(e,t)}function Yv(e,t){return Yv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Yv(e,t)}var x0=function(e){SF(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],w=y[1];return o+=x,i+=w,a&&(o=Math.max(a[0],o),i=Math.max(a[1],i)),l&&(o=Math.min(l[0],o),i=Math.min(l[1],i)),this.slack=[x+(g-o),w+(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 w=x.left-s.lastHandleRect.left;d+=w}if(b==="n"){var _=x.top-s.lastHandleRect.top;h+=_}}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 D=C!==s.props.width||R!==s.props.height,O=typeof s.props[o]=="function"?s.props[o]:null,T=o==="onResize"&&!D;O&&!T&&(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 wc.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=xm({ref:i},a?{}:{handleAxis:o});return wc.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=yF(i,vF);return(0,gF.cloneElement)(s,xm(xm({},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]=wc.createRef();return wc.createElement(pF.DraggableCore,Gv({},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}(wc.Component);Hu.default=x0;x0.propTypes=mF.resizableProps;x0.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var np={};np.__esModule=!0;np.default=void 0;var wm=PF(m),CF=GR(Xi),EF=GR(Hu),RF=Wu,$F=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function GR(e){return e&&e.__esModule?e:{default:e}}function YR(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(YR=function(o){return o?n:t})(e)}function PF(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=YR(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 Kv(){return Kv=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},Kv.apply(this,arguments)}function E_(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 ch(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?E_(Object(n),!0).forEach(function(r){OF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E_(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function OF(e,t,n){return t=MF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MF(e){var t=DF(e,"string");return typeof t=="symbol"?t:String(t)}function DF(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 TF(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 AF(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Xv(e,t)}function Xv(e,t){return Xv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Xv(e,t)}var KR=function(e){AF(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,w=TF(o,$F);return wm.createElement(EF.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},wm.createElement("div",Kv({},w,{style:ch(ch({},y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(wm.Component);np.default=KR;KR.propTypes=ch(ch({},RF.resizableProps),{},{children:CF.default.element});tp.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};tp.exports.Resizable=Hu.default;tp.exports.ResizableBox=np.default;var IF=tp.exports,ni={};Object.defineProperty(ni,"__esModule",{value:!0});ni.resizeHandleType=ni.resizeHandleAxesType=ni.default=void 0;var nt=XR(Xi),kF=XR(m);function XR(e){return e&&e.__esModule?e:{default:e}}const QR=nt.default.arrayOf(nt.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));ni.resizeHandleAxesType=QR;const ZR=nt.default.oneOfType([nt.default.node,nt.default.func]);ni.resizeHandleType=ZR;var NF={className:nt.default.string,style:nt.default.object,width:nt.default.number,autoSize:nt.default.bool,cols:nt.default.number,draggableCancel:nt.default.string,draggableHandle:nt.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:nt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&at.validateLayout(t,"layout")},margin:nt.default.arrayOf(nt.default.number),containerPadding:nt.default.arrayOf(nt.default.number),rowHeight:nt.default.number,maxRows:nt.default.number,isBounded:nt.default.bool,isDraggable:nt.default.bool,isResizable:nt.default.bool,allowOverlap:nt.default.bool,preventCollision:nt.default.bool,useCSSTransforms:nt.default.bool,transformScale:nt.default.number,isDroppable:nt.default.bool,resizeHandles:QR,resizeHandle:ZR,onLayoutChange:nt.default.func,onDragStart:nt.default.func,onDrag:nt.default.func,onDragStop:nt.default.func,onResizeStart:nt.default.func,onResize:nt.default.func,onResizeStop:nt.default.func,onDrop:nt.default.func,droppingItem:nt.default.shape({i:nt.default.string.isRequired,w:nt.default.number.isRequired,h:nt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};kF.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:nt.default.any};ni.default=NF;Object.defineProperty(Xh,"__esModule",{value:!0});Xh.default=void 0;var ja=w0(m),bt=w0(Xi),LF=UR,FF=IF,Va=at,mn=Eo,R_=ni,zF=w0(i0);function w0(e){return e&&e.__esModule?e:{default:e}}function lo(e,t,n){return t=jF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jF(e){var t=VF(e,"string");return typeof t=="symbol"?t:String(t)}function VF(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 _0 extends ja.default.Component{constructor(){super(...arguments),lo(this,"state",{resizing:null,dragging:null,className:""}),lo(this,"elementRef",ja.default.createRef()),lo(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),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,mn.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})}),lo(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:u,i:d,w:h,h:p,containerWidth:g}=this.props,b=this.getPositionParams();if(u){const{offsetParent:_}=r;if(_){const{margin:C,rowHeight:R}=this.props,E=_.clientHeight-(0,mn.calcGridItemWHPx)(p,R,C[1]);a=(0,mn.clamp)(a,0,E);const D=(0,mn.calcGridColWidth)(b),O=g-(0,mn.calcGridItemWHPx)(h,D,C[0]);l=(0,mn.clamp)(l,0,O)}}const y={top:a,left:l};this.setState({dragging:y});const{x,y:w}=(0,mn.calcXY)(b,a,l,h,p);return s.call(this,d,x,w,{e:t,node:r,newPosition:y})}),lo(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:s,i:a}=this.props,{left:l,top:u}=this.state.dragging,d={top:u,left:l};this.setState({dragging:null});const{x:h,y:p}=(0,mn.calcXY)(this.getPositionParams(),u,l,i,s);return o.call(this,a,h,p,{e:t,node:r,newPosition:d})}),lo(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),lo(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),lo(this,"onResize",(t,n,r)=>this.onResizeHandler(t,n,r,"onResize"))}shouldComponentUpdate(t,n){if(this.props.children!==t.children||this.props.droppingPosition!==t.droppingPosition)return!0;const r=(0,mn.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,mn.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,Va.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,Va.setTransform)(t):(i=(0,Va.setTopLeft)(t),n&&(i.left=(0,Va.perc)(t.left/r),i.width=(0,Va.perc)(t.width/r))),i}mixinDraggable(t,n){return ja.default.createElement(LF.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,mn.calcGridItemPosition)(p,0,0,o,0).width,b=(0,mn.calcGridItemPosition)(p,0,0,i,s),y=(0,mn.calcGridItemPosition)(p,0,0,a,l),x=[b.width,b.height],w=[Math.min(y.width,g),Math.min(y.height,1/0)];return ja.default.createElement(FF.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:x,maxConstraints:w,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale: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 w=s;i&&(w=(0,Va.resizeItemInDirection)(a,r,s,b),this.setState({resizing:o==="onResizeStop"?null:w}));let{w:_,h:C}=(0,mn.calcWH)(this.getPositionParams(),w.width,w.height,u,d,a);_=(0,mn.clamp)(_,Math.max(y,1),x),C=(0,mn.clamp)(C,g,p),l.call(this,h,_,C,{e:t,node:i,size:w,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,u=(0,mn.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),d=ja.default.Children.only(this.props.children);let h=ja.default.cloneElement(d,{ref:this.elementRef,className:(0,zF.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}}Xh.default=_0;lo(_0,"propTypes",{children:bt.default.element,cols:bt.default.number.isRequired,containerWidth:bt.default.number.isRequired,rowHeight:bt.default.number.isRequired,margin:bt.default.array.isRequired,maxRows:bt.default.number.isRequired,containerPadding:bt.default.array.isRequired,x:bt.default.number.isRequired,y:bt.default.number.isRequired,w:bt.default.number.isRequired,h:bt.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:bt.default.string.isRequired,resizeHandles:R_.resizeHandleAxesType,resizeHandle:R_.resizeHandleType,onDragStop:bt.default.func,onDragStart:bt.default.func,onDrag:bt.default.func,onResizeStop:bt.default.func,onResizeStart:bt.default.func,onResize:bt.default.func,isDraggable:bt.default.bool.isRequired,isResizable:bt.default.bool.isRequired,isBounded:bt.default.bool.isRequired,static:bt.default.bool,useCSSTransforms:bt.default.bool.isRequired,transformScale:bt.default.number,className:bt.default.string,handle:bt.default.string,cancel:bt.default.string,droppingPosition:bt.default.shape({e:bt.default.object.isRequired,left:bt.default.number.isRequired,top:bt.default.number.isRequired})});lo(_0,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(Vu,"__esModule",{value:!0});Vu.default=void 0;var Cs=UF(m),_m=o0,HF=S0(i0),We=at,WF=Eo,$_=S0(Xh),BF=S0(ni);function S0(e){return e&&e.__esModule?e:{default:e}}function JR(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(JR=function(r){return r?n:t})(e)}function UF(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=JR(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 Rn(e,t,n){return t=qF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qF(e){var t=GF(e,"string");return typeof t=="symbol"?t:String(t)}function GF(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 P_="react-grid-layout";let e$=!1;try{e$=/firefox/i.test(navigator.userAgent)}catch{}class rp extends Cs.Component{constructor(){super(...arguments),Rn(this,"state",{activeDrag:null,layout:(0,We.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,We.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Rn(this,"dragEnterCounter",0),Rn(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,We.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,We.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,i,s)}),Rn(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,We.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,We.moveElement)(l,p,n,r,b,h,(0,We.compactType)(this.props),u,d),this.props.onDrag(l,a,p,g,i,s),this.setState({layout:d?l:(0,We.compact)(l,(0,We.compactType)(this.props),u),activeDrag:g})}),Rn(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,We.getLayoutItem)(l,t);if(!p)return;const g=!0;l=(0,We.moveElement)(l,p,n,r,g,d,(0,We.compactType)(this.props),u,h);const b=h?l:(0,We.compact)(l,(0,We.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)}),Rn(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,We.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,We.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),Rn(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,w;const[_,C]=(0,We.withLayoutItem)(d,t,E=>{let D;return x=E.x,w=E.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(x=E.x+(E.w-n),n=E.x!==x&&x<0?E.w:n,x=x<0?0:x),["ne","n","nw"].indexOf(l)!==-1&&(w=E.y+(E.h-r),r=E.y!==w&&w<0?E.h:r,w=w<0?0:w),b=!0),p&&!g&&(D=(0,We.getAllCollisions)(d,{...E,w:n,h:r,x,y:w}).filter(T=>T.i!==E.i).length>0,D&&(w=E.y,r=E.h,x=E.x,n=E.w,b=!1)),E.w=n,E.h=r,E});if(!C)return;y=_,b&&(y=(0,We.moveElement)(_,C,x,w,!0,this.props.preventCollision,(0,We.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,We.compact)(y,(0,We.compactType)(this.props),h),activeDrag:R})}),Rn(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,We.getLayoutItem)(a,t),p=d?a:(0,We.compact)(a,(0,We.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)}),Rn(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),e$&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(P_)))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,w={left:y/h,top:x/h,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:C}=this.state.droppingPosition;(_!=y||C!=x)&&this.setState({droppingPosition:w})}}else{const _={cols:s,margin:i,maxRows:l,rowHeight:a,containerWidth:u,containerPadding:d||i},C=(0,WF.calcXY)(_,x,y,g.w,g.h);this.setState({droppingDOMNode:Cs.createElement("div",{key:g.i}),droppingPosition:w,layout:[...b,{...g,x:C.x,y:C.y,static:!1,isDraggable:!0}]})}}),Rn(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,We.compact)(r.filter(i=>i.i!==t.i),(0,We.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Rn(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Rn(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Rn(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,_m.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,We.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,We.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,We.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,We.fastRGLPropsEqual)(this.props,t,_m.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,We.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,_m.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 Cs.createElement($_.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},Cs.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,We.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:w,resizeHandle:_}=this.props,{mounted:C,droppingPosition:R}=this.state,E=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&d,D=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&h,O=r.resizeHandles||w,T=E&&p&&r.isBounded!==!1;return Cs.createElement($_.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:D,isBounded:T,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:_},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,HF.default)(P_,t),s={height:this.containerHeight(),...n};return Cs.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:We.noop,onDragLeave:r?this.onDragLeave:We.noop,onDragEnter:r?this.onDragEnter:We.noop,onDragOver:r?this.onDragOver:We.noop},Cs.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}Vu.default=rp;Rn(rp,"displayName","ReactGridLayout");Rn(rp,"propTypes",BF.default);Rn(rp,"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:We.noop,onDragStart:We.noop,onDrag:We.noop,onDragStop:We.noop,onResizeStart:We.noop,onResize:We.noop,onResizeStop:We.noop,onDrop:We.noop,onDropDragOver:We.noop});var op={},va={};Object.defineProperty(va,"__esModule",{value:!0});va.findOrGenerateResponsiveLayout=XF;va.getBreakpointFromWidth=YF;va.getColsFromBreakpoint=KF;va.sortBreakpoints=C0;var nf=at;function YF(e,t){const n=C0(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 KF(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function XF(e,t,n,r,o,i){if(e[n])return(0,nf.cloneLayout)(e[n]);let s=e[r];const a=C0(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,nf.cloneLayout)(s||[]),(0,nf.compact)((0,nf.correctBounds)(s,{cols:o}),i,o)}function C0(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(op,"__esModule",{value:!0});op.default=void 0;var O_=ZF(m),Hn=t$(Xi),Sm=o0,al=at,Es=va,QF=t$(Vu);function t$(e){return e&&e.__esModule?e:{default:e}}function n$(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(n$=function(r){return r?n:t})(e)}function ZF(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=n$(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 Qv(){return Qv=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},Qv.apply(this,arguments)}function uh(e,t,n){return t=JF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JF(e){var t=e4(e,"string");return typeof t=="symbol"?t:String(t)}function e4(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 M_=e=>Object.prototype.toString.call(e);function rf(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class E0 extends O_.Component{constructor(){super(...arguments),uh(this,"state",this.generateInitialState()),uh(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,Es.getBreakpointFromWidth)(n,t),s=(0,Es.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Es.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,Sm.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Es.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,Sm.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,Sm.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,Es.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,Es.getColsFromBreakpoint)(s,r),u={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in u||(u[a]=(0,al.cloneLayout)(this.state.layout));let p=(0,Es.findOrGenerateResponsiveLayout)(u,n,s,a,l,i);p=(0,al.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=rf(this.props.margin,s),h=rf(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 O_.createElement(QF.default,Qv({},d,{margin:rf(i,this.state.breakpoint),containerPadding:rf(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}op.default=E0;uh(E0,"propTypes",{breakpoint:Hn.default.string,breakpoints:Hn.default.object,allowOverlap:Hn.default.bool,cols:Hn.default.object,margin:Hn.default.oneOfType([Hn.default.array,Hn.default.object]),containerPadding:Hn.default.oneOfType([Hn.default.array,Hn.default.object]),layouts(e,t){if(M_(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+M_(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,al.validateLayout)(e.layouts[n],"layouts."+n)})},width:Hn.default.number.isRequired,onBreakpointChange:Hn.default.func,onLayoutChange:Hn.default.func,onWidthChange:Hn.default.func});uh(E0,"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:al.noop,onLayoutChange:al.noop,onWidthChange:al.noop});var R0={},r$=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}()}(),Zv=typeof window<"u"&&typeof document<"u"&&window.document===document,dh=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")()}(),t4=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(dh):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),n4=2;function r4(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){t4(i)}function a(){var l=Date.now();if(n){if(l-o<n4)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var o4=20,i4=["top","right","bottom","left","width","height","size","weight"],s4=typeof MutationObserver<"u",a4=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=r4(this.refresh.bind(this),o4)}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(){!Zv||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),s4?(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(){!Zv||!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=i4.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}(),o$=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},Pl=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||dh},i$=ip(0,0,0,0);function fh(e){return parseFloat(e)||0}function D_(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+fh(i)},0)}function l4(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]=fh(s)}return n}function c4(e){var t=e.getBBox();return ip(0,0,t.width,t.height)}function u4(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return i$;var r=Pl(e).getComputedStyle(e),o=l4(r),i=o.left+o.right,s=o.top+o.bottom,a=fh(r.width),l=fh(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=D_(r,"left","right")+i),Math.round(l+s)!==n&&(l-=D_(r,"top","bottom")+s)),!f4(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 ip(o.left,o.top,a,l)}var d4=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Pl(e).SVGGraphicsElement}:function(e){return e instanceof Pl(e).SVGElement&&typeof e.getBBox=="function"}}();function f4(e){return e===Pl(e).document.documentElement}function h4(e){return Zv?d4(e)?c4(e):u4(e):i$}function p4(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 o$(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function ip(e,t,n,r){return{x:e,y:t,width:n,height:r}}var g4=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=ip(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=h4(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}(),m4=function(){function e(t,n){var r=p4(n);o$(this,{target:t,contentRect:r})}return e}(),v4=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new r$,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 Pl(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new g4(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 Pl(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 m4(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}(),s$=typeof WeakMap<"u"?new WeakMap:new r$,a$=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=a4.getInstance(),r=new v4(t,n,this);s$.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){a$.prototype[e]=function(){var t;return(t=s$.get(this))[e].apply(t,arguments)}});var b4=function(){return typeof dh.ResizeObserver<"u"?dh.ResizeObserver:a$}();const y4=Object.freeze(Object.defineProperty({__proto__:null,default:b4},Symbol.toStringTag,{value:"Module"})),x4=Ub(y4);Object.defineProperty(R0,"__esModule",{value:!0});R0.default=P4;var of=C4(m),w4=$0(Xi),_4=$0(x4),S4=$0(i0);function $0(e){return e&&e.__esModule?e:{default:e}}function l$(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(l$=function(r){return r?n:t})(e)}function C4(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=l$(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 Jv(){return Jv=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},Jv.apply(this,arguments)}function Ha(e,t,n){return t=E4(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E4(e){var t=R4(e,"string");return typeof t=="symbol"?t:String(t)}function R4(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 $4="react-grid-layout";function P4(e){var t;return t=class extends of.Component{constructor(){super(...arguments),Ha(this,"state",{width:1280}),Ha(this,"elementRef",of.createRef()),Ha(this,"mounted",!1),Ha(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new _4.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?of.createElement("div",{className:(0,S4.default)(this.props.className,$4),style:this.props.style,ref:this.elementRef}):of.createElement(e,Jv({innerRef:this.elementRef},o,this.state))}},Ha(t,"defaultProps",{measureBeforeMount:!1}),Ha(t,"propTypes",{measureBeforeMount:w4.default.bool}),t}(function(e){e.exports=Vu.default,e.exports.utils=at,e.exports.calculateUtils=Eo,e.exports.Responsive=op.default,e.exports.Responsive.utils=va,e.exports.WidthProvider=R0.default})(xR);var T_=xR.exports;function sa({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 P0=ae.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));P0.displayName="Card";const sp=ae.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se("flex flex-col space-y-1.5 p-6",e),...t}));sp.displayName="CardHeader";const ap=ae.forwardRef(({className:e,...t},n)=>k.jsx("h3",{ref:n,className:Se("text-2xl font-semibold leading-none tracking-tight",e),...t}));ap.displayName="CardTitle";const O0=ae.forwardRef(({className:e,...t},n)=>k.jsx("p",{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));O0.displayName="CardDescription";const lp=ae.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se("px-6 pb-6 pt-0",e),...t}));lp.displayName="CardContent";const M0=ae.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se("flex items-center p-6 pt-0",e),...t}));M0.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 Bu(e){return e+.5|0}const Ni=(e,t,n)=>Math.max(Math.min(e,n),t);function Nc(e){return Ni(Bu(e*2.55),0,255)}function Hi(e){return Ni(Bu(e*255),0,255)}function Xo(e){return Ni(Bu(e/2.55)/100,0,1)}function A_(e){return Ni(Bu(e*100),0,100)}const Or={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},eb=[..."0123456789ABCDEF"],O4=e=>eb[e&15],M4=e=>eb[(e&240)>>4]+eb[e&15],sf=e=>(e&240)>>4===(e&15),D4=e=>sf(e.r)&&sf(e.g)&&sf(e.b)&&sf(e.a);function T4(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Or[e[1]]*17,g:255&Or[e[2]]*17,b:255&Or[e[3]]*17,a:t===5?Or[e[4]]*17:255}:(t===7||t===9)&&(n={r:Or[e[1]]<<4|Or[e[2]],g:Or[e[3]]<<4|Or[e[4]],b:Or[e[5]]<<4|Or[e[6]],a:t===9?Or[e[7]]<<4|Or[e[8]]:255})),n}const A4=(e,t)=>e<255?t(e):"";function I4(e){var t=D4(e)?O4:M4;return e?"#"+t(e.r)+t(e.g)+t(e.b)+A4(e.a,t):void 0}const k4=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function c$(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 N4(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 L4(e,t,n){const r=c$(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 F4(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 D0(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=F4(n,r,o,d,i),l=l*60+.5),[l|0,u||0,a]}function T0(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Hi)}function A0(e,t,n){return T0(c$,e,t,n)}function z4(e,t,n){return T0(L4,e,t,n)}function j4(e,t,n){return T0(N4,e,t,n)}function u$(e){return(e%360+360)%360}function V4(e){const t=k4.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Nc(+t[5]):Hi(+t[5]));const o=u$(+t[2]),i=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=z4(o,i,s):t[1]==="hsv"?r=j4(o,i,s):r=A0(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function H4(e,t){var n=D0(e);n[0]=u$(n[0]+t),n=A0(n),e.r=n[0],e.g=n[1],e.b=n[2]}function W4(e){if(!e)return;const t=D0(e),n=t[0],r=A_(t[1]),o=A_(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${Xo(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const I_={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"},k_={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 B4(){const e={},t=Object.keys(k_),n=Object.keys(I_);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,I_[i]);i=parseInt(k_[s],16),e[a]=[i>>16&255,i>>8&255,i&255]}return e}let af;function U4(e){af||(af=B4(),af.transparent=[0,0,0,0]);const t=af[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const q4=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function G4(e){const t=q4.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?Nc(s):Ni(s*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?Nc(r):Ni(r,0,255)),o=255&(t[4]?Nc(o):Ni(o,0,255)),i=255&(t[6]?Nc(i):Ni(i,0,255)),{r,g:o,b:i,a:n}}}function Y4(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Xo(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Cm=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Wa=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function K4(e,t,n){const r=Wa(Xo(e.r)),o=Wa(Xo(e.g)),i=Wa(Xo(e.b));return{r:Hi(Cm(r+n*(Wa(Xo(t.r))-r))),g:Hi(Cm(o+n*(Wa(Xo(t.g))-o))),b:Hi(Cm(i+n*(Wa(Xo(t.b))-i))),a:e.a+n*(t.a-e.a)}}function lf(e,t,n){if(e){let r=D0(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=A0(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function d$(e,t){return e&&Object.assign(t||{},e)}function N_(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=Hi(e[3]))):(t=d$(e,{r:0,g:0,b:0,a:1}),t.a=Hi(t.a)),t}function X4(e){return e.charAt(0)==="r"?G4(e):V4(e)}class lu{constructor(t){if(t instanceof lu)return t;const n=typeof t;let r;n==="object"?r=N_(t):n==="string"&&(r=T4(t)||U4(t)||X4(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=d$(this._rgb);return t&&(t.a=Xo(t.a)),t}set rgb(t){this._rgb=N_(t)}rgbString(){return this._valid?Y4(this._rgb):void 0}hexString(){return this._valid?I4(this._rgb):void 0}hslString(){return this._valid?W4(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=K4(this._rgb,t._rgb,n)),this}clone(){return new lu(this.rgb)}alpha(t){return this._rgb.a=Hi(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Bu(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 lf(this._rgb,2,t),this}darken(t){return lf(this._rgb,2,-t),this}saturate(t){return lf(this._rgb,1,t),this}desaturate(t){return lf(this._rgb,1,-t),this}rotate(t){return H4(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 Wo(){}const Q4=(()=>{let e=0;return()=>e++})();function st(e){return e===null||typeof e>"u"}function Nt(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 ct(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Gt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function ir(e,t){return Gt(e)?e:t}function Ke(e,t){return typeof e>"u"?t:e}const Z4=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,f$=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Et(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function _t(e,t,n,r){let o,i,s;if(Nt(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(ct(e))for(s=Object.keys(e),i=s.length,o=0;o<i;o++)t.call(n,e[s[o]],s[o])}function hh(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 ph(e){if(Nt(e))return e.map(ph);if(ct(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let o=0;for(;o<r;++o)t[n[o]]=ph(e[n[o]]);return t}return e}function h$(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function J4(e,t,n,r){if(!h$(e))return;const o=t[e],i=n[e];ct(o)&&ct(i)?wo(o,i,r):t[e]=ph(i)}function wo(e,t,n){const r=Nt(t)?t:[t],o=r.length;if(!ct(e))return e;n=n||{};const i=n.merger||J4;let s;for(let a=0;a<o;++a){if(s=r[a],!ct(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 Wc(e,t){return wo(e,t,{merger:e8})}function e8(e,t,n){if(!h$(e))return;const r=t[e],o=n[e];ct(r)&&ct(o)?Wc(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=ph(o))}const L_={"":e=>e,x:e=>e.x,y:e=>e.y};function t8(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 n8(e){const t=t8(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Bi(e,t){return(L_[t]||(L_[t]=n8(t)))(e)}function I0(e){return e.charAt(0).toUpperCase()+e.slice(1)}const cu=e=>typeof e<"u",Ui=e=>typeof e=="function",F_=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function r8(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Ft=Math.PI,Lt=2*Ft,o8=Lt+Ft,gh=Number.POSITIVE_INFINITY,i8=Ft/180,Qt=Ft/2,Rs=Ft/4,z_=Ft*2/3,Li=Math.log10,bo=Math.sign;function Bc(e,t,n){return Math.abs(e-t)<n}function j_(e){const t=Math.round(e);e=Bc(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Li(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function s8(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 Ol(e){return!isNaN(parseFloat(e))&&isFinite(e)}function a8(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function p$(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 Kr(e){return e*(Ft/180)}function k0(e){return e*(180/Ft)}function V_(e){if(!Gt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function g$(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*Ft&&(i+=Lt),{angle:i,distance:o}}function tb(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function l8(e,t){return(e-t+o8)%Lt-Ft}function cr(e){return(e%Lt+Lt)%Lt}function uu(e,t,n,r){const o=cr(e),i=cr(t),s=cr(n),a=cr(i-o),l=cr(s-o),u=cr(o-i),d=cr(o-s);return o===i||o===s||r&&i===s||a>l&&u<d}function dn(e,t,n){return Math.max(t,Math.min(n,e))}function c8(e){return dn(e,-32768,32767)}function Zo(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function N0(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 Jo=(e,t,n,r)=>N0(e,n,r?o=>{const i=e[o][t];return i<n||i===n&&e[o+1][t]===n}:o=>e[o][t]<n),u8=(e,t,n)=>N0(e,n,r=>e[r][t]>=n);function d8(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 m$=["push","pop","shift","splice","unshift"];function f8(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),m$.forEach(n=>{const r="_onData"+I0(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 H_(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)&&(m$.forEach(i=>{delete e[i]}),delete e._chartjs)}function v$(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const b$=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function y$(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,b$.call(window,()=>{r=!1,e.apply(t,n)}))}}function h8(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const L0=e=>e==="start"?"left":e==="end"?"right":"center",$n=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,p8=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function x$(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=dn(Math.min(Jo(a,l,u).lo,n?r:Jo(t,l,s.getPixelForValue(u)).lo),0,r-1)),p?i=dn(Math.max(Jo(a,s.axis,d,!0).hi+1,n?0:Jo(t,l,s.getPixelForValue(d),!0).hi+1),o,r)-o:i=r-o}return{start:o,count:i}}function w$(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 cf=e=>e===0||e===1,W_=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Lt/n)),B_=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Lt/n)+1,Uc={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*Qt)+1,easeOutSine:e=>Math.sin(e*Qt),easeInOutSine:e=>-.5*(Math.cos(Ft*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=>cf(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=>cf(e)?e:W_(e,.075,.3),easeOutElastic:e=>cf(e)?e:B_(e,.075,.3),easeInOutElastic(e){return cf(e)?e:e<.5?.5*W_(e*2,.1125,.45):.5+.5*B_(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-Uc.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?Uc.easeInBounce(e*2)*.5:Uc.easeOutBounce(e*2-1)*.5+.5};function F0(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function U_(e){return F0(e)?e:new lu(e)}function Em(e){return F0(e)?e:new lu(e).saturate(.5).darken(.1).hexString()}const g8=["x","y","borderWidth","radius","tension"],m8=["color","borderColor","backgroundColor"];function v8(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:m8},numbers:{type:"number",properties:g8}}),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 b8(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const q_=new Map;function y8(e,t){t=t||{};const n=e+JSON.stringify(t);let r=q_.get(n);return r||(r=new Intl.NumberFormat(e,t),q_.set(n,r)),r}function Uu(e,t,n){return y8(t,n).format(e)}const _$={values(e){return Nt(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=x8(e,n)}const s=Li(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),Uu(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Li(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?_$.numeric.call(this,e,t,n):""}};function x8(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 cp={formatters:_$};function w8(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:cp.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const aa=Object.create(null),nb=Object.create(null);function qc(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 Rm(e,t,n){return typeof t=="string"?wo(qc(e,t),n):wo(qc(e,""),t)}class _8{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)=>Em(o.backgroundColor),this.hoverBorderColor=(r,o)=>Em(o.borderColor),this.hoverColor=(r,o)=>Em(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 Rm(this,t,n)}get(t){return qc(this,t)}describe(t,n){return Rm(nb,t,n)}override(t,n){return Rm(aa,t,n)}route(t,n,r,o){const i=qc(this,t),s=qc(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 ct(l)?Object.assign({},u,l):Ke(l,u)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Wt=new _8({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[v8,b8,w8]);function S8(e){return!e||st(e.size)||st(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function mh(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 C8(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&&!Nt(h))s=mh(e,o,i,s,h);else if(Nt(h))for(u=0,d=h.length;u<d;u++)p=h[u],p!=null&&!Nt(p)&&(s=mh(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 $s(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 G_(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function rb(e,t,n,r){S$(e,t,n,r,null)}function S$(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)*i8;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,Lt):e.arc(n,r,y,0,Lt),e.closePath();break;case"triangle":d=o?o/2:y,e.moveTo(n+Math.sin(x)*d,r-Math.cos(x)*y),x+=z_,e.lineTo(n+Math.sin(x)*d,r-Math.cos(x)*y),x+=z_,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+Rs)*l,h=Math.cos(x+Rs)*(o?o/2-u:l),a=Math.sin(x+Rs)*l,p=Math.sin(x+Rs)*(o?o/2-u:l),e.arc(n-h,r-a,u,x-Ft,x-Qt),e.arc(n+p,r-s,u,x-Qt,x),e.arc(n+h,r+a,u,x,x+Qt),e.arc(n-p,r+s,u,x+Qt,x+Ft),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+=Rs;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+=Rs;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+=Rs,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 ei(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 up(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function dp(e){e.restore()}function E8(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 R8(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 $8(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),st(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 P8(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 O8(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function la(e,t,n,r,o,i={}){const s=Nt(t)?t:[t],a=i.strokeWidth>0&&i.strokeColor!=="";let l,u;for(e.save(),e.font=o.string,$8(e,i),l=0;l<s.length;++l)u=s[l],i.backdrop&&O8(e,i.backdrop),a&&(i.strokeColor&&(e.strokeStyle=i.strokeColor),st(i.strokeWidth)||(e.lineWidth=i.strokeWidth),e.strokeText(u,n,r,i.maxWidth)),e.fillText(u,n,r,i.maxWidth),P8(e,n,r,u,i),r+=Number(o.lineHeight);e.restore()}function du(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*Ft,Ft,!0),e.lineTo(n,r+i-s.bottomLeft),e.arc(n+s.bottomLeft,r+i-s.bottomLeft,s.bottomLeft,Ft,Qt,!0),e.lineTo(n+o-s.bottomRight,r+i),e.arc(n+o-s.bottomRight,r+i-s.bottomRight,s.bottomRight,Qt,0,!0),e.lineTo(n+o,r+s.topRight),e.arc(n+o-s.topRight,r+s.topRight,s.topRight,0,-Qt,!0),e.lineTo(n+s.topLeft,r)}const M8=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,D8=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function T8(e,t){const n=(""+e).match(M8);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 A8=e=>+e||0;function z0(e,t){const n={},r=ct(t),o=r?Object.keys(t):t,i=ct(e)?r?s=>Ke(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of o)n[s]=A8(i(s));return n}function C$(e){return z0(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Qs(e){return z0(e,["topLeft","topRight","bottomLeft","bottomRight"])}function xn(e){const t=C$(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Zt(e,t){e=e||{},t=t||Wt.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(D8)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:Ke(e.family,t.family),lineHeight:T8(Ke(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:Ke(e.weight,t.weight),string:""};return o.string=S8(o),o}function kt(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&&Nt(a)&&(a=a[n%a.length],o=!1),a!==void 0))return r&&!o&&(r.cacheable=!1),a}function I8(e,t,n){const{min:r,max:o}=e,i=f$(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 Qi(e,t){return Object.assign(Object.create(e),t)}function j0(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=P$("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:a=>j0([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 R$(a,l,()=>H8(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return K_(a).includes(l)},ownKeys(a){return K_(a)},set(a,l,u){const d=a._storage||(a._storage=o());return a[l]=d[l]=u,delete a._keys,!0}})}function Ml(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:E$(e,r),setContext:i=>Ml(e,i,n,r),override:i=>Ml(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 R$(i,s,()=>N8(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 E$(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:Ui(n)?n:()=>n,isIndexable:Ui(r)?r:()=>r}}const k8=(e,t)=>e?e+I0(t):t,V0=(e,t)=>ct(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function R$(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function N8(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=e;let a=r[t];return Ui(a)&&s.isScriptable(t)&&(a=L8(t,a,e,n)),Nt(a)&&a.length&&(a=F8(t,a,e,s.isIndexable)),V0(t,a)&&(a=Ml(a,o,i&&i[t],s)),a}function L8(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),V0(e,l)&&(l=H0(o._scopes,o,e,l)),l}function F8(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(ct(t[0])){const l=t,u=o._scopes.filter(d=>d!==l);t=[];for(const d of l){const h=H0(u,o,e,d);t.push(Ml(h,i,s&&s[e],a))}}return t}function $$(e,t,n){return Ui(e)?e(t,n):e}const z8=(e,t)=>e===!0?t:typeof e=="string"?Bi(t,e):void 0;function j8(e,t,n,r,o){for(const i of t){const s=z8(n,i);if(s){e.add(s);const a=$$(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 H0(e,t,n,r){const o=t._rootScopes,i=$$(t._fallback,n,r),s=[...e,...o],a=new Set;a.add(r);let l=Y_(a,s,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=Y_(a,s,i,l,r),l===null)?!1:j0(Array.from(a),[""],o,i,()=>V8(t,n,r))}function Y_(e,t,n,r,o){for(;n;)n=j8(e,t,n,r,o);return n}function V8(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return Nt(o)&&ct(n)?n:o||{}}function H8(e,t,n,r){let o;for(const i of t)if(o=P$(k8(i,e),n),typeof o<"u")return V0(e,o)?H0(n,r,e,o):o}function P$(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function K_(e){let t=e._keys;return t||(t=e._keys=W8(e._scopes)),t}function W8(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 O$(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(Bi(d,i),u)};return s}const B8=Number.EPSILON||1e-14,Dl=(e,t)=>t<e.length&&!e[t].skip&&e[t],M$=e=>e==="x"?"y":"x";function U8(e,t,n,r){const o=e.skip?t:e,i=t,s=n.skip?t:n,a=tb(i,o),l=tb(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 q8(e,t,n){const r=e.length;let o,i,s,a,l,u=Dl(e,0);for(let d=0;d<r-1;++d)if(l=u,u=Dl(e,d+1),!(!l||!u)){if(Bc(t[d],0,B8)){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 G8(e,t,n="x"){const r=M$(n),o=e.length;let i,s,a,l=Dl(e,0);for(let u=0;u<o;++u){if(s=a,a=l,l=Dl(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 Y8(e,t="x"){const n=M$(t),r=e.length,o=Array(r).fill(0),i=Array(r);let s,a,l,u=Dl(e,0);for(s=0;s<r;++s)if(a=l,l=u,u=Dl(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?bo(o[s-1])!==bo(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}q8(e,o,i),G8(e,i,t)}function uf(e,t,n){return Math.max(Math.min(e,n),t)}function K8(e,t){let n,r,o,i,s,a=ei(e[0],t);for(n=0,r=e.length;n<r;++n)s=i,i=a,a=n<r-1&&ei(e[n+1],t),i&&(o=e[n],s&&(o.cp1x=uf(o.cp1x,t.left,t.right),o.cp1y=uf(o.cp1y,t.top,t.bottom)),a&&(o.cp2x=uf(o.cp2x,t.left,t.right),o.cp2y=uf(o.cp2y,t.top,t.bottom)))}function X8(e,t,n,r,o){let i,s,a,l;if(t.spanGaps&&(e=e.filter(u=>!u.skip)),t.cubicInterpolationMode==="monotone")Y8(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=U8(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&&K8(e,n)}function W0(){return typeof window<"u"&&typeof document<"u"}function B0(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function vh(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 fp=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Q8(e,t){return fp(e).getPropertyValue(t)}const Z8=["top","right","bottom","left"];function Zs(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=Z8[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const J8=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function ez(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let s=!1,a,l;if(J8(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 Ts(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=fp(n),i=o.boxSizing==="border-box",s=Zs(o,"padding"),a=Zs(o,"border","width"),{x:l,y:u,box:d}=ez(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 tz(e,t,n){let r,o;if(t===void 0||n===void 0){const i=B0(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const s=i.getBoundingClientRect(),a=fp(i),l=Zs(a,"border","width"),u=Zs(a,"padding");t=s.width-u.width-l.width,n=s.height-u.height-l.height,r=vh(a.maxWidth,i,"clientWidth"),o=vh(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||gh,maxHeight:o||gh}}const df=e=>Math.round(e*10)/10;function nz(e,t,n,r){const o=fp(e),i=Zs(o,"margin"),s=vh(o.maxWidth,e,"clientWidth")||gh,a=vh(o.maxHeight,e,"clientHeight")||gh,l=tz(e,t,n);let{width:u,height:d}=l;if(o.boxSizing==="content-box"){const p=Zs(o,"border","width"),g=Zs(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=df(Math.min(u,s,l.maxWidth)),d=df(Math.min(d,a,l.maxHeight)),u&&!d&&(d=df(u/2)),(t!==void 0||n!==void 0)&&r&&l.height&&d>l.height&&(d=l.height,u=df(Math.floor(d*r))),{width:u,height:d}}function X_(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 rz=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};W0()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function Q_(e,t){const n=Q8(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function As(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function oz(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 iz(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},s=As(e,o,n),a=As(o,i,n),l=As(i,t,n),u=As(s,a,n),d=As(a,l,n);return As(u,d,n)}const sz=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}}},az=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function ll(e,t,n){return e?sz(t,n):az()}function D$(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 T$(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function A$(e){return e==="angle"?{between:uu,compare:l8,normalize:cr}:{between:Zo,compare:(t,n)=>t-n,normalize:t=>t}}function Z_({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 lz(e,t,n){const{property:r,start:o,end:i}=n,{between:s,normalize:a}=A$(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 I$(e,t,n){if(!n)return[e];const{property:r,start:o,end:i}=n,s=t.length,{compare:a,between:l,normalize:u}=A$(r),{start:d,end:h,loop:p,style:g}=lz(e,t,n),b=[];let y=!1,x=null,w,_,C;const R=()=>l(o,C,w)&&a(o,C)!==0,E=()=>a(i,w)===0||l(i,C,w),D=()=>y||R(),O=()=>!y||E();for(let T=d,I=d;T<=h;++T)_=t[T%s],!_.skip&&(w=u(_[r]),w!==C&&(y=l(w,o,i),x===null&&D()&&(x=a(w,o)===0?T:I),x!==null&&O()&&(b.push(Z_({start:x,end:T,loop:p,count:s,style:g})),x=null),I=T,C=w));return x!==null&&b.push(Z_({start:x,end:h,loop:p,count:s,style:g})),b}function k$(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const i=I$(r[o],e.points,t);i.length&&n.push(...i)}return n}function cz(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 uz(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 dz(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:s,end:a}=cz(n,o,i,r);if(r===!0)return J_(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 J_(e,uz(n,s,l,u),n,t)}function J_(e,t,n,r){return!r||!r.setContext||!n?t:fz(e,t,n,r)}function fz(e,t,n,r){const o=e._chart.getContext(),i=eS(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,w){const _=a?-1:1;if(b!==y){for(b+=l;n[b%l].skip;)b-=_;for(;n[y%l].skip;)y+=_;b%l!==y%l&&(u.push({start:b%l,end:y%l,loop:x,style:w}),d=w,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 w=n[p%l];x=eS(r.setContext(Qi(o,{type:"segment",p0:y,p1:w,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:s}))),hz(x,d)&&g(h,p-1,b.loop,d),y=w,d=x}h<p-1&&g(h,p-1,b.loop,d)}return u}function eS(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function hz(e,t){if(!t)return!1;const n=[],r=function(o,i){return F0(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 pz{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=b$.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 Go=new pz;const tS="transparent",gz={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=U_(e||tS),o=r.valid&&U_(t||tS);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class mz{constructor(t,n,r,o){const i=n[r];o=kt([t.to,o,i,t.from]);const s=kt([t.from,i,o]);this._active=!0,this._fn=t.fn||gz[t.type||typeof s],this._easing=Uc[t.easing]||Uc.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=kt([t.to,n,o,t.from]),this._from=kt([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 N${constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!ct(t))return;const n=Object.keys(Wt.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const i=t[o];if(!ct(i))return;const s={};for(const a of n)s[a]=i[a];(Nt(i.properties)&&i.properties||[o]).forEach(a=>{(a===o||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,o=bz(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&vz(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 mz(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 Go.add(this._chart,r),!0}}function vz(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 bz(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 nS(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 yz(e,t,n){if(n===!1)return!1;const r=nS(e,n),o=nS(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function xz(e){let t,n,r,o;return ct(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 L$(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 rS(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],Gt(u)&&(i||t===0||bo(t)===bo(u))&&(t+=u)}return t}}function wz(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 oS(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function _z(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Sz(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 Cz(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function iS(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 sS(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=_z(i,s,r),h=t.length;let p;for(let g=0;g<h;++g){const b=t[g],{[l]:y,[u]:x}=b,w=b._stacks||(b._stacks={});p=w[u]=Cz(o,d,y),p[a]=x,p._top=iS(p,s,!0,r.type),p._bottom=iS(p,s,!1,r.type);const _=p._visualValues||(p._visualValues={});_[a]=x}}function $m(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function Ez(e,t){return Qi(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Rz(e,t,n){return Qi(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function _c(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 Pm=e=>e==="reset"||e==="none",aS=(e,t)=>t?e:Object.assign({},e),$z=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:L$(n,!0),values:null};class Xr{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=oS(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&&_c(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,$m(t,"x")),s=n.yAxisID=Ke(r.yAxisID,$m(t,"y")),a=n.rAxisID=Ke(r.rAxisID,$m(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&&H_(this._data,this),t._stacked&&_c(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(ct(n))this._data=wz(n);else if(r!==n){if(r){H_(r,this);const o=this._cachedMeta;_c(o),o._parsed=[]}n&&Object.isExtensible(n)&&f8(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=oS(n.vScale,n),n.stack!==r.stack&&(o=!0,_c(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&sS(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{Nt(o[t])?p=this.parseArrayData(r,o,t,n):ct(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&&sS(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(Bi(g,a),p),y:s.parse(Bi(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:L$(o,!0),values:n._stacks[t.axis]._visualValues};return rS(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=rS(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=$z(n,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:h}=Sz(a);let p,g;function b(){g=o[p];const y=g[a.axis];return!Gt(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],Gt(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=xz(Ke(this.options.clip,yz(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=Rz(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=Ez(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&&cu(r);if(a)return aS(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(Wt.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(aS(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 N$(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||Pm(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){Pm(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!Pm(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&&_c(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(Xr,"defaults",{}),Ce(Xr,"datasetElementType",null),Ce(Xr,"dataElementType",null);function Pz(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=v$(r.sort((o,i)=>o-i))}return e._cache.$bar}function Oz(e){const t=e.iScale,n=Pz(t,e.type);let r=t._length,o,i,s,a;const l=()=>{s===32767||s===-32768||(cu(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 Mz(e,t,n,r){const o=n.barThickness;let i,s;return st(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 Dz(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 Tz(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 F$(e,t,n,r){return Nt(e)?Tz(e,t,n,r):t[n.axis]=n.parse(e,r),t}function lS(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(F$(p,h,i,u));return l}function Om(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Az(e,t,n){return e!==0?bo(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function Iz(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 kz(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}=Iz(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=u:(n._bottom||0)===r?o=d:(i[cS(d,s,a,l)]=!0,o=u)),i[cS(o,s,a,l)]=!0,e.borderSkipped=i}function cS(e,t,n,r){return r?(e=Nz(e,t,n),e=uS(e,n,t)):e=uS(e,t,n),e}function Nz(e,t,n){return e===t?n:e===n?t:e}function uS(e,t,n){return e==="start"?t:e==="end"?n:e}function Lz(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Bf extends Xr{parsePrimitiveData(t,n,r,o){return lS(t,n,r,o)}parseArrayData(t,n,r,o){return lS(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(Bi(y,u),p),h.push(F$(Bi(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=Om(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||st(b[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),x=this._calculateBarIndexPixels(g,d),w=(b._stacks||{})[a.axis],_={horizontal:u,base:y.base,enableBorderRadius:!w||Om(b._custom)||s===w._top||s===w._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&&(_.options=h||this.resolveDataElementOptions(g,t[g].active?"active":o));const C=_.options||t[g].options;kz(_,C,w,s),Lz(_,C,d.ratio),this.updateElement(t[g],g,_,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(st(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||Oz(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=Om(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&&bo(h)!==bo(u.barEnd)&&(p=0),p+=h);const x=!st(i)&&!d?i:p;let w=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?b=n.getPixelForValue(p+g):b=w,y=b-w,Math.abs(y)<s){y=Az(y,n,a)*s,h===a&&(w-=y/2);const _=n.getPixelForDecimal(0),C=n.getPixelForDecimal(1),R=Math.min(_,C),E=Math.max(_,C);w=Math.max(Math.min(w,E),R),b=w+y,r&&!d&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(b)-n.getValueForPixel(w))}if(w===n.getPixelForValue(a)){const _=bo(y)*n.getLineWidthForValue(a)/2;w+=_,y-=_}return{size:y,base:w,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"?Dz(t,n,o,u):Mz(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(Bf,"id","bar"),Ce(Bf,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Ce(Bf,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Uf extends Xr{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]),w=y[h]=i?a.getBasePixel():a.getPixelForValue(b[h]);y.skip=isNaN(x)||isNaN(w),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(Uf,"id","bubble"),Ce(Uf,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Ce(Uf,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Fz(e,t,n){let r=1,o=1,i=0,s=0;if(t<Lt){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)=>uu(C,a,l,!0)?1:Math.max(R,R*n,E,E*n),b=(C,R,E)=>uu(C,a,l,!0)?-1:Math.min(R,R*n,E,E*n),y=g(0,u,h),x=g(Qt,d,p),w=b(Ft,u,h),_=b(Ft+Qt,d,p);r=(y-w)/2,o=(x-_)/2,i=-(y+w)/2,s=-(x+_)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:s}}class js extends Xr{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(ct(r[t])){const{key:l="value"}=this._parsing;i=u=>+Bi(r[u],l)}let s,a;for(s=t,a=t+n;s<a;++s)o._parsed[s]=i(s)}}_getRotation(){return Kr(this.options.rotation-90)}_getCircumference(){return Kr(this.options.circumference)}_getRotationExtents(){let t=Lt,n=-Lt;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(Z4(this.options.cutout,a),1),u=this._getRingWeight(this.index),{circumference:d,rotation:h}=this._getRotationExtents(),{ratioX:p,ratioY:g,offsetX:b,offsetY:y}=Fz(h,d,l),x=(r.width-s)/p,w=(r.height-s)/g,_=Math.max(Math.min(x,w)/2,0),C=f$(this.options.radius,_),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/Lt)}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 w=this._getRotation(),_;for(_=0;_<n;++_)w+=this._circumference(_,i);for(_=n;_<n+r;++_){const C=this._circumference(_,i),R=t[_],E={x:d+this.offsetX,y:h+this.offsetY,startAngle:w,endAngle:w+C,circumference:C,outerRadius:b,innerRadius:g};x&&(E.options=y||this.resolveDataElementOptions(_,R.active?"active":o)),w+=C,this.updateElement(R,_,E,o)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,o;for(o=0;o<n.length;o++){const i=t._parsed[o];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(o)&&!n[o].hidden&&(r+=Math.abs(i))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Lt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=Uu(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(js,"id","doughnut"),Ce(js,"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(js,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Ce(js,"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 qf extends Xr{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}=x$(n,o,s);this._drawStart=a,this._drawCount=l,w$(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=Ol(b)?b:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||i||o==="none",_=n+r,C=t.length;let R=n>0&&this.getParsed(n-1);for(let E=0;E<C;++E){const D=t[E],O=w?D:{};if(E<n||E>=_){O.skip=!0;continue}const T=this.getParsed(E),I=st(T[g]),N=O[p]=s.getPixelForValue(T[p],E),W=O[g]=i||I?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,T,l):T[g],E);O.skip=isNaN(N)||isNaN(W)||I,O.stop=E>0&&Math.abs(T[p]-R[p])>x,y&&(O.parsed=T,O.raw=u.data[E]),h&&(O.options=d||this.resolveDataElementOptions(E,D.active?"active":o)),w||this.updateElement(D,E,O,o),R=T}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,o=t.data||[];if(!o.length)return r;const i=o[0].size(this.resolveDataElementOptions(0)),s=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(r,i,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Ce(qf,"id","line"),Ce(qf,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ce(qf,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Gc extends Xr{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=Uu(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return O$.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*Ft;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 w=g,_=g+this._computeAngle(b,o,y),C=s.getDataVisibility(b)?u.getDistanceFromCenterForValue(this.getParsed(b).r):0;g=_,i&&(l.animateScale&&(C=0),l.animateRotate&&(w=_=p));const R={x:d,y:h,innerRadius:0,outerRadius:C,startAngle:w,endAngle:_,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)?Kr(this.resolveDataElementOptions(t,n).angle||r):0}}Ce(Gc,"id","polarArea"),Ce(Gc,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Ce(Gc,"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 ob extends js{}Ce(ob,"id","pie"),Ce(ob,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Gf extends Xr{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 O$.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(Gf,"id","radar"),Ce(Gf,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Ce(Gf,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Yf extends Xr{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}=x$(n,r,o);if(this._drawStart=i,this._drawCount=s,w$(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,w=Ol(y)?y:Number.POSITIVE_INFINITY,_=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],D=this.getParsed(R),O=_?E:{},T=st(D[b]),I=O[g]=s.getPixelForValue(D[g],R),N=O[b]=i||T?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,D,l):D[b],R);O.skip=isNaN(I)||isNaN(N)||T,O.stop=R>0&&Math.abs(D[g]-C[g])>w,x&&(O.parsed=D,O.raw=u.data[R]),p&&(O.options=h||this.resolveDataElementOptions(R,E.active?"active":o)),_||this.updateElement(E,R,O,o),C=D}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(Yf,"id","scatter"),Ce(Yf,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Ce(Yf,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var zz=Object.freeze({__proto__:null,BarController:Bf,BubbleController:Uf,DoughnutController:js,LineController:qf,PieController:ob,PolarAreaController:Gc,RadarController:Gf,ScatterController:Yf});function Ps(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class U0{constructor(t){Ce(this,"options");this.options=t||{}}static override(t){Object.assign(U0.prototype,t)}init(){}formats(){return Ps()}parse(){return Ps()}format(){return Ps()}add(){return Ps()}diff(){return Ps()}startOf(){return Ps()}endOf(){return Ps()}}var jz={_date:U0};function Vz(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?u8:Jo;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 qu(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}=Vz(i[a],t,s,o);for(let g=h;g<=p;++g){const b=d[g];b.skip||r(b,u,g)}}}function Hz(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 Mm(e,t,n,r,o){const i=[];return!o&&!e.isPointInArea(t)||qu(e,n,t,function(a,l,u){!o&&!ei(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&i.push({element:a,datasetIndex:l,index:u})},!0),i}function Wz(e,t,n,r){let o=[];function i(s,a,l){const{startAngle:u,endAngle:d}=s.getProps(["startAngle","endAngle"],r),{angle:h}=g$(s,{x:t.x,y:t.y});uu(h,u,d)&&o.push({element:s,datasetIndex:a,index:l})}return qu(e,n,t,i),o}function Bz(e,t,n,r,o,i){let s=[];const a=Hz(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 qu(e,n,t,u),s}function Dm(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?Wz(e,t,n,o):Bz(e,t,n,r,o,i)}function dS(e,t,n,r,o){const i=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return qu(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 Uz={evaluateInteractionItems:qu,modes:{index(e,t,n,r){const o=Ts(t,e),i=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?Mm(e,o,i,r,s):Dm(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=Ts(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?Mm(e,o,i,r,s):Dm(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=Ts(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return Mm(e,o,i,r,s)},nearest(e,t,n,r){const o=Ts(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return Dm(e,o,i,n.intersect,r,s)},x(e,t,n,r){const o=Ts(t,e);return dS(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=Ts(t,e);return dS(e,o,"y",n.intersect,r)}}};const z$=["left","top","right","bottom"];function Sc(e,t){return e.filter(n=>n.pos===t)}function fS(e,t){return e.filter(n=>z$.indexOf(n.pos)===-1&&n.box.axis===t)}function Cc(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 qz(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 Gz(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!z$.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 Yz(e,t){const n=Gz(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 Kz(e){const t=qz(e),n=Cc(t.filter(u=>u.box.fullSize),!0),r=Cc(Sc(t,"left"),!0),o=Cc(Sc(t,"right")),i=Cc(Sc(t,"top"),!0),s=Cc(Sc(t,"bottom")),a=fS(t,"x"),l=fS(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:Sc(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(s).concat(a)}}function hS(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function j$(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 Xz(e,t,n,r){const{pos:o,box:i}=n,s=e.maxPadding;if(!ct(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&&j$(s,i.getPadding());const a=Math.max(0,t.outerWidth-hS(s,e,"left","right")),l=Math.max(0,t.outerHeight-hS(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 Qz(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 Zz(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 Lc(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,Zz(a.horizontal,t));const{same:h,other:p}=Xz(t,n,a,r);u|=h&&o.length,d=d||p,l.fullSize||o.push(a)}return u&&Lc(o,t,n,r)||d}function ff(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 pS(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;cu(u.start)&&(s=u.start),l.fullSize?ff(l,o.left,s,n.outerWidth-o.right-o.left,p):ff(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;cu(u.start)&&(i=u.start),l.fullSize?ff(l,i,o.top,p,n.outerHeight-o.bottom-o.top):ff(l,i,t.top+u.placed,p,h),u.start=i,u.placed+=h,i=l.right}}t.x=i,t.y=s}var Pn={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=xn(e.options.layout.padding),i=Math.max(t-o.width,0),s=Math.max(n-o.height,0),a=Kz(e.boxes),l=a.vertical,u=a.horizontal;_t(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);j$(p,xn(r));const g=Object.assign({maxPadding:p,w:i,h:s,x:o.left,y:o.top},o),b=Yz(l.concat(u),h);Lc(a.fullSize,g,h,b),Lc(l,g,h,b),Lc(u,g,h,b)&&Lc(l,g,h,b),Qz(g),pS(a.leftAndTop,g,h,b),g.x+=g.w,g.y+=g.h,pS(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},_t(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 V${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 Jz extends V${acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Kf="$chartjs",ej={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},gS=e=>e===null||e==="";function tj(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[Kf]={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",gS(o)){const i=Q_(e,"width");i!==void 0&&(e.width=i)}if(gS(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=Q_(e,"height");i!==void 0&&(e.height=i)}return e}const H$=rz?{passive:!0}:!1;function nj(e,t,n){e.addEventListener(t,n,H$)}function rj(e,t,n){e.canvas.removeEventListener(t,n,H$)}function oj(e,t){const n=ej[e.type]||e.type,{x:r,y:o}=Ts(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function bh(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function ij(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||bh(a.addedNodes,r),s=s&&!bh(a.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function sj(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||bh(a.removedNodes,r),s=s&&!bh(a.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const fu=new Map;let mS=0;function W$(){const e=window.devicePixelRatio;e!==mS&&(mS=e,fu.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function aj(e,t){fu.size||window.addEventListener("resize",W$),fu.set(e,t)}function lj(e){fu.delete(e),fu.size||window.removeEventListener("resize",W$)}function cj(e,t,n){const r=e.canvas,o=r&&B0(r);if(!o)return;const i=y$((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),aj(e,i),s}function Tm(e,t,n){n&&n.disconnect(),t==="resize"&&lj(e)}function uj(e,t,n){const r=e.canvas,o=y$(i=>{e.ctx!==null&&n(oj(i,e))},e);return nj(r,t,o),o}class dj extends V${acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(tj(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Kf])return!1;const r=n[Kf].initial;["height","width"].forEach(i=>{const s=r[i];st(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[Kf],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),s={attach:ij,detach:sj,resize:cj}[n]||uj;o[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:Tm,detach:Tm,resize:Tm}[n]||rj)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return nz(t,n,r,o)}isAttached(t){const n=B0(t);return!!(n&&n.isConnected)}}function fj(e){return!W0()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Jz:dj}var Hf;let ai=(Hf=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 Ol(this.x)&&Ol(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(Hf,"defaults",{}),Ce(Hf,"defaultRoutes"),Hf);function hj(e,t){const n=e.options.ticks,r=pj(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?mj(t):[],s=i.length,a=i[0],l=i[s-1],u=[];if(s>o)return vj(t,u,i,s/o),u;const d=gj(i,t,o);if(s>0){let h,p;const g=s>1?Math.round((l-a)/(s-1)):null;for(hf(t,u,d,st(g)?0:a-g,a),h=0,p=s-1;h<p;h++)hf(t,u,d,i[h],i[h+1]);return hf(t,u,d,l,st(g)?t.length:l+g),u}return hf(t,u,d),u}function pj(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 gj(e,t,n){const r=bj(e),o=t.length/n;if(!r)return Math.max(o,1);const i=s8(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 mj(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function vj(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 hf(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 bj(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 yj=e=>e==="left"?"right":e==="right"?"left":e,vS=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,bS=(e,t)=>Math.min(t||e,e);function yS(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 xj(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 wj(e,t){_t(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 Ec(e){return e.drawTicks?e.tickLength:0}function xS(e,t){if(!e.display)return 0;const n=Zt(e.font,t),r=xn(e.padding);return(Nt(e.text)?e.text.length:1)*n.lineHeight+r.height}function _j(e,t){return Qi(e,{scale:t,type:"scale"})}function Sj(e,t,n){return Qi(e,{tick:n,index:t,type:"tick"})}function Cj(e,t,n){let r=L0(e);return(n&&t!=="right"||!n&&t==="right")&&(r=yj(r)),r}function Ej(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=$n(r,i,a),ct(n)){const w=Object.keys(n)[0],_=n[w];b=d[w].getPixelForValue(_)+y-t}else n==="center"?b=(u.bottom+u.top)/2+y-t:b=vS(e,n,t);p=a-i}else{if(ct(n)){const w=Object.keys(n)[0],_=n[w];g=d[w].getPixelForValue(_)-x+t}else n==="center"?g=(u.left+u.right)/2-x+t:g=vS(e,n,t);b=$n(r,s,o),h=n==="left"?-Qt:Qt}return{titleX:g,titleY:b,maxWidth:p,rotation:h}}class ba extends ai{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=ir(t,Number.POSITIVE_INFINITY),n=ir(n,Number.NEGATIVE_INFINITY),r=ir(r,Number.POSITIVE_INFINITY),o=ir(o,Number.NEGATIVE_INFINITY),{min:ir(t,r),max:ir(n,o),minDefined:Gt(t),maxDefined:Gt(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:ir(n,ir(r,n)),max:ir(r,ir(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(){Et(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=I8(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?yS(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=hj(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(){Et(this.options.afterUpdate,[this])}beforeSetDimensions(){Et(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(){Et(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Et(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Et(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=Et(n.callback,[i.value,r,t],this)}afterTickToLabelConversion(){Et(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Et(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=bS(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=dn(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-Ec(t.grid)-n.padding-xS(t.title,this.chart.options.font),u=Math.sqrt(h*h+p*p),s=k0(Math.min(Math.asin(dn((d.highest.height+6)/a,-1,1)),Math.asin(dn(l/u,-1,1))-Math.asin(dn(p/u,-1,1)))),s=Math.max(o,Math.min(i,s))),this.labelRotation=s}afterCalculateLabelRotation(){Et(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Et(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=xS(o,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ec(i)+l):(t.height=this.maxHeight,t.width=Ec(i)+l),r.display&&this.ticks.length){const{first:u,last:d,widest:h,highest:p}=this._getLabelSizes(),g=r.padding*2,b=Kr(this.labelRotation),y=Math.cos(b),x=Math.sin(b);if(a){const w=r.mirror?0:x*h.width+y*p.height;t.height=Math.min(this.maxHeight,t.height+w+g)}else{const w=r.mirror?0:y*h.width+x*p.height;t.width=Math.min(this.maxWidth,t.width+w+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(){Et(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++)st(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=yS(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/bS(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,w=i[x]=i[x]||{data:{},gc:[]},_=y.lineHeight,C=R=0,!st(b)&&!Nt(b))C=mh(o,w.data,w.gc,C,b),R=_;else if(Nt(b))for(p=0,g=b.length;p<g;++p)E=b[p],!st(E)&&!Nt(E)&&(C=mh(o,w.data,w.gc,C,E),R+=_);s.push(C),a.push(R),u=Math.max(C,u),d=Math.max(R,d)}wj(i,n);const D=s.indexOf(u),O=a.indexOf(d),T=I=>({width:s[I]||0,height:a[I]||0});return{first:T(0),last:T(n-1),widest:T(D),highest:T(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 c8(this._alignToPixels?$s(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=Sj(this.getContext(),t,r))}return this.$context||(this.$context=_j(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Kr(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=Ec(i),g=[],b=a.setContext(this.getContext()),y=b.display?b.width:0,x=y/2,w=function(Z){return $s(r,Z,y)};let _,C,R,E,D,O,T,I,N,W,Y,ue;if(s==="top")_=w(this.bottom),O=this.bottom-p,I=_-x,W=w(t.top)+x,ue=t.bottom;else if(s==="bottom")_=w(this.top),W=t.top,ue=w(t.bottom)-x,O=_+x,I=this.top+p;else if(s==="left")_=w(this.right),D=this.right-p,T=_-x,N=w(t.left)+x,Y=t.right;else if(s==="right")_=w(this.left),N=t.left,Y=w(t.right)-x,D=_+x,T=this.left+p;else if(n==="x"){if(s==="center")_=w((t.top+t.bottom)/2+.5);else if(ct(s)){const Z=Object.keys(s)[0],q=s[Z];_=w(this.chart.scales[Z].getPixelForValue(q))}W=t.top,ue=t.bottom,O=_+x,I=O+p}else if(n==="y"){if(s==="center")_=w((t.left+t.right)/2);else if(ct(s)){const Z=Object.keys(s)[0],q=s[Z];_=w(this.chart.scales[Z].getPixelForValue(q))}D=_-x,T=D-p,N=t.left,Y=t.right}const J=Ke(o.ticks.maxTicksLimit,h),F=Math.max(1,Math.ceil(h/J));for(C=0;C<h;C+=F){const Z=this.getContext(C),q=i.setContext(Z),X=a.setContext(Z),ie=q.lineWidth,j=q.color,V=X.dash||[],te=X.dashOffset,le=q.tickWidth,ce=q.tickColor,ge=q.tickBorderDash||[],ve=q.tickBorderDashOffset;R=xj(this,C,l),R!==void 0&&(E=$s(r,R,ie),u?D=T=N=Y=E:O=I=W=ue=E,g.push({tx1:D,ty1:O,tx2:T,ty2:I,x1:N,y1:W,x2:Y,y2:ue,width:ie,color:j,borderDash:V,borderDashOffset:te,tickWidth:le,tickColor:ce,tickBorderDash:ge,tickBorderDashOffset:ve}))}return this._ticksLength=h,this._borderValue=_,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=Ec(r.grid),g=p+d,b=h?-d:g,y=-Kr(this.labelRotation),x=[];let w,_,C,R,E,D,O,T,I,N,W,Y,ue="middle";if(o==="top")D=this.bottom-b,O=this._getXAxisLabelAlignment();else if(o==="bottom")D=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")D=(t.top+t.bottom)/2+g;else if(ct(o)){const F=Object.keys(o)[0],Z=o[F];D=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(ct(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"?ue="top":l==="end"&&(ue="bottom"));const J=this._getLabelSizes();for(w=0,_=a.length;w<_;++w){C=a[w],R=C.label;const F=i.setContext(this.getContext(w));T=this.getPixelForTick(w)+i.labelOffset,I=this._resolveTickFontOptions(w),N=I.lineHeight,W=Nt(R)?R.length:1;const Z=W/2,q=F.color,X=F.textStrokeColor,ie=F.textStrokeWidth;let j=O;s?(E=T,O==="inner"&&(w===_-1?j=this.options.reverse?"left":"right":w===0?j=this.options.reverse?"right":"left":j="center"),o==="top"?u==="near"||y!==0?Y=-W*N+N/2:u==="center"?Y=-J.highest.height/2-Z*N+N:Y=-J.highest.height+N/2:u==="near"||y!==0?Y=N/2:u==="center"?Y=J.highest.height/2-Z*N:Y=J.highest.height-W*N,h&&(Y*=-1),y!==0&&!F.showLabelBackdrop&&(E+=N/2*Math.sin(y))):(D=T,Y=(1-W)*N/2);let V;if(F.showLabelBackdrop){const te=xn(F.backdropPadding),le=J.heights[w],ce=J.widths[w];let ge=Y-te.top,ve=0-te.left;switch(ue){case"middle":ge-=le/2;break;case"bottom":ge-=le;break}switch(O){case"center":ve-=ce/2;break;case"right":ve-=ce;break;case"inner":w===_-1?ve-=ce:w>0&&(ve-=ce/2);break}V={left:ve,top:ge,width:ce+te.width,height:le+te.height,color:F.backdropColor}}x.push({label:R,font:I,textOffset:Y,options:{rotation:y,color:q,strokeColor:X,strokeWidth:ie,textAlign:j,textBaseline:ue,translation:[E,D],backdrop:V}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Kr(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=$s(t,this.left,s)-s/2,d=$s(t,this.right,a)+a/2,h=p=l):(h=$s(t,this.top,s)-s/2,p=$s(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&&up(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;la(r,u,0,d,l,a)}o&&dp(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=Zt(r.font),s=xn(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||ct(n)?(l+=s.bottom,Nt(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:u,titleY:d,maxWidth:h,rotation:p}=Ej(this,l,n,a);la(t,r.text,0,0,i,{color:r.color,maxWidth:h,rotation:p,textAlign:Cj(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!==ba.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 Zt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class pf{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;Pj(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,Rj(t,s,r),this.override&&Wt.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 Wt[o]&&(delete Wt[o][r],this.override&&delete aa[r])}}function Rj(e,t,n){const r=wo(Object.create(null),[n?Wt.get(n):{},Wt.get(t),e.defaults]);Wt.set(t,r),e.defaultRoutes&&$j(t,e.defaultRoutes),e.descriptors&&Wt.describe(t,e.descriptors)}function $j(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(".");Wt.route(i,o,l,a)})}function Pj(e){return"id"in e&&"defaults"in e}class Oj{constructor(){this.controllers=new pf(Xr,"datasets",!0),this.elements=new pf(ai,"elements"),this.plugins=new pf(Object,"plugins"),this.scales=new pf(ba,"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):_t(o,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const o=I0(t);Et(r["before"+o],[],r),n[t](r),Et(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 co=new Oj;class Mj{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(Et(a,l,s)===!1&&o.cancelable)return!1}return!0}invalidate(){st(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=Dj(r);return o===!1&&!n?[]:Aj(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 Dj(e){const t={},n=[],r=Object.keys(co.plugins.items);for(let i=0;i<r.length;i++)n.push(co.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 Tj(e,t){return!t&&e===!1?null:e===!0?{}:e}function Aj(e,{plugins:t,localIds:n},r,o){const i=[],s=e.getContext();for(const a of t){const l=a.id,u=Tj(r[l],o);u!==null&&i.push({plugin:a,options:Ij(e.config,{plugin:a,local:n[l]},u,s)})}return i}function Ij(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 ib(e,t){const n=Wt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function kj(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function Nj(e,t){return e===t?"_index_":"_value_"}function wS(e){if(e==="x"||e==="y"||e==="r")return e}function Lj(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function sb(e,...t){if(wS(e))return e;for(const n of t){const r=n.axis||Lj(n.position)||e.length>1&&wS(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function _S(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Fj(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 _S(e,"x",n[0])||_S(e,"y",n[0])}return{}}function zj(e,t){const n=aa[e.type]||{scales:{}},r=t.scales||{},o=ib(e.type,t),i=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!ct(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=sb(s,a,Fj(s,e),Wt.scales[a.type]),u=Nj(l,o),d=n.scales||{};i[s]=Wc(Object.create(null),[{axis:l},a,d[l],d[u]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||ib(a,t),d=(aa[a]||{}).scales||{};Object.keys(d).forEach(h=>{const p=kj(h,l),g=s[p+"AxisID"]||p;i[g]=i[g]||Object.create(null),Wc(i[g],[{axis:p},r[g],d[h]])})}),Object.keys(i).forEach(s=>{const a=i[s];Wc(a,[Wt.scales[a.type],Wt.scale])}),i}function B$(e){const t=e.options||(e.options={});t.plugins=Ke(t.plugins,{}),t.scales=zj(e,t)}function U$(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function jj(e){return e=e||{},e.data=U$(e.data),B$(e),e}const SS=new Map,q$=new Set;function gf(e,t){let n=SS.get(e);return n||(n=t(),SS.set(e,n),q$.add(n)),n}const Rc=(e,t,n)=>{const r=Bi(t,n);r!==void 0&&e.add(r)};class Vj{constructor(t){this._config=jj(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=U$(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(),B$(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return gf(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return gf(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return gf(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return gf(`${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=>Rc(l,t,h))),d.forEach(h=>Rc(l,o,h)),d.forEach(h=>Rc(l,aa[i]||{},h)),d.forEach(h=>Rc(l,Wt,h)),d.forEach(h=>Rc(l,nb,h))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),q$.has(n)&&s.set(n,u),u}chartOptionScopes(){const{options:t,type:n}=this;return[t,aa[n]||{},Wt.datasets[n]||{},{type:n},Wt,nb]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:a}=CS(this._resolverCache,t,o);let l=s;if(Wj(s,n)){i.$shared=!1,r=Ui(r)?r():r;const u=this.createResolver(t,r,a);l=Ml(s,r,u)}for(const u of n)i[u]=l[u];return i}createResolver(t,n,r=[""],o){const{resolver:i}=CS(this._resolverCache,t,r);return ct(n)?Ml(i,n,void 0,o):i}}function CS(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:j0(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(o,i)),i}const Hj=e=>ct(e)&&Object.getOwnPropertyNames(e).some(t=>Ui(e[t]));function Wj(e,t){const{isScriptable:n,isIndexable:r}=E$(e);for(const o of t){const i=n(o),s=r(o),a=(s||i)&&e[o];if(i&&(Ui(a)||Hj(a))||s&&Nt(a))return!0}return!1}var Bj="4.4.1";const Uj=["top","bottom","left","right","chartArea"];function ES(e,t){return e==="top"||e==="bottom"||Uj.indexOf(e)===-1&&t==="x"}function RS(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function $S(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Et(n&&n.onComplete,[e],t)}function qj(e){const t=e.chart,n=t.options.animation;Et(n&&n.onProgress,[e],t)}function G$(e){return W0()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Xf={},PS=e=>{const t=G$(e);return Object.values(Xf).filter(n=>n.canvas===t).pop()};function Gj(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 Yj(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function mf(e,t,n){return e.options.clip?e[n]:t[n]}function Kj(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:mf(n,t,"left"),right:mf(n,t,"right"),top:mf(r,t,"top"),bottom:mf(r,t,"bottom")}:t}class Ir{static register(...t){co.add(...t),OS()}static unregister(...t){co.remove(...t),OS()}constructor(t,n){const r=this.config=new Vj(n),o=G$(t),i=PS(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||fj(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=Q4(),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 Mj,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=h8(h=>this.update(h),s.resizeDelay||0),this._dataChanges=[],Xf[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Go.listen(this,"complete",$S),Go.listen(this,"progress",qj),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return st(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 co}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():X_(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return G_(this.canvas,this.ctx),this}stop(){return Go.stop(this),this}resize(t,n){Go.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,X_(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),Et(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};_t(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=sb(s,a),u=l==="r",d=l==="x";return{options:a,dposition:u?"chartArea":d?"bottom":"left",dtype:u?"radialLinear":d?"category":"linear"}}))),_t(i,s=>{const a=s.options,l=a.id,u=sb(l,a),d=Ke(a.type,s.dtype);(a.position===void 0||ES(a.position,u)!==ES(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=co.getScale(d);h=new p({id:l,type:d,ctx:this.ctx,chart:this}),r[h.id]=h}h.init(a,t)}),_t(o,(s,a)=>{s||delete r[a]}),_t(r,s=>{Pn.configure(this,s,s.options),Pn.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(RS("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||ib(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=co.getController(a),{datasetElementType:u,dataElementType:d}=Wt.datasets[a];Object.assign(l,{dataElementType:co.getElement(d),datasetElementType:u&&co.getElement(u)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){_t(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||_t(i,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(RS("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){_t(this.scales,t=>{Pn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!F_(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;Gj(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(!F_(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;Pn.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],_t(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,Ui(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&&(Go.has(this)?this.attached&&!Go.running(this)&&Go.start(this):(this.draw(),$S({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=Kj(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(o&&up(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&&dp(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return ei(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=Uz.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=Qi(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);cu(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(),Go.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(),G_(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Xf[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)};_t(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(){_t(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},_t(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}});!hh(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=r8(t),u=Yj(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Et(i.onHover,[t,a,this],this),l&&Et(i.onClick,[t,a,this],this));const d=!hh(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(Ir,"defaults",Wt),Ce(Ir,"instances",Xf),Ce(Ir,"overrides",aa),Ce(Ir,"registry",co),Ce(Ir,"version",Bj),Ce(Ir,"getChart",PS);function OS(){return _t(Ir.instances,e=>e._plugins.invalidate())}function Xj(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+Qt,r-Qt),e.closePath(),e.clip()}function Qj(e){return z0(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Zj(e,t,n,r){const o=Qj(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 dn(l,0,Math.min(i,u))};return{outerStart:a(o.outerStart),outerEnd:a(o.outerEnd),innerStart:dn(o.innerStart,0,s),innerEnd:dn(o.innerEnd,0,s)}}function Ba(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function yh(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,q=(F+Z)/2,X=q!==0?b*q/(q+r):b;g=(b-X)/2}const y=Math.max(.001,b*h-n/Ft)/h,x=(b-y)/2,w=l+x+g,_=o-x-g,{outerStart:C,outerEnd:R,innerStart:E,innerEnd:D}=Zj(t,p,h,_-w),O=h-C,T=h-R,I=w+C/O,N=_-R/T,W=p+E,Y=p+D,ue=w+E/W,J=_-D/Y;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 ie=Ba(T,N,s,a);e.arc(ie.x,ie.y,R,N,_+Qt)}const Z=Ba(Y,_,s,a);if(e.lineTo(Z.x,Z.y),D>0){const ie=Ba(Y,J,s,a);e.arc(ie.x,ie.y,D,_+Qt,J+Math.PI)}const q=(_-D/p+(w+E/p))/2;if(e.arc(s,a,p,_-D/p,q,!0),e.arc(s,a,p,q,w+E/p,!0),E>0){const ie=Ba(W,ue,s,a);e.arc(ie.x,ie.y,E,ue+Math.PI,w-Qt)}const X=Ba(O,w,s,a);if(e.lineTo(X.x,X.y),C>0){const ie=Ba(O,I,s,a);e.arc(ie.x,ie.y,C,w-Qt,I)}}else{e.moveTo(s,a);const F=Math.cos(I)*h+s,Z=Math.sin(I)*h+a;e.lineTo(F,Z);const q=Math.cos(N)*h+s,X=Math.sin(N)*h+a;e.lineTo(q,X)}e.closePath()}function Jj(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a}=t;let l=t.endAngle;if(i){yh(e,t,n,r,l,o);for(let u=0;u<i;++u)e.fill();isNaN(a)||(l=s+(a%Lt||Lt))}return yh(e,t,n,r,l,o),e.fill(),l}function eV(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){yh(e,t,n,r,b,o);for(let y=0;y<i;++y)e.stroke();isNaN(a)||(b=s+(a%Lt||Lt))}g&&Xj(e,t,b),i||(yh(e,t,n,r,b,o),e.stroke())}class ol extends ai{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}=g$(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)>=Lt||uu(s,l,u),x=Zo(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>Lt?Math.floor(o/Lt):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(Ft,o||0)),d=i*u;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,Jj(n,this,d,s,a),eV(n,this,d,s,a),n.restore()}}Ce(ol,"id","arc"),Ce(ol,"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(ol,"defaultRoutes",{backgroundColor:"backgroundColor"}),Ce(ol,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Y$(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 tV(e,t,n){e.lineTo(n.x,n.y)}function nV(e){return e.stepped?E8:e.tension||e.cubicInterpolationMode==="monotone"?R8:tV}function K$(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 rV(e,t,n,r){const{points:o,options:i}=t,{count:s,start:a,loop:l,ilen:u}=K$(o,n,r),d=nV(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 oV(e,t,n,r){const o=t.points,{count:i,start:s,ilen:a}=K$(o,n,r),{move:l=!0,reverse:u}=r||{};let d=0,h=0,p,g,b,y,x,w;const _=R=>(s+(u?a-R:R))%i,C=()=>{y!==x&&(e.lineTo(d,x),e.lineTo(d,y),e.lineTo(d,w))};for(l&&(g=o[_(0)],e.moveTo(g.x,g.y)),p=0;p<=a;++p){if(g=o[_(p)],g.skip)continue;const R=g.x,E=g.y,D=R|0;D===b?(E<y?y=E:E>x&&(x=E),d=(h*d+R)/++h):(C(),e.lineTo(R,E),b=D,h=0,y=x=E),w=E}C()}function ab(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?oV:rV}function iV(e){return e.stepped?oz:e.tension||e.cubicInterpolationMode==="monotone"?iz:As}function sV(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),Y$(e,t.options),e.stroke(o)}function aV(e,t,n,r){const{segments:o,options:i}=t,s=ab(t);for(const a of o)Y$(e,i,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const lV=typeof Path2D=="function";function cV(e,t,n,r){lV&&!t.options.segment?sV(e,t,n,r):aV(e,t,n,r)}class Fi extends ai{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;X8(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=dz(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=k$(this,{property:n,start:o,end:o});if(!s.length)return;const a=[],l=iV(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 ab(this)(t,this,n,r)}path(t,n,r){const o=this.segments,i=ab(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(),cV(t,this,r,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ce(Fi,"id","line"),Ce(Fi,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Ce(Fi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Ce(Fi,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function MS(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class Yc extends ai{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 MS(this,n,"x",r)}inYRange(n,r){return MS(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||!ei(this,r,this.size(o)/2)||(n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.fillStyle=o.backgroundColor,rb(n,o,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Ce(Yc,"id","point"),Ce(Yc,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Ce(Yc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function X$(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 zi(e,t,n,r){return e?0:dn(t,n,r)}function uV(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=C$(r);return{t:zi(o.top,i.top,0,n),r:zi(o.right,i.right,0,t),b:zi(o.bottom,i.bottom,0,n),l:zi(o.left,i.left,0,t)}}function dV(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=Qs(o),s=Math.min(t,n),a=e.borderSkipped,l=r||ct(o);return{topLeft:zi(!l||a.top||a.left,i.topLeft,0,s),topRight:zi(!l||a.top||a.right,i.topRight,0,s),bottomLeft:zi(!l||a.bottom||a.left,i.bottomLeft,0,s),bottomRight:zi(!l||a.bottom||a.right,i.bottomRight,0,s)}}function fV(e){const t=X$(e),n=t.right-t.left,r=t.bottom-t.top,o=uV(e,n/2,r/2),i=dV(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 Am(e,t,n,r){const o=t===null,i=n===null,a=e&&!(o&&i)&&X$(e,r);return a&&(o||Zo(t,a.left,a.right))&&(i||Zo(n,a.top,a.bottom))}function hV(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function pV(e,t){e.rect(t.x,t.y,t.w,t.h)}function Im(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 Kc extends ai{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}=fV(this),a=hV(s.radius)?du:pV;t.save(),(s.w!==i.w||s.h!==i.h)&&(t.beginPath(),a(t,Im(s,n,i)),t.clip(),a(t,Im(i,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Im(i,n)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,n,r){return Am(this,t,n,r)}inXRange(t,n){return Am(this,t,null,n)}inYRange(t,n){return Am(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(Kc,"id","bar"),Ce(Kc,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Ce(Kc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var gV=Object.freeze({__proto__:null,ArcElement:ol,BarElement:Kc,LineElement:Fi,PointElement:Yc});const lb=["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)"],DS=lb.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Q$(e){return lb[e%lb.length]}function Z$(e){return DS[e%DS.length]}function mV(e,t){return e.borderColor=Q$(t),e.backgroundColor=Z$(t),++t}function vV(e,t){return e.backgroundColor=e.data.map(()=>Q$(t++)),t}function bV(e,t){return e.backgroundColor=e.data.map(()=>Z$(t++)),t}function yV(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof js?t=vV(n,t):o instanceof Gc?t=bV(n,t):o&&(t=mV(n,t))}}function TS(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function xV(e){return e&&(e.borderColor||e.backgroundColor)}var wV={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&&(TS(r)||xV(o)||i&&TS(i)))return;const s=yV(e);r.forEach(s)}};function _V(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,w=0,_;const C=Math.floor((h+1)*a)+1+t,R=Math.min(Math.floor((h+2)*a)+1,n)+t,E=R-C;for(_=C;_<R;_++)x+=e[_].x,w+=e[_].y;x/=E,w/=E;const D=Math.floor(h*a)+1+t,O=Math.min(Math.floor((h+1)*a)+1,n)+t,{x:T,y:I}=e[d];for(g=b=-1,_=D;_<O;_++)b=.5*Math.abs((T-x)*(e[_].y-I)-(T-e[_].x)*(w-I)),b>g&&(g=b,p=e[_],y=_);s[l++]=p,d=y}return s[l++]=e[u],s}function SV(e,t,n,r){let o=0,i=0,s,a,l,u,d,h,p,g,b,y;const x=[],w=t+n-1,_=e[t].x,R=e[w].x-_;for(s=t;s<t+n;++s){a=e[s],l=(a.x-_)/R*r,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 D=s-1;if(!st(h)&&!st(p)){const O=Math.min(h,p),T=Math.max(h,p);O!==g&&O!==D&&x.push({...e[O],x:o}),T!==g&&T!==D&&x.push({...e[T],x:o})}s>0&&D!==g&&x.push(e[D]),x.push(a),d=E,i=0,b=y=u,h=p=g=s}}return x}function J$(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 AS(e){e.data.datasets.forEach(t=>{J$(t)})}function CV(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=dn(Jo(t,i.axis,s).lo,0,n-1)),u?o=dn(Jo(t,i.axis,a).hi+1,r,n)-r:o=n-r,{start:r,count:o}}var EV={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){AS(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(kt([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}=CV(l,u);const g=n.threshold||4*r;if(p<=g){J$(o);return}st(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=_V(u,h,p,r,n);break;case"min-max":b=SV(u,h,p,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=b})},destroy(e){AS(e)}};function RV(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=q0(l,u,o);const d=cb(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=k$(t,d);for(const p of h){const g=cb(n,i[p.start],i[p.end],p.loop),b=I$(a,o,g);for(const y of b)s.push({source:y,target:p,start:{[n]:IS(d,g,"start",Math.max)},end:{[n]:IS(d,g,"end",Math.min)}})}}return s}function cb(e,t,n,r){if(r)return;let o=t[e],i=n[e];return e==="angle"&&(o=cr(o),i=cr(i)),{property:e,start:o,end:i}}function $V(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:s,end:a})=>{a=q0(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 q0(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function IS(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function eP(e,t){let n=[],r=!1;return Nt(e)?(r=!0,n=e):n=$V(e,t),n.length?new Fi({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function kS(e){return e&&e.fill!==!1}function PV(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(!Gt(o))return o;if(s=e[o],!s)return!1;if(s.visible)return o;i.push(o),o=s.fill}return!1}function OV(e,t,n){const r=AV(e);if(ct(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return Gt(o)&&Math.floor(o)===o?MV(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function MV(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function DV(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:ct(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function TV(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:ct(e)?r=e.value:r=t.getBaseValue(),r}function AV(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 IV(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,s=r.points,a=kV(t,n);a.push(eP({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++)NV(o,s[d],a)}return new Fi({points:o,options:{}})}function kV(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 NV(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:s,last:a,point:l}=LV(i,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function LV(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(Zo(o,h,p)){a=o===h,l=o===p;break}}return{first:a,last:l,point:r}}class tP{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:Lt},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 FV(e){const{chart:t,fill:n,line:r}=e;if(Gt(n))return zV(t,n);if(n==="stack")return IV(e);if(n==="shape")return!0;const o=jV(e);return o instanceof tP?o:eP(o,r)}function zV(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function jV(e){return(e.scale||{}).getPointPositionForValue?HV(e):VV(e)}function VV(e){const{scale:t={},fill:n}=e,r=DV(n,t);if(Gt(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function HV(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,s=TV(n,t,i),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new tP({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 km(e,t,n){const r=FV(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&&(up(e,n),WV(e,{line:o,target:r,above:d,below:h,area:n,scale:i,axis:s}),dp(e))}function WV(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&&(NS(e,r,s.top),LS(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore(),e.save(),NS(e,r,s.bottom)),LS(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore()}function NS(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[q0(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 LS(e,t){const{line:n,target:r,property:o,color:i,scale:s}=t,a=RV(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,BV(e,s,g&&cb(o,d,h)),e.beginPath();const b=!!n.pathSegment(e,l);let y;if(g){b?e.closePath():FS(e,r,h,o);const x=!!r.pathSegment(e,u,{move:b,reverse:!0});y=b&&x,y||FS(e,r,d,o)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function BV(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 FS(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var UV={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 Fi&&(l={visible:e.isDatasetVisible(s),index:s,fill:OV(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=PV(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&&km(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;kS(i)&&km(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!kS(r)||n.drawTime!=="beforeDatasetDraw"||km(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const zS=(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)}},qV=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class jS extends ai{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=Et(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=Zt(r.font),i=o.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=zS(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,w)=>{const{itemWidth:_,itemHeight:C}=GV(r,n,i,x,o);w>0&&g+C+2*a>d&&(h+=p+a,u.push({width:p,height:g}),b+=p+a,y++,p=g=0),l[w]={left:b,top:g,col:y,width:_,height:C},p=Math.max(p,_),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=ll(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=$n(r,this.left+o,this.right-this.lineWidths[a]);for(const u of n)a!==u.row&&(a=u.row,l=$n(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=$n(r,this.top+t+o,this.bottom-this.columnSizes[a].height);for(const u of n)u.col!==a&&(a=u.col,l=$n(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;up(t,this),this._draw(),dp(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=t,a=Wt.color,l=ll(t.rtl,this.left,this.width),u=Zt(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}=zS(s,h),w=function(D,O,T){if(isNaN(b)||b<=0||isNaN(y)||y<0)return;o.save();const I=Ke(T.lineWidth,1);if(o.fillStyle=Ke(T.fillStyle,a),o.lineCap=Ke(T.lineCap,"butt"),o.lineDashOffset=Ke(T.lineDashOffset,0),o.lineJoin=Ke(T.lineJoin,"miter"),o.lineWidth=I,o.strokeStyle=Ke(T.strokeStyle,a),o.setLineDash(Ke(T.lineDash,[])),s.usePointStyle){const N={radius:y*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:I},W=l.xPlus(D,b/2),Y=O+p;S$(o,N,W,Y,s.pointStyleWidth&&b)}else{const N=O+Math.max((h-y)/2,0),W=l.leftForLtr(D,b),Y=Qs(T.borderRadius);o.beginPath(),Object.values(Y).some(ue=>ue!==0)?du(o,{x:W,y:N,w:b,h:y,radius:Y}):o.rect(W,N,b,y),o.fill(),I!==0&&o.stroke()}o.restore()},_=function(D,O,T){la(o,T.text,D,O+x/2,u,{strikethrough:T.hidden,textAlign:l.textAlign(T.textAlign)})},C=this.isHorizontal(),R=this._computeTitleHeight();C?g={x:$n(i,this.left+d,this.right-r[0]),y:this.top+d+R,line:0}:g={x:this.left+d,y:$n(i,this.top+R+d,this.bottom-n[0].height),line:0},D$(this.ctx,t.textDirection);const E=x+d;this.legendItems.forEach((D,O)=>{o.strokeStyle=D.fontColor,o.fillStyle=D.fontColor;const T=o.measureText(D.text).width,I=l.textAlign(D.textAlign||(D.textAlign=s.textAlign)),N=b+p+T;let W=g.x,Y=g.y;l.setWidth(this.width),C?O>0&&W+N+d>this.right&&(Y=g.y+=E,g.line++,W=g.x=$n(i,this.left+d,this.right-r[g.line])):O>0&&Y+E>this.bottom&&(W=g.x=W+n[g.line].width+d,g.line++,Y=g.y=$n(i,this.top+R+d,this.bottom-n[g.line].height));const ue=l.x(W);if(w(ue,Y,D),W=p8(I,W+b+p,C?W+N:this.right,t.rtl),_(l.x(W),Y,D),C)g.x+=N+d;else if(typeof D.text!="string"){const J=u.lineHeight;g.y+=nP(D,J)+d}else g.y+=E}),T$(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Zt(n.font),o=xn(n.padding);if(!n.display)return;const i=ll(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=$n(t.align,h,this.right-p);else{const b=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);d=u+$n(t.align,this.top,this.bottom-b-t.labels.padding-this._computeTitleHeight())}const g=$n(a,h,h+p);s.textAlign=i.textAlign(L0(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,la(s,n.text,g,d,r)}_computeTitleHeight(){const t=this.options.title,n=Zt(t.font),r=xn(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,o,i;if(Zo(t,this.left,this.right)&&Zo(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],Zo(t,o.left,o.left+o.width)&&Zo(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!XV(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=qV(o,r);o&&!i&&Et(n.onLeave,[t,o,this],this),this._hoveredItem=r,r&&!i&&Et(n.onHover,[t,r,this],this)}else r&&Et(n.onClick,[t,r,this],this)}}function GV(e,t,n,r,o){const i=YV(r,e,t,n),s=KV(o,r,t.lineHeight);return{itemWidth:i,itemHeight:s}}function YV(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 KV(e,t,n){let r=e;return typeof t.text!="string"&&(r=nP(t,n)),r}function nP(e,t){const n=e.text?e.text.length:0;return t*n}function XV(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var QV={id:"legend",_element:jS,start(e,t,n){const r=e.legend=new jS({ctx:e.ctx,options:n,chart:e});Pn.configure(e,r,n),Pn.addBox(e,r)},stop(e){Pn.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Pn.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=xn(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 G0 extends ai{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=Nt(r.text)?r.text.length:1;this._padding=xn(r.padding);const i=o*Zt(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=$n(a,r,i),h=n+t,u=i-r):(s.position==="left"?(d=r+t,h=$n(a,o,n),l=Ft*-.5):(d=i-t,h=$n(a,n,o),l=Ft*.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=Zt(n.font),i=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:u}=this._drawArgs(i);la(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:u,textAlign:L0(n.align),textBaseline:"middle",translation:[s,a]})}}function ZV(e,t){const n=new G0({ctx:e.ctx,options:t,chart:e});Pn.configure(e,n,t),Pn.addBox(e,n),e.titleBlock=n}var JV={id:"title",_element:G0,start(e,t,n){ZV(e,n)},stop(e){const t=e.titleBlock;Pn.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Pn.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 vf=new WeakMap;var eH={id:"subtitle",start(e,t,n){const r=new G0({ctx:e.ctx,options:n,chart:e});Pn.configure(e,r,n),Pn.addBox(e,r),vf.set(e,r)},stop(e){Pn.removeBox(e,vf.get(e)),vf.delete(e)},beforeUpdate(e,t,n){const r=vf.get(e);Pn.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 Fc={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=tb(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 ao(e,t){return t&&(Nt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Yo(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
125
|
+
`)>-1?e.split(`
|
|
126
|
+
`):e}function tH(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 VS(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:s,boxHeight:a}=t,l=Zt(t.bodyFont),u=Zt(t.titleFont),d=Zt(t.footerFont),h=i.length,p=o.length,g=r.length,b=xn(t.padding);let y=b.height,x=0,w=r.reduce((R,E)=>R+E.before.length+E.lines.length+E.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,h&&(y+=h*u.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),w){const R=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=g*R+(w-g)*l.lineHeight+(w-1)*t.bodySpacing}p&&(y+=t.footerMarginTop+p*d.lineHeight+(p-1)*t.footerSpacing);let _=0;const C=function(R){x=Math.max(x,n.measureText(R).width+_)};return n.save(),n.font=u.string,_t(e.title,C),n.font=l.string,_t(e.beforeBody.concat(e.afterBody),C),_=t.displayColors?s+2+t.boxPadding:0,_t(r,R=>{_t(R.before,C),_t(R.lines,C),_t(R.after,C)}),_=0,n.font=d.string,_t(e.footer,C),n.restore(),x+=b.width,{width:x,height:y}}function nH(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function rH(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 oH(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"),rH(u,e,t,n)&&(u="center"),u}function HS(e,t,n){const r=n.yAlign||t.yAlign||nH(e,n);return{xAlign:n.xAlign||t.xAlign||oH(e,t,n,r),yAlign:r}}function iH(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function sH(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function WS(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}=Qs(s);let b=iH(t,a);const y=sH(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:dn(b,0,r.width-t.width),y:dn(y,0,r.height-t.height)}}function bf(e,t,n){const r=xn(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function BS(e){return ao([],Yo(e))}function aH(e,t,n){return Qi(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function US(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const rP={beforeTitle:Wo,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:Wo,beforeBody:Wo,beforeLabel:Wo,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 st(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:Wo,afterBody:Wo,beforeFooter:Wo,footer:Wo,afterFooter:Wo};function Wn(e,t,n,r){const o=e[t].call(n,r);return typeof o>"u"?rP[t].call(n,r):o}var mv;let qS=(mv=class extends ai{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 N$(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=aH(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=Wn(r,"beforeTitle",this,t),i=Wn(r,"title",this,t),s=Wn(r,"afterTitle",this,t);let a=[];return a=ao(a,Yo(o)),a=ao(a,Yo(i)),a=ao(a,Yo(s)),a}getBeforeBody(t,n){return BS(Wn(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return _t(t,i=>{const s={before:[],lines:[],after:[]},a=US(r,i);ao(s.before,Yo(Wn(a,"beforeLabel",this,i))),ao(s.lines,Wn(a,"label",this,i)),ao(s.after,Yo(Wn(a,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(t,n){return BS(Wn(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=Wn(r,"beforeFooter",this,t),i=Wn(r,"footer",this,t),s=Wn(r,"afterFooter",this,t);let a=[];return a=ao(a,Yo(o)),a=ao(a,Yo(i)),a=ao(a,Yo(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(tH(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))),_t(a,d=>{const h=US(t.callbacks,d);o.push(Wn(h,"labelColor",this,d)),i.push(Wn(h,"labelPointStyle",this,d)),s.push(Wn(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=Fc[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=VS(this,r),u=Object.assign({},a,l),d=HS(this.chart,r,u),h=WS(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}=Qs(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,w=x-s,C=R+s,E=R-s):(x=p+b,w=x+s,C=R-s,E=R+s),_=x):(o==="left"?w=p+Math.max(l,d)+s:o==="right"?w=p+b-Math.max(u,h)-s:w=this.caretX,i==="top"?(C=g,R=C-s,x=w-s,_=w+s):(C=g+y,R=C+s,x=w+s,_=w-s),E=C),{x1:x,x2:w,x3:_,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=ll(r.rtl,this.x,this.width);for(t.x=bf(this,r.titleAlign,r),n.textAlign=u.textAlign(r.titleAlign),n.textBaseline="middle",s=Zt(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=Zt(i.bodyFont),h=bf(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,w=b+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,rb(t,y,x,w),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,rb(t,y,x,w)}else{t.lineWidth=ct(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),w=Qs(s.borderRadius);Object.values(w).some(_=>_!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,du(t,{x:y,y:b,w:u,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),du(t,{x,y:b+1,w:u-2,h:l-2,radius:w}),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=Zt(r.bodyFont);let p=h.lineHeight,g=0;const b=ll(r.rtl,this.x,this.width),y=function(T){n.fillText(T,b.x(t.x+g),t.y+p/2),t.y+=p+i},x=b.textAlign(s);let w,_,C,R,E,D,O;for(n.textAlign=s,n.textBaseline="middle",n.font=h.string,t.x=bf(this,x,r),n.fillStyle=r.bodyColor,_t(this.beforeBody,y),g=a&&x!=="right"?s==="center"?u/2+d:u+2+d:0,R=0,D=o.length;R<D;++R){for(w=o[R],_=this.labelTextColors[R],n.fillStyle=_,_t(w.before,y),C=w.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;_t(w.after,y)}g=0,p=h.lineHeight,_t(this.afterBody,y),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let s,a;if(i){const l=ll(r.rtl,this.x,this.width);for(t.x=bf(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=Zt(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}=Qs(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=Fc[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=VS(this,t),l=Object.assign({},s,this._size),u=HS(n,t,l),d=WS(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=xn(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),D$(t,n.textDirection),i.y+=s.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),T$(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=!hh(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||!hh(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=Fc[i.position].call(this,t,n);return s!==!1&&(r!==s.x||o!==s.y)}},Ce(mv,"positioners",Fc),mv);var lH={id:"tooltip",_element:qS,positioners:Fc,afterInit(e,t,n){n&&(e.tooltip=new qS({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:rP},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"]},cH=Object.freeze({__proto__:null,Colors:wV,Decimation:EV,Filler:UV,Legend:QV,SubTitle:eH,Title:JV,Tooltip:lH});const uH=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function dH(e,t,n,r){const o=e.indexOf(t);if(o===-1)return uH(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const fH=(e,t)=>e===null?null:dn(Math.round(e),0,t);function GS(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class ub extends ba{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(st(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:dH(r,t,Ke(n,t),this._addedLabels),fH(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 GS.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(ub,"id","category"),Ce(ub,"defaults",{ticks:{callback:GS}});function hH(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,w=!st(s),_=!st(a),C=!st(u),R=(x-y)/(h+1);let E=j_((x-y)/b/g)*g,D,O,T,I;if(E<1e-14&&!w&&!_)return[{value:y},{value:x}];I=Math.ceil(x/E)-Math.floor(y/E),I>b&&(E=j_(I*E/b/g)*g),st(l)||(D=Math.pow(10,l),E=Math.ceil(E*D)/D),o==="ticks"?(O=Math.floor(y/E)*E,T=Math.ceil(x/E)*E):(O=y,T=x),w&&_&&i&&a8((a-s)/i,E/1e3)?(I=Math.round(Math.min((a-s)/E,d)),E=(a-s)/I,O=s,T=a):C?(O=w?s:O,T=_?a:T,I=u-1,E=(T-O)/I):(I=(T-O)/E,Bc(I,Math.round(I),E/1e3)?I=Math.round(I):I=Math.ceil(I));const N=Math.max(V_(E),V_(O));D=Math.pow(10,st(l)?N:l),O=Math.round(O*D)/D,T=Math.round(T*D)/D;let W=0;for(w&&(p&&O!==s?(n.push({value:s}),O<s&&W++,Bc(Math.round((O+W*E)*D)/D,s,YS(s,R,e))&&W++):O<s&&W++);W<I;++W){const Y=Math.round((O+W*E)*D)/D;if(_&&Y>a)break;n.push({value:Y})}return _&&p&&T!==a?n.length&&Bc(n[n.length-1].value,a,YS(a,R,e))?n[n.length-1].value=a:n.push({value:a}):(!_||T===a)&&n.push({value:T}),n}function YS(e,t,{horizontal:n,minRotation:r}){const o=Kr(r),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*t*(""+e).length;return Math.min(t/i,s)}class xh extends ba{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 st(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=bo(o),u=bo(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=hH(o,i);return t.bounds==="ticks"&&p$(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 Uu(t,this.chart.options.locale,this.options.ticks.format)}}class db extends xh{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Gt(t)?t:0,this.max=Gt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Kr(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(db,"id","linear"),Ce(db,"defaults",{ticks:{callback:cp.formatters.numeric}});const hu=e=>Math.floor(Li(e)),Os=(e,t)=>Math.pow(10,hu(e)+t);function KS(e){return e/Math.pow(10,hu(e))===1}function XS(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function pH(e,t){const n=t-e;let r=hu(n);for(;XS(e,t,r)>10;)r++;for(;XS(e,t,r)<10;)r--;return Math.min(r,hu(e))}function gH(e,{min:t,max:n}){t=ir(e.min,t);const r=[],o=hu(t);let i=pH(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=ir(e.min,Math.round((l+d+h*Math.pow(10,i))*s)/s);for(;p<n;)r.push({value:p,major:KS(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=ir(e.max,p);return r.push({value:g,major:KS(g),significand:h}),r}class fb extends ba{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=xh.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Gt(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Gt(t)?Math.max(0,t):null,this.max=Gt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Gt(this._userMin)&&(this.min=t===Os(this.min,0)?Os(this.min,-1):Os(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(Os(r,-1)),s(Os(o,1)))),r<=0&&i(Os(o,-1)),o<=0&&s(Os(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=gH(n,this);return t.bounds==="ticks"&&p$(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":Uu(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Li(t),this._valueRange=Li(this.max)-Li(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Li(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Ce(fb,"id","logarithmic"),Ce(fb,"defaults",{ticks:{callback:cp.formatters.logarithmic,major:{enabled:!0}}});function hb(e){const t=e.ticks;if(t.display&&e.display){const n=xn(t.backdropPadding);return Ke(t.font&&t.font.size,Wt.font.size)+n.height}return 0}function mH(e,t,n){return n=Nt(n)?n:[n],{w:C8(e,t.string,n),h:n.length*t.lineHeight}}function QS(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 vH(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?Ft/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=Zt(u.font),p=mH(e.ctx,h,e._pointLabels[l]);r[l]=p;const g=cr(e.getIndexAngle(l)+a),b=Math.round(k0(g)),y=QS(b,d.x,p.w,0,180),x=QS(b,d.y,p.h,90,270);bH(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=wH(e,r,o)}function bH(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 yH(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(k0(cr(l.angle+Qt))),d=CH(l.y,a.h,u),h=_H(u),p=SH(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 xH(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(ei({x:n,y:r},t)||ei({x:n,y:i},t)||ei({x:o,y:r},t)||ei({x:o,y:i},t))}function wH(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:s,display:a}=i.pointLabels,l={extra:hb(i)/2,additionalAngle:s?Ft/o:0};let u;for(let d=0;d<o;d++){l.padding=n[d],l.size=t[d];const h=yH(e,d,l);r.push(h),a==="auto"&&(h.visible=xH(h,u),h.visible&&(u=h))}return r}function _H(e){return e===0||e===180?"center":e<180?"left":"right"}function SH(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function CH(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function EH(e,t,n){const{left:r,top:o,right:i,bottom:s}=n,{backdropColor:a}=t;if(!st(a)){const l=Qs(t.borderRadius),u=xn(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(),du(e,{x:d,y:h,w:p,h:g,radius:l}),e.fill()):e.fillRect(d,h,p,g)}}function RH(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));EH(n,s,i);const a=Zt(s.font),{x:l,y:u,textAlign:d}=i;la(n,e._pointLabels[o],l,u+a.lineHeight/2,a,{color:s.color,textAlign:d,textBaseline:"middle"})}}function oP(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,Lt);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 $H(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(),oP(e,n,s,r),i.closePath(),i.stroke(),i.restore())}function PH(e,t,n){return Qi(e,{label:n,index:t,type:"pointLabel"})}class zc extends xh{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=xn(hb(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=Gt(t)&&!isNaN(t)?t:0,this.max=Gt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/hb(this.options))}generateTickLabels(t){xh.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const o=Et(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?vH(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=Lt/(this._pointLabels.length||1),r=this.options.startAngle||0;return cr(t*n+Kr(r))}getDistanceFromCenterForValue(t){if(st(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(st(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 PH(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const o=this.getIndexAngle(t)-Qt+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(),oP(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&&RH(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);$H(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=Zt(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=xn(u.backdropPadding);t.fillRect(-s/2-h.left,-i-d.size/2-h.top,s+h.width,d.size+h.height)}la(t,a.label,0,-i,d,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}Ce(zc,"id","radialLinear"),Ce(zc,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:cp.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Ce(zc,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Ce(zc,"descriptors",{angleLines:{_fallback:"grid"}});const hp={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}},Gn=Object.keys(hp);function ZS(e,t){return e-t}function JS(e,t){if(st(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)),Gt(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(o&&(s=o==="week"&&(Ol(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function eC(e,t,n,r){const o=Gn.length;for(let i=Gn.indexOf(e);i<o-1;++i){const s=hp[Gn[i]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return Gn[i]}return Gn[o-1]}function OH(e,t,n,r,o){for(let i=Gn.length-1;i>=Gn.indexOf(n);i--){const s=Gn[i];if(hp[s].common&&e._adapter.diff(o,r,s)>=t-1)return s}return Gn[n?Gn.indexOf(n):0]}function MH(e){for(let t=Gn.indexOf(e)+1,n=Gn.length;t<n;++t)if(hp[Gn[t]].common)return Gn[t]}function tC(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=N0(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function DH(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 nC(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:DH(e,r,o,n)}class pu extends ba{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 jz._date(t.adapters.date);o.init(n),Wc(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:JS(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=Gt(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=Gt(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=d8(o,i,s);return this._unit=n.unit||(r.autoSkip?eC(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):OH(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:MH(this._unit),this.initOffsets(o),t.reverse&&a.reverse(),nC(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=dn(n,0,s),r=dn(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||eC(i.minUnit,n,r,this._getLabelCapacity(n)),a=Ke(o.ticks.stepSize,1),l=s==="week"?i.isoWeekday:!1,u=Ol(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++)tC(d,p,b);return(p===r||o.bounds==="ticks"||g===1)&&tC(d,p,b),Object.keys(d).sort(ZS).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 Et(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=Kr(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,nC(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(JS(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return v$(t.sort(ZS))}}Ce(pu,"id","time"),Ce(pu,"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 yf(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}=Jo(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}=Jo(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 pb extends pu{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=yf(n,this.min),this._tableRange=yf(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(yf(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return yf(this._table,r*this._tableRange+this._minPos,!0)}}Ce(pb,"id","timeseries"),Ce(pb,"defaults",pu.defaults);var TH=Object.freeze({__proto__:null,CategoryScale:ub,LinearScale:db,LogarithmicScale:fb,RadialLinearScale:zc,TimeScale:pu,TimeSeriesScale:pb});const AH=[zz,gV,cH,TH];/*!
|
|
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 rC=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}(),Xc={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):st(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*rC)/rC}};function Nm(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 IH(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 kH=0,iP=1,sP=2,aP=4,lP=8;function xf(e,t,n){var r=kH;return e<n.left?r|=iP:e>n.right&&(r|=sP),t<n.top?r|=lP:t>n.bottom&&(r|=aP),r}function NH(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=xf(n,r,t),a=xf(o,i,t),l,u,d;!(!(s|a)||s&a);)l=s||a,l&lP?(u=n+(o-n)*(t.top-r)/(i-r),d=t.top):l&aP?(u=n+(o-n)*(t.bottom-r)/(i-r),d=t.bottom):l&sP?(d=r+(i-r)*(t.right-n)/(o-n),u=t.right):l&iP&&(d=r+(i-r)*(t.left-n)/(o-n),u=t.left),l===s?(n=u,r=d,s=xf(n,r,t)):(o=u,i=d,a=xf(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function wf(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=NH(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),IH(o,i,e.vx,e.vy,t.align)}var _f={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 wf({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=Nm(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return wf({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=Nm(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)),wf({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=Nm(e,t.origin);return wf({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)}},ti=Xc.rasterize;function LH(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 FH(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 zH(e){return e instanceof ol?_f.arc:e instanceof Yc?_f.point:e instanceof Kc?_f.bar:_f.fallback}function jH(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 VH(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),jH(e,ti(t.x)+i/2,ti(t.y)+i/2,ti(t.w)-i,ti(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 HH(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 WH(e,t,n){var r=e.shadowBlur,o=n.stroked,i=ti(n.x),s=ti(n.y),a=ti(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 BH(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=HH(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)WH(e,t[p],{stroked:h,filled:s,w:n.w,x:n.x,y:n.y+n.h*p})}var cP=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};wo(cP.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=Zt(kt([n.font,{}],r,i)),a=kt([n.color,Wt.color],r,i);return{align:kt([n.align,"center"],r,i),anchor:kt([n.anchor,"center"],r,i),area:r.chart.chartArea,backgroundColor:kt([n.backgroundColor,null],r,i),borderColor:kt([n.borderColor,null],r,i),borderRadius:kt([n.borderRadius,0],r,i),borderWidth:kt([n.borderWidth,0],r,i),clamp:kt([n.clamp,!1],r,i),clip:kt([n.clip,!1],r,i),color:a,display:e,font:s,lines:t,offset:kt([n.offset,4],r,i),opacity:kt([n.opacity,1],r,i),origin:FH(o._el,r),padding:xn(kt([n.padding,4],r,i)),positioner:zH(o._el),rotation:kt([n.rotation,0],r,i)*(Math.PI/180),size:Xc.textSize(o._ctx,t,s),textAlign:kt([n.textAlign,"start"],r,i),textShadowBlur:kt([n.textShadowBlur,0],r,i),textShadowColor:kt([n.textShadowColor,a],r,i),textStrokeColor:kt([n.textStrokeColor,a],r,i),textStrokeWidth:kt([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=kt([i.display,!0],e,o);u&&(s=e.dataset.data[o],a=Ke(Et(i.formatter,[s,e]),s),l=st(a)?[]:Xc.toTextLines(a),l.length&&(n=t._modelize(u,l,i,e),r=LH(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=Xc.bound(0,o.opacity,1),r.translate(ti(t.x),ti(t.y)),r.rotate(o.rotation),VH(r,i.frame,o),BH(r,o.lines,i.text,o),r.restore())}});var UH=Number.MIN_SAFE_INTEGER||-9007199254740991,qH=Number.MAX_SAFE_INTEGER||9007199254740991;function $c(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 oC(e,t){var n=qH,r=UH,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 Sf(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 uP=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};wo(uP.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=$c(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=[Sf(t[0],t[1]),Sf(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(Sf(n[0],n[1]),Sf(n[0],n[3])),o=0;o<r.length;++o)if(i=oC(t,r[o]),s=oC(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[$c({x:t.x,y:t.y},r,n),$c({x:t.x+t.w,y:t.y},r,n),$c({x:t.x+t.w,y:t.y+t.h},r,n),$c({x:t.x,y:t.y+t.h},r,n)]}});function dP(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 GH(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 YH(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=dP(a,r.model(),i),o._box.update(s,i,r.rotation()));return GH(e,function(l,u){var d=l._hidable,h=u._hidable;d&&h||h?u._visible=!1:d&&(l._visible=!1)})}var Qc={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 uP,_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&&YH(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=dP(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},KH=function(e){if(st(e))return null;var t=e,n,r,o;if(ct(e))if(!st(e.label))t=e.label;else if(!st(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},XH={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:KH,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},Bn="$datalabels",fP="$default";function QH(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=wo({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(wo({},[t,i[a],{_key:a}]))}):o.push(t),r=o.reduce(function(a,l){return _t(l.listeners||{},function(u,d){a[d]=a[d]||{},a[d][l._key||fP]=u}),delete l.listeners,a},{}),{labels:o,listeners:r})}function gb(e,t,n,r){if(t){var o=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&Et(s,[o,r])===!0&&(e[Bn]._dirty=!0,n.update(o)))}}function ZH(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&gb(e,t.leave,n,o),i&&gb(e,t.enter,r,o))}function JH(e,t){var n=e[Bn],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=Qc.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,ZH(e,r,o,i,t)}}function eW(e,t){var n=e[Bn],r=n._listeners.click,o=r&&Qc.lookup(n._labels,t);o&&gb(e,r,o,t)}var tW={id:"datalabels",defaults:XH,beforeInit:function(e){e[Bn]={_actives:[]}},beforeUpdate:function(e){var t=e[Bn];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[Bn],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=QH(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(w=u[h],w[Bn]=[],s&&w&&e.getDataVisibility(h)&&!w.skip)for(p=0,b=l.labels.length;p<b;++p)y=l.labels[p],x=y._key,_=new cP(y,d,w,h),_.$groups={_set:r,_key:x||fP},_.$context={active:!1,chart:e,dataIndex:h,dataset:a,datasetIndex:r},_.update(_.$context),w[Bn].push(_),i.push(_);d.restore(),wo(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[Bn]._labels=Qc.prepare(e[Bn]._datasets)},afterDatasetsDraw:function(e){Qc.draw(e,e[Bn]._labels)},beforeEvent:function(e,t){if(e[Bn]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":JH(e,n);break;case"click":eW(e,n);break}}},afterEvent:function(e){var t=e[Bn],n=t._actives,r=t._actives=e.getActiveElements(),o=Xc.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[Bn]||[],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)&&(Qc.update(t._labels),e.render()),delete t._dirty}};Ir.register(...AH);Ir.register(tW);function hP({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&&(Ir.defaults.font={...Ir.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 Ir(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 Fr(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 nW=["color"],pP=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,nW);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"}))}),rW=["color"],oW=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,rW);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"}))}),iW=["color"],sW=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,iW);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"}))}),aW=["color"],gP=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,aW);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"}))}),lW=["color"],cW=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,lW);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"}))}),uW=["color"],dW=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,uW);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"}))}),fW=["color"],hW=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,fW);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"}))}),pW=["color"],gW=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,pW);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"}))}),mW=["color"],vW=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,mW);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"}))}),bW=["color"],yW=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,bW);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"}))}),xW=["color"],Y0=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,xW);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}))}),wW=["color"],K0=m.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=Fr(e,wW);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 _W(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 _;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:SW((_=b==null?void 0:b.datalabels)==null?void 0:_.align,y)},backgroundColor:y,borderColor:x}})}function SW(e,t){return ih(e==="end"||e==="start"?oh():t)}function CW(e){var a,l,u,d;const{metricKeys:t,dimensionKeys:n}=Nr(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 EW(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 RW(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 Nr(e){if(e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=RW(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 mb(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 X0({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 vb(e,t){var s;const n=Ee.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=ia.cloneDeep(r);return ia.merge(o,e,t)}function mP(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}function $W({frame:e}){const t=Ee(_=>_.isDashboardEditing),n=Ee(_=>_.filterValues),r=Ee(_=>_.isVisualEditing),o=Ee(_=>_.selectedSheetId);Ee(_=>_.currentBreakpoint);const{removeFrame:i}=Ee(_=>_.actions),s=Ee(_=>_.actions.setIsVisualEditing),a=qt(_=>_.actions.setFilterValues),l=qt(_=>_.actions.setApplyFilters),{setCard:u,setFrame:d,setQueryResultColumns:h}=qt(_=>_.actions),p=qt(_=>_.actions.setSelectedConnectionId),g=qt(_=>_.actions.setSelectedDatabaseName),b=qt(_=>_.actions.setSelectedSchemaName),y=qt(_=>_.actions.setSelectedTableName),x=e.cards.find(_=>_.id===e.activeCardId);function w(){s(!r),u(x);const{dimensionKeys:_}=Nr((x==null?void 0:x.data)||[]);h(_),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(cW,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}):k.jsx(dW,{role:"edit-visual",onClick:w,className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"}),k.jsx(gP,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] hover:cursor-pointer hover:text-foreground/50 text-foreground/30"})]})})}function PW(e,t=globalThis==null?void 0:globalThis.document){const n=sn(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const bb="dismissableLayer.update",OW="dismissableLayer.pointerDownOutside",MW="dismissableLayer.focusOutside";let iC;const DW=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wl=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(DW),[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,T=>p(T)),x=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=x.indexOf(w),C=h?x.indexOf(h):-1,R=d.layersWithOutsidePointerEventsDisabled.size>0,E=C>=_,D=TW(T=>{const I=T.target,N=[...d.branches].some(W=>W.contains(I));!E||N||(i==null||i(T),a==null||a(T),T.defaultPrevented||l==null||l())},g),O=AW(T=>{const I=T.target;[...d.branches].some(W=>W.contains(I))||(s==null||s(T),a==null||a(T),T.defaultPrevented||l==null||l())},g);return PW(T=>{C===d.layers.size-1&&(o==null||o(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},g),m.useEffect(()=>{if(h)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(iC=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),sC(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=iC)}},[h,g,r,d]),m.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),sC())},[h,d]),m.useEffect(()=>{const T=()=>b({});return document.addEventListener(bb,T),()=>document.removeEventListener(bb,T)},[]),m.createElement(Le.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,D.onPointerDownCapture)}))});function TW(e,t=globalThis==null?void 0:globalThis.document){const n=sn(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let u=function(){vP(OW,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 AW(e,t=globalThis==null?void 0:globalThis.document){const n=sn(e),r=m.useRef(!1);return m.useEffect(()=>{const o=i=>{i.target&&!r.current&&vP(MW,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 sC(){const e=new CustomEvent(bb);document.dispatchEvent(e)}function vP(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?aR(o,i):o.dispatchEvent(i)}const IW=["top","right","bottom","left"],qi=Math.min,dr=Math.max,wh=Math.round,Cf=Math.floor,Gi=e=>({x:e,y:e}),kW={left:"right",right:"left",bottom:"top",top:"bottom"},NW={start:"end",end:"start"};function yb(e,t,n){return dr(e,qi(t,n))}function oi(e,t){return typeof e=="function"?e(t):e}function ii(e){return e.split("-")[0]}function Bl(e){return e.split("-")[1]}function Q0(e){return e==="x"?"y":"x"}function Z0(e){return e==="y"?"height":"width"}function Ul(e){return["top","bottom"].includes(ii(e))?"y":"x"}function J0(e){return Q0(Ul(e))}function LW(e,t,n){n===void 0&&(n=!1);const r=Bl(e),o=J0(e),i=Z0(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=_h(s)),[s,_h(s)]}function FW(e){const t=_h(e);return[xb(e),t,xb(t)]}function xb(e){return e.replace(/start|end/g,t=>NW[t])}function zW(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 jW(e,t,n,r){const o=Bl(e);let i=zW(ii(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(xb)))),i}function _h(e){return e.replace(/left|right|bottom|top/g,t=>kW[t])}function VW(e){return{top:0,right:0,bottom:0,left:0,...e}}function bP(e){return typeof e!="number"?VW(e):{top:e,right:e,bottom:e,left:e}}function Sh(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function aC(e,t,n){let{reference:r,floating:o}=e;const i=Ul(t),s=J0(t),a=Z0(s),l=ii(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(Bl(t)){case"start":g[s]-=p*(n&&u?-1:1);break;case"end":g[s]+=p*(n&&u?-1:1);break}return g}const HW=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}=aC(u,r,l),p=r,g={},b=0;for(let y=0;y<a.length;y++){const{name:x,fn:w}=a[y],{x:_,y:C,data:R,reset:E}=await w({x:d,y:h,initialPlacement:r,placement:p,strategy:o,middlewareData:g,rects:u,platform:s,elements:{reference:e,floating:t}});if(d=_??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}=aC(u,p,l)),y=-1;continue}}return{x:d,y:h,placement:p,strategy:o,middlewareData:g}};async function gu(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}=oi(t,e),b=bP(g),x=a[p?h==="floating"?"reference":"floating":h],w=Sh(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})),_=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=Sh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:_,offsetParent:C,strategy:l}):_);return{top:(w.top-E.top+b.top)/R.y,bottom:(E.bottom-w.bottom+b.bottom)/R.y,left:(w.left-E.left+b.left)/R.x,right:(E.right-w.right+b.right)/R.x}}const lC=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}=oi(e,t)||{};if(u==null)return{};const h=bP(d),p={x:n,y:r},g=J0(o),b=Z0(g),y=await s.getDimensions(u),x=g==="y",w=x?"top":"left",_=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],D=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let O=D?D[C]:0;(!O||!await(s.isElement==null?void 0:s.isElement(D)))&&(O=a.floating[C]||i.floating[b]);const T=R/2-E/2,I=O/2-y[b]/2-1,N=qi(h[w],I),W=qi(h[_],I),Y=N,ue=O-y[b]-W,J=O/2-y[b]/2+T,F=yb(Y,J,ue),Z=!l.arrow&&Bl(o)!=null&&J!=F&&i.reference[b]/2-(J<Y?N:W)-y[b]/2<0,q=Z?J<Y?J-Y:J-ue:0;return{[g]:p[g]+q,data:{[g]:F,centerOffset:J-F-q,...Z&&{alignmentOffset:q}},reset:Z}}}),WW=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}=oi(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=ii(o),_=ii(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(u.floating)),R=p||(_||!y?[_h(a)]:FW(a));!p&&b!=="none"&&R.push(...jW(a,y,b,C));const E=[a,...R],D=await gu(t,x),O=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&O.push(D[w]),h){const Y=LW(o,s,C);O.push(D[Y[0]],D[Y[1]])}if(T=[...T,{placement:o,overflows:O}],!O.every(Y=>Y<=0)){var I,N;const Y=(((I=i.flip)==null?void 0:I.index)||0)+1,ue=E[Y];if(ue)return{data:{index:Y,overflows:T},reset:{placement:ue}};let J=(N=T.filter(F=>F.overflows[0]<=0).sort((F,Z)=>F.overflows[1]-Z.overflows[1])[0])==null?void 0:N.placement;if(!J)switch(g){case"bestFit":{var W;const F=(W=T.map(Z=>[Z.placement,Z.overflows.filter(q=>q>0).reduce((q,X)=>q+X,0)]).sort((Z,q)=>Z[1]-q[1])[0])==null?void 0:W[0];F&&(J=F);break}case"initialPlacement":J=a;break}if(o!==J)return{reset:{placement:J}}}return{}}}};function cC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function uC(e){return IW.some(t=>e[t]>=0)}const BW=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=oi(e,t);switch(r){case"referenceHidden":{const i=await gu(t,{...o,elementContext:"reference"}),s=cC(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:uC(s)}}}case"escaped":{const i=await gu(t,{...o,altBoundary:!0}),s=cC(i,n.floating);return{data:{escapedOffsets:s,escaped:uC(s)}}}default:return{}}}}};async function UW(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=ii(n),a=Bl(n),l=Ul(n)==="y",u=["left","top"].includes(s)?-1:1,d=i&&l?-1:1,h=oi(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 qW=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 UW(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}}}}},GW=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:w,y:_}=x;return{x:w,y:_}}},...l}=oi(e,t),u={x:n,y:r},d=await gu(t,l),h=Ul(ii(o)),p=Q0(h);let g=u[p],b=u[h];if(i){const x=p==="y"?"top":"left",w=p==="y"?"bottom":"right",_=g+d[x],C=g-d[w];g=yb(_,g,C)}if(s){const x=h==="y"?"top":"left",w=h==="y"?"bottom":"right",_=b+d[x],C=b-d[w];b=yb(_,b,C)}const y=a.fn({...t,[p]:g,[h]:b});return{...y,data:{x:y.x-n,y:y.y-r}}}}},YW=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}=oi(e,t),d={x:n,y:r},h=Ul(o),p=Q0(h);let g=d[p],b=d[h];const y=oi(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(ii(o)),E=i.reference[h]-i.floating[C]+(R&&((w=s.offset)==null?void 0:w[h])||0)+(R?0:x.crossAxis),D=i.reference[h]+i.reference[C]+(R?0:((_=s.offset)==null?void 0:_[h])||0)-(R?x.crossAxis:0);b<E?b=E:b>D&&(b=D)}return{[p]:g,[h]:b}}}},KW=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}=oi(e,t),l=await gu(t,a),u=ii(n),d=Bl(n),h=Ul(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],w=p-l[y],_=!t.middlewareData.shift;let C=x,R=w;if(h){const D=p-l.left-l.right;R=d||_?qi(w,D):D}else{const D=g-l.top-l.bottom;C=d||_?qi(x,D):D}if(_&&!d){const D=dr(l.left,0),O=dr(l.right,0),T=dr(l.top,0),I=dr(l.bottom,0);h?R=p-2*(D!==0||O!==0?D+O:dr(l.left,l.right)):C=g-2*(T!==0||I!==0?T+I:dr(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 Yi(e){return yP(e)?(e.nodeName||"").toLowerCase():"#document"}function pr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function li(e){var t;return(t=(yP(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yP(e){return e instanceof Node||e instanceof pr(e).Node}function si(e){return e instanceof Element||e instanceof pr(e).Element}function _o(e){return e instanceof HTMLElement||e instanceof pr(e).HTMLElement}function dC(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof pr(e).ShadowRoot}function Gu(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Lr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function XW(e){return["table","td","th"].includes(Yi(e))}function ey(e){const t=ty(),n=Lr(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 QW(e){let t=Tl(e);for(;_o(t)&&!pp(t);){if(ey(t))return t;t=Tl(t)}return null}function ty(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function pp(e){return["html","body","#document"].includes(Yi(e))}function Lr(e){return pr(e).getComputedStyle(e)}function gp(e){return si(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Tl(e){if(Yi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dC(e)&&e.host||li(e);return dC(t)?t.host:t}function xP(e){const t=Tl(e);return pp(t)?e.ownerDocument?e.ownerDocument.body:e.body:_o(t)&&Gu(t)?t:xP(t)}function mu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=xP(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=pr(o);return i?t.concat(s,s.visualViewport||[],Gu(o)?o:[],s.frameElement&&n?mu(s.frameElement):[]):t.concat(o,mu(o,[],n))}function wP(e){const t=Lr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=_o(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=wh(n)!==i||wh(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function ny(e){return si(e)?e:e.contextElement}function cl(e){const t=ny(e);if(!_o(t))return Gi(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=wP(t);let s=(i?wh(n.width):n.width)/r,a=(i?wh(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const ZW=Gi(0);function _P(e){const t=pr(e);return!ty()||!t.visualViewport?ZW:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function JW(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==pr(e)?!1:t}function ca(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=ny(e);let s=Gi(1);t&&(r?si(r)&&(s=cl(r)):s=cl(e));const a=JW(i,n,r)?_P(i):Gi(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=pr(i),g=r&&si(r)?pr(r):r;let b=p.frameElement;for(;b&&r&&g!==p;){const y=cl(b),x=b.getBoundingClientRect(),w=Lr(b),_=x.left+(b.clientLeft+parseFloat(w.paddingLeft))*y.x,C=x.top+(b.clientTop+parseFloat(w.paddingTop))*y.y;l*=y.x,u*=y.y,d*=y.x,h*=y.y,l+=_,u+=C,b=pr(b).frameElement}}return Sh({width:d,height:h,x:l,y:u})}function eB(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=_o(n),i=li(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=Gi(1);const l=Gi(0);if((o||!o&&r!=="fixed")&&((Yi(n)!=="body"||Gu(i))&&(s=gp(n)),_o(n))){const u=ca(n);a=cl(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 tB(e){return Array.from(e.getClientRects())}function SP(e){return ca(li(e)).left+gp(e).scrollLeft}function nB(e){const t=li(e),n=gp(e),r=e.ownerDocument.body,o=dr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=dr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+SP(e);const a=-n.scrollTop;return Lr(r).direction==="rtl"&&(s+=dr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function rB(e,t){const n=pr(e),r=li(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=ty();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function oB(e,t){const n=ca(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=_o(e)?cl(e):Gi(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 fC(e,t,n){let r;if(t==="viewport")r=rB(e,n);else if(t==="document")r=nB(li(e));else if(si(t))r=oB(t,n);else{const o=_P(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Sh(r)}function CP(e,t){const n=Tl(e);return n===t||!si(n)||pp(n)?!1:Lr(n).position==="fixed"||CP(n,t)}function iB(e,t){const n=t.get(e);if(n)return n;let r=mu(e,[],!1).filter(a=>si(a)&&Yi(a)!=="body"),o=null;const i=Lr(e).position==="fixed";let s=i?Tl(e):e;for(;si(s)&&!pp(s);){const a=Lr(s),l=ey(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Gu(s)&&!l&&CP(e,s))?r=r.filter(d=>d!==s):o=a,s=Tl(s)}return t.set(e,r),r}function sB(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?iB(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,d)=>{const h=fC(t,d,o);return u.top=dr(h.top,u.top),u.right=qi(h.right,u.right),u.bottom=qi(h.bottom,u.bottom),u.left=dr(h.left,u.left),u},fC(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function aB(e){return wP(e)}function lB(e,t,n){const r=_o(t),o=li(t),i=n==="fixed",s=ca(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=Gi(0);if(r||!r&&!i)if((Yi(t)!=="body"||Gu(o))&&(a=gp(t)),r){const u=ca(t,!0,i,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else o&&(l.x=SP(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function hC(e,t){return!_o(e)||Lr(e).position==="fixed"?null:t?t(e):e.offsetParent}function EP(e,t){const n=pr(e);if(!_o(e))return n;let r=hC(e,t);for(;r&&XW(r)&&Lr(r).position==="static";)r=hC(r,t);return r&&(Yi(r)==="html"||Yi(r)==="body"&&Lr(r).position==="static"&&!ey(r))?n:r||QW(e)||n}const cB=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||EP,i=this.getDimensions;return{reference:lB(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function uB(e){return Lr(e).direction==="rtl"}const dB={convertOffsetParentRelativeRectToViewportRelativeRect:eB,getDocumentElement:li,getClippingRect:sB,getOffsetParent:EP,getElementRects:cB,getClientRects:tB,getDimensions:aB,getScale:cl,isElement:si,isRTL:uB};function fB(e,t){let n=null,r;const o=li(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=Cf(d),b=Cf(o.clientWidth-(u+h)),y=Cf(o.clientHeight-(d+p)),x=Cf(u),_={rootMargin:-g+"px "+-b+"px "+-y+"px "+-x+"px",threshold:dr(0,qi(1,l))||1};let C=!0;function R(E){const D=E[0].intersectionRatio;if(D!==l){if(!C)return s();D?s(!1,D):r=setTimeout(()=>{s(!1,1e-7)},100)}C=!1}try{n=new IntersectionObserver(R,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,_)}n.observe(e)}return s(!0),i}function hB(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=ny(e),d=o||i?[...u?mu(u):[],...mu(t)]:[];d.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const h=u&&a?fB(u,n):null;let p=-1,g=null;s&&(g=new ResizeObserver(w=>{let[_]=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?ca(e):null;l&&x();function x(){const w=ca(e);y&&(w.x!==y.x||w.y!==y.y||w.width!==y.width||w.height!==y.height)&&n(),y=w,b=requestAnimationFrame(x)}return n(),()=>{d.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),h&&h(),g&&g.disconnect(),g=null,l&&cancelAnimationFrame(b)}}const pB=(e,t,n)=>{const r=new Map,o={platform:dB,...n},i={...o.platform,_c:r};return HW(e,t,{...o,platform:i})},gB=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?lC({element:r.current,padding:o}).fn(n):{}:r?lC({element:r,padding:o}).fn(n):{}}}};var Qf=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Ch(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(!Ch(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)&&!Ch(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function RP(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pC(e,t){const n=RP(e);return Math.round(t*n)/n}function gC(e){const t=ae.useRef(e);return Qf(()=>{t.current=e}),t}function mB(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]=ae.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=ae.useState(r);Ch(p,r)||g(r);const[b,y]=ae.useState(null),[x,w]=ae.useState(null),_=ae.useCallback(Z=>{Z!=D.current&&(D.current=Z,y(Z))},[y]),C=ae.useCallback(Z=>{Z!==O.current&&(O.current=Z,w(Z))},[w]),R=i||b,E=s||x,D=ae.useRef(null),O=ae.useRef(null),T=ae.useRef(d),I=gC(l),N=gC(o),W=ae.useCallback(()=>{if(!D.current||!O.current)return;const Z={placement:t,strategy:n,middleware:p};N.current&&(Z.platform=N.current),pB(D.current,O.current,Z).then(q=>{const X={...q,isPositioned:!0};Y.current&&!Ch(T.current,X)&&(T.current=X,iN.flushSync(()=>{h(X)}))})},[p,t,n,N]);Qf(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,h(Z=>({...Z,isPositioned:!1})))},[u]);const Y=ae.useRef(!1);Qf(()=>(Y.current=!0,()=>{Y.current=!1}),[]),Qf(()=>{if(R&&(D.current=R),E&&(O.current=E),R&&E){if(I.current)return I.current(R,E,W);W()}},[R,E,W,I]);const ue=ae.useMemo(()=>({reference:D,floating:O,setReference:_,setFloating:C}),[_,C]),J=ae.useMemo(()=>({reference:R,floating:E}),[R,E]),F=ae.useMemo(()=>{const Z={position:n,left:0,top:0};if(!J.floating)return Z;const q=pC(J.floating,d.x),X=pC(J.floating,d.y);return a?{...Z,transform:"translate("+q+"px, "+X+"px)",...RP(J.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:X}},[n,a,J.floating,d.x,d.y]);return ae.useMemo(()=>({...d,update:W,refs:ue,elements:J,floatingStyles:F}),[d,W,ue,J,F])}function mp(e){const[t,n]=m.useState(void 0);return On(()=>{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 $P="Popper",[PP,Po]=fn($P),[vB,OP]=PP($P),bB=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return m.createElement(vB,{scope:t,anchor:r,onAnchorChange:o},n)},yB="PopperAnchor",xB=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=OP(yB,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(Le.div,ne({},o,{ref:a}))}),MP="PopperContent",[wB,roe]=PP(MP),_B=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:w=[],collisionPadding:_=0,sticky:C="partial",hideWhenDetached:R=!1,updatePositionStrategy:E="optimized",onPlaced:D,...O}=e,T=OP(MP,d),[I,N]=m.useState(null),W=Xe(t,ze=>N(ze)),[Y,ue]=m.useState(null),J=mp(Y),F=(n=J==null?void 0:J.width)!==null&&n!==void 0?n:0,Z=(r=J==null?void 0:J.height)!==null&&r!==void 0?r:0,q=h+(g!=="center"?"-"+g:""),X=typeof _=="number"?_:{top:0,right:0,bottom:0,left:0,..._},ie=Array.isArray(w)?w:[w],j=ie.length>0,V={padding:X,boundary:ie.filter(SB),altBoundary:j},{refs:te,floatingStyles:le,placement:ce,isPositioned:ge,middlewareData:ve}=mB({strategy:"fixed",placement:q,whileElementsMounted:(...ze)=>hB(...ze,{animationFrame:E==="always"}),elements:{reference:T.anchor},middleware:[qW({mainAxis:p+Z,alignmentAxis:b}),x&&GW({mainAxis:!0,crossAxis:!1,limiter:C==="partial"?YW():void 0,...V}),x&&WW({...V}),KW({...V,apply:({elements:ze,rects:_e,availableWidth:pt,availableHeight:dt})=>{const{width:ft,height:Bt}=_e.reference,Vt=ze.floating.style;Vt.setProperty("--radix-popper-available-width",`${pt}px`),Vt.setProperty("--radix-popper-available-height",`${dt}px`),Vt.setProperty("--radix-popper-anchor-width",`${ft}px`),Vt.setProperty("--radix-popper-anchor-height",`${Bt}px`)}}),Y&&gB({element:Y,padding:y}),CB({arrowWidth:F,arrowHeight:Z}),R&&BW({strategy:"referenceHidden",...V})]}),[de,ee]=DP(ce),K=sn(D);On(()=>{ge&&(K==null||K())},[ge,K]);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,Q=((s=ve.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Oe,Ie]=m.useState();return On(()=>{I&&Ie(window.getComputedStyle(I).zIndex)},[I]),m.createElement("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...le,transform:ge?le.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Oe,"--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(wB,{scope:d,placedSide:de,onArrowChange:ue,arrowX:re,arrowY:be,shouldHideArrow:Q},m.createElement(Le.div,ne({"data-side":de,"data-align":ee},O,{ref:W,style:{...O.style,animation:ge?void 0:"none",opacity:(u=ve.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))});function SB(e){return e!==null}const CB=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]=DP(a),x={start:"0%",center:"50%",end:"100%"}[y],w=((r=(o=u.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+p/2,_=((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:`${w}px`,R=`${-g}px`):b==="top"?(C=h?x:`${w}px`,R=`${l.floating.height+g}px`):b==="right"?(C=`${-g}px`,R=h?x:`${_}px`):b==="left"&&(C=`${l.floating.width+g}px`,R=h?x:`${_}px`),{data:{x:C,y:R}}}});function DP(e){const[t,n="center"]=e.split("-");return[t,n]}const Yu=bB,Ku=xB,Xu=_B,vp=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?Co.createPortal(m.createElement(Le.div,ne({},o,{ref:t})),r):null}),TP=m.forwardRef((e,t)=>m.createElement(Le.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}}))),EB=TP,[bp,ooe]=fn("Tooltip",[Po]),ry=Po(),RB="TooltipProvider",$B=700,wb="tooltip.open",[PB,oy]=bp(RB),OB=e=>{const{__scopeTooltip:t,delayDuration:n=$B,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(PB,{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)},iy="Tooltip",[MB,yp]=bp(iy),DB=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=oy(iy,e.__scopeTooltip),u=ry(t),[d,h]=m.useState(null),p=Kn(),g=m.useRef(0),b=s??l.disableHoverableContent,y=a??l.delayDuration,x=m.useRef(!1),[w=!1,_]=Mn({prop:r,defaultProp:o,onChange:O=>{O?(l.onOpen(),document.dispatchEvent(new CustomEvent(wb))):l.onClose(),i==null||i(O)}}),C=m.useMemo(()=>w?x.current?"delayed-open":"instant-open":"closed",[w]),R=m.useCallback(()=>{window.clearTimeout(g.current),x.current=!1,_(!0)},[_]),E=m.useCallback(()=>{window.clearTimeout(g.current),_(!1)},[_]),D=m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{x.current=!0,_(!0)},y)},[y,_]);return m.useEffect(()=>()=>window.clearTimeout(g.current),[]),m.createElement(Yu,u,m.createElement(MB,{scope:t,contentId:p,open:w,stateAttribute:C,trigger:d,onTriggerChange:h,onTriggerEnter:m.useCallback(()=>{l.isOpenDelayed?D():R()},[l.isOpenDelayed,D,R]),onTriggerLeave:m.useCallback(()=>{b?E():window.clearTimeout(g.current)},[E,b]),onOpen:R,onClose:E,disableHoverableContent:b},n))},mC="TooltipTrigger",AP=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=yp(mC,n),i=oy(mC,n),s=ry(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(Ku,ne({asChild:!0},s),m.createElement(Le.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)})))}),TB="TooltipPortal",[ioe,AB]=bp(TB,{forceMount:void 0}),vu="TooltipContent",IB=m.forwardRef((e,t)=>{const n=AB(vu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=yp(vu,e.__scopeTooltip);return m.createElement(Jt,{present:r||s.open},s.disableHoverableContent?m.createElement(IP,ne({side:o},i,{ref:t})):m.createElement(kB,ne({side:o},i,{ref:t})))}),kB=m.forwardRef((e,t)=>{const n=yp(vu,e.__scopeTooltip),r=oy(vu,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,w={x:b.clientX,y:b.clientY},_=LB(w,x.getBoundingClientRect()),C=FB(w,_),R=zB(y.getBoundingClientRect()),E=VB([...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,w={x:y.clientX,y:y.clientY},_=(l==null?void 0:l.contains(x))||(d==null?void 0:d.contains(x)),C=!jB(w,s);_?p():C&&(p(),u())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[l,d,s,u,p]),m.createElement(IP,ne({},e,{ref:i}))}),[NB,soe]=bp(iy,{isInside:!1}),IP=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=yp(vu,n),u=ry(n),{onClose:d}=l;return m.useEffect(()=>(document.addEventListener(wb,d),()=>document.removeEventListener(wb,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(Wl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:h=>h.preventDefault(),onDismiss:d},m.createElement(Xu,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(sR,null,r),m.createElement(NB,{scope:n,isInside:!0},m.createElement(EB,{id:l.contentId,role:"tooltip"},o||r))))});function LB(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 FB(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 zB(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 jB(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 VB(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),HB(t)}function HB(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 WB=OB,BB=DB,UB=AP,kP=IB,qB=WB,NP=BB,LP=UB,sy=ae.forwardRef(({className:e,sideOffset:t=4,...n},r)=>k.jsx(kP,{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}));sy.displayName=kP.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 GB=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),FP=(...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 YB={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 KB=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,...YB,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:FP("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 yr=(e,t)=>{const n=m.forwardRef(({className:r,...o},i)=>m.createElement(KB,{ref:i,iconNode:t,className:FP(`lucide-${GB(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 zP=yr("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 Qu=yr("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 xp=yr("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 XB=yr("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 jP=yr("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 QB=yr("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 VP=yr("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 ZB=yr("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 ay=yr("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 HP=yr("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 JB=yr("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 WP=yr("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function vC({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 BP({card:e,isLoading:t}){var x,w,_,C,R,E,D,O,T,I,N,W,Y,ue,J,F,Z,q;const n=Ee(X=>X.actions.setCardTitle),r=Ee(X=>X.actions.setCardDescription),o=Ee(X=>X.isVisualEditing),i=qt(X=>X.card),s=qt(X=>X.actions.setCard);qt(X=>X.actions.setNumberFormat);const a=Ee(X=>X.selectedSheetId),l=e.data,{metricKeys:u}=Nr(l||[]),d=(x=l==null?void 0:l[0])==null?void 0:x[u==null?void 0:u[0]],h=(w=l==null?void 0:l[0])==null?void 0:w[u==null?void 0:u[1]],p=!!e.data&&e.data.length>0;function g(X){o?s({...i,title:X}):n(a,e.id,X)}function b(X){o?s({...i,description:X}):r(a,e.id,X)}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(sp,{className:"grow pb-3",children:[k.jsx(sa,{text:o?i.title:e.title,onSave:g,children:k.jsxs("div",{className:"flex items-center gap-2",children:[k.jsx(ap,{className:"text-base font-medium text-muted-foreground",children:e.title}),!e.refreshInterval&&t&&k.jsx(ay,{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:vC({number:d,format:((C=(_=e.preferences)==null?void 0:_.formatNumber)==null?void 0:C.format)||"",useSuffix:!!((E=(R=e.preferences)==null?void 0:R.formatNumber)!=null&&E.suffix),customSuffix:"",locale:((O=(D=e.preferences)==null?void 0:D.formatNumber)==null?void 0:O.locale)||"",currency:((I=(T=e.preferences)==null?void 0:T.formatNumber)==null?void 0:I.currency)||""})}),h&&k.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from ",vC({number:h,format:((W=(N=e.preferences)==null?void 0:N.formatNumber)==null?void 0:W.format)||"",useSuffix:!!((ue=(Y=e.preferences)==null?void 0:Y.formatNumber)!=null&&ue.suffix),customSuffix:"",locale:((F=(J=e.preferences)==null?void 0:J.formatNumber)==null?void 0:F.locale)||"",currency:((q=(Z=e.preferences)==null?void 0:Z.formatNumber)==null?void 0:q.currency)||""})]})]})]}),y&&k.jsxs(lp,{className:"grow items-start gap-1 pb-4 text-sm",children:[k.jsx(eU,{children:y}),k.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[y>0?"up ":"down ",k.jsx(sa,{text:e.description||"",onSave:b,children:e.description})]})]})]})}function eU({children:e}){const t=e>0?k.jsx(K0,{className:"h-4 w-4"}):k.jsx(Y0,{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 Al=1e3,Il=Al*60,kl=Il*60,ua=kl*24,tU=ua*7,nU=ua*365.25,rU=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return oU(e);if(n==="number"&&isFinite(e))return t.long?sU(e):iU(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function oU(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*nU;case"weeks":case"week":case"w":return n*tU;case"days":case"day":case"d":return n*ua;case"hours":case"hour":case"hrs":case"hr":case"h":return n*kl;case"minutes":case"minute":case"mins":case"min":case"m":return n*Il;case"seconds":case"second":case"secs":case"sec":case"s":return n*Al;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function iU(e){var t=Math.abs(e);return t>=ua?Math.round(e/ua)+"d":t>=kl?Math.round(e/kl)+"h":t>=Il?Math.round(e/Il)+"m":t>=Al?Math.round(e/Al)+"s":e+"ms"}function sU(e){var t=Math.abs(e);return t>=ua?Ef(e,t,ua,"day"):t>=kl?Ef(e,t,kl,"hour"):t>=Il?Ef(e,t,Il,"minute"):t>=Al?Ef(e,t,Al,"second"):e+" ms"}function Ef(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const aU=zu(rU);function lU(e){Ee(u=>u.bookmarkKey);const t=Ee(u=>u.dashboard.baseQueries),{authToken:n}=ha(),r=Ee(u=>u.authToken),o=Ee(u=>u.filterValues),i=Ee(u=>u.isDashboardEditing),s=aU((e==null?void 0:e.refreshInterval)||"0"),a=ME(e.sql,t);return go({queryKey:[e.id,a],queryFn:()=>jh("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===BE?"":e.python,active_filters:o}),refetchInterval:s,enabled:!!e.connectionId&&!i})}function Ua({data:e,cfg:t,customCfg:n,preferences:r}){const{dimensionKeys:o,metricKeys:i}=Nr(e),s=_W(i,e,r),a=mb(s,n),l=o[0],u=mP(e,l);ia.merge((t==null?void 0:t.options)||{},r==null?void 0:r.chartOptions);const d=vb((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 cU(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}}}}}function uU(e){return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function dU(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 fU(e){return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}}}}}function hU(e,t){return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}}}}}function pU(e){return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}}}}}function UP({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s}){if(t==="bar"){const a=uU(n);return Ua({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="horizontalBar"){const a=cU(n);return Ua({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="stackedBar"){const a=dU(n),{dimensionKeys:l,metricKeys:u}=Nr(e),d=X0({dataArray:e,groupKey:l[0],pivotKey:l[1],valueKey:u[0]});return Ua({data:d,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="line"){const a=fU(n);return Ua({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="pie"||t==="doughnut"||t==="polarArea"){const a=hU(t,n),{dimensionKeys:l,metricKeys:u}=Nr(e),d=EW(u,e),h=mb(d,r),p=l[0],g=mP(e,p),b=vb((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=pU(n);return Ua({data:e,cfg:a,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:a}=Nr(e);if(a.length<3){console.log("Bubble charts require 3 numeric columns");return}const l=CW(e),u=mb(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=vb(d,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:u},options:h}}return Ua({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}function gU({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)&&vU(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&bU(e,t,o,i,a),r==="stackedBar"&&mU({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function mU(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:w[p])==null?void 0:_.borderColor)}),t==null||t.update()}function vU(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 bU(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=(w=u==null?void 0:u.backgroundColor)==null?void 0:w.map((C,R)=>{var E;return(E=n.data.datasets[d].backgroundColor)==null?void 0:E[R]}),u.borderColor=(_=u==null?void 0:u.borderColor)==null?void 0:_.map((C,R)=>{var E;return(E=n.data.datasets[d].borderColor)==null?void 0:E[R]})}),e==null||e.update()}function yU(e,t,n,r){var o,i;try{if(!e||!e.data)return;const{dimensionKeys:s,metricKeys:a}=Nr(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=X0({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}=Nr(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 xU(e){var s,a;const[t]=m.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=pa(),r=n(e),o=ly(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 ly(e){var W,Y,ue;const{onChartElementClicked:t}=ha(),[n,r]=m.useState(0),o=((W=e==null?void 0:e.preferences)==null?void 0:W.filterOnClickColumnIndex)===void 0?0:(Y=e.preferences)==null?void 0:Y.filterOnClickColumnIndex,i=Ee(J=>J.bookmarkKey);Ee(J=>J.isVisualEditing);const s=Ee(J=>J.filteringCards),a=Ee(J=>J.selectedSheetId);Ee(J=>J.selectedCardId),Ee(J=>J.isDashboardEditing);const l=Ee(J=>J.themeStyle),u=Ee(J=>J.filterValues),d=(ue=e==null?void 0:e.preferences)==null?void 0:ue.onClickFilter,{addFrame:h,addFilteringCard:p,setFrameCardData:g,getSelectedFrame:b,addOrUpdateFilterValue:y,addOrUpdateFilterValues:x,removeFilterValue:w,removeFilteringCard:_}=pa(),{data:C,isLoading:R,isFetching:E,isError:D,refetch:O}=lU(e),T=s==null?void 0:s.find(J=>J.id===e.id);let I;e.data&&e.data.length>0&&(I=UP({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&&!T&&O()},[u,i]);function N(J,F,Z,q){var j,V;let X=!1;if(!e.data)return;const ie=yU(e,F,Z,q);if(console.log("fieldValues",ie),t==null||t(e,ie),!!(((j=e==null?void 0:e.preferences)==null?void 0:j.onClickFilter)??[]).length){if(T){const te=e.id;w(te),_(e)}else{if(X=!0,!ie)return;const te=[];ie.forEach((le,ce)=>{const ge=d==null?void 0:d.find(de=>de.columnIndex===ce);if(!ge)return;const ve={filterId:e.id+"-"+le.columnName,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:le.columnName,expression:ge.expression,valueType:au(ie[ge.columnIndex].columnValue),operation:"=",values:[ie[ge.columnIndex].columnValue]};te.push(ve)}),e.id,e==null||e.connectionId,e.lastSelectedTable,ie[o].columnName,(V=e.preferences)==null||V.filterOnClickField,au(ie[o].columnValue),ie[o].columnValue,x(te),p(e)}gU({chart:J,elementIndex:Z,datasetIndex:F,cardType:e.type,cfg:I,apply:X})}}return{isError:D,isLoading:R,isFetching:E,data:C,visualKey:n,handleDatapointClick:N,cfg:I}}function wU(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=su();const y=b.activeCardId;b.cards.forEach(x=>{const w=x.id;x.id=su(),w===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 Lm;const qP="HoverCard",[GP,aoe]=fn(qP,[Po]),cy=Po(),[_U,uy]=GP(qP),SU=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=cy(t),u=m.useRef(0),d=m.useRef(0),h=m.useRef(!1),p=m.useRef(!1),[g=!1,b]=Mn({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]),w=m.useCallback(()=>b(!1),[b]);return m.useEffect(()=>()=>{clearTimeout(u.current),clearTimeout(d.current)},[]),m.createElement(_U,{scope:t,open:g,onOpenChange:b,onOpen:y,onClose:x,onDismiss:w,hasSelectionRef:h,isPointerDownOnContentRef:p},m.createElement(Yu,l,n))},CU="HoverCardTrigger",EU=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=uy(CU,n),i=cy(n);return m.createElement(Ku,ne({asChild:!0},i),m.createElement(Le.a,ne({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:we(e.onPointerEnter,Eh(o.onOpen)),onPointerLeave:we(e.onPointerLeave,Eh(o.onClose)),onFocus:we(e.onFocus,o.onOpen),onBlur:we(e.onBlur,o.onClose),onTouchStart:we(e.onTouchStart,s=>s.preventDefault())})))}),RU="HoverCardPortal",[loe,$U]=GP(RU,{forceMount:void 0}),_b="HoverCardContent",PU=m.forwardRef((e,t)=>{const n=$U(_b,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=uy(_b,e.__scopeHoverCard);return m.createElement(Jt,{present:r||i.open},m.createElement(OU,ne({"data-state":i.open?"open":"closed"},o,{onPointerEnter:we(e.onPointerEnter,Eh(i.onOpen)),onPointerLeave:we(e.onPointerLeave,Eh(i.onClose)),ref:t})))}),OU=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=uy(_b,n),u=cy(n),d=m.useRef(null),h=Xe(t,d),[p,g]=m.useState(!1);return m.useEffect(()=>{if(p){const b=document.body;return Lm=b.style.userSelect||b.style.webkitUserSelect,b.style.userSelect="none",b.style.webkitUserSelect="none",()=>{b.style.userSelect=Lm,b.style.webkitUserSelect=Lm}}},[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&&MU(d.current).forEach(y=>y.setAttribute("tabindex","-1"))}),m.createElement(Wl,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:we(i,b=>{b.preventDefault()}),onDismiss:l.onDismiss},m.createElement(Xu,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 Eh(e){return t=>t.pointerType==="touch"?void 0:e()}function MU(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 DU=SU,TU=EU,YP=PU,KP=DU,XP=TU,dy=ae.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>k.jsx(YP,{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}));dy.displayName=YP.displayName;function AU({card:e}){const{setCardInfo:t}=pa();return k.jsxs(KP,{openDelay:0,children:[k.jsx(XP,{children:k.jsx(ZB,{className:"size-4 text-muted-foreground/40"})}),k.jsx(dy,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:k.jsx(sa,{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 fy=ae.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})}));fy.displayName="Table";const hy=ae.forwardRef(({className:e,...t},n)=>k.jsx("thead",{ref:n,className:Se("[&_tr]:border-b",e),...t}));hy.displayName="TableHeader";const py=ae.forwardRef(({className:e,...t},n)=>k.jsx("tbody",{ref:n,className:Se("[&_tr:last-child]:border-0",e),...t}));py.displayName="TableBody";const IU=ae.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}));IU.displayName="TableFooter";const Zc=ae.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}));Zc.displayName="TableRow";const gy=ae.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}));gy.displayName="TableHead";const Rh=ae.forwardRef(({className:e,...t},n)=>k.jsx("td",{ref:n,className:Se("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));Rh.displayName="TableCell";const kU=ae.forwardRef(({className:e,...t},n)=>k.jsx("caption",{ref:n,className:Se("mt-4 text-sm text-muted-foreground",e),...t}));kU.displayName="TableCaption";/**
|
|
213
|
+
* table-core
|
|
214
|
+
*
|
|
215
|
+
* Copyright (c) TanStack
|
|
216
|
+
*
|
|
217
|
+
* This source code is licensed under the MIT license found in the
|
|
218
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
219
|
+
*
|
|
220
|
+
* @license MIT
|
|
221
|
+
*/function ji(e,t){return typeof e=="function"?e(t):e}function vr(e,t){return n=>{t.setState(r=>({...r,[e]:ji(n,r[e])}))}}function $h(e){return e instanceof Function}function NU(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function LU(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 Ue(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 FU(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:Ue(()=>[!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:Ue(()=>[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 bC(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 zU={createTable:e=>{e.getHeaderGroups=Ue(()=>[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 Rf(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=Ue(()=>[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))),Rf(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=Ue(()=>[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 Rf(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=Ue(()=>[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 Rf(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=Ue(()=>[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=Ue(()=>[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=Ue(()=>[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=Ue(()=>[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=Ue(()=>[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=Ue(()=>[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=Ue(()=>[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=Ue(()=>[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=Ue(()=>[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=Ue(()=>[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=Ue(()=>[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=Ue(()=>[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 Rf(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 w=[...y].reverse()[0],_=x.column.depth===b.depth;let C,R=!1;if(_&&x.column.parent?C=x.column.parent:(C=x.column,R=!0),w&&(w==null?void 0:w.column)===C)w.subHeaders.push(x);else{const E=bC(n,C,{id:[r,g,C.id,x==null?void 0:x.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${y.filter(D=>D.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)=>bC(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,w=[0];b.subHeaders&&b.subHeaders.length?(w=[],h(b.subHeaders).forEach(C=>{let{colSpan:R,rowSpan:E}=C;y+=R,w.push(E)})):y=1;const _=Math.min(...w);return x=x+_,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 $f={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Fm=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),jU={getDefaultColumnDef:()=>$f,getInitialState:e=>({columnSizing:{},columnSizingInfo:Fm(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:vr("columnSizing",e),onColumnSizingInfoChange:vr("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:$f.minSize,(r=i??e.columnDef.size)!=null?r:$f.size),(o=e.columnDef.maxSize)!=null?o:$f.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(),zm(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],l=zm(i)?Math.round(i.touches[0].clientX):i.clientX,u={},d=(w,_)=>{typeof _=="number"&&(t.setColumnSizingInfo(C=>{var R,E;const D=t.options.columnResizeDirection==="rtl"?-1:1,O=(_-((R=C==null?void 0:C.startOffset)!=null?R:0))*D,T=Math.max(O/((E=C==null?void 0:C.startSize)!=null?E:0),-.999999);return C.columnSizingStart.forEach(I=>{let[N,W]=I;u[N]=Math.round(Math.max(W+W*T,0)*100)/100}),{...C,deltaOffset:O,deltaPercentage:T}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(C=>({...C,...u})))},h=w=>d("move",w),p=w=>{d("end",w),t.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=n||typeof document<"u"?document:null,b={moveHandler:w=>h(w.clientX),upHandler:w=>{g==null||g.removeEventListener("mousemove",b.moveHandler),g==null||g.removeEventListener("mouseup",b.upHandler),p(w.clientX)}},y={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),h(w.touches[0].clientX),!1),upHandler:w=>{var _;g==null||g.removeEventListener("touchmove",y.moveHandler),g==null||g.removeEventListener("touchend",y.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),p((_=w.touches[0])==null?void 0:_.clientX)}},x=VU()?{passive:!1}:!1;zm(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(w=>({...w,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Fm():(n=e.initialState.columnSizingInfo)!=null?n:Fm())},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 Pf=null;function VU(){if(typeof Pf=="boolean")return Pf;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 Pf=e,Pf}function zm(e){return e.type==="touchstart"}const HU={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:vr("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()}}}},QP=(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))};QP.autoRemove=e=>Qr(e);const ZP=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};ZP.autoRemove=e=>Qr(e);const JP=(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())};JP.autoRemove=e=>Qr(e);const eO=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};eO.autoRemove=e=>Qr(e)||!(e!=null&&e.length);const tO=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});tO.autoRemove=e=>Qr(e)||!(e!=null&&e.length);const nO=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});nO.autoRemove=e=>Qr(e)||!(e!=null&&e.length);const rO=(e,t,n)=>e.getValue(t)===n;rO.autoRemove=e=>Qr(e);const oO=(e,t,n)=>e.getValue(t)==n;oO.autoRemove=e=>Qr(e);const my=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};my.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]};my.autoRemove=e=>Qr(e)||Qr(e[0])&&Qr(e[1]);const Bo={includesString:QP,includesStringSensitive:ZP,equalsString:JP,arrIncludes:eO,arrIncludesAll:tO,arrIncludesSome:nO,equals:rO,weakEquals:oO,inNumberRange:my};function Qr(e){return e==null||e===""}const WU={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:vr("columnFilters",e),onGlobalFilterChange:vr("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"?Bo.includesString:typeof r=="number"?Bo.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Bo.equals:Array.isArray(r)?Bo.arrIncludes:Bo.weakEquals},e.getFilterFn=()=>{var n,r;return $h(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:Bo[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(d=>d.id===e.id),s=ji(n,i?i.value:void 0);if(yC(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=()=>Bo.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return $h(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Bo[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=ji(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(yC(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 yC(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const BU=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),UU=(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},qU=(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},GU=(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]},YU=(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},KU=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!NU(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},XU=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),QU=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,ZU=(e,t)=>t.length,jm={sum:BU,min:UU,max:qU,extent:GU,mean:YU,median:KU,unique:XU,uniqueCount:QU,count:ZU},JU={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:vr("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 jm.sum;if(Object.prototype.toString.call(r)==="[object Date]")return jm.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return $h(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:jm[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 eq(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 tq={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:vr("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=Ue(()=>[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 eq(i,n,r)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},Sb=0,Cb=10,Vm=()=>({pageIndex:Sb,pageSize:Cb}),nq={getInitialState:e=>({...e,pagination:{...Vm(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:vr("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>ji(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Vm():(o=e.initialState.pagination)!=null?o:Vm())},e.setPageIndex=r=>{e.setPagination(o=>{let i=ji(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?Sb:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:Sb)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?Cb:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:Cb)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,ji(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=ji(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=Ue(()=>[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)}}},Hm=()=>({left:[],right:[]}),Wm=()=>({top:[],bottom:[]}),rq={getInitialState:e=>({columnPinning:Hm(),rowPinning:Wm(),...e}),getDefaultOptions:e=>({onColumnPinningChange:vr("columnPinning",e),onRowPinningChange:vr("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=Ue(()=>[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=Ue(()=>[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=Ue(()=>[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?Hm():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Hm())},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=Ue(()=>[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=Ue(()=>[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=Ue(()=>[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?Wm():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Wm())},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=>Ue(()=>[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=Ue(()=>[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}})}},oq={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:vr("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=>{Eb(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Ue(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Bm(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=Ue(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Bm(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=Ue(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Bm(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 Eb(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return vy(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Rb(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Rb(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)}}}},Eb=(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=>Eb(e,a.id,n,r,o))};function Bm(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var u;const d=vy(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 vy(e,t){var n;return(n=t[e.id])!=null?n:!1}function Rb(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()&&(vy(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=Rb(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const $b=/([0-9]+)/gm,iq=(e,t,n)=>iO(Ki(e.getValue(n)).toLowerCase(),Ki(t.getValue(n)).toLowerCase()),sq=(e,t,n)=>iO(Ki(e.getValue(n)),Ki(t.getValue(n))),aq=(e,t,n)=>by(Ki(e.getValue(n)).toLowerCase(),Ki(t.getValue(n)).toLowerCase()),lq=(e,t,n)=>by(Ki(e.getValue(n)),Ki(t.getValue(n))),cq=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},uq=(e,t,n)=>by(e.getValue(n),t.getValue(n));function by(e,t){return e===t?0:e>t?1:-1}function Ki(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function iO(e,t){const n=e.split($b).filter(Boolean),r=t.split($b).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 Pc={alphanumeric:iq,alphanumericCaseSensitive:sq,text:aq,textCaseSensitive:lq,datetime:cq,basic:uq},dq={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:vr("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 Pc.datetime;if(typeof i=="string"&&(r=!0,i.split($b).length>1))return Pc.alphanumeric}return r?Pc.text:Pc.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 $h(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:Pc[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())}},fq={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:vr("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=Ue(()=>[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=Ue(()=>[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)=>Ue(()=>[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)}}},xC=[zU,fq,tq,rq,WU,dq,JU,HU,nq,oq,jU];function hq(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:xC};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:xC,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=ji(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:Ue(()=>[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:Ue(()=>[n._getColumnDefs()],d=>{const h=function(p,g,b){return b===void 0&&(b=0),p.map(y=>{const x=FU(n,y,b,g),w=y;return x.columns=w.columns?h(w.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:Ue(()=>[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:Ue(()=>[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:Ue(()=>[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 pq(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:Ue(()=>[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 gq=(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:()=>LU(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:Ue(()=>[e.getAllLeafColumns()],l=>l.map(u=>pq(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:Ue(()=>[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 sO(){return e=>Ue(()=>[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=gq(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 aO(){return e=>Ue(()=>[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 w=0;if(y.sortUndefined){const _=d.getValue(b.id),C=h.getValue(b.id),R=_===void 0,E=C===void 0;(R||E)&&(w=R&&E?0:R?y.sortUndefined:-y.sortUndefined)}if(w===0&&(w=y.sortingFn(d,h,b.id)),w!==0)return x&&(w*=-1),y.invertSorting&&(w*=-1),w}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 mq(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 lO(e){return t=>Ue(()=>[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=mq({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 Pb(e,t){return e?vq(e)?ae.createElement(e,t):e:null}function vq(e){return bq(e)||typeof e=="function"||yq(e)}function bq(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function yq(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function cO(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=ae.useState(()=>({current:hq(t)})),[r,o]=ae.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 uO({data:e,card:t}){var x,w;const[n,r]=m.useState([]),{keys:o}=Nr(e),i=Ee(_=>_.filteringCards),s=i==null?void 0:i.find(_=>_.id===t.id),a=(x=t==null?void 0:t.preferences)==null?void 0:x.onClickFilter,{addOrUpdateFilterValues:l,addFilteringCard:u,removeFilterValue:d,removeFilteringCard:h}=pa(),p=o.map(_=>({accessorKey:_,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:[_,R==="asc"?k.jsx(K0,{className:"ml-2 h-5 w-5"}):R==="desc"?k.jsx(Y0,{className:"ml-2 h-5 w-5"}):null]})})}})),g=cO({data:e,columns:p,getCoreRowModel:sO(),getPaginationRowModel:lO(),onSortingChange:r,getSortedRowModel:aO(),manualPagination:!0,state:{sorting:n}}),b=g.getSelectedRowModel().rows;m.useEffect(()=>{if(b.length===0){if(s){const _=t.id;d(_),h(t)}return}if(a){const{dimensionKeys:_}=Nr(e),C=a.map(R=>{const E=_==null?void 0:_[R.columnIndex],D=b.map(T=>T.getValue(E));return{filterId:t.id+"-"+E,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:E,expression:R.expression,valueType:au(D[0]===void 0?"":D[0]),operation:"in",values:D}});l(C),u(t)}},[u,l,t,e,s,a,d,h,b]);function y(_){_.toggleSelected()}return k.jsxs(fy,{onMouseDown:_=>_.stopPropagation(),children:[k.jsx(hy,{children:g.getHeaderGroups().map(_=>k.jsx(Zc,{children:_.headers.map(C=>k.jsx(gy,{className:"sticky top-0 h-8 border-x bg-muted-foreground px-2 py-1 text-background",children:C.isPlaceholder?null:Pb(C.column.columnDef.header,C.getContext())},C.id))},_.id))}),k.jsx(py,{children:(w=g.getRowModel().rows)!=null&&w.length?g.getRowModel().rows.map(_=>k.jsx(Zc,{onClick:()=>y(_),className:Se("whitespace-nowrap p-1",{"cursor-pointer":a&&(a==null?void 0:a.length)>0}),"data-state":_.getIsSelected()&&"selected",children:_.getVisibleCells().map(C=>k.jsx(Rh,{className:"border px-2 py-1",children:Pb(C.column.columnDef.cell,C.getContext())},C.id))},_.id)):k.jsx(Zc,{children:k.jsx(Rh,{colSpan:p.length,className:"p-1 text-center",children:"No results."})})})]})}function xq({frame:e,footer:t,className:n,...r}){const{customCards:o}=ha(),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);wU(e,i);const{isError:h,isLoading:p,isFetching:g,cfg:b,visualKey:y,handleDatapointClick:x}=ly(d),{setCardTitle:w,setCardDescription:_,setSelectedFrameId:C}=pa();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(BP,{isLoading:p||g,card:d}):T}function D(){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(uO,{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(hP,{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 T=k.jsxs(k.Fragment,{children:[k.jsxs(sp,{className:"pb-4",children:[k.jsxs("div",{className:"flex items-center gap-2",children:[k.jsx(sa,{text:d.title,onSave:I=>w(a,d.id,I),children:k.jsx(ap,{className:"text-base",children:d.title})}),(u||d.info)&&k.jsx(AU,{card:d}),d.refreshInterval&&k.jsxs(NP,{children:[k.jsx(LP,{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(sy,{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(ay,{className:"h-4 w-4 animate-spin text-muted-foreground"})]}),k.jsx(sa,{text:(d==null?void 0:d.description)||"",onSave:I=>_(a,d.id,I),children:k.jsxs(O0,{children:[" ",d.description]})})]}),k.jsx(lp,{className:"relative flex grow flex-col",children:D()}),k.jsx(M0,{children:O()})]});return k.jsxs(P0,{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($W,{frame:e}),E()]})}const wq=T_.WidthProvider(T_.Responsive);function _q(){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,D;return(D=(E=R.dashboard)==null?void 0:E.sheets)==null?void 0:D.filter(O=>O.id===n)}))==null||x[0].layout;const r=(w=Ee(R=>{var E,D;return(D=(E=R.dashboard)==null?void 0:E.sheets)==null?void 0:D.filter(O=>O.id===n)}))==null?void 0:w[0].layouts,o=Ee(R=>{var E,D,O;return(O=(D=(E=R.dashboard)==null?void 0:E.sheets)==null?void 0:D.find(T=>T.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(dO,{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(xq,{frame:R})},R.id))}return k.jsx(k.Fragment,{children:k.jsx(wq,{margin:((_=t==null?void 0:t.gridLayout)==null?void 0:_.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 dO=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}));dO.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 Ph(){return Ph=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},Ph.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 Oh(){return Oh=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},Oh.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 qa(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 Um(e,t){if(e===void 0)throw new Error("Unexpected undefined"+(t?": "+t:""));return e}var Sq=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 Cq=function(t){return t},Eq=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},Rq=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)}}},$q=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)}}},Pq=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"])},Oq=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))},Mq=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=Oh({debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Cq,rangeExtractor:Eq,onChange:function(){},measureElement:Pq,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=qa(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=qa(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=qa(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),w=b+x,_=g?g.lane:h%n.options.lanes;d[h]={index:h,start:b,size:x,end:w,key:p,lane:_}}return n.measurementsCache=d,d},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:function(){return n.options.debug}}),this.calculateRange=qa(function(){return[n.getMeasurements(),n.getSize(),n.scrollOffset]},function(r,o,i){return n.range=r.length>0&&o>0?Dq({measurements:r,outerSize:o,scrollOffset:i}):null},{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:function(){return n.options.debug}}),this.getIndexes=qa(function(){return[n.options.rangeExtractor,n.calculateRange(),n.options.overscan,n.options.count]},function(r,o,i,s){return o===null?[]:r(Oh({},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=qa(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 Um(o[fO(0,o.length-1,function(i){return Um(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=Um(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];Sq(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()},fO=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 Dq(e){for(var t=e.measurements,n=e.outerSize,r=e.scrollOffset,o=t.length-1,i=function(u){return t[u].start},s=fO(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 Tq=typeof document<"u"?ae.useLayoutEffect:ae.useEffect;function Aq(e){var t=ae.useReducer(function(){return{}},{})[1],n=Ph({},e,{onChange:function(s,a){a?Co.flushSync(t):t(),e.onChange==null||e.onChange(s,a)}}),r=ae.useState(function(){return new Mq(n)}),o=r[0];return o.setOptions(n),ae.useEffect(function(){return o._didMount()},[]),Tq(function(){return o._willUpdate()}),o}function Iq(e){return Aq(Ph({observeElementRect:Rq,observeElementOffset:$q,scrollToFn:Oq},e))}var kq=Object.defineProperty,Nq=(e,t,n)=>t in e?kq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qm=(e,t,n)=>(Nq(e,typeof t!="symbol"?t+"":t,n),n);let Lq=class{constructor(){qm(this,"current",this.detect()),qm(this,"handoffState","pending"),qm(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"}},Js=new Lq,an=(e,t)=>{Js.isServer?m.useEffect(e,t):m.useLayoutEffect(e,t)};function yo(e){let t=m.useRef(e);return an(()=>{t.current=e},[e]),t}function yy(e,t){let[n,r]=m.useState(e),o=yo(e);return an(()=>r(o.current),[o,r,...t]),n}let it=function(e){let t=yo(e);return m.useCallback((...n)=>t.current(...n),[t])};function Fq(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,it(u=>(i||o(u),t==null?void 0:t(u)))]}function zq(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function da(){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 zq(()=>{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=da();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 Zu(){let[e]=m.useState(da);return m.useEffect(()=>()=>e.dispose(),[e]),e}function jq(){let e=typeof document>"u";return"useSyncExternalStore"in ae?(t=>t.useSyncExternalStore)(ae)(()=>()=>{},()=>!1,()=>!e):!1}function xy(){let e=jq(),[t,n]=ae.useState(Js.isHandoffComplete);return t&&Js.isHandoffComplete===!1&&n(!1),ae.useEffect(()=>{t!==!0&&n(!0)},[t]),ae.useEffect(()=>Js.handoff(),[]),e?!1:t}var wC;let Ju=(wC=m.useId)!=null?wC:function(){let e=xy(),[t,n]=m.useState(e?()=>Js.nextId():null);return an(()=>{t===null&&n(Js.nextId())},[t]),t!=null?""+t:void 0};function yn(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,yn),r}function wy(e){return Js.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let _C=["[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 Vq=(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))(Vq||{}),Hq=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Hq||{}),Wq=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Wq||{}),hO=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(hO||{});function Bq(e,t=0){var n;return e===((n=wy(e))==null?void 0:n.body)?!1:yn(t,{0(){return e.matches(_C)},1(){let r=e;for(;r!==null;){if(r.matches(_C))return!0;r=r.parentElement}return!1}})}var Uq=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Uq||{});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 qq(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 Gq(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function Yq(){return/Android/gi.test(window.navigator.userAgent)}function pO(){return Gq()||Yq()}function Of(e,t,n){let r=yo(t);m.useEffect(()=>{function o(i){r.current(i)}return document.addEventListener(e,o,n),()=>document.removeEventListener(e,o,n)},[e,n])}function Kq(e,t,n){let r=yo(t);m.useEffect(()=>{function o(i){r.current(i)}return window.addEventListener(e,o,n),()=>window.removeEventListener(e,o,n)},[e,n])}function Xq(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!Bq(l,hO.Loose)&&l.tabIndex!==-1&&s.preventDefault(),t(s,l)}let i=m.useRef(null);Of("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),Of("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),Of("click",s=>{pO()||i.current&&(o(s,()=>i.current),i.current=null)},!0),Of("touchend",s=>o(s,()=>s.target instanceof HTMLElement?s.target:null),!0),Kq("blur",s=>o(s,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Qq(...e){return m.useMemo(()=>wy(...e),[...e])}function SC(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 Zq(e,t){let[n,r]=m.useState(()=>SC(e));return an(()=>{r(SC(e))},[e.type,e.as]),an(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let Jq=Symbol();function ya(...e){let t=m.useRef(e);m.useEffect(()=>{t.current=e},[e]);let n=it(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[Jq]))?void 0:n}function CC(e){return[e.screenX,e.screenY]}function eG(){let e=m.useRef([-1,-1]);return{wasMoved(t){let n=CC(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=CC(t)}}}function tG({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]),an(()=>{if(!e||!r)return;let s=wy(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 EC(e,t){let n=m.useRef([]),r=it(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 Mh(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Dh=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Dh||{}),Vi=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Vi||{});function ci({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??nG;let l=gO(t,e);if(i)return Mf(l,n,r,s,a);let u=o??0;if(u&2){let{static:d=!1,...h}=l;if(d)return Mf(h,n,r,s,a)}if(u&1){let{unmount:d=!0,...h}=l;return yn(d?0:1,{0(){return null},1(){return Mf({...h,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Mf(l,n,r,s,a)}function Mf(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=Gm(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(Ob(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)=>Mh(p==null?void 0:p.className(...y),l.className):Mh(p==null?void 0:p.className,l.className),b=g?{className:g}:{};return m.cloneElement(d,Object.assign({},gO(d.props,Ob(Gm(l,["ref"]))),h,u,{ref:o(d.ref,u.ref)},b))}return m.createElement(i,Object.assign({},Gm(l,["ref"]),i!==m.Fragment&&u,i!==m.Fragment&&h),d)}function nG(...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 gO(...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 Oo(e){var t;return Object.assign(m.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Ob(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Gm(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let rG="div";var mO=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(mO||{});function oG(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 ci({ourProps:i,theirProps:o,slot:{},defaultTag:rG,name:"Hidden"})}let iG=Oo(oG),_y=m.createContext(null);_y.displayName="OpenClosedContext";var fr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(fr||{});function Sy(){return m.useContext(_y)}function vO({value:e,children:t}){return m.createElement(_y.Provider,{value:e},t)}function sG(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Ns=[];sG(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&Ns[0]!==t.target&&(Ns.unshift(t.target),Ns=Ns.filter(n=>n!=null&&n.isConnected),Ns.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 aG(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&&lG(n)?!1:r}function lG(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function cG(e){throw new Error("Unexpected object: "+e)}var on=(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))(on||{});function RC(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:cG(e)}}function bO(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))xO(n,yO(t,r),o);return n}function yO(e,t){return e?e+"["+t+"]":t}function xO(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())xO(e,yO(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,""]):bO(n,t,e)}var ar=(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))(ar||{}),uG=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(uG||{}),dG=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(dG||{}),fG=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(fG||{}),hG=(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))(hG||{});function Ym(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):qq(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let pG={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===on.Specific?t.idx:RC(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=Ym(e);if(a.activeOptionIndex===null){let d=a.options.findIndex(h=>!h.dataRef.current.disabled);d!==-1&&(a.activeOptionIndex=d)}let l=t.focus===on.Specific?t.idx:RC(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=Ym(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=Ym(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})}}},Cy=m.createContext(null);Cy.displayName="ComboboxActionsContext";function ed(e){let t=m.useContext(Cy);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ed),n}return t}let wO=m.createContext(null);function gG(e){var t;let n=xa("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=Iq({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 an(()=>{a(l=>l+1)},[(t=n.virtual)==null?void 0:t.options]),m.createElement(wO.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 Ey=m.createContext(null);Ey.displayName="ComboboxDataContext";function xa(e){let t=m.useContext(Ey);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,xa),n}return t}function mG(e,t){return yn(t.type,pG,e,t)}let vG=m.Fragment;function bG(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,[w=h?[]:void 0,_]=Fq(n,o,r),[C,R]=m.useReducer(mG,{dataRef:m.createRef(),comboboxState:u?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),E=m.useRef(!1),D=m.useRef({static:!1,hold:!1}),O=m.useRef(null),T=m.useRef(null),I=m.useRef(null),N=m.useRef(null),W=it(typeof a=="string"?(K,re)=>{let be=a;return(K==null?void 0:K[be])===(re==null?void 0:re[be])}:a??((K,re)=>K===re)),Y=it(K=>C.options.findIndex(re=>W(re.dataRef.current.value,K))),ue=m.useCallback(K=>yn(F.mode,{1:()=>w.some(re=>W(re,K)),0:()=>W(w,K)}),[w]),J=it(K=>C.activeOptionIndex===Y(K)),F=m.useMemo(()=>({...C,immediate:y,optionsPropsRef:D,labelRef:O,inputRef:T,buttonRef:I,optionsRef:N,value:w,defaultValue:r,disabled:l,mode:h?1:0,virtual:C.virtual,get activeOptionIndex(){if(E.current&&C.activeOptionIndex===null&&C.options.length>0){let K=C.options.findIndex(re=>!re.dataRef.current.disabled);if(K!==-1)return K}return C.activeOptionIndex},calculateIndex:Y,compare:W,isSelected:ue,isActive:J,nullable:d,__demoMode:u}),[w,r,l,h,d,u,C,x]);an(()=>{},[x,void 0]),an(()=>{C.dataRef.current=F},[F]),Xq([F.buttonRef,F.inputRef,F.optionsRef],()=>ge.closeCombobox(),F.comboboxState===0);let Z=m.useMemo(()=>{var K,re,be;return{open:F.comboboxState===0,disabled:l,activeIndex:F.activeOptionIndex,activeOption:F.activeOptionIndex===null?null:F.virtual?F.virtual.options[(K=F.activeOptionIndex)!=null?K:0]:(be=(re=F.options[F.activeOptionIndex])==null?void 0:re.dataRef.current.value)!=null?be:null,value:w}},[F,l,w]),q=it(()=>{if(F.activeOptionIndex!==null){if(F.virtual)le(F.virtual.options[F.activeOptionIndex]);else{let{dataRef:K}=F.options[F.activeOptionIndex];le(K.current.value)}ge.goToOption(on.Specific,F.activeOptionIndex)}}),X=it(()=>{R({type:0}),E.current=!0}),ie=it(()=>{R({type:1}),E.current=!1}),j=it((K,re,be)=>(E.current=!1,K===on.Specific?R({type:2,focus:on.Specific,idx:re,trigger:be}):R({type:2,focus:K,trigger:be}))),V=it((K,re)=>(R({type:3,payload:{id:K,dataRef:re}}),()=>{F.isActive(re.current.value)&&(E.current=!0),R({type:4,id:K})})),te=it(K=>(R({type:5,id:K}),()=>R({type:5,id:null}))),le=it(K=>yn(F.mode,{0(){return _==null?void 0:_(K)},1(){let re=F.value.slice(),be=re.findIndex(Q=>W(Q,K));return be===-1?re.push(K):re.splice(be,1),_==null?void 0:_(re)}})),ce=it(K=>{R({type:6,trigger:K})}),ge=m.useMemo(()=>({onChange:le,registerOption:V,registerLabel:te,goToOption:j,closeCombobox:ie,openCombobox:X,setActivationTrigger:ce,selectActiveOption:q}),[]),ve=t===null?{}:{ref:t},de=m.useRef(null),ee=Zu();return m.useEffect(()=>{de.current&&r!==void 0&&ee.addEventListener(de.current,"reset",()=>{_==null||_(r)})},[de,_]),m.createElement(Cy.Provider,{value:ge},m.createElement(Ey.Provider,{value:F},m.createElement(vO,{value:yn(F.comboboxState,{0:fr.Open,1:fr.Closed})},s!=null&&w!=null&&bO({[s]:w}).map(([K,re],be)=>m.createElement(iG,{features:mO.Hidden,ref:be===0?Q=>{var Oe;de.current=(Oe=Q==null?void 0:Q.closest("form"))!=null?Oe:null}:void 0,...Ob({key:K,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,name:K,value:re})})),ci({ourProps:ve,theirProps:b,slot:Z,defaultTag:vG,name:"Combobox"}))))}let yG="input";function xG(e,t){var n,r,o,i,s;let a=Ju(),{id:l=`headlessui-combobox-input-${a}`,onChange:u,displayValue:d,type:h="text",...p}=e,g=xa("Combobox.Input"),b=ed("Combobox.Input"),y=ya(g.inputRef,t),x=Qq(g.inputRef),w=m.useRef(!1),_=Zu(),C=it(()=>{b.onChange(null),g.optionsRef.current&&(g.optionsRef.current.scrollTop=0),b.goToOption(on.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:""}();EC(([F,Z],[q,X])=>{if(w.current)return;let ie=g.inputRef.current;ie&&((X===0&&Z===1||F!==q)&&(ie.value=F),requestAnimationFrame(()=>{if(w.current||!ie||(x==null?void 0:x.activeElement)!==ie)return;let{selectionStart:j,selectionEnd:V}=ie;Math.abs((V??0)-(j??0))===0&&j===0&&ie.setSelectionRange(ie.value.length,ie.value.length)}))},[R,g.comboboxState,x]),EC(([F],[Z])=>{if(F===0&&Z===1){if(w.current)return;let q=g.inputRef.current;if(!q)return;let X=q.value,{selectionStart:ie,selectionEnd:j,selectionDirection:V}=q;q.value="",q.value=X,V!==null?q.setSelectionRange(ie,j,V):q.setSelectionRange(ie,j)}},[g.comboboxState]);let E=m.useRef(!1),D=it(()=>{E.current=!0}),O=it(()=>{_.nextFrame(()=>{E.current=!1})}),T=it(F=>{switch(w.current=!0,F.key){case ar.Enter:if(w.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 ar.ArrowDown:return w.current=!1,F.preventDefault(),F.stopPropagation(),yn(g.comboboxState,{0:()=>b.goToOption(on.Next),1:()=>b.openCombobox()});case ar.ArrowUp:return w.current=!1,F.preventDefault(),F.stopPropagation(),yn(g.comboboxState,{0:()=>b.goToOption(on.Previous),1:()=>{b.openCombobox(),_.nextFrame(()=>{g.value||b.goToOption(on.Last)})}});case ar.Home:if(F.shiftKey)break;return w.current=!1,F.preventDefault(),F.stopPropagation(),b.goToOption(on.First);case ar.PageUp:return w.current=!1,F.preventDefault(),F.stopPropagation(),b.goToOption(on.First);case ar.End:if(F.shiftKey)break;return w.current=!1,F.preventDefault(),F.stopPropagation(),b.goToOption(on.Last);case ar.PageDown:return w.current=!1,F.preventDefault(),F.stopPropagation(),b.goToOption(on.Last);case ar.Escape:return w.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 ar.Tab:if(w.current=!1,g.comboboxState!==0)return;g.mode===0&&g.activationTrigger!==1&&b.selectActiveOption(),b.closeCombobox();break}}),I=it(F=>{u==null||u(F),g.nullable&&g.mode===0&&F.target.value===""&&C(),b.openCombobox()}),N=it(F=>{var Z,q,X;let ie=(Z=F.relatedTarget)!=null?Z:Ns.find(j=>j!==F.currentTarget);if(w.current=!1,!((q=g.optionsRef.current)!=null&&q.contains(ie))&&!((X=g.buttonRef.current)!=null&&X.contains(ie))&&g.comboboxState===0)return F.preventDefault(),g.mode===0&&(g.nullable&&g.value===null?C():g.activationTrigger!==1&&b.selectActiveOption()),b.closeCombobox()}),W=it(F=>{var Z,q,X;let ie=(Z=F.relatedTarget)!=null?Z:Ns.find(j=>j!==F.currentTarget);(q=g.buttonRef.current)!=null&&q.contains(ie)||(X=g.optionsRef.current)!=null&&X.contains(ie)||g.disabled||g.immediate&&g.comboboxState!==0&&(b.openCombobox(),_.nextFrame(()=>{b.setActivationTrigger(1)}))}),Y=yy(()=>{if(g.labelId)return[g.labelId].join(" ")},[g.labelId]),ue=m.useMemo(()=>({open:g.comboboxState===0,disabled:g.disabled}),[g]),J={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":Y,"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:D,onCompositionEnd:O,onKeyDown:T,onChange:I,onFocus:W,onBlur:N};return ci({ourProps:J,theirProps:p,slot:ue,defaultTag:yG,name:"Combobox.Input"})}let wG="button";function _G(e,t){var n;let r=xa("Combobox.Button"),o=ed("Combobox.Button"),i=ya(r.buttonRef,t),s=Ju(),{id:a=`headlessui-combobox-button-${s}`,...l}=e,u=Zu(),d=it(y=>{switch(y.key){case ar.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 ar.ArrowUp:return y.preventDefault(),y.stopPropagation(),r.comboboxState===1&&(o.openCombobox(),u.nextFrame(()=>{r.value||o.goToOption(on.Last)})),u.nextFrame(()=>{var x;return(x=r.inputRef.current)==null?void 0:x.focus({preventScroll:!0})});case ar.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=it(y=>{if(aG(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=yy(()=>{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:Zq(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 ci({ourProps:b,theirProps:l,slot:g,defaultTag:wG,name:"Combobox.Button"})}let SG="label";function CG(e,t){let n=Ju(),{id:r=`headlessui-combobox-label-${n}`,...o}=e,i=xa("Combobox.Label"),s=ed("Combobox.Label"),a=ya(i.labelRef,t);an(()=>s.registerLabel(r),[r]);let l=it(()=>{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 ci({ourProps:{ref:a,id:r,onClick:l},theirProps:o,slot:u,defaultTag:SG,name:"Combobox.Label"})}let EG="ul",RG=Dh.RenderStrategy|Dh.Static;function $G(e,t){let n=Ju(),{id:r=`headlessui-combobox-options-${n}`,hold:o=!1,...i}=e,s=xa("Combobox.Options"),a=ya(s.optionsRef,t),l=Sy(),u=l!==null?(l&fr.Open)===fr.Open:s.comboboxState===0;an(()=>{var g;s.optionsPropsRef.current.static=(g=e.static)!=null?g:!1},[s.optionsPropsRef,e.static]),an(()=>{s.optionsPropsRef.current.hold=o},[s.optionsPropsRef,o]),tG({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=yy(()=>{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(gG,null,i.children)}),ci({ourProps:p,theirProps:i,slot:h,defaultTag:EG,features:RG,visible:u,name:"Combobox.Options"})}let PG="li";function OG(e,t){var n;let r=Ju(),{id:o=`headlessui-combobox-option-${r}`,disabled:i=!1,value:s,order:a=null,...l}=e,u=xa("Combobox.Option"),d=ed("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=yo({disabled:i,value:s,domRef:g,order:a}),y=m.useContext(wO),x=ya(t,g,y?y.measureElement:null),w=it(()=>d.onChange(s));an(()=>d.registerOption(o,b),[b,o]);let _=m.useRef(!(u.virtual||u.__demoMode));an(()=>{if(!u.virtual||!u.__demoMode)return;let N=da();return N.requestAnimationFrame(()=>{_.current=!0}),N.dispose},[u.virtual,u.__demoMode]),an(()=>{if(!_.current||u.comboboxState!==0||!h||u.activationTrigger===0)return;let N=da();return N.requestAnimationFrame(()=>{var W,Y;(Y=(W=g.current)==null?void 0:W.scrollIntoView)==null||Y.call(W,{block:"nearest"})}),N.dispose},[g,h,u.comboboxState,u.activationTrigger,u.activeOptionIndex]);let C=it(N=>{var W;if(i||(W=u.virtual)!=null&&W.disabled(s))return N.preventDefault();w(),pO()||requestAnimationFrame(()=>{var Y;return(Y=u.inputRef.current)==null?void 0:Y.focus({preventScroll:!0})}),u.mode===0&&requestAnimationFrame(()=>d.closeCombobox())}),R=it(()=>{var N;if(i||(N=u.virtual)!=null&&N.disabled(s))return d.goToOption(on.Nothing);let W=u.calculateIndex(s);d.goToOption(on.Specific,W)}),E=eG(),D=it(N=>E.update(N)),O=it(N=>{var W;if(!E.wasMoved(N)||i||(W=u.virtual)!=null&&W.disabled(s)||h)return;let Y=u.calculateIndex(s);d.goToOption(on.Specific,Y,0)}),T=it(N=>{var W;E.wasMoved(N)&&(i||(W=u.virtual)!=null&&W.disabled(s)||h&&(u.optionsPropsRef.current.hold||d.goToOption(on.Nothing)))}),I=m.useMemo(()=>({active:h,selected:p,disabled:i}),[h,p,i]);return ci({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:D,onMouseEnter:D,onPointerMove:O,onMouseMove:O,onPointerLeave:T,onMouseLeave:T},theirProps:l,slot:I,defaultTag:PG,name:"Combobox.Option"})}let MG=Oo(bG),DG=Oo(_G),TG=Oo(xG),AG=Oo(CG),IG=Oo($G),kG=Oo(OG),Ga=Object.assign(MG,{Input:TG,Button:DG,Label:AG,Options:IG,Option:kG});function Ry(){let e=m.useRef(!1);return an(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function NG(e=0){let[t,n]=m.useState(e),r=Ry(),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 LG(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Km(e,...t){e&&t.length>0&&e.classList.add(...t)}function Xm(e,...t){e&&t.length>0&&e.classList.remove(...t)}function FG(e,t){let n=da();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 zG(e,t,n,r){let o=n?"enter":"leave",i=da(),s=r!==void 0?LG(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=yn(o,{enter:()=>t.enter,leave:()=>t.leave}),l=yn(o,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),u=yn(o,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Xm(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Km(e,...t.base,...a,...u),i.nextFrame(()=>{Xm(e,...t.base,...a,...u),Km(e,...t.base,...a,...l),FG(e,()=>(Xm(e,...t.base,...a),Km(e,...t.base,...t.entered),s()))}),i.dispose}function jG({immediate:e,container:t,direction:n,classes:r,onStart:o,onStop:i}){let s=Ry(),a=Zu(),l=yo(n);an(()=>{e&&(l.current="enter")},[e]),an(()=>{let u=da();a.add(u.dispose);let d=t.current;if(d&&l.current!=="idle"&&s.current)return u.dispose(),o.current(l.current),u.add(zG(d,r.current,l.current==="enter",()=>{u.dispose(),i.current(l.current)})),u.dispose},[n])}function Ci(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let wp=m.createContext(null);wp.displayName="TransitionContext";var VG=(e=>(e.Visible="visible",e.Hidden="hidden",e))(VG||{});function HG(){let e=m.useContext(wp);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function WG(){let e=m.useContext(_p);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let _p=m.createContext(null);_p.displayName="NestingContext";function Sp(e){return"children"in e?Sp(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function _O(e,t){let n=yo(e),r=m.useRef([]),o=Ry(),i=Zu(),s=it((g,b=Vi.Hidden)=>{let y=r.current.findIndex(({el:x})=>x===g);y!==-1&&(yn(b,{[Vi.Unmount](){r.current.splice(y,1)},[Vi.Hidden](){r.current[y].state="hidden"}}),i.microTask(()=>{var x;!Sp(r)&&o.current&&((x=n.current)==null||x.call(n))}))}),a=it(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,Vi.Unmount)}),l=m.useRef([]),u=m.useRef(Promise.resolve()),d=m.useRef({enter:[],leave:[],idle:[]}),h=it((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,_])=>_)).then(()=>x())})]),b==="enter"?u.current=u.current.then(()=>t==null?void 0:t.wait.current).then(()=>y(b)):y(b)}),p=it((g,b,y)=>{Promise.all(d.current[b].splice(0).map(([x,w])=>w)).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 BG(){}let UG=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function $C(e){var t;let n={};for(let r of UG)n[r]=(t=e[r])!=null?t:BG;return n}function qG(e){let t=m.useRef($C(e));return m.useEffect(()=>{t.current=$C(e)},[e]),t}let GG="div",SO=Dh.RenderStrategy;function YG(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),w=ya(x,t),_=(n=y.unmount)==null||n?Vi.Unmount:Vi.Hidden,{show:C,appear:R,initial:E}=HG(),[D,O]=m.useState(C?"visible":"hidden"),T=WG(),{register:I,unregister:N}=T;m.useEffect(()=>I(x),[I,x]),m.useEffect(()=>{if(_===Vi.Hidden&&x.current){if(C&&D!=="visible"){O("visible");return}return yn(D,{hidden:()=>N(x),visible:()=>I(x)})}},[D,x,I,N,C,_]);let W=yo({base:Ci(y.className),enter:Ci(l),enterFrom:Ci(u),enterTo:Ci(d),entered:Ci(h),leave:Ci(p),leaveFrom:Ci(g),leaveTo:Ci(b)}),Y=qG({beforeEnter:o,afterEnter:i,beforeLeave:s,afterLeave:a}),ue=xy();m.useEffect(()=>{if(ue&&D==="visible"&&x.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[x,D,ue]);let J=E&&!R,F=R&&C&&E,Z=!ue||J?"idle":C?"enter":"leave",q=NG(0),X=it(ce=>yn(ce,{enter:()=>{q.addFlag(fr.Opening),Y.current.beforeEnter()},leave:()=>{q.addFlag(fr.Closing),Y.current.beforeLeave()},idle:()=>{}})),ie=it(ce=>yn(ce,{enter:()=>{q.removeFlag(fr.Opening),Y.current.afterEnter()},leave:()=>{q.removeFlag(fr.Closing),Y.current.afterLeave()},idle:()=>{}})),j=_O(()=>{O("hidden"),N(x)},T),V=m.useRef(!1);jG({immediate:F,container:x,classes:W,direction:Z,onStart:yo(ce=>{V.current=!0,j.onStart(x,ce,X)}),onStop:yo(ce=>{V.current=!1,j.onStop(x,ce,ie),ce==="leave"&&!Sp(j)&&(O("hidden"),N(x))})});let te=y,le={ref:w};return F?te={...te,className:Mh(y.className,...W.current.enter,...W.current.enterFrom)}:V.current&&(te.className=Mh(y.className,(r=x.current)==null?void 0:r.className),te.className===""&&delete te.className),m.createElement(_p.Provider,{value:j},m.createElement(vO,{value:yn(D,{visible:fr.Open,hidden:fr.Closed})|q.flags},ci({ourProps:le,theirProps:te,defaultTag:GG,features:SO,visible:D==="visible",name:"Transition.Child"})))}function KG(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=m.useRef(null),a=ya(s,t);xy();let l=Sy();if(n===void 0&&l!==null&&(n=(l&fr.Open)===fr.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=m.useState(n?"visible":"hidden"),h=_O(()=>{d("hidden")}),[p,g]=m.useState(!0),b=m.useRef([n]);an(()=>{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(!Sp(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},w=it(()=>{var C;p&&g(!1),(C=e.beforeEnter)==null||C.call(e)}),_=it(()=>{var C;p&&g(!1),(C=e.beforeLeave)==null||C.call(e)});return m.createElement(_p.Provider,{value:h},m.createElement(wp.Provider,{value:y},ci({ourProps:{...x,as:m.Fragment,children:m.createElement(CO,{ref:a,...x,...i,beforeEnter:w,beforeLeave:_})},theirProps:{},defaultTag:m.Fragment,features:SO,visible:u==="visible",name:"Transition"})))}function XG(e,t){let n=m.useContext(wp)!==null,r=Sy()!==null;return m.createElement(m.Fragment,null,!n&&r?m.createElement(Mb,{ref:t,...e}):m.createElement(CO,{ref:t,...e}))}let Mb=Oo(KG),CO=Oo(YG),QG=Oo(XG),ZG=Object.assign(Mb,{Child:QG,Root:Mb});const Cp=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],Nl=["number","integer","int","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8"],td=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],$y=["boolean"];function EO(e){return e.match(/[A-Z]/)?`"${e}"`:e}function JG(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=RO(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 eY(e,t,n="AVG"){var i,s,a,l;let r={};const o=EO(e.column_name);return Cp.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]}),Nl.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 Th(e){return Cp.includes(e.dataType)?"string":Nl.includes(e.dataType)?"number":td.includes(e.dataType)?"date":$y.includes(e.dataType)?"boolean":"string"}function tY(e){let t;const n=e.data_type.toLowerCase();return Cp.includes(n)?t="T":Nl.includes(n)?t="#":td.includes(n)?t="D":$y.includes(n)?t="B":t="?",t}function nY(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 RO(e,t){return t==="api"||t==="s3"||e==="public"?t:e?`${e}.${t}`:`${t}`}function rY(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 oY(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 td.includes(e)?o:r}const PC=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,OC=th,Py=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return OC(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=PC(d)||PC(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 OC(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Db=Py("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"}}),ea=ae.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?ri:"button";return k.jsx(s,{className:Se(Db({variant:t,size:n,className:e})),ref:i,...o})});ea.displayName="Button";function iY({filter:e}){const[t,n]=m.useState([]),[r,o]=m.useState(""),[i,s]=m.useState(""),a=m.useRef(null),{authToken:l}=ha(),u=Ee(T=>T.filterValues),d=Ee(T=>T.actions.addOrUpdateFilterValue),h=Ee(T=>T.actions.removeFilterValue),p=C(u),{data:g,isLoading:b,isFetching:y,isError:x,refetch:w}=go({queryKey:["filter",e.id,e.sql,JSON.stringify(p)],queryFn:()=>jh("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}),_=m.useMemo(()=>{var T;return(T=g==null?void 0:g.records)==null?void 0:T.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 T=u.find(I=>I.filterId===e.id);if(!T){n([]);return}if(T.operation==="in"){const I=_==null?void 0:_.filter(N=>T.values.includes(N.value));I&&n(I)}else o(`${T.operation} ${T.values[0]}`)}},[g]),m.useEffect(()=>{if(u&&!u.find(I=>I.filterId===e.id)){n([]);return}},[u,e.id]);function C(T){return T?T.filter(I=>{const W=I.name.split(".");if(W.slice(0,W.length-1).join(".")===e.table&&I.name!==e.column)return!0}):[]}function R(T){const I=rY(T[0].toString());if(!(I!=null&&I.value)||!(I!=null&&I.operation))return;const N={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Th(e),name:e.column,operation:I.operation,values:[Number(I.value)]};d(N)}function E(T){if(console.log("onComboBoxChange",T),T.length===1&&_.find(N=>N.value===T[0].value)===void 0){R(T);return}if(n(T),T.length===0){h(e.id);return}const I={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Th(e),operation:e.operation,values:T.map(N=>N.value)};d(I)}function D(){var T;o(""),h(e.id),console.log(e.id),(T=a.current)==null||T.click()}if(b)return k.jsx("div",{children:k.jsx(Zb,{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 Nl.includes(e.dataType)?O=_:O=i===""?_:_.filter(T=>T.value.toLowerCase().replace(/\s+/g,"").includes(i.toLowerCase().replace(/\s+/g,""))),k.jsx("div",{className:"w-[250px]",children:k.jsx(Ga,{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(Ga.Input,{className:"flex h-8 w-full rounded border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",displayValue:T=>T.map(N=>N.value).join(", ")||r,onChange:T=>{o(T.target.value),s(T.target.value)}}),k.jsx(Ga.Button,{ref:a,className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:k.jsx(oW,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),k.jsx(ZG,{as:m.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:k.jsxs(Ga.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:[Nl.includes(e.dataType)&&k.jsxs(Ga.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(ea,{variant:"link",className:"h-4 w-3 cursor-pointer text-foreground/50 hover:text-foreground/100",onClick:T=>{T.stopPropagation(),D()},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(T=>k.jsx(Ga.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:T,children:({selected:I,active:N})=>(I&&console.log("record",T,I),k.jsxs("div",{className:"",children:[k.jsx("span",{className:`block ${I?"font-medium":"font-normal"}`,children:typeof T.value=="boolean"?T.value?"True":"False":T.value}),I?k.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:k.jsx(pP,{className:"h-5 w-5","aria-hidden":"true"})}):null]}))},T.value))]})})]})})})}const sY=m.forwardRef((e,t)=>m.createElement(Le.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()}}))),$O=sY,aY=Py("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Qo=ae.forwardRef(({className:e,...t},n)=>k.jsx($O,{ref:n,className:Se(aY(),e),...t}));Qo.displayName=$O.displayName;function mt(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 br(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Nn(e,t){const n=mt(e);return isNaN(t)?br(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Jr(e,t){const n=mt(e);if(isNaN(t))return br(e,NaN);if(!t)return n;const r=n.getDate(),o=br(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 Oy=6048e5,lY=864e5;let cY={};function nd(){return cY}function So(e,t){var a,l,u,d;const n=nd(),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=mt(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 fa(e){return So(e,{weekStartsOn:1})}function PO(e){const t=mt(e),n=t.getFullYear(),r=br(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=fa(r),i=br(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=fa(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Ll(e){const t=mt(e);return t.setHours(0,0,0,0),t}function Ah(e){const t=mt(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 vo(e,t){const n=Ll(e),r=Ll(t),o=+n-Ah(n),i=+r-Ah(r);return Math.round((o-i)/lY)}function uY(e){const t=PO(e),n=br(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),fa(n)}function Tb(e,t){const n=t*7;return Nn(e,n)}function dY(e,t){return Jr(e,t*12)}function fY(e){let t;return e.forEach(function(n){const r=mt(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function hY(e){let t;return e.forEach(n=>{const r=mt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function Yn(e,t){const n=Ll(e),r=Ll(t);return+n==+r}function My(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function pY(e){if(!My(e)&&typeof e!="number")return!1;const t=mt(e);return!isNaN(Number(t))}function bu(e,t){const n=mt(e),r=mt(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function gY(e,t,n){const r=So(e,n),o=So(t,n),i=+r-Ah(r),s=+o-Ah(o);return Math.round((i-s)/Oy)}function Dy(e){const t=mt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function Xn(e){const t=mt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function OO(e){const t=mt(e),n=br(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Ty(e,t){var a,l,u,d;const n=nd(),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=mt(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 MO(e){return Ty(e,{weekStartsOn:1})}const mY={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"}},vY=(e,t,n)=>{let r;const o=mY[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 Qm(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const bY={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},yY={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},xY={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},wY={date:Qm({formats:bY,defaultWidth:"full"}),time:Qm({formats:yY,defaultWidth:"full"}),dateTime:Qm({formats:xY,defaultWidth:"full"})},_Y={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},SY=(e,t,n,r)=>_Y[e];function Oc(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 CY={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},EY={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},RY={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"]},$Y={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"]},PY={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"}},OY={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"}},MY=(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"},DY={ordinalNumber:MY,era:Oc({values:CY,defaultWidth:"wide"}),quarter:Oc({values:EY,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Oc({values:RY,defaultWidth:"wide"}),day:Oc({values:$Y,defaultWidth:"wide"}),dayPeriod:Oc({values:PY,defaultWidth:"wide",formattingValues:OY,defaultFormattingWidth:"wide"})};function Mc(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)?AY(a,h=>h.test(s)):TY(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 TY(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function AY(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function IY(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 kY=/^(\d+)(th|st|nd|rd)?/i,NY=/\d+/i,LY={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},FY={any:[/^b/i,/^(a|c)/i]},zY={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},jY={any:[/1/i,/2/i,/3/i,/4/i]},VY={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},HY={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]},WY={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},BY={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]},UY={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},qY={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}},GY={ordinalNumber:IY({matchPattern:kY,parsePattern:NY,valueCallback:e=>parseInt(e,10)}),era:Mc({matchPatterns:LY,defaultMatchWidth:"wide",parsePatterns:FY,defaultParseWidth:"any"}),quarter:Mc({matchPatterns:zY,defaultMatchWidth:"wide",parsePatterns:jY,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Mc({matchPatterns:VY,defaultMatchWidth:"wide",parsePatterns:HY,defaultParseWidth:"any"}),day:Mc({matchPatterns:WY,defaultMatchWidth:"wide",parsePatterns:BY,defaultParseWidth:"any"}),dayPeriod:Mc({matchPatterns:UY,defaultMatchWidth:"any",parsePatterns:qY,defaultParseWidth:"any"})},DO={code:"en-US",formatDistance:vY,formatLong:wY,formatRelative:SY,localize:DY,match:GY,options:{weekStartsOn:0,firstWeekContainsDate:1}};function YY(e){const t=mt(e);return vo(t,OO(t))+1}function TO(e){const t=mt(e),n=+fa(t)-+uY(t);return Math.round(n/Oy)+1}function AO(e,t){var d,h,p,g;const n=mt(e),r=n.getFullYear(),o=nd(),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=br(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=So(s,t),l=br(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const u=So(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function KY(e,t){var a,l,u,d;const n=nd(),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=AO(e,t),i=br(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),So(i,t)}function IO(e,t){const n=mt(e),r=+So(n,t)-+KY(n,t);return Math.round(r/Oy)+1}function Ct(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Ei={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ct(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ct(n+1,2)},d(e,t){return Ct(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 Ct(e.getHours()%12||12,t.length)},H(e,t){return Ct(e.getHours(),t.length)},m(e,t){return Ct(e.getMinutes(),t.length)},s(e,t){return Ct(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return Ct(o,t.length)}},Ya={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},MC={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 Ei.y(e,t)},Y:function(e,t,n,r){const o=AO(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return Ct(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Ct(i,t.length)},R:function(e,t){const n=PO(e);return Ct(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ct(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 Ct(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 Ct(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 Ei.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 Ct(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=IO(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):Ct(o,t.length)},I:function(e,t,n){const r=TO(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ct(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ei.d(e,t)},D:function(e,t,n){const r=YY(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ct(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 Ct(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 Ct(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 Ct(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=Ya.noon:r===0?o=Ya.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=Ya.evening:r>=12?o=Ya.afternoon:r>=4?o=Ya.morning:o=Ya.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 Ei.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ei.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ct(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ct(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ei.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ei.s(e,t)},S:function(e,t){return Ei.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return TC(r);case"XXXX":case"XX":return Is(r);case"XXXXX":case"XXX":default:return Is(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return TC(r);case"xxxx":case"xx":return Is(r);case"xxxxx":case"xxx":default:return Is(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+DC(r,":");case"OOOO":default:return"GMT"+Is(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+DC(r,":");case"zzzz":default:return"GMT"+Is(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Ct(r,t.length)},T:function(e,t,n){const r=e.getTime();return Ct(r,t.length)}};function DC(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+Ct(i,2)}function TC(e,t){return e%60===0?(e>0?"-":"+")+Ct(Math.abs(e)/60,2):Is(e,t)}function Is(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=Ct(Math.trunc(r/60),2),i=Ct(r%60,2);return n+o+t+i}const AC=(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"})}},kO=(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"})}},XY=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return AC(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}}",AC(r,t)).replace("{{time}}",kO(o,t))},QY={p:kO,P:XY},ZY=/^D+$/,JY=/^Y+$/,eK=["D","DD","YY","YYYY"];function tK(e){return ZY.test(e)}function nK(e){return JY.test(e)}function rK(e,t,n){const r=oK(e,t,n);if(console.warn(r),eK.includes(e))throw new RangeError(r)}function oK(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 iK=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sK=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,aK=/^'([^]*?)'?$/,lK=/''/g,cK=/[a-zA-Z]/;function xo(e,t,n){var d,h,p,g,b,y,x,w;const r=nd(),o=(n==null?void 0:n.locale)??r.locale??DO,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??((w=(x=r.locale)==null?void 0:x.options)==null?void 0:w.weekStartsOn)??0,a=mt(e);if(!pY(a))throw new RangeError("Invalid time value");let l=t.match(sK).map(_=>{const C=_[0];if(C==="p"||C==="P"){const R=QY[C];return R(_,o.formatLong)}return _}).join("").match(iK).map(_=>{if(_==="''")return{isToken:!1,value:"'"};const C=_[0];if(C==="'")return{isToken:!1,value:uK(_)};if(MC[C])return{isToken:!0,value:_};if(C.match(cK))throw new RangeError("Format string contains an unescaped latin alphabet character `"+C+"`");return{isToken:!1,value:_}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const u={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(_=>{if(!_.isToken)return _.value;const C=_.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&nK(C)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&tK(C))&&rK(C,t,String(e));const R=MC[C[0]];return R(a,C,o.localize,u)}).join("")}function uK(e){const t=e.match(aK);return t?t[1].replace(lK,"'"):e}function dK(e){const t=mt(e),n=t.getFullYear(),r=t.getMonth(),o=br(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function fK(e){return Math.trunc(+mt(e)/1e3)}function hK(e){const t=mt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function pK(e,t){return gY(hK(e),Xn(e),t)+1}function Ab(e,t){const n=mt(e),r=mt(t);return n.getTime()>r.getTime()}function NO(e,t){const n=mt(e),r=mt(t);return+n<+r}function Ay(e,t){const n=mt(e),r=mt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function gK(e,t){const n=mt(e),r=mt(t);return n.getFullYear()===r.getFullYear()}function Zm(e,t){return Nn(e,-t)}function Jm(e,t){const n=mt(e),r=n.getFullYear(),o=n.getDate(),i=br(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=dK(i);return n.setMonth(t,Math.min(o,s)),n}function IC(e,t){const n=mt(e);return isNaN(+n)?br(e,NaN):(n.setFullYear(t),n)}var He=function(){return He=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},He.apply(this,arguments)};function mK(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 LO(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 Ib={exports:{}},Dc={};/**
|
|
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 kC;function vK(){return kC||(kC=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 H=b&&$[b]||$[y];return typeof H=="function"?H:null}var w=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _($){{for(var H=arguments.length,oe=new Array(H>1?H-1:0),xe=1;xe<H;xe++)oe[xe-1]=arguments[xe];C("error",$,oe)}}function C($,H,oe){{var xe=w.ReactDebugCurrentFrame,Te=xe.getStackAddendum();Te!==""&&(H+="%s",oe=oe.concat([Te]));var ke=oe.map(function(Pe){return String(Pe)});ke.unshift("Warning: "+H),Function.prototype.apply.call(console[$],console,ke)}}var R=!1,E=!1,D=!1,O=!1,T=!1,I;I=Symbol.for("react.module.reference");function N($){return!!(typeof $=="string"||typeof $=="function"||$===r||$===i||T||$===o||$===u||$===d||O||$===g||R||E||D||typeof $=="object"&&$!==null&&($.$$typeof===p||$.$$typeof===h||$.$$typeof===s||$.$$typeof===a||$.$$typeof===l||$.$$typeof===I||$.getModuleId!==void 0))}function W($,H,oe){var xe=$.displayName;if(xe)return xe;var Te=H.displayName||H.name||"";return Te!==""?oe+"("+Te+")":oe}function Y($){return $.displayName||"Context"}function ue($){if($==null)return null;if(typeof $.tag=="number"&&_("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 H=$;return Y(H)+".Consumer";case s:var oe=$;return Y(oe._context)+".Provider";case l:return W($,$.render,"ForwardRef");case h:var xe=$.displayName||null;return xe!==null?xe:ue($.type)||"Memo";case p:{var Te=$,ke=Te._payload,Pe=Te._init;try{return ue(Pe(ke))}catch{return null}}}return null}var J=Object.assign,F=0,Z,q,X,ie,j,V,te;function le(){}le.__reactDisabledLog=!0;function ce(){{if(F===0){Z=console.log,q=console.info,X=console.warn,ie=console.error,j=console.group,V=console.groupCollapsed,te=console.groupEnd;var $={configurable:!0,enumerable:!0,value:le,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:J({},$,{value:Z}),info:J({},$,{value:q}),warn:J({},$,{value:X}),error:J({},$,{value:ie}),group:J({},$,{value:j}),groupCollapsed:J({},$,{value:V}),groupEnd:J({},$,{value:te})})}F<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ve=w.ReactCurrentDispatcher,de;function ee($,H,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 K=!1,re;{var be=typeof WeakMap=="function"?WeakMap:Map;re=new be}function Q($,H){if(!$||K)return"";{var oe=re.get($);if(oe!==void 0)return oe}var xe;K=!0;var Te=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ke;ke=ve.current,ve.current=null,ce();try{if(H){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(zt){xe=zt}Reflect.construct($,[],Pe)}else{try{Pe.call()}catch(zt){xe=zt}$.call(Pe.prototype)}}else{try{throw Error()}catch(zt){xe=zt}$()}}catch(zt){if(zt&&xe&&typeof zt.stack=="string"){for(var Re=zt.stack.split(`
|
|
294
|
+
`),gt=xe.stack.split(`
|
|
295
|
+
`),Be=Re.length-1,Ge=gt.length-1;Be>=1&&Ge>=0&&Re[Be]!==gt[Ge];)Ge--;for(;Be>=1&&Ge>=0;Be--,Ge--)if(Re[Be]!==gt[Ge]){if(Be!==1||Ge!==1)do if(Be--,Ge--,Ge<0||Re[Be]!==gt[Ge]){var Rt=`
|
|
296
|
+
`+Re[Be].replace(" at new "," at ");return $.displayName&&Rt.includes("<anonymous>")&&(Rt=Rt.replace("<anonymous>",$.displayName)),typeof $=="function"&&re.set($,Rt),Rt}while(Be>=1&&Ge>=0);break}}}finally{K=!1,ve.current=ke,ge(),Error.prepareStackTrace=Te}var ln=$?$.displayName||$.name:"",ps=ln?ee(ln):"";return typeof $=="function"&&re.set($,ps),ps}function Oe($,H,oe){return Q($,!1)}function Ie($){var H=$.prototype;return!!(H&&H.isReactComponent)}function ze($,H,oe){if($==null)return"";if(typeof $=="function")return Q($,Ie($));if(typeof $=="string")return ee($);switch($){case u:return ee("Suspense");case d:return ee("SuspenseList")}if(typeof $=="object")switch($.$$typeof){case l:return Oe($.render);case h:return ze($.type,H,oe);case p:{var xe=$,Te=xe._payload,ke=xe._init;try{return ze(ke(Te),H,oe)}catch{}}}return""}var _e=Object.prototype.hasOwnProperty,pt={},dt=w.ReactDebugCurrentFrame;function ft($){if($){var H=$._owner,oe=ze($.type,$._source,H?H.type:null);dt.setExtraStackFrame(oe)}else dt.setExtraStackFrame(null)}function Bt($,H,oe,xe,Te){{var ke=Function.call.bind(_e);for(var Pe in $)if(ke($,Pe)){var Re=void 0;try{if(typeof $[Pe]!="function"){var gt=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 gt.name="Invariant Violation",gt}Re=$[Pe](H,Pe,xe,oe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Be){Re=Be}Re&&!(Re instanceof Error)&&(ft(Te),_("%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),ft(null)),Re instanceof Error&&!(Re.message in pt)&&(pt[Re.message]=!0,ft(Te),_("Failed %s type: %s",oe,Re.message),ft(null))}}}var Vt=Array.isArray;function wn($){return Vt($)}function en($){{var H=typeof Symbol=="function"&&Symbol.toStringTag,oe=H&&$[Symbol.toStringTag]||$.constructor.name||"Object";return oe}}function Yl($){try{return jr($),!1}catch{return!0}}function jr($){return""+$}function Ji($){if(Yl($))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",en($)),jr($)}var hn=w.ReactCurrentOwner,no={key:!0,ref:!0,__self:!0,__source:!0},Mo,Do,Vr;Vr={};function es($){if(_e.call($,"ref")){var H=Object.getOwnPropertyDescriptor($,"ref").get;if(H&&H.isReactWarning)return!1}return $.ref!==void 0}function ts($){if(_e.call($,"key")){var H=Object.getOwnPropertyDescriptor($,"key").get;if(H&&H.isReactWarning)return!1}return $.key!==void 0}function ns($,H){if(typeof $.ref=="string"&&hn.current&&H&&hn.current.stateNode!==H){var oe=ue(hn.current.type);Vr[oe]||(_('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',ue(hn.current.type),$.ref),Vr[oe]=!0)}}function rs($,H){{var oe=function(){Mo||(Mo=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",H))};oe.isReactWarning=!0,Object.defineProperty($,"key",{get:oe,configurable:!0})}}function os($,H){{var oe=function(){Do||(Do=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",H))};oe.isReactWarning=!0,Object.defineProperty($,"ref",{get:oe,configurable:!0})}}var is=function($,H,oe,xe,Te,ke,Pe){var Re={$$typeof:t,type:$,key:H,ref:oe,props:Pe,_owner:ke};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 Kl($,H,oe,xe,Te){{var ke,Pe={},Re=null,gt=null;oe!==void 0&&(Ji(oe),Re=""+oe),ts(H)&&(Ji(H.key),Re=""+H.key),es(H)&&(gt=H.ref,ns(H,Te));for(ke in H)_e.call(H,ke)&&!no.hasOwnProperty(ke)&&(Pe[ke]=H[ke]);if($&&$.defaultProps){var Be=$.defaultProps;for(ke in Be)Pe[ke]===void 0&&(Pe[ke]=Be[ke])}if(Re||gt){var Ge=typeof $=="function"?$.displayName||$.name||"Unknown":$;Re&&rs(Pe,Ge),gt&&os(Pe,Ge)}return is($,Re,gt,Te,xe,hn.current,Pe)}}var To=w.ReactCurrentOwner,ss=w.ReactDebugCurrentFrame;function _n($){if($){var H=$._owner,oe=ze($.type,$._source,H?H.type:null);ss.setExtraStackFrame(oe)}else ss.setExtraStackFrame(null)}var ro;ro=!1;function Ao($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function as(){{if(To.current){var $=ue(To.current.type);if($)return`
|
|
297
|
+
|
|
298
|
+
Check the render method of \``+$+"`."}return""}}function Xl($){{if($!==void 0){var H=$.fileName.replace(/^.*[\\\/]/,""),oe=$.lineNumber;return`
|
|
299
|
+
|
|
300
|
+
Check your code at `+H+":"+oe+"."}return""}}var ls={};function Ea($){{var H=as();if(!H){var oe=typeof $=="string"?$:$.displayName||$.name;oe&&(H=`
|
|
301
|
+
|
|
302
|
+
Check the top-level render call using <`+oe+">.")}return H}}function cs($,H){{if(!$._store||$._store.validated||$.key!=null)return;$._store.validated=!0;var oe=Ea(H);if(ls[oe])return;ls[oe]=!0;var xe="";$&&$._owner&&$._owner!==To.current&&(xe=" It was passed a child from "+ue($._owner.type)+"."),_n($),_('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),_n(null)}}function us($,H){{if(typeof $!="object")return;if(wn($))for(var oe=0;oe<$.length;oe++){var xe=$[oe];Ao(xe)&&cs(xe,H)}else if(Ao($))$._store&&($._store.validated=!0);else if($){var Te=x($);if(typeof Te=="function"&&Te!==$.entries)for(var ke=Te.call($),Pe;!(Pe=ke.next()).done;)Ao(Pe.value)&&cs(Pe.value,H)}}}function Ql($){{var H=$.type;if(H==null||typeof H=="string")return;var oe;if(typeof H=="function")oe=H.propTypes;else if(typeof H=="object"&&(H.$$typeof===l||H.$$typeof===h))oe=H.propTypes;else return;if(oe){var xe=ue(H);Bt(oe,$.props,"prop",xe,$)}else if(H.PropTypes!==void 0&&!ro){ro=!0;var Te=ue(H);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Te||"Unknown")}typeof H.getDefaultProps=="function"&&!H.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ds($){{for(var H=Object.keys($.props),oe=0;oe<H.length;oe++){var xe=H[oe];if(xe!=="children"&&xe!=="key"){_n($),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",xe),_n(null);break}}$.ref!==null&&(_n($),_("Invalid attribute `ref` supplied to `React.Fragment`."),_n(null))}}function fs($,H,oe,xe,Te,ke){{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 gt=Xl(Te);gt?Re+=gt:Re+=as();var Be;$===null?Be="null":wn($)?Be="array":$!==void 0&&$.$$typeof===t?(Be="<"+(ue($.type)||"Unknown")+" />",Re=" Did you accidentally export a JSX literal instead of a component?"):Be=typeof $,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Be,Re)}var Ge=Kl($,H,oe,Te,ke);if(Ge==null)return Ge;if(Pe){var Rt=H.children;if(Rt!==void 0)if(xe)if(wn(Rt)){for(var ln=0;ln<Rt.length;ln++)us(Rt[ln],$);Object.freeze&&Object.freeze(Rt)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else us(Rt,$)}return $===r?ds(Ge):Ql(Ge),Ge}}function hs($,H,oe){return fs($,H,oe,!0)}function Zl($,H,oe){return fs($,H,oe,!1)}var Jl=Zl,ec=hs;Dc.Fragment=r,Dc.jsx=Jl,Dc.jsxs=ec}()),Dc}var Tc={};/**
|
|
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 NC;function bK(){if(NC)return Tc;NC=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 Tc.Fragment=n,Tc.jsx=s,Tc.jsxs=s,Tc}process.env.NODE_ENV==="production"?Ib.exports=bK():Ib.exports=vK();var me=Ib.exports;function rd(e){return e.mode==="multiple"}function od(e){return e.mode==="range"}function Ep(e){return e.mode==="single"}var yK={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 xK(e,t){return xo(e,"LLLL y",t)}function wK(e,t){return xo(e,"d",t)}function _K(e,t){return xo(e,"LLLL",t)}function SK(e){return"".concat(e)}function CK(e,t){return xo(e,"cccccc",t)}function EK(e,t){return xo(e,"yyyy",t)}var RK=Object.freeze({__proto__:null,formatCaption:xK,formatDay:wK,formatMonthCaption:_K,formatWeekNumber:SK,formatWeekdayName:CK,formatYearCaption:EK}),$K=function(e,t,n){return xo(e,"do MMMM (EEEE)",n)},PK=function(){return"Month: "},OK=function(){return"Go to next month"},MK=function(){return"Go to previous month"},DK=function(e,t){return xo(e,"cccc",t)},TK=function(e){return"Week n. ".concat(e)},AK=function(){return"Year: "},IK=Object.freeze({__proto__:null,labelDay:$K,labelMonthDropdown:PK,labelNext:OK,labelPrevious:MK,labelWeekNumber:TK,labelWeekday:DK,labelYearDropdown:AK});function kK(){var e="buttons",t=yK,n=DO,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:RK,labels:IK,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function NK(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=Xn(r):t&&(i=new Date(t,0,1)),o?s=Dy(o):n&&(s=new Date(n,11,31)),{fromDate:i?Ll(i):void 0,toDate:s?Ll(s):void 0}}var FO=m.createContext(void 0);function LK(e){var t,n=e.initialProps,r=kK(),o=NK(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;(Ep(n)||rd(n)||od(n))&&(l=n.onSelect);var u=He(He(He({},r),n),{captionLayout:a,classNames:He(He({},r.classNames),n.classNames),components:He({},n.components),formatters:He(He({},r.formatters),n.formatters),fromDate:i,labels:He(He({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:He(He({},r.modifiers),n.modifiers),modifiersClassNames:He(He({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:He(He({},r.styles),n.styles),toDate:s});return me.jsx(FO.Provider,{value:u,children:e.children})}function Mt(){var e=m.useContext(FO);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function zO(e){var t=Mt(),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 FK(e){return me.jsx("svg",He({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 jO(e){var t,n,r=e.onChange,o=e.value,i=e.children,s=e.caption,a=e.className,l=e.style,u=Mt(),d=(n=(t=u.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:FK;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 zK(e){var t,n=Mt(),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(gK(r,o))for(var p=Xn(r),g=r.getMonth();g<=o.getMonth();g++)h.push(Jm(p,g));else for(var p=Xn(new Date),g=0;g<=11;g++)h.push(Jm(p,g));var b=function(x){var w=Number(x.target.value),_=Jm(Xn(e.displayMonth),w);e.onChange(_)},y=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:jO;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 jK(e){var t,n=e.displayMonth,r=Mt(),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(IC(OO(new Date),y));var x=function(_){var C=IC(Xn(n),Number(_.target.value));e.onChange(C)},w=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:jO;return me.jsx(w,{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(_){return me.jsx("option",{value:_.getFullYear(),children:d(_,{locale:s})},_.getFullYear())})})}function VK(e,t){var n=m.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function HK(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&&bu(i,o)<0){var u=-1*(l-1);o=Jr(i,u)}return s&&bu(o,s)<0&&(o=s),Xn(o)}function WK(){var e=Mt(),t=HK(e),n=VK(t,e.month),r=n[0],o=n[1],i=function(s){var a;if(!e.disableNavigation){var l=Xn(s);o(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,i]}function BK(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=Xn(e),i=Xn(Jr(o,r)),s=bu(i,o),a=[],l=0;l<s;l++){var u=Jr(o,l);a.push(u)}return n&&(a=a.reverse()),a}function UK(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=Xn(e);if(!n)return Jr(a,s);var l=bu(n,e);if(!(l<i))return Jr(a,s)}}function qK(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=Xn(e);if(!n)return Jr(a,-s);var l=bu(a,n);if(!(l<=0))return Jr(a,-s)}}var VO=m.createContext(void 0);function GK(e){var t=Mt(),n=WK(),r=n[0],o=n[1],i=BK(r,t),s=UK(r,t),a=qK(r,t),l=function(h){return i.some(function(p){return Ay(h,p)})},u=function(h,p){l(h)||(p&&NO(h,p)?o(Jr(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(VO.Provider,{value:d,children:e.children})}function id(){var e=m.useContext(VO);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function LC(e){var t,n=Mt(),r=n.classNames,o=n.styles,i=n.components,s=id().goToMonth,a=function(d){s(Jr(d,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:zO,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(zK,{onChange:a,displayMonth:e.displayMonth}),me.jsx(jK,{onChange:a,displayMonth:e.displayMonth})]})}function YK(e){return me.jsx("svg",He({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 KK(e){return me.jsx("svg",He({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 Ih=m.forwardRef(function(e,t){var n=Mt(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var s=i.join(" "),a=He(He({},o.button_reset),o.button);return e.style&&Object.assign(a,e.style),me.jsx("button",He({},e,{ref:t,type:"button",className:s,style:a}))});function XK(e){var t,n,r=Mt(),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:KK,w=(n=h==null?void 0:h.IconLeft)!==null&&n!==void 0?n:YK;return me.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&me.jsx(Ih,{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(w,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&me.jsx(Ih,{name:"next-month","aria-label":b,className:y,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?me.jsx(w,{className:s.nav_icon,style:a.nav_icon}):me.jsx(x,{className:s.nav_icon,style:a.nav_icon})})]})}function FC(e){var t=Mt().numberOfMonths,n=id(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(b){return Ay(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(XK,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:h,nextMonth:o,previousMonth:r,onPreviousClick:p,onNextClick:g})}function QK(e){var t,n=Mt(),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:zO,u;return o?u=me.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?u=me.jsx(LC,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?u=me.jsxs(me.Fragment,{children:[me.jsx(LC,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),me.jsx(FC,{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(FC,{displayMonth:e.displayMonth,id:e.id})]}),me.jsx("div",{className:r.caption,style:i.caption,children:u})}function ZK(e){var t=Mt(),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 JK(e,t,n){for(var r=n?fa(new Date):So(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=Nn(r,i);o.push(s)}return o}function eX(){var e=Mt(),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=JK(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 tX(){var e,t=Mt(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:eX;return me.jsx("thead",{style:r.head,className:n.head,children:me.jsx(i,{})})}function nX(e){var t=Mt(),n=t.locale,r=t.formatters.formatDay;return me.jsx(me.Fragment,{children:r(e.date,{locale:n})})}var Iy=m.createContext(void 0);function rX(e){if(!rd(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return me.jsx(Iy.Provider,{value:t,children:e.children})}return me.jsx(oX,{initialProps:e.initialProps,children:e.children})}function oX(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?LO([],r,!0):[];if(d.selected){var w=x.findIndex(function(_){return Yn(u,_)});x.splice(w,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 Yn(p,u)});return!!(d&&!h)});var l={selected:r,onDayClick:s,modifiers:a};return me.jsx(Iy.Provider,{value:l,children:n})}function ky(){var e=m.useContext(Iy);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function iX(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?Yn(o,e)&&Yn(r,e)?void 0:Yn(o,e)?{from:o,to:void 0}:Yn(r,e)?void 0:Ab(r,e)?{from:e,to:o}:{from:r,to:e}:o?Ab(e,o)?{from:o,to:e}:{from:e,to:o}:r?NO(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var Ny=m.createContext(void 0);function sX(e){if(!od(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return me.jsx(Ny.Provider,{value:t,children:e.children})}return me.jsx(aX,{initialProps:e.initialProps,children:e.children})}function aX(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,w;(x=t.onDayClick)===null||x===void 0||x.call(t,g,b,y);var _=iX(g,r);(w=t.onSelect)===null||w===void 0||w.call(t,_,g,b,y)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(d.range_start=[i],s?(d.range_end=[s],Yn(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:Zm(i,a-1),before:Nn(i,a-1)}),i&&s&&d.disabled.push({after:i,before:Nn(i,a-1)}),!i&&s&&d.disabled.push({after:Zm(s,a-1),before:Nn(s,a-1)})),l){if(i&&!s&&(d.disabled.push({before:Nn(i,-l+1)}),d.disabled.push({after:Nn(i,l-1)})),i&&s){var h=vo(s,i)+1,p=l-h;d.disabled.push({before:Zm(i,p)}),d.disabled.push({after:Nn(s,p)})}!i&&s&&(d.disabled.push({before:Nn(s,-l+1)}),d.disabled.push({after:Nn(s,l-1)}))}return me.jsx(Ny.Provider,{value:{selected:r,onDayClick:u,modifiers:d},children:n})}function Ly(){var e=m.useContext(Ny);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Zf(e){return Array.isArray(e)?LO([],e,!0):e!==void 0?[e]:[]}function lX(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=Zf(o)}),t}var eo;(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"})(eo||(eo={}));var cX=eo.Selected,Uo=eo.Disabled,uX=eo.Hidden,dX=eo.Today,ev=eo.RangeEnd,tv=eo.RangeMiddle,nv=eo.RangeStart,fX=eo.Outside;function hX(e,t,n){var r,o=(r={},r[cX]=Zf(e.selected),r[Uo]=Zf(e.disabled),r[uX]=Zf(e.hidden),r[dX]=[e.today],r[ev]=[],r[tv]=[],r[nv]=[],r[fX]=[],r);return e.fromDate&&o[Uo].push({before:e.fromDate}),e.toDate&&o[Uo].push({after:e.toDate}),rd(e)?o[Uo]=o[Uo].concat(t.modifiers[Uo]):od(e)&&(o[Uo]=o[Uo].concat(n.modifiers[Uo]),o[nv]=n.modifiers[nv],o[tv]=n.modifiers[tv],o[ev]=n.modifiers[ev]),o}var HO=m.createContext(void 0);function pX(e){var t=Mt(),n=ky(),r=Ly(),o=hX(t,n,r),i=lX(t.modifiers),s=He(He({},o),i);return me.jsx(HO.Provider,{value:s,children:e.children})}function WO(){var e=m.useContext(HO);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function gX(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function mX(e){return!!(e&&typeof e=="object"&&"from"in e)}function vX(e){return!!(e&&typeof e=="object"&&"after"in e)}function bX(e){return!!(e&&typeof e=="object"&&"before"in e)}function yX(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function xX(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=vo(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var s=vo(e,r)>=0&&vo(o,e)>=0;return s}return o?Yn(o,e):r?Yn(r,e):!1}function wX(e){return My(e)}function _X(e){return Array.isArray(e)&&e.every(My)}function SX(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(wX(n))return Yn(e,n);if(_X(n))return n.includes(e);if(mX(n))return xX(e,n);if(yX(n))return n.dayOfWeek.includes(e.getDay());if(gX(n)){var r=vo(n.before,e),o=vo(n.after,e),i=r>0,s=o<0,a=Ab(n.before,n.after);return a?s&&i:i||s}return vX(n)?vo(e,n.after)>0:bX(n)?vo(n.before,e)>0:typeof n=="function"?n(e):!1})}function Fy(e,t,n){var r=Object.keys(t).reduce(function(i,s){var a=t[s];return SX(e,a)&&i.push(s),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!Ay(e,n)&&(o.outside=!0),o}function CX(e,t){for(var n=Xn(e[0]),r=Dy(e[e.length-1]),o,i,s=n;s<=r;){var a=Fy(s,t),l=!a.disabled&&!a.hidden;if(!l){s=Nn(s,1);continue}if(a.selected)return s;a.today&&!i&&(i=s),o||(o=s),s=Nn(s,1)}return i||o}var EX=365;function BO(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:Nn,week:Tb,month:Jr,year:dY,startOfWeek:function(x){return o.ISOWeek?fa(x):So(x,{locale:h,weekStartsOn:l})},endOfWeek:function(x){return o.ISOWeek?MO(x):Ty(x,{locale:h,weekStartsOn:l})}},g=p[n](e,r==="after"?1:-1);r==="before"&&u?g=fY([u,g]):r==="after"&&d&&(g=hY([d,g]));var b=!0;if(i){var y=Fy(g,i);b=!y.disabled&&!y.hidden}return b?g:a.count>EX?a.lastFocused:BO(g,{moveBy:n,direction:r,context:o,modifiers:i,retry:He(He({},a),{count:a.count+1})})}var UO=m.createContext(void 0);function RX(e){var t=id(),n=WO(),r=m.useState(),o=r[0],i=r[1],s=m.useState(),a=s[0],l=s[1],u=CX(t.displayMonths,n),d=o??(a&&t.isDateDisplayed(a))?a:u,h=function(){l(o),i(void 0)},p=function(x){i(x)},g=Mt(),b=function(x,w){if(o){var _=BO(o,{moveBy:x,direction:w,context:g,modifiers:n});Yn(o,_)||(t.goToDate(_,o),p(_))}},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(UO.Provider,{value:y,children:e.children})}function zy(){var e=m.useContext(UO);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function $X(e,t){var n=WO(),r=Fy(e,n,t);return r}var jy=m.createContext(void 0);function PX(e){if(!Ep(e.initialProps)){var t={selected:void 0};return me.jsx(jy.Provider,{value:t,children:e.children})}return me.jsx(OX,{initialProps:e.initialProps,children:e.children})}function OX(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(jy.Provider,{value:o,children:n})}function qO(){var e=m.useContext(jy);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function MX(e,t){var n=Mt(),r=qO(),o=ky(),i=Ly(),s=zy(),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,w=s.focusStartOfWeek,_=s.focusEndOfWeek,C=function(q){var X,ie,j,V;Ep(n)?(X=r.onDayClick)===null||X===void 0||X.call(r,e,t,q):rd(n)?(ie=o.onDayClick)===null||ie===void 0||ie.call(o,e,t,q):od(n)?(j=i.onDayClick)===null||j===void 0||j.call(i,e,t,q):(V=n.onDayClick)===null||V===void 0||V.call(n,e,t,q)},R=function(q){var X;p(e),(X=n.onDayFocus)===null||X===void 0||X.call(n,e,t,q)},E=function(q){var X;h(),(X=n.onDayBlur)===null||X===void 0||X.call(n,e,t,q)},D=function(q){var X;(X=n.onDayMouseEnter)===null||X===void 0||X.call(n,e,t,q)},O=function(q){var X;(X=n.onDayMouseLeave)===null||X===void 0||X.call(n,e,t,q)},T=function(q){var X;(X=n.onDayPointerEnter)===null||X===void 0||X.call(n,e,t,q)},I=function(q){var X;(X=n.onDayPointerLeave)===null||X===void 0||X.call(n,e,t,q)},N=function(q){var X;(X=n.onDayTouchCancel)===null||X===void 0||X.call(n,e,t,q)},W=function(q){var X;(X=n.onDayTouchEnd)===null||X===void 0||X.call(n,e,t,q)},Y=function(q){var X;(X=n.onDayTouchMove)===null||X===void 0||X.call(n,e,t,q)},ue=function(q){var X;(X=n.onDayTouchStart)===null||X===void 0||X.call(n,e,t,q)},J=function(q){var X;(X=n.onDayKeyUp)===null||X===void 0||X.call(n,e,t,q)},F=function(q){var X;switch(q.key){case"ArrowLeft":q.preventDefault(),q.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":q.preventDefault(),q.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":q.preventDefault(),q.stopPropagation(),u();break;case"ArrowUp":q.preventDefault(),q.stopPropagation(),d();break;case"PageUp":q.preventDefault(),q.stopPropagation(),q.shiftKey?y():g();break;case"PageDown":q.preventDefault(),q.stopPropagation(),q.shiftKey?x():b();break;case"Home":q.preventDefault(),q.stopPropagation(),w();break;case"End":q.preventDefault(),q.stopPropagation(),_();break}(X=n.onDayKeyDown)===null||X===void 0||X.call(n,e,t,q)},Z={onClick:C,onFocus:R,onBlur:E,onKeyDown:F,onKeyUp:J,onMouseEnter:D,onMouseLeave:O,onPointerEnter:T,onPointerLeave:I,onTouchCancel:N,onTouchEnd:W,onTouchMove:Y,onTouchStart:ue};return Z}function DX(){var e=Mt(),t=qO(),n=ky(),r=Ly(),o=Ep(e)?t.selected:rd(e)?n.selected:od(e)?r.selected:void 0;return o}function TX(e){return Object.values(eo).includes(e)}function AX(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(TX(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function IX(e,t){var n=He({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=He(He({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function kX(e,t,n){var r,o,i,s=Mt(),a=zy(),l=$X(e,t),u=MX(e,l),d=DX(),h=!!(s.onDayClick||s.mode!=="default");m.useEffect(function(){var D;l.outside||a.focusedDay&&h&&Yn(a.focusedDay,e)&&((D=n.current)===null||D===void 0||D.focus())},[a.focusedDay,e,n,h,l.outside]);var p=AX(s,l).join(" "),g=IX(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:nX,x=me.jsx(y,{date:e,displayMonth:t,activeModifiers:l}),w={style:g,className:p,children:x,role:"gridcell"},_=a.focusTarget&&Yn(a.focusTarget,e)&&!l.outside,C=a.focusedDay&&Yn(a.focusedDay,e),R=He(He(He({},w),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=C||_?0:-1,r)),u),E={isButton:h,isHidden:b,activeModifiers:l,selectedDays:d,buttonProps:R,divProps:w};return E}function NX(e){var t=m.useRef(null),n=kX(e.date,e.displayMonth,t);return n.isHidden?me.jsx("div",{role:"gridcell"}):n.isButton?me.jsx(Ih,He({name:"day",ref:t},n.buttonProps)):me.jsx("div",He({},n.divProps))}function LX(e){var t=e.number,n=e.dates,r=Mt(),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(Ih,{name:"week-number","aria-label":h,className:s.weeknumber,style:i.weeknumber,onClick:p,children:d})}function FX(e){var t,n,r=Mt(),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:NX,u=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:LX,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})},fK(h))})]})}function zC(e,t,n){for(var r=n!=null&&n.ISOWeek?MO(t):Ty(t,n),o=n!=null&&n.ISOWeek?fa(e):So(e,n),i=vo(r,o),s=[],a=0;a<=i;a++)s.push(Nn(o,a));var l=s.reduce(function(u,d){var h=n!=null&&n.ISOWeek?TO(d):IO(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 zX(e,t){var n=zC(Xn(e),Dy(e),t);if(t!=null&&t.useFixedWeeks){var r=pK(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=Tb(i,6-r),a=zC(Tb(i,1),s,t);n.push.apply(n,a)}}return n}function jX(e){var t,n,r,o=Mt(),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=zX(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:tX,x=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:FX,w=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:ZK;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(_){return me.jsx(x,{displayMonth:e.displayMonth,dates:_.dates,weekNumber:_.weekNumber},_.weekNumber)})}),me.jsx(w,{displayMonth:e.displayMonth})]})}function VX(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var HX=VX()?m.useLayoutEffect:m.useEffect,rv=!1,WX=0;function jC(){return"react-day-picker-".concat(++WX)}function BX(e){var t,n=e??(rv?jC():null),r=m.useState(n),o=r[0],i=r[1];return HX(function(){o===null&&i(jC())},[]),m.useEffect(function(){rv===!1&&(rv=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function UX(e){var t,n,r=Mt(),o=r.dir,i=r.classNames,s=r.styles,a=r.components,l=id().displayMonths,u=BX(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=He(He({},p),s.caption_start)),b&&(h.push(i.caption_end),p=He(He({},p),s.caption_end)),y&&(h.push(i.caption_between),p=He(He({},p),s.caption_between));var x=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:QK;return me.jsxs("div",{className:h.join(" "),style:p,children:[me.jsx(x,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),me.jsx(jX,{id:d,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function qX(e){var t=Mt(),n=t.classNames,r=t.styles;return me.jsx("div",{className:n.months,style:r.months,children:e.children})}function GX(e){var t,n,r=e.initialProps,o=Mt(),i=zy(),s=id(),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=He(He({},o.styles.root),o.style),p=Object.keys(r).filter(function(b){return b.startsWith("data-")}).reduce(function(b,y){var x;return He(He({},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:qX;return me.jsx("div",He({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(UX,{displayIndex:y,displayMonth:b},y)})})}))}function YX(e){var t=e.children,n=mK(e,["children"]);return me.jsx(LK,{initialProps:n,children:me.jsx(GK,{children:me.jsx(PX,{initialProps:n,children:me.jsx(rX,{initialProps:n,children:me.jsx(sX,{initialProps:n,children:me.jsx(pX,{children:me.jsx(RX,{children:t})})})})})})})}function KX(e){return me.jsx(YX,He({},e,{children:me.jsx(GX,{initialProps:e})}))}function GO({className:e,classNames:t,showOutsideDays:n=!0,...r}){return k.jsx(KX,{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(Db({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(Db({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(XB,{...o,className:"h-4 w-4"}),IconRight:({...o})=>k.jsx(jP,{...o,className:"h-4 w-4"})},...r})}GO.displayName="Calendar";let ov=0;function Rp(){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:VC()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:VC()),ov++,()=>{ov===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),ov--}},[])}function VC(){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 iv="focusScope.autoFocusOnMount",sv="focusScope.autoFocusOnUnmount",HC={bubbles:!1,cancelable:!0},$p=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=m.useState(null),u=sn(o),d=sn(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:Pi(h.current,{select:!0})},x=function(C){if(g.paused||!a)return;const R=C.relatedTarget;R!==null&&(a.contains(R)||Pi(h.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const E of C)E.removedNodes.length>0&&Pi(a)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const _=new MutationObserver(w);return a&&_.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),_.disconnect()}}},[r,a,g.paused]),m.useEffect(()=>{if(a){BC.add(g);const y=document.activeElement;if(!a.contains(y)){const w=new CustomEvent(iv,HC);a.addEventListener(iv,u),a.dispatchEvent(w),w.defaultPrevented||(XX(tQ(YO(a)),{select:!0}),document.activeElement===y&&Pi(a))}return()=>{a.removeEventListener(iv,u),setTimeout(()=>{const w=new CustomEvent(sv,HC);a.addEventListener(sv,d),a.dispatchEvent(w),w.defaultPrevented||Pi(y??document.body,{select:!0}),a.removeEventListener(sv,d),BC.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,w=document.activeElement;if(x&&w){const _=y.currentTarget,[C,R]=QX(_);C&&R?!y.shiftKey&&w===R?(y.preventDefault(),n&&Pi(C,{select:!0})):y.shiftKey&&w===C&&(y.preventDefault(),n&&Pi(R,{select:!0})):w===_&&y.preventDefault()}},[n,r,g.paused]);return m.createElement(Le.div,ne({tabIndex:-1},s,{ref:p,onKeyDown:b}))});function XX(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Pi(r,{select:t}),document.activeElement!==n)return}function QX(e){const t=YO(e),n=WC(t,e),r=WC(t.reverse(),e);return[n,r]}function YO(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 WC(e,t){for(const n of e)if(!ZX(n,{upTo:t}))return n}function ZX(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function JX(e){return e instanceof HTMLInputElement&&"select"in e}function Pi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&JX(e)&&t&&e.select()}}const BC=eQ();function eQ(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=UC(e,t),e.unshift(t)},remove(t){var n;e=UC(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function UC(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function tQ(e){return e.filter(t=>t.tagName!=="A")}var nQ=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ka=new WeakMap,Df=new WeakMap,Tf={},av=0,KO=function(e){return e&&(e.host||KO(e.parentNode))},rQ=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=KO(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})},oQ=function(e,t,n,r){var o=rQ(t,Array.isArray(e)?e:[e]);Tf[n]||(Tf[n]=new WeakMap);var i=Tf[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=(Ka.get(p)||0)+1,x=(i.get(p)||0)+1;Ka.set(p,y),i.set(p,x),s.push(p),y===1&&b&&Df.set(p,!0),x===1&&p.setAttribute(n,"true"),b||p.setAttribute(r,"true")}})};return d(t),a.clear(),av++,function(){s.forEach(function(h){var p=Ka.get(h)-1,g=i.get(h)-1;Ka.set(h,p),i.set(h,g),p||(Df.has(h)||h.removeAttribute(r),Df.delete(h)),g||h.removeAttribute(n)}),av--,av||(Ka=new WeakMap,Ka=new WeakMap,Df=new WeakMap,Tf={})}},Pp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||nQ(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),oQ(r,o,n,"aria-hidden")):function(){return null}},mo=function(){return mo=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},mo.apply(this,arguments)};function XO(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 iQ(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 Jf="right-scroll-bar-position",eh="width-before-scroll-bar",sQ="with-scroll-bars-hidden",aQ="--removed-body-scroll-bar-size";function lQ(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function cQ(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 uQ(e,t){return cQ(t||null,function(n){return e.forEach(function(r){return lQ(r,n)})})}function dQ(e){return e}function fQ(e,t){t===void 0&&(t=dQ);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 hQ(e){e===void 0&&(e={});var t=fQ(null);return t.options=mo({async:!0,ssr:!1},e),t}var QO=function(e){var t=e.sideCar,n=XO(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 ae.createElement(r,mo({},n))};QO.isSideCarExport=!0;function pQ(e,t){return e.useMedium(t),QO}var ZO=hQ(),lv=function(){},Op=ae.forwardRef(function(e,t){var n=ae.useRef(null),r=ae.useState({onScrollCapture:lv,onWheelCapture:lv,onTouchMoveCapture:lv}),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,w=x===void 0?"div":x,_=XO(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),C=p,R=uQ([n,t]),E=mo(mo({},_),o);return ae.createElement(ae.Fragment,null,d&&ae.createElement(C,{sideCar:ZO,removeScrollBar:u,shards:h,noIsolation:g,inert:b,setCallbacks:i,allowPinchZoom:!!y,lockRef:n}),s?ae.cloneElement(ae.Children.only(a),mo(mo({},E),{ref:R})):ae.createElement(w,mo({},E,{className:l,ref:R}),a))});Op.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Op.classNames={fullWidth:eh,zeroRight:Jf};var qC,gQ=function(){if(qC)return qC;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mQ(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=gQ();return t&&e.setAttribute("nonce",t),e}function vQ(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function bQ(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var yQ=function(){var e=0,t=null;return{add:function(n){e==0&&(t=mQ())&&(vQ(t,n),bQ(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},xQ=function(){var e=yQ();return function(t,n){ae.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},JO=function(){var e=xQ(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},wQ={left:0,top:0,right:0,gap:0},cv=function(e){return parseInt(e||"",10)||0},_Q=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[cv(n),cv(r),cv(o)]},SQ=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return wQ;var t=_Q(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])}},CQ=JO(),EQ=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(sQ,` {
|
|
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(Jf,` {
|
|
329
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.`).concat(eh,` {
|
|
333
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.`).concat(Jf," .").concat(Jf,` {
|
|
337
|
+
right: 0 `).concat(r,`;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.`).concat(eh," .").concat(eh,` {
|
|
341
|
+
margin-right: 0 `).concat(r,`;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
body {
|
|
345
|
+
`).concat(aQ,": ").concat(a,`px;
|
|
346
|
+
}
|
|
347
|
+
`)},RQ=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r,i=ae.useMemo(function(){return SQ(o)},[o]);return ae.createElement(CQ,{styles:EQ(i,!t,o,n?"":"!important")})},kb=!1;if(typeof window<"u")try{var Af=Object.defineProperty({},"passive",{get:function(){return kb=!0,!0}});window.addEventListener("test",Af,Af),window.removeEventListener("test",Af,Af)}catch{kb=!1}var Xa=kb?{passive:!1}:!1,$Q=function(e){return e.tagName==="TEXTAREA"},e2=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!$Q(e)&&n[t]==="visible")},PQ=function(e){return e2(e,"overflowY")},OQ=function(e){return e2(e,"overflowX")},GC=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=t2(e,n);if(r){var o=n2(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},MQ=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},DQ=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},t2=function(e,t){return e==="v"?PQ(t):OQ(t)},n2=function(e,t){return e==="v"?MQ(t):DQ(t)},TQ=function(e,t){return e==="h"&&t==="rtl"?-1:1},AQ=function(e,t,n,r,o){var i=TQ(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=n2(e,a),b=g[0],y=g[1],x=g[2],w=y-x-i*b;(b||w)&&t2(e,a)&&(h+=w,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},If=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},YC=function(e){return[e.deltaX,e.deltaY]},KC=function(e){return e&&"current"in e?e.current:e},IQ=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kQ=function(e){return`
|
|
348
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
349
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
350
|
+
`)},NQ=0,Qa=[];function LQ(e){var t=ae.useRef([]),n=ae.useRef([0,0]),r=ae.useRef(),o=ae.useState(NQ++)[0],i=ae.useState(function(){return JO()})[0],s=ae.useRef(e);ae.useEffect(function(){s.current=e},[e]),ae.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var y=iQ([e.lockRef.current],(e.shards||[]).map(KC),!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=ae.useCallback(function(y,x){if("touches"in y&&y.touches.length===2)return!s.current.allowPinchZoom;var w=If(y),_=n.current,C="deltaX"in y?y.deltaX:_[0]-w[0],R="deltaY"in y?y.deltaY:_[1]-w[1],E,D=y.target,O=Math.abs(C)>Math.abs(R)?"h":"v";if("touches"in y&&O==="h"&&D.type==="range")return!1;var T=GC(O,D);if(!T)return!0;if(T?E=O:(E=O==="v"?"h":"v",T=GC(O,D)),!T)return!1;if(!r.current&&"changedTouches"in y&&(C||R)&&(r.current=E),!E)return!0;var I=r.current||E;return AQ(I,x,y,I==="h"?C:R,!0)},[]),l=ae.useCallback(function(y){var x=y;if(!(!Qa.length||Qa[Qa.length-1]!==i)){var w="deltaY"in x?YC(x):If(x),_=t.current.filter(function(E){return E.name===x.type&&E.target===x.target&&IQ(E.delta,w)})[0];if(_&&_.should){x.cancelable&&x.preventDefault();return}if(!_){var C=(s.current.shards||[]).map(KC).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=ae.useCallback(function(y,x,w,_){var C={name:y,delta:x,target:w,should:_};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(R){return R!==C})},1)},[]),d=ae.useCallback(function(y){n.current=If(y),r.current=void 0},[]),h=ae.useCallback(function(y){u(y.type,YC(y),y.target,a(y,e.lockRef.current))},[]),p=ae.useCallback(function(y){u(y.type,If(y),y.target,a(y,e.lockRef.current))},[]);ae.useEffect(function(){return Qa.push(i),e.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Xa),document.addEventListener("touchmove",l,Xa),document.addEventListener("touchstart",d,Xa),function(){Qa=Qa.filter(function(y){return y!==i}),document.removeEventListener("wheel",l,Xa),document.removeEventListener("touchmove",l,Xa),document.removeEventListener("touchstart",d,Xa)}},[]);var g=e.removeScrollBar,b=e.inert;return ae.createElement(ae.Fragment,null,b?ae.createElement(i,{styles:kQ(o)}):null,g?ae.createElement(RQ,{gapMode:"margin"}):null)}const FQ=pQ(ZO,LQ);var r2=ae.forwardRef(function(e,t){return ae.createElement(Op,mo({},e,{ref:t,sideCar:FQ}))});r2.classNames=Op.classNames;const Mp=r2,o2="Popover",[i2,uoe]=fn(o2,[Po]),Vy=Po(),[zQ,ql]=i2(o2),jQ=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=Vy(t),l=m.useRef(null),[u,d]=m.useState(!1),[h=!1,p]=Mn({prop:r,defaultProp:o,onChange:i});return m.createElement(Yu,a,m.createElement(zQ,{scope:t,contentId:Kn(),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))},VQ="PopoverTrigger",HQ=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ql(VQ,n),i=Vy(n),s=Xe(t,o.triggerRef),a=m.createElement(Le.button,ne({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":l2(o.open)},r,{ref:s,onClick:we(e.onClick,o.onOpenToggle)}));return o.hasCustomAnchor?a:m.createElement(Ku,ne({asChild:!0},i),a)}),s2="PopoverPortal",[WQ,BQ]=i2(s2,{forceMount:void 0}),UQ=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=ql(s2,t);return m.createElement(WQ,{scope:t,forceMount:n},m.createElement(Jt,{present:n||i.open},m.createElement(vp,{asChild:!0,container:o},r)))},yu="PopoverContent",qQ=m.forwardRef((e,t)=>{const n=BQ(yu,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=ql(yu,e.__scopePopover);return m.createElement(Jt,{present:r||i.open},i.modal?m.createElement(GQ,ne({},o,{ref:t})):m.createElement(YQ,ne({},o,{ref:t})))}),GQ=m.forwardRef((e,t)=>{const n=ql(yu,e.__scopePopover),r=m.useRef(null),o=Xe(t,r),i=m.useRef(!1);return m.useEffect(()=>{const s=r.current;if(s)return Pp(s)},[]),m.createElement(Mp,{as:ri,allowPinchZoom:!0},m.createElement(a2,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})})))}),YQ=m.forwardRef((e,t)=>{const n=ql(yu,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(a2,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()}}))}),a2=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=ql(yu,n),g=Vy(n);return Rp(),m.createElement($p,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(Wl,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>p.onOpenChange(!1)},m.createElement(Xu,ne({"data-state":l2(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 l2(e){return e?"open":"closed"}const KQ=jQ,XQ=HQ,QQ=UQ,c2=qQ,Hy=KQ,Wy=XQ,Dp=ae.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>k.jsx(QQ,{children:k.jsx(c2,{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})}));Dp.displayName=c2.displayName;function ZQ({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}=ha(),d=Ee(C=>C.actions.addOrUpdateFilterValue),h=Ee(C=>C.actions.removeFilterValue),{data:p,isLoading:g,isFetching:b,isError:y,refetch:x}=go({queryKey:[e.sql],queryFn:()=>jh("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 w(){h(e.id),i(s),r(!1)}function _(){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:Th(e),name:e.column,operation:"between",values:C};d(R),r(!1)}return g?k.jsx("div",{children:k.jsx(Zb,{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(Hy,{open:n,onOpenChange:r,children:[k.jsx(Wy,{asChild:!0,children:k.jsxs(ea,{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(zP,{className:"mr-2 h-4 w-4"}),o!=null&&o.from?o.to?k.jsxs(k.Fragment,{children:[xo(o.from,"LLL dd, y")," -"," ",xo(o.to,"LLL dd, y")]}):xo(o.from,"LLL dd, y"):k.jsx("span",{children:"Pick a date"})]})}),k.jsxs(Dp,{className:"w-auto p-0",align:"start",children:[k.jsx(GO,{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(ea,{size:"sm",variant:"outline",onClick:_,children:"Apply"}),k.jsx(ea,{size:"sm",variant:"outline",onClick:w,children:"Clear"})]})]})]})}):null}const By=ae.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}));By.displayName="Textarea";const Nb="horizontal",JQ=["horizontal","vertical"],u2=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=Nb,...o}=e,i=d2(r)?r:Nb,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return m.createElement(Le.div,ne({"data-orientation":i},a,o,{ref:t}))});u2.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!d2(r)?new Error(eZ(o,n)):null}};function eZ(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
|
|
351
|
+
- horizontal
|
|
352
|
+
- vertical
|
|
353
|
+
|
|
354
|
+
Defaulting to \`${Nb}\`.`}function d2(e){return JQ.includes(e)}const f2=u2,Uy=ae.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>k.jsx(f2,{ref:o,decorative:n,orientation:t,className:Se("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Uy.displayName=f2.displayName;function Lb(e,[t,n]){return Math.min(n,Math.max(t,e))}function Tp(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 tZ=[" ","Enter","ArrowUp","ArrowDown"],nZ=[" ","Enter"],Ap="Select",[Ip,kp,rZ]=Gh(Ap),[Gl,doe]=fn(Ap,[rZ,Po]),qy=Po(),[oZ,wa]=Gl(Ap),[iZ,sZ]=Gl(Ap),aZ=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=qy(t),[y,x]=m.useState(null),[w,_]=m.useState(null),[C,R]=m.useState(!1),E=ga(u),[D=!1,O]=Mn({prop:r,defaultProp:o,onChange:i}),[T,I]=Mn({prop:s,defaultProp:a,onChange:l}),N=m.useRef(null),W=y?!!y.closest("form"):!0,[Y,ue]=m.useState(new Set),J=Array.from(Y).map(F=>F.props.value).join(";");return m.createElement(Yu,b,m.createElement(oZ,{required:g,scope:t,trigger:y,onTriggerChange:x,valueNode:w,onValueNodeChange:_,valueNodeHasChildren:C,onValueNodeHasChildrenChange:R,contentId:Kn(),value:T,onValueChange:I,open:D,onOpenChange:O,dir:E,triggerPointerDownPosRef:N,disabled:p},m.createElement(Ip.Provider,{scope:t},m.createElement(iZ,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(F=>{ue(Z=>new Set(Z).add(F))},[]),onNativeOptionRemove:m.useCallback(F=>{ue(Z=>{const q=new Set(Z);return q.delete(F),q})},[])},n)),W?m.createElement(v2,{key:J,"aria-hidden":!0,required:g,tabIndex:-1,name:d,autoComplete:h,value:T,onChange:F=>I(F.target.value),disabled:p},T===void 0?m.createElement("option",{value:""}):null,Array.from(Y)):null))},lZ="SelectTrigger",cZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=qy(n),s=wa(lZ,n),a=s.disabled||r,l=Xe(t,s.onTriggerChange),u=kp(n),[d,h,p]=b2(b=>{const y=u().filter(_=>!_.disabled),x=y.find(_=>_.value===s.value),w=y2(y,b,x);w!==void 0&&s.onValueChange(w.value)}),g=()=>{a||(s.onOpenChange(!0),p())};return m.createElement(Ku,ne({asChild:!0},i),m.createElement(Le.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":m2(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===" ")&&tZ.includes(b.key)&&(g(),b.preventDefault())})})))}),uZ="SelectValue",dZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=wa(uZ,n),{onValueNodeHasChildrenChange:u}=l,d=i!==void 0,h=Xe(t,l.onValueNodeChange);return On(()=>{u(d)},[u,d]),m.createElement(Le.span,ne({},a,{ref:h,style:{pointerEvents:"none"}}),m2(l.value)?m.createElement(m.Fragment,null,s):i)}),fZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.createElement(Le.span,ne({"aria-hidden":!0},o,{ref:t}),r||"▼")}),hZ=e=>m.createElement(vp,ne({asChild:!0},e)),Fl="SelectContent",pZ=m.forwardRef((e,t)=>{const n=wa(Fl,e.__scopeSelect),[r,o]=m.useState();if(On(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Co.createPortal(m.createElement(h2,{scope:e.__scopeSelect},m.createElement(Ip.Slot,{scope:e.__scopeSelect},m.createElement("div",null,e.children))),i):null}return m.createElement(gZ,ne({},e,{ref:t}))}),Ko=10,[h2,_a]=Gl(Fl),gZ=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,...w}=e,_=wa(Fl,n),[C,R]=m.useState(null),[E,D]=m.useState(null),O=Xe(t,de=>R(de)),[T,I]=m.useState(null),[N,W]=m.useState(null),Y=kp(n),[ue,J]=m.useState(!1),F=m.useRef(!1);m.useEffect(()=>{if(C)return Pp(C)},[C]),Rp();const Z=m.useCallback(de=>{const[ee,...K]=Y().map(Q=>Q.ref.current),[re]=K.slice(-1),be=document.activeElement;for(const Q of de)if(Q===be||(Q==null||Q.scrollIntoView({block:"nearest"}),Q===ee&&E&&(E.scrollTop=0),Q===re&&E&&(E.scrollTop=E.scrollHeight),Q==null||Q.focus(),document.activeElement!==be))return},[Y,E]),q=m.useCallback(()=>Z([T,C]),[Z,T,C]);m.useEffect(()=>{ue&&q()},[ue,q]);const{onOpenChange:X,triggerPointerDownPosRef:ie}=_;m.useEffect(()=>{if(C){let de={x:0,y:0};const ee=re=>{var be,Q,Oe,Ie;de={x:Math.abs(Math.round(re.pageX)-((be=(Q=ie.current)===null||Q===void 0?void 0:Q.x)!==null&&be!==void 0?be:0)),y:Math.abs(Math.round(re.pageY)-((Oe=(Ie=ie.current)===null||Ie===void 0?void 0:Ie.y)!==null&&Oe!==void 0?Oe:0))}},K=re=>{de.x<=10&&de.y<=10?re.preventDefault():C.contains(re.target)||X(!1),document.removeEventListener("pointermove",ee),ie.current=null};return ie.current!==null&&(document.addEventListener("pointermove",ee),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ee),document.removeEventListener("pointerup",K,{capture:!0})}}},[C,X,ie]),m.useEffect(()=>{const de=()=>X(!1);return window.addEventListener("blur",de),window.addEventListener("resize",de),()=>{window.removeEventListener("blur",de),window.removeEventListener("resize",de)}},[X]);const[j,V]=b2(de=>{const ee=Y().filter(be=>!be.disabled),K=ee.find(be=>be.ref.current===document.activeElement),re=y2(ee,de,K);re&&setTimeout(()=>re.ref.current.focus())}),te=m.useCallback((de,ee,K)=>{const re=!F.current&&!K;(_.value!==void 0&&_.value===ee||re)&&(I(de),re&&(F.current=!0))},[_.value]),le=m.useCallback(()=>C==null?void 0:C.focus(),[C]),ce=m.useCallback((de,ee,K)=>{const re=!F.current&&!K;(_.value!==void 0&&_.value===ee||re)&&W(de)},[_.value]),ge=r==="popper"?XC:mZ,ve=ge===XC?{side:a,sideOffset:l,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:p,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:x}:{};return m.createElement(h2,{scope:n,content:C,viewport:E,onViewportChange:D,itemRefCallback:te,selectedItem:T,onItemLeave:le,itemTextRefCallback:ce,focusSelectedItem:q,selectedItemText:N,position:r,isPositioned:ue,searchRef:j},m.createElement(Mp,{as:ri,allowPinchZoom:!0},m.createElement($p,{asChild:!0,trapped:_.open,onMountAutoFocus:de=>{de.preventDefault()},onUnmountAutoFocus:we(o,de=>{var ee;(ee=_.trigger)===null||ee===void 0||ee.focus({preventScroll:!0}),de.preventDefault()})},m.createElement(Wl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:de=>de.preventDefault(),onDismiss:()=>_.onOpenChange(!1)},m.createElement(ge,ne({role:"listbox",id:_.contentId,"data-state":_.open?"open":"closed",dir:_.dir,onContextMenu:de=>de.preventDefault()},w,ve,{onPlaced:()=>J(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:we(w.onKeyDown,de=>{const ee=de.ctrlKey||de.altKey||de.metaKey;if(de.key==="Tab"&&de.preventDefault(),!ee&&de.key.length===1&&V(de.key),["ArrowUp","ArrowDown","Home","End"].includes(de.key)){let re=Y().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,Q=re.indexOf(be);re=re.slice(Q+1)}setTimeout(()=>Z(re)),de.preventDefault()}})}))))))}),mZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=wa(Fl,n),s=_a(Fl,n),[a,l]=m.useState(null),[u,d]=m.useState(null),h=Xe(t,O=>d(O)),p=kp(n),g=m.useRef(!1),b=m.useRef(!0),{viewport:y,selectedItem:x,selectedItemText:w,focusSelectedItem:_}=s,C=m.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&u&&y&&x&&w){const O=i.trigger.getBoundingClientRect(),T=u.getBoundingClientRect(),I=i.valueNode.getBoundingClientRect(),N=w.getBoundingClientRect();if(i.dir!=="rtl"){const be=N.left-T.left,Q=I.left-be,Oe=O.left-Q,Ie=O.width+Oe,ze=Math.max(Ie,T.width),_e=window.innerWidth-Ko,pt=Lb(Q,[Ko,_e-ze]);a.style.minWidth=Ie+"px",a.style.left=pt+"px"}else{const be=T.right-N.right,Q=window.innerWidth-I.right-be,Oe=window.innerWidth-O.right-Q,Ie=O.width+Oe,ze=Math.max(Ie,T.width),_e=window.innerWidth-Ko,pt=Lb(Q,[Ko,_e-ze]);a.style.minWidth=Ie+"px",a.style.right=pt+"px"}const W=p(),Y=window.innerHeight-Ko*2,ue=y.scrollHeight,J=window.getComputedStyle(u),F=parseInt(J.borderTopWidth,10),Z=parseInt(J.paddingTop,10),q=parseInt(J.borderBottomWidth,10),X=parseInt(J.paddingBottom,10),ie=F+Z+ue+X+q,j=Math.min(x.offsetHeight*5,ie),V=window.getComputedStyle(y),te=parseInt(V.paddingTop,10),le=parseInt(V.paddingBottom,10),ce=O.top+O.height/2-Ko,ge=Y-ce,ve=x.offsetHeight/2,de=x.offsetTop+ve,ee=F+Z+de,K=ie-ee;if(ee<=ce){const be=x===W[W.length-1].ref.current;a.style.bottom="0px";const Q=u.clientHeight-y.offsetTop-y.offsetHeight,Oe=Math.max(ge,ve+(be?le:0)+Q+q),Ie=ee+Oe;a.style.height=Ie+"px"}else{const be=x===W[0].ref.current;a.style.top="0px";const Oe=Math.max(ce,F+y.offsetTop+(be?te:0)+ve)+K;a.style.height=Oe+"px",y.scrollTop=ee-ce+y.offsetTop}a.style.margin=`${Ko}px 0`,a.style.minHeight=j+"px",a.style.maxHeight=Y+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[p,i.trigger,i.valueNode,a,u,y,x,w,i.dir,r]);On(()=>C(),[C]);const[R,E]=m.useState();On(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const D=m.useCallback(O=>{O&&b.current===!0&&(C(),_==null||_(),b.current=!1)},[C,_]);return m.createElement(vZ,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:D},m.createElement("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R}},m.createElement(Le.div,ne({},o,{ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}}))))}),XC=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Ko,...i}=e,s=qy(n);return m.createElement(Xu,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)"}}))}),[vZ,Gy]=Gl(Fl,{}),QC="SelectViewport",bZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=_a(QC,n),i=Gy(QC,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(Ip.Slot,{scope:n},m.createElement(Le.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-Ko*2,b=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),x=Math.max(b,y);if(x<g){const w=x+p,_=Math.min(g,w),C=w-_;d.style.height=_+"px",d.style.bottom==="0px"&&(u.scrollTop=C>0?C:0,d.style.justifyContent="flex-end")}}}a.current=u.scrollTop})}))))}),yZ="SelectGroup",[xZ,wZ]=Gl(yZ),_Z=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Kn();return m.createElement(xZ,{scope:n,id:o},m.createElement(Le.div,ne({role:"group","aria-labelledby":o},r,{ref:t})))}),SZ="SelectLabel",CZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=wZ(SZ,n);return m.createElement(Le.div,ne({id:o.id},r,{ref:t}))}),Fb="SelectItem",[EZ,p2]=Gl(Fb),RZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=wa(Fb,n),l=_a(Fb,n),u=a.value===r,[d,h]=m.useState(i??""),[p,g]=m.useState(!1),b=Xe(t,w=>{var _;return(_=l.itemRefCallback)===null||_===void 0?void 0:_.call(l,w,r,o)}),y=Kn(),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(EZ,{scope:n,value:r,disabled:o,textId:y,isSelected:u,onItemTextChange:m.useCallback(w=>{h(_=>{var C;return _||((C=w==null?void 0:w.textContent)!==null&&C!==void 0?C:"").trim()})},[])},m.createElement(Ip.ItemSlot,{scope:n,value:r,disabled:o,textValue:d},m.createElement(Le.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,w=>{if(o){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}else w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:we(s.onPointerLeave,w=>{if(w.currentTarget===document.activeElement){var _;(_=l.onItemLeave)===null||_===void 0||_.call(l)}}),onKeyDown:we(s.onKeyDown,w=>{var _;((_=l.searchRef)===null||_===void 0?void 0:_.current)!==""&&w.key===" "||(nZ.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})}))))}),kf="SelectItemText",$Z=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=wa(kf,n),a=_a(kf,n),l=p2(kf,n),u=sZ(kf,n),[d,h]=m.useState(null),p=Xe(t,w=>h(w),l.onItemTextChange,w=>{var _;return(_=a.itemTextRefCallback)===null||_===void 0?void 0:_.call(a,w,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 On(()=>(y(b),()=>x(b)),[y,x,b]),m.createElement(m.Fragment,null,m.createElement(Le.span,ne({id:l.textId},i,{ref:p})),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Co.createPortal(i.children,s.valueNode):null)}),PZ="SelectItemIndicator",OZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p2(PZ,n).isSelected?m.createElement(Le.span,ne({"aria-hidden":!0},r,{ref:t})):null}),ZC="SelectScrollUpButton",MZ=m.forwardRef((e,t)=>{const n=_a(ZC,e.__scopeSelect),r=Gy(ZC,e.__scopeSelect),[o,i]=m.useState(!1),s=Xe(t,r.onScrollButtonChange);return On(()=>{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(g2,ne({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}})):null}),JC="SelectScrollDownButton",DZ=m.forwardRef((e,t)=>{const n=_a(JC,e.__scopeSelect),r=Gy(JC,e.__scopeSelect),[o,i]=m.useState(!1),s=Xe(t,r.onScrollButtonChange);return On(()=>{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(g2,ne({},e,{ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}})):null}),g2=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=_a("SelectScrollButton",n),s=m.useRef(null),a=kp(n),l=m.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return m.useEffect(()=>()=>l(),[l]),On(()=>{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(Le.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()})}))}),TZ=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.createElement(Le.div,ne({"aria-hidden":!0},r,{ref:t}))});function m2(e){return e===""||e===void 0}const v2=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=m.useRef(null),i=Xe(t,o),s=Tp(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(TP,{asChild:!0},m.createElement("select",ne({},r,{ref:i,defaultValue:n})))});v2.displayName="BubbleSelect";function b2(e){const t=sn(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 y2(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=AZ(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 AZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const IZ=aZ,x2=cZ,kZ=dZ,NZ=fZ,LZ=hZ,w2=pZ,FZ=bZ,zZ=_Z,_2=CZ,S2=RZ,jZ=$Z,VZ=OZ,C2=MZ,E2=DZ,R2=TZ,$2=IZ,HZ=zZ,P2=kZ,Yy=ae.forwardRef(({className:e,children:t,...n},r)=>k.jsxs(x2,{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(NZ,{asChild:!0,children:k.jsx(xp,{className:"h-4 w-4 opacity-50"})})]}));Yy.displayName=x2.displayName;const O2=ae.forwardRef(({className:e,...t},n)=>k.jsx(C2,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:k.jsx(QB,{className:"h-4 w-4"})}));O2.displayName=C2.displayName;const M2=ae.forwardRef(({className:e,...t},n)=>k.jsx(E2,{ref:n,className:Se("flex cursor-default items-center justify-center py-1",e),...t,children:k.jsx(xp,{className:"h-4 w-4"})}));M2.displayName=E2.displayName;const Ky=ae.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>k.jsx(LZ,{children:k.jsxs(w2,{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(O2,{}),k.jsx(FZ,{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(M2,{})]})}));Ky.displayName=w2.displayName;const D2=ae.forwardRef(({className:e,...t},n)=>k.jsx(_2,{ref:n,className:Se("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));D2.displayName=_2.displayName;const Jc=ae.forwardRef(({className:e,children:t,...n},r)=>k.jsxs(S2,{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(VZ,{children:k.jsx(Qu,{className:"h-4 w-4"})})}),k.jsx(jZ,{children:t})]}));Jc.displayName=S2.displayName;const T2=ae.forwardRef(({className:e,...t},n)=>k.jsx(R2,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));T2.displayName=R2.displayName;function WZ({filter:e}){const[t,n]=m.useState(e.sql),[r,o]=m.useState(!1),{updateFilter:i}=pa();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(Hy,{open:r,onOpenChange:o,children:[k.jsx(Wy,{children:k.jsx(HP,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),k.jsxs(Dp,{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(Uy,{}),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(Qo,{children:"Table Column"}),k.jsx(Qo,{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(Qo,{children:"Data Type"}),k.jsx(Qo,{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(Qo,{className:"text-sm",children:"Filter Operation"}),k.jsx(BZ,{updateFilterOperation:a,value:e.operation})]})]}),k.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[k.jsx(Qo,{className:"text-sm",children:"Values SQL"}),k.jsx(By,{value:t,onChange:l=>n(l.target.value),className:`min-w-full grow resize font-mono text-xs ${BN}`})]}),k.jsx("div",{className:"flex justify-end gap-2",children:k.jsxs(ea,{onClick:s,size:"sm",variant:"outline",children:[k.jsx(Qu,{className:"mr-2 size-4"}),"Apply"]})})]})]})}function BZ({value:e,updateFilterOperation:t}){return k.jsxs($2,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[k.jsx(Yy,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:k.jsx(P2,{placeholder:"Operation"})}),k.jsxs(Ky,{children:[k.jsx(Jc,{value:"=",children:"Equals"}),k.jsx(Jc,{value:"in",children:"Contains"}),k.jsx(Jc,{value:"like",children:"Like"})]})]})}function UZ(){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=>td.includes(s.dataType)?k.jsx(ZQ,{filter:s}):k.jsx(iY,{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(sa,{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(Qo,{className:"inline-block text-sm",children:s.title}),t&&k.jsx(WZ,{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(JB,{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 A2(){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(vR,{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(UZ,{}),e==null?void 0:e.map(o=>k.jsx(r0,{className:"mt-0",value:o.id,children:k.jsx(_q,{})},o.id))]}):null}function I2({children:e}){return k.jsx(l9,{defaultTheme:"system",storageKey:"vite-ui-theme",children:k.jsx(qB,{delayDuration:0,children:e})})}function k2(e){return k.jsx(tR,{dashboardProps:e,children:k.jsx(I2,{children:k.jsx(iR,{...e,children:k.jsx(A2,{})})})})}const zb=["Enter"," "],qZ=["ArrowDown","PageUp","Home"],N2=["ArrowUp","PageDown","End"],GZ=[...qZ,...N2],YZ={ltr:[...zb,"ArrowRight"],rtl:[...zb,"ArrowLeft"]},KZ={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Np="Menu",[xu,XZ,QZ]=Gh(Np),[Sa,L2]=fn(Np,[QZ,Po,Hl]),Xy=Po(),F2=Hl(),[ZZ,Ca]=Sa(Np),[JZ,sd]=Sa(Np),eJ=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=Xy(t),[l,u]=m.useState(null),d=m.useRef(!1),h=sn(i),p=ga(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(Yu,a,m.createElement(ZZ,{scope:t,open:n,onOpenChange:h,content:l,onContentChange:u},m.createElement(JZ,{scope:t,onClose:m.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:p,modal:s},r)))},z2=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Xy(n);return m.createElement(Ku,ne({},o,r,{ref:t}))}),j2="MenuPortal",[tJ,V2]=Sa(j2,{forceMount:void 0}),nJ=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Ca(j2,t);return m.createElement(tJ,{scope:t,forceMount:n},m.createElement(Jt,{present:n||i.open},m.createElement(vp,{asChild:!0,container:o},r)))},Zr="MenuContent",[rJ,Qy]=Sa(Zr),oJ=m.forwardRef((e,t)=>{const n=V2(Zr,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Ca(Zr,e.__scopeMenu),s=sd(Zr,e.__scopeMenu);return m.createElement(xu.Provider,{scope:e.__scopeMenu},m.createElement(Jt,{present:r||i.open},m.createElement(xu.Slot,{scope:e.__scopeMenu},s.modal?m.createElement(iJ,ne({},o,{ref:t})):m.createElement(sJ,ne({},o,{ref:t})))))}),iJ=m.forwardRef((e,t)=>{const n=Ca(Zr,e.__scopeMenu),r=m.useRef(null),o=Xe(t,r);return m.useEffect(()=>{const i=r.current;if(i)return Pp(i)},[]),m.createElement(Zy,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)}))}),sJ=m.forwardRef((e,t)=>{const n=Ca(Zr,e.__scopeMenu);return m.createElement(Zy,ne({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)}))}),Zy=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=Ca(Zr,n),w=sd(Zr,n),_=Xy(n),C=F2(n),R=XZ(n),[E,D]=m.useState(null),O=m.useRef(null),T=Xe(t,O,x.onContentChange),I=m.useRef(0),N=m.useRef(""),W=m.useRef(0),Y=m.useRef(null),ue=m.useRef("right"),J=m.useRef(0),F=b?Mp:m.Fragment,Z=b?{as:ri,allowPinchZoom:!0}:void 0,q=ie=>{var j,V;const te=N.current+ie,le=R().filter(K=>!K.disabled),ce=document.activeElement,ge=(j=le.find(K=>K.ref.current===ce))===null||j===void 0?void 0:j.textValue,ve=le.map(K=>K.textValue),de=EJ(ve,te,ge),ee=(V=le.find(K=>K.textValue===de))===null||V===void 0?void 0:V.ref.current;(function K(re){N.current=re,window.clearTimeout(I.current),re!==""&&(I.current=window.setTimeout(()=>K(""),1e3))})(te),ee&&setTimeout(()=>ee.focus())};m.useEffect(()=>()=>window.clearTimeout(I.current),[]),Rp();const X=m.useCallback(ie=>{var j,V;return ue.current===((j=Y.current)===null||j===void 0?void 0:j.side)&&$J(ie,(V=Y.current)===null||V===void 0?void 0:V.area)},[]);return m.createElement(rJ,{scope:n,searchRef:N,onItemEnter:m.useCallback(ie=>{X(ie)&&ie.preventDefault()},[X]),onItemLeave:m.useCallback(ie=>{var j;X(ie)||((j=O.current)===null||j===void 0||j.focus(),D(null))},[X]),onTriggerLeave:m.useCallback(ie=>{X(ie)&&ie.preventDefault()},[X]),pointerGraceTimerRef:W,onPointerGraceIntentChange:m.useCallback(ie=>{Y.current=ie},[])},m.createElement(F,Z,m.createElement($p,{asChild:!0,trapped:o,onMountAutoFocus:we(i,ie=>{var j;ie.preventDefault(),(j=O.current)===null||j===void 0||j.focus()}),onUnmountAutoFocus:s},m.createElement(Wl,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,onDismiss:g},m.createElement(e0,ne({asChild:!0},C,{dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:D,onEntryFocus:we(l,ie=>{w.isUsingKeyboardRef.current||ie.preventDefault()})}),m.createElement(Xu,ne({role:"menu","aria-orientation":"vertical","data-state":q2(x.open),"data-radix-menu-content":"",dir:w.dir},_,y,{ref:T,style:{outline:"none",...y.style},onKeyDown:we(y.onKeyDown,ie=>{const V=ie.target.closest("[data-radix-menu-content]")===ie.currentTarget,te=ie.ctrlKey||ie.altKey||ie.metaKey,le=ie.key.length===1;V&&(ie.key==="Tab"&&ie.preventDefault(),!te&&le&&q(ie.key));const ce=O.current;if(ie.target!==ce||!GZ.includes(ie.key))return;ie.preventDefault();const ve=R().filter(de=>!de.disabled).map(de=>de.ref.current);N2.includes(ie.key)&&ve.reverse(),SJ(ve)}),onBlur:we(e.onBlur,ie=>{ie.currentTarget.contains(ie.target)||(window.clearTimeout(I.current),N.current="")}),onPointerMove:we(e.onPointerMove,wu(ie=>{const j=ie.target,V=J.current!==ie.clientX;if(ie.currentTarget.contains(j)&&V){const te=ie.clientX>J.current?"right":"left";ue.current=te,J.current=ie.clientX}}))})))))))}),aJ=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Le.div,ne({role:"group"},r,{ref:t}))}),lJ=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Le.div,ne({},r,{ref:t}))}),jb="MenuItem",eE="menu.itemSelect",Jy=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=m.useRef(null),s=sd(jb,e.__scopeMenu),a=Qy(jb,e.__scopeMenu),l=Xe(t,i),u=m.useRef(!1),d=()=>{const h=i.current;if(!n&&h){const p=new CustomEvent(eE,{bubbles:!0,cancelable:!0});h.addEventListener(eE,g=>r==null?void 0:r(g),{once:!0}),aR(h,p),p.defaultPrevented?u.current=!1:s.onClose()}};return m.createElement(H2,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===" "||zb.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})}))}),H2=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=Qy(jb,n),a=F2(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(xu.ItemSlot,{scope:n,disabled:r,textValue:o??p},m.createElement(t0,ne({asChild:!0},a,{focusable:!r}),m.createElement(Le.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,wu(b=>{r?s.onItemLeave(b):(s.onItemEnter(b),b.defaultPrevented||b.currentTarget.focus())})),onPointerLeave:we(e.onPointerLeave,wu(b=>s.onItemLeave(b))),onFocus:we(e.onFocus,()=>h(!0)),onBlur:we(e.onBlur,()=>h(!1))}))))}),cJ=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return m.createElement(B2,{scope:e.__scopeMenu,checked:n},m.createElement(Jy,ne({role:"menuitemcheckbox","aria-checked":kh(n)?"mixed":n},o,{ref:t,"data-state":ex(n),onSelect:we(o.onSelect,()=>r==null?void 0:r(kh(n)?!0:!n),{checkForDefaultPrevented:!1})})))}),uJ="MenuRadioGroup",[dJ,fJ]=Sa(uJ,{value:void 0,onValueChange:()=>{}}),hJ=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=sn(r);return m.createElement(dJ,{scope:e.__scopeMenu,value:n,onValueChange:i},m.createElement(aJ,ne({},o,{ref:t})))}),pJ="MenuRadioItem",gJ=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=fJ(pJ,e.__scopeMenu),i=n===o.value;return m.createElement(B2,{scope:e.__scopeMenu,checked:i},m.createElement(Jy,ne({role:"menuitemradio","aria-checked":i},r,{ref:t,"data-state":ex(i),onSelect:we(r.onSelect,()=>{var s;return(s=o.onValueChange)===null||s===void 0?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})))}),W2="MenuItemIndicator",[B2,mJ]=Sa(W2,{checked:!1}),vJ=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=mJ(W2,n);return m.createElement(Jt,{present:r||kh(i.checked)||i.checked===!0},m.createElement(Le.span,ne({},o,{ref:t,"data-state":ex(i.checked)})))}),bJ=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return m.createElement(Le.div,ne({role:"separator","aria-orientation":"horizontal"},r,{ref:t}))}),yJ="MenuSub",[foe,U2]=Sa(yJ),Nf="MenuSubTrigger",xJ=m.forwardRef((e,t)=>{const n=Ca(Nf,e.__scopeMenu),r=sd(Nf,e.__scopeMenu),o=U2(Nf,e.__scopeMenu),i=Qy(Nf,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(z2,ne({asChild:!0},u),m.createElement(H2,ne({id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":q2(n.open)},e,{ref:qh(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,wu(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,wu(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",w=x?-5:5,_=g[x?"left":"right"],C=g[x?"right":"left"];i.onPointerGraceIntentChange({area:[{x:h.clientX+w,y:h.clientY},{x:_,y:g.top},{x:C,y:g.top},{x:C,y:g.bottom},{x:_,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===" ")&&YZ[r.dir].includes(h.key)){var g;n.onOpenChange(!0),(g=n.content)===null||g===void 0||g.focus(),h.preventDefault()}})})))}),wJ="MenuSubContent",_J=m.forwardRef((e,t)=>{const n=V2(Zr,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Ca(Zr,e.__scopeMenu),s=sd(Zr,e.__scopeMenu),a=U2(wJ,e.__scopeMenu),l=m.useRef(null),u=Xe(t,l);return m.createElement(xu.Provider,{scope:e.__scopeMenu},m.createElement(Jt,{present:r||i.open},m.createElement(xu.Slot,{scope:e.__scopeMenu},m.createElement(Zy,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=KZ[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 q2(e){return e?"open":"closed"}function kh(e){return e==="indeterminate"}function ex(e){return kh(e)?"indeterminate":e?"checked":"unchecked"}function SJ(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function CJ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function EJ(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=CJ(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 RJ(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 $J(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return RJ(n,t)}function wu(e){return t=>t.pointerType==="mouse"?e(t):void 0}const PJ=eJ,OJ=z2,MJ=nJ,DJ=oJ,TJ=lJ,AJ=Jy,IJ=cJ,kJ=hJ,NJ=gJ,LJ=vJ,FJ=bJ,zJ=xJ,jJ=_J,G2="DropdownMenu",[VJ,hoe]=fn(G2,[L2]),xr=L2(),[HJ,Y2]=VJ(G2),WJ=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=xr(t),u=m.useRef(null),[d=!1,h]=Mn({prop:o,defaultProp:i,onChange:s});return m.createElement(HJ,{scope:t,triggerId:Kn(),triggerRef:u,contentId:Kn(),open:d,onOpenChange:h,onOpenToggle:m.useCallback(()=>h(p=>!p),[h]),modal:a},m.createElement(PJ,ne({},l,{open:d,onOpenChange:h,dir:r,modal:a}),n))},BJ="DropdownMenuTrigger",UJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=Y2(BJ,n),s=xr(n);return m.createElement(OJ,ne({asChild:!0},s),m.createElement(Le.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:qh(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())})})))}),qJ=e=>{const{__scopeDropdownMenu:t,...n}=e,r=xr(t);return m.createElement(MJ,ne({},r,n))},GJ="DropdownMenuContent",YJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Y2(GJ,n),i=xr(n),s=m.useRef(!1);return m.createElement(DJ,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)"}}))}),KJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return m.createElement(TJ,ne({},o,r,{ref:t}))}),XJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return m.createElement(AJ,ne({},o,r,{ref:t}))}),QJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return m.createElement(IJ,ne({},o,r,{ref:t}))}),ZJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return m.createElement(kJ,ne({},o,r,{ref:t}))}),JJ=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return m.createElement(NJ,ne({},o,r,{ref:t}))}),eee=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return m.createElement(LJ,ne({},o,r,{ref:t}))}),tee=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return m.createElement(FJ,ne({},o,r,{ref:t}))}),nee=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return m.createElement(zJ,ne({},o,r,{ref:t}))}),ree=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=xr(n);return m.createElement(jJ,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)"}}))}),oee=WJ,iee=UJ,see=qJ,K2=YJ,X2=KJ,Q2=XJ,Z2=QJ,aee=ZJ,J2=JJ,eM=eee,tM=tee,nM=nee,rM=ree,lee=oee,cee=iee,uee=aee,dee=ae.forwardRef(({className:e,inset:t,children:n,...r},o)=>k.jsxs(nM,{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(jP,{className:"ml-auto h-4 w-4"})]}));dee.displayName=nM.displayName;const fee=ae.forwardRef(({className:e,...t},n)=>k.jsx(rM,{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}));fee.displayName=rM.displayName;const oM=ae.forwardRef(({className:e,sideOffset:t=4,...n},r)=>k.jsx(see,{children:k.jsx(K2,{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})}));oM.displayName=K2.displayName;const hee=ae.forwardRef(({className:e,inset:t,...n},r)=>k.jsx(Q2,{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}));hee.displayName=Q2.displayName;const pee=ae.forwardRef(({className:e,children:t,checked:n,...r},o)=>k.jsxs(Z2,{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(eM,{children:k.jsx(Qu,{className:"h-4 w-4"})})}),t]}));pee.displayName=Z2.displayName;const iM=ae.forwardRef(({className:e,children:t,...n},r)=>k.jsxs(J2,{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(eM,{children:k.jsx(VP,{className:"h-2 w-2 fill-current"})})}),t]}));iM.displayName=J2.displayName;const sM=ae.forwardRef(({className:e,inset:t,...n},r)=>k.jsx(X2,{ref:r,className:Se("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));sM.displayName=X2.displayName;const aM=ae.forwardRef(({className:e,...t},n)=>k.jsx(tM,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",e),...t}));aM.displayName=tM.displayName;function gee(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=>lM(s))}})}})}}function lM(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:mee(e.customCfg),data:[]}}function mee(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 cM(e){return`semaphor:bookmark:${e}`}const uM="Dialog",[dM,poe]=fn(uM),[vee,to]=dM(uM),bee=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]=Mn({prop:r,defaultProp:o,onChange:i});return m.createElement(vee,{scope:t,triggerRef:a,contentRef:l,contentId:Kn(),titleId:Kn(),descriptionId:Kn(),open:u,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(h=>!h),[d]),modal:s},n)},yee="DialogTrigger",xee=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=to(yee,n),i=Xe(t,o.triggerRef);return m.createElement(Le.button,ne({type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":tx(o.open)},r,{ref:i,onClick:we(e.onClick,o.onOpenToggle)}))}),fM="DialogPortal",[wee,hM]=dM(fM,{forceMount:void 0}),_ee=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=to(fM,t);return m.createElement(wee,{scope:t,forceMount:n},m.Children.map(r,s=>m.createElement(Jt,{present:n||i.open},m.createElement(vp,{asChild:!0,container:o},s))))},Vb="DialogOverlay",See=m.forwardRef((e,t)=>{const n=hM(Vb,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=to(Vb,e.__scopeDialog);return i.modal?m.createElement(Jt,{present:r||i.open},m.createElement(Cee,ne({},o,{ref:t}))):null}),Cee=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=to(Vb,n);return m.createElement(Mp,{as:ri,allowPinchZoom:!0,shards:[o.contentRef]},m.createElement(Le.div,ne({"data-state":tx(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),_u="DialogContent",Eee=m.forwardRef((e,t)=>{const n=hM(_u,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=to(_u,e.__scopeDialog);return m.createElement(Jt,{present:r||i.open},i.modal?m.createElement(Ree,ne({},o,{ref:t})):m.createElement($ee,ne({},o,{ref:t})))}),Ree=m.forwardRef((e,t)=>{const n=to(_u,e.__scopeDialog),r=m.useRef(null),o=Xe(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return Pp(i)},[]),m.createElement(pM,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())}))}),$ee=m.forwardRef((e,t)=>{const n=to(_u,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return m.createElement(pM,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()}}))}),pM=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=to(_u,n),l=m.useRef(null),u=Xe(t,l);return Rp(),m.createElement(m.Fragment,null,m.createElement($p,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},m.createElement(Wl,ne({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":tx(a.open)},s,{ref:u,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),Pee="DialogTitle",Oee=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=to(Pee,n);return m.createElement(Le.h2,ne({id:o.titleId},r,{ref:t}))}),Mee="DialogDescription",Dee=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=to(Mee,n);return m.createElement(Le.p,ne({id:o.descriptionId},r,{ref:t}))}),Tee="DialogClose",Aee=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=to(Tee,n);return m.createElement(Le.button,ne({type:"button"},r,{ref:t,onClick:we(e.onClick,()=>o.onOpenChange(!1))}))});function tx(e){return e?"open":"closed"}const Iee=bee,kee=xee,Nee=_ee,gM=See,mM=Eee,vM=Oee,bM=Dee,Lee=Aee,Fee=Iee,zee=kee,jee=Nee,yM=ae.forwardRef(({className:e,...t},n)=>k.jsx(gM,{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}));yM.displayName=gM.displayName;const xM=ae.forwardRef(({className:e,children:t,...n},r)=>k.jsxs(jee,{children:[k.jsx(yM,{}),k.jsxs(mM,{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(Lee,{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(WP,{className:"h-4 w-4"}),k.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));xM.displayName=mM.displayName;const wM=({className:e,...t})=>k.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});wM.displayName="DialogHeader";const _M=({className:e,...t})=>k.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});_M.displayName="DialogFooter";const SM=ae.forwardRef(({className:e,...t},n)=>k.jsx(vM,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",e),...t}));SM.displayName=vM.displayName;const CM=ae.forwardRef(({className:e,...t},n)=>k.jsx(bM,{ref:n,className:Se("text-sm text-muted-foreground",e),...t}));CM.displayName=bM.displayName;const EM=ae.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}));EM.displayName="Input";const RM="Checkbox",[Vee,goe]=fn(RM),[Hee,Wee]=Vee(RM),Bee=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,w]=Mn({prop:o,defaultProp:i,onChange:u}),_=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,w]),m.createElement(Hee,{scope:n,state:x,disabled:a},m.createElement(Le.button,ne({type:"button",role:"checkbox","aria-checked":ta(x)?"mixed":x,"aria-required":s,"data-state":$M(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=>{w(R=>ta(R)?!0:!R),y&&(b.current=C.isPropagationStopped(),b.current||C.stopPropagation())})})),y&&m.createElement(Gee,{control:h,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),Uee="CheckboxIndicator",qee=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Wee(Uee,n);return m.createElement(Jt,{present:r||ta(i.state)||i.state===!0},m.createElement(Le.span,ne({"data-state":$M(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),Gee=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Tp(n),a=mp(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=ta(n),h.call(l,ta(n)?!1:n),l.dispatchEvent(p)}},[s,n,r]),m.createElement("input",ne({type:"checkbox","aria-hidden":!0,defaultChecked:ta(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function ta(e){return e==="indeterminate"}function $M(e){return ta(e)?"indeterminate":e?"checked":"unchecked"}const PM=Bee,Yee=qee,OM=ae.forwardRef(({className:e,...t},n)=>k.jsx(PM,{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(Yee,{className:Se("flex items-center justify-center text-current"),children:k.jsx(Qu,{className:"h-4 w-4"})})}));OM.displayName=PM.displayName;const MM=m.forwardRef(({className:e,...t},n)=>k.jsx("div",{role:"editor-panel",ref:n,className:Se("flex grow h-full",e),...t}));MM.displayName="EditorPanel";const DM=m.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se(" flex flex-col space-y-2 w-[270px]",e),...t}));DM.displayName="EditorAside";const TM=m.forwardRef(({className:e,...t},n)=>k.jsx("div",{ref:n,className:Se(" grow",e),...t}));TM.displayName="EditorMain";function Kee(e,t){return m.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const AM="ScrollArea",[IM,moe]=fn(AM),[Xee,zr]=IM(AM),kM=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,D]=m.useState(!1),[O,T]=m.useState(!1),I=Xe(t,W=>l(W)),N=ga(o);return m.createElement(Xee,{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:D,scrollbarY:y,onScrollbarYChange:x,scrollbarYEnabled:O,onScrollbarYEnabledChange:T,onCornerWidthChange:_,onCornerHeightChange:R},m.createElement(Le.div,ne({dir:N},s,{ref:I,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})))}),Qee="ScrollAreaViewport",Zee=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,...o}=e,i=zr(Qee,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(Le.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)))}),ui="ScrollAreaScrollbar",NM=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=zr(ui,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(Jee,ne({},r,{ref:t,forceMount:n})):o.type==="scroll"?m.createElement(ete,ne({},r,{ref:t,forceMount:n})):o.type==="auto"?m.createElement(LM,ne({},r,{ref:t,forceMount:n})):o.type==="always"?m.createElement(nx,ne({},r,{ref:t})):null}),Jee=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=zr(ui,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(Jt,{present:n||i},m.createElement(LM,ne({"data-state":i?"visible":"hidden"},r,{ref:t})))}),ete=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=zr(ui,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Fp(()=>l("SCROLL_END"),100),[a,l]=Kee("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(Jt,{present:n||a!=="hidden"},m.createElement(nx,ne({"data-state":a==="hidden"?"hidden":"visible"},r,{ref:t,onPointerEnter:we(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:we(e.onPointerLeave,()=>l("POINTER_LEAVE"))})))}),LM=m.forwardRef((e,t)=>{const n=zr(ui,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=m.useState(!1),a=e.orientation==="horizontal",l=Fp(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?u:d)}},10);return zl(n.viewport,l),zl(n.content,l),m.createElement(Jt,{present:r||i},m.createElement(nx,ne({"data-state":i?"visible":"hidden"},o,{ref:t})))}),nx=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=zr(ui,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=VM(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 lte(p,s.current,a,g)}return n==="horizontal"?m.createElement(tte,ne({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,g=tE(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(nte,ne({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,g=tE(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}),tte=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=zr(ui,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(zM,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":Lp(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),WM(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:Nh(s.paddingLeft),paddingEnd:Nh(s.paddingRight)}})}}))}),nte=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=zr(ui,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(zM,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":Lp(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),WM(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:Nh(s.paddingTop),paddingEnd:Nh(s.paddingBottom)}})}}))}),[rte,FM]=IM(ui),zM=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=zr(ui,n),[b,y]=m.useState(null),x=Xe(t,I=>y(I)),w=m.useRef(null),_=m.useRef(""),C=g.viewport,R=r.content-r.viewport,E=sn(d),D=sn(l),O=Fp(h,10);function T(I){if(w.current){const N=I.clientX-w.current.left,W=I.clientY-w.current.top;u({x:N,y:W})}}return m.useEffect(()=>{const I=N=>{const W=N.target;(b==null?void 0:b.contains(W))&&E(N,R)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[C,b,R,E]),m.useEffect(D,[r,D]),zl(b,O),zl(g.content,O),m.createElement(rte,{scope:n,scrollbar:b,hasThumb:o,onThumbChange:sn(i),onThumbPointerUp:sn(s),onThumbPositionChange:D,onThumbPointerDown:sn(a)},m.createElement(Le.div,ne({},p,{ref:x,style:{position:"absolute",...p.style},onPointerDown:we(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),w.current=b.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),T(I))}),onPointerMove:we(e.onPointerMove,T),onPointerUp:we(e.onPointerUp,I=>{const N=I.target;N.hasPointerCapture(I.pointerId)&&N.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=_.current,g.viewport&&(g.viewport.style.scrollBehavior=""),w.current=null})})))}),Hb="ScrollAreaThumb",ote=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=FM(Hb,e.__scopeScrollArea);return m.createElement(Jt,{present:n||o.hasThumb},m.createElement(ite,ne({ref:t},r)))}),ite=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=zr(Hb,n),s=FM(Hb,n),{onThumbPositionChange:a}=s,l=Xe(t,h=>s.onThumbChange(h)),u=m.useRef(),d=Fp(()=>{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=cte(h,a);u.current=g,a()}};return a(),h.addEventListener("scroll",p),()=>h.removeEventListener("scroll",p)}},[i.viewport,d,a]),m.createElement(Le.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)}))}),jM="ScrollAreaCorner",ste=m.forwardRef((e,t)=>{const n=zr(jM,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.createElement(ate,ne({},e,{ref:t})):null}),ate=m.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=zr(jM,n),[i,s]=m.useState(0),[a,l]=m.useState(0),u=!!(i&&a);return zl(o.scrollbarX,()=>{var d;const h=((d=o.scrollbarX)===null||d===void 0?void 0:d.offsetHeight)||0;o.onCornerHeightChange(h),l(h)}),zl(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(Le.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 Nh(e){return e?parseInt(e,10):0}function VM(e,t){const n=e/t;return isNaN(n)?0:n}function Lp(e){const t=VM(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function lte(e,t,n,r="ltr"){const o=Lp(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 HM([l,u],h)(e)}function tE(e,t,n="ltr"){const r=Lp(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=Lb(e,l);return HM([0,s],[0,a])(u)}function HM(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 WM(e,t){return e>0&&e<t}const cte=(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 Fp(e,t){const n=sn(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 zl(e,t){const n=sn(t);On(()=>{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 BM=kM,ute=Zee,dte=ste,UM=ae.forwardRef(({className:e,children:t,...n},r)=>k.jsxs(BM,{ref:r,className:Se("relative overflow-hidden",e),...n,children:[k.jsx(ute,{className:"h-full w-full rounded-[inherit]",children:t}),k.jsx(rx,{}),k.jsx(dte,{})]}));UM.displayName=BM.displayName;const rx=ae.forwardRef(({className:e,orientation:t="vertical",...n},r)=>k.jsx(NM,{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(ote,{className:"relative flex-1 rounded-full bg-border"})}));rx.displayName=NM.displayName;const{createElement:jl,createContext:fte,createRef:voe,forwardRef:qM,useCallback:or,useContext:GM,useEffect:na,useImperativeHandle:YM,useLayoutEffect:hte,useMemo:pte,useRef:kr,useState:Lh}=ae,nE=ae.useId,zp=fte(null);zp.displayName="PanelGroupContext";const Su=hte,gte=typeof nE=="function"?nE:()=>null;let mte=0;function ox(e=null){const t=gte(),n=kr(e||t||null);return n.current===null&&(n.current=""+mte++),e??n.current}function KM({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=GM(zp);if(x===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:w,expandPanel:_,getPanelSize:C,getPanelStyle:R,groupId:E,isPanelCollapsed:D,registerPanel:O,resizePanel:T,unregisterPanel:I}=x,N=ox(s),W=kr({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});kr({didLogMissingDefaultSizeWarning:!1}),Su(()=>{const{callbacks:ue,constraints:J}=W.current;W.current.id=N,W.current.idIsFromProps=s!==void 0,W.current.order=p,ue.onCollapse=u,ue.onExpand=d,ue.onResize=h,J.collapsedSize=n,J.collapsible=r,J.defaultSize=o,J.maxSize=a,J.minSize=l}),Su(()=>{const ue=W.current;return O(ue),()=>{I(ue)}},[p,N,O,I]),YM(i,()=>({collapse:()=>{w(W.current)},expand:()=>{_(W.current)},getId(){return N},getSize(){return C(W.current)},isCollapsed(){return D(W.current)},isExpanded(){return!D(W.current)},resize:ue=>{T(W.current,ue)}}),[w,_,C,D,N,T]);const Y=R(W.current,o);return jl(b,{...y,children:e,className:t,style:{...Y,...g},"data-panel":"","data-panel-id":N,"data-panel-group-id":E,"data-panel-collapsible":void 0,"data-panel-size":void 0})}const XM=qM((e,t)=>jl(KM,{...e,forwardedRef:t}));KM.displayName="Panel";XM.displayName="forwardRef(Panel)";function Je(e,t="Assertion failed!"){if(!e)throw console.error(t),Error(t)}const QM=10;function Cu(e,t,n=QM){e=parseFloat(e.toFixed(n)),t=parseFloat(t.toFixed(n));const r=e-t;return r===0?0:r>0?1:-1}function lr(e,t,n){return Cu(e,t,n)===0}function il({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];Je(r!=null);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(Cu(n,a)<0)if(i){const l=(o+a)/2;Cu(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(QM)),n}function jc({delta:e,layout:t,panelConstraints:n,pivotIndices:r,trigger:o}){if(lr(e,0))return t;const i=[...t],[s,a]=r;Je(s!=null),Je(a!=null);let l=0;if(o==="keyboard"){{const d=e<0?a:s,h=n[d];if(Je(h),h.collapsible){const p=t[d];Je(p!=null);const g=n[d];Je(g);const{collapsedSize:b=0,minSize:y=0}=g;if(lr(p,b)){const x=y-p;Cu(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const d=e<0?s:a,h=n[d];Je(h);const{collapsible:p}=h;if(p){const g=t[d];Je(g!=null);const b=n[d];Je(b);const{collapsedSize:y=0,minSize:x=0}=b;if(lr(g,x)){const w=g-y;Cu(w,Math.abs(e))>0&&(e=e<0?0-w:w)}}}}{const d=e<0?1:-1;let h=e<0?a:s,p=0;for(;;){const b=t[h];Je(b!=null);const x=il({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];Je(g!=null);const b=g-p,y=il({panelConstraints:n,panelIndex:h,size:b});if(!lr(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(lr(l,0))return t;{const d=e<0?a:s,h=t[d];Je(h!=null);const p=h+l,g=il({panelConstraints:n,panelIndex:d,size:p});if(i[d]=g,!lr(g,p)){let b=p-g,x=e<0?a:s;for(;x>=0&&x<n.length;){const w=i[x];Je(w!=null);const _=w+b,C=il({panelConstraints:n,panelIndex:x,size:_});if(lr(w,C)||(b-=C-w,i[x]=C),lr(b,0))break;e>0?x--:x++}}}const u=i.reduce((d,h)=>h+d,0);return lr(u,100)?i:t}function vte({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];Je(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 Eu(e){return Array.from(document.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function ZM(e,t){const r=Eu(e).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===t);return r??null}function JM(e,t){const n=ZM(e,t);return n!=null?[n,n+1]:[-1,-1]}function eD(e){const t=document.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return t||null}function jp(e){const t=document.querySelector(`[data-panel-resize-handle-id="${e}"]`);return t||null}function bte(e,t,n){var r,o,i,s;const a=jp(t),l=Eu(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 yte({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,setLayout:i}){kr({didWarnAboutMissingResizeHandle:!1}),Su(()=>{const s=Eu(n);for(let a=0;a<o.length-1;a++){const{valueMax:l,valueMin:u,valueNow:d}=vte({layout:r,panelsArray:o,pivotIndices:[a,a+1]}),h=s[a];if(h!=null){const p=o[a];Je(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]),na(()=>{const s=t.current;Je(s);const{panelDataArray:a}=s,l=eD(n);Je(l!=null,`No group found for id "${n}"`);const u=Eu(n);Je(u);const d=u.map(h=>{const p=h.getAttribute("data-panel-resize-handle-id");Je(p);const[g,b]=bte(n,p,a);if(g==null||b==null)return()=>{};const y=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const w=a.findIndex(_=>_.id===g);if(w>=0){const _=a[w];Je(_);const C=r[w],{collapsedSize:R=0,collapsible:E,minSize:D=0}=_.constraints;if(C!=null&&E){const O=jc({delta:lr(C,R)?D-R:R-C,layout:r,panelConstraints:a.map(T=>T.constraints),pivotIndices:JM(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 rE(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 tD(e){return e.type==="keydown"}function nD(e){return e.type.startsWith("mouse")}function rD(e){return e.type.startsWith("touch")}function oD(e,t){const n=e==="horizontal";if(nD(t))return n?t.clientX:t.clientY;if(rD(t)){const r=t.touches[0];return Je(r),n?r.screenX:r.screenY}else throw Error(`Unsupported event type "${t.type}"`)}function xte(e,t,n,r){const o=n==="horizontal",i=jp(t);Je(i);const s=i.getAttribute("data-panel-group-id");Je(s);let{initialCursorPosition:a}=r;const l=oD(n,e),u=eD(s);Je(u);const d=u.getBoundingClientRect(),h=o?d.width:d.height;return(l-a)/h*100}function wte(e,t,n,r,o){if(tD(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:xte(e,t,n,r)}function _te({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];Je(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];Je(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 Za(e,t,n){t.forEach((r,o)=>{const i=e[o];Je(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 Lf(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 Ste({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 Wb=null,Vs=null;function iD(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 Cte(){Vs!==null&&(document.head.removeChild(Vs),Wb=null,Vs=null)}function uv(e){if(Wb===e)return;Wb=e;const t=iD(e);Vs===null&&(Vs=document.createElement("style"),document.head.appendChild(Vs)),Vs.innerHTML=`*{cursor: ${t}!important;}`}function Ete(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function oE(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 sD(e){return`react-resizable-panels:${e}`}function aD(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 lD(e,t){try{const n=sD(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function Rte(e,t,n){var r,o;const i=(r=lD(e,n))!==null&&r!==void 0?r:{},s=aD(t);return(o=i[s])!==null&&o!==void 0?o:null}function $te(e,t,n,r,o){var i;const s=sD(e),a=aD(t),l=(i=lD(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 iE({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(!lr(r,100))for(let i=0;i<t.length;i++){const s=n[i];Je(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];Je(s!=null);const a=il({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!lr(o,0))for(let i=0;i<t.length;i++){const s=n[i];Je(s!=null);const a=s+o,l=il({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,lr(o,0)))break}return n}const Pte=100,Vc={getItem:e=>(oE(Vc),Vc.getItem(e)),setItem:(e,t)=>{oE(Vc),Vc.setItem(e,t)}},sE={};function cD({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=Vc,style:u,tagName:d="div",...h}){const p=ox(i),[g,b]=Lh(null),[y,x]=Lh([]),w=kr({}),_=kr(new Map),C=kr(0),R=kr({autoSaveId:e,direction:r,dragState:g,id:p,keyboardResizeBy:a,onLayout:s,storage:l}),E=kr({layout:y,panelDataArray:[],panelDataArrayChanged:!1});kr({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),YM(o,()=>({getId:()=>R.current.id,getLayout:()=>{const{layout:j}=E.current;return j},setLayout:j=>{const{onLayout:V}=R.current,{layout:te,panelDataArray:le}=E.current,ce=iE({layout:j,panelConstraints:le.map(ge=>ge.constraints)});rE(te,ce)||(x(ce),E.current.layout=ce,V&&V(ce),Za(le,ce,w.current))}}),[]),Su(()=>{R.current.autoSaveId=e,R.current.direction=r,R.current.dragState=g,R.current.id=p,R.current.onLayout=s,R.current.storage=l}),yte({committedValuesRef:R,eagerValuesRef:E,groupId:p,layout:y,panelDataArray:E.current.panelDataArray,setLayout:x}),na(()=>{const{panelDataArray:j}=E.current;if(e){if(y.length===0||y.length!==j.length)return;let V=sE[e];V==null&&(V=Ete($te,Pte),sE[e]=V);const te=[...j],le=new Map(_.current);V(e,te,le,y,l)}},[e,y,l]),na(()=>{});const D=or(j=>{const{onLayout:V}=R.current,{layout:te,panelDataArray:le}=E.current;if(j.constraints.collapsible){const ce=le.map(ee=>ee.constraints),{collapsedSize:ge=0,panelSize:ve,pivotIndices:de}=Ja(le,j,te);if(Je(ve!=null),ve!==ge){_.current.set(j.id,ve);const K=nl(le,j)===le.length-1?ve-ge:ge-ve,re=jc({delta:K,layout:te,panelConstraints:ce,pivotIndices:de,trigger:"imperative-api"});Lf(te,re)||(x(re),E.current.layout=re,V&&V(re),Za(le,re,w.current))}}},[]),O=or(j=>{const{onLayout:V}=R.current,{layout:te,panelDataArray:le}=E.current;if(j.constraints.collapsible){const ce=le.map(K=>K.constraints),{collapsedSize:ge=0,panelSize:ve,minSize:de=0,pivotIndices:ee}=Ja(le,j,te);if(ve===ge){const K=_.current.get(j.id),re=K!=null&&K>=de?K:de,Q=nl(le,j)===le.length-1?ve-re:re-ve,Oe=jc({delta:Q,layout:te,panelConstraints:ce,pivotIndices:ee,trigger:"imperative-api"});Lf(te,Oe)||(x(Oe),E.current.layout=Oe,V&&V(Oe),Za(le,Oe,w.current))}}},[]),T=or(j=>{const{layout:V,panelDataArray:te}=E.current,{panelSize:le}=Ja(te,j,V);return Je(le!=null),le},[]),I=or((j,V)=>{const{panelDataArray:te}=E.current,le=nl(te,j);return Ste({defaultSize:V,dragState:g,layout:y,panelData:te,panelIndex:le})},[g,y]),N=or(j=>{const{layout:V,panelDataArray:te}=E.current,{collapsedSize:le=0,collapsible:ce,panelSize:ge}=Ja(te,j,V);return ce===!0&&ge===le},[]),W=or(j=>{const{layout:V,panelDataArray:te}=E.current,{collapsedSize:le=0,collapsible:ce,panelSize:ge}=Ja(te,j,V);return Je(ge!=null),!ce||ge>le},[]),Y=or(j=>{const{panelDataArray:V}=E.current;V.push(j),V.sort((te,le)=>{const ce=te.order,ge=le.order;return ce==null&&ge==null?0:ce==null?-1:ge==null?1:ce-ge}),E.current.panelDataArrayChanged=!0},[]);Su(()=>{if(E.current.panelDataArrayChanged){E.current.panelDataArrayChanged=!1;const{autoSaveId:j,onLayout:V,storage:te}=R.current,{layout:le,panelDataArray:ce}=E.current;let ge=null;if(j){const de=Rte(j,ce,te);de&&(_.current=new Map(Object.entries(de.expandToSizes)),ge=de.layout)}ge==null&&(ge=_te({panelDataArray:ce}));const ve=iE({layout:ge,panelConstraints:ce.map(de=>de.constraints)});rE(le,ve)||(x(ve),E.current.layout=ve,V&&V(ve),Za(ce,ve,w.current))}});const ue=or(j=>function(te){te.preventDefault();const{direction:le,dragState:ce,id:ge,keyboardResizeBy:ve,onLayout:de}=R.current,{layout:ee,panelDataArray:K}=E.current,{initialLayout:re}=ce??{},be=JM(ge,j);let Q=wte(te,j,le,ce,ve);if(Q===0)return;const Oe=le==="horizontal";document.dir==="rtl"&&Oe&&(Q=-Q);const Ie=K.map(pt=>pt.constraints),ze=jc({delta:Q,layout:re??ee,panelConstraints:Ie,pivotIndices:be,trigger:tD(te)?"keyboard":"mouse-or-touch"}),_e=!Lf(ee,ze);(nD(te)||rD(te))&&C.current!=Q&&(C.current=Q,uv(_e?Oe?"horizontal":"vertical":Oe?Q<0?"horizontal-min":"horizontal-max":Q<0?"vertical-min":"vertical-max")),_e&&(x(ze),E.current.layout=ze,de&&de(ze),Za(K,ze,w.current))},[]),J=or((j,V)=>{const{onLayout:te}=R.current,{layout:le,panelDataArray:ce}=E.current,ge=ce.map(be=>be.constraints),{panelSize:ve,pivotIndices:de}=Ja(ce,j,le);Je(ve!=null);const K=nl(ce,j)===ce.length-1?ve-V:V-ve,re=jc({delta:K,layout:le,panelConstraints:ge,pivotIndices:de,trigger:"imperative-api"});Lf(le,re)||(x(re),E.current.layout=re,te&&te(re),Za(ce,re,w.current))},[]),F=or((j,V)=>{const{direction:te}=R.current,{layout:le}=E.current,ce=jp(j);Je(ce);const ge=oD(te,V);b({dragHandleId:j,dragHandleRect:ce.getBoundingClientRect(),initialCursorPosition:ge,initialLayout:le})},[]),Z=or(()=>{Cte(),b(null)},[]),q=or(j=>{const{panelDataArray:V}=E.current,te=nl(V,j);te>=0&&(V.splice(te,1),delete w.current[j.id],E.current.panelDataArrayChanged=!0)},[]),X=pte(()=>({collapsePanel:D,direction:r,dragState:g,expandPanel:O,getPanelSize:T,getPanelStyle:I,groupId:p,isPanelCollapsed:N,isPanelExpanded:W,registerPanel:Y,registerResizeHandle:ue,resizePanel:J,startDragging:F,stopDragging:Z,unregisterPanel:q}),[D,g,r,O,T,I,p,N,W,Y,ue,J,F,Z,q]),ie={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return jl(zp.Provider,{value:X},jl(d,{...h,children:t,className:n,style:{...ie,...u},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const uD=qM((e,t)=>jl(cD,{...e,forwardedRef:t}));cD.displayName="PanelGroup";uD.displayName="forwardRef(PanelGroup)";function nl(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function Ja(e,t,n){const r=e.map(u=>u.constraints),o=nl(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 Ote({disabled:e,handleId:t,resizeHandler:n}){na(()=>{if(e||n==null)return;const r=jp(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");Je(s);const a=Eu(s),l=ZM(s,t);Je(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 dD({children:e=null,className:t="",disabled:n=!1,id:r,onDragging:o,style:i={},tabIndex:s=0,tagName:a="div",...l}){const u=kr(null),d=kr({onDragging:o});na(()=>{d.current.onDragging=o});const h=GM(zp);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:w}=h,_=ox(r),C=(g==null?void 0:g.dragHandleId)===_,[R,E]=Lh(!1),[D,O]=Lh(null),T=or(()=>{const N=u.current;Je(N),N.blur(),w();const{onDragging:W}=d.current;W&&W(!1)},[w]);na(()=>{if(n)O(null);else{const N=y(_);O(()=>N)}},[n,_,y]),na(()=>{if(n||D==null||!C)return;const N=J=>{D(J)},W=J=>{D(J)},Y=u.current;Je(Y);const ue=Y.ownerDocument;return ue.body.addEventListener("contextmenu",T),ue.body.addEventListener("mousemove",N),ue.body.addEventListener("touchmove",N),ue.body.addEventListener("mouseleave",W),window.addEventListener("mouseup",T),window.addEventListener("touchend",T),()=>{ue.body.removeEventListener("contextmenu",T),ue.body.removeEventListener("mousemove",N),ue.body.removeEventListener("touchmove",N),ue.body.removeEventListener("mouseleave",W),window.removeEventListener("mouseup",T),window.removeEventListener("touchend",T)}},[p,n,C,D,T]),Ote({disabled:n,handleId:_,resizeHandler:D});const I={cursor:iD(p),touchAction:"none",userSelect:"none"};return jl(a,{...l,children:e,className:t,onBlur:()=>E(!1),onFocus:()=>E(!0),onMouseDown:N=>{x(_,N.nativeEvent);const W=d.current;Je(W);const{onDragging:Y}=W;Y&&Y(!0)},onMouseUp:T,onTouchCancel:T,onTouchEnd:T,onTouchStart:N=>{x(_,N.nativeEvent);const W=d.current;Je(W);const{onDragging:Y}=W;Y&&Y(!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":_})}dD.displayName="PanelResizeHandle";function Mte(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aE(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 lE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?aE(Object(n),!0).forEach(function(r){Mte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Dte(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 Tte(e,t){if(e==null)return{};var n=Dte(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 Ate(e,t){return Ite(e)||kte(e,t)||Nte(e,t)||Lte()}function Ite(e){if(Array.isArray(e))return e}function kte(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 Nte(e,t){if(e){if(typeof e=="string")return cE(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 cE(e,t)}}function cE(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 Lte(){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 Fte(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uE(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 dE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uE(Object(n),!0).forEach(function(r){Fte(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uE(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zte(){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 Hc(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 Fh(e){return{}.toString.call(e).includes("Object")}function jte(e){return!Object.keys(e).length}function Ru(e){return typeof e=="function"}function Vte(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Hte(e,t){return Fh(t)||Wi("changeType"),Object.keys(t).some(function(n){return!Vte(e,n)})&&Wi("changeField"),t}function Wte(e){Ru(e)||Wi("selectorType")}function Bte(e){Ru(e)||Fh(e)||Wi("handlerType"),Fh(e)&&Object.values(e).some(function(t){return!Ru(t)})&&Wi("handlersType")}function Ute(e){e||Wi("initialIsRequired"),Fh(e)||Wi("initialType"),jte(e)&&Wi("initialContent")}function qte(e,t){throw new Error(e[t]||e.default)}var Gte={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"},Wi=Hc(qte)(Gte),Ff={changes:Hte,selector:Wte,handler:Bte,initial:Ute};function Yte(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ff.initial(e),Ff.handler(t);var n={current:e},r=Hc(Qte)(n,t),o=Hc(Xte)(n),i=Hc(Ff.changes)(e),s=Hc(Kte)(n);function a(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(d){return d};return Ff.selector(u),u(n.current)}function l(u){zte(r,o,i,s)(u)}return[a,l]}function Kte(e,t){return Ru(t)?t(e.current):t}function Xte(e,t){return e.current=dE(dE({},e.current),t),t}function Qte(e,t,n){return Ru(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 Zte={create:Yte},Jte={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function ene(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 tne(e){return{}.toString.call(e).includes("Object")}function nne(e){return e||fE("configIsRequired"),tne(e)||fE("configType"),e.urls?(rne(),{paths:{vs:e.urls.monacoBase}}):e}function rne(){console.warn(fD.deprecation)}function one(e,t){throw new Error(e[t]||e.default)}var fD={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
|
+
`},fE=ene(one)(fD),ine={config:nne},sne=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 hD(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],hD(e[n],t[n]))}),lE(lE({},e),t)}var ane={type:"cancelation",msg:"operation is manually canceled"};function dv(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(ane):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var lne=Zte.create({config:Jte,isInitialized:!1,resolve:null,reject:null,monaco:null}),pD=Ate(lne,2),ad=pD[0],Vp=pD[1];function cne(e){var t=ine.config(e),n=t.monaco,r=Tte(t,["monaco"]);Vp(function(o){return{config:hD(o.config,r),monaco:n}})}function une(){var e=ad(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(Vp({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),dv(fv);if(window.monaco&&window.monaco.editor)return gD(window.monaco),e.resolve(window.monaco),dv(fv);sne(dne,hne)(pne)}return dv(fv)}function dne(e){return document.body.appendChild(e)}function fne(e){var t=document.createElement("script");return e&&(t.src=e),t}function hne(e){var t=ad(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=fne("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function pne(){var e=ad(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){gD(n),e.resolve(n)},function(n){e.reject(n)})}function gD(e){ad().monaco||Vp({monaco:e})}function gne(){return ad(function(e){var t=e.monaco;return t})}var fv=new Promise(function(e,t){return Vp({resolve:e,reject:t})}),mD={config:cne,init:une,__getMonacoInstance:gne},mne={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},hv=mne,vne={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},bne=vne;function yne({children:e}){return m.createElement("div",{style:bne.container},e)}var xne=yne,wne=xne;function _ne({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return m.createElement("section",{style:{...hv.wrapper,width:e,height:t},...s},!n&&m.createElement(wne,null,r),m.createElement("div",{ref:o,style:{...hv.fullWidth,...!n&&hv.hide},className:i}))}var Sne=_ne,vD=m.memo(Sne);function Cne(e){m.useEffect(e,[])}var bD=Cne;function Ene(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var ur=Ene;function eu(){}function sl(e,t,n,r){return Rne(e,r)||$ne(e,t,n,r)}function Rne(e,t){return e.editor.getModel(yD(e,t))}function $ne(e,t,n,r){return e.editor.createModel(t,n,r?yD(e,r):void 0)}function yD(e,t){return e.Uri.parse(t)}function Pne({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=eu,onMount:w=eu}){let[_,C]=m.useState(!1),[R,E]=m.useState(!0),D=m.useRef(null),O=m.useRef(null),T=m.useRef(null),I=m.useRef(w),N=m.useRef(x),W=m.useRef(!1);bD(()=>{let F=mD.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)),()=>D.current?J():F.cancel()}),ur(()=>{if(D.current&&O.current){let F=D.current.getOriginalEditor(),Z=sl(O.current,e||"",r||n||"text",i||"");Z!==F.getModel()&&F.setModel(Z)}},[i],_),ur(()=>{if(D.current&&O.current){let F=D.current.getModifiedEditor(),Z=sl(O.current,t||"",o||n||"text",s||"");Z!==F.getModel()&&F.setModel(Z)}},[s],_),ur(()=>{let F=D.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],_),ur(()=>{var F,Z;(Z=(F=D.current)==null?void 0:F.getModel())==null||Z.original.setValue(e||"")},[e],_),ur(()=>{let{original:F,modified:Z}=D.current.getModel();O.current.editor.setModelLanguage(F,r||n||"text"),O.current.editor.setModelLanguage(Z,o||n||"text")},[n,r,o],_),ur(()=>{var F;(F=O.current)==null||F.editor.setTheme(u)},[u],_),ur(()=>{var F;(F=D.current)==null||F.updateOptions(h)},[h],_);let Y=m.useCallback(()=>{var q;if(!O.current)return;N.current(O.current);let F=sl(O.current,e||"",r||n||"text",i||""),Z=sl(O.current,t||"",o||n||"text",s||"");(q=D.current)==null||q.setModel({original:F,modified:Z})},[n,t,o,e,r,i,s]),ue=m.useCallback(()=>{var F;!W.current&&T.current&&(D.current=O.current.editor.createDiffEditor(T.current,{automaticLayout:!0,...h}),Y(),(F=O.current)==null||F.editor.setTheme(u),C(!0),W.current=!0)},[h,u,Y]);m.useEffect(()=>{_&&I.current(D.current,O.current)},[_]),m.useEffect(()=>{!R&&!_&&ue()},[R,_,ue]);function J(){var Z,q,X,ie;let F=(Z=D.current)==null?void 0:Z.getModel();a||((q=F==null?void 0:F.original)==null||q.dispose()),l||((X=F==null?void 0:F.modified)==null||X.dispose()),(ie=D.current)==null||ie.dispose()}return m.createElement(vD,{width:g,height:p,isEditorReady:_,loading:d,_ref:T,className:b,wrapperProps:y})}var One=Pne;m.memo(One);function Mne(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var Dne=Mne,zf=new Map;function Tne({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:w=eu,onMount:_=eu,onChange:C,onValidate:R=eu}){let[E,D]=m.useState(!1),[O,T]=m.useState(!0),I=m.useRef(null),N=m.useRef(null),W=m.useRef(null),Y=m.useRef(_),ue=m.useRef(w),J=m.useRef(),F=m.useRef(r),Z=Dne(i),q=m.useRef(!1),X=m.useRef(!1);bD(()=>{let V=mD.init();return V.then(te=>(I.current=te)&&T(!1)).catch(te=>(te==null?void 0:te.type)!=="cancelation"&&console.error("Monaco initialization: error:",te)),()=>N.current?j():V.cancel()}),ur(()=>{var te,le,ce,ge;let V=sl(I.current,e||r||"",t||o||"",i||n||"");V!==((te=N.current)==null?void 0:te.getModel())&&(h&&zf.set(Z,(le=N.current)==null?void 0:le.saveViewState()),(ce=N.current)==null||ce.setModel(V),h&&((ge=N.current)==null||ge.restoreViewState(zf.get(i))))},[i],E),ur(()=>{var V;(V=N.current)==null||V.updateOptions(u)},[u],E),ur(()=>{!N.current||r===void 0||(N.current.getOption(I.current.editor.EditorOption.readOnly)?N.current.setValue(r):r!==N.current.getValue()&&(X.current=!0,N.current.executeEdits("",[{range:N.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),N.current.pushUndoStop(),X.current=!1))},[r],E),ur(()=>{var te,le;let V=(te=N.current)==null?void 0:te.getModel();V&&o&&((le=I.current)==null||le.editor.setModelLanguage(V,o))},[o],E),ur(()=>{var V;a!==void 0&&((V=N.current)==null||V.revealLine(a))},[a],E),ur(()=>{var V;(V=I.current)==null||V.editor.setTheme(s)},[s],E);let ie=m.useCallback(()=>{var V;if(!(!W.current||!I.current)&&!q.current){ue.current(I.current);let te=i||n,le=sl(I.current,r||e||"",t||o||"",te||"");N.current=(V=I.current)==null?void 0:V.editor.create(W.current,{model:le,automaticLayout:!0,...u},d),h&&N.current.restoreViewState(zf.get(te)),I.current.editor.setTheme(s),a!==void 0&&N.current.revealLine(a),D(!0),q.current=!0}},[e,t,n,r,o,i,u,d,h,s,a]);m.useEffect(()=>{E&&Y.current(N.current,I.current)},[E]),m.useEffect(()=>{!O&&!E&&ie()},[O,E,ie]),F.current=r,m.useEffect(()=>{var V,te;E&&C&&((V=J.current)==null||V.dispose(),J.current=(te=N.current)==null?void 0:te.onDidChangeModelContent(le=>{X.current||C(N.current.getValue(),le)}))},[E,C]),m.useEffect(()=>{if(E){let V=I.current.editor.onDidChangeMarkers(te=>{var ce;let le=(ce=N.current.getModel())==null?void 0:ce.uri;if(le&&te.find(ge=>ge.path===le.path)){let ge=I.current.editor.getModelMarkers({resource:le});R==null||R(ge)}});return()=>{V==null||V.dispose()}}return()=>{}},[E,R]);function j(){var V,te;(V=J.current)==null||V.dispose(),p?h&&zf.set(i,N.current.saveViewState()):(te=N.current.getModel())==null||te.dispose(),N.current.dispose()}return m.createElement(vD,{width:g,height:b,isEditorReady:E,loading:l,_ref:W,className:y,wrapperProps:x})}var Ane=Tne,xD=m.memo(Ane),Ine=xD;const kne=m.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=Mn({prop:n,onChange:o,defaultProp:r});return m.createElement(Le.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)})}))}),wD=kne,Nne=Py("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"}}),_D=ae.forwardRef(({className:e,variant:t,size:n,...r},o)=>k.jsx(wD,{ref:o,className:Se(Nne({variant:t,size:n,className:e})),...r}));_D.displayName=wD.displayName;const SD="Switch",[Lne,boe]=fn(SD),[Fne,zne]=Lne(SD),jne=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,_=>p(_)),b=m.useRef(!1),y=h?!!h.closest("form"):!0,[x=!1,w]=Mn({prop:o,defaultProp:i,onChange:u});return m.createElement(Fne,{scope:n,checked:x,disabled:a},m.createElement(Le.button,ne({type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":CD(x),"data-disabled":a?"":void 0,disabled:a,value:l},d,{ref:g,onClick:we(e.onClick,_=>{w(C=>!C),y&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})})),y&&m.createElement(Wne,{control:h,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),Vne="SwitchThumb",Hne=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=zne(Vne,n);return m.createElement(Le.span,ne({"data-state":CD(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),Wne=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Tp(n),a=mp(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 CD(e){return e?"checked":"unchecked"}const Hp=jne,ED=Hne,RD=ae.forwardRef(({className:e,...t},n)=>k.jsx(Hp,{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(ED,{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")})}));RD.displayName=Hp.displayName;const Bne=ae.forwardRef(({className:e,...t},n)=>k.jsx(Hp,{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(ED,{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")})}));Bne.displayName=Hp.displayName;const $D="Collapsible",[Une,PD]=fn($D),[qne,ix]=Une($D),Gne=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,u]=Mn({prop:r,defaultProp:o,onChange:s});return m.createElement(qne,{scope:n,disabled:i,contentId:Kn(),open:l,onOpenToggle:m.useCallback(()=>u(d=>!d),[u])},m.createElement(Le.div,ne({"data-state":sx(l),"data-disabled":i?"":void 0},a,{ref:t})))}),Yne="CollapsibleTrigger",Kne=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=ix(Yne,n);return m.createElement(Le.button,ne({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":sx(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:we(e.onClick,o.onOpenToggle)}))}),OD="CollapsibleContent",Xne=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ix(OD,e.__scopeCollapsible);return m.createElement(Jt,{present:n||o.open},({present:i})=>m.createElement(Qne,ne({},r,{ref:t,present:i})))}),Qne=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=ix(OD,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),w=m.useRef();return m.useEffect(()=>{const _=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(_)},[]),On(()=>{const _=u.current;if(_){w.current=w.current||{transitionDuration:_.style.transitionDuration,animationName:_.style.animationName},_.style.transitionDuration="0s",_.style.animationName="none";const C=_.getBoundingClientRect();h.current=C.height,g.current=C.width,x.current||(_.style.transitionDuration=w.current.transitionDuration,_.style.animationName=w.current.animationName),l(r)}},[s.open,r]),m.createElement(Le.div,ne({"data-state":sx(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 sx(e){return e?"open":"closed"}const Zne=Gne,Jne=Kne,ere=Xne,Zi="Accordion",tre=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ax,nre,rre]=Gh(Zi),[Wp,yoe]=fn(Zi,[rre,PD]),lx=PD(),MD=m.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return m.createElement(ax.Provider,{scope:e.__scopeAccordion},n==="multiple"?m.createElement(are,ne({},i,{ref:t})):m.createElement(sre,ne({},o,{ref:t})))});MD.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[DD,ore]=Wp(Zi),[TD,ire]=Wp(Zi,{collapsible:!1}),sre=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=Mn({prop:n,defaultProp:r,onChange:o});return m.createElement(DD,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:m.useCallback(()=>i&&l(""),[i,l])},m.createElement(TD,{scope:e.__scopeAccordion,collapsible:i},m.createElement(AD,ne({},s,{ref:t}))))}),are=m.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=Mn({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(DD,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:u},m.createElement(TD,{scope:e.__scopeAccordion,collapsible:!0},m.createElement(AD,ne({},i,{ref:t}))))}),[lre,Bp]=Wp(Zi),AD=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=nre(n),h=ga(o)==="ltr",p=we(e.onKeyDown,g=>{var b;if(!tre.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)}),w=x.findIndex(I=>I.ref.current===y),_=x.length;if(w===-1)return;g.preventDefault();let C=w;const R=0,E=_-1,D=()=>{C=w+1,C>E&&(C=R)},O=()=>{C=w-1,C<R&&(C=E)};switch(g.key){case"Home":C=R;break;case"End":C=E;break;case"ArrowRight":i==="horizontal"&&(h?D():O());break;case"ArrowDown":i==="vertical"&&D();break;case"ArrowLeft":i==="horizontal"&&(h?O():D());break;case"ArrowUp":i==="vertical"&&O();break}const T=C%_;(b=x[T].ref.current)===null||b===void 0||b.focus()});return m.createElement(lre,{scope:n,disabled:r,direction:o,orientation:i},m.createElement(ax.Slot,{scope:n},m.createElement(Le.div,ne({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:p}))))}),Bb="AccordionItem",[cre,cx]=Wp(Bb),ure=m.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Bp(Bb,n),s=ore(Bb,n),a=lx(n),l=Kn(),u=r&&s.value.includes(r)||!1,d=i.disabled||e.disabled;return m.createElement(cre,{scope:n,open:u,disabled:d,triggerId:l},m.createElement(Zne,ne({"data-orientation":i.orientation,"data-state":ID(u)},a,o,{ref:t,disabled:d,open:u,onOpenChange:h=>{h?s.onItemOpen(r):s.onItemClose(r)}})))}),dre="AccordionHeader",fre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Bp(Zi,n),i=cx(dre,n);return m.createElement(Le.h3,ne({"data-orientation":o.orientation,"data-state":ID(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),hE="AccordionTrigger",hre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Bp(Zi,n),i=cx(hE,n),s=ire(hE,n),a=lx(n);return m.createElement(ax.ItemSlot,{scope:n},m.createElement(Jne,ne({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:t})))}),pre="AccordionContent",gre=m.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Bp(Zi,n),i=cx(pre,n),s=lx(n);return m.createElement(ere,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 ID(e){return e?"open":"closed"}const mre=MD,vre=ure,bre=fre,kD=hre,ND=gre,yre=mre,LD=ae.forwardRef(({className:e,...t},n)=>k.jsx(vre,{ref:n,className:Se("border-b",e),...t}));LD.displayName="AccordionItem";const FD=ae.forwardRef(({className:e,children:t,...n},r)=>k.jsx(bre,{className:"flex",children:k.jsxs(kD,{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(xp,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));FD.displayName=kD.displayName;const zD=ae.forwardRef(({className:e,children:t,...n},r)=>k.jsx(ND,{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})}));zD.displayName=ND.displayName;const jD="Radio",[xre,VD]=fn(jD),[wre,_re]=xre(jD),Sre=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(wre,{scope:n,checked:o,disabled:s},m.createElement(Le.button,ne({type:"button",role:"radio","aria-checked":o,"data-state":HD(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(Rre,{control:d,bubbles:!g.current,name:r,value:a,checked:o,required:i,disabled:s,style:{transform:"translateX(-100%)"}}))}),Cre="RadioIndicator",Ere=m.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=_re(Cre,n);return m.createElement(Jt,{present:r||i.checked},m.createElement(Le.span,ne({"data-state":HD(i.checked),"data-disabled":i.disabled?"":void 0},o,{ref:t})))}),Rre=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=m.useRef(null),s=Tp(n),a=mp(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 HD(e){return e?"checked":"unchecked"}const $re=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],WD="RadioGroup",[Pre,xoe]=fn(WD,[Hl,VD]),BD=Hl(),UD=VD(),[Ore,Mre]=Pre(WD),Dre=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=BD(n),b=ga(u),[y,x]=Mn({prop:i,defaultProp:o,onChange:h});return m.createElement(Ore,{scope:n,name:r,required:s,disabled:a,value:y,onValueChange:x},m.createElement(e0,ne({asChild:!0},g,{orientation:l,dir:b,loop:d}),m.createElement(Le.div,ne({role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:b},p,{ref:t}))))}),Tre="RadioGroupItem",Are=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=Mre(Tre,n),s=i.disabled||r,a=BD(n),l=UD(n),u=m.useRef(null),d=Xe(t,u),h=i.value===o.value,p=m.useRef(!1);return m.useEffect(()=>{const g=y=>{$re.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(t0,ne({asChild:!0},a,{focusable:!s,active:h}),m.createElement(Sre,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())})})))}),Ire=m.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=UD(n);return m.createElement(Ere,ne({},o,r,{ref:t}))}),qD=Dre,GD=Are,kre=Ire,YD=ae.forwardRef(({className:e,...t},n)=>k.jsx(qD,{className:Se("grid gap-2",e),...t,ref:n}));YD.displayName=qD.displayName;const KD=ae.forwardRef(({className:e,...t},n)=>k.jsx(GD,{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(kre,{className:"flex items-center justify-center",children:k.jsx(VP,{className:"h-2.5 w-2.5 fill-current text-current"})})}));KD.displayName=GD.displayName;var Nre=Object.defineProperty,Lre=(e,t,n)=>t in e?Nre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jf=(e,t,n)=>(Lre(e,typeof t!="symbol"?t+"":t,n),n);const Fre={stringify:e=>e,parse:e=>e},zre={stringify:e=>`${e}`,parse:e=>parseFloat(e)},jre={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},Vre={stringify:e=>e.name,parse:(e,t)=>{const n=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof n=="function"?n.bind(t):void 0}},Hre={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},pv={string:Fre,number:zre,boolean:jre,function:Vre,json:Hre},gv=Symbol.for("r2wc.render"),Vf=Symbol.for("r2wc.connected"),Ms=Symbol.for("r2wc.context"),Ri=Symbol.for("r2wc.props");function Wre(e,t,n){var r,o,i;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]);const s=(Array.isArray(t.props)?t.props.slice():Object.keys(t.props)).filter(h=>h!=="container"),a={},l={},u={};for(const h of s){a[h]=Array.isArray(t.props)?"string":t.props[h];const p=Bre(h);l[h]=p,u[p]=h}class d extends HTMLElement{constructor(){super(),jf(this,r,!0),jf(this,o),jf(this,i,{}),jf(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[Ri].container=this.container;for(const p of s){const g=l[p],b=this.getAttribute(g),y=a[p],x=pv[y];b&&x!=null&&x.parse&&(this[Ri][p]=x.parse(b,this))}}static get observedAttributes(){return Object.keys(u)}connectedCallback(){this[Vf]=!0,this[gv]()}disconnectedCallback(){this[Vf]=!1,this[Ms]&&n.unmount(this[Ms]),delete this[Ms]}attributeChangedCallback(p,g,b){const y=u[p],x=a[y],w=pv[x];y in a&&w!=null&&w.parse&&(this[Ri][y]=w.parse(b,this),this[gv]())}[(r=Vf,o=Ms,i=Ri,gv)](){this[Vf]&&(this[Ms]?n.update(this[Ms],this[Ri]):this[Ms]=n.mount(this.container,e,this[Ri]))}}for(const h of s){const p=l[h],g=a[h];Object.defineProperty(d.prototype,h,{enumerable:!0,configurable:!0,get(){return this[Ri][h]},set(b){this[Ri][h]=b;const y=pv[g];if(y!=null&&y.stringify){const x=y.stringify(b);this.getAttribute(p)!==x&&this.setAttribute(p,x)}}})}return d}function Bre(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function Ure(e,t,n){const r=Rv(e),o=m.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function qre({root:e,ReactComponent:t},n){const r=m.createElement(t,n);e.render(r)}function Gre({root:e}){e.unmount()}function Yre(e,t={}){return Wre(e,t,{mount:Ure,update:qre,unmount:Gre})}const Kre={id:"string",version:"string",authToken:"json",currentTheme:"string",customCards:"json",style:"json",onChartElementClicked:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function"},Xre=Yre(k2,{props:Kre});exports.$57acba87d6e25586$export$ccf8d8d7bbf3c2cc=kM;exports.$a093c7e1ec25a057$export$8c610744efcf8a1d=AP;exports.Accordion=yre;exports.AccordionContent=zD;exports.AccordionItem=LD;exports.AccordionTrigger=FD;exports.BOOLEAN_DATA_TYPES=$y;exports.Button=ea;exports.Calendar=zP;exports.Card=P0;exports.CardContent=lp;exports.CardDescription=O0;exports.CardFooter=M0;exports.CardHeader=sp;exports.CardTitle=ap;exports.ChartJsVisual=hP;exports.Check=Qu;exports.CheckIcon=pP;exports.Checkbox=OM;exports.ChevronDown=xp;exports.ClipboardCopyIcon=sW;exports.Cross2Icon=gP;exports.DATE_DATA_TYPES=td;exports.Dashboard=k2;exports.DashboardPanel=iR;exports.DashboardTabs=A2;exports.DashboardWC=Xre;exports.Dialog=Fee;exports.DialogContent=xM;exports.DialogDescription=CM;exports.DialogFooter=_M;exports.DialogHeader=wM;exports.DialogTitle=SM;exports.DialogTrigger=zee;exports.DropdownMenu=lee;exports.DropdownMenuContent=oM;exports.DropdownMenuLabel=sM;exports.DropdownMenuRadioGroup=uee;exports.DropdownMenuRadioItem=iM;exports.DropdownMenuSeparator=aM;exports.DropdownMenuTrigger=cee;exports.Editable=sa;exports.EditorAside=DM;exports.EditorMain=TM;exports.EditorPanel=MM;exports.Ft=Ine;exports.HoverCard=KP;exports.HoverCardContent=dy;exports.HoverCardTrigger=XP;exports.InfoCircledIcon=hW;exports.Input=EM;exports.KPICard=BP;exports.Label=Qo;exports.LoaderCircle=ay;exports.NUMBER_DATA_TYPES=Nl;exports.PYTHON_DEFAULT_CODE=BE;exports.Panel=XM;exports.PanelGroup=uD;exports.PanelResizeHandle=dD;exports.PaperPlaneIcon=gW;exports.PlayIcon=vW;exports.Popover=Hy;exports.PopoverContent=Dp;exports.PopoverTrigger=Wy;exports.RadioGroup=YD;exports.RadioGroupItem=KD;exports.ScrollArea=UM;exports.ScrollBar=rx;exports.Select=$2;exports.SelectContent=Ky;exports.SelectGroup=HZ;exports.SelectItem=Jc;exports.SelectLabel=D2;exports.SelectSeparator=T2;exports.SelectTrigger=Yy;exports.SelectValue=P2;exports.SemaphorContextProvider=tR;exports.SemaphorQueryClient=JE;exports.Separator=Uy;exports.Settings=HP;exports.SliderIcon=yW;exports.Switch=RD;exports.TEXT_DATA_TYPES=Cp;exports.Table=fy;exports.TableBody=py;exports.TableCell=Rh;exports.TableHead=gy;exports.TableHeader=hy;exports.TableRow=Zc;exports.TableVisual=uO;exports.Tabs=vR;exports.TabsContent=r0;exports.TabsList=bR;exports.TabsTrigger=yR;exports.Textarea=By;exports.Toggle=_D;exports.Tooltip=NP;exports.TooltipContent=sy;exports.TooltipTrigger=LP;exports.TriangleDownIcon=Y0;exports.TriangleUpIcon=K0;exports.UXProvider=I2;exports.X=WP;exports._=ia;exports.cleanCard=lM;exports.cn=Se;exports.commonjsGlobal=ks;exports.copyToClipboard=VN;exports.createChartConfig=UP;exports.createLucideIcon=yr;exports.createSqlGenConfig=eY;exports.de=xD;exports.flexRender=Pb;exports.fmt=EO;exports.getBookmarkKey=cM;exports.getCanvasBackgroundColor=oh;exports.getColumnDataType=tY;exports.getContrastColor=ih;exports.getCoreRowModel=sO;exports.getDashbaordStateWithoutData=gee;exports.getDefaultExportFromCjs=zu;exports.getDefaultFilterSql=oY;exports.getFilterValueType=Th;exports.getKeys=Nr;exports.getPaginationRowModel=lO;exports.getQualifiedTableName=RO;exports.getRequest=el;exports.getSortedRowModel=aO;exports.getSql=JG;exports.isColumnInSqlGen=nY;exports.jsxRuntimeExports=k;exports.pivotData=X0;exports.postRequest=jh;exports.resolveBaseQuery=ME;exports.resolveDataType=au;exports.titleCase=WN;exports.useCard=xU;exports.useDashboardActions=pa;exports.useDashboardCard=ly;exports.useDashboardStore=Ee;exports.useEditorActions=t9;exports.useEditorAside=r9;exports.useEditorStore=qt;exports.useQuery=go;exports.useReactTable=cO;exports.useSemaphorContext=ha;exports.useTheme=rR;exports.v4=su;
|