react-semaphor 0.0.305 → 0.0.306

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,400 @@
1
+ "use strict";var JQ=Object.defineProperty;var eZ=(e,t,n)=>t in e?JQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ne=(e,t,n)=>(eZ(e,typeof t!="symbol"?t+"":t,n),n),h1=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var le=(e,t,n)=>(h1(e,t,"read from private field"),n?n.call(e):t.get(e)),Ye=(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)},We=(e,t,n,r)=>(h1(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Pm=(e,t,n,r)=>({set _(o){We(e,t,o,n)},get _(){return le(e,t,r)}}),kt=(e,t,n)=>(h1(e,t,"access private method"),n);const w=require("react"),Pn=require("react-dom");function C5(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 S=C5(w),Pi=C5(Pn);var Pa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bE(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 CS={exports:{}},Of={};/**
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 NT;function tZ(){return NT||(NT=1,process.env.NODE_ENV!=="production"&&function(){var e=w,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m=Symbol.iterator,v="@@iterator";function y(N){if(N===null||typeof N!="object")return null;var se=m&&N[m]||N[v];return typeof se=="function"?se:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(N){{for(var se=arguments.length,he=new Array(se>1?se-1:0),Oe=1;Oe<se;Oe++)he[Oe-1]=arguments[Oe];E("error",N,he)}}function E(N,se,he){{var Oe=b.ReactDebugCurrentFrame,Be=Oe.getStackAddendum();Be!==""&&(se+="%s",he=he.concat([Be]));var Ue=he.map(function(Fe){return String(Fe)});Ue.unshift("Warning: "+se),Function.prototype.apply.call(console[N],console,Ue)}}var R=!1,P=!1,O=!1,A=!1,D=!1,I;I=Symbol.for("react.module.reference");function L(N){return!!(typeof N=="string"||typeof N=="function"||N===r||N===i||D||N===o||N===c||N===u||A||N===p||R||P||O||typeof N=="object"&&N!==null&&(N.$$typeof===f||N.$$typeof===d||N.$$typeof===s||N.$$typeof===a||N.$$typeof===l||N.$$typeof===I||N.getModuleId!==void 0))}function j(N,se,he){var Oe=N.displayName;if(Oe)return Oe;var Be=se.displayName||se.name||"";return Be!==""?he+"("+Be+")":he}function z(N){return N.displayName||"Context"}function K(N){if(N==null)return null;if(typeof N.tag=="number"&&x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof N=="function")return N.displayName||N.name||null;if(typeof N=="string")return N;switch(N){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof N=="object")switch(N.$$typeof){case a:var se=N;return z(se)+".Consumer";case s:var he=N;return z(he._context)+".Provider";case l:return j(N,N.render,"ForwardRef");case d:var Oe=N.displayName||null;return Oe!==null?Oe:K(N.type)||"Memo";case f:{var Be=N,Ue=Be._payload,Fe=Be._init;try{return K(Fe(Ue))}catch{return null}}}return null}var H=Object.assign,k=0,W,B,U,q,$,Y,X;function M(){}M.__reactDisabledLog=!0;function oe(){{if(k===0){W=console.log,B=console.info,U=console.warn,q=console.error,$=console.group,Y=console.groupCollapsed,X=console.groupEnd;var N={configurable:!0,enumerable:!0,value:M,writable:!0};Object.defineProperties(console,{info:N,log:N,warn:N,error:N,group:N,groupCollapsed:N,groupEnd:N})}k++}}function te(){{if(k--,k===0){var N={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},N,{value:W}),info:H({},N,{value:B}),warn:H({},N,{value:U}),error:H({},N,{value:q}),group:H({},N,{value:$}),groupCollapsed:H({},N,{value:Y}),groupEnd:H({},N,{value:X})})}k<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ie=b.ReactCurrentDispatcher,ne;function Z(N,se,he){{if(ne===void 0)try{throw Error()}catch(Be){var Oe=Be.stack.trim().match(/\n( *(at )?)/);ne=Oe&&Oe[1]||""}return`
10
+ `+ne+N}}var ae=!1,ce;{var ve=typeof WeakMap=="function"?WeakMap:Map;ce=new ve}function ee(N,se){if(!N||ae)return"";{var he=ce.get(N);if(he!==void 0)return he}var Oe;ae=!0;var Be=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ue;Ue=ie.current,ie.current=null,oe();try{if(se){var Fe=function(){throw Error()};if(Object.defineProperty(Fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Fe,[])}catch(ft){Oe=ft}Reflect.construct(N,[],Fe)}else{try{Fe.call()}catch(ft){Oe=ft}N.call(Fe.prototype)}}else{try{throw Error()}catch(ft){Oe=ft}N()}}catch(ft){if(ft&&Oe&&typeof ft.stack=="string"){for(var ke=ft.stack.split(`
11
+ `),Me=Oe.stack.split(`
12
+ `),J=ke.length-1,be=Me.length-1;J>=1&&be>=0&&ke[J]!==Me[be];)be--;for(;J>=1&&be>=0;J--,be--)if(ke[J]!==Me[be]){if(J!==1||be!==1)do if(J--,be--,be<0||ke[J]!==Me[be]){var $e=`
13
+ `+ke[J].replace(" at new "," at ");return N.displayName&&$e.includes("<anonymous>")&&($e=$e.replace("<anonymous>",N.displayName)),typeof N=="function"&&ce.set(N,$e),$e}while(J>=1&&be>=0);break}}}finally{ae=!1,ie.current=Ue,te(),Error.prepareStackTrace=Be}var at=N?N.displayName||N.name:"",En=at?Z(at):"";return typeof N=="function"&&ce.set(N,En),En}function ge(N,se,he){return ee(N,!1)}function fe(N){var se=N.prototype;return!!(se&&se.isReactComponent)}function Se(N,se,he){if(N==null)return"";if(typeof N=="function")return ee(N,fe(N));if(typeof N=="string")return Z(N);switch(N){case c:return Z("Suspense");case u:return Z("SuspenseList")}if(typeof N=="object")switch(N.$$typeof){case l:return ge(N.render);case d:return Se(N.type,se,he);case f:{var Oe=N,Be=Oe._payload,Ue=Oe._init;try{return Se(Ue(Be),se,he)}catch{}}}return""}var Ae=Object.prototype.hasOwnProperty,ze={},Ie=b.ReactDebugCurrentFrame;function De(N){if(N){var se=N._owner,he=Se(N.type,N._source,se?se.type:null);Ie.setExtraStackFrame(he)}else Ie.setExtraStackFrame(null)}function ot(N,se,he,Oe,Be){{var Ue=Function.call.bind(Ae);for(var Fe in N)if(Ue(N,Fe)){var ke=void 0;try{if(typeof N[Fe]!="function"){var Me=Error((Oe||"React class")+": "+he+" type `"+Fe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof N[Fe]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Me.name="Invariant Violation",Me}ke=N[Fe](se,Fe,Oe,he,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(J){ke=J}ke&&!(ke instanceof Error)&&(De(Be),x("%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).",Oe||"React class",he,Fe,typeof ke),De(null)),ke instanceof Error&&!(ke.message in ze)&&(ze[ke.message]=!0,De(Be),x("Failed %s type: %s",he,ke.message),De(null))}}}var _t=Array.isArray;function rn(N){return _t(N)}function $t(N){{var se=typeof Symbol=="function"&&Symbol.toStringTag,he=se&&N[Symbol.toStringTag]||N.constructor.name||"Object";return he}}function on(N){try{return pe(N),!1}catch{return!0}}function pe(N){return""+N}function Pe(N){if(on(N))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",$t(N)),pe(N)}var je=b.ReactCurrentOwner,qe={key:!0,ref:!0,__self:!0,__source:!0},tt,sn,_n;_n={};function mn(N){if(Ae.call(N,"ref")){var se=Object.getOwnPropertyDescriptor(N,"ref").get;if(se&&se.isReactWarning)return!1}return N.ref!==void 0}function Bn(N){if(Ae.call(N,"key")){var se=Object.getOwnPropertyDescriptor(N,"key").get;if(se&&se.isReactWarning)return!1}return N.key!==void 0}function vn(N,se){if(typeof N.ref=="string"&&je.current&&se&&je.current.stateNode!==se){var he=K(je.current.type);_n[he]||(x('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',K(je.current.type),N.ref),_n[he]=!0)}}function Bt(N,se){{var he=function(){tt||(tt=!0,x("%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)",se))};he.isReactWarning=!0,Object.defineProperty(N,"key",{get:he,configurable:!0})}}function cn(N,se){{var he=function(){sn||(sn=!0,x("%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)",se))};he.isReactWarning=!0,Object.defineProperty(N,"ref",{get:he,configurable:!0})}}var An=function(N,se,he,Oe,Be,Ue,Fe){var ke={$$typeof:t,type:N,key:se,ref:he,props:Fe,_owner:Ue};return ke._store={},Object.defineProperty(ke._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ke,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Oe}),Object.defineProperty(ke,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Be}),Object.freeze&&(Object.freeze(ke.props),Object.freeze(ke)),ke};function et(N,se,he,Oe,Be){{var Ue,Fe={},ke=null,Me=null;he!==void 0&&(Pe(he),ke=""+he),Bn(se)&&(Pe(se.key),ke=""+se.key),mn(se)&&(Me=se.ref,vn(se,Be));for(Ue in se)Ae.call(se,Ue)&&!qe.hasOwnProperty(Ue)&&(Fe[Ue]=se[Ue]);if(N&&N.defaultProps){var J=N.defaultProps;for(Ue in J)Fe[Ue]===void 0&&(Fe[Ue]=J[Ue])}if(ke||Me){var be=typeof N=="function"?N.displayName||N.name||"Unknown":N;ke&&Bt(Fe,be),Me&&cn(Fe,be)}return An(N,ke,Me,Be,Oe,je.current,Fe)}}var pt=b.ReactCurrentOwner,Mt=b.ReactDebugCurrentFrame;function Jt(N){if(N){var se=N._owner,he=Se(N.type,N._source,se?se.type:null);Mt.setExtraStackFrame(he)}else Mt.setExtraStackFrame(null)}var yt;yt=!1;function Vn(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function ai(){{if(pt.current){var N=K(pt.current.type);if(N)return`
14
+
15
+ Check the render method of \``+N+"`."}return""}}function na(N){{if(N!==void 0){var se=N.fileName.replace(/^.*[\\\/]/,""),he=N.lineNumber;return`
16
+
17
+ Check your code at `+se+":"+he+"."}return""}}var li={};function gs(N){{var se=ai();if(!se){var he=typeof N=="string"?N:N.displayName||N.name;he&&(se=`
18
+
19
+ Check the top-level render call using <`+he+">.")}return se}}function Mi(N,se){{if(!N._store||N._store.validated||N.key!=null)return;N._store.validated=!0;var he=gs(se);if(li[he])return;li[he]=!0;var Oe="";N&&N._owner&&N._owner!==pt.current&&(Oe=" It was passed a child from "+K(N._owner.type)+"."),Jt(N),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',he,Oe),Jt(null)}}function ms(N,se){{if(typeof N!="object")return;if(rn(N))for(var he=0;he<N.length;he++){var Oe=N[he];Vn(Oe)&&Mi(Oe,se)}else if(Vn(N))N._store&&(N._store.validated=!0);else if(N){var Be=y(N);if(typeof Be=="function"&&Be!==N.entries)for(var Ue=Be.call(N),Fe;!(Fe=Ue.next()).done;)Vn(Fe.value)&&Mi(Fe.value,se)}}}function ra(N){{var se=N.type;if(se==null||typeof se=="string")return;var he;if(typeof se=="function")he=se.propTypes;else if(typeof se=="object"&&(se.$$typeof===l||se.$$typeof===d))he=se.propTypes;else return;if(he){var Oe=K(se);ot(he,N.props,"prop",Oe,N)}else if(se.PropTypes!==void 0&&!yt){yt=!0;var Be=K(se);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Be||"Unknown")}typeof se.getDefaultProps=="function"&&!se.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ii(N){{for(var se=Object.keys(N.props),he=0;he<se.length;he++){var Oe=se[he];if(Oe!=="children"&&Oe!=="key"){Jt(N),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Oe),Jt(null);break}}N.ref!==null&&(Jt(N),x("Invalid attribute `ref` supplied to `React.Fragment`."),Jt(null))}}function vs(N,se,he,Oe,Be,Ue){{var Fe=L(N);if(!Fe){var ke="";(N===void 0||typeof N=="object"&&N!==null&&Object.keys(N).length===0)&&(ke+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Me=na(Be);Me?ke+=Me:ke+=ai();var J;N===null?J="null":rn(N)?J="array":N!==void 0&&N.$$typeof===t?(J="<"+(K(N.type)||"Unknown")+" />",ke=" Did you accidentally export a JSX literal instead of a component?"):J=typeof N,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",J,ke)}var be=et(N,se,he,Be,Ue);if(be==null)return be;if(Fe){var $e=se.children;if($e!==void 0)if(Oe)if(rn($e)){for(var at=0;at<$e.length;at++)ms($e[at],N);Object.freeze&&Object.freeze($e)}else x("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 ms($e,N)}return N===r?Ii(be):ra(be),be}}function er(N,se,he){return vs(N,se,he,!0)}function $i(N,se,he){return vs(N,se,he,!1)}var oa=$i,ia=er;Of.Fragment=r,Of.jsx=oa,Of.jsxs=ia}()),Of}var Af={};/**
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 kT;function nZ(){if(kT)return Af;kT=1;var e=w,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,d={},f=null,p=null;c!==void 0&&(f=""+c),l.key!==void 0&&(f=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:a,key:f,ref:p,props:d,_owner:o.current}}return Af.Fragment=n,Af.jsx=s,Af.jsxs=s,Af}process.env.NODE_ENV==="production"?CS.exports=nZ():CS.exports=tZ();var C=CS.exports;function _5(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=_5(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function lb(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=_5(e))&&(r&&(r+=" "),r+=t);return r}const rZ=Object.freeze(Object.defineProperty({__proto__:null,clsx:lb,default:lb},Symbol.toStringTag,{value:"Module"})),yE="-";function oZ(e){const t=sZ(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;function o(s){const a=s.split(yE);return a[0]===""&&a.length!==1&&a.shift(),E5(a,t)||iZ(s)}function i(s,a){const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}return{getClassGroupId:o,getConflictingClassGroupIds:i}}function E5(e,t){var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?E5(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(yE);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId}const LT=/^\[(.+)\]$/;function iZ(e){if(LT.test(e)){const t=LT.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}}function sZ(e){const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return lZ(Object.entries(e.classGroups),n).forEach(([i,s])=>{_S(s,r,i,t)}),r}function _S(e,t,n,r){e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:FT(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(aZ(o)){_S(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{_S(s,FT(t,i),n,r)})})}function FT(e,t){let n=e;return t.split(yE).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n}function aZ(e){return e.isThemeGetter}function lZ(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 cZ(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 R5="!";function uZ(e){const t=e.separator,n=t.length===1,r=t[0],o=t.length;return function(s){const a=[];let l=0,c=0,u;for(let v=0;v<s.length;v++){let y=s[v];if(l===0){if(y===r&&(n||s.slice(v,v+o)===t)){a.push(s.slice(c,v)),c=v+o;continue}if(y==="/"){u=v;continue}}y==="["?l++:y==="]"&&l--}const d=a.length===0?s:s.substring(c),f=d.startsWith(R5),p=f?d.substring(1):d,m=u&&u>c?u-c:void 0;return{modifiers:a,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}}}function dZ(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 fZ(e){return{cache:cZ(e.cacheSize),splitModifiers:uZ(e),...oZ(e)}}const hZ=/\s+/;function pZ(e,t){const{splitModifiers:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=new Set;return e.trim().split(hZ).map(s=>{const{modifiers:a,hasImportantModifier:l,baseClassName:c,maybePostfixModifierPosition:u}=n(s);let d=r(u?c.substring(0,u):c),f=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};f=!1}const p=dZ(a).join(":");return{isTailwindClass:!0,modifierId:l?p+R5:p,classGroupId:d,originalClassName:s,hasPostfixModifier:f}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:a,classGroupId:l,hasPostfixModifier:c}=s,u=a+l;return i.has(u)?!1:(i.add(u),o(l,c).forEach(d=>i.add(a+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function gZ(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=P5(t))&&(r&&(r+=" "),r+=n);return r}function P5(e){if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=P5(e[r]))&&(n&&(n+=" "),n+=t);return n}function mZ(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=fZ(c),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=pZ(l,n);return o(l,u),u}return function(){return i(gZ.apply(null,arguments))}}function yn(e){const t=n=>n[e]||[];return t.isThemeGetter=!0,t}const O5=/^\[(?:([a-z-]+):)?(.+)\]$/i,vZ=/^\d+\/\d+$/,bZ=new Set(["px","full","screen"]),yZ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,xZ=/\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$/,wZ=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,SZ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function hi(e){return ql(e)||bZ.has(e)||vZ.test(e)}function ga(e){return Wd(e,"length",TZ)}function ql(e){return!!e&&!Number.isNaN(Number(e))}function Om(e){return Wd(e,"number",ql)}function Tf(e){return!!e&&Number.isInteger(Number(e))}function CZ(e){return e.endsWith("%")&&ql(e.slice(0,-1))}function wt(e){return O5.test(e)}function ma(e){return yZ.test(e)}const _Z=new Set(["length","size","percentage"]);function EZ(e){return Wd(e,_Z,A5)}function RZ(e){return Wd(e,"position",A5)}const PZ=new Set(["image","url"]);function OZ(e){return Wd(e,PZ,MZ)}function AZ(e){return Wd(e,"",DZ)}function Df(){return!0}function Wd(e,t,n){const r=O5.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1}function TZ(e){return xZ.test(e)}function A5(){return!1}function DZ(e){return wZ.test(e)}function MZ(e){return SZ.test(e)}function IZ(){const e=yn("colors"),t=yn("spacing"),n=yn("blur"),r=yn("brightness"),o=yn("borderColor"),i=yn("borderRadius"),s=yn("borderSpacing"),a=yn("borderWidth"),l=yn("contrast"),c=yn("grayscale"),u=yn("hueRotate"),d=yn("invert"),f=yn("gap"),p=yn("gradientColorStops"),m=yn("gradientColorStopPositions"),v=yn("inset"),y=yn("margin"),b=yn("opacity"),x=yn("padding"),E=yn("saturate"),R=yn("scale"),P=yn("sepia"),O=yn("skew"),A=yn("space"),D=yn("translate"),I=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",wt,t],z=()=>[wt,t],K=()=>["",hi,ga],H=()=>["auto",ql,wt],k=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],U=()=>["start","end","center","between","around","evenly","stretch"],q=()=>["","0",wt],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[ql,Om],X=()=>[ql,wt];return{cacheSize:500,separator:":",theme:{colors:[Df],spacing:[hi,ga],blur:["none","",ma,wt],brightness:Y(),borderColor:[e],borderRadius:["none","","full",ma,wt],borderSpacing:z(),borderWidth:K(),contrast:Y(),grayscale:q(),hueRotate:X(),invert:q(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[CZ,ga],inset:j(),margin:j(),opacity:Y(),padding:z(),saturate:Y(),scale:Y(),sepia:q(),skew:X(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",wt]}],container:["container"],columns:[{columns:[ma]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none"]}],clear:[{clear:["left","right","both","none"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...k(),wt]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Tf,wt]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",wt]}],grow:[{grow:q()}],shrink:[{shrink:q()}],order:[{order:["first","last","none",Tf,wt]}],"grid-cols":[{"grid-cols":[Df]}],"col-start-end":[{col:["auto",{span:["full",Tf,wt]},wt]}],"col-start":[{"col-start":H()}],"col-end":[{"col-end":H()}],"grid-rows":[{"grid-rows":[Df]}],"row-start-end":[{row:["auto",{span:[Tf,wt]},wt]}],"row-start":[{"row-start":H()}],"row-end":[{"row-end":H()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",wt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",wt]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...U()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...U(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...U(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit",wt,t]}],"min-w":[{"min-w":["min","max","fit",wt,hi]}],"max-w":[{"max-w":["0","none","full","min","max","fit","prose",{screen:[ma]},ma,wt]}],h:[{h:[wt,t,"auto","min","max","fit"]}],"min-h":[{"min-h":["min","max","fit",hi,wt]}],"max-h":[{"max-h":[wt,t,"min","max","fit"]}],"font-size":[{text:["base",ma,ga]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Om]}],"font-family":[{font:[Df]}],"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",wt]}],"line-clamp":[{"line-clamp":["none",ql,Om]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",hi,wt]}],"list-image":[{"list-image":["none",wt]}],"list-style-type":[{list:["none","disc","decimal",wt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",hi,ga]}],"underline-offset":[{"underline-offset":["auto",hi,wt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",wt]}],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",wt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...k(),RZ]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",EZ]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},OZ]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...W(),"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":[b]}],"divide-style":[{divide:W()}],"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:["",...W()]}],"outline-offset":[{"outline-offset":[hi,wt]}],"outline-w":[{outline:[hi,ga]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[hi,ga]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ma,AZ]}],"shadow-color":[{shadow:[Df]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":B()}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ma,wt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[E]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[E]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"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",wt]}],duration:[{duration:X()}],ease:[{ease:["linear","in","out","in-out",wt]}],delay:[{delay:X()}],animate:[{animate:["none","spin","ping","pulse","bounce",wt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[Tf,wt]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",wt]}],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",wt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"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",wt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[hi,ga,Om]}],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 $Z=mZ(IZ);class nh extends Error{}nh.prototype.name="InvalidTokenError";function NZ(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function kZ(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return NZ(t)}catch{return atob(t)}}function xE(e,t){if(typeof e!="string")throw new nh("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new nh(`Invalid token specified: missing part #${n+1}`);let o;try{o=kZ(r)}catch(i){throw new nh(`Invalid token specified: invalid base64 for part #${n+1} (${i.message})`)}try{return JSON.parse(o)}catch(i){throw new nh(`Invalid token specified: invalid json for part #${n+1} (${i.message})`)}}async function LZ(e,t){const n=t.slice(0,16),r=new TextEncoder,o=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),i=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},o,{name:"AES-GCM",length:256},!1,["encrypt"]),s=window.crypto.getRandomValues(new Uint8Array(12)),a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},i,r.encode(e)),l=new Uint8Array(s.length+a.byteLength);return l.set(s,0),l.set(new Uint8Array(a),s.length),{payload:btoa(String.fromCharCode(...l))}}async function FZ(e,t){const n=t.slice(0,16),r=new TextEncoder,o=new TextDecoder,i=await window.crypto.subtle.importKey("raw",r.encode(n),{name:"PBKDF2"},!1,["deriveKey"]),s=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r.encode(n),iterations:1e5,hash:"SHA-256"},i,{name:"AES-GCM",length:256},!1,["decrypt"]),a=Uint8Array.from(atob(e),f=>f.charCodeAt(0)),l=a.slice(0,12),c=a.slice(a.length-16),u=a.slice(12,a.length-16),d=new Uint8Array(u.length+c.length);d.set(u),d.set(c,u.length);try{const f=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:l},s,d);return{decryptedData:o.decode(f)}}catch(f){throw new Error(`Decryption failed: ${f}`)}}function xe(...e){return $Z(lb(e))}async function jZ(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 x0(e,t,n={}){try{const r=JSON.stringify(n),o=await LZ(r,t),i=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(o)});if(!i.ok)return i.json().then(a=>{throw console.log(a.detail||"Unknown error occurred"),new Error((a==null?void 0:a.error)||`HTTP error! status: ${i.status}`)});const s=await i.json();if(s.payload){const a=await FZ(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}function zZ(e){if(!e)return{tenantId:"",endUserId:""};const t=xE(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function BZ(e){if(!e)return;const t=xE(e);if(t.params&&t.params.currencyFormat)return t.params.currencyFormat}function T5(e){return e?xE(e).params:void 0}function VZ(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 HZ(e,t){if(!e)return"";const n=/\{\{\s*ref\('([^']+)'\)\s*\}\}/g;return e.replace(n,(o,i)=>WZ(i,t))}function WZ(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 UZ(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ch="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";async function GZ(e,t={}){if(!e)return null;let n="https://semaphor.cloud/api/v1/dashboard";const r=Object.fromEntries(Object.entries(t).filter(([a,l])=>l!==void 0)),o=new URLSearchParams(r).toString();return o&&(n+=`?${o}`),await(await fetch(n,{headers:{Authorization:`Bearer ${e}`}})).json()}async function qZ(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}var YZ={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const jT=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const d=t;t=c??(typeof u!="object"||u===null)?u:Object.assign({},t,u),n.forEach(f=>f(t,d))}},o=()=>t,a={setState:r,getState:o,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(YZ?"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},KZ=e=>e?jT(e):jT;var ES={exports:{}},p1={},RS={exports:{}},g1={};/**
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 zT;function XZ(){return zT||(zT=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=w,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(E){{for(var R=arguments.length,P=new Array(R>1?R-1:0),O=1;O<R;O++)P[O-1]=arguments[O];r("error",E,P)}}function r(E,R,P){{var O=t.ReactDebugCurrentFrame,A=O.getStackAddendum();A!==""&&(R+="%s",P=P.concat([A]));var D=P.map(function(I){return String(I)});D.unshift("Warning: "+R),Function.prototype.apply.call(console[E],console,D)}}function o(E,R){return E===R&&(E!==0||1/E===1/R)||E!==E&&R!==R}var i=typeof Object.is=="function"?Object.is:o,s=e.useState,a=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue,u=!1,d=!1;function f(E,R,P){u||e.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var O=R();if(!d){var A=R();i(O,A)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var D=s({inst:{value:O,getSnapshot:R}}),I=D[0].inst,L=D[1];return l(function(){I.value=O,I.getSnapshot=R,p(I)&&L({inst:I})},[E,O,R]),a(function(){p(I)&&L({inst:I});var j=function(){p(I)&&L({inst:I})};return E(j)},[E]),c(O),O}function p(E){var R=E.getSnapshot,P=E.value;try{var O=R();return!i(P,O)}catch{return!0}}function m(E,R,P){return R()}var v=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y=!v,b=y?m:f,x=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:b;g1.useSyncExternalStore=x,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),g1}var m1={};/**
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 BT;function QZ(){if(BT)return m1;BT=1;var e=w;function t(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(d,f){var p=f(),m=r({inst:{value:p,getSnapshot:f}}),v=m[0].inst,y=m[1];return i(function(){v.value=p,v.getSnapshot=f,l(v)&&y({inst:v})},[d,p,f]),o(function(){return l(v)&&y({inst:v}),d(function(){l(v)&&y({inst:v})})},[d]),s(p),p}function l(d){var f=d.getSnapshot;d=d.value;try{var p=f();return!n(d,p)}catch{return!0}}function c(d,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return m1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,m1}process.env.NODE_ENV==="production"?RS.exports=QZ():RS.exports=XZ();var wE=RS.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 VT;function ZZ(){return VT||(VT=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=w,t=wE;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;function c(u,d,f,p,m){var v=i(null),y;v.current===null?(y={hasValue:!1,value:null},v.current=y):y=v.current;var b=a(function(){var P=!1,O,A,D=function(z){if(!P){P=!0,O=z;var K=p(z);if(m!==void 0&&y.hasValue){var H=y.value;if(m(H,K))return A=H,H}return A=K,K}var k=O,W=A;if(r(k,z))return W;var B=p(z);return m!==void 0&&m(W,B)?W:(O=z,A=B,B)},I=f===void 0?null:f,L=function(){return D(d())},j=I===null?void 0:function(){return D(I())};return[L,j]},[d,f,p,m]),x=b[0],E=b[1],R=o(u,x,E);return s(function(){y.hasValue=!0,y.value=R},[R]),l(R),R}p1.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),p1}var v1={};/**
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 HT;function JZ(){if(HT)return v1;HT=1;var e=w,t=wE;function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return v1.useSyncExternalStoreWithSelector=function(c,u,d,f,p){var m=i(null);if(m.current===null){var v={hasValue:!1,value:null};m.current=v}else v=m.current;m=a(function(){function b(O){if(!x){if(x=!0,E=O,O=f(O),p!==void 0&&v.hasValue){var A=v.value;if(p(A,O))return R=A}return R=O}if(A=R,r(E,O))return A;var D=f(O);return p!==void 0&&p(A,D)?A:(E=O,R=D)}var x=!1,E,R,P=d===void 0?null:d;return[function(){return b(u())},P===null?void 0:function(){return b(P())}]},[u,d,f,p]);var y=o(c,m[0],m[1]);return s(function(){v.hasValue=!0,v.value=y},[y]),l(y),y},v1}process.env.NODE_ENV==="production"?ES.exports=JZ():ES.exports=ZZ();var eJ=ES.exports;const tJ=sl(eJ);var D5={VITE_SEMAPHOR_API:"https://semaphor.cloud/api/v1",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:nJ}=w,{useSyncExternalStoreWithSelector:rJ}=tJ;let WT=!1;function oJ(e,t=e.getState,n){(D5?"production":void 0)!=="production"&&n&&!WT&&(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"),WT=!0);const r=rJ(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return nJ(r),r}const UT=e=>{(D5?"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"?KZ(e):e,n=(r,o)=>oJ(t,r,o);return Object.assign(n,t),n},M5=e=>e?UT(e):UT;var I5=Symbol.for("immer-nothing"),GT=Symbol.for("immer-draftable"),Po=Symbol.for("immer-state"),iJ=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 eo(e,...t){if(process.env.NODE_ENV!=="production"){const n=iJ[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 xd=Object.getPrototypeOf;function wd(e){return!!e&&!!e[Po]}function Ec(e){var t;return e?$5(e)||Array.isArray(e)||!!e[GT]||!!((t=e.constructor)!=null&&t[GT])||S0(e)||C0(e):!1}var sJ=Object.prototype.constructor.toString();function $5(e){if(!e||typeof e!="object")return!1;const t=xd(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)===sJ}function Hh(e,t){w0(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function w0(e){const t=e[Po];return t?t.type_:Array.isArray(e)?1:S0(e)?2:C0(e)?3:0}function PS(e,t){return w0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function N5(e,t,n){const r=w0(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function aJ(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function S0(e){return e instanceof Map}function C0(e){return e instanceof Set}function kl(e){return e.copy_||e.base_}function OS(e,t){if(S0(e))return new Map(e);if(C0(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&$5(e))return xd(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[Po];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(xd(e),n)}function SE(e,t=!1){return _0(e)||wd(e)||!Ec(e)||(w0(e)>1&&(e.set=e.add=e.clear=e.delete=lJ),Object.freeze(e),t&&Hh(e,(n,r)=>SE(r,!0))),e}function lJ(){eo(2)}function _0(e){return Object.isFrozen(e)}var cJ={};function Rc(e){const t=cJ[e];return t||eo(0,e),t}var Wh;function k5(){return Wh}function uJ(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function qT(e,t){t&&(Rc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function AS(e){TS(e),e.drafts_.forEach(dJ),e.drafts_=null}function TS(e){e===Wh&&(Wh=e.parent_)}function YT(e){return Wh=uJ(Wh,e)}function dJ(e){const t=e[Po];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function KT(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Po].modified_&&(AS(t),eo(4)),Ec(e)&&(e=cb(t,e),t.parent_||ub(t,e)),t.patches_&&Rc("Patches").generateReplacementPatches_(n[Po].base_,e,t.patches_,t.inversePatches_)):e=cb(t,n,[]),AS(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==I5?e:void 0}function cb(e,t,n){if(_0(t))return t;const r=t[Po];if(!r)return Hh(t,(o,i)=>XT(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return ub(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),Hh(i,(a,l)=>XT(e,r,o,a,l,n,s)),ub(e,o,!1),n&&e.patches_&&Rc("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function XT(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&eo(5),wd(o)){const a=i&&t&&t.type_!==3&&!PS(t.assigned_,r)?i.concat(r):void 0,l=cb(e,o,a);if(N5(n,r,l),wd(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(Ec(o)&&!_0(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;cb(e,o),(!t||!t.scope_.parent_)&&ub(e,o)}}function ub(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&SE(t,n)}function fJ(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:k5(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=CE;n&&(o=[r],i=Uh);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var CE={get(e,t){if(t===Po)return e;const n=kl(e);if(!PS(n,t))return hJ(e,n,t);const r=n[t];return e.finalized_||!Ec(r)?r:r===b1(e.base_,t)?(y1(e),e.copy_[t]=MS(r,e)):r},has(e,t){return t in kl(e)},ownKeys(e){return Reflect.ownKeys(kl(e))},set(e,t,n){const r=L5(kl(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=b1(kl(e),t),i=o==null?void 0:o[Po];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(aJ(n,o)&&(n!==void 0||PS(e.base_,t)))return!0;y1(e),DS(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 b1(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,y1(e),DS(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=kl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){eo(11)},getPrototypeOf(e){return xd(e.base_)},setPrototypeOf(){eo(12)}},Uh={};Hh(CE,(e,t)=>{Uh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Uh.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&eo(13),Uh.set.call(this,e,t,void 0)};Uh.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&eo(14),CE.set.call(this,e[0],t,n,e[0])};function b1(e,t){const n=e[Po];return(n?kl(n):e)[t]}function hJ(e,t,n){var o;const r=L5(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function L5(e,t){if(!(t in e))return;let n=xd(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=xd(n)}}function DS(e){e.modified_||(e.modified_=!0,e.parent_&&DS(e.parent_))}function y1(e){e.copy_||(e.copy_=OS(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var pJ=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(l=i,...c){return s.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&eo(6),r!==void 0&&typeof r!="function"&&eo(7);let o;if(Ec(t)){const i=YT(this),s=MS(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?AS(i):TS(i)}return qT(i,r),KT(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===I5&&(o=void 0),this.autoFreeze_&&SE(o,!0),r){const i=[],s=[];Rc("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else eo(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){Ec(e)||eo(8),wd(e)&&(e=gJ(e));const t=YT(this),n=MS(e,void 0);return n[Po].isManual_=!0,TS(t),n}finishDraft(e,t){const n=e&&e[Po];(!n||!n.isManual_)&&eo(9);const{scope_:r}=n;return qT(r,t),KT(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=Rc("Patches").applyPatches_;return wd(e)?r(e,t):this.produce(e,o=>r(o,t))}};function MS(e,t){const n=S0(e)?Rc("MapSet").proxyMap_(e,t):C0(e)?Rc("MapSet").proxySet_(e,t):fJ(e,t);return(t?t.scope_:k5()).drafts_.push(n),n}function gJ(e){return wd(e)||eo(10,e),F5(e)}function F5(e){if(!Ec(e)||_0(e))return e;const t=e[Po];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=OS(e,t.scope_.immer_.useStrictShallowCopy_)}else n=OS(e,!0);return Hh(n,(r,o)=>{N5(n,r,F5(o))}),t&&(t.finalized_=!1),n}var Oo=new pJ,mJ=Oo.produce;Oo.produceWithPatches.bind(Oo);Oo.setAutoFreeze.bind(Oo);Oo.setUseStrictShallowCopy.bind(Oo);Oo.applyPatches.bind(Oo);Oo.createDraft.bind(Oo);Oo.finishDraft.bind(Oo);const vJ=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?mJ(o):o;return t(a,i,...s)},e(r.setState,n,r)),j5=vJ;var IS,Am=Pn;if(process.env.NODE_ENV==="production")IS=Am.createRoot,Am.hydrateRoot;else{var QT=Am.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;IS=function(e,t){QT.usingClientEntryPoint=!0;try{return Am.createRoot(e,t)}finally{QT.usingClientEntryPoint=!1}}}var z5={},B5={},_E={exports:{}},mt=String,V5=function(){return{isColorSupported:!1,reset:mt,bold:mt,dim:mt,italic:mt,underline:mt,inverse:mt,hidden:mt,strikethrough:mt,black:mt,red:mt,green:mt,yellow:mt,blue:mt,magenta:mt,cyan:mt,white:mt,gray:mt,bgBlack:mt,bgRed:mt,bgGreen:mt,bgYellow:mt,bgBlue:mt,bgMagenta:mt,bgCyan:mt,bgWhite:mt,blackBright:mt,redBright:mt,greenBright:mt,yellowBright:mt,blueBright:mt,magentaBright:mt,cyanBright:mt,whiteBright:mt,bgBlackBright:mt,bgRedBright:mt,bgGreenBright:mt,bgYellowBright:mt,bgBlueBright:mt,bgMagentaBright:mt,bgCyanBright:mt,bgWhiteBright:mt}};_E.exports=V5();_E.exports.createColors=V5;var bJ=_E.exports;(function(e){Object.defineProperty(e,"__esModule",{value:!0});function t(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}t(e,{dim:function(){return s},default:function(){return a}});const n=r(bJ);function r(l){return l&&l.__esModule?l:{default:l}}let o=new Set;function i(l,c,u){typeof process<"u"&&process.env.JEST_WORKER_ID||u&&o.has(u)||(u&&o.add(u),console.warn(""),c.forEach(d=>console.warn(l,"-",d)))}function s(l){return n.default.dim(l)}const a={info(l,c){i(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){i(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){i(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(B5);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(B5);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}}})(z5);let x1=z5;var yJ=(x1.__esModule?x1:{default:x1}).default;const Ut=sl(yJ),H5=`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
+ `,W5="dm",$S=[{locale:"en-US",currency:"USD",currencyName:"US Dollar"},{locale:"en-GB",currency:"GBP",currencyName:"British Pound"},{locale:"en-CA",currency:"CAD",currencyName:"Canadian Dollar"},{locale:"en-AU",currency:"AUD",currencyName:"Australian Dollar"},{locale:"en-IN",currency:"INR",currencyName:"Indian Rupee"},{locale:"ja-JP",currency:"JPY",currencyName:"Japanese Yen"},{locale:"de-DE",currency:"EUR",currencyName:"Germany (Eurozone)"},{locale:"fr-FR",currency:"EUR",currencyName:"France (Eurozone)"},{locale:"es-ES",currency:"EUR",currencyName:"Spain (Eurozone)"},{locale:"it-IT",currency:"EUR",currencyName:"Italy (Eurozone)"},{locale:"fi-FI",currency:"EUR",currencyName:"Finland (Eurozone)"},{locale:"nl-NL",currency:"EUR",currencyName:"Netherlands (Eurozone)"},{locale:"zh-CN",currency:"CNY",currencyName:"Chinese Yuan"},{locale:"ru-RU",currency:"RUB",currencyName:"Russian Ruble"},{locale:"pt-BR",currency:"BRL",currencyName:"Brazilian Real"},{locale:"ko-KR",currency:"KRW",currencyName:"South Korean Won"},{locale:"ar-SA",currency:"SAR",currencyName:"Saudi Riyal"},{locale:"sv-SE",currency:"SEK",currencyName:"Swedish Krona"},{locale:"no-NO",currency:"NOK",currencyName:"Norwegian Krone"},{locale:"da-DK",currency:"DKK",currencyName:"Danish Krone"},{locale:"pl-PL",currency:"PLN",currencyName:"Polish Zloty"},{locale:"tr-TR",currency:"TRY",currencyName:"Turkish Lira"},{locale:"he-IL",currency:"ILS",currencyName:"Israeli Shekel"},{locale:"th-TH",currency:"THB",currencyName:"Thai Baht"},{locale:"vi-VN",currency:"VND",currencyName:"Vietnamese Dong"},{locale:"id-ID",currency:"IDR",currencyName:"Indonesian Rupiah"},{locale:"mx-MX",currency:"MXN",currencyName:"Mexican Peso"},{locale:"za-ZA",currency:"ZAR",currencyName:"South African Rand"},{locale:"sg-SG",currency:"SGD",currencyName:"Singapore Dollar"},{locale:"hk-HK",currency:"HKD",currencyName:"Hong Kong Dollar"},{locale:"ch-CH",currency:"CHF",currencyName:"Swiss Franc"},{locale:"my-MY",currency:"MYR",currencyName:"Malaysian Ringgit"},{locale:"ph-PH",currency:"PHP",currencyName:"Philippine Peso"},{locale:"eg-EG",currency:"EGP",currencyName:"Egyptian Pound"},{locale:"nz-NZ",currency:"NZD",currencyName:"New Zealand Dollar"}],xJ=[{label:"English",locales:[{code:"en-US",name:"US English"},{code:"en-GB",name:"British English"},{code:"en-AU",name:"Australian English"},{code:"en-CA",name:"Canadian English"}]},{label:"French",locales:[{code:"fr-FR",name:"France French"},{code:"fr-CA",name:"Canadian French"}]},{label:"Spanish",locales:[{code:"es-ES",name:"Spain Spanish"},{code:"es-MX",name:"Mexican Spanish"},{code:"es-419",name:"Latin American Spanish"}]},{label:"German",locales:[{code:"de-DE",name:"Germany German"},{code:"de-CH",name:"Swiss German"}]},{label:"Chinese",locales:[{code:"zh-CN",name:"Simplified Chinese (China)"},{code:"zh-TW",name:"Traditional Chinese (Taiwan)"},{code:"zh-HK",name:"Hong Kong Chinese"}]},{label:"Japanese",locales:[{code:"ja-JP",name:"Japanese"}]},{label:"Arabic",locales:[{code:"ar-EG",name:"Egypt Arabic"},{code:"ar-SA",name:"Saudi Arabia Arabic"}]},{label:"Russian",locales:[{code:"ru-RU",name:"Russian"}]},{label:"Portuguese",locales:[{code:"pt-PT",name:"Portugal Portuguese"},{code:"pt-BR",name:"Brazil Portuguese"}]},{label:"Indian Languages",locales:[{code:"hi-IN",name:"Hindi (India)"},{code:"ta-IN",name:"Tamil (India)"}]},{label:"Korean",locales:[{code:"ko-KR",name:"Korean"}]},{label:"Italian",locales:[{code:"it-IT",name:"Italian (Italy)"}]},{label:"Dutch",locales:[{code:"nl-NL",name:"Dutch (Netherlands)"}]},{label:"Swedish",locales:[{code:"sv-SE",name:"Swedish (Sweden)"}]},{label:"Turkish",locales:[{code:"tr-TR",name:"Turkish (Turkey)"}]},{label:"Hebrew",locales:[{code:"he-IL",name:"Hebrew (Israel)"}]},{label:"Thai",locales:[{code:"th-TH",name:"Thai (Thailand)"}]},{label:"Polish",locales:[{code:"pl-PL",name:"Polish (Poland)"}]},{label:"Greek",locales:[{code:"el-GR",name:"Greek (Greece)"}]},{label:"Norwegian",locales:[{code:"no-NO",name:"Norwegian (Norway)"}]}],EE=["lg","md","sm","xs","xxs"],db={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[Ut.blue[500],Ut.teal[500],Ut.amber[500],Ut.red[500],Ut.indigo[500],Ut.green[500]],borderColor:[Ut.blue[500],Ut.teal[500],Ut.amber[500],Ut.red[500],Ut.indigo[500],Ut.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:NS},title:{display:!0},tooltip:{backgroundColor:"#fff",bodyColor:"#000",borderWidth:.25,titleColor:"#000",borderColor:"rgb(128,131,139)",cornerRadius:4,usePointStyle:!0,pointStyle:"rectRounded",boxPadding:4},legend:{position:"top",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},scales:{y:{grid:{display:!0},title:{display:!0,text:""},beginAtZero:!0,ticks:{precision:0}},x:{grid:{display:!0},title:{display:!0}}},layout:{padding:{top:-40}},borderRadius:2,responsive:!0,maintainAspectRatio:!1}}},dark:{chart:{dataset:{backgroundColor:[Ut.blue[500],Ut.teal[500],Ut.amber[500],Ut.red[500],Ut.indigo[500],Ut.green[500]],borderColor:[Ut.blue[500],Ut.teal[500],Ut.amber[500],Ut.red[500],Ut.indigo[500],Ut.green[500]],datalables:{color:NS}},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:Ut.slate[800]}},y:{grid:{display:!0,color:Ut.slate[800]}}}}}}};function NS(e){var r,o,i,s,a,l;const t=(a=(s=(i=(o=(r=e==null?void 0:e.chart)==null?void 0:r.config)==null?void 0:o._config)==null?void 0:i.options)==null?void 0:s.plugins)==null?void 0:a.datalabels;let n=(l=e==null?void 0:e.dataset)==null?void 0:l.backgroundColor;return(t==null?void 0:t.align)==="end"&&(t==null?void 0:t.anchor)==="end"&&(n=Gh()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Gh()),Sd(n)}function Gh(){return we.getState().theme==="dark"?"#000000":"#FFFFFF"}function Sd(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return Ut.gray[500];const d=u.replace("#",""),f=parseInt(d.substring(0,2),16),p=parseInt(d.substring(2,4),16),m=parseInt(d.substring(4,6),16);t+=f,n+=p,r+=m,o++};Array.isArray(e)?e.forEach(u=>{i(u)}):i(e);const s=t/o,a=n/o,l=r/o;return(s*299+a*587+l*114)/1e3>=180?"black":"white"}const E0=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],Xp=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],Ud=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],RE=["boolean"];function PE(e){return e.match(/[A-Z]/)?`"${e}"`:e}function wJ(e,t,n,r){const{measures:o,dimensions:i}=e,s=o==null?void 0:o.map(u=>`${u.calc}(${u.name}) as ${u.calc}_${u.name.replace(/"/g,"")}`).join(", "),a=(i==null?void 0:i.join(", "))||"";let l="";const c=r?`${W5}.${r}`:U5(t,n);if(s&&a)return l=`SELECT ${a}, COUNT(*) as count, ${s} FROM ${c} GROUP BY ${a} ORDER BY ${a} DESC`,l;if(!s&&a)return l=`SELECT ${a}, COUNT(*) as count FROM ${c} GROUP BY ${a} ORDER BY ${a} DESC`,l;if(s&&!a)return l=`SELECT ${s} FROM ${c}`,l}function SJ(e,t,n="AVG"){var i,s,a,l;let r={};const o=PE(e.column_name);return E0.includes(e.data_type)&&(((i=t.dimensions)==null?void 0:i.includes(o))?r={...t,dimensions:(s=t.dimensions)==null?void 0:s.filter(u=>u!==o)}:r={...t,dimensions:[...t.dimensions||[],o]}),Xp.includes(e.data_type)&&(((a=t.measures)==null?void 0:a.some(u=>u.name===o&&u.calc===n))?r={...t,measures:(l=t.measures)==null?void 0:l.filter(u=>!(u.name===o&&u.calc===n))}:r={...t,measures:[...t.measures||[],{name:o,calc:n||"SUM"}]}),r}function Wu(e){return E0.includes(e.dataType)?"string":Xp.includes(e.dataType)?"number":Ud.includes(e.dataType)?"date":RE.includes(e.dataType)?"boolean":"string"}function CJ(e){let t;const n=e.data_type.toLowerCase();return E0.includes(n)?t="T":Xp.includes(n)?t="#":Ud.includes(n)?t="D":RE.includes(n)?t="B":t="?",t}function _J(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 U5(e,t){return t==="api"||e===PE("NA")||e==="public"?t:e?`${e}.${t}`:`${t}`}const EJ=e=>{const t=new Date(e);return!isNaN(t.getTime())},RJ=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),R0=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?EJ(e)?t="date":RJ(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function PJ({get:e,dataPoint:t,card:n}){var f;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValue:i,replaceFilterValue:s,removeFilteringCard:a}=e().actions,l=e().filteringCards,{columnName:c,columnValue:u}=t,d={filterId:n.id,connectionId:n==null?void 0:n.connectionId,tableName:n.lastSelectedTable,name:c,expression:(f=n.preferences)==null?void 0:f.filterOnClickField,valueType:R0(u),operation:"=",values:[u]};if(l!=null&&l.find(p=>p.id===n.id)){const p=n.id;if(u==null){a(n),i(p);return}else s(d)}o(n),r(d)}var fb={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
+ */fb.exports;(function(e,t){(function(){var n,r="4.17.21",o=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",d=1,f=2,p=4,m=1,v=2,y=1,b=2,x=4,E=8,R=16,P=32,O=64,A=128,D=256,I=512,L=30,j="...",z=800,K=16,H=1,k=2,W=3,B=1/0,U=9007199254740991,q=17976931348623157e292,$=NaN,Y=4294967295,X=Y-1,M=Y>>>1,oe=[["ary",A],["bind",y],["bindKey",b],["curry",E],["curryRight",R],["flip",I],["partial",P],["partialRight",O],["rearg",D]],te="[object Arguments]",ie="[object Array]",ne="[object AsyncFunction]",Z="[object Boolean]",ae="[object Date]",ce="[object DOMException]",ve="[object Error]",ee="[object Function]",ge="[object GeneratorFunction]",fe="[object Map]",Se="[object Number]",Ae="[object Null]",ze="[object Object]",Ie="[object Promise]",De="[object Proxy]",ot="[object RegExp]",_t="[object Set]",rn="[object String]",$t="[object Symbol]",on="[object Undefined]",pe="[object WeakMap]",Pe="[object WeakSet]",je="[object ArrayBuffer]",qe="[object DataView]",tt="[object Float32Array]",sn="[object Float64Array]",_n="[object Int8Array]",mn="[object Int16Array]",Bn="[object Int32Array]",vn="[object Uint8Array]",Bt="[object Uint8ClampedArray]",cn="[object Uint16Array]",An="[object Uint32Array]",et=/\b__p \+= '';/g,pt=/\b(__p \+=) '' \+/g,Mt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Jt=/&(?:amp|lt|gt|quot|#39);/g,yt=/[&<>"']/g,Vn=RegExp(Jt.source),ai=RegExp(yt.source),na=/<%-([\s\S]+?)%>/g,li=/<%([\s\S]+?)%>/g,gs=/<%=([\s\S]+?)%>/g,Mi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ms=/^\w*$/,ra=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ii=/[\\^$.*+?()[\]{}|]/g,vs=RegExp(Ii.source),er=/^\s+/,$i=/\s/,oa=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ia=/\{\n\/\* \[wrapped with (.+)\] \*/,N=/,? & /,se=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,he=/[()=,{}\[\]\/\s]/,Oe=/\\(\\)?/g,Be=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ue=/\w*$/,Fe=/^[-+]0x[0-9a-f]+$/i,ke=/^0b[01]+$/i,Me=/^\[object .+?Constructor\]$/,J=/^0o[0-7]+$/i,be=/^(?:0|[1-9]\d*)$/,$e=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,at=/($^)/,En=/['\n\r\u2028\u2029\\]/g,ft="\\ud800-\\udfff",pr="\\u0300-\\u036f",Fo="\\ufe20-\\ufe2f",vl="\\u20d0-\\u20ff",tr=pr+Fo+vl,df="\\u2700-\\u27bf",ff="a-z\\xdf-\\xf6\\xf8-\\xff",KW="\\xac\\xb1\\xd7\\xf7",XW="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",QW="\\u2000-\\u206f",ZW=" \\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",hO="A-Z\\xc0-\\xd6\\xd8-\\xde",pO="\\ufe0e\\ufe0f",gO=KW+XW+QW+ZW,rx="['’]",JW="["+ft+"]",mO="["+gO+"]",Bg="["+tr+"]",vO="\\d+",eU="["+df+"]",bO="["+ff+"]",yO="[^"+ft+gO+vO+df+ff+hO+"]",ox="\\ud83c[\\udffb-\\udfff]",tU="(?:"+Bg+"|"+ox+")",xO="[^"+ft+"]",ix="(?:\\ud83c[\\udde6-\\uddff]){2}",sx="[\\ud800-\\udbff][\\udc00-\\udfff]",ru="["+hO+"]",wO="\\u200d",SO="(?:"+bO+"|"+yO+")",nU="(?:"+ru+"|"+yO+")",CO="(?:"+rx+"(?:d|ll|m|re|s|t|ve))?",_O="(?:"+rx+"(?:D|LL|M|RE|S|T|VE))?",EO=tU+"?",RO="["+pO+"]?",rU="(?:"+wO+"(?:"+[xO,ix,sx].join("|")+")"+RO+EO+")*",oU="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",iU="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",PO=RO+EO+rU,sU="(?:"+[eU,ix,sx].join("|")+")"+PO,aU="(?:"+[xO+Bg+"?",Bg,ix,sx,JW].join("|")+")",lU=RegExp(rx,"g"),cU=RegExp(Bg,"g"),ax=RegExp(ox+"(?="+ox+")|"+aU+PO,"g"),uU=RegExp([ru+"?"+bO+"+"+CO+"(?="+[mO,ru,"$"].join("|")+")",nU+"+"+_O+"(?="+[mO,ru+SO,"$"].join("|")+")",ru+"?"+SO+"+"+CO,ru+"+"+_O,iU,oU,vO,sU].join("|"),"g"),dU=RegExp("["+wO+ft+tr+pO+"]"),fU=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,hU=["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"],pU=-1,bn={};bn[tt]=bn[sn]=bn[_n]=bn[mn]=bn[Bn]=bn[vn]=bn[Bt]=bn[cn]=bn[An]=!0,bn[te]=bn[ie]=bn[je]=bn[Z]=bn[qe]=bn[ae]=bn[ve]=bn[ee]=bn[fe]=bn[Se]=bn[ze]=bn[ot]=bn[_t]=bn[rn]=bn[pe]=!1;var fn={};fn[te]=fn[ie]=fn[je]=fn[qe]=fn[Z]=fn[ae]=fn[tt]=fn[sn]=fn[_n]=fn[mn]=fn[Bn]=fn[fe]=fn[Se]=fn[ze]=fn[ot]=fn[_t]=fn[rn]=fn[$t]=fn[vn]=fn[Bt]=fn[cn]=fn[An]=!0,fn[ve]=fn[ee]=fn[pe]=!1;var gU={À:"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"},mU={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},vU={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},bU={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},yU=parseFloat,xU=parseInt,OO=typeof Pa=="object"&&Pa&&Pa.Object===Object&&Pa,wU=typeof self=="object"&&self&&self.Object===Object&&self,ar=OO||wU||Function("return this")(),lx=t&&!t.nodeType&&t,bl=lx&&!0&&e&&!e.nodeType&&e,AO=bl&&bl.exports===lx,cx=AO&&OO.process,jo=function(){try{var ue=bl&&bl.require&&bl.require("util").types;return ue||cx&&cx.binding&&cx.binding("util")}catch{}}(),TO=jo&&jo.isArrayBuffer,DO=jo&&jo.isDate,MO=jo&&jo.isMap,IO=jo&&jo.isRegExp,$O=jo&&jo.isSet,NO=jo&&jo.isTypedArray;function co(ue,ye,me){switch(me.length){case 0:return ue.call(ye);case 1:return ue.call(ye,me[0]);case 2:return ue.call(ye,me[0],me[1]);case 3:return ue.call(ye,me[0],me[1],me[2])}return ue.apply(ye,me)}function SU(ue,ye,me,Ve){for(var ut=-1,Ht=ue==null?0:ue.length;++ut<Ht;){var Qn=ue[ut];ye(Ve,Qn,me(Qn),ue)}return Ve}function zo(ue,ye){for(var me=-1,Ve=ue==null?0:ue.length;++me<Ve&&ye(ue[me],me,ue)!==!1;);return ue}function CU(ue,ye){for(var me=ue==null?0:ue.length;me--&&ye(ue[me],me,ue)!==!1;);return ue}function kO(ue,ye){for(var me=-1,Ve=ue==null?0:ue.length;++me<Ve;)if(!ye(ue[me],me,ue))return!1;return!0}function sa(ue,ye){for(var me=-1,Ve=ue==null?0:ue.length,ut=0,Ht=[];++me<Ve;){var Qn=ue[me];ye(Qn,me,ue)&&(Ht[ut++]=Qn)}return Ht}function Vg(ue,ye){var me=ue==null?0:ue.length;return!!me&&ou(ue,ye,0)>-1}function ux(ue,ye,me){for(var Ve=-1,ut=ue==null?0:ue.length;++Ve<ut;)if(me(ye,ue[Ve]))return!0;return!1}function Rn(ue,ye){for(var me=-1,Ve=ue==null?0:ue.length,ut=Array(Ve);++me<Ve;)ut[me]=ye(ue[me],me,ue);return ut}function aa(ue,ye){for(var me=-1,Ve=ye.length,ut=ue.length;++me<Ve;)ue[ut+me]=ye[me];return ue}function dx(ue,ye,me,Ve){var ut=-1,Ht=ue==null?0:ue.length;for(Ve&&Ht&&(me=ue[++ut]);++ut<Ht;)me=ye(me,ue[ut],ut,ue);return me}function _U(ue,ye,me,Ve){var ut=ue==null?0:ue.length;for(Ve&&ut&&(me=ue[--ut]);ut--;)me=ye(me,ue[ut],ut,ue);return me}function fx(ue,ye){for(var me=-1,Ve=ue==null?0:ue.length;++me<Ve;)if(ye(ue[me],me,ue))return!0;return!1}var EU=hx("length");function RU(ue){return ue.split("")}function PU(ue){return ue.match(se)||[]}function LO(ue,ye,me){var Ve;return me(ue,function(ut,Ht,Qn){if(ye(ut,Ht,Qn))return Ve=Ht,!1}),Ve}function Hg(ue,ye,me,Ve){for(var ut=ue.length,Ht=me+(Ve?1:-1);Ve?Ht--:++Ht<ut;)if(ye(ue[Ht],Ht,ue))return Ht;return-1}function ou(ue,ye,me){return ye===ye?jU(ue,ye,me):Hg(ue,FO,me)}function OU(ue,ye,me,Ve){for(var ut=me-1,Ht=ue.length;++ut<Ht;)if(Ve(ue[ut],ye))return ut;return-1}function FO(ue){return ue!==ue}function jO(ue,ye){var me=ue==null?0:ue.length;return me?gx(ue,ye)/me:$}function hx(ue){return function(ye){return ye==null?n:ye[ue]}}function px(ue){return function(ye){return ue==null?n:ue[ye]}}function zO(ue,ye,me,Ve,ut){return ut(ue,function(Ht,Qn,un){me=Ve?(Ve=!1,Ht):ye(me,Ht,Qn,un)}),me}function AU(ue,ye){var me=ue.length;for(ue.sort(ye);me--;)ue[me]=ue[me].value;return ue}function gx(ue,ye){for(var me,Ve=-1,ut=ue.length;++Ve<ut;){var Ht=ye(ue[Ve]);Ht!==n&&(me=me===n?Ht:me+Ht)}return me}function mx(ue,ye){for(var me=-1,Ve=Array(ue);++me<ue;)Ve[me]=ye(me);return Ve}function TU(ue,ye){return Rn(ye,function(me){return[me,ue[me]]})}function BO(ue){return ue&&ue.slice(0,UO(ue)+1).replace(er,"")}function uo(ue){return function(ye){return ue(ye)}}function vx(ue,ye){return Rn(ye,function(me){return ue[me]})}function hf(ue,ye){return ue.has(ye)}function VO(ue,ye){for(var me=-1,Ve=ue.length;++me<Ve&&ou(ye,ue[me],0)>-1;);return me}function HO(ue,ye){for(var me=ue.length;me--&&ou(ye,ue[me],0)>-1;);return me}function DU(ue,ye){for(var me=ue.length,Ve=0;me--;)ue[me]===ye&&++Ve;return Ve}var MU=px(gU),IU=px(mU);function $U(ue){return"\\"+bU[ue]}function NU(ue,ye){return ue==null?n:ue[ye]}function iu(ue){return dU.test(ue)}function kU(ue){return fU.test(ue)}function LU(ue){for(var ye,me=[];!(ye=ue.next()).done;)me.push(ye.value);return me}function bx(ue){var ye=-1,me=Array(ue.size);return ue.forEach(function(Ve,ut){me[++ye]=[ut,Ve]}),me}function WO(ue,ye){return function(me){return ue(ye(me))}}function la(ue,ye){for(var me=-1,Ve=ue.length,ut=0,Ht=[];++me<Ve;){var Qn=ue[me];(Qn===ye||Qn===u)&&(ue[me]=u,Ht[ut++]=me)}return Ht}function Wg(ue){var ye=-1,me=Array(ue.size);return ue.forEach(function(Ve){me[++ye]=Ve}),me}function FU(ue){var ye=-1,me=Array(ue.size);return ue.forEach(function(Ve){me[++ye]=[Ve,Ve]}),me}function jU(ue,ye,me){for(var Ve=me-1,ut=ue.length;++Ve<ut;)if(ue[Ve]===ye)return Ve;return-1}function zU(ue,ye,me){for(var Ve=me+1;Ve--;)if(ue[Ve]===ye)return Ve;return Ve}function su(ue){return iu(ue)?VU(ue):EU(ue)}function ci(ue){return iu(ue)?HU(ue):RU(ue)}function UO(ue){for(var ye=ue.length;ye--&&$i.test(ue.charAt(ye)););return ye}var BU=px(vU);function VU(ue){for(var ye=ax.lastIndex=0;ax.test(ue);)++ye;return ye}function HU(ue){return ue.match(ax)||[]}function WU(ue){return ue.match(uU)||[]}var UU=function ue(ye){ye=ye==null?ar:au.defaults(ar.Object(),ye,au.pick(ar,hU));var me=ye.Array,Ve=ye.Date,ut=ye.Error,Ht=ye.Function,Qn=ye.Math,un=ye.Object,yx=ye.RegExp,GU=ye.String,Bo=ye.TypeError,Ug=me.prototype,qU=Ht.prototype,lu=un.prototype,Gg=ye["__core-js_shared__"],qg=qU.toString,en=lu.hasOwnProperty,YU=0,GO=function(){var h=/[^.]+$/.exec(Gg&&Gg.keys&&Gg.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:""}(),Yg=lu.toString,KU=qg.call(un),XU=ar._,QU=yx("^"+qg.call(en).replace(Ii,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kg=AO?ye.Buffer:n,ca=ye.Symbol,Xg=ye.Uint8Array,qO=Kg?Kg.allocUnsafe:n,Qg=WO(un.getPrototypeOf,un),YO=un.create,KO=lu.propertyIsEnumerable,Zg=Ug.splice,XO=ca?ca.isConcatSpreadable:n,pf=ca?ca.iterator:n,yl=ca?ca.toStringTag:n,Jg=function(){try{var h=_l(un,"defineProperty");return h({},"",{}),h}catch{}}(),ZU=ye.clearTimeout!==ar.clearTimeout&&ye.clearTimeout,JU=Ve&&Ve.now!==ar.Date.now&&Ve.now,eG=ye.setTimeout!==ar.setTimeout&&ye.setTimeout,em=Qn.ceil,tm=Qn.floor,xx=un.getOwnPropertySymbols,tG=Kg?Kg.isBuffer:n,QO=ye.isFinite,nG=Ug.join,rG=WO(un.keys,un),Zn=Qn.max,gr=Qn.min,oG=Ve.now,iG=ye.parseInt,ZO=Qn.random,sG=Ug.reverse,wx=_l(ye,"DataView"),gf=_l(ye,"Map"),Sx=_l(ye,"Promise"),cu=_l(ye,"Set"),mf=_l(ye,"WeakMap"),vf=_l(un,"create"),nm=mf&&new mf,uu={},aG=El(wx),lG=El(gf),cG=El(Sx),uG=El(cu),dG=El(mf),rm=ca?ca.prototype:n,bf=rm?rm.valueOf:n,JO=rm?rm.toString:n;function V(h){if($n(h)&&!dt(h)&&!(h instanceof It)){if(h instanceof Vo)return h;if(en.call(h,"__wrapped__"))return eT(h)}return new Vo(h)}var du=function(){function h(){}return function(g){if(!Tn(g))return{};if(YO)return YO(g);h.prototype=g;var _=new h;return h.prototype=n,_}}();function om(){}function Vo(h,g){this.__wrapped__=h,this.__actions__=[],this.__chain__=!!g,this.__index__=0,this.__values__=n}V.templateSettings={escape:na,evaluate:li,interpolate:gs,variable:"",imports:{_:V}},V.prototype=om.prototype,V.prototype.constructor=V,Vo.prototype=du(om.prototype),Vo.prototype.constructor=Vo;function It(h){this.__wrapped__=h,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Y,this.__views__=[]}function fG(){var h=new It(this.__wrapped__);return h.__actions__=Br(this.__actions__),h.__dir__=this.__dir__,h.__filtered__=this.__filtered__,h.__iteratees__=Br(this.__iteratees__),h.__takeCount__=this.__takeCount__,h.__views__=Br(this.__views__),h}function hG(){if(this.__filtered__){var h=new It(this);h.__dir__=-1,h.__filtered__=!0}else h=this.clone(),h.__dir__*=-1;return h}function pG(){var h=this.__wrapped__.value(),g=this.__dir__,_=dt(h),T=g<0,F=_?h.length:0,G=Rq(0,F,this.__views__),Q=G.start,re=G.end,de=re-Q,Ce=T?re:Q-1,_e=this.__iteratees__,Re=_e.length,Le=0,Ge=gr(de,this.__takeCount__);if(!_||!T&&F==de&&Ge==de)return CA(h,this.__actions__);var Xe=[];e:for(;de--&&Le<Ge;){Ce+=g;for(var xt=-1,Qe=h[Ce];++xt<Re;){var At=_e[xt],Nt=At.iteratee,po=At.type,Pr=Nt(Qe);if(po==k)Qe=Pr;else if(!Pr){if(po==H)continue e;break e}}Xe[Le++]=Qe}return Xe}It.prototype=du(om.prototype),It.prototype.constructor=It;function xl(h){var g=-1,_=h==null?0:h.length;for(this.clear();++g<_;){var T=h[g];this.set(T[0],T[1])}}function gG(){this.__data__=vf?vf(null):{},this.size=0}function mG(h){var g=this.has(h)&&delete this.__data__[h];return this.size-=g?1:0,g}function vG(h){var g=this.__data__;if(vf){var _=g[h];return _===l?n:_}return en.call(g,h)?g[h]:n}function bG(h){var g=this.__data__;return vf?g[h]!==n:en.call(g,h)}function yG(h,g){var _=this.__data__;return this.size+=this.has(h)?0:1,_[h]=vf&&g===n?l:g,this}xl.prototype.clear=gG,xl.prototype.delete=mG,xl.prototype.get=vG,xl.prototype.has=bG,xl.prototype.set=yG;function bs(h){var g=-1,_=h==null?0:h.length;for(this.clear();++g<_;){var T=h[g];this.set(T[0],T[1])}}function xG(){this.__data__=[],this.size=0}function wG(h){var g=this.__data__,_=im(g,h);if(_<0)return!1;var T=g.length-1;return _==T?g.pop():Zg.call(g,_,1),--this.size,!0}function SG(h){var g=this.__data__,_=im(g,h);return _<0?n:g[_][1]}function CG(h){return im(this.__data__,h)>-1}function _G(h,g){var _=this.__data__,T=im(_,h);return T<0?(++this.size,_.push([h,g])):_[T][1]=g,this}bs.prototype.clear=xG,bs.prototype.delete=wG,bs.prototype.get=SG,bs.prototype.has=CG,bs.prototype.set=_G;function ys(h){var g=-1,_=h==null?0:h.length;for(this.clear();++g<_;){var T=h[g];this.set(T[0],T[1])}}function EG(){this.size=0,this.__data__={hash:new xl,map:new(gf||bs),string:new xl}}function RG(h){var g=vm(this,h).delete(h);return this.size-=g?1:0,g}function PG(h){return vm(this,h).get(h)}function OG(h){return vm(this,h).has(h)}function AG(h,g){var _=vm(this,h),T=_.size;return _.set(h,g),this.size+=_.size==T?0:1,this}ys.prototype.clear=EG,ys.prototype.delete=RG,ys.prototype.get=PG,ys.prototype.has=OG,ys.prototype.set=AG;function wl(h){var g=-1,_=h==null?0:h.length;for(this.__data__=new ys;++g<_;)this.add(h[g])}function TG(h){return this.__data__.set(h,l),this}function DG(h){return this.__data__.has(h)}wl.prototype.add=wl.prototype.push=TG,wl.prototype.has=DG;function ui(h){var g=this.__data__=new bs(h);this.size=g.size}function MG(){this.__data__=new bs,this.size=0}function IG(h){var g=this.__data__,_=g.delete(h);return this.size=g.size,_}function $G(h){return this.__data__.get(h)}function NG(h){return this.__data__.has(h)}function kG(h,g){var _=this.__data__;if(_ instanceof bs){var T=_.__data__;if(!gf||T.length<o-1)return T.push([h,g]),this.size=++_.size,this;_=this.__data__=new ys(T)}return _.set(h,g),this.size=_.size,this}ui.prototype.clear=MG,ui.prototype.delete=IG,ui.prototype.get=$G,ui.prototype.has=NG,ui.prototype.set=kG;function eA(h,g){var _=dt(h),T=!_&&Rl(h),F=!_&&!T&&pa(h),G=!_&&!T&&!F&&gu(h),Q=_||T||F||G,re=Q?mx(h.length,GU):[],de=re.length;for(var Ce in h)(g||en.call(h,Ce))&&!(Q&&(Ce=="length"||F&&(Ce=="offset"||Ce=="parent")||G&&(Ce=="buffer"||Ce=="byteLength"||Ce=="byteOffset")||Cs(Ce,de)))&&re.push(Ce);return re}function tA(h){var g=h.length;return g?h[Ix(0,g-1)]:n}function LG(h,g){return bm(Br(h),Sl(g,0,h.length))}function FG(h){return bm(Br(h))}function Cx(h,g,_){(_!==n&&!di(h[g],_)||_===n&&!(g in h))&&xs(h,g,_)}function yf(h,g,_){var T=h[g];(!(en.call(h,g)&&di(T,_))||_===n&&!(g in h))&&xs(h,g,_)}function im(h,g){for(var _=h.length;_--;)if(di(h[_][0],g))return _;return-1}function jG(h,g,_,T){return ua(h,function(F,G,Q){g(T,F,_(F),Q)}),T}function nA(h,g){return h&&ki(g,nr(g),h)}function zG(h,g){return h&&ki(g,Hr(g),h)}function xs(h,g,_){g=="__proto__"&&Jg?Jg(h,g,{configurable:!0,enumerable:!0,value:_,writable:!0}):h[g]=_}function _x(h,g){for(var _=-1,T=g.length,F=me(T),G=h==null;++_<T;)F[_]=G?n:o1(h,g[_]);return F}function Sl(h,g,_){return h===h&&(_!==n&&(h=h<=_?h:_),g!==n&&(h=h>=g?h:g)),h}function Ho(h,g,_,T,F,G){var Q,re=g&d,de=g&f,Ce=g&p;if(_&&(Q=F?_(h,T,F,G):_(h)),Q!==n)return Q;if(!Tn(h))return h;var _e=dt(h);if(_e){if(Q=Oq(h),!re)return Br(h,Q)}else{var Re=mr(h),Le=Re==ee||Re==ge;if(pa(h))return RA(h,re);if(Re==ze||Re==te||Le&&!F){if(Q=de||Le?{}:UA(h),!re)return de?vq(h,zG(Q,h)):mq(h,nA(Q,h))}else{if(!fn[Re])return F?h:{};Q=Aq(h,Re,re)}}G||(G=new ui);var Ge=G.get(h);if(Ge)return Ge;G.set(h,Q),xT(h)?h.forEach(function(Qe){Q.add(Ho(Qe,g,_,Qe,h,G))}):bT(h)&&h.forEach(function(Qe,At){Q.set(At,Ho(Qe,g,_,At,h,G))});var Xe=Ce?de?Wx:Hx:de?Hr:nr,xt=_e?n:Xe(h);return zo(xt||h,function(Qe,At){xt&&(At=Qe,Qe=h[At]),yf(Q,At,Ho(Qe,g,_,At,h,G))}),Q}function BG(h){var g=nr(h);return function(_){return rA(_,h,g)}}function rA(h,g,_){var T=_.length;if(h==null)return!T;for(h=un(h);T--;){var F=_[T],G=g[F],Q=h[F];if(Q===n&&!(F in h)||!G(Q))return!1}return!0}function oA(h,g,_){if(typeof h!="function")throw new Bo(s);return Rf(function(){h.apply(n,_)},g)}function xf(h,g,_,T){var F=-1,G=Vg,Q=!0,re=h.length,de=[],Ce=g.length;if(!re)return de;_&&(g=Rn(g,uo(_))),T?(G=ux,Q=!1):g.length>=o&&(G=hf,Q=!1,g=new wl(g));e:for(;++F<re;){var _e=h[F],Re=_==null?_e:_(_e);if(_e=T||_e!==0?_e:0,Q&&Re===Re){for(var Le=Ce;Le--;)if(g[Le]===Re)continue e;de.push(_e)}else G(g,Re,T)||de.push(_e)}return de}var ua=DA(Ni),iA=DA(Rx,!0);function VG(h,g){var _=!0;return ua(h,function(T,F,G){return _=!!g(T,F,G),_}),_}function sm(h,g,_){for(var T=-1,F=h.length;++T<F;){var G=h[T],Q=g(G);if(Q!=null&&(re===n?Q===Q&&!ho(Q):_(Q,re)))var re=Q,de=G}return de}function HG(h,g,_,T){var F=h.length;for(_=gt(_),_<0&&(_=-_>F?0:F+_),T=T===n||T>F?F:gt(T),T<0&&(T+=F),T=_>T?0:ST(T);_<T;)h[_++]=g;return h}function sA(h,g){var _=[];return ua(h,function(T,F,G){g(T,F,G)&&_.push(T)}),_}function lr(h,g,_,T,F){var G=-1,Q=h.length;for(_||(_=Dq),F||(F=[]);++G<Q;){var re=h[G];g>0&&_(re)?g>1?lr(re,g-1,_,T,F):aa(F,re):T||(F[F.length]=re)}return F}var Ex=MA(),aA=MA(!0);function Ni(h,g){return h&&Ex(h,g,nr)}function Rx(h,g){return h&&aA(h,g,nr)}function am(h,g){return sa(g,function(_){return _s(h[_])})}function Cl(h,g){g=fa(g,h);for(var _=0,T=g.length;h!=null&&_<T;)h=h[Li(g[_++])];return _&&_==T?h:n}function lA(h,g,_){var T=g(h);return dt(h)?T:aa(T,_(h))}function Er(h){return h==null?h===n?on:Ae:yl&&yl in un(h)?Eq(h):Fq(h)}function Px(h,g){return h>g}function WG(h,g){return h!=null&&en.call(h,g)}function UG(h,g){return h!=null&&g in un(h)}function GG(h,g,_){return h>=gr(g,_)&&h<Zn(g,_)}function Ox(h,g,_){for(var T=_?ux:Vg,F=h[0].length,G=h.length,Q=G,re=me(G),de=1/0,Ce=[];Q--;){var _e=h[Q];Q&&g&&(_e=Rn(_e,uo(g))),de=gr(_e.length,de),re[Q]=!_&&(g||F>=120&&_e.length>=120)?new wl(Q&&_e):n}_e=h[0];var Re=-1,Le=re[0];e:for(;++Re<F&&Ce.length<de;){var Ge=_e[Re],Xe=g?g(Ge):Ge;if(Ge=_||Ge!==0?Ge:0,!(Le?hf(Le,Xe):T(Ce,Xe,_))){for(Q=G;--Q;){var xt=re[Q];if(!(xt?hf(xt,Xe):T(h[Q],Xe,_)))continue e}Le&&Le.push(Xe),Ce.push(Ge)}}return Ce}function qG(h,g,_,T){return Ni(h,function(F,G,Q){g(T,_(F),G,Q)}),T}function wf(h,g,_){g=fa(g,h),h=KA(h,g);var T=h==null?h:h[Li(Uo(g))];return T==null?n:co(T,h,_)}function cA(h){return $n(h)&&Er(h)==te}function YG(h){return $n(h)&&Er(h)==je}function KG(h){return $n(h)&&Er(h)==ae}function Sf(h,g,_,T,F){return h===g?!0:h==null||g==null||!$n(h)&&!$n(g)?h!==h&&g!==g:XG(h,g,_,T,Sf,F)}function XG(h,g,_,T,F,G){var Q=dt(h),re=dt(g),de=Q?ie:mr(h),Ce=re?ie:mr(g);de=de==te?ze:de,Ce=Ce==te?ze:Ce;var _e=de==ze,Re=Ce==ze,Le=de==Ce;if(Le&&pa(h)){if(!pa(g))return!1;Q=!0,_e=!1}if(Le&&!_e)return G||(G=new ui),Q||gu(h)?VA(h,g,_,T,F,G):Cq(h,g,de,_,T,F,G);if(!(_&m)){var Ge=_e&&en.call(h,"__wrapped__"),Xe=Re&&en.call(g,"__wrapped__");if(Ge||Xe){var xt=Ge?h.value():h,Qe=Xe?g.value():g;return G||(G=new ui),F(xt,Qe,_,T,G)}}return Le?(G||(G=new ui),_q(h,g,_,T,F,G)):!1}function QG(h){return $n(h)&&mr(h)==fe}function Ax(h,g,_,T){var F=_.length,G=F,Q=!T;if(h==null)return!G;for(h=un(h);F--;){var re=_[F];if(Q&&re[2]?re[1]!==h[re[0]]:!(re[0]in h))return!1}for(;++F<G;){re=_[F];var de=re[0],Ce=h[de],_e=re[1];if(Q&&re[2]){if(Ce===n&&!(de in h))return!1}else{var Re=new ui;if(T)var Le=T(Ce,_e,de,h,g,Re);if(!(Le===n?Sf(_e,Ce,m|v,T,Re):Le))return!1}}return!0}function uA(h){if(!Tn(h)||Iq(h))return!1;var g=_s(h)?QU:Me;return g.test(El(h))}function ZG(h){return $n(h)&&Er(h)==ot}function JG(h){return $n(h)&&mr(h)==_t}function eq(h){return $n(h)&&_m(h.length)&&!!bn[Er(h)]}function dA(h){return typeof h=="function"?h:h==null?Wr:typeof h=="object"?dt(h)?pA(h[0],h[1]):hA(h):IT(h)}function Tx(h){if(!Ef(h))return rG(h);var g=[];for(var _ in un(h))en.call(h,_)&&_!="constructor"&&g.push(_);return g}function tq(h){if(!Tn(h))return Lq(h);var g=Ef(h),_=[];for(var T in h)T=="constructor"&&(g||!en.call(h,T))||_.push(T);return _}function Dx(h,g){return h<g}function fA(h,g){var _=-1,T=Vr(h)?me(h.length):[];return ua(h,function(F,G,Q){T[++_]=g(F,G,Q)}),T}function hA(h){var g=Gx(h);return g.length==1&&g[0][2]?qA(g[0][0],g[0][1]):function(_){return _===h||Ax(_,h,g)}}function pA(h,g){return Yx(h)&&GA(g)?qA(Li(h),g):function(_){var T=o1(_,h);return T===n&&T===g?i1(_,h):Sf(g,T,m|v)}}function lm(h,g,_,T,F){h!==g&&Ex(g,function(G,Q){if(F||(F=new ui),Tn(G))nq(h,g,Q,_,lm,T,F);else{var re=T?T(Xx(h,Q),G,Q+"",h,g,F):n;re===n&&(re=G),Cx(h,Q,re)}},Hr)}function nq(h,g,_,T,F,G,Q){var re=Xx(h,_),de=Xx(g,_),Ce=Q.get(de);if(Ce){Cx(h,_,Ce);return}var _e=G?G(re,de,_+"",h,g,Q):n,Re=_e===n;if(Re){var Le=dt(de),Ge=!Le&&pa(de),Xe=!Le&&!Ge&&gu(de);_e=de,Le||Ge||Xe?dt(re)?_e=re:Hn(re)?_e=Br(re):Ge?(Re=!1,_e=RA(de,!0)):Xe?(Re=!1,_e=PA(de,!0)):_e=[]:Pf(de)||Rl(de)?(_e=re,Rl(re)?_e=CT(re):(!Tn(re)||_s(re))&&(_e=UA(de))):Re=!1}Re&&(Q.set(de,_e),F(_e,de,T,G,Q),Q.delete(de)),Cx(h,_,_e)}function gA(h,g){var _=h.length;if(_)return g+=g<0?_:0,Cs(g,_)?h[g]:n}function mA(h,g,_){g.length?g=Rn(g,function(G){return dt(G)?function(Q){return Cl(Q,G.length===1?G[0]:G)}:G}):g=[Wr];var T=-1;g=Rn(g,uo(Ke()));var F=fA(h,function(G,Q,re){var de=Rn(g,function(Ce){return Ce(G)});return{criteria:de,index:++T,value:G}});return AU(F,function(G,Q){return gq(G,Q,_)})}function rq(h,g){return vA(h,g,function(_,T){return i1(h,T)})}function vA(h,g,_){for(var T=-1,F=g.length,G={};++T<F;){var Q=g[T],re=Cl(h,Q);_(re,Q)&&Cf(G,fa(Q,h),re)}return G}function oq(h){return function(g){return Cl(g,h)}}function Mx(h,g,_,T){var F=T?OU:ou,G=-1,Q=g.length,re=h;for(h===g&&(g=Br(g)),_&&(re=Rn(h,uo(_)));++G<Q;)for(var de=0,Ce=g[G],_e=_?_(Ce):Ce;(de=F(re,_e,de,T))>-1;)re!==h&&Zg.call(re,de,1),Zg.call(h,de,1);return h}function bA(h,g){for(var _=h?g.length:0,T=_-1;_--;){var F=g[_];if(_==T||F!==G){var G=F;Cs(F)?Zg.call(h,F,1):kx(h,F)}}return h}function Ix(h,g){return h+tm(ZO()*(g-h+1))}function iq(h,g,_,T){for(var F=-1,G=Zn(em((g-h)/(_||1)),0),Q=me(G);G--;)Q[T?G:++F]=h,h+=_;return Q}function $x(h,g){var _="";if(!h||g<1||g>U)return _;do g%2&&(_+=h),g=tm(g/2),g&&(h+=h);while(g);return _}function Et(h,g){return Qx(YA(h,g,Wr),h+"")}function sq(h){return tA(mu(h))}function aq(h,g){var _=mu(h);return bm(_,Sl(g,0,_.length))}function Cf(h,g,_,T){if(!Tn(h))return h;g=fa(g,h);for(var F=-1,G=g.length,Q=G-1,re=h;re!=null&&++F<G;){var de=Li(g[F]),Ce=_;if(de==="__proto__"||de==="constructor"||de==="prototype")return h;if(F!=Q){var _e=re[de];Ce=T?T(_e,de,re):n,Ce===n&&(Ce=Tn(_e)?_e:Cs(g[F+1])?[]:{})}yf(re,de,Ce),re=re[de]}return h}var yA=nm?function(h,g){return nm.set(h,g),h}:Wr,lq=Jg?function(h,g){return Jg(h,"toString",{configurable:!0,enumerable:!1,value:a1(g),writable:!0})}:Wr;function cq(h){return bm(mu(h))}function Wo(h,g,_){var T=-1,F=h.length;g<0&&(g=-g>F?0:F+g),_=_>F?F:_,_<0&&(_+=F),F=g>_?0:_-g>>>0,g>>>=0;for(var G=me(F);++T<F;)G[T]=h[T+g];return G}function uq(h,g){var _;return ua(h,function(T,F,G){return _=g(T,F,G),!_}),!!_}function cm(h,g,_){var T=0,F=h==null?T:h.length;if(typeof g=="number"&&g===g&&F<=M){for(;T<F;){var G=T+F>>>1,Q=h[G];Q!==null&&!ho(Q)&&(_?Q<=g:Q<g)?T=G+1:F=G}return F}return Nx(h,g,Wr,_)}function Nx(h,g,_,T){var F=0,G=h==null?0:h.length;if(G===0)return 0;g=_(g);for(var Q=g!==g,re=g===null,de=ho(g),Ce=g===n;F<G;){var _e=tm((F+G)/2),Re=_(h[_e]),Le=Re!==n,Ge=Re===null,Xe=Re===Re,xt=ho(Re);if(Q)var Qe=T||Xe;else Ce?Qe=Xe&&(T||Le):re?Qe=Xe&&Le&&(T||!Ge):de?Qe=Xe&&Le&&!Ge&&(T||!xt):Ge||xt?Qe=!1:Qe=T?Re<=g:Re<g;Qe?F=_e+1:G=_e}return gr(G,X)}function xA(h,g){for(var _=-1,T=h.length,F=0,G=[];++_<T;){var Q=h[_],re=g?g(Q):Q;if(!_||!di(re,de)){var de=re;G[F++]=Q===0?0:Q}}return G}function wA(h){return typeof h=="number"?h:ho(h)?$:+h}function fo(h){if(typeof h=="string")return h;if(dt(h))return Rn(h,fo)+"";if(ho(h))return JO?JO.call(h):"";var g=h+"";return g=="0"&&1/h==-B?"-0":g}function da(h,g,_){var T=-1,F=Vg,G=h.length,Q=!0,re=[],de=re;if(_)Q=!1,F=ux;else if(G>=o){var Ce=g?null:wq(h);if(Ce)return Wg(Ce);Q=!1,F=hf,de=new wl}else de=g?[]:re;e:for(;++T<G;){var _e=h[T],Re=g?g(_e):_e;if(_e=_||_e!==0?_e:0,Q&&Re===Re){for(var Le=de.length;Le--;)if(de[Le]===Re)continue e;g&&de.push(Re),re.push(_e)}else F(de,Re,_)||(de!==re&&de.push(Re),re.push(_e))}return re}function kx(h,g){return g=fa(g,h),h=KA(h,g),h==null||delete h[Li(Uo(g))]}function SA(h,g,_,T){return Cf(h,g,_(Cl(h,g)),T)}function um(h,g,_,T){for(var F=h.length,G=T?F:-1;(T?G--:++G<F)&&g(h[G],G,h););return _?Wo(h,T?0:G,T?G+1:F):Wo(h,T?G+1:0,T?F:G)}function CA(h,g){var _=h;return _ instanceof It&&(_=_.value()),dx(g,function(T,F){return F.func.apply(F.thisArg,aa([T],F.args))},_)}function Lx(h,g,_){var T=h.length;if(T<2)return T?da(h[0]):[];for(var F=-1,G=me(T);++F<T;)for(var Q=h[F],re=-1;++re<T;)re!=F&&(G[F]=xf(G[F]||Q,h[re],g,_));return da(lr(G,1),g,_)}function _A(h,g,_){for(var T=-1,F=h.length,G=g.length,Q={};++T<F;){var re=T<G?g[T]:n;_(Q,h[T],re)}return Q}function Fx(h){return Hn(h)?h:[]}function jx(h){return typeof h=="function"?h:Wr}function fa(h,g){return dt(h)?h:Yx(h,g)?[h]:JA(Yt(h))}var dq=Et;function ha(h,g,_){var T=h.length;return _=_===n?T:_,!g&&_>=T?h:Wo(h,g,_)}var EA=ZU||function(h){return ar.clearTimeout(h)};function RA(h,g){if(g)return h.slice();var _=h.length,T=qO?qO(_):new h.constructor(_);return h.copy(T),T}function zx(h){var g=new h.constructor(h.byteLength);return new Xg(g).set(new Xg(h)),g}function fq(h,g){var _=g?zx(h.buffer):h.buffer;return new h.constructor(_,h.byteOffset,h.byteLength)}function hq(h){var g=new h.constructor(h.source,Ue.exec(h));return g.lastIndex=h.lastIndex,g}function pq(h){return bf?un(bf.call(h)):{}}function PA(h,g){var _=g?zx(h.buffer):h.buffer;return new h.constructor(_,h.byteOffset,h.length)}function OA(h,g){if(h!==g){var _=h!==n,T=h===null,F=h===h,G=ho(h),Q=g!==n,re=g===null,de=g===g,Ce=ho(g);if(!re&&!Ce&&!G&&h>g||G&&Q&&de&&!re&&!Ce||T&&Q&&de||!_&&de||!F)return 1;if(!T&&!G&&!Ce&&h<g||Ce&&_&&F&&!T&&!G||re&&_&&F||!Q&&F||!de)return-1}return 0}function gq(h,g,_){for(var T=-1,F=h.criteria,G=g.criteria,Q=F.length,re=_.length;++T<Q;){var de=OA(F[T],G[T]);if(de){if(T>=re)return de;var Ce=_[T];return de*(Ce=="desc"?-1:1)}}return h.index-g.index}function AA(h,g,_,T){for(var F=-1,G=h.length,Q=_.length,re=-1,de=g.length,Ce=Zn(G-Q,0),_e=me(de+Ce),Re=!T;++re<de;)_e[re]=g[re];for(;++F<Q;)(Re||F<G)&&(_e[_[F]]=h[F]);for(;Ce--;)_e[re++]=h[F++];return _e}function TA(h,g,_,T){for(var F=-1,G=h.length,Q=-1,re=_.length,de=-1,Ce=g.length,_e=Zn(G-re,0),Re=me(_e+Ce),Le=!T;++F<_e;)Re[F]=h[F];for(var Ge=F;++de<Ce;)Re[Ge+de]=g[de];for(;++Q<re;)(Le||F<G)&&(Re[Ge+_[Q]]=h[F++]);return Re}function Br(h,g){var _=-1,T=h.length;for(g||(g=me(T));++_<T;)g[_]=h[_];return g}function ki(h,g,_,T){var F=!_;_||(_={});for(var G=-1,Q=g.length;++G<Q;){var re=g[G],de=T?T(_[re],h[re],re,_,h):n;de===n&&(de=h[re]),F?xs(_,re,de):yf(_,re,de)}return _}function mq(h,g){return ki(h,qx(h),g)}function vq(h,g){return ki(h,HA(h),g)}function dm(h,g){return function(_,T){var F=dt(_)?SU:jG,G=g?g():{};return F(_,h,Ke(T,2),G)}}function fu(h){return Et(function(g,_){var T=-1,F=_.length,G=F>1?_[F-1]:n,Q=F>2?_[2]:n;for(G=h.length>3&&typeof G=="function"?(F--,G):n,Q&&Rr(_[0],_[1],Q)&&(G=F<3?n:G,F=1),g=un(g);++T<F;){var re=_[T];re&&h(g,re,T,G)}return g})}function DA(h,g){return function(_,T){if(_==null)return _;if(!Vr(_))return h(_,T);for(var F=_.length,G=g?F:-1,Q=un(_);(g?G--:++G<F)&&T(Q[G],G,Q)!==!1;);return _}}function MA(h){return function(g,_,T){for(var F=-1,G=un(g),Q=T(g),re=Q.length;re--;){var de=Q[h?re:++F];if(_(G[de],de,G)===!1)break}return g}}function bq(h,g,_){var T=g&y,F=_f(h);function G(){var Q=this&&this!==ar&&this instanceof G?F:h;return Q.apply(T?_:this,arguments)}return G}function IA(h){return function(g){g=Yt(g);var _=iu(g)?ci(g):n,T=_?_[0]:g.charAt(0),F=_?ha(_,1).join(""):g.slice(1);return T[h]()+F}}function hu(h){return function(g){return dx(DT(TT(g).replace(lU,"")),h,"")}}function _f(h){return function(){var g=arguments;switch(g.length){case 0:return new h;case 1:return new h(g[0]);case 2:return new h(g[0],g[1]);case 3:return new h(g[0],g[1],g[2]);case 4:return new h(g[0],g[1],g[2],g[3]);case 5:return new h(g[0],g[1],g[2],g[3],g[4]);case 6:return new h(g[0],g[1],g[2],g[3],g[4],g[5]);case 7:return new h(g[0],g[1],g[2],g[3],g[4],g[5],g[6])}var _=du(h.prototype),T=h.apply(_,g);return Tn(T)?T:_}}function yq(h,g,_){var T=_f(h);function F(){for(var G=arguments.length,Q=me(G),re=G,de=pu(F);re--;)Q[re]=arguments[re];var Ce=G<3&&Q[0]!==de&&Q[G-1]!==de?[]:la(Q,de);if(G-=Ce.length,G<_)return FA(h,g,fm,F.placeholder,n,Q,Ce,n,n,_-G);var _e=this&&this!==ar&&this instanceof F?T:h;return co(_e,this,Q)}return F}function $A(h){return function(g,_,T){var F=un(g);if(!Vr(g)){var G=Ke(_,3);g=nr(g),_=function(re){return G(F[re],re,F)}}var Q=h(g,_,T);return Q>-1?F[G?g[Q]:Q]:n}}function NA(h){return Ss(function(g){var _=g.length,T=_,F=Vo.prototype.thru;for(h&&g.reverse();T--;){var G=g[T];if(typeof G!="function")throw new Bo(s);if(F&&!Q&&mm(G)=="wrapper")var Q=new Vo([],!0)}for(T=Q?T:_;++T<_;){G=g[T];var re=mm(G),de=re=="wrapper"?Ux(G):n;de&&Kx(de[0])&&de[1]==(A|E|P|D)&&!de[4].length&&de[9]==1?Q=Q[mm(de[0])].apply(Q,de[3]):Q=G.length==1&&Kx(G)?Q[re]():Q.thru(G)}return function(){var Ce=arguments,_e=Ce[0];if(Q&&Ce.length==1&&dt(_e))return Q.plant(_e).value();for(var Re=0,Le=_?g[Re].apply(this,Ce):_e;++Re<_;)Le=g[Re].call(this,Le);return Le}})}function fm(h,g,_,T,F,G,Q,re,de,Ce){var _e=g&A,Re=g&y,Le=g&b,Ge=g&(E|R),Xe=g&I,xt=Le?n:_f(h);function Qe(){for(var At=arguments.length,Nt=me(At),po=At;po--;)Nt[po]=arguments[po];if(Ge)var Pr=pu(Qe),go=DU(Nt,Pr);if(T&&(Nt=AA(Nt,T,F,Ge)),G&&(Nt=TA(Nt,G,Q,Ge)),At-=go,Ge&&At<Ce){var Wn=la(Nt,Pr);return FA(h,g,fm,Qe.placeholder,_,Nt,Wn,re,de,Ce-At)}var fi=Re?_:this,Rs=Le?fi[h]:h;return At=Nt.length,re?Nt=jq(Nt,re):Xe&&At>1&&Nt.reverse(),_e&&de<At&&(Nt.length=de),this&&this!==ar&&this instanceof Qe&&(Rs=xt||_f(Rs)),Rs.apply(fi,Nt)}return Qe}function kA(h,g){return function(_,T){return qG(_,h,g(T),{})}}function hm(h,g){return function(_,T){var F;if(_===n&&T===n)return g;if(_!==n&&(F=_),T!==n){if(F===n)return T;typeof _=="string"||typeof T=="string"?(_=fo(_),T=fo(T)):(_=wA(_),T=wA(T)),F=h(_,T)}return F}}function Bx(h){return Ss(function(g){return g=Rn(g,uo(Ke())),Et(function(_){var T=this;return h(g,function(F){return co(F,T,_)})})})}function pm(h,g){g=g===n?" ":fo(g);var _=g.length;if(_<2)return _?$x(g,h):g;var T=$x(g,em(h/su(g)));return iu(g)?ha(ci(T),0,h).join(""):T.slice(0,h)}function xq(h,g,_,T){var F=g&y,G=_f(h);function Q(){for(var re=-1,de=arguments.length,Ce=-1,_e=T.length,Re=me(_e+de),Le=this&&this!==ar&&this instanceof Q?G:h;++Ce<_e;)Re[Ce]=T[Ce];for(;de--;)Re[Ce++]=arguments[++re];return co(Le,F?_:this,Re)}return Q}function LA(h){return function(g,_,T){return T&&typeof T!="number"&&Rr(g,_,T)&&(_=T=n),g=Es(g),_===n?(_=g,g=0):_=Es(_),T=T===n?g<_?1:-1:Es(T),iq(g,_,T,h)}}function gm(h){return function(g,_){return typeof g=="string"&&typeof _=="string"||(g=Go(g),_=Go(_)),h(g,_)}}function FA(h,g,_,T,F,G,Q,re,de,Ce){var _e=g&E,Re=_e?Q:n,Le=_e?n:Q,Ge=_e?G:n,Xe=_e?n:G;g|=_e?P:O,g&=~(_e?O:P),g&x||(g&=~(y|b));var xt=[h,g,F,Ge,Re,Xe,Le,re,de,Ce],Qe=_.apply(n,xt);return Kx(h)&&XA(Qe,xt),Qe.placeholder=T,QA(Qe,h,g)}function Vx(h){var g=Qn[h];return function(_,T){if(_=Go(_),T=T==null?0:gr(gt(T),292),T&&QO(_)){var F=(Yt(_)+"e").split("e"),G=g(F[0]+"e"+(+F[1]+T));return F=(Yt(G)+"e").split("e"),+(F[0]+"e"+(+F[1]-T))}return g(_)}}var wq=cu&&1/Wg(new cu([,-0]))[1]==B?function(h){return new cu(h)}:u1;function jA(h){return function(g){var _=mr(g);return _==fe?bx(g):_==_t?FU(g):TU(g,h(g))}}function ws(h,g,_,T,F,G,Q,re){var de=g&b;if(!de&&typeof h!="function")throw new Bo(s);var Ce=T?T.length:0;if(Ce||(g&=~(P|O),T=F=n),Q=Q===n?Q:Zn(gt(Q),0),re=re===n?re:gt(re),Ce-=F?F.length:0,g&O){var _e=T,Re=F;T=F=n}var Le=de?n:Ux(h),Ge=[h,g,_,T,F,_e,Re,G,Q,re];if(Le&&kq(Ge,Le),h=Ge[0],g=Ge[1],_=Ge[2],T=Ge[3],F=Ge[4],re=Ge[9]=Ge[9]===n?de?0:h.length:Zn(Ge[9]-Ce,0),!re&&g&(E|R)&&(g&=~(E|R)),!g||g==y)var Xe=bq(h,g,_);else g==E||g==R?Xe=yq(h,g,re):(g==P||g==(y|P))&&!F.length?Xe=xq(h,g,_,T):Xe=fm.apply(n,Ge);var xt=Le?yA:XA;return QA(xt(Xe,Ge),h,g)}function zA(h,g,_,T){return h===n||di(h,lu[_])&&!en.call(T,_)?g:h}function BA(h,g,_,T,F,G){return Tn(h)&&Tn(g)&&(G.set(g,h),lm(h,g,n,BA,G),G.delete(g)),h}function Sq(h){return Pf(h)?n:h}function VA(h,g,_,T,F,G){var Q=_&m,re=h.length,de=g.length;if(re!=de&&!(Q&&de>re))return!1;var Ce=G.get(h),_e=G.get(g);if(Ce&&_e)return Ce==g&&_e==h;var Re=-1,Le=!0,Ge=_&v?new wl:n;for(G.set(h,g),G.set(g,h);++Re<re;){var Xe=h[Re],xt=g[Re];if(T)var Qe=Q?T(xt,Xe,Re,g,h,G):T(Xe,xt,Re,h,g,G);if(Qe!==n){if(Qe)continue;Le=!1;break}if(Ge){if(!fx(g,function(At,Nt){if(!hf(Ge,Nt)&&(Xe===At||F(Xe,At,_,T,G)))return Ge.push(Nt)})){Le=!1;break}}else if(!(Xe===xt||F(Xe,xt,_,T,G))){Le=!1;break}}return G.delete(h),G.delete(g),Le}function Cq(h,g,_,T,F,G,Q){switch(_){case qe:if(h.byteLength!=g.byteLength||h.byteOffset!=g.byteOffset)return!1;h=h.buffer,g=g.buffer;case je:return!(h.byteLength!=g.byteLength||!G(new Xg(h),new Xg(g)));case Z:case ae:case Se:return di(+h,+g);case ve:return h.name==g.name&&h.message==g.message;case ot:case rn:return h==g+"";case fe:var re=bx;case _t:var de=T&m;if(re||(re=Wg),h.size!=g.size&&!de)return!1;var Ce=Q.get(h);if(Ce)return Ce==g;T|=v,Q.set(h,g);var _e=VA(re(h),re(g),T,F,G,Q);return Q.delete(h),_e;case $t:if(bf)return bf.call(h)==bf.call(g)}return!1}function _q(h,g,_,T,F,G){var Q=_&m,re=Hx(h),de=re.length,Ce=Hx(g),_e=Ce.length;if(de!=_e&&!Q)return!1;for(var Re=de;Re--;){var Le=re[Re];if(!(Q?Le in g:en.call(g,Le)))return!1}var Ge=G.get(h),Xe=G.get(g);if(Ge&&Xe)return Ge==g&&Xe==h;var xt=!0;G.set(h,g),G.set(g,h);for(var Qe=Q;++Re<de;){Le=re[Re];var At=h[Le],Nt=g[Le];if(T)var po=Q?T(Nt,At,Le,g,h,G):T(At,Nt,Le,h,g,G);if(!(po===n?At===Nt||F(At,Nt,_,T,G):po)){xt=!1;break}Qe||(Qe=Le=="constructor")}if(xt&&!Qe){var Pr=h.constructor,go=g.constructor;Pr!=go&&"constructor"in h&&"constructor"in g&&!(typeof Pr=="function"&&Pr instanceof Pr&&typeof go=="function"&&go instanceof go)&&(xt=!1)}return G.delete(h),G.delete(g),xt}function Ss(h){return Qx(YA(h,n,rT),h+"")}function Hx(h){return lA(h,nr,qx)}function Wx(h){return lA(h,Hr,HA)}var Ux=nm?function(h){return nm.get(h)}:u1;function mm(h){for(var g=h.name+"",_=uu[g],T=en.call(uu,g)?_.length:0;T--;){var F=_[T],G=F.func;if(G==null||G==h)return F.name}return g}function pu(h){var g=en.call(V,"placeholder")?V:h;return g.placeholder}function Ke(){var h=V.iteratee||l1;return h=h===l1?dA:h,arguments.length?h(arguments[0],arguments[1]):h}function vm(h,g){var _=h.__data__;return Mq(g)?_[typeof g=="string"?"string":"hash"]:_.map}function Gx(h){for(var g=nr(h),_=g.length;_--;){var T=g[_],F=h[T];g[_]=[T,F,GA(F)]}return g}function _l(h,g){var _=NU(h,g);return uA(_)?_:n}function Eq(h){var g=en.call(h,yl),_=h[yl];try{h[yl]=n;var T=!0}catch{}var F=Yg.call(h);return T&&(g?h[yl]=_:delete h[yl]),F}var qx=xx?function(h){return h==null?[]:(h=un(h),sa(xx(h),function(g){return KO.call(h,g)}))}:d1,HA=xx?function(h){for(var g=[];h;)aa(g,qx(h)),h=Qg(h);return g}:d1,mr=Er;(wx&&mr(new wx(new ArrayBuffer(1)))!=qe||gf&&mr(new gf)!=fe||Sx&&mr(Sx.resolve())!=Ie||cu&&mr(new cu)!=_t||mf&&mr(new mf)!=pe)&&(mr=function(h){var g=Er(h),_=g==ze?h.constructor:n,T=_?El(_):"";if(T)switch(T){case aG:return qe;case lG:return fe;case cG:return Ie;case uG:return _t;case dG:return pe}return g});function Rq(h,g,_){for(var T=-1,F=_.length;++T<F;){var G=_[T],Q=G.size;switch(G.type){case"drop":h+=Q;break;case"dropRight":g-=Q;break;case"take":g=gr(g,h+Q);break;case"takeRight":h=Zn(h,g-Q);break}}return{start:h,end:g}}function Pq(h){var g=h.match(ia);return g?g[1].split(N):[]}function WA(h,g,_){g=fa(g,h);for(var T=-1,F=g.length,G=!1;++T<F;){var Q=Li(g[T]);if(!(G=h!=null&&_(h,Q)))break;h=h[Q]}return G||++T!=F?G:(F=h==null?0:h.length,!!F&&_m(F)&&Cs(Q,F)&&(dt(h)||Rl(h)))}function Oq(h){var g=h.length,_=new h.constructor(g);return g&&typeof h[0]=="string"&&en.call(h,"index")&&(_.index=h.index,_.input=h.input),_}function UA(h){return typeof h.constructor=="function"&&!Ef(h)?du(Qg(h)):{}}function Aq(h,g,_){var T=h.constructor;switch(g){case je:return zx(h);case Z:case ae:return new T(+h);case qe:return fq(h,_);case tt:case sn:case _n:case mn:case Bn:case vn:case Bt:case cn:case An:return PA(h,_);case fe:return new T;case Se:case rn:return new T(h);case ot:return hq(h);case _t:return new T;case $t:return pq(h)}}function Tq(h,g){var _=g.length;if(!_)return h;var T=_-1;return g[T]=(_>1?"& ":"")+g[T],g=g.join(_>2?", ":" "),h.replace(oa,`{
70
+ /* [wrapped with `+g+`] */
71
+ `)}function Dq(h){return dt(h)||Rl(h)||!!(XO&&h&&h[XO])}function Cs(h,g){var _=typeof h;return g=g??U,!!g&&(_=="number"||_!="symbol"&&be.test(h))&&h>-1&&h%1==0&&h<g}function Rr(h,g,_){if(!Tn(_))return!1;var T=typeof g;return(T=="number"?Vr(_)&&Cs(g,_.length):T=="string"&&g in _)?di(_[g],h):!1}function Yx(h,g){if(dt(h))return!1;var _=typeof h;return _=="number"||_=="symbol"||_=="boolean"||h==null||ho(h)?!0:ms.test(h)||!Mi.test(h)||g!=null&&h in un(g)}function Mq(h){var g=typeof h;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?h!=="__proto__":h===null}function Kx(h){var g=mm(h),_=V[g];if(typeof _!="function"||!(g in It.prototype))return!1;if(h===_)return!0;var T=Ux(_);return!!T&&h===T[0]}function Iq(h){return!!GO&&GO in h}var $q=Gg?_s:f1;function Ef(h){var g=h&&h.constructor,_=typeof g=="function"&&g.prototype||lu;return h===_}function GA(h){return h===h&&!Tn(h)}function qA(h,g){return function(_){return _==null?!1:_[h]===g&&(g!==n||h in un(_))}}function Nq(h){var g=Sm(h,function(T){return _.size===c&&_.clear(),T}),_=g.cache;return g}function kq(h,g){var _=h[1],T=g[1],F=_|T,G=F<(y|b|A),Q=T==A&&_==E||T==A&&_==D&&h[7].length<=g[8]||T==(A|D)&&g[7].length<=g[8]&&_==E;if(!(G||Q))return h;T&y&&(h[2]=g[2],F|=_&y?0:x);var re=g[3];if(re){var de=h[3];h[3]=de?AA(de,re,g[4]):re,h[4]=de?la(h[3],u):g[4]}return re=g[5],re&&(de=h[5],h[5]=de?TA(de,re,g[6]):re,h[6]=de?la(h[5],u):g[6]),re=g[7],re&&(h[7]=re),T&A&&(h[8]=h[8]==null?g[8]:gr(h[8],g[8])),h[9]==null&&(h[9]=g[9]),h[0]=g[0],h[1]=F,h}function Lq(h){var g=[];if(h!=null)for(var _ in un(h))g.push(_);return g}function Fq(h){return Yg.call(h)}function YA(h,g,_){return g=Zn(g===n?h.length-1:g,0),function(){for(var T=arguments,F=-1,G=Zn(T.length-g,0),Q=me(G);++F<G;)Q[F]=T[g+F];F=-1;for(var re=me(g+1);++F<g;)re[F]=T[F];return re[g]=_(Q),co(h,this,re)}}function KA(h,g){return g.length<2?h:Cl(h,Wo(g,0,-1))}function jq(h,g){for(var _=h.length,T=gr(g.length,_),F=Br(h);T--;){var G=g[T];h[T]=Cs(G,_)?F[G]:n}return h}function Xx(h,g){if(!(g==="constructor"&&typeof h[g]=="function")&&g!="__proto__")return h[g]}var XA=ZA(yA),Rf=eG||function(h,g){return ar.setTimeout(h,g)},Qx=ZA(lq);function QA(h,g,_){var T=g+"";return Qx(h,Tq(T,zq(Pq(T),_)))}function ZA(h){var g=0,_=0;return function(){var T=oG(),F=K-(T-_);if(_=T,F>0){if(++g>=z)return arguments[0]}else g=0;return h.apply(n,arguments)}}function bm(h,g){var _=-1,T=h.length,F=T-1;for(g=g===n?T:g;++_<g;){var G=Ix(_,F),Q=h[G];h[G]=h[_],h[_]=Q}return h.length=g,h}var JA=Nq(function(h){var g=[];return h.charCodeAt(0)===46&&g.push(""),h.replace(ra,function(_,T,F,G){g.push(F?G.replace(Oe,"$1"):T||_)}),g});function Li(h){if(typeof h=="string"||ho(h))return h;var g=h+"";return g=="0"&&1/h==-B?"-0":g}function El(h){if(h!=null){try{return qg.call(h)}catch{}try{return h+""}catch{}}return""}function zq(h,g){return zo(oe,function(_){var T="_."+_[0];g&_[1]&&!Vg(h,T)&&h.push(T)}),h.sort()}function eT(h){if(h instanceof It)return h.clone();var g=new Vo(h.__wrapped__,h.__chain__);return g.__actions__=Br(h.__actions__),g.__index__=h.__index__,g.__values__=h.__values__,g}function Bq(h,g,_){(_?Rr(h,g,_):g===n)?g=1:g=Zn(gt(g),0);var T=h==null?0:h.length;if(!T||g<1)return[];for(var F=0,G=0,Q=me(em(T/g));F<T;)Q[G++]=Wo(h,F,F+=g);return Q}function Vq(h){for(var g=-1,_=h==null?0:h.length,T=0,F=[];++g<_;){var G=h[g];G&&(F[T++]=G)}return F}function Hq(){var h=arguments.length;if(!h)return[];for(var g=me(h-1),_=arguments[0],T=h;T--;)g[T-1]=arguments[T];return aa(dt(_)?Br(_):[_],lr(g,1))}var Wq=Et(function(h,g){return Hn(h)?xf(h,lr(g,1,Hn,!0)):[]}),Uq=Et(function(h,g){var _=Uo(g);return Hn(_)&&(_=n),Hn(h)?xf(h,lr(g,1,Hn,!0),Ke(_,2)):[]}),Gq=Et(function(h,g){var _=Uo(g);return Hn(_)&&(_=n),Hn(h)?xf(h,lr(g,1,Hn,!0),n,_):[]});function qq(h,g,_){var T=h==null?0:h.length;return T?(g=_||g===n?1:gt(g),Wo(h,g<0?0:g,T)):[]}function Yq(h,g,_){var T=h==null?0:h.length;return T?(g=_||g===n?1:gt(g),g=T-g,Wo(h,0,g<0?0:g)):[]}function Kq(h,g){return h&&h.length?um(h,Ke(g,3),!0,!0):[]}function Xq(h,g){return h&&h.length?um(h,Ke(g,3),!0):[]}function Qq(h,g,_,T){var F=h==null?0:h.length;return F?(_&&typeof _!="number"&&Rr(h,g,_)&&(_=0,T=F),HG(h,g,_,T)):[]}function tT(h,g,_){var T=h==null?0:h.length;if(!T)return-1;var F=_==null?0:gt(_);return F<0&&(F=Zn(T+F,0)),Hg(h,Ke(g,3),F)}function nT(h,g,_){var T=h==null?0:h.length;if(!T)return-1;var F=T-1;return _!==n&&(F=gt(_),F=_<0?Zn(T+F,0):gr(F,T-1)),Hg(h,Ke(g,3),F,!0)}function rT(h){var g=h==null?0:h.length;return g?lr(h,1):[]}function Zq(h){var g=h==null?0:h.length;return g?lr(h,B):[]}function Jq(h,g){var _=h==null?0:h.length;return _?(g=g===n?1:gt(g),lr(h,g)):[]}function eY(h){for(var g=-1,_=h==null?0:h.length,T={};++g<_;){var F=h[g];T[F[0]]=F[1]}return T}function oT(h){return h&&h.length?h[0]:n}function tY(h,g,_){var T=h==null?0:h.length;if(!T)return-1;var F=_==null?0:gt(_);return F<0&&(F=Zn(T+F,0)),ou(h,g,F)}function nY(h){var g=h==null?0:h.length;return g?Wo(h,0,-1):[]}var rY=Et(function(h){var g=Rn(h,Fx);return g.length&&g[0]===h[0]?Ox(g):[]}),oY=Et(function(h){var g=Uo(h),_=Rn(h,Fx);return g===Uo(_)?g=n:_.pop(),_.length&&_[0]===h[0]?Ox(_,Ke(g,2)):[]}),iY=Et(function(h){var g=Uo(h),_=Rn(h,Fx);return g=typeof g=="function"?g:n,g&&_.pop(),_.length&&_[0]===h[0]?Ox(_,n,g):[]});function sY(h,g){return h==null?"":nG.call(h,g)}function Uo(h){var g=h==null?0:h.length;return g?h[g-1]:n}function aY(h,g,_){var T=h==null?0:h.length;if(!T)return-1;var F=T;return _!==n&&(F=gt(_),F=F<0?Zn(T+F,0):gr(F,T-1)),g===g?zU(h,g,F):Hg(h,FO,F,!0)}function lY(h,g){return h&&h.length?gA(h,gt(g)):n}var cY=Et(iT);function iT(h,g){return h&&h.length&&g&&g.length?Mx(h,g):h}function uY(h,g,_){return h&&h.length&&g&&g.length?Mx(h,g,Ke(_,2)):h}function dY(h,g,_){return h&&h.length&&g&&g.length?Mx(h,g,n,_):h}var fY=Ss(function(h,g){var _=h==null?0:h.length,T=_x(h,g);return bA(h,Rn(g,function(F){return Cs(F,_)?+F:F}).sort(OA)),T});function hY(h,g){var _=[];if(!(h&&h.length))return _;var T=-1,F=[],G=h.length;for(g=Ke(g,3);++T<G;){var Q=h[T];g(Q,T,h)&&(_.push(Q),F.push(T))}return bA(h,F),_}function Zx(h){return h==null?h:sG.call(h)}function pY(h,g,_){var T=h==null?0:h.length;return T?(_&&typeof _!="number"&&Rr(h,g,_)?(g=0,_=T):(g=g==null?0:gt(g),_=_===n?T:gt(_)),Wo(h,g,_)):[]}function gY(h,g){return cm(h,g)}function mY(h,g,_){return Nx(h,g,Ke(_,2))}function vY(h,g){var _=h==null?0:h.length;if(_){var T=cm(h,g);if(T<_&&di(h[T],g))return T}return-1}function bY(h,g){return cm(h,g,!0)}function yY(h,g,_){return Nx(h,g,Ke(_,2),!0)}function xY(h,g){var _=h==null?0:h.length;if(_){var T=cm(h,g,!0)-1;if(di(h[T],g))return T}return-1}function wY(h){return h&&h.length?xA(h):[]}function SY(h,g){return h&&h.length?xA(h,Ke(g,2)):[]}function CY(h){var g=h==null?0:h.length;return g?Wo(h,1,g):[]}function _Y(h,g,_){return h&&h.length?(g=_||g===n?1:gt(g),Wo(h,0,g<0?0:g)):[]}function EY(h,g,_){var T=h==null?0:h.length;return T?(g=_||g===n?1:gt(g),g=T-g,Wo(h,g<0?0:g,T)):[]}function RY(h,g){return h&&h.length?um(h,Ke(g,3),!1,!0):[]}function PY(h,g){return h&&h.length?um(h,Ke(g,3)):[]}var OY=Et(function(h){return da(lr(h,1,Hn,!0))}),AY=Et(function(h){var g=Uo(h);return Hn(g)&&(g=n),da(lr(h,1,Hn,!0),Ke(g,2))}),TY=Et(function(h){var g=Uo(h);return g=typeof g=="function"?g:n,da(lr(h,1,Hn,!0),n,g)});function DY(h){return h&&h.length?da(h):[]}function MY(h,g){return h&&h.length?da(h,Ke(g,2)):[]}function IY(h,g){return g=typeof g=="function"?g:n,h&&h.length?da(h,n,g):[]}function Jx(h){if(!(h&&h.length))return[];var g=0;return h=sa(h,function(_){if(Hn(_))return g=Zn(_.length,g),!0}),mx(g,function(_){return Rn(h,hx(_))})}function sT(h,g){if(!(h&&h.length))return[];var _=Jx(h);return g==null?_:Rn(_,function(T){return co(g,n,T)})}var $Y=Et(function(h,g){return Hn(h)?xf(h,g):[]}),NY=Et(function(h){return Lx(sa(h,Hn))}),kY=Et(function(h){var g=Uo(h);return Hn(g)&&(g=n),Lx(sa(h,Hn),Ke(g,2))}),LY=Et(function(h){var g=Uo(h);return g=typeof g=="function"?g:n,Lx(sa(h,Hn),n,g)}),FY=Et(Jx);function jY(h,g){return _A(h||[],g||[],yf)}function zY(h,g){return _A(h||[],g||[],Cf)}var BY=Et(function(h){var g=h.length,_=g>1?h[g-1]:n;return _=typeof _=="function"?(h.pop(),_):n,sT(h,_)});function aT(h){var g=V(h);return g.__chain__=!0,g}function VY(h,g){return g(h),h}function ym(h,g){return g(h)}var HY=Ss(function(h){var g=h.length,_=g?h[0]:0,T=this.__wrapped__,F=function(G){return _x(G,h)};return g>1||this.__actions__.length||!(T instanceof It)||!Cs(_)?this.thru(F):(T=T.slice(_,+_+(g?1:0)),T.__actions__.push({func:ym,args:[F],thisArg:n}),new Vo(T,this.__chain__).thru(function(G){return g&&!G.length&&G.push(n),G}))});function WY(){return aT(this)}function UY(){return new Vo(this.value(),this.__chain__)}function GY(){this.__values__===n&&(this.__values__=wT(this.value()));var h=this.__index__>=this.__values__.length,g=h?n:this.__values__[this.__index__++];return{done:h,value:g}}function qY(){return this}function YY(h){for(var g,_=this;_ instanceof om;){var T=eT(_);T.__index__=0,T.__values__=n,g?F.__wrapped__=T:g=T;var F=T;_=_.__wrapped__}return F.__wrapped__=h,g}function KY(){var h=this.__wrapped__;if(h instanceof It){var g=h;return this.__actions__.length&&(g=new It(this)),g=g.reverse(),g.__actions__.push({func:ym,args:[Zx],thisArg:n}),new Vo(g,this.__chain__)}return this.thru(Zx)}function XY(){return CA(this.__wrapped__,this.__actions__)}var QY=dm(function(h,g,_){en.call(h,_)?++h[_]:xs(h,_,1)});function ZY(h,g,_){var T=dt(h)?kO:VG;return _&&Rr(h,g,_)&&(g=n),T(h,Ke(g,3))}function JY(h,g){var _=dt(h)?sa:sA;return _(h,Ke(g,3))}var eK=$A(tT),tK=$A(nT);function nK(h,g){return lr(xm(h,g),1)}function rK(h,g){return lr(xm(h,g),B)}function oK(h,g,_){return _=_===n?1:gt(_),lr(xm(h,g),_)}function lT(h,g){var _=dt(h)?zo:ua;return _(h,Ke(g,3))}function cT(h,g){var _=dt(h)?CU:iA;return _(h,Ke(g,3))}var iK=dm(function(h,g,_){en.call(h,_)?h[_].push(g):xs(h,_,[g])});function sK(h,g,_,T){h=Vr(h)?h:mu(h),_=_&&!T?gt(_):0;var F=h.length;return _<0&&(_=Zn(F+_,0)),Em(h)?_<=F&&h.indexOf(g,_)>-1:!!F&&ou(h,g,_)>-1}var aK=Et(function(h,g,_){var T=-1,F=typeof g=="function",G=Vr(h)?me(h.length):[];return ua(h,function(Q){G[++T]=F?co(g,Q,_):wf(Q,g,_)}),G}),lK=dm(function(h,g,_){xs(h,_,g)});function xm(h,g){var _=dt(h)?Rn:fA;return _(h,Ke(g,3))}function cK(h,g,_,T){return h==null?[]:(dt(g)||(g=g==null?[]:[g]),_=T?n:_,dt(_)||(_=_==null?[]:[_]),mA(h,g,_))}var uK=dm(function(h,g,_){h[_?0:1].push(g)},function(){return[[],[]]});function dK(h,g,_){var T=dt(h)?dx:zO,F=arguments.length<3;return T(h,Ke(g,4),_,F,ua)}function fK(h,g,_){var T=dt(h)?_U:zO,F=arguments.length<3;return T(h,Ke(g,4),_,F,iA)}function hK(h,g){var _=dt(h)?sa:sA;return _(h,Cm(Ke(g,3)))}function pK(h){var g=dt(h)?tA:sq;return g(h)}function gK(h,g,_){(_?Rr(h,g,_):g===n)?g=1:g=gt(g);var T=dt(h)?LG:aq;return T(h,g)}function mK(h){var g=dt(h)?FG:cq;return g(h)}function vK(h){if(h==null)return 0;if(Vr(h))return Em(h)?su(h):h.length;var g=mr(h);return g==fe||g==_t?h.size:Tx(h).length}function bK(h,g,_){var T=dt(h)?fx:uq;return _&&Rr(h,g,_)&&(g=n),T(h,Ke(g,3))}var yK=Et(function(h,g){if(h==null)return[];var _=g.length;return _>1&&Rr(h,g[0],g[1])?g=[]:_>2&&Rr(g[0],g[1],g[2])&&(g=[g[0]]),mA(h,lr(g,1),[])}),wm=JU||function(){return ar.Date.now()};function xK(h,g){if(typeof g!="function")throw new Bo(s);return h=gt(h),function(){if(--h<1)return g.apply(this,arguments)}}function uT(h,g,_){return g=_?n:g,g=h&&g==null?h.length:g,ws(h,A,n,n,n,n,g)}function dT(h,g){var _;if(typeof g!="function")throw new Bo(s);return h=gt(h),function(){return--h>0&&(_=g.apply(this,arguments)),h<=1&&(g=n),_}}var e1=Et(function(h,g,_){var T=y;if(_.length){var F=la(_,pu(e1));T|=P}return ws(h,T,g,_,F)}),fT=Et(function(h,g,_){var T=y|b;if(_.length){var F=la(_,pu(fT));T|=P}return ws(g,T,h,_,F)});function hT(h,g,_){g=_?n:g;var T=ws(h,E,n,n,n,n,n,g);return T.placeholder=hT.placeholder,T}function pT(h,g,_){g=_?n:g;var T=ws(h,R,n,n,n,n,n,g);return T.placeholder=pT.placeholder,T}function gT(h,g,_){var T,F,G,Q,re,de,Ce=0,_e=!1,Re=!1,Le=!0;if(typeof h!="function")throw new Bo(s);g=Go(g)||0,Tn(_)&&(_e=!!_.leading,Re="maxWait"in _,G=Re?Zn(Go(_.maxWait)||0,g):G,Le="trailing"in _?!!_.trailing:Le);function Ge(Wn){var fi=T,Rs=F;return T=F=n,Ce=Wn,Q=h.apply(Rs,fi),Q}function Xe(Wn){return Ce=Wn,re=Rf(At,g),_e?Ge(Wn):Q}function xt(Wn){var fi=Wn-de,Rs=Wn-Ce,$T=g-fi;return Re?gr($T,G-Rs):$T}function Qe(Wn){var fi=Wn-de,Rs=Wn-Ce;return de===n||fi>=g||fi<0||Re&&Rs>=G}function At(){var Wn=wm();if(Qe(Wn))return Nt(Wn);re=Rf(At,xt(Wn))}function Nt(Wn){return re=n,Le&&T?Ge(Wn):(T=F=n,Q)}function po(){re!==n&&EA(re),Ce=0,T=de=F=re=n}function Pr(){return re===n?Q:Nt(wm())}function go(){var Wn=wm(),fi=Qe(Wn);if(T=arguments,F=this,de=Wn,fi){if(re===n)return Xe(de);if(Re)return EA(re),re=Rf(At,g),Ge(de)}return re===n&&(re=Rf(At,g)),Q}return go.cancel=po,go.flush=Pr,go}var wK=Et(function(h,g){return oA(h,1,g)}),SK=Et(function(h,g,_){return oA(h,Go(g)||0,_)});function CK(h){return ws(h,I)}function Sm(h,g){if(typeof h!="function"||g!=null&&typeof g!="function")throw new Bo(s);var _=function(){var T=arguments,F=g?g.apply(this,T):T[0],G=_.cache;if(G.has(F))return G.get(F);var Q=h.apply(this,T);return _.cache=G.set(F,Q)||G,Q};return _.cache=new(Sm.Cache||ys),_}Sm.Cache=ys;function Cm(h){if(typeof h!="function")throw new Bo(s);return function(){var g=arguments;switch(g.length){case 0:return!h.call(this);case 1:return!h.call(this,g[0]);case 2:return!h.call(this,g[0],g[1]);case 3:return!h.call(this,g[0],g[1],g[2])}return!h.apply(this,g)}}function _K(h){return dT(2,h)}var EK=dq(function(h,g){g=g.length==1&&dt(g[0])?Rn(g[0],uo(Ke())):Rn(lr(g,1),uo(Ke()));var _=g.length;return Et(function(T){for(var F=-1,G=gr(T.length,_);++F<G;)T[F]=g[F].call(this,T[F]);return co(h,this,T)})}),t1=Et(function(h,g){var _=la(g,pu(t1));return ws(h,P,n,g,_)}),mT=Et(function(h,g){var _=la(g,pu(mT));return ws(h,O,n,g,_)}),RK=Ss(function(h,g){return ws(h,D,n,n,n,g)});function PK(h,g){if(typeof h!="function")throw new Bo(s);return g=g===n?g:gt(g),Et(h,g)}function OK(h,g){if(typeof h!="function")throw new Bo(s);return g=g==null?0:Zn(gt(g),0),Et(function(_){var T=_[g],F=ha(_,0,g);return T&&aa(F,T),co(h,this,F)})}function AK(h,g,_){var T=!0,F=!0;if(typeof h!="function")throw new Bo(s);return Tn(_)&&(T="leading"in _?!!_.leading:T,F="trailing"in _?!!_.trailing:F),gT(h,g,{leading:T,maxWait:g,trailing:F})}function TK(h){return uT(h,1)}function DK(h,g){return t1(jx(g),h)}function MK(){if(!arguments.length)return[];var h=arguments[0];return dt(h)?h:[h]}function IK(h){return Ho(h,p)}function $K(h,g){return g=typeof g=="function"?g:n,Ho(h,p,g)}function NK(h){return Ho(h,d|p)}function kK(h,g){return g=typeof g=="function"?g:n,Ho(h,d|p,g)}function LK(h,g){return g==null||rA(h,g,nr(g))}function di(h,g){return h===g||h!==h&&g!==g}var FK=gm(Px),jK=gm(function(h,g){return h>=g}),Rl=cA(function(){return arguments}())?cA:function(h){return $n(h)&&en.call(h,"callee")&&!KO.call(h,"callee")},dt=me.isArray,zK=TO?uo(TO):YG;function Vr(h){return h!=null&&_m(h.length)&&!_s(h)}function Hn(h){return $n(h)&&Vr(h)}function BK(h){return h===!0||h===!1||$n(h)&&Er(h)==Z}var pa=tG||f1,VK=DO?uo(DO):KG;function HK(h){return $n(h)&&h.nodeType===1&&!Pf(h)}function WK(h){if(h==null)return!0;if(Vr(h)&&(dt(h)||typeof h=="string"||typeof h.splice=="function"||pa(h)||gu(h)||Rl(h)))return!h.length;var g=mr(h);if(g==fe||g==_t)return!h.size;if(Ef(h))return!Tx(h).length;for(var _ in h)if(en.call(h,_))return!1;return!0}function UK(h,g){return Sf(h,g)}function GK(h,g,_){_=typeof _=="function"?_:n;var T=_?_(h,g):n;return T===n?Sf(h,g,n,_):!!T}function n1(h){if(!$n(h))return!1;var g=Er(h);return g==ve||g==ce||typeof h.message=="string"&&typeof h.name=="string"&&!Pf(h)}function qK(h){return typeof h=="number"&&QO(h)}function _s(h){if(!Tn(h))return!1;var g=Er(h);return g==ee||g==ge||g==ne||g==De}function vT(h){return typeof h=="number"&&h==gt(h)}function _m(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=U}function Tn(h){var g=typeof h;return h!=null&&(g=="object"||g=="function")}function $n(h){return h!=null&&typeof h=="object"}var bT=MO?uo(MO):QG;function YK(h,g){return h===g||Ax(h,g,Gx(g))}function KK(h,g,_){return _=typeof _=="function"?_:n,Ax(h,g,Gx(g),_)}function XK(h){return yT(h)&&h!=+h}function QK(h){if($q(h))throw new ut(i);return uA(h)}function ZK(h){return h===null}function JK(h){return h==null}function yT(h){return typeof h=="number"||$n(h)&&Er(h)==Se}function Pf(h){if(!$n(h)||Er(h)!=ze)return!1;var g=Qg(h);if(g===null)return!0;var _=en.call(g,"constructor")&&g.constructor;return typeof _=="function"&&_ instanceof _&&qg.call(_)==KU}var r1=IO?uo(IO):ZG;function eX(h){return vT(h)&&h>=-U&&h<=U}var xT=$O?uo($O):JG;function Em(h){return typeof h=="string"||!dt(h)&&$n(h)&&Er(h)==rn}function ho(h){return typeof h=="symbol"||$n(h)&&Er(h)==$t}var gu=NO?uo(NO):eq;function tX(h){return h===n}function nX(h){return $n(h)&&mr(h)==pe}function rX(h){return $n(h)&&Er(h)==Pe}var oX=gm(Dx),iX=gm(function(h,g){return h<=g});function wT(h){if(!h)return[];if(Vr(h))return Em(h)?ci(h):Br(h);if(pf&&h[pf])return LU(h[pf]());var g=mr(h),_=g==fe?bx:g==_t?Wg:mu;return _(h)}function Es(h){if(!h)return h===0?h:0;if(h=Go(h),h===B||h===-B){var g=h<0?-1:1;return g*q}return h===h?h:0}function gt(h){var g=Es(h),_=g%1;return g===g?_?g-_:g:0}function ST(h){return h?Sl(gt(h),0,Y):0}function Go(h){if(typeof h=="number")return h;if(ho(h))return $;if(Tn(h)){var g=typeof h.valueOf=="function"?h.valueOf():h;h=Tn(g)?g+"":g}if(typeof h!="string")return h===0?h:+h;h=BO(h);var _=ke.test(h);return _||J.test(h)?xU(h.slice(2),_?2:8):Fe.test(h)?$:+h}function CT(h){return ki(h,Hr(h))}function sX(h){return h?Sl(gt(h),-U,U):h===0?h:0}function Yt(h){return h==null?"":fo(h)}var aX=fu(function(h,g){if(Ef(g)||Vr(g)){ki(g,nr(g),h);return}for(var _ in g)en.call(g,_)&&yf(h,_,g[_])}),_T=fu(function(h,g){ki(g,Hr(g),h)}),Rm=fu(function(h,g,_,T){ki(g,Hr(g),h,T)}),lX=fu(function(h,g,_,T){ki(g,nr(g),h,T)}),cX=Ss(_x);function uX(h,g){var _=du(h);return g==null?_:nA(_,g)}var dX=Et(function(h,g){h=un(h);var _=-1,T=g.length,F=T>2?g[2]:n;for(F&&Rr(g[0],g[1],F)&&(T=1);++_<T;)for(var G=g[_],Q=Hr(G),re=-1,de=Q.length;++re<de;){var Ce=Q[re],_e=h[Ce];(_e===n||di(_e,lu[Ce])&&!en.call(h,Ce))&&(h[Ce]=G[Ce])}return h}),fX=Et(function(h){return h.push(n,BA),co(ET,n,h)});function hX(h,g){return LO(h,Ke(g,3),Ni)}function pX(h,g){return LO(h,Ke(g,3),Rx)}function gX(h,g){return h==null?h:Ex(h,Ke(g,3),Hr)}function mX(h,g){return h==null?h:aA(h,Ke(g,3),Hr)}function vX(h,g){return h&&Ni(h,Ke(g,3))}function bX(h,g){return h&&Rx(h,Ke(g,3))}function yX(h){return h==null?[]:am(h,nr(h))}function xX(h){return h==null?[]:am(h,Hr(h))}function o1(h,g,_){var T=h==null?n:Cl(h,g);return T===n?_:T}function wX(h,g){return h!=null&&WA(h,g,WG)}function i1(h,g){return h!=null&&WA(h,g,UG)}var SX=kA(function(h,g,_){g!=null&&typeof g.toString!="function"&&(g=Yg.call(g)),h[g]=_},a1(Wr)),CX=kA(function(h,g,_){g!=null&&typeof g.toString!="function"&&(g=Yg.call(g)),en.call(h,g)?h[g].push(_):h[g]=[_]},Ke),_X=Et(wf);function nr(h){return Vr(h)?eA(h):Tx(h)}function Hr(h){return Vr(h)?eA(h,!0):tq(h)}function EX(h,g){var _={};return g=Ke(g,3),Ni(h,function(T,F,G){xs(_,g(T,F,G),T)}),_}function RX(h,g){var _={};return g=Ke(g,3),Ni(h,function(T,F,G){xs(_,F,g(T,F,G))}),_}var PX=fu(function(h,g,_){lm(h,g,_)}),ET=fu(function(h,g,_,T){lm(h,g,_,T)}),OX=Ss(function(h,g){var _={};if(h==null)return _;var T=!1;g=Rn(g,function(G){return G=fa(G,h),T||(T=G.length>1),G}),ki(h,Wx(h),_),T&&(_=Ho(_,d|f|p,Sq));for(var F=g.length;F--;)kx(_,g[F]);return _});function AX(h,g){return RT(h,Cm(Ke(g)))}var TX=Ss(function(h,g){return h==null?{}:rq(h,g)});function RT(h,g){if(h==null)return{};var _=Rn(Wx(h),function(T){return[T]});return g=Ke(g),vA(h,_,function(T,F){return g(T,F[0])})}function DX(h,g,_){g=fa(g,h);var T=-1,F=g.length;for(F||(F=1,h=n);++T<F;){var G=h==null?n:h[Li(g[T])];G===n&&(T=F,G=_),h=_s(G)?G.call(h):G}return h}function MX(h,g,_){return h==null?h:Cf(h,g,_)}function IX(h,g,_,T){return T=typeof T=="function"?T:n,h==null?h:Cf(h,g,_,T)}var PT=jA(nr),OT=jA(Hr);function $X(h,g,_){var T=dt(h),F=T||pa(h)||gu(h);if(g=Ke(g,4),_==null){var G=h&&h.constructor;F?_=T?new G:[]:Tn(h)?_=_s(G)?du(Qg(h)):{}:_={}}return(F?zo:Ni)(h,function(Q,re,de){return g(_,Q,re,de)}),_}function NX(h,g){return h==null?!0:kx(h,g)}function kX(h,g,_){return h==null?h:SA(h,g,jx(_))}function LX(h,g,_,T){return T=typeof T=="function"?T:n,h==null?h:SA(h,g,jx(_),T)}function mu(h){return h==null?[]:vx(h,nr(h))}function FX(h){return h==null?[]:vx(h,Hr(h))}function jX(h,g,_){return _===n&&(_=g,g=n),_!==n&&(_=Go(_),_=_===_?_:0),g!==n&&(g=Go(g),g=g===g?g:0),Sl(Go(h),g,_)}function zX(h,g,_){return g=Es(g),_===n?(_=g,g=0):_=Es(_),h=Go(h),GG(h,g,_)}function BX(h,g,_){if(_&&typeof _!="boolean"&&Rr(h,g,_)&&(g=_=n),_===n&&(typeof g=="boolean"?(_=g,g=n):typeof h=="boolean"&&(_=h,h=n)),h===n&&g===n?(h=0,g=1):(h=Es(h),g===n?(g=h,h=0):g=Es(g)),h>g){var T=h;h=g,g=T}if(_||h%1||g%1){var F=ZO();return gr(h+F*(g-h+yU("1e-"+((F+"").length-1))),g)}return Ix(h,g)}var VX=hu(function(h,g,_){return g=g.toLowerCase(),h+(_?AT(g):g)});function AT(h){return s1(Yt(h).toLowerCase())}function TT(h){return h=Yt(h),h&&h.replace($e,MU).replace(cU,"")}function HX(h,g,_){h=Yt(h),g=fo(g);var T=h.length;_=_===n?T:Sl(gt(_),0,T);var F=_;return _-=g.length,_>=0&&h.slice(_,F)==g}function WX(h){return h=Yt(h),h&&ai.test(h)?h.replace(yt,IU):h}function UX(h){return h=Yt(h),h&&vs.test(h)?h.replace(Ii,"\\$&"):h}var GX=hu(function(h,g,_){return h+(_?"-":"")+g.toLowerCase()}),qX=hu(function(h,g,_){return h+(_?" ":"")+g.toLowerCase()}),YX=IA("toLowerCase");function KX(h,g,_){h=Yt(h),g=gt(g);var T=g?su(h):0;if(!g||T>=g)return h;var F=(g-T)/2;return pm(tm(F),_)+h+pm(em(F),_)}function XX(h,g,_){h=Yt(h),g=gt(g);var T=g?su(h):0;return g&&T<g?h+pm(g-T,_):h}function QX(h,g,_){h=Yt(h),g=gt(g);var T=g?su(h):0;return g&&T<g?pm(g-T,_)+h:h}function ZX(h,g,_){return _||g==null?g=0:g&&(g=+g),iG(Yt(h).replace(er,""),g||0)}function JX(h,g,_){return(_?Rr(h,g,_):g===n)?g=1:g=gt(g),$x(Yt(h),g)}function eQ(){var h=arguments,g=Yt(h[0]);return h.length<3?g:g.replace(h[1],h[2])}var tQ=hu(function(h,g,_){return h+(_?"_":"")+g.toLowerCase()});function nQ(h,g,_){return _&&typeof _!="number"&&Rr(h,g,_)&&(g=_=n),_=_===n?Y:_>>>0,_?(h=Yt(h),h&&(typeof g=="string"||g!=null&&!r1(g))&&(g=fo(g),!g&&iu(h))?ha(ci(h),0,_):h.split(g,_)):[]}var rQ=hu(function(h,g,_){return h+(_?" ":"")+s1(g)});function oQ(h,g,_){return h=Yt(h),_=_==null?0:Sl(gt(_),0,h.length),g=fo(g),h.slice(_,_+g.length)==g}function iQ(h,g,_){var T=V.templateSettings;_&&Rr(h,g,_)&&(g=n),h=Yt(h),g=Rm({},g,T,zA);var F=Rm({},g.imports,T.imports,zA),G=nr(F),Q=vx(F,G),re,de,Ce=0,_e=g.interpolate||at,Re="__p += '",Le=yx((g.escape||at).source+"|"+_e.source+"|"+(_e===gs?Be:at).source+"|"+(g.evaluate||at).source+"|$","g"),Ge="//# sourceURL="+(en.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++pU+"]")+`
72
+ `;h.replace(Le,function(Qe,At,Nt,po,Pr,go){return Nt||(Nt=po),Re+=h.slice(Ce,go).replace(En,$U),At&&(re=!0,Re+=`' +
73
+ __e(`+At+`) +
74
+ '`),Pr&&(de=!0,Re+=`';
75
+ `+Pr+`;
76
+ __p += '`),Nt&&(Re+=`' +
77
+ ((__t = (`+Nt+`)) == null ? '' : __t) +
78
+ '`),Ce=go+Qe.length,Qe}),Re+=`';
79
+ `;var Xe=en.call(g,"variable")&&g.variable;if(!Xe)Re=`with (obj) {
80
+ `+Re+`
81
+ }
82
+ `;else if(he.test(Xe))throw new ut(a);Re=(de?Re.replace(et,""):Re).replace(pt,"$1").replace(Mt,"$1;"),Re="function("+(Xe||"obj")+`) {
83
+ `+(Xe?"":`obj || (obj = {});
84
+ `)+"var __t, __p = ''"+(re?", __e = _.escape":"")+(de?`, __j = Array.prototype.join;
85
+ function print() { __p += __j.call(arguments, '') }
86
+ `:`;
87
+ `)+Re+`return __p
88
+ }`;var xt=MT(function(){return Ht(G,Ge+"return "+Re).apply(n,Q)});if(xt.source=Re,n1(xt))throw xt;return xt}function sQ(h){return Yt(h).toLowerCase()}function aQ(h){return Yt(h).toUpperCase()}function lQ(h,g,_){if(h=Yt(h),h&&(_||g===n))return BO(h);if(!h||!(g=fo(g)))return h;var T=ci(h),F=ci(g),G=VO(T,F),Q=HO(T,F)+1;return ha(T,G,Q).join("")}function cQ(h,g,_){if(h=Yt(h),h&&(_||g===n))return h.slice(0,UO(h)+1);if(!h||!(g=fo(g)))return h;var T=ci(h),F=HO(T,ci(g))+1;return ha(T,0,F).join("")}function uQ(h,g,_){if(h=Yt(h),h&&(_||g===n))return h.replace(er,"");if(!h||!(g=fo(g)))return h;var T=ci(h),F=VO(T,ci(g));return ha(T,F).join("")}function dQ(h,g){var _=L,T=j;if(Tn(g)){var F="separator"in g?g.separator:F;_="length"in g?gt(g.length):_,T="omission"in g?fo(g.omission):T}h=Yt(h);var G=h.length;if(iu(h)){var Q=ci(h);G=Q.length}if(_>=G)return h;var re=_-su(T);if(re<1)return T;var de=Q?ha(Q,0,re).join(""):h.slice(0,re);if(F===n)return de+T;if(Q&&(re+=de.length-re),r1(F)){if(h.slice(re).search(F)){var Ce,_e=de;for(F.global||(F=yx(F.source,Yt(Ue.exec(F))+"g")),F.lastIndex=0;Ce=F.exec(_e);)var Re=Ce.index;de=de.slice(0,Re===n?re:Re)}}else if(h.indexOf(fo(F),re)!=re){var Le=de.lastIndexOf(F);Le>-1&&(de=de.slice(0,Le))}return de+T}function fQ(h){return h=Yt(h),h&&Vn.test(h)?h.replace(Jt,BU):h}var hQ=hu(function(h,g,_){return h+(_?" ":"")+g.toUpperCase()}),s1=IA("toUpperCase");function DT(h,g,_){return h=Yt(h),g=_?n:g,g===n?kU(h)?WU(h):PU(h):h.match(g)||[]}var MT=Et(function(h,g){try{return co(h,n,g)}catch(_){return n1(_)?_:new ut(_)}}),pQ=Ss(function(h,g){return zo(g,function(_){_=Li(_),xs(h,_,e1(h[_],h))}),h});function gQ(h){var g=h==null?0:h.length,_=Ke();return h=g?Rn(h,function(T){if(typeof T[1]!="function")throw new Bo(s);return[_(T[0]),T[1]]}):[],Et(function(T){for(var F=-1;++F<g;){var G=h[F];if(co(G[0],this,T))return co(G[1],this,T)}})}function mQ(h){return BG(Ho(h,d))}function a1(h){return function(){return h}}function vQ(h,g){return h==null||h!==h?g:h}var bQ=NA(),yQ=NA(!0);function Wr(h){return h}function l1(h){return dA(typeof h=="function"?h:Ho(h,d))}function xQ(h){return hA(Ho(h,d))}function wQ(h,g){return pA(h,Ho(g,d))}var SQ=Et(function(h,g){return function(_){return wf(_,h,g)}}),CQ=Et(function(h,g){return function(_){return wf(h,_,g)}});function c1(h,g,_){var T=nr(g),F=am(g,T);_==null&&!(Tn(g)&&(F.length||!T.length))&&(_=g,g=h,h=this,F=am(g,nr(g)));var G=!(Tn(_)&&"chain"in _)||!!_.chain,Q=_s(h);return zo(F,function(re){var de=g[re];h[re]=de,Q&&(h.prototype[re]=function(){var Ce=this.__chain__;if(G||Ce){var _e=h(this.__wrapped__),Re=_e.__actions__=Br(this.__actions__);return Re.push({func:de,args:arguments,thisArg:h}),_e.__chain__=Ce,_e}return de.apply(h,aa([this.value()],arguments))})}),h}function _Q(){return ar._===this&&(ar._=XU),this}function u1(){}function EQ(h){return h=gt(h),Et(function(g){return gA(g,h)})}var RQ=Bx(Rn),PQ=Bx(kO),OQ=Bx(fx);function IT(h){return Yx(h)?hx(Li(h)):oq(h)}function AQ(h){return function(g){return h==null?n:Cl(h,g)}}var TQ=LA(),DQ=LA(!0);function d1(){return[]}function f1(){return!1}function MQ(){return{}}function IQ(){return""}function $Q(){return!0}function NQ(h,g){if(h=gt(h),h<1||h>U)return[];var _=Y,T=gr(h,Y);g=Ke(g),h-=Y;for(var F=mx(T,g);++_<h;)g(_);return F}function kQ(h){return dt(h)?Rn(h,Li):ho(h)?[h]:Br(JA(Yt(h)))}function LQ(h){var g=++YU;return Yt(h)+g}var FQ=hm(function(h,g){return h+g},0),jQ=Vx("ceil"),zQ=hm(function(h,g){return h/g},1),BQ=Vx("floor");function VQ(h){return h&&h.length?sm(h,Wr,Px):n}function HQ(h,g){return h&&h.length?sm(h,Ke(g,2),Px):n}function WQ(h){return jO(h,Wr)}function UQ(h,g){return jO(h,Ke(g,2))}function GQ(h){return h&&h.length?sm(h,Wr,Dx):n}function qQ(h,g){return h&&h.length?sm(h,Ke(g,2),Dx):n}var YQ=hm(function(h,g){return h*g},1),KQ=Vx("round"),XQ=hm(function(h,g){return h-g},0);function QQ(h){return h&&h.length?gx(h,Wr):0}function ZQ(h,g){return h&&h.length?gx(h,Ke(g,2)):0}return V.after=xK,V.ary=uT,V.assign=aX,V.assignIn=_T,V.assignInWith=Rm,V.assignWith=lX,V.at=cX,V.before=dT,V.bind=e1,V.bindAll=pQ,V.bindKey=fT,V.castArray=MK,V.chain=aT,V.chunk=Bq,V.compact=Vq,V.concat=Hq,V.cond=gQ,V.conforms=mQ,V.constant=a1,V.countBy=QY,V.create=uX,V.curry=hT,V.curryRight=pT,V.debounce=gT,V.defaults=dX,V.defaultsDeep=fX,V.defer=wK,V.delay=SK,V.difference=Wq,V.differenceBy=Uq,V.differenceWith=Gq,V.drop=qq,V.dropRight=Yq,V.dropRightWhile=Kq,V.dropWhile=Xq,V.fill=Qq,V.filter=JY,V.flatMap=nK,V.flatMapDeep=rK,V.flatMapDepth=oK,V.flatten=rT,V.flattenDeep=Zq,V.flattenDepth=Jq,V.flip=CK,V.flow=bQ,V.flowRight=yQ,V.fromPairs=eY,V.functions=yX,V.functionsIn=xX,V.groupBy=iK,V.initial=nY,V.intersection=rY,V.intersectionBy=oY,V.intersectionWith=iY,V.invert=SX,V.invertBy=CX,V.invokeMap=aK,V.iteratee=l1,V.keyBy=lK,V.keys=nr,V.keysIn=Hr,V.map=xm,V.mapKeys=EX,V.mapValues=RX,V.matches=xQ,V.matchesProperty=wQ,V.memoize=Sm,V.merge=PX,V.mergeWith=ET,V.method=SQ,V.methodOf=CQ,V.mixin=c1,V.negate=Cm,V.nthArg=EQ,V.omit=OX,V.omitBy=AX,V.once=_K,V.orderBy=cK,V.over=RQ,V.overArgs=EK,V.overEvery=PQ,V.overSome=OQ,V.partial=t1,V.partialRight=mT,V.partition=uK,V.pick=TX,V.pickBy=RT,V.property=IT,V.propertyOf=AQ,V.pull=cY,V.pullAll=iT,V.pullAllBy=uY,V.pullAllWith=dY,V.pullAt=fY,V.range=TQ,V.rangeRight=DQ,V.rearg=RK,V.reject=hK,V.remove=hY,V.rest=PK,V.reverse=Zx,V.sampleSize=gK,V.set=MX,V.setWith=IX,V.shuffle=mK,V.slice=pY,V.sortBy=yK,V.sortedUniq=wY,V.sortedUniqBy=SY,V.split=nQ,V.spread=OK,V.tail=CY,V.take=_Y,V.takeRight=EY,V.takeRightWhile=RY,V.takeWhile=PY,V.tap=VY,V.throttle=AK,V.thru=ym,V.toArray=wT,V.toPairs=PT,V.toPairsIn=OT,V.toPath=kQ,V.toPlainObject=CT,V.transform=$X,V.unary=TK,V.union=OY,V.unionBy=AY,V.unionWith=TY,V.uniq=DY,V.uniqBy=MY,V.uniqWith=IY,V.unset=NX,V.unzip=Jx,V.unzipWith=sT,V.update=kX,V.updateWith=LX,V.values=mu,V.valuesIn=FX,V.without=$Y,V.words=DT,V.wrap=DK,V.xor=NY,V.xorBy=kY,V.xorWith=LY,V.zip=FY,V.zipObject=jY,V.zipObjectDeep=zY,V.zipWith=BY,V.entries=PT,V.entriesIn=OT,V.extend=_T,V.extendWith=Rm,c1(V,V),V.add=FQ,V.attempt=MT,V.camelCase=VX,V.capitalize=AT,V.ceil=jQ,V.clamp=jX,V.clone=IK,V.cloneDeep=NK,V.cloneDeepWith=kK,V.cloneWith=$K,V.conformsTo=LK,V.deburr=TT,V.defaultTo=vQ,V.divide=zQ,V.endsWith=HX,V.eq=di,V.escape=WX,V.escapeRegExp=UX,V.every=ZY,V.find=eK,V.findIndex=tT,V.findKey=hX,V.findLast=tK,V.findLastIndex=nT,V.findLastKey=pX,V.floor=BQ,V.forEach=lT,V.forEachRight=cT,V.forIn=gX,V.forInRight=mX,V.forOwn=vX,V.forOwnRight=bX,V.get=o1,V.gt=FK,V.gte=jK,V.has=wX,V.hasIn=i1,V.head=oT,V.identity=Wr,V.includes=sK,V.indexOf=tY,V.inRange=zX,V.invoke=_X,V.isArguments=Rl,V.isArray=dt,V.isArrayBuffer=zK,V.isArrayLike=Vr,V.isArrayLikeObject=Hn,V.isBoolean=BK,V.isBuffer=pa,V.isDate=VK,V.isElement=HK,V.isEmpty=WK,V.isEqual=UK,V.isEqualWith=GK,V.isError=n1,V.isFinite=qK,V.isFunction=_s,V.isInteger=vT,V.isLength=_m,V.isMap=bT,V.isMatch=YK,V.isMatchWith=KK,V.isNaN=XK,V.isNative=QK,V.isNil=JK,V.isNull=ZK,V.isNumber=yT,V.isObject=Tn,V.isObjectLike=$n,V.isPlainObject=Pf,V.isRegExp=r1,V.isSafeInteger=eX,V.isSet=xT,V.isString=Em,V.isSymbol=ho,V.isTypedArray=gu,V.isUndefined=tX,V.isWeakMap=nX,V.isWeakSet=rX,V.join=sY,V.kebabCase=GX,V.last=Uo,V.lastIndexOf=aY,V.lowerCase=qX,V.lowerFirst=YX,V.lt=oX,V.lte=iX,V.max=VQ,V.maxBy=HQ,V.mean=WQ,V.meanBy=UQ,V.min=GQ,V.minBy=qQ,V.stubArray=d1,V.stubFalse=f1,V.stubObject=MQ,V.stubString=IQ,V.stubTrue=$Q,V.multiply=YQ,V.nth=lY,V.noConflict=_Q,V.noop=u1,V.now=wm,V.pad=KX,V.padEnd=XX,V.padStart=QX,V.parseInt=ZX,V.random=BX,V.reduce=dK,V.reduceRight=fK,V.repeat=JX,V.replace=eQ,V.result=DX,V.round=KQ,V.runInContext=ue,V.sample=pK,V.size=vK,V.snakeCase=tQ,V.some=bK,V.sortedIndex=gY,V.sortedIndexBy=mY,V.sortedIndexOf=vY,V.sortedLastIndex=bY,V.sortedLastIndexBy=yY,V.sortedLastIndexOf=xY,V.startCase=rQ,V.startsWith=oQ,V.subtract=XQ,V.sum=QQ,V.sumBy=ZQ,V.template=iQ,V.times=NQ,V.toFinite=Es,V.toInteger=gt,V.toLength=ST,V.toLower=sQ,V.toNumber=Go,V.toSafeInteger=sX,V.toString=Yt,V.toUpper=aQ,V.trim=lQ,V.trimEnd=cQ,V.trimStart=uQ,V.truncate=dQ,V.unescape=fQ,V.uniqueId=LQ,V.upperCase=hQ,V.upperFirst=s1,V.each=lT,V.eachRight=cT,V.first=oT,c1(V,function(){var h={};return Ni(V,function(g,_){en.call(V.prototype,_)||(h[_]=g)}),h}(),{chain:!1}),V.VERSION=r,zo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(h){V[h].placeholder=V}),zo(["drop","take"],function(h,g){It.prototype[h]=function(_){_=_===n?1:Zn(gt(_),0);var T=this.__filtered__&&!g?new It(this):this.clone();return T.__filtered__?T.__takeCount__=gr(_,T.__takeCount__):T.__views__.push({size:gr(_,Y),type:h+(T.__dir__<0?"Right":"")}),T},It.prototype[h+"Right"]=function(_){return this.reverse()[h](_).reverse()}}),zo(["filter","map","takeWhile"],function(h,g){var _=g+1,T=_==H||_==W;It.prototype[h]=function(F){var G=this.clone();return G.__iteratees__.push({iteratee:Ke(F,3),type:_}),G.__filtered__=G.__filtered__||T,G}}),zo(["head","last"],function(h,g){var _="take"+(g?"Right":"");It.prototype[h]=function(){return this[_](1).value()[0]}}),zo(["initial","tail"],function(h,g){var _="drop"+(g?"":"Right");It.prototype[h]=function(){return this.__filtered__?new It(this):this[_](1)}}),It.prototype.compact=function(){return this.filter(Wr)},It.prototype.find=function(h){return this.filter(h).head()},It.prototype.findLast=function(h){return this.reverse().find(h)},It.prototype.invokeMap=Et(function(h,g){return typeof h=="function"?new It(this):this.map(function(_){return wf(_,h,g)})}),It.prototype.reject=function(h){return this.filter(Cm(Ke(h)))},It.prototype.slice=function(h,g){h=gt(h);var _=this;return _.__filtered__&&(h>0||g<0)?new It(_):(h<0?_=_.takeRight(-h):h&&(_=_.drop(h)),g!==n&&(g=gt(g),_=g<0?_.dropRight(-g):_.take(g-h)),_)},It.prototype.takeRightWhile=function(h){return this.reverse().takeWhile(h).reverse()},It.prototype.toArray=function(){return this.take(Y)},Ni(It.prototype,function(h,g){var _=/^(?:filter|find|map|reject)|While$/.test(g),T=/^(?:head|last)$/.test(g),F=V[T?"take"+(g=="last"?"Right":""):g],G=T||/^find/.test(g);F&&(V.prototype[g]=function(){var Q=this.__wrapped__,re=T?[1]:arguments,de=Q instanceof It,Ce=re[0],_e=de||dt(Q),Re=function(At){var Nt=F.apply(V,aa([At],re));return T&&Le?Nt[0]:Nt};_e&&_&&typeof Ce=="function"&&Ce.length!=1&&(de=_e=!1);var Le=this.__chain__,Ge=!!this.__actions__.length,Xe=G&&!Le,xt=de&&!Ge;if(!G&&_e){Q=xt?Q:new It(this);var Qe=h.apply(Q,re);return Qe.__actions__.push({func:ym,args:[Re],thisArg:n}),new Vo(Qe,Le)}return Xe&&xt?h.apply(this,re):(Qe=this.thru(Re),Xe?T?Qe.value()[0]:Qe.value():Qe)})}),zo(["pop","push","shift","sort","splice","unshift"],function(h){var g=Ug[h],_=/^(?:push|sort|unshift)$/.test(h)?"tap":"thru",T=/^(?:pop|shift)$/.test(h);V.prototype[h]=function(){var F=arguments;if(T&&!this.__chain__){var G=this.value();return g.apply(dt(G)?G:[],F)}return this[_](function(Q){return g.apply(dt(Q)?Q:[],F)})}}),Ni(It.prototype,function(h,g){var _=V[g];if(_){var T=_.name+"";en.call(uu,T)||(uu[T]=[]),uu[T].push({name:g,func:_})}}),uu[fm(n,b).name]=[{name:"wrapper",func:n}],It.prototype.clone=fG,It.prototype.reverse=hG,It.prototype.value=pG,V.prototype.at=HY,V.prototype.chain=WY,V.prototype.commit=UY,V.prototype.next=GY,V.prototype.plant=YY,V.prototype.reverse=KY,V.prototype.toJSON=V.prototype.valueOf=V.prototype.value=XY,V.prototype.first=V.prototype.head,pf&&(V.prototype[pf]=qY),V},au=UU();bl?((bl.exports=au)._=au,lx._=au):ar._=au}).call(Pa)})(fb,fb.exports);var rh=fb.exports;const cc=sl(rh);function ZT({id:e,layouts:t,initialHeight:n,y:r,x:o,w:i,minH:s}){const a={i:e,x:o??0,y:r??1/0,w:i||20,h:n||35,minW:6,minH:s||10},l=t?{...t}:{};return EE.forEach(c=>{l[c]||(l[c]=[]);const u=l[c].reduce((d,f)=>Math.max(d,f.y+f.h),0);a.y=a.y===1/0?u:a.y,l[c].push({...a})}),l}function JT(e,t){if(!t)return;const n={...t};return EE.forEach(r=>{n[r]&&(n[r]=n[r].filter(o=>o.i!==e))}),n}function OE(e){return we.getState().dashboard.globalCacheConfig}const we=M5()(j5((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:db},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setInitStore:()=>{e(n=>{n.isSessionExpired=!1,n.currentBreakpoint="lg",n.dashboard={id:"",style:db},n.showContext=!1,n.selectedSheetId=null,n.selectedCardId=null,n.selectedFrameId=null,n.selectedCard=null,n.showFilters=!1,n.isDashboardEditing=!1,n.isVisualEditing=!1,n.showDashboardJSON=!1,n.filteringCards=[],n.selectedLensId=void 0,n.filterValues=void 0})},setGlobalCacheConfig:n=>{e(r=>{r.dashboard.globalCacheConfig=n})},setLenses:n=>{e(r=>{r.lenses=n})},setSelectedLensId:n=>{e(r=>{r.selectedLensId=n})},deleteSheet:n=>{e(r=>{var i,s,a,l,c,u,d,f;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(p=>p.id===n);if(o!==void 0&&o>-1){(s=r.dashboard.sheets)==null||s.splice(o,1);const p=(a=r.dashboard.filters)==null?void 0:a.filter(v=>v.sheetId===n),m=(l=r.filterValues)==null?void 0:l.filter(v=>p==null?void 0:p.some(y=>y.id===v.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(v=>!(m!=null&&m.some(y=>y.filterId===v.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(v=>v.sheetId!==n),r.selectedSheetId=(f=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:f.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{EE.forEach(l=>{i!=null&&i[l]||(i={...i,[l]:[]});const c={i:a.id,x:0,y:0,w:10,h:8};i[l].push(c)})});const s={...n,layouts:i};r.dashboard.sheets.push(s)})},setGlobalStyle:n=>{e(r=>{r.dashboard.globalStyle=n})},setAIScopeTables:n=>{e(r=>{r.dashboard.aiScopeTables=n})},setIsSessionExpired:n=>{e(()=>({isSessionExpired:n}))},setCardPython:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&rh.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.python=r)})})},addBaseQuery:n=>{e(r=>{var o;r.dashboard.baseQueries||(r.dashboard.baseQueries=[]),(o=r.dashboard.baseQueries)==null||o.push(n)})},removeBaseQuery:n=>{e(r=>{var i,s;const o=(i=r.dashboard.baseQueries)==null?void 0:i.findIndex(a=>a.id===n);o!=null&&o>-1&&((s=r.dashboard.baseQueries)==null||s.splice(o,1))})},setBaseQueries:n=>{e(r=>{r.dashboard.baseQueries=n})},setCurrentBreakpoint:n=>{e(()=>({currentBreakpoint:n}))},setFilteringCards:n=>{e(()=>({filteringCards: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}),setDashboardWithFilterValues:(n,r)=>{e(o=>{o.dashboard=n,o.filterValues=r})},setDashboardTheme:n=>{e(r=>{r.theme=n})},setSheets:n=>{e(r=>{r.dashboard&&(r.dashboard.sheets=n)})},setSheetTitle:(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.title=r)})},setCardTitle:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&rh.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(f=>f.id===r);u&&(u.title=o)})})},setCardInfo:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===o.selectedSheetId);i&&rh.forEach(i.frames,l=>{var u;const c=(u=l.cards)==null?void 0:u.find(d=>d.id===n);c&&(c.info=r)})})},setCardDescription:(n,r,o)=>{e(i=>{var a,l;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(c=>c.id===n);s&&rh.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(f=>f.id===r);u&&(u.description=o)})})},setCardSql:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){const d=(c=s.cards)==null?void 0:c.find(f=>f.id===r);d&&(d.sql=o,(u=i.onUpdateCard)==null||u.call(i,d,n))}})},setSheetLayout:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layout=r)})},setSheetLayouts:(n,r)=>{e(o=>{var s,a;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(l=>l.id===n);i&&(i.layouts=r)})},setShowContext:n=>{e(()=>({showContext:n}))},setShowFilters:n=>{e(()=>({showFilters:n}))},setFilterValues:n=>{e(()=>({filterValues:n}))},addOrUpdateFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1?r.filterValues.splice(o,1,n):r.filterValues.push(n)}else r.filterValues=[n]})},addOrUpdateFilterValues:n=>{e(r=>{r.filterValues?n.forEach(o=>{var s,a,l;const i=(s=r==null?void 0:r.filterValues)==null?void 0:s.findIndex(c=>c.filterId===o.filterId);i!==void 0&&i>-1?(a=r.filterValues)==null||a.splice(i,1,o):(l=r.filterValues)==null||l.push(o)}):r.filterValues=n})},removeFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.filter(i=>i.filterId!==n&&!i.filterId.startsWith(n));r.filterValues=o}})},replaceFilterValue:n=>{e(r=>{if(r.filterValues){const o=r.filterValues.findIndex(i=>i.filterId===n.filterId);o>-1&&r.filterValues.splice(o,1,n)}})},addFilter:n=>{e(r=>{var i,s;r.dashboard.filters?(i=r.dashboard.filters)==null||i.push(n):r.dashboard.filters=[n],(s=r.dashboard.sheets)==null||s.find(a=>a.id===r.selectedSheetId);const o=r.dashboard.sheets;o==null||o.forEach(a=>{ZT({id:n.id,layouts:a.layouts,y:0,initialHeight:8,minH:7,w:10})})})},removeFilter:n=>{e(r=>{var o,i,s;if(r.dashboard.filters){const a=(o=r.dashboard.filters)==null?void 0:o.findIndex(l=>l.id===n);if(a>-1){(i=r.dashboard.filters)==null||i.splice(a,1),(s=r.dashboard.sheets)==null||s.find(c=>c.id===r.selectedSheetId);const l=r.dashboard.sheets;l==null||l.forEach(c=>{const u=JT(n,c.layouts);c.layouts=u})}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,d,f;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(p=>p.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(p=>p.id===r);if(a){const p=(d=a.cards)==null?void 0:d.findIndex(m=>m.id===o.id);p>-1&&((f=a.cards)==null||f.splice(p,1,o))}})},updateFilter:n=>{e(r=>{var o,i;if(r.dashboard.filters){const s=(o=r.dashboard.filters)==null?void 0:o.findIndex(a=>a.id===n.id);s>-1&&((i=r.dashboard.filters)==null||i.splice(s,1,n))}})},setIsDashboardEditing:n=>{e(()=>({isDashboardEditing:n}))},setShowDashboardJSON:n=>{e(()=>({showDashboardJSON:n}))},setIsVisualEditing:n=>{e(()=>({isVisualEditing:n}))},addFrame:(n,r,o)=>{e(i=>{var a,l,c,u;const s=(l=(a=i.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(d=>d.id===n);if(s){s.frames||(s.frames=[]),(c=s.frames)==null||c.push(r);let d=1/0;const f=0;o==="start"&&(d=0);const p=ZT({id:r.id,layouts:s.layouts,minH:10,x:f,y:d});s.layouts=p,(u=i.onAddFrame)==null||u.call(i,r,n)}})},removeFrame:(n,r)=>{e(o=>{var s,a,l,c,u;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(d=>d.id===n);if(i){const d=(l=i.frames)==null?void 0:l.findIndex(f=>f.id===r);console.log(d),typeof d=="number"&&d>-1&&((c=i.frames)==null||c.splice(d,1),(u=i.layout)==null||u.splice(d,1),JT(r,i.layouts))}})},updateFrame:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.frames)==null||u.splice(s,1,r)),(d=o.onAcceptChanges)==null||d.call(o,r,o.dashboard)})},updateCard:(n,r)=>{e(o=>{var a,l,c,u,d;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(f=>f.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(f=>f.id===r.id);i&&((u=i.cards)==null||u.splice(s,1,r),(d=o.onUpdateCard)==null||d.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,d,f;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(p=>p.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(p=>p.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(d=i.layout)==null||d.splice(s,1),(f=o.onRemoveCard)==null||f.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(c=>c.id===n);i&&(((l=i.cards)==null?void 0:l.find(u=>u.id===r))?o.selectedCardId=r:o.selectedCardId=null)})},setSelectedFrameId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===r.selectedSheetId))&&(r.selectedFrameId=n)})},setSelectedSheetId:n=>{e(r=>{var i,s;((s=(i=r.dashboard)==null?void 0:i.sheets)==null?void 0:s.find(a=>a.id===n))&&(r.selectedSheetId=n)})},setOnSaveFunction:n=>{e(()=>({onSaveFunction:n}))},setOnAddCard:n=>{e(()=>({onAddCard:n}))},setOnAcceptChanges:n=>{e(()=>({onAcceptChanges: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)},getCardFrame: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++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return a[l]}}},getSelectedFrame:()=>{var r,o,i;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(s=>s.id===t().selectedSheetId);return(i=n==null?void 0:n.frames)==null?void 0:i.find(s=>s.id===t().selectedFrameId)},getCard:n=>{var o,i;const r=(o=t().dashboard)==null?void 0:o.sheets;if(r)for(let s=0;s<r.length;s++){const a=r[s].frames;if(a)for(let l=0;l<a.length;l++){const c=(i=a[l].cards)==null?void 0:i.find(u=>u.id===n);if(c)return c}}},getSelectedSheetLayout:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layout},getSelectedSheetLayouts:()=>{var r,o;const n=(o=(r=t().dashboard)==null?void 0:r.sheets)==null?void 0:o.find(i=>i.id===t().selectedSheetId);return n==null?void 0:n.layouts},getStyle:()=>{var n;return(n=t().dashboard)==null?void 0:n.style},getCardSheet(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++)if((i=a[l].cards)==null?void 0:i.find(u=>u.id===n))return r[s]}}},handleDataPointClickAction:(n,r)=>{PJ({card:n,dataPoint:r,set:e,get:t})}}}))),fr=()=>we(e=>e.actions),OJ={theme:"system",setTheme:()=>null},G5=w.createContext(OJ);function AJ({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=w.useState(()=>localStorage.getItem(n)||t);w.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 C.jsx(G5.Provider,{...r,value:s,children:e})}const q5=()=>{const e=w.useContext(G5);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var Qp=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(){}},Pc=typeof window>"u"||"Deno"in globalThis;function Ko(){}function TJ(e,t){return typeof e=="function"?e(t):e}function kS(e){return typeof e=="number"&&e>=0&&e!==1/0}function Y5(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Uu(e,t){return typeof e=="function"?e(t):e}function yi(e,t){return typeof e=="function"?e(t):e}function eD(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==AE(s,t.options))return!1}else if(!Yh(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||o&&o!==t.state.fetchStatus||i&&!i(t))}function tD(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(qh(t.options.mutationKey)!==qh(i))return!1}else if(!Yh(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function AE(e,t){return((t==null?void 0:t.queryKeyHashFn)||qh)(e)}function qh(e){return JSON.stringify(e,(t,n)=>jS(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Yh(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Yh(e[n],t[n])):!1}function LS(e,t){if(e===t)return e;const n=nD(e)&&nD(t);if(n||jS(e)&&jS(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let c=0;c<s;c++){const u=n?c:i[c];(!n&&r.includes(u)||n)&&e[u]===void 0&&t[u]===void 0?(a[u]=void 0,l++):(a[u]=LS(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function FS(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function nD(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function jS(e){if(!rD(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!rD(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function rD(e){return Object.prototype.toString.call(e)==="[object Object]"}function DJ(e){return new Promise(t=>{setTimeout(t,e)})}function zS(e,t,n){if(typeof n.structuralSharing=="function")return n.structuralSharing(e,t);if(n.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return LS(e,t)}catch(r){console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${n.queryHash}]: ${r}`)}return LS(e,t)}return t}function MJ(e){return e}function IJ(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function $J(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var hb=Symbol();function K5(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===hb&&console.error(`Attempted to invoke queryFn when set to skipToken. This is likely a configuration error. Query hash: '${e.queryHash}'`),!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===hb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var tc,Ta,ad,p5,NJ=(p5=class extends Qp{constructor(){super();Ye(this,tc,void 0);Ye(this,Ta,void 0);Ye(this,ad,void 0);We(this,ad,t=>{if(!Pc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){le(this,Ta)||this.setEventListener(le(this,ad))}onUnsubscribe(){var t;this.hasListeners()||((t=le(this,Ta))==null||t.call(this),We(this,Ta,void 0))}setEventListener(t){var n;We(this,ad,t),(n=le(this,Ta))==null||n.call(this),We(this,Ta,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){le(this,tc)!==t&&(We(this,tc,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof le(this,tc)=="boolean"?le(this,tc):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},tc=new WeakMap,Ta=new WeakMap,ad=new WeakMap,p5),TE=new NJ,ld,Da,cd,g5,kJ=(g5=class extends Qp{constructor(){super();Ye(this,ld,!0);Ye(this,Da,void 0);Ye(this,cd,void 0);We(this,cd,t=>{if(!Pc&&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(){le(this,Da)||this.setEventListener(le(this,cd))}onUnsubscribe(){var t;this.hasListeners()||((t=le(this,Da))==null||t.call(this),We(this,Da,void 0))}setEventListener(t){var n;We(this,cd,t),(n=le(this,Da))==null||n.call(this),We(this,Da,t(this.setOnline.bind(this)))}setOnline(t){le(this,ld)!==t&&(We(this,ld,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return le(this,ld)}},ld=new WeakMap,Da=new WeakMap,cd=new WeakMap,g5),pb=new kJ;function BS(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function LJ(e){return Math.min(1e3*2**e,3e4)}function X5(e){return(e??"online")==="online"?pb.isOnline():!0}var Q5=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function w1(e){return e instanceof Q5}function Z5(e){let t=!1,n=0,r=!1,o;const i=BS(),s=v=>{var y;r||(f(new Q5(v)),(y=e.abort)==null||y.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>TE.isFocused()&&(e.networkMode==="always"||pb.isOnline())&&e.canRun(),u=()=>X5(e.networkMode)&&e.canRun(),d=v=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,v),o==null||o(),i.resolve(v))},f=v=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,v),o==null||o(),i.reject(v))},p=()=>new Promise(v=>{var y;o=b=>{(r||c())&&v(b)},(y=e.onPause)==null||y.call(e)}).then(()=>{var v;o=void 0,r||(v=e.onContinue)==null||v.call(e)}),m=()=>{if(r)return;let v;const y=n===0?e.initialPromise:void 0;try{v=y??e.fn()}catch(b){v=Promise.reject(b)}Promise.resolve(v).then(d).catch(b=>{var O;if(r)return;const x=e.retry??(Pc?0:3),E=e.retryDelay??LJ,R=typeof E=="function"?E(n,b):E,P=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,b);if(t||!P){f(b);return}n++,(O=e.onFail)==null||O.call(e,n,b),DJ(R).then(()=>c()?void 0:p()).then(()=>{t?f(b):m()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?m():p().then(m),i)}}function FJ(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var dr=FJ(),nc,m5,J5=(m5=class{constructor(){Ye(this,nc,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),kS(this.gcTime)&&We(this,nc,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Pc?1/0:5*60*1e3))}clearGcTimeout(){le(this,nc)&&(clearTimeout(le(this,nc)),We(this,nc,void 0))}},nc=new WeakMap,m5),ud,dd,Yo,yr,jp,rc,vi,Ts,v5,jJ=(v5=class extends J5{constructor(t){super();Ye(this,vi);Ye(this,ud,void 0);Ye(this,dd,void 0);Ye(this,Yo,void 0);Ye(this,yr,void 0);Ye(this,jp,void 0);Ye(this,rc,void 0);We(this,rc,!1),We(this,jp,t.defaultOptions),this.setOptions(t.options),this.observers=[],We(this,Yo,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,We(this,ud,zJ(this.options)),this.state=t.state??le(this,ud),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=le(this,yr))==null?void 0:t.promise}setOptions(t){this.options={...le(this,jp),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&le(this,Yo).remove(this)}setData(t,n){const r=zS(this.state.data,t,this.options);return kt(this,vi,Ts).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){kt(this,vi,Ts).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=le(this,yr))==null?void 0:r.promise;return(o=le(this,yr))==null||o.cancel(t),n?n.then(Ko).catch(Ko):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(le(this,ud))}isActive(){return this.observers.some(t=>yi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===hb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!Y5(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=le(this,yr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=le(this,yr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),le(this,Yo).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(le(this,yr)&&(le(this,rc)?le(this,yr).cancel({revert:!0}):le(this,yr).cancelRetry()),this.scheduleGc()),le(this,Yo).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||kt(this,vi,Ts).call(this,{type:"invalidate"})}fetch(t,n){var l,c,u;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(le(this,yr))return le(this,yr).continueRetry(),le(this,yr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.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=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(We(this,rc,!0),r.signal)})},i=()=>{const d=K5(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return o(f),We(this,rc,!1),this.options.persister?this.options.persister(d,f,this):d(f)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),We(this,dd,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&kt(this,vi,Ts).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var f,p,m,v;w1(d)&&d.silent||kt(this,vi,Ts).call(this,{type:"error",error:d}),w1(d)||((p=(f=le(this,Yo).config).onError)==null||p.call(f,d,this),(v=(m=le(this,Yo).config).onSettled)==null||v.call(m,this.state.data,d,this)),this.scheduleGc()};return We(this,yr,Z5({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var f,p,m,v;if(d===void 0){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}`),a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(y){a(y);return}(p=(f=le(this,Yo).config).onSuccess)==null||p.call(f,d,this),(v=(m=le(this,Yo).config).onSettled)==null||v.call(m,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,f)=>{kt(this,vi,Ts).call(this,{type:"failed",failureCount:d,error:f})},onPause:()=>{kt(this,vi,Ts).call(this,{type:"pause"})},onContinue:()=>{kt(this,vi,Ts).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),le(this,yr).start()}},ud=new WeakMap,dd=new WeakMap,Yo=new WeakMap,yr=new WeakMap,jp=new WeakMap,rc=new WeakMap,vi=new WeakSet,Ts=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,...e3(r.data,this.options),fetchMeta:t.meta??null};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 w1(o)&&o.revert&&le(this,dd)?{...le(this,dd),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),dr.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),le(this,Yo).notify({query:this,type:"updated",action:t})})},v5);function e3(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:X5(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function zJ(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Hi,b5,t3=(b5=class extends Qp{constructor(t={}){super();Ye(this,Hi,void 0);this.config=t,We(this,Hi,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??AE(o,n);let s=this.get(i);return s||(s=new jJ({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){le(this,Hi).has(t.queryHash)||(le(this,Hi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=le(this,Hi).get(t.queryHash);n&&(t.destroy(),n===t&&le(this,Hi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){dr.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return le(this,Hi).get(t)}getAll(){return[...le(this,Hi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>eD(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>eD(t,r)):n}notify(t){dr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){dr.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){dr.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Hi=new WeakMap,b5),Wi,Tr,oc,Ui,Sa,y5,BJ=(y5=class extends J5{constructor(t){super();Ye(this,Ui);Ye(this,Wi,void 0);Ye(this,Tr,void 0);Ye(this,oc,void 0);this.mutationId=t.mutationId,We(this,Tr,t.mutationCache),We(this,Wi,[]),this.state=t.state||VJ(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){le(this,Wi).includes(t)||(le(this,Wi).push(t),this.clearGcTimeout(),le(this,Tr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){We(this,Wi,le(this,Wi).filter(n=>n!==t)),this.scheduleGc(),le(this,Tr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){le(this,Wi).length||(this.state.status==="pending"?this.scheduleGc():le(this,Tr).remove(this))}continue(){var t;return((t=le(this,oc))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,f,p,m,v,y,b,x,E,R,P,O,A;We(this,oc,Z5({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(D,I)=>{kt(this,Ui,Sa).call(this,{type:"failed",failureCount:D,error:I})},onPause:()=>{kt(this,Ui,Sa).call(this,{type:"pause"})},onContinue:()=>{kt(this,Ui,Sa).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>le(this,Tr).canRun(this)}));const n=this.state.status==="pending",r=!le(this,oc).canStart();try{if(!n){kt(this,Ui,Sa).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=le(this,Tr).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&&kt(this,Ui,Sa).call(this,{type:"pending",context:I,variables:t,isPaused:r})}const D=await le(this,oc).start();return await((c=(l=le(this,Tr).config).onSuccess)==null?void 0:c.call(l,D,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,D,t,this.state.context)),await((p=(f=le(this,Tr).config).onSettled)==null?void 0:p.call(f,D,null,this.state.variables,this.state.context,this)),await((v=(m=this.options).onSettled)==null?void 0:v.call(m,D,null,t,this.state.context)),kt(this,Ui,Sa).call(this,{type:"success",data:D}),D}catch(D){try{throw await((b=(y=le(this,Tr).config).onError)==null?void 0:b.call(y,D,t,this.state.context,this)),await((E=(x=this.options).onError)==null?void 0:E.call(x,D,t,this.state.context)),await((P=(R=le(this,Tr).config).onSettled)==null?void 0:P.call(R,void 0,D,this.state.variables,this.state.context,this)),await((A=(O=this.options).onSettled)==null?void 0:A.call(O,void 0,D,t,this.state.context)),D}finally{kt(this,Ui,Sa).call(this,{type:"error",error:D})}}finally{le(this,Tr).runNext(this)}}},Wi=new WeakMap,Tr=new WeakMap,oc=new WeakMap,Ui=new WeakSet,Sa=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),dr.batch(()=>{le(this,Wi).forEach(r=>{r.onMutationUpdate(t)}),le(this,Tr).notify({mutation:this,type:"updated",action:t})})},y5);function VJ(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ks,bi,zp,x5,HJ=(x5=class extends Qp{constructor(t={}){super();Ye(this,ks,void 0);Ye(this,bi,void 0);Ye(this,zp,void 0);this.config=t,We(this,ks,new Set),We(this,bi,new Map),We(this,zp,0)}build(t,n,r){const o=new BJ({mutationCache:this,mutationId:++Pm(this,zp)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){le(this,ks).add(t);const n=Tm(t);if(typeof n=="string"){const r=le(this,bi).get(n);r?r.push(t):le(this,bi).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(le(this,ks).delete(t)){const n=Tm(t);if(typeof n=="string"){const r=le(this,bi).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&le(this,bi).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Tm(t);if(typeof n=="string"){const r=le(this,bi).get(n),o=r==null?void 0:r.find(i=>i.state.status==="pending");return!o||o===t}else return!0}runNext(t){var r;const n=Tm(t);if(typeof n=="string"){const o=(r=le(this,bi).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(o==null?void 0:o.continue())??Promise.resolve()}else return Promise.resolve()}clear(){dr.batch(()=>{le(this,ks).forEach(t=>{this.notify({type:"removed",mutation:t})}),le(this,ks).clear(),le(this,bi).clear()})}getAll(){return Array.from(le(this,ks))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>tD(n,r))}findAll(t={}){return this.getAll().filter(n=>tD(t,n))}notify(t){dr.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return dr.batch(()=>Promise.all(t.map(n=>n.continue().catch(Ko))))}},ks=new WeakMap,bi=new WeakMap,zp=new WeakMap,x5);function Tm(e){var t;return(t=e.options.scope)==null?void 0:t.id}function oD(e){return{onFetch:(t,n)=>{var u,d,f,p,m;const r=t.options,o=(f=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],s=((m=t.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let v=!1;const y=E=>{Object.defineProperty(E,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},b=K5(t.options,t.fetchOptions),x=async(E,R,P)=>{if(v)return Promise.reject();if(R==null&&E.pages.length)return Promise.resolve(E);const O={queryKey:t.queryKey,pageParam:R,direction:P?"backward":"forward",meta:t.options.meta};y(O);const A=await b(O),{maxPages:D}=t.options,I=P?$J:IJ;return{pages:I(E.pages,A,D),pageParams:I(E.pageParams,R,D)}};if(o&&i.length){const E=o==="backward",R=E?WJ:iD,P={pages:i,pageParams:s},O=R(r,P);a=await x(P,O,E)}else{const E=e??i.length;do{const R=l===0?s[0]??r.initialPageParam:iD(r,a);if(l>0&&R==null)break;a=await x(a,R),l++}while(l<E)}return a};t.options.persister?t.fetchFn=()=>{var v,y;return(y=(v=t.options).persister)==null?void 0:y.call(v,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function iD(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function WJ(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Nn,Ma,Ia,fd,hd,$a,pd,gd,w5,UJ=(w5=class{constructor(e={}){Ye(this,Nn,void 0);Ye(this,Ma,void 0);Ye(this,Ia,void 0);Ye(this,fd,void 0);Ye(this,hd,void 0);Ye(this,$a,void 0);Ye(this,pd,void 0);Ye(this,gd,void 0);We(this,Nn,e.queryCache||new t3),We(this,Ma,e.mutationCache||new HJ),We(this,Ia,e.defaultOptions||{}),We(this,fd,new Map),We(this,hd,new Map),We(this,$a,0)}mount(){Pm(this,$a)._++,le(this,$a)===1&&(We(this,pd,TE.subscribe(async e=>{e&&(await this.resumePausedMutations(),le(this,Nn).onFocus())})),We(this,gd,pb.subscribe(async e=>{e&&(await this.resumePausedMutations(),le(this,Nn).onOnline())})))}unmount(){var e,t;Pm(this,$a)._--,le(this,$a)===0&&((e=le(this,pd))==null||e.call(this),We(this,pd,void 0),(t=le(this,gd))==null||t.call(this),We(this,gd,void 0))}isFetching(e){return le(this,Nn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return le(this,Ma).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=le(this,Nn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=le(this,Nn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Uu(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return le(this,Nn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=le(this,Nn).get(r.queryHash),i=o==null?void 0:o.state.data,s=TJ(t,i);if(s!==void 0)return le(this,Nn).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return dr.batch(()=>le(this,Nn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=le(this,Nn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=le(this,Nn);dr.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=le(this,Nn),r={type:"active",...e};return dr.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=dr.batch(()=>le(this,Nn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Ko).catch(Ko)}invalidateQueries(e,t={}){return dr.batch(()=>{if(le(this,Nn).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=dr.batch(()=>le(this,Nn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Ko)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Ko)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=le(this,Nn).build(this,t);return n.isStaleByTime(Uu(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ko).catch(Ko)}fetchInfiniteQuery(e){return e.behavior=oD(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ko).catch(Ko)}ensureInfiniteQueryData(e){return e.behavior=oD(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return pb.isOnline()?le(this,Ma).resumePausedMutations():Promise.resolve()}getQueryCache(){return le(this,Nn)}getMutationCache(){return le(this,Ma)}getDefaultOptions(){return le(this,Ia)}setDefaultOptions(e){We(this,Ia,e)}setQueryDefaults(e,t){le(this,fd).set(qh(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...le(this,fd).values()],n={};return t.forEach(r=>{Yh(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){le(this,hd).set(qh(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...le(this,hd).values()];let n={};return t.forEach(r=>{Yh(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...le(this,Ia).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=AE(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===hb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...le(this,Ia).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){le(this,Nn).clear(),le(this,Ma).clear()}},Nn=new WeakMap,Ma=new WeakMap,Ia=new WeakMap,fd=new WeakMap,hd=new WeakMap,$a=new WeakMap,pd=new WeakMap,gd=new WeakMap,w5),Qr,Lt,Bp,Dr,ic,md,Na,Gi,Vp,vd,bd,sc,ac,ka,yd,lc,oh,Hp,VS,Wp,HS,Up,WS,Gp,US,qp,GS,Yp,qS,Kp,YS,y0,n3,S5,GJ=(S5=class extends Qp{constructor(t,n){super();Ye(this,lc);Ye(this,Hp);Ye(this,Wp);Ye(this,Up);Ye(this,Gp);Ye(this,qp);Ye(this,Yp);Ye(this,Kp);Ye(this,y0);Ye(this,Qr,void 0);Ye(this,Lt,void 0);Ye(this,Bp,void 0);Ye(this,Dr,void 0);Ye(this,ic,void 0);Ye(this,md,void 0);Ye(this,Na,void 0);Ye(this,Gi,void 0);Ye(this,Vp,void 0);Ye(this,vd,void 0);Ye(this,bd,void 0);Ye(this,sc,void 0);Ye(this,ac,void 0);Ye(this,ka,void 0);Ye(this,yd,new Set);this.options=n,We(this,Qr,t),We(this,Gi,null),We(this,Na,BS()),this.options.experimental_prefetchInRender||le(this,Na).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(le(this,Lt).addObserver(this),sD(le(this,Lt),this.options)?kt(this,lc,oh).call(this):this.updateResult(),kt(this,Gp,US).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return KS(le(this,Lt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return KS(le(this,Lt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,kt(this,qp,GS).call(this),kt(this,Yp,qS).call(this),le(this,Lt).removeObserver(this)}setOptions(t,n){const r=this.options,o=le(this,Lt);if(this.options=le(this,Qr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof yi(this.options.enabled,le(this,Lt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");kt(this,Kp,YS).call(this),le(this,Lt).setOptions(this.options),r._defaulted&&!FS(this.options,r)&&le(this,Qr).getQueryCache().notify({type:"observerOptionsUpdated",query:le(this,Lt),observer:this});const i=this.hasListeners();i&&aD(le(this,Lt),o,this.options,r)&&kt(this,lc,oh).call(this),this.updateResult(n),i&&(le(this,Lt)!==o||yi(this.options.enabled,le(this,Lt))!==yi(r.enabled,le(this,Lt))||Uu(this.options.staleTime,le(this,Lt))!==Uu(r.staleTime,le(this,Lt)))&&kt(this,Hp,VS).call(this);const s=kt(this,Wp,HS).call(this);i&&(le(this,Lt)!==o||yi(this.options.enabled,le(this,Lt))!==yi(r.enabled,le(this,Lt))||s!==le(this,ka))&&kt(this,Up,WS).call(this,s)}getOptimisticResult(t){const n=le(this,Qr).getQueryCache().build(le(this,Qr),t),r=this.createResult(n,t);return YJ(this,r)&&(We(this,Dr,r),We(this,md,this.options),We(this,ic,le(this,Lt).state)),r}getCurrentResult(){return le(this,Dr)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){le(this,yd).add(t)}getCurrentQuery(){return le(this,Lt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=le(this,Qr).defaultQueryOptions(t),r=le(this,Qr).getQueryCache().build(le(this,Qr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return kt(this,lc,oh).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),le(this,Dr)))}createResult(t,n){var D;const r=le(this,Lt),o=this.options,i=le(this,Dr),s=le(this,ic),a=le(this,md),c=t!==r?t.state:le(this,Bp),{state:u}=t;let d={...u},f=!1,p;if(n._optimisticResults){const I=this.hasListeners(),L=!I&&sD(t,n),j=I&&aD(t,r,n,o);(L||j)&&(d={...d,...e3(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:v,status:y}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(s==null?void 0:s.data)&&n.select===le(this,Vp))p=le(this,vd);else try{We(this,Vp,n.select),p=n.select(d.data),p=zS(i==null?void 0:i.data,p,n),We(this,vd,p),We(this,Gi,null)}catch(I){We(this,Gi,I)}else p=d.data;if(n.placeholderData!==void 0&&p===void 0&&y==="pending"){let I;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))I=i.data;else if(I=typeof n.placeholderData=="function"?n.placeholderData((D=le(this,bd))==null?void 0:D.state.data,le(this,bd)):n.placeholderData,n.select&&I!==void 0)try{I=n.select(I),We(this,Gi,null)}catch(L){We(this,Gi,L)}I!==void 0&&(y="success",p=zS(i==null?void 0:i.data,I,n),f=!0)}le(this,Gi)&&(m=le(this,Gi),p=le(this,vd),v=Date.now(),y="error");const b=d.fetchStatus==="fetching",x=y==="pending",E=y==="error",R=x&&b,P=p!==void 0,A={status:y,fetchStatus:d.fetchStatus,isPending:x,isSuccess:y==="success",isError:E,isInitialLoading:R,isLoading:R,data:p,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:b,isRefetching:b&&!x,isLoadingError:E&&!P,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:E&&P,isStale:DE(t,n),refetch:this.refetch,promise:le(this,Na)};if(this.options.experimental_prefetchInRender){const I=z=>{A.status==="error"?z.reject(A.error):A.data!==void 0&&z.resolve(A.data)},L=()=>{const z=We(this,Na,A.promise=BS());I(z)},j=le(this,Na);switch(j.status){case"pending":t.queryHash===r.queryHash&&I(j);break;case"fulfilled":(A.status==="error"||A.data!==j.value)&&L();break;case"rejected":(A.status!=="error"||A.error!==j.reason)&&L();break}}return A}updateResult(t){const n=le(this,Dr),r=this.createResult(le(this,Lt),this.options);if(We(this,ic,le(this,Lt).state),We(this,md,this.options),le(this,ic).data!==void 0&&We(this,bd,le(this,Lt)),FS(r,n))return;We(this,Dr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!le(this,yd).size)return!0;const l=new Set(a??le(this,yd));return this.options.throwOnError&&l.add("error"),Object.keys(le(this,Dr)).some(c=>{const u=c;return le(this,Dr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),kt(this,y0,n3).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&kt(this,Gp,US).call(this)}},Qr=new WeakMap,Lt=new WeakMap,Bp=new WeakMap,Dr=new WeakMap,ic=new WeakMap,md=new WeakMap,Na=new WeakMap,Gi=new WeakMap,Vp=new WeakMap,vd=new WeakMap,bd=new WeakMap,sc=new WeakMap,ac=new WeakMap,ka=new WeakMap,yd=new WeakMap,lc=new WeakSet,oh=function(t){kt(this,Kp,YS).call(this);let n=le(this,Lt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ko)),n},Hp=new WeakSet,VS=function(){kt(this,qp,GS).call(this);const t=Uu(this.options.staleTime,le(this,Lt));if(Pc||le(this,Dr).isStale||!kS(t))return;const r=Y5(le(this,Dr).dataUpdatedAt,t)+1;We(this,sc,setTimeout(()=>{le(this,Dr).isStale||this.updateResult()},r))},Wp=new WeakSet,HS=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(le(this,Lt)):this.options.refetchInterval)??!1},Up=new WeakSet,WS=function(t){kt(this,Yp,qS).call(this),We(this,ka,t),!(Pc||yi(this.options.enabled,le(this,Lt))===!1||!kS(le(this,ka))||le(this,ka)===0)&&We(this,ac,setInterval(()=>{(this.options.refetchIntervalInBackground||TE.isFocused())&&kt(this,lc,oh).call(this)},le(this,ka)))},Gp=new WeakSet,US=function(){kt(this,Hp,VS).call(this),kt(this,Up,WS).call(this,kt(this,Wp,HS).call(this))},qp=new WeakSet,GS=function(){le(this,sc)&&(clearTimeout(le(this,sc)),We(this,sc,void 0))},Yp=new WeakSet,qS=function(){le(this,ac)&&(clearInterval(le(this,ac)),We(this,ac,void 0))},Kp=new WeakSet,YS=function(){const t=le(this,Qr).getQueryCache().build(le(this,Qr),this.options);if(t===le(this,Lt))return;const n=le(this,Lt);We(this,Lt,t),We(this,Bp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},y0=new WeakSet,n3=function(t){dr.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(le(this,Dr))}),le(this,Qr).getQueryCache().notify({query:le(this,Lt),type:"observerResultsUpdated"})})},S5);function qJ(e,t){return yi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function sD(e,t){return qJ(e,t)||e.state.data!==void 0&&KS(e,t,t.refetchOnMount)}function KS(e,t,n){if(yi(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&DE(e,t)}return!1}function aD(e,t,n,r){return(e!==t||yi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&DE(e,n)}function DE(e,t){return yi(t.enabled,e)!==!1&&e.isStaleByTime(Uu(t.staleTime,e))}function YJ(e,t){return!FS(e.getCurrentResult(),t)}var r3=S.createContext(void 0),ME=e=>{const t=S.useContext(r3);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},KJ=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),C.jsx(r3.Provider,{value:e,children:t})),o3=S.createContext(!1),XJ=()=>S.useContext(o3);o3.Provider;function QJ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ZJ=S.createContext(QJ()),JJ=()=>S.useContext(ZJ);function eee(e,t){return typeof e=="function"?e(...t):!!e}function lD(){}var tee=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},nee=e=>{S.useEffect(()=>{e.clearReset()},[e])},ree=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&eee(n,[e.error,r]),oee=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},iee=(e,t)=>e.isLoading&&e.isFetching&&!t,see=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,cD=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function aee(e,t,n){var u,d,f,p,m;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=ME(n),o=XJ(),i=JJ(),s=r.defaultQueryOptions(e);(d=(u=r.getDefaultOptions().queries)==null?void 0:u._experimental_beforeQuery)==null||d.call(u,s),s._optimisticResults=o?"isRestoring":"optimistic",oee(s),tee(s,i),nee(i);const a=!r.getQueryCache().get(s.queryHash),[l]=S.useState(()=>new t(r,s)),c=l.getOptimisticResult(s);if(S.useSyncExternalStore(S.useCallback(v=>{const y=o?lD:l.subscribe(dr.batchCalls(v));return l.updateResult(),y},[l,o]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),S.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),see(s,c))throw cD(s,l,i);if(ree({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw c.error;if((p=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||p.call(f,s,c),s.experimental_prefetchInRender&&!Pc&&iee(c,o)){const v=a?cD(s,l,i):(m=r.getQueryCache().get(s.queryHash))==null?void 0:m.promise;v==null||v.catch(lD).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function Zp(e,t){return aee(e,GJ,t)}function i3({children:e}){const{setIsSessionExpired:t}=fr(),n=new UJ({queryCache:new t3({onError:r=>{console.error(`Something went wrong: ${r.message}`),r.message==="invalid token"&&t(!0)}}),defaultOptions:{queries:{gcTime:1e3*60*10,staleTime:1e3*60*5,refetchOnWindowFocus:!1,retry:1}}});return C.jsx(KJ,{client:n,children:e})}const Wc=w.forwardRef(({children:e,className:t,...n},r)=>C.jsx("div",{className:xe("semaphor-scope",t),ref:r,...n,children:e})),lee={id:"",authToken:void 0},s3=w.createContext(lee),a3=({children:e,dashboardProps:t})=>C.jsx(i3,{children:C.jsx(s3.Provider,{value:t,children:C.jsx(Wc,{style:{height:"100%"},children:e})})});function No(){const e=w.useContext(s3);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function cee(){const{authToken:e,version:t}=No(),n=we(a=>a.selectedLensId),{data:r,isLoading:o,isFetching:i,isError:s}=Zp({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>GZ(e==null?void 0:e.accessToken,{lensId:n,version:t})});return{data:r,isLoading:o,isFetching:i,isError:s}}function l3(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function uD(e,t){const n=l3(e);return n==="dark"?cc.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function uee({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,onFilterValuesChange:i}){const{authToken:s}=No(),a=we(k=>k.selectedLensId),{data:l,isLoading:c,isFetching:u,isError:d}=cee(),[f,p]=w.useState(o||[]),{theme:m,setTheme:v}=q5(),y=we(k=>k.dashboard.globalStyle),{setDashboard:b,setDashboardWithFilterValues:x,setSelectedSheetId:E,setStyle:R,setOnSaveFunction:P,setLenses:O,setSelectedLensId:A,setInitStore:D}=we(k=>k.actions);we(k=>k.actions.setCustomCards);const I=we(k=>k.actions.setFilterValues),L=we(k=>k.filterValues),j=we(k=>k.actions.setThemeStyle),z=we(k=>k.actions.setDashboardTheme),K=we(k=>k.actions.setOnEvent);w.useEffect(()=>{s&&D()},[s,D]),w.useEffect(()=>{if(m){const k=l3(m);z(k)}},[m,z]),w.useEffect(()=>{t&&v(t)},[t,v]);const H=w.useCallback(()=>{const k=cc.cloneDeep(db),W=cc.merge(k,y);if(e){const B=cc.merge(W,e),U=uD(m,B);j(U),R(B)}else{const B=uD(m,W);j(B),R(db)}},[m,e,y,j,R]);return w.useEffect(()=>{l&&l.dashboard&&H()},[m,e,y,H,l]),w.useEffect(()=>{var Y,X;function k(M,oe){const te=M.filters||[],ie=[];for(const ne of oe){const Z=te.find(ae=>ae.id===ne.filterId);Z&&ie.push({filterId:ne.filterId,connectionType:Z.database==="NA"?"api":"database",name:Z.column,operation:Z.operation,valueType:Wu(Z),values:ne.values})}return ie}if(!l||!l.dashboard)return;const{dashboard:W,filterValues:B,defaultLensId:U,lenses:q}=l,$=k(W,f||[]);x(W,B||$||[]),U&&A(U),q&&O(q),E(((X=(Y=W==null?void 0:W.sheets)==null?void 0:Y[0])==null?void 0:X.id)||null)},[l,b,E,I,a,O,x,A,f]),w.useEffect(()=>{i&&L&&i(L)},[L,i]),w.useEffect(()=>{n&&P(n),r&&K(r)},[n,P,r,K]),{isFetching:u,isLoading:c,isError:d}}function Gu({className:e,...t}){return C.jsx("div",{className:xe("animate-pulse rounded-md bg-muted",e),...t})}const c3=S.forwardRef(({className:e,...t},n)=>C.jsx("div",{ref:n,className:xe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));c3.displayName="Card";const P0=S.forwardRef(({className:e,...t},n)=>C.jsx("div",{ref:n,className:xe("flex flex-col space-y-1.5 p-6",e),...t}));P0.displayName="CardHeader";const Gd=S.forwardRef(({className:e,...t},n)=>C.jsx("h3",{ref:n,className:xe("text-2xl font-semibold leading-none tracking-tight",e),...t}));Gd.displayName="CardTitle";const IE=S.forwardRef(({className:e,...t},n)=>C.jsx("p",{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));IE.displayName="CardDescription";const O0=S.forwardRef(({className:e,...t},n)=>C.jsx("div",{ref:n,className:xe("px-6 pt-0",e),...t}));O0.displayName="CardContent";const u3=S.forwardRef(({className:e,...t},n)=>C.jsx("div",{ref:n,className:xe("flex items-center p-6 pt-0",e),...t}));u3.displayName="CardFooter";function d3({className:e,customStyle:t,onSave:n,onEvent:r,LoadingComponent:o,ErrorComponent:i,onChartElementClicked:s,id:a,authToken:l,currentTheme:c,version:u,customCards:d,showAssistant:f,defaultFilterValues:p,onFilterValuesChange:m,...v}){we(P=>P.selectedSheetId);const y=we(P=>P.themeStyle),b=we(P=>P.isSessionExpired),{isLoading:x,isError:E,isFetching:R}=uee({authToken:l,customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:p,onFilterValuesChange:m});return x||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?C.jsx(o,{message:"loading"}):C.jsx("div",{className:"flex items-center gap-3",children:C.jsx(Gu,{className:"h-1 w-full dark:h-[2px]"})})):E?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),C.jsx(i,{})):C.jsx("div",{children:"Error"})):b?(r==null||r({type:"error",message:"Session Expired"}),C.jsx("div",{className:"flex h-full items-center justify-center",children:C.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[C.jsx(Gd,{children:"Session Expired"}),C.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):C.jsx("div",{className:xe("flex h-full flex-col justify-between",y==null?void 0:y.dashboardPanel,e),style:{},role:"dashboard-panel",...v})}function He(){return He=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},He.apply(this,arguments)}function Ft(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 ls(e,t=[]){let n=[];function r(i,s){const a=w.createContext(s),l=n.length;n=[...n,s];function c(d){const{scope:f,children:p,...m}=d,v=(f==null?void 0:f[e][l])||a,y=w.useMemo(()=>m,Object.values(m));return w.createElement(v.Provider,{value:y},p)}function u(d,f){const p=(f==null?void 0:f[e][l])||a,m=w.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>w.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,dee(o,...t)]}function dee(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function fee(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function A0(...e){return t=>e.forEach(n=>fee(n,t))}function so(...e){return w.useCallback(A0(...e),e)}const XS=w.forwardRef((e,t)=>{const{children:n,...r}=e,o=w.Children.toArray(n),i=o.find(pee);if(i){const s=i.props.children,a=o.map(l=>l===i?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:l);return w.createElement(QS,He({},r,{ref:t}),w.isValidElement(s)?w.cloneElement(s,void 0,a):null)}return w.createElement(QS,He({},r,{ref:t}),n)});XS.displayName="Slot";const QS=w.forwardRef((e,t)=>{const{children:n,...r}=e;return w.isValidElement(n)?w.cloneElement(n,{...gee(r,n.props),ref:t?A0(t,n.ref):n.ref}):w.Children.count(n)>1?w.Children.only(null):null});QS.displayName="SlotClone";const hee=({children:e})=>w.createElement(w.Fragment,null,e);function pee(e){return w.isValidElement(e)&&e.type===hee}function gee(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 f3(e){const t=e+"CollectionProvider",[n,r]=ls(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:m,children:v}=p,y=w.useRef(null),b=w.useRef(new Map).current;return w.createElement(o,{scope:m,itemMap:b,collectionRef:y},v)},a=e+"CollectionSlot",l=w.forwardRef((p,m)=>{const{scope:v,children:y}=p,b=i(a,v),x=so(m,b.collectionRef);return w.createElement(XS,{ref:x},y)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",d=w.forwardRef((p,m)=>{const{scope:v,children:y,...b}=p,x=w.useRef(null),E=so(m,x),R=i(c,v);return w.useEffect(()=>(R.itemMap.set(x,{ref:x,...b}),()=>void R.itemMap.delete(x))),w.createElement(XS,{[u]:"",ref:E},y)});function f(p){const m=i(e+"CollectionConsumer",p);return w.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((R,P)=>b.indexOf(R.ref.current)-b.indexOf(P.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},f,r]}const Oc=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},mee=S.useId||(()=>{});let vee=0;function Jp(e){const[t,n]=S.useState(mee());return Oc(()=>{e||n(r=>r??String(vee++))},[e]),e||(t?`radix-${t}`:"")}const h3=w.forwardRef((e,t)=>{const{children:n,...r}=e,o=w.Children.toArray(n),i=o.find(yee);if(i){const s=i.props.children,a=o.map(l=>l===i?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:l);return w.createElement(ZS,He({},r,{ref:t}),w.isValidElement(s)?w.cloneElement(s,void 0,a):null)}return w.createElement(ZS,He({},r,{ref:t}),n)});h3.displayName="Slot";const ZS=w.forwardRef((e,t)=>{const{children:n,...r}=e;return w.isValidElement(n)?w.cloneElement(n,{...xee(r,n.props),ref:t?A0(t,n.ref):n.ref}):w.Children.count(n)>1?w.Children.only(null):null});ZS.displayName="SlotClone";const bee=({children:e})=>w.createElement(w.Fragment,null,e);function yee(e){return w.isValidElement(e)&&e.type===bee}function xee(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}}const wee=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],On=wee.reduce((e,t)=>{const n=w.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?h3:t;return w.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),w.createElement(a,He({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function See(e,t){e&&Pn.flushSync(()=>e.dispatchEvent(t))}function Uc(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function cs({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Cee({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Uc(n),l=w.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function Cee({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,o=w.useRef(r),i=Uc(t);return w.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const _ee=w.createContext(void 0);function $E(e){const t=w.useContext(_ee);return e||t||"ltr"}const S1="rovingFocusGroup.onEntryFocus",Eee={bubbles:!1,cancelable:!0},NE="RovingFocusGroup",[JS,p3,Ree]=f3(NE),[Pee,g3]=ls(NE,[Ree]),[Oee,Aee]=Pee(NE),Tee=w.forwardRef((e,t)=>w.createElement(JS.Provider,{scope:e.__scopeRovingFocusGroup},w.createElement(JS.Slot,{scope:e.__scopeRovingFocusGroup},w.createElement(Dee,He({},e,{ref:t}))))),Dee=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,...u}=e,d=w.useRef(null),f=so(t,d),p=$E(i),[m=null,v]=cs({prop:s,defaultProp:a,onChange:l}),[y,b]=w.useState(!1),x=Uc(c),E=p3(n),R=w.useRef(!1),[P,O]=w.useState(0);return w.useEffect(()=>{const A=d.current;if(A)return A.addEventListener(S1,x),()=>A.removeEventListener(S1,x)},[x]),w.createElement(Oee,{scope:n,orientation:r,dir:p,loop:o,currentTabStopId:m,onItemFocus:w.useCallback(A=>v(A),[v]),onItemShiftTab:w.useCallback(()=>b(!0),[]),onFocusableItemAdd:w.useCallback(()=>O(A=>A+1),[]),onFocusableItemRemove:w.useCallback(()=>O(A=>A-1),[])},w.createElement(On.div,He({tabIndex:y||P===0?-1:0,"data-orientation":r},u,{ref:f,style:{outline:"none",...e.style},onMouseDown:Ft(e.onMouseDown,()=>{R.current=!0}),onFocus:Ft(e.onFocus,A=>{const D=!R.current;if(A.target===A.currentTarget&&D&&!y){const I=new CustomEvent(S1,Eee);if(A.currentTarget.dispatchEvent(I),!I.defaultPrevented){const L=E().filter(k=>k.focusable),j=L.find(k=>k.active),z=L.find(k=>k.id===m),H=[j,z,...L].filter(Boolean).map(k=>k.ref.current);m3(H)}}R.current=!1}),onBlur:Ft(e.onBlur,()=>b(!1))})))}),Mee="RovingFocusGroupItem",Iee=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Jp(),l=i||a,c=Aee(Mee,n),u=c.currentTabStopId===l,d=p3(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=c;return w.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),w.createElement(JS.ItemSlot,{scope:n,id:l,focusable:r,active:o},w.createElement(On.span,He({tabIndex:u?0:-1,"data-orientation":c.orientation},s,{ref:t,onMouseDown:Ft(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:Ft(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Ft(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=kee(m,c.orientation,c.dir);if(v!==void 0){m.preventDefault();let b=d().filter(x=>x.focusable).map(x=>x.ref.current);if(v==="last")b.reverse();else if(v==="prev"||v==="next"){v==="prev"&&b.reverse();const x=b.indexOf(m.currentTarget);b=c.loop?Lee(b,x+1):b.slice(x+1)}setTimeout(()=>m3(b))}})})))}),$ee={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Nee(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function kee(e,t,n){const r=Nee(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return $ee[r]}function m3(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Lee(e,t){return e.map((n,r)=>e[(t+r)%e.length])}const Fee=Tee,jee=Iee;function zee(e,t){return w.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const qd=e=>{const{present:t,children:n}=e,r=Bee(t),o=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),i=so(r.ref,o.ref);return typeof n=="function"||r.isPresent?w.cloneElement(o,{ref:i}):null};qd.displayName="Presence";function Bee(e){const[t,n]=w.useState(),r=w.useRef({}),o=w.useRef(e),i=w.useRef("none"),s=e?"mounted":"unmounted",[a,l]=zee(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const c=Dm(r.current);i.current=a==="mounted"?c:"none"},[a]),Oc(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,p=Dm(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Oc(()=>{if(t){const c=d=>{const p=Dm(r.current).includes(d.animationName);d.target===t&&p&&Pn.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=Dm(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Dm(e){return(e==null?void 0:e.animationName)||"none"}const v3="Tabs",[Vee,a3e]=ls(v3,[g3]),b3=g3(),[Hee,kE]=Vee(v3),Wee=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=$E(a),[d,f]=cs({prop:r,onChange:o,defaultProp:i});return w.createElement(Hee,{scope:n,baseId:Jp(),value:d,onValueChange:f,orientation:s,dir:u,activationMode:l},w.createElement(On.div,He({dir:u,"data-orientation":s},c,{ref:t})))}),Uee="TabsList",Gee=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=kE(Uee,n),s=b3(n);return w.createElement(Fee,He({asChild:!0},s,{orientation:i.orientation,dir:i.dir,loop:r}),w.createElement(On.div,He({role:"tablist","aria-orientation":i.orientation},o,{ref:t})))}),qee="TabsTrigger",Yee=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=kE(qee,n),a=b3(n),l=y3(s.baseId,r),c=x3(s.baseId,r),u=r===s.value;return w.createElement(jee,He({asChild:!0},a,{focusable:!o,active:u}),w.createElement(On.button,He({type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l},i,{ref:t,onMouseDown:Ft(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:Ft(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:Ft(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!o&&d&&s.onValueChange(r)})})))}),Kee="TabsContent",Xee=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=kE(Kee,n),l=y3(a.baseId,r),c=x3(a.baseId,r),u=r===a.value,d=w.useRef(u);return w.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),w.createElement(qd,{present:o||u},({present:f})=>w.createElement(On.div,He({"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0},s,{ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0}}),f&&i))});function y3(e,t){return`${e}-trigger-${t}`}function x3(e,t){return`${e}-content-${t}`}const Qee=Wee,w3=Gee,S3=Yee,C3=Xee,LE=Qee,T0=S.forwardRef(({className:e,...t},n)=>C.jsx(w3,{ref:n,className:xe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));T0.displayName=w3.displayName;const D0=S.forwardRef(({className:e,...t},n)=>C.jsx(S3,{ref:n,className:xe("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}));D0.displayName=S3.displayName;const FE=S.forwardRef(({className:e,...t},n)=>C.jsx(C3,{ref:n,className:xe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));FE.displayName=C3.displayName;var _3={exports:{}},eg={},eC={exports:{}};(function(e,t){(function(n,r){r(t)})(Pa,function(n){function r(Z){return function(ce,ve,ee,ge,fe,Se,Ae){return Z(ce,ve,Ae)}}function o(Z){return function(ce,ve,ee,ge){if(!ce||!ve||typeof ce!="object"||typeof ve!="object")return Z(ce,ve,ee,ge);var fe=ge.get(ce),Se=ge.get(ve);if(fe&&Se)return fe===ve&&Se===ce;ge.set(ce,ve),ge.set(ve,ce);var Ae=Z(ce,ve,ee,ge);return ge.delete(ce),ge.delete(ve),Ae}}function i(Z,ae){var ce={};for(var ve in Z)ce[ve]=Z[ve];for(var ve in ae)ce[ve]=ae[ve];return ce}function s(Z){return Z.constructor===Object||Z.constructor==null}function a(Z){return typeof Z.then=="function"}function l(Z,ae){return Z===ae||Z!==Z&&ae!==ae}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",f="[object RegExp]",p="[object Map]",m="[object Number]",v="[object Object]",y="[object Set]",b="[object String]",x=Object.prototype.toString;function E(Z){var ae=Z.areArraysEqual,ce=Z.areDatesEqual,ve=Z.areMapsEqual,ee=Z.areObjectsEqual,ge=Z.areRegExpsEqual,fe=Z.areSetsEqual,Se=Z.createIsNestedEqual,Ae=Se(ze);function ze(Ie,De,ot){if(Ie===De)return!0;if(!Ie||!De||typeof Ie!="object"||typeof De!="object")return Ie!==Ie&&De!==De;if(s(Ie)&&s(De))return ee(Ie,De,Ae,ot);var _t=Array.isArray(Ie),rn=Array.isArray(De);if(_t||rn)return _t===rn&&ae(Ie,De,Ae,ot);var $t=x.call(Ie);return $t!==x.call(De)?!1:$t===d?ce(Ie,De,Ae,ot):$t===f?ge(Ie,De,Ae,ot):$t===p?ve(Ie,De,Ae,ot):$t===y?fe(Ie,De,Ae,ot):$t===v||$t===c?a(Ie)||a(De)?!1:ee(Ie,De,Ae,ot):$t===u||$t===m||$t===b?l(Ie.valueOf(),De.valueOf()):!1}return ze}function R(Z,ae,ce,ve){var ee=Z.length;if(ae.length!==ee)return!1;for(;ee-- >0;)if(!ce(Z[ee],ae[ee],ee,ee,Z,ae,ve))return!1;return!0}var P=o(R);function O(Z,ae){return l(Z.valueOf(),ae.valueOf())}function A(Z,ae,ce,ve){var ee=Z.size===ae.size;if(!ee)return!1;if(!Z.size)return!0;var ge={},fe=0;return Z.forEach(function(Se,Ae){if(ee){var ze=!1,Ie=0;ae.forEach(function(De,ot){!ze&&!ge[Ie]&&(ze=ce(Ae,ot,fe,Ie,Z,ae,ve)&&ce(Se,De,Ae,ot,Z,ae,ve))&&(ge[Ie]=!0),Ie++}),fe++,ee=ze}}),ee}var D=o(A),I="_owner",L=Object.prototype.hasOwnProperty;function j(Z,ae,ce,ve){var ee=Object.keys(Z),ge=ee.length;if(Object.keys(ae).length!==ge)return!1;for(var fe;ge-- >0;){if(fe=ee[ge],fe===I){var Se=!!Z.$$typeof,Ae=!!ae.$$typeof;if((Se||Ae)&&Se!==Ae)return!1}if(!L.call(ae,fe)||!ce(Z[fe],ae[fe],fe,fe,Z,ae,ve))return!1}return!0}var z=o(j);function K(Z,ae){return Z.source===ae.source&&Z.flags===ae.flags}function H(Z,ae,ce,ve){var ee=Z.size===ae.size;if(!ee)return!1;if(!Z.size)return!0;var ge={};return Z.forEach(function(fe,Se){if(ee){var Ae=!1,ze=0;ae.forEach(function(Ie,De){!Ae&&!ge[ze]&&(Ae=ce(fe,Ie,Se,De,Z,ae,ve))&&(ge[ze]=!0),ze++}),ee=Ae}}),ee}var k=o(H),W=Object.freeze({areArraysEqual:R,areDatesEqual:O,areMapsEqual:A,areObjectsEqual:j,areRegExpsEqual:K,areSetsEqual:H,createIsNestedEqual:r}),B=Object.freeze({areArraysEqual:P,areDatesEqual:O,areMapsEqual:D,areObjectsEqual:z,areRegExpsEqual:K,areSetsEqual:k,createIsNestedEqual:r}),U=E(W);function q(Z,ae){return U(Z,ae,void 0)}var $=E(i(W,{createIsNestedEqual:function(){return l}}));function Y(Z,ae){return $(Z,ae,void 0)}var X=E(B);function M(Z,ae){return X(Z,ae,new WeakMap)}var oe=E(i(B,{createIsNestedEqual:function(){return l}}));function te(Z,ae){return oe(Z,ae,new WeakMap)}function ie(Z){return E(i(W,Z(W)))}function ne(Z){var ae=E(i(B,Z(B)));return function(ce,ve,ee){return ee===void 0&&(ee=new WeakMap),ae(ce,ve,ee)}}n.circularDeepEqual=M,n.circularShallowEqual=te,n.createCustomCircularEqual=ne,n.createCustomEqual=ie,n.deepEqual=q,n.sameValueZeroEqual=l,n.shallowEqual=Y,Object.defineProperty(n,"__esModule",{value:!0})})})(eC,eC.exports);var jE=eC.exports;const zE=bE(rZ);var Ot={},Zee=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(Ot,"__esModule",{value:!0});Ot.bottom=BE;Ot.childrenEqual=nte;Ot.cloneLayout=E3;Ot.cloneLayoutItem=uc;Ot.collides=M0;Ot.compact=P3;Ot.compactItem=O3;Ot.compactType=mte;Ot.correctBounds=A3;Ot.fastPositionEqual=ote;Ot.fastRGLPropsEqual=void 0;Ot.getAllCollisions=T3;Ot.getFirstCollision=Yl;Ot.getLayoutItem=VE;Ot.getStatics=HE;Ot.modifyLayout=R3;Ot.moveElement=sh;Ot.moveElementAwayFromCollision=nC;Ot.noop=void 0;Ot.perc=ste;Ot.resizeItemInDirection=fte;Ot.setTopLeft=pte;Ot.setTransform=hte;Ot.sortLayoutItems=KE;Ot.sortLayoutItemsByColRow=N3;Ot.sortLayoutItemsByRowCol=$3;Ot.synchronizeLayoutWithChildren=gte;Ot.validateLayout=k3;Ot.withLayoutItem=tte;var dD=jE,ih=Jee(w);function Jee(e){return e&&e.__esModule?e:{default:e}}const ete=process.env.NODE_ENV==="production";function BE(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 E3(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=uc(e[n]);return t}function R3(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 tte(e,t,n){let r=VE(e,t);return r?(r=n(uc(r)),e=R3(e,r),[e,r]):[e,null]}function uc(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 nte(e,t){return(0,dD.deepEqual)(ih.default.Children.map(e,n=>n==null?void 0:n.key),ih.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,dD.deepEqual)(ih.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),ih.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}const rte=Zee;Ot.fastRGLPropsEqual=rte;function ote(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function M0(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 P3(e,t,n,r){const o=HE(e),i=KE(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=uc(i[a]);c.static||(c=O3(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const ite={x:"w",y:"h"};function tC(e,t,n,r){const o=ite[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;M0(t,a)&&tC(e,a,n+t[o],r)}}t[r]=n}function O3(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(BE(e),t.y);t.y>0&&!Yl(e,t);)t.y--;else if(a)for(;t.x>0&&!Yl(e,t);)t.x--;let l;for(;(l=Yl(e,t))&&!(n===null&&i);)if(a?tC(o,t,l.x+l.w,"x"):tC(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Yl(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function A3(e,t){const n=HE(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(;Yl(n,i);)i.y++}return e}function VE(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Yl(e,t){for(let n=0,r=e.length;n<r;n++)if(M0(e[n],t))return e[n]}function T3(e,t){return e.filter(n=>M0(n,t))}function HE(e){return e.filter(t=>t.static)}function sh(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;"Moving element ".concat(t.i," to [").concat(String(n),",").concat(String(r),"] from [").concat(t.x,",").concat(t.y,"]");const c=t.x,u=t.y;typeof n=="number"&&(t.x=n),typeof r=="number"&&(t.y=r),t.moved=!0;let d=KE(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const p=T3(d,t),m=p.length>0;if(m&&l)return E3(e);if(m&&i)return"Collision prevented on ".concat(t.i,", reverting."),t.x=c,t.y=u,t.moved=!1,e;for(let v=0,y=p.length;v<y;v++){const b=p[v];"Resolving collision between ".concat(t.i," at [").concat(t.x,",").concat(t.y,"] and ").concat(b.i," at [").concat(b.x,",").concat(b.y,"]"),!b.moved&&(b.static?e=nC(e,b,t,o,s):e=nC(e,t,b,o,s))}return e}function nC(e,t,n,r,o,i){const s=o==="horizontal",a=o==="vertical",l=t.static;if(r){r=!1;const d={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"},f=Yl(e,d),p=f&&f.y+f.h>t.y,m=f&&t.x+t.w>f.x;if(f){if(p&&a)return sh(e,n,void 0,t.y+1,r,l,o);if(p&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(m&&s)return sh(e,t,n.x,void 0,r,l,o)}else return"Doing reverse collision on ".concat(n.i," up to [").concat(d.x,",").concat(d.y,"]."),sh(e,n,s?d.x:void 0,a?d.y:void 0,r,l,o)}const c=s?n.x+1:void 0,u=a?n.y+1:void 0;return c==null&&u==null?e:sh(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function ste(e){return e*100+"%"}const D3=(e,t,n,r)=>e+n>r?t:n,M3=(e,t,n)=>e<0?t:n,I3=e=>Math.max(0,e),WE=e=>Math.max(0,e),UE=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:M3(s,e.height,o),top:WE(s)}},GE=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:D3(e.left,e.width,s,n),left:I3(o)}},qE=(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:D3(e.left,e.width,i,n),top:WE(r),left:I3(s)}},YE=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:M3(r,e.height,i),top:WE(r)}},ate=function(){return UE(arguments.length<=0?void 0:arguments[0],GE(...arguments))},lte=function(){return UE(arguments.length<=0?void 0:arguments[0],qE(...arguments))},cte=function(){return YE(arguments.length<=0?void 0:arguments[0],GE(...arguments))},ute=function(){return YE(arguments.length<=0?void 0:arguments[0],qE(...arguments))},dte={n:UE,ne:ate,e:GE,se:cte,s:YE,sw:ute,w:qE,nw:lte};function fte(e,t,n,r){const o=dte[e];return o?o(t,{...t,...n},r):n}function hte(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 pte(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 KE(e,t){return t==="horizontal"?N3(e):t==="vertical"?$3(e):e}function $3(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 N3(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 gte(e,t,n,r,o){e=e||[];const i=[];ih.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=VE(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(uc(l)):c?(ete||k3([c],"ReactGridLayout.children"),i.push(uc({...c,i:a.key}))):i.push(uc({w:1,h:1,x:0,y:BE(i),i:String(a.key)}))});const s=A3(i,{cols:n});return o?s:P3(s,r,n)}function k3(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 mte(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const vte=()=>{};Ot.noop=vte;var us={};Object.defineProperty(us,"__esModule",{value:!0});us.calcGridColWidth=I0;us.calcGridItemPosition=bte;us.calcGridItemWHPx=rC;us.calcWH=xte;us.calcXY=yte;us.clamp=Kl;function I0(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function rC(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function bte(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=I0(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=rC(r,c,s[0]),u.height=rC(o,l,s[1])),i&&i.dragging?(u.top=Math.round(i.dragging.top),u.left=Math.round(i.dragging.left)):i&&i.resizing&&typeof i.resizing.top=="number"&&typeof i.resizing.left=="number"?(u.top=Math.round(i.resizing.top),u.left=Math.round(i.resizing.left)):(u.top=Math.round((l+s[1])*n+a[1]),u.left=Math.round((c+s[0])*t+a[0])),u}function yte(e,t,n,r,o){const{margin:i,cols:s,rowHeight:a,maxRows:l}=e,c=I0(e);let u=Math.round((n-i[0])/(c+i[0])),d=Math.round((t-i[1])/(a+i[1]));return u=Kl(u,0,s-r),d=Kl(d,0,l-o),{x:u,y:d}}function xte(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=I0(e);let d=Math.round((t+s[0])/(u+s[0])),f=Math.round((n+s[1])/(c+s[1])),p=Kl(d,0,l-r),m=Kl(f,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(p=Kl(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(m=Kl(f,0,a)),{w:p,h:m}}function Kl(e,t,n){return Math.max(Math.min(e,n),t)}var $0={},oC={exports:{}},C1,fD;function XE(){if(fD)return C1;fD=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return C1=e,C1}var _1,hD;function wte(){if(hD)return _1;hD=1;var e=XE();function t(){}function n(){}return n.resetWarningCache=t,_1=function(){function r(s,a,l,c,u,d){if(d!==e){var f=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 f.name="Invariant Violation",f}}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},_1}var Mm={exports:{}},Kt={};/** @license React v16.13.1
89
+ * react-is.development.js
90
+ *
91
+ * Copyright (c) Facebook, Inc. and its affiliates.
92
+ *
93
+ * This source code is licensed under the MIT license found in the
94
+ * LICENSE file in the root directory of this source tree.
95
+ */var pD;function Ste(){return pD||(pD=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function E(ee){return typeof ee=="string"||typeof ee=="function"||ee===r||ee===c||ee===i||ee===o||ee===d||ee===f||typeof ee=="object"&&ee!==null&&(ee.$$typeof===m||ee.$$typeof===p||ee.$$typeof===s||ee.$$typeof===a||ee.$$typeof===u||ee.$$typeof===y||ee.$$typeof===b||ee.$$typeof===x||ee.$$typeof===v)}function R(ee){if(typeof ee=="object"&&ee!==null){var ge=ee.$$typeof;switch(ge){case t:var fe=ee.type;switch(fe){case l:case c:case r:case i:case o:case d:return fe;default:var Se=fe&&fe.$$typeof;switch(Se){case a:case u:case m:case p:case s:return Se;default:return ge}}case n:return ge}}}var P=l,O=c,A=a,D=s,I=t,L=u,j=r,z=m,K=p,H=n,k=i,W=o,B=d,U=!1;function q(ee){return U||(U=!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.")),$(ee)||R(ee)===l}function $(ee){return R(ee)===c}function Y(ee){return R(ee)===a}function X(ee){return R(ee)===s}function M(ee){return typeof ee=="object"&&ee!==null&&ee.$$typeof===t}function oe(ee){return R(ee)===u}function te(ee){return R(ee)===r}function ie(ee){return R(ee)===m}function ne(ee){return R(ee)===p}function Z(ee){return R(ee)===n}function ae(ee){return R(ee)===i}function ce(ee){return R(ee)===o}function ve(ee){return R(ee)===d}Kt.AsyncMode=P,Kt.ConcurrentMode=O,Kt.ContextConsumer=A,Kt.ContextProvider=D,Kt.Element=I,Kt.ForwardRef=L,Kt.Fragment=j,Kt.Lazy=z,Kt.Memo=K,Kt.Portal=H,Kt.Profiler=k,Kt.StrictMode=W,Kt.Suspense=B,Kt.isAsyncMode=q,Kt.isConcurrentMode=$,Kt.isContextConsumer=Y,Kt.isContextProvider=X,Kt.isElement=M,Kt.isForwardRef=oe,Kt.isFragment=te,Kt.isLazy=ie,Kt.isMemo=ne,Kt.isPortal=Z,Kt.isProfiler=ae,Kt.isStrictMode=ce,Kt.isSuspense=ve,Kt.isValidElementType=E,Kt.typeOf=R}()),Kt}var Xt={};/** @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 gD;function Cte(){if(gD)return Xt;gD=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function E(P){if(typeof P=="object"&&P!==null){var O=P.$$typeof;switch(O){case t:switch(P=P.type,P){case l:case c:case r:case i:case o:case d:return P;default:switch(P=P&&P.$$typeof,P){case a:case u:case m:case p:case s:return P;default:return O}}case n:return O}}}function R(P){return E(P)===c}return Xt.AsyncMode=l,Xt.ConcurrentMode=c,Xt.ContextConsumer=a,Xt.ContextProvider=s,Xt.Element=t,Xt.ForwardRef=u,Xt.Fragment=r,Xt.Lazy=m,Xt.Memo=p,Xt.Portal=n,Xt.Profiler=i,Xt.StrictMode=o,Xt.Suspense=d,Xt.isAsyncMode=function(P){return R(P)||E(P)===l},Xt.isConcurrentMode=R,Xt.isContextConsumer=function(P){return E(P)===a},Xt.isContextProvider=function(P){return E(P)===s},Xt.isElement=function(P){return typeof P=="object"&&P!==null&&P.$$typeof===t},Xt.isForwardRef=function(P){return E(P)===u},Xt.isFragment=function(P){return E(P)===r},Xt.isLazy=function(P){return E(P)===m},Xt.isMemo=function(P){return E(P)===p},Xt.isPortal=function(P){return E(P)===n},Xt.isProfiler=function(P){return E(P)===i},Xt.isStrictMode=function(P){return E(P)===o},Xt.isSuspense=function(P){return E(P)===d},Xt.isValidElementType=function(P){return typeof P=="string"||typeof P=="function"||P===r||P===c||P===i||P===o||P===d||P===f||typeof P=="object"&&P!==null&&(P.$$typeof===m||P.$$typeof===p||P.$$typeof===s||P.$$typeof===a||P.$$typeof===u||P.$$typeof===y||P.$$typeof===b||P.$$typeof===x||P.$$typeof===v)},Xt.typeOf=E,Xt}var mD;function L3(){return mD||(mD=1,process.env.NODE_ENV==="production"?Mm.exports=Cte():Mm.exports=Ste()),Mm.exports}/*
103
+ object-assign
104
+ (c) Sindre Sorhus
105
+ @license MIT
106
+ */var E1,vD;function _te(){if(vD)return E1;vD=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return E1=o()?Object.assign:function(i,s){for(var a,l=r(i),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)t.call(a,d)&&(l[d]=a[d]);if(e){c=e(a);for(var f=0;f<c.length;f++)n.call(a,c[f])&&(l[c[f]]=a[c[f]])}}return l},E1}var R1,bD;function F3(){return bD||(bD=1,R1=Function.call.bind(Object.prototype.hasOwnProperty)),R1}var P1,yD;function Ete(){if(yD)return P1;yD=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=XE(),n={},r=F3();e=function(i){var s="Warning: "+i;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function o(i,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in i)if(r(i,u)){var d;try{if(typeof i[u]!="function"){var f=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=i[u](s,u,l,a,null,t)}catch(m){d=m}if(d&&!(d instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var p=c?c():"";e("Failed "+a+" type: "+d.message+(p??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},P1=o,P1}var O1,xD;function Rte(){if(xD)return O1;xD=1;var e=L3(),t=_te(),n=XE(),r=F3(),o=Ete(),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 O1=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d($){var Y=$&&(c&&$[c]||$[u]);if(typeof Y=="function")return Y}var f="<<anonymous>>",p={array:b("array"),bigint:b("bigint"),bool:b("boolean"),func:b("function"),number:b("number"),object:b("object"),string:b("string"),symbol:b("symbol"),any:x(),arrayOf:E,element:R(),elementType:P(),instanceOf:O,node:L(),objectOf:D,oneOf:A,oneOfType:I,shape:z,exact:K};function m($,Y){return $===Y?$!==0||1/$===1/Y:$!==$&&Y!==Y}function v($,Y){this.message=$,this.data=Y&&typeof Y=="object"?Y:{},this.stack=""}v.prototype=Error.prototype;function y($){if(process.env.NODE_ENV!=="production")var Y={},X=0;function M(te,ie,ne,Z,ae,ce,ve){if(Z=Z||f,ce=ce||ne,ve!==n){if(l){var ee=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 ee.name="Invariant Violation",ee}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ge=Z+":"+ne;!Y[ge]&&X<3&&(i("You are manually calling a React.PropTypes validation function for the `"+ce+"` prop on `"+Z+"`. 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."),Y[ge]=!0,X++)}}return ie[ne]==null?te?ie[ne]===null?new v("The "+ae+" `"+ce+"` is marked as required "+("in `"+Z+"`, but its value is `null`.")):new v("The "+ae+" `"+ce+"` is marked as required in "+("`"+Z+"`, but its value is `undefined`.")):null:$(ie,ne,Z,ae,ce)}var oe=M.bind(null,!1);return oe.isRequired=M.bind(null,!0),oe}function b($){function Y(X,M,oe,te,ie,ne){var Z=X[M],ae=W(Z);if(ae!==$){var ce=B(Z);return new v("Invalid "+te+" `"+ie+"` of type "+("`"+ce+"` supplied to `"+oe+"`, expected ")+("`"+$+"`."),{expectedType:$})}return null}return y(Y)}function x(){return y(s)}function E($){function Y(X,M,oe,te,ie){if(typeof $!="function")return new v("Property `"+ie+"` of component `"+oe+"` has invalid PropType notation inside arrayOf.");var ne=X[M];if(!Array.isArray(ne)){var Z=W(ne);return new v("Invalid "+te+" `"+ie+"` of type "+("`"+Z+"` supplied to `"+oe+"`, expected an array."))}for(var ae=0;ae<ne.length;ae++){var ce=$(ne,ae,oe,te,ie+"["+ae+"]",n);if(ce instanceof Error)return ce}return null}return y(Y)}function R(){function $(Y,X,M,oe,te){var ie=Y[X];if(!a(ie)){var ne=W(ie);return new v("Invalid "+oe+" `"+te+"` of type "+("`"+ne+"` supplied to `"+M+"`, expected a single ReactElement."))}return null}return y($)}function P(){function $(Y,X,M,oe,te){var ie=Y[X];if(!e.isValidElementType(ie)){var ne=W(ie);return new v("Invalid "+oe+" `"+te+"` of type "+("`"+ne+"` supplied to `"+M+"`, expected a single ReactElement type."))}return null}return y($)}function O($){function Y(X,M,oe,te,ie){if(!(X[M]instanceof $)){var ne=$.name||f,Z=q(X[M]);return new v("Invalid "+te+" `"+ie+"` of type "+("`"+Z+"` supplied to `"+oe+"`, expected ")+("instance of `"+ne+"`."))}return null}return y(Y)}function A($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),s;function Y(X,M,oe,te,ie){for(var ne=X[M],Z=0;Z<$.length;Z++)if(m(ne,$[Z]))return null;var ae=JSON.stringify($,function(ve,ee){var ge=B(ee);return ge==="symbol"?String(ee):ee});return new v("Invalid "+te+" `"+ie+"` of value `"+String(ne)+"` "+("supplied to `"+oe+"`, expected one of "+ae+"."))}return y(Y)}function D($){function Y(X,M,oe,te,ie){if(typeof $!="function")return new v("Property `"+ie+"` of component `"+oe+"` has invalid PropType notation inside objectOf.");var ne=X[M],Z=W(ne);if(Z!=="object")return new v("Invalid "+te+" `"+ie+"` of type "+("`"+Z+"` supplied to `"+oe+"`, expected an object."));for(var ae in ne)if(r(ne,ae)){var ce=$(ne,ae,oe,te,ie+"."+ae,n);if(ce instanceof Error)return ce}return null}return y(Y)}function I($){if(!Array.isArray($))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var Y=0;Y<$.length;Y++){var X=$[Y];if(typeof X!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+U(X)+" at index "+Y+"."),s}function M(oe,te,ie,ne,Z){for(var ae=[],ce=0;ce<$.length;ce++){var ve=$[ce],ee=ve(oe,te,ie,ne,Z,n);if(ee==null)return null;ee.data&&r(ee.data,"expectedType")&&ae.push(ee.data.expectedType)}var ge=ae.length>0?", expected one of type ["+ae.join(", ")+"]":"";return new v("Invalid "+ne+" `"+Z+"` supplied to "+("`"+ie+"`"+ge+"."))}return y(M)}function L(){function $(Y,X,M,oe,te){return H(Y[X])?null:new v("Invalid "+oe+" `"+te+"` supplied to "+("`"+M+"`, expected a ReactNode."))}return y($)}function j($,Y,X,M,oe){return new v(($||"React class")+": "+Y+" type `"+X+"."+M+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+oe+"`.")}function z($){function Y(X,M,oe,te,ie){var ne=X[M],Z=W(ne);if(Z!=="object")return new v("Invalid "+te+" `"+ie+"` of type `"+Z+"` "+("supplied to `"+oe+"`, expected `object`."));for(var ae in $){var ce=$[ae];if(typeof ce!="function")return j(oe,te,ie,ae,B(ce));var ve=ce(ne,ae,oe,te,ie+"."+ae,n);if(ve)return ve}return null}return y(Y)}function K($){function Y(X,M,oe,te,ie){var ne=X[M],Z=W(ne);if(Z!=="object")return new v("Invalid "+te+" `"+ie+"` of type `"+Z+"` "+("supplied to `"+oe+"`, expected `object`."));var ae=t({},X[M],$);for(var ce in ae){var ve=$[ce];if(r($,ce)&&typeof ve!="function")return j(oe,te,ie,ce,B(ve));if(!ve)return new v("Invalid "+te+" `"+ie+"` key `"+ce+"` supplied to `"+oe+"`.\nBad object: "+JSON.stringify(X[M],null," ")+`
107
+ Valid keys: `+JSON.stringify(Object.keys($),null," "));var ee=ve(ne,ce,oe,te,ie+"."+ce,n);if(ee)return ee}return null}return y(Y)}function H($){switch(typeof $){case"number":case"string":case"undefined":return!0;case"boolean":return!$;case"object":if(Array.isArray($))return $.every(H);if($===null||a($))return!0;var Y=d($);if(Y){var X=Y.call($),M;if(Y!==$.entries){for(;!(M=X.next()).done;)if(!H(M.value))return!1}else for(;!(M=X.next()).done;){var oe=M.value;if(oe&&!H(oe[1]))return!1}}else return!1;return!0;default:return!1}}function k($,Y){return $==="symbol"?!0:Y?Y["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&Y instanceof Symbol:!1}function W($){var Y=typeof $;return Array.isArray($)?"array":$ instanceof RegExp?"object":k(Y,$)?"symbol":Y}function B($){if(typeof $>"u"||$===null)return""+$;var Y=W($);if(Y==="object"){if($ instanceof Date)return"date";if($ instanceof RegExp)return"regexp"}return Y}function U($){var Y=B($);switch(Y){case"array":case"object":return"an "+Y;case"boolean":case"date":case"regexp":return"a "+Y;default:return Y}}function q($){return!$.constructor||!$.constructor.name?f:$.constructor.name}return p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p},O1}if(process.env.NODE_ENV!=="production"){var Pte=L3(),Ote=!0;oC.exports=Rte()(Pte.isElement,Ote)}else oC.exports=wte()();var al=oC.exports,N0={exports:{}},j3={};function z3(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=z3(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function wD(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=z3(e))&&(r&&(r+=" "),r+=t);return r}const Ate=Object.freeze(Object.defineProperty({__proto__:null,clsx:wD,default:wD},Symbol.toStringTag,{value:"Module"})),Tte=bE(Ate);var jn={},ds={};Object.defineProperty(ds,"__esModule",{value:!0});ds.dontSetMe=Nte;ds.findInArray=Dte;ds.int=$te;ds.isFunction=Mte;ds.isNum=Ite;function Dte(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function Mte(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function Ite(e){return typeof e=="number"&&!isNaN(e)}function $te(e){return parseInt(e,10)}function Nte(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 Gc={};Object.defineProperty(Gc,"__esModule",{value:!0});Gc.browserPrefixToKey=V3;Gc.browserPrefixToStyle=kte;Gc.default=void 0;Gc.getPrefix=B3;const A1=["Moz","Webkit","O","ms"];function B3(){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<A1.length;r++)if(V3(t,A1[r])in n)return A1[r];return""}function V3(e,t){return t?"".concat(t).concat(Lte(e)):e}function kte(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function Lte(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}Gc.default=B3();Object.defineProperty(jn,"__esModule",{value:!0});jn.addClassName=U3;jn.addEvent=zte;jn.addUserSelectStyles=Qte;jn.createCSSTransform=qte;jn.createSVGTransform=Yte;jn.getTouch=Kte;jn.getTouchIdentifier=Xte;jn.getTranslation=QE;jn.innerHeight=Wte;jn.innerWidth=Ute;jn.matchesSelector=W3;jn.matchesSelectorAndParentsTo=jte;jn.offsetXYFromParent=Gte;jn.outerHeight=Vte;jn.outerWidth=Hte;jn.removeClassName=G3;jn.removeEvent=Bte;jn.removeUserSelectStyles=Zte;var Eo=ds,SD=Fte(Gc);function H3(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(H3=function(r){return r?n:t})(e)}function Fte(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=H3(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 Im="";function W3(e,t){return Im||(Im=(0,Eo.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,Eo.isFunction)(e[n])})),(0,Eo.isFunction)(e[Im])?e[Im](t):!1}function jte(e,t,n){let r=e;do{if(W3(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function zte(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 Bte(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 Vte(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Eo.int)(n.borderTopWidth),t+=(0,Eo.int)(n.borderBottomWidth),t}function Hte(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,Eo.int)(n.borderLeftWidth),t+=(0,Eo.int)(n.borderRightWidth),t}function Wte(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Eo.int)(n.paddingTop),t-=(0,Eo.int)(n.paddingBottom),t}function Ute(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,Eo.int)(n.paddingLeft),t-=(0,Eo.int)(n.paddingRight),t}function Gte(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 qte(e,t){const n=QE(e,t,"px");return{[(0,SD.browserPrefixToKey)("transform",SD.default)]:n}}function Yte(e,t){return QE(e,t,"")}function QE(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 Kte(e,t){return e.targetTouches&&(0,Eo.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,Eo.findInArray)(e.changedTouches,n=>t===n.identifier)}function Xte(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Qte(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&&U3(e.body,"react-draggable-transparent-selection")}function Zte(e){if(e)try{if(e.body&&G3(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 U3(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function G3(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var fs={};Object.defineProperty(fs,"__esModule",{value:!0});fs.canDragX=tne;fs.canDragY=nne;fs.createCoreData=one;fs.createDraggableData=ine;fs.getBoundPosition=Jte;fs.getControlPosition=rne;fs.snapToGrid=ene;var mo=ds,Lu=jn;function Jte(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:sne(r);const o=ZE(e);if(typeof r=="string"){const{ownerDocument:i}=o,s=i.defaultView;let a;if(r==="parent"?a=o.parentNode:a=i.querySelector(r),!(a instanceof s.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');const l=a,c=s.getComputedStyle(o),u=s.getComputedStyle(l);r={left:-o.offsetLeft+(0,mo.int)(u.paddingLeft)+(0,mo.int)(c.marginLeft),top:-o.offsetTop+(0,mo.int)(u.paddingTop)+(0,mo.int)(c.marginTop),right:(0,Lu.innerWidth)(l)-(0,Lu.outerWidth)(o)-o.offsetLeft+(0,mo.int)(u.paddingRight)-(0,mo.int)(c.marginRight),bottom:(0,Lu.innerHeight)(l)-(0,Lu.outerHeight)(o)-o.offsetTop+(0,mo.int)(u.paddingBottom)-(0,mo.int)(c.marginBottom)}}return(0,mo.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,mo.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,mo.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,mo.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function ene(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function tne(e){return e.props.axis==="both"||e.props.axis==="x"}function nne(e){return e.props.axis==="both"||e.props.axis==="y"}function rne(e,t,n){const r=typeof t=="number"?(0,Lu.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=ZE(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,Lu.offsetXYFromParent)(r||e,i,n.props.scale)}function one(e,t,n){const r=!(0,mo.isNum)(e.lastX),o=ZE(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 ine(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 sne(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function ZE(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var k0={},L0={};Object.defineProperty(L0,"__esModule",{value:!0});L0.default=ane;function ane(){}Object.defineProperty(k0,"__esModule",{value:!0});k0.default=void 0;var T1=cne(w),Ur=JE(al),lne=JE(Pn),vr=jn,va=fs,D1=ds,Mf=JE(L0);function JE(e){return e&&e.__esModule?e:{default:e}}function q3(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(q3=function(r){return r?n:t})(e)}function cne(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=q3(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 Ar(e,t,n){return t=une(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function une(e){var t=dne(e,"string");return typeof t=="symbol"?t:String(t)}function dne(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 pi={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let ba=pi.mouse,F0=class extends T1.Component{constructor(){super(...arguments),Ar(this,"dragging",!1),Ar(this,"lastX",NaN),Ar(this,"lastY",NaN),Ar(this,"touchIdentifier",null),Ar(this,"mounted",!1),Ar(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,vr.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,vr.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,vr.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,va.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,va.createCoreData)(this,s,a);(0,Mf.default)("DraggableCore: handleDragStart: %j",l),(0,Mf.default)("calling",this.props.onStart),!(this.props.onStart(t,l)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,vr.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,vr.addEvent)(r,ba.move,this.handleDrag),(0,vr.addEvent)(r,ba.stop,this.handleDragStop))}),Ar(this,"handleDrag",t=>{const n=(0,va.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,va.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,va.createCoreData)(this,r,o);if((0,Mf.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}),Ar(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,va.getControlPosition)(t,this.touchIdentifier,this);if(n==null)return;let{x:r,y:o}=n;if(Array.isArray(this.props.grid)){let l=r-this.lastX||0,c=o-this.lastY||0;[l,c]=(0,va.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,va.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,vr.removeUserSelectStyles)(a.ownerDocument),(0,Mf.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,Mf.default)("DraggableCore: Removing handlers"),(0,vr.removeEvent)(a.ownerDocument,ba.move,this.handleDrag),(0,vr.removeEvent)(a.ownerDocument,ba.stop,this.handleDragStop))}),Ar(this,"onMouseDown",t=>(ba=pi.mouse,this.handleDragStart(t))),Ar(this,"onMouseUp",t=>(ba=pi.mouse,this.handleDragStop(t))),Ar(this,"onTouchStart",t=>(ba=pi.touch,this.handleDragStart(t))),Ar(this,"onTouchEnd",t=>(ba=pi.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,vr.addEvent)(t,pi.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,vr.removeEvent)(n,pi.mouse.move,this.handleDrag),(0,vr.removeEvent)(n,pi.touch.move,this.handleDrag),(0,vr.removeEvent)(n,pi.mouse.stop,this.handleDragStop),(0,vr.removeEvent)(n,pi.touch.stop,this.handleDragStop),(0,vr.removeEvent)(t,pi.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,vr.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:lne.default.findDOMNode(this)}render(){return T1.cloneElement(T1.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};k0.default=F0;Ar(F0,"displayName","DraggableCore");Ar(F0,"propTypes",{allowAnyClick:Ur.default.bool,children:Ur.default.node.isRequired,disabled:Ur.default.bool,enableUserSelectHack:Ur.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:Ur.default.arrayOf(Ur.default.number),handle:Ur.default.string,cancel:Ur.default.string,nodeRef:Ur.default.object,onStart:Ur.default.func,onDrag:Ur.default.func,onStop:Ur.default.func,onMouseDown:Ur.default.func,scale:Ur.default.number,className:D1.dontSetMe,style:D1.dontSetMe,transform:D1.dontSetMe});Ar(F0,"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=f(w),n=u(al),r=u(Pn),o=u(Tte),i=jn,s=fs,a=ds,l=u(k0),c=u(L0);function u(x){return x&&x.__esModule?x:{default:x}}function d(x){if(typeof WeakMap!="function")return null;var E=new WeakMap,R=new WeakMap;return(d=function(P){return P?R:E})(x)}function f(x,E){if(!E&&x&&x.__esModule)return x;if(x===null||typeof x!="object"&&typeof x!="function")return{default:x};var R=d(E);if(R&&R.has(x))return R.get(x);var P={},O=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in x)if(A!=="default"&&Object.prototype.hasOwnProperty.call(x,A)){var D=O?Object.getOwnPropertyDescriptor(x,A):null;D&&(D.get||D.set)?Object.defineProperty(P,A,D):P[A]=x[A]}return P.default=x,R&&R.set(x,P),P}function p(){return p=Object.assign?Object.assign.bind():function(x){for(var E=1;E<arguments.length;E++){var R=arguments[E];for(var P in R)Object.prototype.hasOwnProperty.call(R,P)&&(x[P]=R[P])}return x},p.apply(this,arguments)}function m(x,E,R){return E=v(E),E in x?Object.defineProperty(x,E,{value:R,enumerable:!0,configurable:!0,writable:!0}):x[E]=R,x}function v(x){var E=y(x,"string");return typeof E=="symbol"?E:String(E)}function y(x,E){if(typeof x!="object"||x===null)return x;var R=x[Symbol.toPrimitive];if(R!==void 0){var P=R.call(x,E||"default");if(typeof P!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(E==="string"?String:Number)(x)}class b extends t.Component{static getDerivedStateFromProps(E,R){let{position:P}=E,{prevPropsPosition:O}=R;return P&&(!O||P.x!==O.x||P.y!==O.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:P,prevPropsPosition:O}),{x:P.x,y:P.y,prevPropsPosition:{...P}}):null}constructor(E){super(E),m(this,"onDragStart",(R,P)=>{if((0,c.default)("Draggable: onDragStart: %j",P),this.props.onStart(R,(0,s.createDraggableData)(this,P))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(R,P)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",P);const O=(0,s.createDraggableData)(this,P),A={x:O.x,y:O.y,slackX:0,slackY:0};if(this.props.bounds){const{x:I,y:L}=A;A.x+=this.state.slackX,A.y+=this.state.slackY;const[j,z]=(0,s.getBoundPosition)(this,A.x,A.y);A.x=j,A.y=z,A.slackX=this.state.slackX+(I-A.x),A.slackY=this.state.slackY+(L-A.y),O.x=A.x,O.y=A.y,O.deltaX=A.x-this.state.x,O.deltaY=A.y-this.state.y}if(this.props.onDrag(R,O)===!1)return!1;this.setState(A)}),m(this,"onDragStop",(R,P)=>{if(!this.state.dragging||this.props.onStop(R,(0,s.createDraggableData)(this,P))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",P);const A={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:I,y:L}=this.props.position;A.x=I,A.y=L}this.setState(A)}),this.state={dragging:!1,dragged:!1,x:E.position?E.position.x:E.defaultPosition.x,y:E.position?E.position.y:E.defaultPosition.y,prevPropsPosition:{...E.position},slackX:0,slackY:0,isElementSVG:!1},E.position&&!(E.onDrag||E.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 E,R;return(E=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&E!==void 0?E:r.default.findDOMNode(this)}render(){const{axis:E,bounds:R,children:P,defaultPosition:O,defaultClassName:A,defaultClassNameDragging:D,defaultClassNameDragged:I,position:L,positionOffset:j,scale:z,...K}=this.props;let H={},k=null;const B=!!!L||this.state.dragging,U=L||O,q={x:(0,s.canDragX)(this)&&B?this.state.x:U.x,y:(0,s.canDragY)(this)&&B?this.state.y:U.y};this.state.isElementSVG?k=(0,i.createSVGTransform)(q,j):H=(0,i.createCSSTransform)(q,j);const $=(0,o.default)(P.props.className||"",A,{[D]:this.state.dragging,[I]:this.state.dragged});return t.createElement(l.default,p({},K,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(P),{className:$,style:{...P.props.style,...H},transform:k}))}}e.default=b,m(b,"displayName","Draggable"),m(b,"propTypes",{...l.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),m(b,"defaultProps",{...l.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(j3);const{default:Y3,DraggableCore:fne}=j3;N0.exports=Y3;N0.exports.default=Y3;N0.exports.DraggableCore=fne;var K3=N0.exports,j0={exports:{}},tg={},eR={};eR.__esModule=!0;eR.cloneElement=bne;var hne=pne(w);function pne(e){return e&&e.__esModule?e:{default:e}}function CD(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 _D(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?CD(Object(n),!0).forEach(function(r){gne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gne(e,t,n){return t=mne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mne(e){var t=vne(e,"string");return typeof t=="symbol"?t:String(t)}function vne(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 bne(e,t){return t.style&&e.props.style&&(t.style=_D(_D({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),hne.default.cloneElement(e,t)}var ng={};ng.__esModule=!0;ng.resizableProps=void 0;var vt=yne(al);function yne(e){return e&&e.__esModule?e:{default:e}}var xne={axis:vt.default.oneOf(["both","x","y","none"]),className:vt.default.string,children:vt.default.element.isRequired,draggableOpts:vt.default.shape({allowAnyClick:vt.default.bool,cancel:vt.default.string,children:vt.default.node,disabled:vt.default.bool,enableUserSelectHack:vt.default.bool,offsetParent:vt.default.node,grid:vt.default.arrayOf(vt.default.number),handle:vt.default.string,nodeRef:vt.default.object,onStart:vt.default.func,onDrag:vt.default.func,onStop:vt.default.func,onMouseDown:vt.default.func,scale:vt.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=vt.default.number).isRequired.apply(i,n)}return vt.default.number.apply(vt.default,n)},handle:vt.default.oneOfType([vt.default.node,vt.default.func]),handleSize:vt.default.arrayOf(vt.default.number),lockAspectRatio:vt.default.bool,maxConstraints:vt.default.arrayOf(vt.default.number),minConstraints:vt.default.arrayOf(vt.default.number),onResizeStop:vt.default.func,onResizeStart:vt.default.func,onResize:vt.default.func,resizeHandles:vt.default.arrayOf(vt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:vt.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=vt.default.number).isRequired.apply(i,n)}return vt.default.number.apply(vt.default,n)}};ng.resizableProps=xne;tg.__esModule=!0;tg.default=void 0;var If=Ene(w),wne=K3,Sne=eR,Cne=ng,_ne=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function X3(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(X3=function(o){return o?n:t})(e)}function Ene(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=X3(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 iC(){return iC=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},iC.apply(this,arguments)}function Rne(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 ED(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 M1(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ED(Object(n),!0).forEach(function(r){Pne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ED(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Pne(e,t,n){return t=One(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function One(e){var t=Ane(e,"string");return typeof t=="symbol"?t:String(t)}function Ane(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 Tne(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,sC(e,t)}function sC(e,t){return sC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},sC(e,t)}var tR=function(e){Tne(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,d=o-this.props.width,f=i-this.props.height;Math.abs(d)>Math.abs(f*u)?i=o/u:o=i*u}var p=o,m=i,v=this.slack||[0,0],y=v[0],b=v[1];return o+=y,i+=b,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=[y+(p-o),b+(m-i)],[o,i]},n.resizeHandler=function(o,i){var s=this;return function(a,l){var c=l.node,u=l.deltaX,d=l.deltaY;o==="onResizeStart"&&s.resetData();var f=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",p=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!f&&!p)){var m=i[0],v=i[i.length-1],y=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(v==="w"){var b=y.left-s.lastHandleRect.left;u+=b}if(m==="n"){var x=y.top-s.lastHandleRect.top;d+=x}}s.lastHandleRect=y,v==="w"&&(u=-u),m==="n"&&(d=-d);var E=s.props.width+(f?u/s.props.transformScale:0),R=s.props.height+(p?d/s.props.transformScale:0),P=s.runConstraints(E,R);E=P[0],R=P[1];var O=E!==s.props.width||R!==s.props.height,A=typeof s.props[o]=="function"?s.props[o]:null,D=o==="onResize"&&!O;A&&!D&&(a.persist==null||a.persist(),A(a,{node:c,size:{width:E,height:R},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return If.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=M1({ref:i},a?{}:{handleAxis:o});return If.cloneElement(s,l)},n.render=function(){var o=this,i=this.props,s=i.children,a=i.className,l=i.draggableOpts;i.width,i.height,i.handle,i.handleSize,i.lockAspectRatio,i.axis,i.minConstraints,i.maxConstraints,i.onResize,i.onResizeStop,i.onResizeStart;var c=i.resizeHandles;i.transformScale;var u=Rne(i,_ne);return(0,Sne.cloneElement)(s,M1(M1({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(d){var f,p=(f=o.handleRefs[d])!=null?f:o.handleRefs[d]=If.createRef();return If.createElement(wne.DraggableCore,iC({},l,{nodeRef:p,key:"resizableHandle-"+d,onStop:o.resizeHandler("onResizeStop",d),onStart:o.resizeHandler("onResizeStart",d),onDrag:o.resizeHandler("onResize",d)}),o.renderResizeHandle(d,p))}))}))},t}(If.Component);tg.default=tR;tR.propTypes=Cne.resizableProps;tR.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var z0={};z0.__esModule=!0;z0.default=void 0;var I1=Nne(w),Dne=Q3(al),Mne=Q3(tg),Ine=ng,$ne=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function Q3(e){return e&&e.__esModule?e:{default:e}}function Z3(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Z3=function(o){return o?n:t})(e)}function Nne(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Z3(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 aC(){return aC=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},aC.apply(this,arguments)}function RD(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 gb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?RD(Object(n),!0).forEach(function(r){kne(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kne(e,t,n){return t=Lne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lne(e){var t=Fne(e,"string");return typeof t=="symbol"?t:String(t)}function Fne(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 jne(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 zne(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,lC(e,t)}function lC(e,t){return lC=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},lC(e,t)}var J3=function(e){zne(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.state={width:r.props.width,height:r.props.height,propsWidth:r.props.width,propsHeight:r.props.height},r.onResize=function(a,l){var c=l.size;r.props.onResize?(a.persist==null||a.persist(),r.setState(c,function(){return r.props.onResize&&r.props.onResize(a,l)})):r.setState(c)},r}t.getDerivedStateFromProps=function(o,i){return i.propsWidth!==o.width||i.propsHeight!==o.height?{width:o.width,height:o.height,propsWidth:o.width,propsHeight:o.height}:null};var n=t.prototype;return n.render=function(){var o=this.props,i=o.handle,s=o.handleSize;o.onResize;var a=o.onResizeStart,l=o.onResizeStop,c=o.draggableOpts,u=o.minConstraints,d=o.maxConstraints,f=o.lockAspectRatio,p=o.axis;o.width,o.height;var m=o.resizeHandles,v=o.style,y=o.transformScale,b=jne(o,$ne);return I1.createElement(Mne.default,{axis:p,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:f,maxConstraints:d,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:m,transformScale:y,width:this.state.width},I1.createElement("div",aC({},b,{style:gb(gb({},v),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(I1.Component);z0.default=J3;J3.propTypes=gb(gb({},Ine.resizableProps),{},{children:Dne.default.element});j0.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};j0.exports.Resizable=tg.default;j0.exports.ResizableBox=z0.default;var Bne=j0.exports,Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.resizeHandleType=Ws.resizeHandleAxesType=Ws.default=void 0;var St=e4(al),Vne=e4(w);function e4(e){return e&&e.__esModule?e:{default:e}}const t4=St.default.arrayOf(St.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));Ws.resizeHandleAxesType=t4;const n4=St.default.oneOfType([St.default.node,St.default.func]);Ws.resizeHandleType=n4;var Hne={className:St.default.string,style:St.default.object,width:St.default.number,autoSize:St.default.bool,cols:St.default.number,draggableCancel:St.default.string,draggableHandle:St.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:St.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Ot.validateLayout(t,"layout")},margin:St.default.arrayOf(St.default.number),containerPadding:St.default.arrayOf(St.default.number),rowHeight:St.default.number,maxRows:St.default.number,isBounded:St.default.bool,isDraggable:St.default.bool,isResizable:St.default.bool,allowOverlap:St.default.bool,preventCollision:St.default.bool,useCSSTransforms:St.default.bool,transformScale:St.default.number,isDroppable:St.default.bool,resizeHandles:t4,resizeHandle:n4,onLayoutChange:St.default.func,onDragStart:St.default.func,onDrag:St.default.func,onDragStop:St.default.func,onResizeStart:St.default.func,onResize:St.default.func,onResizeStop:St.default.func,onDrop:St.default.func,droppingItem:St.default.shape({i:St.default.string.isRequired,w:St.default.number.isRequired,h:St.default.number.isRequired}),children:function(e,t){const n=e[t],r={};Vne.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:St.default.any};Ws.default=Hne;Object.defineProperty($0,"__esModule",{value:!0});$0.default=void 0;var vu=nR(w),Wt=nR(al),Wne=K3,Une=Bne,bu=Ot,cr=us,PD=Ws,Gne=nR(zE);function nR(e){return e&&e.__esModule?e:{default:e}}function ji(e,t,n){return t=qne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qne(e){var t=Yne(e,"string");return typeof t=="symbol"?t:String(t)}function Yne(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 rR extends vu.default.Component{constructor(){super(...arguments),ji(this,"state",{resizing:null,dragging:null,className:""}),ji(this,"elementRef",vu.default.createRef()),ji(this,"onDragStart",(t,n)=>{let{node:r}=n;const{onDragStart:o,transformScale:i}=this.props;if(!o)return;const s={top:0,left:0},{offsetParent:a}=r;if(!a)return;const l=a.getBoundingClientRect(),c=r.getBoundingClientRect(),u=c.left/i,d=l.left/i,f=c.top/i,p=l.top/i;s.left=u-d+a.scrollLeft,s.top=f-p+a.scrollTop,this.setState({dragging:s});const{x:m,y:v}=(0,cr.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,m,v,{e:t,node:r,newPosition:s})}),ji(this,"onDrag",(t,n)=>{let{node:r,deltaX:o,deltaY:i}=n;const{onDrag:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let a=this.state.dragging.top+i,l=this.state.dragging.left+o;const{isBounded:c,i:u,w:d,h:f,containerWidth:p}=this.props,m=this.getPositionParams();if(c){const{offsetParent:x}=r;if(x){const{margin:E,rowHeight:R}=this.props,P=x.clientHeight-(0,cr.calcGridItemWHPx)(f,R,E[1]);a=(0,cr.clamp)(a,0,P);const O=(0,cr.calcGridColWidth)(m),A=p-(0,cr.calcGridItemWHPx)(d,O,E[0]);l=(0,cr.clamp)(l,0,A)}}const v={top:a,left:l};this.setState({dragging:v});const{x:y,y:b}=(0,cr.calcXY)(m,a,l,d,f);return s.call(this,u,y,b,{e:t,node:r,newPosition:v})}),ji(this,"onDragStop",(t,n)=>{let{node:r}=n;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:i,h:s,i:a}=this.props,{left:l,top:c}=this.state.dragging,u={top:c,left:l};this.setState({dragging:null});const{x:d,y:f}=(0,cr.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,d,f,{e:t,node:r,newPosition:u})}),ji(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),ji(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),ji(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,cr.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,cr.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,bu.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,bu.setTransform)(t):(i=(0,bu.setTopLeft)(t),n&&(i.left=(0,bu.perc)(t.left/r),i.width=(0,bu.perc)(t.width/r))),i}mixinDraggable(t,n){return vu.default.createElement(Wne.DraggableCore,{disabled:!n,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},t)}curryResizeHandler(t,n){return(r,o)=>n(r,o,t)}mixinResizable(t,n,r){const{cols:o,minW:i,minH:s,maxW:a,maxH:l,transformScale:c,resizeHandles:u,resizeHandle:d}=this.props,f=this.getPositionParams(),p=(0,cr.calcGridItemPosition)(f,0,0,o,0).width,m=(0,cr.calcGridItemPosition)(f,0,0,i,s),v=(0,cr.calcGridItemPosition)(f,0,0,a,l),y=[m.width,m.height],b=[Math.min(v.width,p),Math.min(v.height,1/0)];return vu.default.createElement(Une.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:y,maxConstraints:b,onResizeStop:this.curryResizeHandler(n,this.onResizeStop),onResizeStart:this.curryResizeHandler(n,this.onResizeStart),onResize:this.curryResizeHandler(n,this.onResize),transformScale:c,resizeHandles:u,handle:d},t)}onResizeHandler(t,n,r,o){let{node:i,size:s,handle:a}=n;const l=this.props[o];if(!l)return;const{x:c,y:u,i:d,maxH:f,minH:p,containerWidth:m}=this.props,{minW:v,maxW:y}=this.props;let b=s;i&&(b=(0,bu.resizeItemInDirection)(a,r,s,m),this.setState({resizing:o==="onResizeStop"?null:b}));let{w:x,h:E}=(0,cr.calcWH)(this.getPositionParams(),b.width,b.height,c,u,a);x=(0,cr.clamp)(x,Math.max(v,1),y),E=(0,cr.clamp)(E,p,f),l.call(this,d,x,E,{e:t,node:i,size:b,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,cr.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=vu.default.Children.only(this.props.children);let d=vu.default.cloneElement(u,{ref:this.elementRef,className:(0,Gne.default)("react-grid-item",u.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":i,"react-draggable-dragging":!!this.state.dragging,dropping:!!a,cssTransforms:l}),style:{...this.props.style,...u.props.style,...this.createStyle(c)}});return d=this.mixinResizable(d,c,s),d=this.mixinDraggable(d,i),d}}$0.default=rR;ji(rR,"propTypes",{children:Wt.default.element,cols:Wt.default.number.isRequired,containerWidth:Wt.default.number.isRequired,rowHeight:Wt.default.number.isRequired,margin:Wt.default.array.isRequired,maxRows:Wt.default.number.isRequired,containerPadding:Wt.default.array.isRequired,x:Wt.default.number.isRequired,y:Wt.default.number.isRequired,w:Wt.default.number.isRequired,h:Wt.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:Wt.default.string.isRequired,resizeHandles:PD.resizeHandleAxesType,resizeHandle:PD.resizeHandleType,onDragStop:Wt.default.func,onDragStart:Wt.default.func,onDrag:Wt.default.func,onResizeStop:Wt.default.func,onResizeStart:Wt.default.func,onResize:Wt.default.func,isDraggable:Wt.default.bool.isRequired,isResizable:Wt.default.bool.isRequired,isBounded:Wt.default.bool.isRequired,static:Wt.default.bool,useCSSTransforms:Wt.default.bool.isRequired,transformScale:Wt.default.number,className:Wt.default.string,handle:Wt.default.string,cancel:Wt.default.string,droppingPosition:Wt.default.shape({e:Wt.default.object.isRequired,left:Wt.default.number.isRequired,top:Wt.default.number.isRequired})});ji(rR,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(eg,"__esModule",{value:!0});eg.default=void 0;var Pl=Zne(w),$1=jE,Kne=oR(zE),it=Ot,Xne=us,OD=oR($0),Qne=oR(Ws);function oR(e){return e&&e.__esModule?e:{default:e}}function r4(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(r4=function(r){return r?n:t})(e)}function Zne(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=r4(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 br(e,t,n){return t=Jne(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Jne(e){var t=ere(e,"string");return typeof t=="symbol"?t:String(t)}function ere(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 AD="react-grid-layout";let o4=!1;try{o4=/firefox/i.test(navigator.userAgent)}catch{}class B0 extends Pl.Component{constructor(){super(...arguments),br(this,"state",{activeDrag:null,layout:(0,it.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,it.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),br(this,"dragEnterCounter",0),br(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,it.getLayoutItem)(a,t);if(l)return this.setState({oldDragItem:(0,it.cloneLayoutItem)(l),oldLayout:a}),this.props.onDragStart(a,l,l,null,i,s)}),br(this,"onDrag",(t,n,r,o)=>{let{e:i,node:s}=o;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,allowOverlap:u,preventCollision:d}=this.props,f=(0,it.getLayoutItem)(l,t);if(!f)return;const p={w:f.w,h:f.h,x:f.x,y:f.y,placeholder:!0,i:t},m=!0;l=(0,it.moveElement)(l,f,n,r,m,d,(0,it.compactType)(this.props),c,u),this.props.onDrag(l,a,f,p,i,s),this.setState({layout:u?l:(0,it.compact)(l,(0,it.compactType)(this.props),c),activeDrag:p})}),br(this,"onDragStop",(t,n,r,o)=>{let{e:i,node:s}=o;if(!this.state.activeDrag)return;const{oldDragItem:a}=this.state;let{layout:l}=this.state;const{cols:c,preventCollision:u,allowOverlap:d}=this.props,f=(0,it.getLayoutItem)(l,t);if(!f)return;const p=!0;l=(0,it.moveElement)(l,f,n,r,p,u,(0,it.compactType)(this.props),c,d);const m=d?l:(0,it.compact)(l,(0,it.compactType)(this.props),c);this.props.onDragStop(m,a,f,null,i,s);const{oldLayout:v}=this.state;this.setState({activeDrag:null,layout:m,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(m,v)}),br(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,it.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,it.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),br(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:c}=this.state;let{layout:u}=this.state;const{cols:d,preventCollision:f,allowOverlap:p}=this.props;let m=!1,v,y,b;const[x,E]=(0,it.withLayoutItem)(u,t,P=>{let O;return y=P.x,b=P.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(y=P.x+(P.w-n),n=P.x!==y&&y<0?P.w:n,y=y<0?0:y),["ne","n","nw"].indexOf(l)!==-1&&(b=P.y+(P.h-r),r=P.y!==b&&b<0?P.h:r,b=b<0?0:b),m=!0),f&&!p&&(O=(0,it.getAllCollisions)(u,{...P,w:n,h:r,x:y,y:b}).filter(D=>D.i!==P.i).length>0,O&&(b=P.y,r=P.h,y=P.x,n=P.w,m=!1)),P.w=n,P.h=r,P});if(!E)return;v=x,m&&(v=(0,it.moveElement)(x,E,y,b,!0,this.props.preventCollision,(0,it.compactType)(this.props),d,p));const R={w:E.w,h:E.h,x:E.x,y:E.y,static:!0,i:t};this.props.onResize(v,c,E,R,i,s),this.setState({layout:p?v:(0,it.compact)(v,(0,it.compactType)(this.props),d),activeDrag:R})}),br(this,"onResizeStop",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a,oldResizeItem:l}=this.state,{cols:c,allowOverlap:u}=this.props,d=(0,it.getLayoutItem)(a,t),f=u?a:(0,it.compact)(a,(0,it.compactType)(this.props),c);this.props.onResizeStop(f,l,d,null,i,s);const{oldLayout:p}=this.state;this.setState({activeDrag:null,layout:f,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(f,p)}),br(this,"onDragOver",t=>{var n;if(t.preventDefault(),t.stopPropagation(),o4&&!((n=t.nativeEvent.target)!==null&&n!==void 0&&n.classList.contains(AD)))return!1;const{droppingItem:r,onDropDragOver:o,margin:i,cols:s,rowHeight:a,maxRows:l,width:c,containerPadding:u,transformScale:d}=this.props,f=o==null?void 0:o(t);if(f===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...r,...f},{layout:m}=this.state,{layerX:v,layerY:y}=t.nativeEvent,b={left:v/d,top:y/d,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:x,top:E}=this.state.droppingPosition;(x!=v||E!=y)&&this.setState({droppingPosition:b})}}else{const x={cols:s,margin:i,maxRows:l,rowHeight:a,containerWidth:c,containerPadding:u||i},E=(0,Xne.calcXY)(x,y,v,p.w,p.h);this.setState({droppingDOMNode:Pl.createElement("div",{key:p.i}),droppingPosition:b,layout:[...m,{...p,x:E.x,y:E.y,static:!1,isDraggable:!0}]})}}),br(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,it.compact)(r.filter(i=>i.i!==t.i),(0,it.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),br(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),br(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),br(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,$1.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,it.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,it.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,it.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,it.fastRGLPropsEqual)(this.props,t,$1.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,it.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,$1.deepEqual)(n,t)||this.props.onLayoutChange(t)}placeholder(){const{activeDrag:t}=this.state;if(!t)return null;const{width:n,cols:r,margin:o,containerPadding:i,rowHeight:s,maxRows:a,useCSSTransforms:l,transformScale:c}=this.props;return Pl.createElement(OD.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:"react-grid-placeholder ".concat(this.state.resizing?"placeholder-resizing":""),containerWidth:n,cols:r,margin:o,containerPadding:i||o,maxRows:a,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:l,transformScale:c},Pl.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,it.getLayoutItem)(this.state.layout,String(t.key));if(!r)return null;const{width:o,cols:i,margin:s,containerPadding:a,rowHeight:l,maxRows:c,isDraggable:u,isResizable:d,isBounded:f,useCSSTransforms:p,transformScale:m,draggableCancel:v,draggableHandle:y,resizeHandles:b,resizeHandle:x}=this.props,{mounted:E,droppingPosition:R}=this.state,P=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,O=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&d,A=r.resizeHandles||b,D=P&&f&&r.isBounded!==!1;return Pl.createElement(OD.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:v,handle:y,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:P,isResizable:O,isBounded:D,useCSSTransforms:p&&E,usePercentages:!E,transformScale:m,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:A,resizeHandle:x},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,Kne.default)(AD,t),s={height:this.containerHeight(),...n};return Pl.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:it.noop,onDragLeave:r?this.onDragLeave:it.noop,onDragEnter:r?this.onDragEnter:it.noop,onDragOver:r?this.onDragOver:it.noop},Pl.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}eg.default=B0;br(B0,"displayName","ReactGridLayout");br(B0,"propTypes",Qne.default);br(B0,"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:it.noop,onDragStart:it.noop,onDrag:it.noop,onDragStop:it.noop,onResizeStart:it.noop,onResize:it.noop,onResizeStop:it.noop,onDrop:it.noop,onDropDragOver:it.noop});var V0={},qc={};Object.defineProperty(qc,"__esModule",{value:!0});qc.findOrGenerateResponsiveLayout=rre;qc.getBreakpointFromWidth=tre;qc.getColsFromBreakpoint=nre;qc.sortBreakpoints=iR;var $m=Ot;function tre(e,t){const n=iR(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 nre(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function rre(e,t,n,r,o,i){if(e[n])return(0,$m.cloneLayout)(e[n]);let s=e[r];const a=iR(t),l=a.slice(a.indexOf(n));for(let c=0,u=l.length;c<u;c++){const d=l[c];if(e[d]){s=e[d];break}}return s=(0,$m.cloneLayout)(s||[]),(0,$m.compact)((0,$m.correctBounds)(s,{cols:o}),i,o)}function iR(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(V0,"__esModule",{value:!0});V0.default=void 0;var TD=ire(w),Gr=i4(al),N1=jE,qu=Ot,Ol=qc,ore=i4(eg);function i4(e){return e&&e.__esModule?e:{default:e}}function s4(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(s4=function(r){return r?n:t})(e)}function ire(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=s4(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 cC(){return cC=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},cC.apply(this,arguments)}function mb(e,t,n){return t=sre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sre(e){var t=are(e,"string");return typeof t=="symbol"?t:String(t)}function are(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 DD=e=>Object.prototype.toString.call(e);function Nm(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class sR extends TD.Component{constructor(){super(...arguments),mb(this,"state",this.generateInitialState()),mb(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,Ol.getBreakpointFromWidth)(n,t),s=(0,Ol.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,Ol.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,N1.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,Ol.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,N1.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,N1.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,Ol.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,Ol.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,qu.cloneLayout)(this.state.layout));let f=(0,Ol.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);f=(0,qu.synchronizeLayoutWithChildren)(f,this.props.children,l,i,this.props.allowOverlap),c[s]=f,this.props.onLayoutChange(f,c),this.props.onBreakpointChange(s,l),this.setState({breakpoint:s,layout:f,cols:l})}const u=Nm(this.props.margin,s),d=Nm(this.props.containerPadding,s);this.props.onWidthChange(this.props.width,u,l,d)}render(){const{breakpoint:t,breakpoints:n,cols:r,layouts:o,margin:i,containerPadding:s,onBreakpointChange:a,onLayoutChange:l,onWidthChange:c,...u}=this.props;return TD.createElement(ore.default,cC({},u,{margin:Nm(i,this.state.breakpoint),containerPadding:Nm(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}V0.default=sR;mb(sR,"propTypes",{breakpoint:Gr.default.string,breakpoints:Gr.default.object,allowOverlap:Gr.default.bool,cols:Gr.default.object,margin:Gr.default.oneOfType([Gr.default.array,Gr.default.object]),containerPadding:Gr.default.oneOfType([Gr.default.array,Gr.default.object]),layouts(e,t){if(DD(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+DD(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,qu.validateLayout)(e.layouts[n],"layouts."+n)})},width:Gr.default.number.isRequired,onBreakpointChange:Gr.default.func,onLayoutChange:Gr.default.func,onWidthChange:Gr.default.func});mb(sR,"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:qu.noop,onLayoutChange:qu.noop,onWidthChange:qu.noop});var aR={},a4=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}()}(),uC=typeof window<"u"&&typeof document<"u"&&window.document===document,vb=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")()}(),lre=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(vb):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),cre=2;function ure(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){lre(i)}function a(){var l=Date.now();if(n){if(l-o<cre)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var dre=20,fre=["top","right","bottom","left","width","height","size","weight"],hre=typeof MutationObserver<"u",pre=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=ure(this.refresh.bind(this),dre)}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(){!uC||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),hre?(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(){!uC||!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=fre.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}(),l4=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},Cd=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||vb},c4=H0(0,0,0,0);function bb(e){return parseFloat(e)||0}function MD(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+bb(i)},0)}function gre(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]=bb(s)}return n}function mre(e){var t=e.getBBox();return H0(0,0,t.width,t.height)}function vre(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return c4;var r=Cd(e).getComputedStyle(e),o=gre(r),i=o.left+o.right,s=o.top+o.bottom,a=bb(r.width),l=bb(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=MD(r,"left","right")+i),Math.round(l+s)!==n&&(l-=MD(r,"top","bottom")+s)),!yre(e)){var c=Math.round(a+i)-t,u=Math.round(l+s)-n;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return H0(o.left,o.top,a,l)}var bre=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof Cd(e).SVGGraphicsElement}:function(e){return e instanceof Cd(e).SVGElement&&typeof e.getBBox=="function"}}();function yre(e){return e===Cd(e).document.documentElement}function xre(e){return uC?bre(e)?mre(e):vre(e):c4}function wre(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 l4(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function H0(e,t,n,r){return{x:e,y:t,width:n,height:r}}var Sre=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=H0(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=xre(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}(),Cre=function(){function e(t,n){var r=wre(n);l4(this,{target:t,contentRect:r})}return e}(),_re=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new a4,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 Cd(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new Sre(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 Cd(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 Cre(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}(),u4=typeof WeakMap<"u"?new WeakMap:new a4,d4=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=pre.getInstance(),r=new _re(t,n,this);u4.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){d4.prototype[e]=function(){var t;return(t=u4.get(this))[e].apply(t,arguments)}});var Ere=function(){return typeof vb.ResizeObserver<"u"?vb.ResizeObserver:d4}();const Rre=Object.freeze(Object.defineProperty({__proto__:null,default:Ere},Symbol.toStringTag,{value:"Module"})),Pre=bE(Rre);Object.defineProperty(aR,"__esModule",{value:!0});aR.default=Nre;var km=Dre(w),Ore=lR(al),Are=lR(Pre),Tre=lR(zE);function lR(e){return e&&e.__esModule?e:{default:e}}function f4(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(f4=function(r){return r?n:t})(e)}function Dre(e,t){if(!t&&e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=f4(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 dC(){return dC=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},dC.apply(this,arguments)}function yu(e,t,n){return t=Mre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mre(e){var t=Ire(e,"string");return typeof t=="symbol"?t:String(t)}function Ire(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 $re="react-grid-layout";function Nre(e){var t;return t=class extends km.Component{constructor(){super(...arguments),yu(this,"state",{width:1280}),yu(this,"elementRef",km.createRef()),yu(this,"mounted",!1),yu(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new Are.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?km.createElement("div",{className:(0,Tre.default)(this.props.className,$re),style:this.props.style,ref:this.elementRef}):km.createElement(e,dC({innerRef:this.elementRef},o,this.state))}},yu(t,"defaultProps",{measureBeforeMount:!1}),yu(t,"propTypes",{measureBeforeMount:Ore.default.bool}),t}(function(e){e.exports=eg.default,e.exports.utils=Ot,e.exports.calculateUtils=us,e.exports.Responsive=V0.default,e.exports.Responsive.utils=qc,e.exports.WidthProvider=aR.default})(_3);var ID=_3.exports;function jr(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 kre=["color"],Lre=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,kre);return w.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}),w.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),Fre=["color"],h4=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,Fre);return w.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}),w.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"}))}),jre=["color"],zre=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,jre);return w.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}),w.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"}))}),Bre=["color"],Vre=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,Bre);return w.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}),w.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"}))}),Hre=["color"],p4=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,Hre);return w.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}),w.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"}))}),Wre=["color"],Ure=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,Wre);return w.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}),w.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),Gre=["color"],qre=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,Gre);return w.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}),w.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"}))}),Yre=["color"],Kre=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,Yre);return w.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}),w.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"}))}),Xre=["color"],Qre=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,Xre);return w.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}),w.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"}))}),Zre=["color"],g4=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,Zre);return w.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}),w.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"}))}),Jre=["color"],eoe=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,Jre);return w.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}),w.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"}))}),toe=["color"],noe=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,toe);return w.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}),w.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"}))}),roe=["color"],ooe=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,roe);return w.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}),w.createElement("path",{d:"M2 3C2 2.44772 2.44772 2 3 2H12C12.5523 2 13 2.44772 13 3V12C13 12.5523 12.5523 13 12 13H3C2.44772 13 2 12.5523 2 12V3ZM12 3H3V12H12V3Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),ioe=["color"],m4=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,ioe);return w.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}),w.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),soe=["color"],v4=w.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=jr(e,soe);return w.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}),w.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let Lm;const aoe=new Uint8Array(16);function loe(){if(!Lm&&(Lm=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Lm))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Lm(aoe)}const ur=[];for(let e=0;e<256;++e)ur.push((e+256).toString(16).slice(1));function coe(e,t=0){return ur[e[t+0]]+ur[e[t+1]]+ur[e[t+2]]+ur[e[t+3]]+"-"+ur[e[t+4]]+ur[e[t+5]]+"-"+ur[e[t+6]]+ur[e[t+7]]+"-"+ur[e[t+8]]+ur[e[t+9]]+"-"+ur[e[t+10]]+ur[e[t+11]]+ur[e[t+12]]+ur[e[t+13]]+ur[e[t+14]]+ur[e[t+15]]}const uoe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),$D={randomUUID:uoe};function Ka(e,t,n){if($D.randomUUID&&!t&&!e)return $D.randomUUID();e=e||{};const r=e.random||(e.rng||loe)();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 coe(r)}const $r=M5()(j5((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:Ka(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:Ka(),cards:[],activeCardId:""},actions:{setCustomCardPreferences:n=>{e(r=>{r.card.customCardPreferences=n})},setChartOrientation:n=>{e(r=>{var s,a,l,c,u,d;const o=r.card.preferences;let i={};((s=o==null?void 0:o.chartOptions)==null?void 0:s.indexAxis)!==n&&(i={x:(l=(a=o==null?void 0:o.chartOptions)==null?void 0:a.scales)==null?void 0:l.y,y:(u=(c=o==null?void 0:o.chartOptions)==null?void 0:c.scales)==null?void 0:u.x}),r.card.preferences={...o,chartOptions:{...o==null?void 0:o.chartOptions,scales:{...(d=o==null?void 0:o.chartOptions)==null?void 0:d.scales,...i},indexAxis:n}}})},setSortChart:n=>{e(r=>{r.card.preferences={...r.card.preferences,sortChart:n}})},setCustomVisualCode:n=>{e(r=>{r.card.preferences={...r.card.preferences,customVisualCode:n}})},setNumberFormat:(n,r,o,i)=>{e(s=>{var a,l,c;s.card.preferences={...(a=s.card)==null?void 0:a.preferences,formatNumber:{...(c=(l=s.card)==null?void 0:l.preferences)==null?void 0:c.formatNumber,decimalPlaces:n,currency:r,locale:o,suffix:i,enabled:!0}}})},setColorRanges:n=>{e(r=>{var o,i;r.card.preferences={...r.card.preferences,formatNumber:{...(i=(o=r.card)==null?void 0:o.preferences)==null?void 0:i.formatNumber,colorRanges:n}}})},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})},updateCardInFrame:n=>{e(r=>{r.frame.cards=r.frame.cards.map(o=>o.id===n.id?n:o)})},setFrame:n=>{e({frame:n})},setCard:n=>{e({card:n})},setCardType:n=>{e(r=>{var o;r.card.type=n,n==="range"&&(r.card.preferences={...r.card.preferences,chartOptions:{...(o=r.card.preferences)==null?void 0:o.chartOptions,indexAxis:"y"}})})},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]})},setSelectedDatamodelId:n=>{var r,o;e(i=>{i.selectedDatamodelId=n,i.card.datamodelId=n}),(o=(r=t()).onDatamodelChange)==null||o.call(r,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})}}}))),W0=()=>$r(e=>e.actions);function doe(e,t,n){var l,c,u,d;const r=n==null?void 0:n.datasetOptions,o=we.getState().themeStyle,i=(c=(l=o==null?void 0:o.chart)==null?void 0:l.dataset)==null?void 0:c.backgroundColor,s=(d=(u=o==null?void 0:o.chart)==null?void 0:u.dataset)==null?void 0:d.borderColor;return e.map((f,p)=>{var E;const m=r==null?void 0:r.find(R=>R.idx===p),v=i==null?void 0:i[p%i.length],y=s==null?void 0:s[p%s.length],b=s==null?void 0:s[p%s.length];return{label:f.charAt(0).toUpperCase()+f.slice(1),data:t.map(R=>R[f]),...m,datalabels:{...m==null?void 0:m.datalabels,color:foe((E=m==null?void 0:m.datalabels)==null?void 0:E.align,v)},backgroundColor:v,pointBackgroundColor:y,borderColor:b}})}function foe(e,t){return Sd(e==="end"||e==="start"?Gh():t)}function hoe(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=rr(e);let r=[];const o=we.getState().themeStyle,i=(l=(a=o==null?void 0:o.chart)==null?void 0:a.dataset)==null?void 0:l.backgroundColor,s=(u=(c=o==null?void 0:o.chart)==null?void 0:c.dataset)==null?void 0:u.borderColor;if((n==null?void 0:n.length)===1){const d=e.map(f=>({x:f[t[0]],y:f[t[1]],r:f[t[2]],label:f[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:d}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(f=>f[n==null?void 0:n[1]]))].map((f,p)=>{const m=e.filter(v=>v[n==null?void 0:n[1]]===f);return{label:f,data:m.map(v=>({x:v[t[0]],y:v[t[1]],r:v[t[2]],label:v[n==null?void 0:n[0]]})),backgroundColor:i==null?void 0:i[p%i.length],borderColor:s==null?void 0:s[p%s.length]}})),r}function poe(e){var c,u,d,f;const{dimensionKeys:t,metricKeys:n}=rr(e),r=we.getState().themeStyle,o=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,i=(f=(d=r==null?void 0:r.chart)==null?void 0:d.dataset)==null?void 0:f.borderColor,s=t==null?void 0:t[1];return[...new Set(e.map(p=>p==null?void 0:p[s]))].map((p,m)=>({label:p,data:e.filter(v=>(v==null?void 0:v[s])===p).map(v=>[v==null?void 0:v[n[0]],v==null?void 0:v[n[1]],v==null?void 0:v[n[2]]]),backgroundColor:o==null?void 0:o[m%o.length],borderColor:i==null?void 0:i[m%i.length],borderSkipped:!1}))}function goe(e,t){var s,a,l,c;const n=we.getState().themeStyle,r=(a=(s=n==null?void 0:n.chart)==null?void 0:s.dataset)==null?void 0:a.backgroundColor,o=(c=(l=n==null?void 0:n.chart)==null?void 0:l.dataset)==null?void 0:c.borderColor;return e.map(u=>({label:u.charAt(0).toUpperCase()+u.slice(1),data:t.map(d=>d[u]),backgroundColor:t.map((d,f)=>(d==null?void 0:d._color)||(r==null?void 0:r[f%r.length])),borderColor:t.map((d,f)=>(d==null?void 0:d._color)||(o==null?void 0:o[f%o.length]))}))}function moe(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 rr(e){if(!e||e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=moe(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,c,u,d,f,p;return!!(typeof((s=e==null?void 0:e[t])==null?void 0:s[i])&&typeof((a=e==null?void 0:e[t])==null?void 0:a[i])=="string"||typeof((l=e==null?void 0:e[0])==null?void 0:l[i])&&typeof((c=e==null?void 0:e[0])==null?void 0:c[i])=="string"||typeof((u=e==null?void 0:e[1])==null?void 0:u[i])&&typeof((d=e==null?void 0:e[1])==null?void 0:d[i])=="string"||typeof((f=e==null?void 0:e[2])==null?void 0:f[i])&&typeof((p=e==null?void 0:e[2])==null?void 0:p[i])=="string")});r.length===0&&r.push(n[0]);const o=n.filter(i=>{var s,a;return((s=e==null?void 0:e[t])==null?void 0:s[i])===+((a=e==null?void 0:e[t])==null?void 0:a[i])});return{keys:n,dimensionKeys:r,metricKeys:o}}function ah(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 voe(e,t="asc"){function n(r){return Object.entries(r).slice(1).reduce((s,[a,l])=>{const c=typeof l=="number"?l:parseFloat(l);return s+(isNaN(c)?0:c)},0)}return e.sort((r,o)=>{const i=n(r),s=n(o);return t==="asc"?i-s:s-i})}function yb({dataArray:e,groupKey:t,pivotKey:n,valueKey:r,sortChart:o}){const i=e.reduce((a,l)=>{const c=l[t],u=l[n],d=l[r];return a[c]||(a[c]={[t]:c}),a[c][u]=d,a},{});let s=Object.values(i);return o!=="none"&&o!==void 0&&(s=voe(s,o)),s}function Xo(e,t){var s;const n=we.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=cc.cloneDeep(r);return cc.merge(o,e,t)}function fC(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}/**
110
+ * @license lucide-react v0.453.0 - ISC
111
+ *
112
+ * This source code is licensed under the ISC license.
113
+ * See the LICENSE file in the root directory of this source tree.
114
+ */const boe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),b4=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
115
+ * @license lucide-react v0.453.0 - ISC
116
+ *
117
+ * This source code is licensed under the ISC license.
118
+ * See the LICENSE file in the root directory of this source tree.
119
+ */var yoe={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"};/**
120
+ * @license lucide-react v0.453.0 - ISC
121
+ *
122
+ * This source code is licensed under the ISC license.
123
+ * See the LICENSE file in the root directory of this source tree.
124
+ */const y4=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>w.createElement("svg",{ref:l,...yoe,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:b4("lucide",o),...a},[...s.map(([c,u])=>w.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
125
+ * @license lucide-react v0.453.0 - ISC
126
+ *
127
+ * This source code is licensed under the ISC license.
128
+ * See the LICENSE file in the root directory of this source tree.
129
+ */const zn=(e,t)=>{const n=w.forwardRef(({className:r,...o},i)=>w.createElement(y4,{ref:i,iconNode:t,className:b4(`lucide-${boe(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
130
+ * @license lucide-react v0.453.0 - ISC
131
+ *
132
+ * This source code is licensed under the ISC license.
133
+ * See the LICENSE file in the root directory of this source tree.
134
+ */const hC=zn("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
135
+ * @license lucide-react v0.453.0 - ISC
136
+ *
137
+ * This source code is licensed under the ISC license.
138
+ * See the LICENSE file in the root directory of this source tree.
139
+ */const x4=zn("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"}]]);/**
140
+ * @license lucide-react v0.453.0 - ISC
141
+ *
142
+ * This source code is licensed under the ISC license.
143
+ * See the LICENSE file in the root directory of this source tree.
144
+ */const rg=zn("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
145
+ * @license lucide-react v0.453.0 - ISC
146
+ *
147
+ * This source code is licensed under the ISC license.
148
+ * See the LICENSE file in the root directory of this source tree.
149
+ */const U0=zn("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
150
+ * @license lucide-react v0.453.0 - ISC
151
+ *
152
+ * This source code is licensed under the ISC license.
153
+ * See the LICENSE file in the root directory of this source tree.
154
+ */const cR=zn("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
155
+ * @license lucide-react v0.453.0 - ISC
156
+ *
157
+ * This source code is licensed under the ISC license.
158
+ * See the LICENSE file in the root directory of this source tree.
159
+ */const G0=zn("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
160
+ * @license lucide-react v0.453.0 - ISC
161
+ *
162
+ * This source code is licensed under the ISC license.
163
+ * See the LICENSE file in the root directory of this source tree.
164
+ */const w4=zn("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
165
+ * @license lucide-react v0.453.0 - ISC
166
+ *
167
+ * This source code is licensed under the ISC license.
168
+ * See the LICENSE file in the root directory of this source tree.
169
+ */const uR=zn("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
170
+ * @license lucide-react v0.453.0 - ISC
171
+ *
172
+ * This source code is licensed under the ISC license.
173
+ * See the LICENSE file in the root directory of this source tree.
174
+ */const S4=zn("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
175
+ * @license lucide-react v0.453.0 - ISC
176
+ *
177
+ * This source code is licensed under the ISC license.
178
+ * See the LICENSE file in the root directory of this source tree.
179
+ */const dR=zn("FilterX",[["path",{d:"M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055",key:"1fi1da"}],["path",{d:"m22 3-5 5",key:"12jva0"}],["path",{d:"m17 3 5 5",key:"k36vhe"}]]);/**
180
+ * @license lucide-react v0.453.0 - ISC
181
+ *
182
+ * This source code is licensed under the ISC license.
183
+ * See the LICENSE file in the root directory of this source tree.
184
+ */const C4=zn("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
185
+ * @license lucide-react v0.453.0 - ISC
186
+ *
187
+ * This source code is licensed under the ISC license.
188
+ * See the LICENSE file in the root directory of this source tree.
189
+ */const _4=zn("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
190
+ * @license lucide-react v0.453.0 - ISC
191
+ *
192
+ * This source code is licensed under the ISC license.
193
+ * See the LICENSE file in the root directory of this source tree.
194
+ */const E4=zn("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
195
+ * @license lucide-react v0.453.0 - ISC
196
+ *
197
+ * This source code is licensed under the ISC license.
198
+ * See the LICENSE file in the root directory of this source tree.
199
+ */const R4=zn("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/**
200
+ * @license lucide-react v0.453.0 - ISC
201
+ *
202
+ * This source code is licensed under the ISC license.
203
+ * See the LICENSE file in the root directory of this source tree.
204
+ */const fR=zn("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
205
+ * @license lucide-react v0.453.0 - ISC
206
+ *
207
+ * This source code is licensed under the ISC license.
208
+ * See the LICENSE file in the root directory of this source tree.
209
+ */const P4=zn("ScanSearch",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m16 16-1.9-1.9",key:"1dq9hf"}]]);/**
210
+ * @license lucide-react v0.453.0 - ISC
211
+ *
212
+ * This source code is licensed under the ISC license.
213
+ * See the LICENSE file in the root directory of this source tree.
214
+ */const O4=zn("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
215
+ * @license lucide-react v0.453.0 - ISC
216
+ *
217
+ * This source code is licensed under the ISC license.
218
+ * See the LICENSE file in the root directory of this source tree.
219
+ */const hR=zn("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"}]]);/**
220
+ * @license lucide-react v0.453.0 - ISC
221
+ *
222
+ * This source code is licensed under the ISC license.
223
+ * See the LICENSE file in the root directory of this source tree.
224
+ */const A4=zn("Table",[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]]);/**
225
+ * @license lucide-react v0.453.0 - ISC
226
+ *
227
+ * This source code is licensed under the ISC license.
228
+ * See the LICENSE file in the root directory of this source tree.
229
+ */const T4=zn("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
230
+ * @license lucide-react v0.453.0 - ISC
231
+ *
232
+ * This source code is licensed under the ISC license.
233
+ * See the LICENSE file in the root directory of this source tree.
234
+ */const Yd=zn("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),xoe=({data:e,filename:t="output.csv"})=>{const n=()=>{if(e.length===0)return;const r=[],o=Object.keys(e[0]);r.push(o.join(","));for(const c of e){const u=o.map(d=>`"${(""+c[d]).replace(/"/g,'""')}"`);r.push(u.join(","))}const i=r.join(`
235
+ `),s=new Blob([i],{type:"text/csv"}),a=window.URL.createObjectURL(s),l=document.createElement("a");l.setAttribute("hidden",""),l.setAttribute("href",a),l.setAttribute("download",t),document.body.appendChild(l),l.click(),document.body.removeChild(l)};return C.jsx(S4,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};function D4({frame:e}){var E;const t=we(R=>R.isDashboardEditing),n=we(R=>R.filterValues),r=we(R=>R.isVisualEditing),o=we(R=>R.selectedSheetId);we(R=>R.currentBreakpoint);const{removeFrame:i}=we(R=>R.actions),s=we(R=>R.actions.setIsVisualEditing),a=$r(R=>R.actions.setFilterValues),l=$r(R=>R.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:d}=$r(R=>R.actions),f=$r(R=>R.actions.setSelectedConnectionId),p=$r(R=>R.actions.setSelectedDatamodelId),m=$r(R=>R.actions.setSelectedDatabaseName),v=$r(R=>R.actions.setSelectedSchemaName),y=$r(R=>R.actions.setSelectedTableName),b=e.cards.find(R=>R.id===e.activeCardId);function x(){s(!r),c(b);const{dimensionKeys:R}=rr((b==null?void 0:b.data)||[]);d(R),u(e),b!=null&&b.connectionId&&f(b==null?void 0:b.connectionId),b!=null&&b.datamodelId&&b.datamodelId!=="none"&&(p(b==null?void 0:b.datamodelId),m("")),b!=null&&b.lastSelectedDatabase&&b.lastSelectedDatabase!=="none"&&(m(b==null?void 0:b.lastSelectedDatabase),p("")),b!=null&&b.lastSelectedSchema&&v(b==null?void 0:b.lastSelectedSchema),b!=null&&b.lastSelectedTable&&y(b==null?void 0:b.lastSelectedTable),n&&(a(n),l(!0))}return C.jsx("section",{className:"absolute right-2 top-2 z-10",children:C.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?C.jsx(qre,{onClick:()=>{s(!r)},className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}):C.jsx(Kre,{role:"edit-visual",onClick:x,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})),t&&C.jsx(p4,{onClick:()=>i(o,e.id),className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"}),((E=b.preferences)==null?void 0:E.allowDownload)===!0&&C.jsx(xoe,{data:(b==null?void 0:b.data)||[],filename:b.title})]})})}function woe(e,t){we(s=>s.selectedSheetId);const n=we(s=>s.selectedFrameId),r=we(s=>s.isDashboardEditing),o=we(s=>s.isVisualEditing);we(s=>s.actions),w.useEffect(()=>{n===e.id&&r&&!o&&i()},[n,e.id,r,o]);function i(){const s=t==null?void 0:t.current;s==null||s.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}const Soe=w.createContext(null),k1={didCatch:!1,error:null};class q0 extends w.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=k1}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(t!==null){for(var n,r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];(n=(r=this.props).onReset)===null||n===void 0||n.call(r,{args:i,reason:"imperative-api"}),this.setState(k1)}}componentDidCatch(t,n){var r,o;(r=(o=this.props).onError)===null||r===void 0||r.call(o,t,n)}componentDidUpdate(t,n){const{didCatch:r}=this.state,{resetKeys:o}=this.props;if(r&&n.error!==null&&Coe(t.resetKeys,o)){var i,s;(i=(s=this.props).onReset)===null||i===void 0||i.call(s,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(k1)}}render(){const{children:t,fallbackRender:n,FallbackComponent:r,fallback:o}=this.props,{didCatch:i,error:s}=this.state;let a=t;if(i){const l={error:s,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")a=n(l);else if(r)a=w.createElement(r,l);else if(o!==void 0)a=o;else throw s}return w.createElement(Soe.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function Coe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e.length!==t.length||e.some((n,r)=>!Object.is(n,t[r]))}function pR({error:e}){return C.jsx("div",{className:"flex flex-col items-center justify-center",role:"alert",style:{height:"100%"},children:C.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md bg-muted p-10",children:[C.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),C.jsx("p",{className:"text-sm",children:"Something went wrong:"}),C.jsx("pre",{className:"text-xs",children:e.message})]})})}function _oe({error:e,frame:t}){return C.jsxs("div",{className:"flex h-full flex-col items-center justify-center border",role:"alert",children:[C.jsx(D4,{frame:t}),C.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),C.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[C.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),C.jsx("p",{className:"text-sm",children:"Something went wrong:"}),C.jsx("pre",{className:"text-xs",children:e.message})]})]})}function Eoe({error:e}){return C.jsxs("div",{className:"flex h-full flex-col items-center justify-center",role:"alert",children:[C.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),C.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[C.jsx("p",{className:"text-lg font-semibold",children:"Oops! Something went wrong!"}),C.jsx("p",{className:"text-sm",children:"Something went wrong:"}),C.jsx("pre",{className:"text-xs",children:e.message})]})]})}var _d=1e3,Ed=_d*60,Rd=Ed*60,Ac=Rd*24,Roe=Ac*7,Poe=Ac*365.25,Ooe=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Aoe(e);if(n==="number"&&isFinite(e))return t.long?Doe(e):Toe(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Aoe(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*Poe;case"weeks":case"week":case"w":return n*Roe;case"days":case"day":case"d":return n*Ac;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Rd;case"minutes":case"minute":case"mins":case"min":case"m":return n*Ed;case"seconds":case"second":case"secs":case"sec":case"s":return n*_d;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Toe(e){var t=Math.abs(e);return t>=Ac?Math.round(e/Ac)+"d":t>=Rd?Math.round(e/Rd)+"h":t>=Ed?Math.round(e/Ed)+"m":t>=_d?Math.round(e/_d)+"s":e+"ms"}function Doe(e){var t=Math.abs(e);return t>=Ac?Fm(e,t,Ac,"day"):t>=Rd?Fm(e,t,Rd,"hour"):t>=Ed?Fm(e,t,Ed,"minute"):t>=_d?Fm(e,t,_d,"second"):e+" ms"}function Fm(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const Moe=sl(Ooe);function Ioe(e){const t=we(u=>u.selectedSheetId),n=we(u=>u.selectedLensId),r=we(u=>u.dashboard.baseQueries),o=we(u=>u.dashboard.filters),i=we(u=>u.filterValues),s=o==null?void 0:o.filter(u=>u.sheetId===t||!u.sheetId),a=i==null?void 0:i.filter(u=>(s==null?void 0:s.some(d=>d.id===u.filterId))||u.filterId.endsWith(t)),l=HZ(e.sql,r);return{queryKey:["query",e.id,l,n||"",JSON.stringify(a)],sql:l,sheetFilterValues:a}}function Y0(e,t){const{authToken:n}=No(),r=we(d=>d.isVisualEditing),o=we(d=>d.authToken),i=Moe((e==null?void 0:e.refreshInterval)||"0"),{queryKey:s,sql:a,sheetFilterValues:l}=Ioe(e);return{...Zp({queryKey:s,queryFn:()=>x0("https://semaphor.cloud/api/v1/query",(n==null?void 0:n.accessToken)||(o==null?void 0:o.accessToken)||"",{connection_id:e.connectionId,sql:a,python:e.python===H5?"":e.python,active_filters:l,cache_config:OE()}),refetchInterval:i,placeholderData:MJ,enabled:!!e.connectionId&&!!e.sql&&!t&&!r}),queryKey:s}}function Us({number:e,decimalPlaces:t=0,useSuffix:n=!1,customSuffix:r="",currency:o="",locale:i="en-US"}){let s=1,a=r,l=i;const c=t;n&&!r&&(e>=1e9?(s=1e9,a="B"):e>=1e7&&i==="en-IN"?(s=1e7,a="Cr"):e>=1e5&&i==="en-IN"?(s=1e5,a="L"):e>=1e6?(s=1e6,a="M"):e>=1e3&&(s=1e3,a="K"));const u=e/s,d={maximumFractionDigits:c,minimumFractionDigits:c};if(o){d.style="currency",d.currency=o;try{new Intl.NumberFormat(i,d).format(0)}catch{}}try{new Intl.NumberFormat(i,d).format(0)}catch{l="en-US"}let p=new Intl.NumberFormat(l,d).format(u);return n&&(p+=a),p}function gR(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function M4(e){try{const n=new Function("getDatalabelColor",e)(NS);return{options:n==null?void 0:n.options,plugins:(n==null?void 0:n.plugins)||[]}}catch(t){return console.error("Error processing custom visual code",t),{options:{},plugins:[]}}}function I4(e){const t=getComputedStyle(document.documentElement).getPropertyValue(e);return $oe(t)}function $oe(e){const[t,n,r]=e.split(" "),o=parseFloat(t),i=parseFloat(n),s=parseFloat(r),a=i/100,l=s/100,c=(1-Math.abs(2*l-1))*a,u=c*(1-Math.abs(o/60%2-1)),d=l-c/2;let f=0,p=0,m=0;0<=o&&o<60?(f=c,p=u,m=0):60<=o&&o<120?(f=u,p=c,m=0):120<=o&&o<180?(f=0,p=c,m=u):180<=o&&o<240?(f=0,p=u,m=c):240<=o&&o<300?(f=u,p=0,m=c):300<=o&&o<360&&(f=c,p=0,m=u),f=Math.round((f+d)*255),p=Math.round((p+d)*255),m=Math.round((m+d)*255);const v=y=>{const b=y.toString(16);return b.length==1?"0"+b:b};return`#${v(f)}${v(p)}${v(m)}`}function Al({data:e,cfg:t,customCfg:n,preferences:r}){we.getState().themeStyle;const{dimensionKeys:o,metricKeys:i}=rr(e),s=doe(i,e,r),a=ah(s,n),l=o[0],c=fC(e,l);mR(r,t),$4(r);const{options:u,plugins:d}=k4({cfg:t,preferences:r,customCfg:n});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:c,datasets:a},options:u,plugins:d}}function mR(e,t){var o,i,s;const n=((o=t==null?void 0:t.options)==null?void 0:o.indexAxis)==="y"?"x":"y";return(i=e==null?void 0:e.chartOptions)!=null&&i.indexAxis?((s=e==null?void 0:e.chartOptions)==null?void 0:s.indexAxis)==="x"?"y":"x":n}function $4(e){var n,r;return(n=e==null?void 0:e.chartOptions)!=null&&n.indexAxis?((r=e==null?void 0:e.chartOptions)==null?void 0:r.indexAxis)==="x"?"x":"y":"x"}function N4(e,t){var i,s,a,l,c,u,d,f,p,m,v,y;const n=mR(t,e),r=$4(t);return{...e==null?void 0:e.options,scales:{...(i=e==null?void 0:e.options)==null?void 0:i.scales,[n]:{...(a=(s=e==null?void 0:e.options)==null?void 0:s.scales)==null?void 0:a[n],ticks:{...(u=(c=(l=e==null?void 0:e.options)==null?void 0:l.scales)==null?void 0:c[n])==null?void 0:u.ticks,callback:b=>{var x,E,R,P;return Us({number:Number(b),decimalPlaces:((x=t==null?void 0:t.numberAxisFormat)==null?void 0:x.decimalPlaces)||0,useSuffix:!!((E=t==null?void 0:t.numberAxisFormat)!=null&&E.suffix),customSuffix:"",locale:((R=t==null?void 0:t.numberAxisFormat)==null?void 0:R.locale)||"",currency:((P=t==null?void 0:t.numberAxisFormat)==null?void 0:P.currency)||""})}}},[r]:{...(p=(f=(d=e==null?void 0:e.options)==null?void 0:d.scales)==null?void 0:f[r])==null?void 0:p.ticks,callback:null}},plugins:{...(m=e==null?void 0:e.options)==null?void 0:m.plugins,datalabels:{...(y=(v=e==null?void 0:e.options)==null?void 0:v.plugins)==null?void 0:y.datalabels,formatter:function(b){var x,E,R,P;return Us({number:Number(b),decimalPlaces:((x=t==null?void 0:t.numberAxisFormat)==null?void 0:x.decimalPlaces)||0,useSuffix:!!((E=t==null?void 0:t.numberAxisFormat)!=null&&E.suffix),customSuffix:"",locale:((R=t==null?void 0:t.numberAxisFormat)==null?void 0:R.locale)||"",currency:((P=t==null?void 0:t.numberAxisFormat)==null?void 0:P.currency)||""})}}}}}function k4({cfg:e,preferences:t,customCfg:n}){var f,p,m,v,y,b,x,E,R,P,O,A,D,I,L,j,z,K,H,k,W,B,U,q,$,Y,X,M,oe;const r=we.getState().themeStyle,o=N4(e,t),i=Xo((e==null?void 0:e.options)||{},t==null?void 0:t.chartOptions),s=Xo(o,i),a=Xo(s,(n==null?void 0:n.options)||{}),l={...a,scales:{...a==null?void 0:a.scales,x:{...(f=a==null?void 0:a.scales)==null?void 0:f.x,grid:{...(m=(p=a==null?void 0:a.scales)==null?void 0:p.x)==null?void 0:m.grid,color:(E=(x=(b=(y=(v=r==null?void 0:r.chart)==null?void 0:v.options)==null?void 0:y.scales)==null?void 0:b.x)==null?void 0:x.grid)==null?void 0:E.color}},y:{...(R=a==null?void 0:a.scales)==null?void 0:R.y,grid:{...(O=(P=a==null?void 0:a.scales)==null?void 0:P.y)==null?void 0:O.grid,color:(j=(L=(I=(D=(A=r==null?void 0:r.chart)==null?void 0:A.options)==null?void 0:D.scales)==null?void 0:I.y)==null?void 0:L.grid)==null?void 0:j.color}}},plugins:{...a==null?void 0:a.plugins,tooltip:{...(z=a==null?void 0:a.plugins)==null?void 0:z.tooltip,backgroundColor:(W=(k=(H=(K=r==null?void 0:r.chart)==null?void 0:K.options)==null?void 0:H.plugins)==null?void 0:k.tooltip)==null?void 0:W.backgroundColor,bodyColor:($=(q=(U=(B=r==null?void 0:r.chart)==null?void 0:B.options)==null?void 0:U.plugins)==null?void 0:q.tooltip)==null?void 0:$.bodyColor,titleColor:(oe=(M=(X=(Y=r==null?void 0:r.chart)==null?void 0:Y.options)==null?void 0:X.plugins)==null?void 0:M.tooltip)==null?void 0:oe.titleColor}}},{plugins:c,options:u}=M4((t==null?void 0:t.customVisualCode)||"");return{options:Xo(l,u),plugins:c}}/*!
236
+ * @kurkle/color v0.3.2
237
+ * https://github.com/kurkle/color#readme
238
+ * (c) 2023 Jukka Kurkela
239
+ * Released under the MIT License
240
+ */function og(e){return e+.5|0}const La=(e,t,n)=>Math.max(Math.min(e,n),t);function lh(e){return La(og(e*2.55),0,255)}function Wa(e){return La(og(e*255),0,255)}function Ns(e){return La(og(e/2.55)/100,0,1)}function ND(e){return La(og(e*100),0,100)}const qo={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},pC=[..."0123456789ABCDEF"],Noe=e=>pC[e&15],koe=e=>pC[(e&240)>>4]+pC[e&15],jm=e=>(e&240)>>4===(e&15),Loe=e=>jm(e.r)&&jm(e.g)&&jm(e.b)&&jm(e.a);function Foe(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&qo[e[1]]*17,g:255&qo[e[2]]*17,b:255&qo[e[3]]*17,a:t===5?qo[e[4]]*17:255}:(t===7||t===9)&&(n={r:qo[e[1]]<<4|qo[e[2]],g:qo[e[3]]<<4|qo[e[4]],b:qo[e[5]]<<4|qo[e[6]],a:t===9?qo[e[7]]<<4|qo[e[8]]:255})),n}const joe=(e,t)=>e<255?t(e):"";function zoe(e){var t=Loe(e)?Noe:koe;return e?"#"+t(e.r)+t(e.g)+t(e.b)+joe(e.a,t):void 0}const Boe=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function L4(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 Voe(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 Hoe(e,t,n){const r=L4(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 Woe(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 vR(e){const n=e.r/255,r=e.g/255,o=e.b/255,i=Math.max(n,r,o),s=Math.min(n,r,o),a=(i+s)/2;let l,c,u;return i!==s&&(u=i-s,c=a>.5?u/(2-i-s):u/(i+s),l=Woe(n,r,o,u,i),l=l*60+.5),[l|0,c||0,a]}function bR(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Wa)}function yR(e,t,n){return bR(L4,e,t,n)}function Uoe(e,t,n){return bR(Hoe,e,t,n)}function Goe(e,t,n){return bR(Voe,e,t,n)}function F4(e){return(e%360+360)%360}function qoe(e){const t=Boe.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?lh(+t[5]):Wa(+t[5]));const o=F4(+t[2]),i=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=Uoe(o,i,s):t[1]==="hsv"?r=Goe(o,i,s):r=yR(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function Yoe(e,t){var n=vR(e);n[0]=F4(n[0]+t),n=yR(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Koe(e){if(!e)return;const t=vR(e),n=t[0],r=ND(t[1]),o=ND(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${Ns(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const kD={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"},LD={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 Xoe(){const e={},t=Object.keys(LD),n=Object.keys(kD);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,kD[i]);i=parseInt(LD[s],16),e[a]=[i>>16&255,i>>8&255,i&255]}return e}let zm;function Qoe(e){zm||(zm=Xoe(),zm.transparent=[0,0,0,0]);const t=zm[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Zoe=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Joe(e){const t=Zoe.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?lh(s):La(s*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?lh(r):La(r,0,255)),o=255&(t[4]?lh(o):La(o,0,255)),i=255&(t[6]?lh(i):La(i,0,255)),{r,g:o,b:i,a:n}}}function eie(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ns(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const L1=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,xu=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function tie(e,t,n){const r=xu(Ns(e.r)),o=xu(Ns(e.g)),i=xu(Ns(e.b));return{r:Wa(L1(r+n*(xu(Ns(t.r))-r))),g:Wa(L1(o+n*(xu(Ns(t.g))-o))),b:Wa(L1(i+n*(xu(Ns(t.b))-i))),a:e.a+n*(t.a-e.a)}}function Bm(e,t,n){if(e){let r=vR(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=yR(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function j4(e,t){return e&&Object.assign(t||{},e)}function FD(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=Wa(e[3]))):(t=j4(e,{r:0,g:0,b:0,a:1}),t.a=Wa(t.a)),t}function nie(e){return e.charAt(0)==="r"?Joe(e):qoe(e)}let z4=class gC{constructor(t){if(t instanceof gC)return t;const n=typeof t;let r;n==="object"?r=FD(t):n==="string"&&(r=Foe(t)||Qoe(t)||nie(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=j4(this._rgb);return t&&(t.a=Ns(t.a)),t}set rgb(t){this._rgb=FD(t)}rgbString(){return this._valid?eie(this._rgb):void 0}hexString(){return this._valid?zoe(this._rgb):void 0}hslString(){return this._valid?Koe(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,o=t.rgb;let i;const s=n===i?.5:n,a=2*s-1,l=r.a-o.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;i=1-c,r.r=255&c*r.r+i*o.r+.5,r.g=255&c*r.g+i*o.g+.5,r.b=255&c*r.b+i*o.b+.5,r.a=s*r.a+(1-s)*o.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=tie(this._rgb,t._rgb,n)),this}clone(){return new gC(this.rgb)}alpha(t){return this._rgb.a=Wa(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=og(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 Bm(this._rgb,2,t),this}darken(t){return Bm(this._rgb,2,-t),this}saturate(t){return Bm(this._rgb,1,t),this}desaturate(t){return Bm(this._rgb,1,-t),this}rotate(t){return Yoe(this._rgb,t),this}};/*!
241
+ * Chart.js v4.4.1
242
+ * https://www.chartjs.org
243
+ * (c) 2023 Chart.js Contributors
244
+ * Released under the MIT License
245
+ */function Ps(){}const rie=(()=>{let e=0;return()=>e++})();function Pt(e){return e===null||typeof e>"u"}function wn(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 Dt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Fn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function bo(e,t){return Fn(e)?e:t}function st(e,t){return typeof e>"u"?t:e}const oie=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,B4=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function an(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Qt(e,t,n,r){let o,i,s;if(wn(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(Dt(e))for(s=Object.keys(e),i=s.length,o=0;o<i;o++)t.call(n,e[s[o]],s[o])}function xb(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 wb(e){if(wn(e))return e.map(wb);if(Dt(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let o=0;for(;o<r;++o)t[n[o]]=wb(e[n[o]]);return t}return e}function V4(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function iie(e,t,n,r){if(!V4(e))return;const o=t[e],i=n[e];Dt(o)&&Dt(i)?sr(o,i,r):t[e]=wb(i)}function sr(e,t,n){const r=wn(t)?t:[t],o=r.length;if(!Dt(e))return e;n=n||{};const i=n.merger||iie;let s;for(let a=0;a<o;++a){if(s=r[a],!Dt(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)i(l[c],e,s,n)}return e}function _h(e,t){return sr(e,t,{merger:sie})}function sie(e,t,n){if(!V4(e))return;const r=t[e],o=n[e];Dt(r)&&Dt(o)?_h(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=wb(o))}const jD={"":e=>e,x:e=>e.x,y:e=>e.y};function aie(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 lie(e){const t=aie(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function Xa(e,t){return(jD[t]||(jD[t]=lie(t)))(e)}function xR(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Kh=e=>typeof e<"u",Qa=e=>typeof e=="function",zD=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function cie(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Cn=Math.PI,Sn=2*Cn,uie=Sn+Cn,Sb=Number.POSITIVE_INFINITY,die=Cn/180,Gn=Cn/2,Tl=Cn/4,BD=Cn*2/3,Fa=Math.log10,Zi=Math.sign;function Eh(e,t,n){return Math.abs(e-t)<n}function VD(e){const t=Math.round(e);e=Eh(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Fa(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function fie(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 Pd(e){return!isNaN(parseFloat(e))&&isFinite(e)}function hie(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function H4(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 Si(e){return e*(Cn/180)}function wR(e){return e*(180/Cn)}function HD(e){if(!Fn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function W4(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*Cn&&(i+=Sn),{angle:i,distance:o}}function mC(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function pie(e,t){return(e-t+uie)%Sn-Cn}function wo(e){return(e%Sn+Sn)%Sn}function Xh(e,t,n,r){const o=wo(e),i=wo(t),s=wo(n),a=wo(i-o),l=wo(s-o),c=wo(o-i),u=wo(o-s);return o===i||o===s||r&&i===s||a>l&&c<u}function ir(e,t,n){return Math.max(t,Math.min(n,e))}function gie(e){return ir(e,-32768,32767)}function zs(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function SR(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 Bs=(e,t,n,r)=>SR(e,n,r?o=>{const i=e[o][t];return i<n||i===n&&e[o+1][t]===n}:o=>e[o][t]<n),mie=(e,t,n)=>SR(e,n,r=>e[r][t]>=n);function vie(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 U4=["push","pop","shift","splice","unshift"];function bie(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),U4.forEach(n=>{const r="_onData"+xR(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 WD(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)&&(U4.forEach(i=>{delete e[i]}),delete e._chartjs)}function G4(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const q4=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function Y4(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,q4.call(window,()=>{r=!1,e.apply(t,n)}))}}function yie(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const CR=e=>e==="start"?"left":e==="end"?"right":"center",xr=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,xie=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function K4(e,t,n){const r=t.length;let o=0,i=r;if(e._sorted){const{iScale:s,_parsed:a}=e,l=s.axis,{min:c,max:u,minDefined:d,maxDefined:f}=s.getUserBounds();d&&(o=ir(Math.min(Bs(a,l,c).lo,n?r:Bs(t,l,s.getPixelForValue(c)).lo),0,r-1)),f?i=ir(Math.max(Bs(a,s.axis,u,!0).hi+1,n?0:Bs(t,l,s.getPixelForValue(u),!0).hi+1),o,r)-o:i=r-o}return{start:o,count:i}}function X4(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 Vm=e=>e===0||e===1,UD=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Sn/n)),GD=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Sn/n)+1,Rh={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*Gn)+1,easeOutSine:e=>Math.sin(e*Gn),easeInOutSine:e=>-.5*(Math.cos(Cn*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=>Vm(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=>Vm(e)?e:UD(e,.075,.3),easeOutElastic:e=>Vm(e)?e:GD(e,.075,.3),easeInOutElastic(e){return Vm(e)?e:e<.5?.5*UD(e*2,.1125,.45):.5+.5*GD(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-Rh.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?Rh.easeInBounce(e*2)*.5:Rh.easeOutBounce(e*2-1)*.5+.5};function _R(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function qD(e){return _R(e)?e:new z4(e)}function F1(e){return _R(e)?e:new z4(e).saturate(.5).darken(.1).hexString()}const wie=["x","y","borderWidth","radius","tension"],Sie=["color","borderColor","backgroundColor"];function Cie(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:Sie},numbers:{type:"number",properties:wie}}),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 _ie(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const YD=new Map;function Eie(e,t){t=t||{};const n=e+JSON.stringify(t);let r=YD.get(n);return r||(r=new Intl.NumberFormat(e,t),YD.set(n,r)),r}function ig(e,t,n){return Eie(t,n).format(e)}const Q4={values(e){return wn(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let o,i=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(o="scientific"),i=Rie(e,n)}const s=Fa(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),ig(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(Fa(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?Q4.numeric.call(this,e,t,n):""}};function Rie(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 K0={formatters:Q4};function Pie(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:K0.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 Tc=Object.create(null),vC=Object.create(null);function Ph(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 j1(e,t,n){return typeof t=="string"?sr(Ph(e,t),n):sr(Ph(e,""),t)}class Oie{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)=>F1(o.backgroundColor),this.hoverBorderColor=(r,o)=>F1(o.borderColor),this.hoverColor=(r,o)=>F1(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 j1(this,t,n)}get(t){return Ph(this,t)}describe(t,n){return j1(vC,t,n)}override(t,n){return j1(Tc,t,n)}route(t,n,r,o){const i=Ph(this,t),s=Ph(this,r),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=s[o];return Dt(l)?Object.assign({},c,l):st(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var In=new Oie({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Cie,_ie,Pie]);function Aie(e){return!e||Pt(e.size)||Pt(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Cb(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 Tie(e,t,n,r){r=r||{};let o=r.data=r.data||{},i=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(o=r.data={},i=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=n.length;let l,c,u,d,f;for(l=0;l<a;l++)if(d=n[l],d!=null&&!wn(d))s=Cb(e,o,i,s,d);else if(wn(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!wn(f)&&(s=Cb(e,o,i,s,f));e.restore();const p=i.length/2;if(p>n.length){for(l=0;l<p;l++)delete o[i[l]];i.splice(0,p)}return s}function Dl(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 KD(e,t){t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore()}function _b(e,t,n,r){Z4(e,t,n,r,null)}function Z4(e,t,n,r,o){let i,s,a,l,c,u,d,f;const p=t.pointStyle,m=t.rotation,v=t.radius;let y=(m||0)*die;if(p&&typeof p=="object"&&(i=p.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(y),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(v)||v<=0)){switch(e.beginPath(),p){default:o?e.ellipse(n,r,o/2,v,0,0,Sn):e.arc(n,r,v,0,Sn),e.closePath();break;case"triangle":u=o?o/2:v,e.moveTo(n+Math.sin(y)*u,r-Math.cos(y)*v),y+=BD,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*v),y+=BD,e.lineTo(n+Math.sin(y)*u,r-Math.cos(y)*v),e.closePath();break;case"rectRounded":c=v*.516,l=v-c,s=Math.cos(y+Tl)*l,d=Math.cos(y+Tl)*(o?o/2-c:l),a=Math.sin(y+Tl)*l,f=Math.sin(y+Tl)*(o?o/2-c:l),e.arc(n-d,r-a,c,y-Cn,y-Gn),e.arc(n+f,r-s,c,y-Gn,y),e.arc(n+d,r+a,c,y,y+Gn),e.arc(n-f,r+s,c,y+Gn,y+Cn),e.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*v,u=o?o/2:l,e.rect(n-u,r-l,2*u,2*l);break}y+=Tl;case"rectRot":d=Math.cos(y)*(o?o/2:v),s=Math.cos(y)*v,a=Math.sin(y)*v,f=Math.sin(y)*(o?o/2:v),e.moveTo(n-d,r-a),e.lineTo(n+f,r-s),e.lineTo(n+d,r+a),e.lineTo(n-f,r+s),e.closePath();break;case"crossRot":y+=Tl;case"cross":d=Math.cos(y)*(o?o/2:v),s=Math.cos(y)*v,a=Math.sin(y)*v,f=Math.sin(y)*(o?o/2:v),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-s),e.lineTo(n-f,r+s);break;case"star":d=Math.cos(y)*(o?o/2:v),s=Math.cos(y)*v,a=Math.sin(y)*v,f=Math.sin(y)*(o?o/2:v),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-s),e.lineTo(n-f,r+s),y+=Tl,d=Math.cos(y)*(o?o/2:v),s=Math.cos(y)*v,a=Math.sin(y)*v,f=Math.sin(y)*(o?o/2:v),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+f,r-s),e.lineTo(n-f,r+s);break;case"line":s=o?o/2:Math.cos(y)*v,a=Math.sin(y)*v,e.moveTo(n-s,r-a),e.lineTo(n+s,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(y)*(o?o/2:v),r+Math.sin(y)*v);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Vs(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 dc(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function fc(e){e.restore()}function Die(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 Mie(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 Iie(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Pt(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 $ie(e,t,n,r,o){if(o.strikethrough||o.underline){const i=e.measureText(r),s=t-i.actualBoundingBoxLeft,a=t+i.actualBoundingBoxRight,l=n-i.actualBoundingBoxAscent,c=n+i.actualBoundingBoxDescent,u=o.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=o.decorationWidth||2,e.moveTo(s,u),e.lineTo(a,u),e.stroke()}}function Nie(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Dc(e,t,n,r,o,i={}){const s=wn(t)?t:[t],a=i.strokeWidth>0&&i.strokeColor!=="";let l,c;for(e.save(),e.font=o.string,Iie(e,i),l=0;l<s.length;++l)c=s[l],i.backdrop&&Nie(e,i.backdrop),a&&(i.strokeColor&&(e.strokeStyle=i.strokeColor),Pt(i.strokeWidth)||(e.lineWidth=i.strokeWidth),e.strokeText(c,n,r,i.maxWidth)),e.fillText(c,n,r,i.maxWidth),$ie(e,n,r,c,i),r+=Number(o.lineHeight);e.restore()}function Qh(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*Cn,Cn,!0),e.lineTo(n,r+i-s.bottomLeft),e.arc(n+s.bottomLeft,r+i-s.bottomLeft,s.bottomLeft,Cn,Gn,!0),e.lineTo(n+o-s.bottomRight,r+i),e.arc(n+o-s.bottomRight,r+i-s.bottomRight,s.bottomRight,Gn,0,!0),e.lineTo(n+o,r+s.topRight),e.arc(n+o-s.topRight,r+s.topRight,s.topRight,0,-Gn,!0),e.lineTo(n+s.topLeft,r)}const kie=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Lie=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Fie(e,t){const n=(""+e).match(kie);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 jie=e=>+e||0;function ER(e,t){const n={},r=Dt(t),o=r?Object.keys(t):t,i=Dt(e)?r?s=>st(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of o)n[s]=jie(i(s));return n}function J4(e){return ER(e,{top:"y",right:"x",bottom:"y",left:"x"})}function hc(e){return ER(e,["topLeft","topRight","bottomLeft","bottomRight"])}function hr(e){const t=J4(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Xn(e,t){e=e||{},t=t||In.font;let n=st(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=st(e.style,t.style);r&&!(""+r).match(Lie)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:st(e.family,t.family),lineHeight:Fie(st(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:st(e.weight,t.weight),string:""};return o.string=Aie(o),o}function xn(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&&wn(a)&&(a=a[n%a.length],o=!1),a!==void 0))return r&&!o&&(r.cacheable=!1),a}function zie(e,t,n){const{min:r,max:o}=e,i=B4(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 ll(e,t){return Object.assign(Object.create(e),t)}function RR(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=r6("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:a=>RR([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 t6(a,l,()=>Yie(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return QD(a).includes(l)},ownKeys(a){return QD(a)},set(a,l,c){const u=a._storage||(a._storage=o());return a[l]=u[l]=c,delete a._keys,!0}})}function Od(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:e6(e,r),setContext:i=>Od(e,i,n,r),override:i=>Od(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 t6(i,s,()=>Vie(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 e6(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:Qa(n)?n:()=>n,isIndexable:Qa(r)?r:()=>r}}const Bie=(e,t)=>e?e+xR(t):t,PR=(e,t)=>Dt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function t6(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];const r=n();return e[t]=r,r}function Vie(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=e;let a=r[t];return Qa(a)&&s.isScriptable(t)&&(a=Hie(t,a,e,n)),wn(a)&&a.length&&(a=Wie(t,a,e,s.isIndexable)),PR(t,a)&&(a=Od(a,o,i&&i[t],s)),a}function Hie(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),PR(e,l)&&(l=OR(o._scopes,o,e,l)),l}function Wie(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(Dt(t[0])){const l=t,c=o._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=OR(c,o,e,u);t.push(Od(d,i,s&&s[e],a))}}return t}function n6(e,t,n){return Qa(e)?e(t,n):e}const Uie=(e,t)=>e===!0?t:typeof e=="string"?Xa(t,e):void 0;function Gie(e,t,n,r,o){for(const i of t){const s=Uie(n,i);if(s){e.add(s);const a=n6(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 OR(e,t,n,r){const o=t._rootScopes,i=n6(t._fallback,n,r),s=[...e,...o],a=new Set;a.add(r);let l=XD(a,s,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=XD(a,s,i,l,r),l===null)?!1:RR(Array.from(a),[""],o,i,()=>qie(t,n,r))}function XD(e,t,n,r,o){for(;n;)n=Gie(e,t,n,r,o);return n}function qie(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return wn(o)&&Dt(n)?n:o||{}}function Yie(e,t,n,r){let o;for(const i of t)if(o=r6(Bie(i,e),n),typeof o<"u")return PR(e,o)?OR(n,r,e,o):o}function r6(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function QD(e){let t=e._keys;return t||(t=e._keys=Kie(e._scopes)),t}function Kie(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 o6(e,t,n,r){const{iScale:o}=e,{key:i="r"}=this._parsing,s=new Array(r);let a,l,c,u;for(a=0,l=r;a<l;++a)c=a+n,u=t[c],s[a]={r:o.parse(Xa(u,i),c)};return s}const Xie=Number.EPSILON||1e-14,Ad=(e,t)=>t<e.length&&!e[t].skip&&e[t],i6=e=>e==="x"?"y":"x";function Qie(e,t,n,r){const o=e.skip?t:e,i=t,s=n.skip?t:n,a=mC(i,o),l=mC(s,i);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,f=r*u;return{previous:{x:i.x-d*(s.x-o.x),y:i.y-d*(s.y-o.y)},next:{x:i.x+f*(s.x-o.x),y:i.y+f*(s.y-o.y)}}}function Zie(e,t,n){const r=e.length;let o,i,s,a,l,c=Ad(e,0);for(let u=0;u<r-1;++u)if(l=c,c=Ad(e,u+1),!(!l||!c)){if(Eh(t[u],0,Xie)){n[u]=n[u+1]=0;continue}o=n[u]/t[u],i=n[u+1]/t[u],a=Math.pow(o,2)+Math.pow(i,2),!(a<=9)&&(s=3/Math.sqrt(a),n[u]=o*s*t[u],n[u+1]=i*s*t[u])}}function Jie(e,t,n="x"){const r=i6(n),o=e.length;let i,s,a,l=Ad(e,0);for(let c=0;c<o;++c){if(s=a,a=l,l=Ad(e,c+1),!a)continue;const u=a[n],d=a[r];s&&(i=(u-s[n])/3,a[`cp1${n}`]=u-i,a[`cp1${r}`]=d-i*t[c]),l&&(i=(l[n]-u)/3,a[`cp2${n}`]=u+i,a[`cp2${r}`]=d+i*t[c])}}function ese(e,t="x"){const n=i6(t),r=e.length,o=Array(r).fill(0),i=Array(r);let s,a,l,c=Ad(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=Ad(e,s+1),!!l){if(c){const u=c[t]-l[t];o[s]=u!==0?(c[n]-l[n])/u:0}i[s]=a?c?Zi(o[s-1])!==Zi(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}Zie(e,o,i),Jie(e,i,t)}function Hm(e,t,n){return Math.max(Math.min(e,n),t)}function tse(e,t){let n,r,o,i,s,a=Vs(e[0],t);for(n=0,r=e.length;n<r;++n)s=i,i=a,a=n<r-1&&Vs(e[n+1],t),i&&(o=e[n],s&&(o.cp1x=Hm(o.cp1x,t.left,t.right),o.cp1y=Hm(o.cp1y,t.top,t.bottom)),a&&(o.cp2x=Hm(o.cp2x,t.left,t.right),o.cp2y=Hm(o.cp2y,t.top,t.bottom)))}function nse(e,t,n,r,o){let i,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")ese(e,o);else{let c=r?e[e.length-1]:e[0];for(i=0,s=e.length;i<s;++i)a=e[i],l=Qie(c,a,e[Math.min(i+1,s-(r?0:1))%s],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&tse(e,n)}function AR(){return typeof window<"u"&&typeof document<"u"}function TR(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Eb(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 X0=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function rse(e,t){return X0(e).getPropertyValue(t)}const ose=["top","right","bottom","left"];function pc(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=ose[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const ise=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function sse(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let s=!1,a,l;if(ise(o,i,e.target))a=o,l=i;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:a,y:l,box:s}}function Ll(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=X0(n),i=o.boxSizing==="border-box",s=pc(o,"padding"),a=pc(o,"border","width"),{x:l,y:c,box:u}=sse(e,n),d=s.left+(u&&a.left),f=s.top+(u&&a.top);let{width:p,height:m}=t;return i&&(p-=s.width+a.width,m-=s.height+a.height),{x:Math.round((l-d)/p*n.width/r),y:Math.round((c-f)/m*n.height/r)}}function ase(e,t,n){let r,o;if(t===void 0||n===void 0){const i=TR(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const s=i.getBoundingClientRect(),a=X0(i),l=pc(a,"border","width"),c=pc(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Eb(a.maxWidth,i,"clientWidth"),o=Eb(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||Sb,maxHeight:o||Sb}}const Wm=e=>Math.round(e*10)/10;function lse(e,t,n,r){const o=X0(e),i=pc(o,"margin"),s=Eb(o.maxWidth,e,"clientWidth")||Sb,a=Eb(o.maxHeight,e,"clientHeight")||Sb,l=ase(e,t,n);let{width:c,height:u}=l;if(o.boxSizing==="content-box"){const f=pc(o,"border","width"),p=pc(o,"padding");c-=p.width+f.width,u-=p.height+f.height}return c=Math.max(0,c-i.width),u=Math.max(0,r?c/r:u-i.height),c=Wm(Math.min(c,s,l.maxWidth)),u=Wm(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Wm(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=Wm(Math.floor(u*r))),{width:c,height:u}}function ZD(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 cse=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};AR()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function JD(e,t){const n=rse(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Fl(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function use(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 dse(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},s=Fl(e,o,n),a=Fl(o,i,n),l=Fl(i,t,n),c=Fl(s,a,n),u=Fl(a,l,n);return Fl(c,u,n)}const fse=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}}},hse=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Yu(e,t,n){return e?fse(t,n):hse()}function s6(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 a6(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function l6(e){return e==="angle"?{between:Xh,compare:pie,normalize:wo}:{between:zs,compare:(t,n)=>t-n,normalize:t=>t}}function eM({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 pse(e,t,n){const{property:r,start:o,end:i}=n,{between:s,normalize:a}=l6(r),l=t.length;let{start:c,end:u,loop:d}=e,f,p;if(d){for(c+=l,u+=l,f=0,p=l;f<p&&s(a(t[c%l][r]),o,i);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function c6(e,t,n){if(!n)return[e];const{property:r,start:o,end:i}=n,s=t.length,{compare:a,between:l,normalize:c}=l6(r),{start:u,end:d,loop:f,style:p}=pse(e,t,n),m=[];let v=!1,y=null,b,x,E;const R=()=>l(o,E,b)&&a(o,E)!==0,P=()=>a(i,b)===0||l(i,E,b),O=()=>v||R(),A=()=>!v||P();for(let D=u,I=u;D<=d;++D)x=t[D%s],!x.skip&&(b=c(x[r]),b!==E&&(v=l(b,o,i),y===null&&O()&&(y=a(b,o)===0?D:I),y!==null&&A()&&(m.push(eM({start:y,end:D,loop:f,count:s,style:p})),y=null),I=D,E=b));return y!==null&&m.push(eM({start:y,end:d,loop:f,count:s,style:p})),m}function u6(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const i=c6(r[o],e.points,t);i.length&&n.push(...i)}return n}function gse(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 mse(e,t,n,r){const o=e.length,i=[];let s=t,a=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%o];c.skip||c.stop?a.skip||(r=!1,i.push({start:t%o,end:(l-1)%o,loop:r}),t=s=c.stop?l:null):(s=l,a.skip&&(t=l)),a=c}return s!==null&&i.push({start:t%o,end:s%o,loop:r}),i}function vse(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:s,end:a}=gse(n,o,i,r);if(r===!0)return tM(e,[{start:s,end:a,loop:i}],n,t);const l=a<s?a+o:a,c=!!e._fullLoop&&s===0&&a===o-1;return tM(e,mse(n,s,l,c),n,t)}function tM(e,t,n,r){return!r||!r.setContext||!n?t:bse(e,t,n,r)}function bse(e,t,n,r){const o=e._chart.getContext(),i=nM(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let u=i,d=t[0].start,f=d;function p(m,v,y,b){const x=a?-1:1;if(m!==v){for(m+=l;n[m%l].skip;)m-=x;for(;n[v%l].skip;)v+=x;m%l!==v%l&&(c.push({start:m%l,end:v%l,loop:y,style:b}),u=b,d=v%l)}}for(const m of t){d=a?d:m.start;let v=n[d%l],y;for(f=d+1;f<=m.end;f++){const b=n[f%l];y=nM(r.setContext(ll(o,{type:"segment",p0:v,p1:b,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:s}))),yse(y,u)&&p(d,f-1,m.loop,u),v=b,u=y}d<f-1&&p(d,f-1,m.loop,u)}return c}function nM(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function yse(e,t){if(!t)return!1;const n=[],r=function(o,i){return _R(i)?(n.includes(i)||n.push(i),n.indexOf(i)):i};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
246
+ * Chart.js v4.4.1
247
+ * https://www.chartjs.org
248
+ * (c) 2023 Chart.js Contributors
249
+ * Released under the MIT License
250
+ */class xse{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=q4.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 Ds=new xse;const rM="transparent",wse={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=qD(e||rM),o=r.valid&&qD(t||rM);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Sse{constructor(t,n,r,o){const i=n[r];o=xn([t.to,o,i,t.from]);const s=xn([t.from,i,o]);this._active=!0,this._fn=t.fn||wse[t.type||typeof s],this._easing=Rh[t.easing]||Rh.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=xn([t.to,n,o,t.from]),this._from=xn([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 d6{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Dt(t))return;const n=Object.keys(In.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const i=t[o];if(!Dt(i))return;const s={};for(const a of n)s[a]=i[a];(wn(i.properties)&&i.properties||[o]).forEach(a=>{(a===o||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,o=_se(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&Cse(t.options.$animations,r).then(()=>{t.options=r},()=>{}),i}_createAnimations(t,n){const r=this._properties,o=[],i=t.$animations||(t.$animations={}),s=Object.keys(n),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){o.push(...this._animateOptions(t,n));continue}const u=n[c];let d=i[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}i[c]=d=new Sse(f,t,c,u),o.push(d)}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 Ds.add(this._chart,r),!0}}function Cse(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 _se(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 oM(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 Ese(e,t,n){if(n===!1)return!1;const r=oM(e,n),o=oM(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function Rse(e){let t,n,r,o;return Dt(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 f6(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 iM(e,t,n,r={}){const o=e.keys,i=r.mode==="single";let s,a,l,c;if(t!==null){for(s=0,a=o.length;s<a;++s){if(l=+o[s],l===n){if(r.all)continue;break}c=e.values[l],Fn(c)&&(i||t===0||Zi(t)===Zi(c))&&(t+=c)}return t}}function Pse(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 sM(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Ose(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Ase(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 Tse(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function aM(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 lM(e,t){const{chart:n,_cachedMeta:r}=e,o=n._stacks||(n._stacks={}),{iScale:i,vScale:s,index:a}=r,l=i.axis,c=s.axis,u=Ose(i,s,r),d=t.length;let f;for(let p=0;p<d;++p){const m=t[p],{[l]:v,[c]:y}=m,b=m._stacks||(m._stacks={});f=b[c]=Tse(o,u,v),f[a]=y,f._top=aM(f,s,!0,r.type),f._bottom=aM(f,s,!1,r.type);const x=f._visualValues||(f._visualValues={});x[a]=y}}function z1(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function Dse(e,t){return ll(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Mse(e,t,n){return ll(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function $f(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 B1=e=>e==="reset"||e==="none",cM=(e,t)=>t?e:Object.assign({},e),Ise=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:f6(n,!0),values:null};class ei{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=sM(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&&$f(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(d,f,p,m)=>d==="x"?f:d==="r"?m:p,i=n.xAxisID=st(r.xAxisID,z1(t,"x")),s=n.yAxisID=st(r.yAxisID,z1(t,"y")),a=n.rAxisID=st(r.rAxisID,z1(t,"r")),l=n.indexAxis,c=n.iAxisID=o(l,i,s,a),u=n.vAxisID=o(l,s,i,a);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(s),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&WD(this._data,this),t._stacked&&$f(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Dt(n))this._data=Pse(n);else if(r!==n){if(r){WD(r,this);const o=this._cachedMeta;$f(o),o._parsed=[]}n&&Object.isExtensible(n)&&bie(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=sM(n.vScale,n),n.stack!==r.stack&&(o=!0,$f(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&lM(this,n._parsed)}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:o}=this,{iScale:i,_stacked:s}=r,a=i.axis;let l=t===0&&n===o.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=o,r._sorted=!0,f=o;else{wn(o[t])?f=this.parseArrayData(r,o,t,n):Dt(o[t])?f=this.parseObjectData(r,o,t,n):f=this.parsePrimitiveData(r,o,t,n);const p=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=d=f[u],l&&(p()&&(l=!1),c=d);r._sorted=l}s&&lM(this,f)}parsePrimitiveData(t,n,r,o){const{iScale:i,vScale:s}=t,a=i.axis,l=s.axis,c=i.getLabels(),u=i===s,d=new Array(o);let f,p,m;for(f=0,p=o;f<p;++f)m=f+r,d[f]={[a]:u||i.parse(c[m],m),[l]:s.parse(n[m],m)};return d}parseArrayData(t,n,r,o){const{xScale:i,yScale:s}=t,a=new Array(o);let l,c,u,d;for(l=0,c=o;l<c;++l)u=l+r,d=n[u],a[l]={x:i.parse(d[0],u),y:s.parse(d[1],u)};return a}parseObjectData(t,n,r,o){const{xScale:i,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(o);let u,d,f,p;for(u=0,d=o;u<d;++u)f=u+r,p=n[f],c[u]={x:i.parse(Xa(p,a),f),y:s.parse(Xa(p,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const o=this.chart,i=this._cachedMeta,s=n[t.axis],a={keys:f6(o,!0),values:n._stacks[t.axis]._visualValues};return iM(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=iM(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=Ise(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=Ase(a);let f,p;function m(){p=o[f];const v=p[a.axis];return!Fn(p[t.axis])||u>v||d<v}for(f=0;f<s&&!(!m()&&(this.updateRangeFromParsed(c,t,p,l),i));++f);if(i){for(f=s-1;f>=0;--f)if(!m()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let o,i,s;for(o=0,i=n.length;o<i;++o)s=n[o][t.axis],Fn(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=Rse(st(this.options.clip,Ese(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,o=r.data||[],i=n.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||o.length-a,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,i,a,l),u=a;u<a+l;++u){const d=o[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,i))}for(u=0;u<s.length;++u)s[u].draw(t,i)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const o=this.getDataset();let i;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];i=s.$context||(s.$context=Mse(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=Dse(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&&Kh(r);if(a)return cM(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=o?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),p=Object.keys(In.elements[t]),m=()=>this.getContext(r,o,n),v=c.resolveNamedOptions(f,p,m,d);return v.$shared&&(v.$shared=l,i[s]=Object.freeze(cM(v,l))),v}_resolveAnimations(t,n,r){const o=this.chart,i=this._cachedDataOpts,s=`animation-${n}`,a=i[s];if(a)return a;let l;if(o.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,n))}const c=new d6(o,l&&l.animations);return l&&l._cacheable&&(i[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||B1(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){B1(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!B1(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,o){t.active=o;const i=this.getStyle(n,o);this._resolveAnimations(n,r,o).update(t,{options:!o&&this.getSharedOptions(i)||i})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const o=r.length,i=n.length,s=Math.min(i,o);s&&this.parse(0,s),i>o?this._insertElements(o,i-o,t):i<o&&this._removeElements(i,o-i)}_insertElements(t,n,r=!0){const o=this._cachedMeta,i=o.data,s=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=s;a--)c[a]=c[a-n]};for(l(i),a=t;a<s;++a)i[a]=new this.dataElementType;this._parsing&&l(o._parsed),this.parse(t,n),r&&this.updateElements(i,t,n,"reset")}updateElements(t,n,r,o){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const o=r._parsed.splice(t,n);r._stacked&&$f(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])}}Ne(ei,"defaults",{}),Ne(ei,"datasetElementType",null),Ne(ei,"dataElementType",null);function $se(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=G4(r.sort((o,i)=>o-i))}return e._cache.$bar}function Nse(e){const t=e.iScale,n=$se(t,e.type);let r=t._length,o,i,s,a;const l=()=>{s===32767||s===-32768||(Kh(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 kse(e,t,n,r){const o=n.barThickness;let i,s;return Pt(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 Lse(e,t,n,r){const o=t.pixels,i=o[e];let s=e>0?o[e-1]:null,a=e<o.length-1?o[e+1]:null;const l=n.categoryPercentage;s===null&&(s=i-(a===null?t.end-t.start:a-i)),a===null&&(a=i+i-s);const c=i-(i-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:n.barPercentage,start:c}}function Fse(e,t,n,r){const o=n.parse(e[0],r),i=n.parse(e[1],r),s=Math.min(o,i),a=Math.max(o,i);let l=s,c=a;Math.abs(s)>Math.abs(a)&&(l=a,c=s),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:o,end:i,min:s,max:a}}function h6(e,t,n,r){return wn(e)?Fse(e,t,n,r):t[n.axis]=n.parse(e,r),t}function uM(e,t,n,r){const o=e.iScale,i=e.vScale,s=o.getLabels(),a=o===i,l=[];let c,u,d,f;for(c=n,u=n+r;c<u;++c)f=t[c],d={},d[o.axis]=a||o.parse(s[c],c),l.push(h6(f,d,i,c));return l}function V1(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function jse(e,t,n){return e!==0?Zi(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function zse(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 Bse(e,t,n,r){let o=t.borderSkipped;const i={};if(!o){e.borderSkipped=i;return}if(o===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:c,bottom:u}=zse(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[dM(u,s,a,l)]=!0,o=c)),i[dM(o,s,a,l)]=!0,e.borderSkipped=i}function dM(e,t,n,r){return r?(e=Vse(e,t,n),e=fM(e,n,t)):e=fM(e,t,n),e}function Vse(e,t,n){return e===t?n:e===n?t:e}function fM(e,t,n){return e==="start"?t:e==="end"?n:e}function Hse(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class qv extends ei{parsePrimitiveData(t,n,r,o){return uM(t,n,r,o)}parseArrayData(t,n,r,o){return uM(t,n,r,o)}parseObjectData(t,n,r,o){const{iScale:i,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=i.axis==="x"?a:l,u=s.axis==="x"?a:l,d=[];let f,p,m,v;for(f=r,p=r+o;f<p;++f)v=n[f],m={},m[i.axis]=i.parse(Xa(v,c),f),d.push(h6(Xa(v,u),m,s,f));return d}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=V1(s)?"["+s.start+", "+s.end+"]":""+o.getLabelForValue(i[o.axis]);return{label:""+r.getLabelForValue(i[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,o){const i=o==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(n,o);for(let p=n;p<n+r;p++){const m=this.getParsed(p),v=i||Pt(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),y=this._calculateBarIndexPixels(p,u),b=(m._stacks||{})[a.axis],x={horizontal:c,base:v.base,enableBorderRadius:!b||V1(m._custom)||s===b._top||s===b._bottom,x:c?v.head:y.center,y:c?y.center:v.head,height:c?y.size:Math.abs(v.size),width:c?Math.abs(v.size):y.size};f&&(x.options=d||this.resolveDataElementOptions(p,t[p].active?"active":o));const E=x.options||t[p].options;Bse(x,E,b,s),Hse(x,E,u.ratio),this.updateElement(t[p],p,x,o)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,o=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),i=r.options.stacked,s=[],a=l=>{const c=l.controller.getParsed(n),u=c&&c[l.vScale.axis];if(Pt(u)||isNaN(u))return!0};for(const l of o)if(!(n!==void 0&&a(l))&&((i===!1||s.indexOf(l.stack)===-1||i===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,n,r){const o=this._getStacks(t,r),i=n!==void 0?o.indexOf(n):-1;return i===-1?o.length-1:i}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,o=[];let i,s;for(i=0,s=n.data.length;i<s;++i)o.push(r.getPixelForValue(this.getParsed(i)[r.axis],i));const a=t.barThickness;return{min:a||Nse(n),pixels:o,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:o},options:{base:i,minBarLength:s}}=this,a=i||0,l=this.getParsed(t),c=l._custom,u=V1(c);let d=l[n.axis],f=0,p=r?this.applyStack(n,l,r):d,m,v;p!==d&&(f=p-d,p=d),u&&(d=c.barStart,p=c.barEnd-c.barStart,d!==0&&Zi(d)!==Zi(c.barEnd)&&(f=0),f+=d);const y=!Pt(i)&&!u?i:f;let b=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?m=n.getPixelForValue(f+p):m=b,v=m-b,Math.abs(v)<s){v=jse(v,n,a)*s,d===a&&(b-=v/2);const x=n.getPixelForDecimal(0),E=n.getPixelForDecimal(1),R=Math.min(x,E),P=Math.max(x,E);b=Math.max(Math.min(b,P),R),m=b+v,r&&!u&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(m)-n.getValueForPixel(b))}if(b===n.getPixelForValue(a)){const x=Zi(v)*n.getLineWidthForValue(a)/2;b+=x,v-=x}return{size:v,base:b,head:m,center:m+v/2}}_calculateBarIndexPixels(t,n){const r=n.scale,o=this.options,i=o.skipNull,s=st(o.maxBarThickness,1/0);let a,l;if(n.grouped){const c=i?this._getStackCount(t):n.stackCount,u=o.barThickness==="flex"?Lse(t,n,o,c):kse(t,n,o,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0);a=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,o=r.length;let i=0;for(;i<o;++i)this.getParsed(i)[n.axis]!==null&&r[i].draw(this._ctx)}}Ne(qv,"id","bar"),Ne(qv,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Ne(qv,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Yv extends ei{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=st(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=st(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return i}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:i}=n,s=this.getParsed(t),a=o.getLabelForValue(s.x),l=i.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,o),u=s.axis,d=a.axis;for(let f=n;f<n+r;f++){const p=t[f],m=!i&&this.getParsed(f),v={},y=v[u]=i?s.getPixelForDecimal(.5):s.getPixelForValue(m[u]),b=v[d]=i?a.getBasePixel():a.getPixelForValue(m[d]);v.skip=isNaN(y)||isNaN(b),c&&(v.options=l||this.resolveDataElementOptions(f,p.active?"active":o),i&&(v.options.radius=0)),this.updateElement(p,f,v,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+=st(r&&r._custom,i),o}}Ne(Yv,"id","bubble"),Ne(Yv,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Ne(Yv,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Wse(e,t,n){let r=1,o=1,i=0,s=0;if(t<Sn){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),f=Math.sin(l),p=(E,R,P)=>Xh(E,a,l,!0)?1:Math.max(R,R*n,P,P*n),m=(E,R,P)=>Xh(E,a,l,!0)?-1:Math.min(R,R*n,P,P*n),v=p(0,c,d),y=p(Gn,u,f),b=m(Cn,c,d),x=m(Cn+Gn,u,f);r=(v-b)/2,o=(y-x)/2,i=-(v+b)/2,s=-(y+x)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:s}}class Xl extends ei{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(Dt(r[t])){const{key:l="value"}=this._parsing;i=c=>+Xa(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)o._parsed[s]=i(s)}}_getRotation(){return Si(this.options.rotation-90)}_getCircumference(){return Si(this.options.circumference)}_getRotationExtents(){let t=Sn,n=-Sn;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(oie(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:m,offsetY:v}=Wse(d,u,l),y=(r.width-s)/f,b=(r.height-s)/p,x=Math.max(Math.min(y,b)/2,0),E=B4(this.options.radius,x),R=Math.max(E*l,0),P=(E-R)/this._getVisibleDatasetWeightTotal();this.offsetX=m*E,this.offsetY=v*E,o.total=this.calculateTotal(),this.outerRadius=E-P*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-P*c,0),this.updateElements(i,0,i.length,t)}_circumference(t,n){const r=this.options,o=this._cachedMeta,i=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||o._parsed[t]===null||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*i/Sn)}updateElements(t,n,r,o){const i=o==="reset",s=this.chart,a=s.chartArea,c=s.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=i&&c.animateScale,p=f?0:this.innerRadius,m=f?0:this.outerRadius,{sharedOptions:v,includeOptions:y}=this._getSharedOptions(n,o);let b=this._getRotation(),x;for(x=0;x<n;++x)b+=this._circumference(x,i);for(x=n;x<n+r;++x){const E=this._circumference(x,i),R=t[x],P={x:u+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+E,circumference:E,outerRadius:m,innerRadius:p};y&&(P.options=v||this.resolveDataElementOptions(x,R.active?"active":o)),b+=E,this.updateElement(R,x,P,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)?Sn*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=ig(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(st(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Ne(Xl,"id","doughnut"),Ne(Xl,"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"}),Ne(Xl,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Ne(Xl,"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 Kv extends ei{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}=K4(n,o,s);this._drawStart=a,this._drawCount=l,X4(n)&&(a=0,l=o.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!i._decimated,r.points=o;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(o,a,l,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(n,o),f=s.axis,p=a.axis,{spanGaps:m,segment:v}=this.options,y=Pd(m)?m:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||i||o==="none",x=n+r,E=t.length;let R=n>0&&this.getParsed(n-1);for(let P=0;P<E;++P){const O=t[P],A=b?O:{};if(P<n||P>=x){A.skip=!0;continue}const D=this.getParsed(P),I=Pt(D[p]),L=A[f]=s.getPixelForValue(D[f],P),j=A[p]=i||I?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,D,l):D[p],P);A.skip=isNaN(L)||isNaN(j)||I,A.stop=P>0&&Math.abs(D[f]-R[f])>y,v&&(A.parsed=D,A.raw=c.data[P]),d&&(A.options=u||this.resolveDataElementOptions(P,O.active?"active":o)),b||this.updateElement(O,P,A,o),R=D}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,r=n.options&&n.options.borderWidth||0,o=t.data||[];if(!o.length)return r;const i=o[0].size(this.resolveDataElementOptions(0)),s=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(r,i,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Ne(Kv,"id","line"),Ne(Kv,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ne(Kv,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Oh extends ei{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=ig(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return o6.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,o)=>{const i=this.getParsed(o).r;!isNaN(i)&&this.chart.getDataVisibility(o)&&(i<n.min&&(n.min=i),i>n.max&&(n.max=i))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,r=t.options,o=Math.min(n.right-n.left,n.bottom-n.top),i=Math.max(o/2,0),s=Math.max(r.cutoutPercentage?i/100*r.cutoutPercentage:1,0),a=(i-s)/t.getVisibleDatasetCount();this.outerRadius=i-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,r,o){const i=o==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*Cn;let p=f,m;const v=360/this.countVisibleElements();for(m=0;m<n;++m)p+=this._computeAngle(m,o,v);for(m=n;m<n+r;m++){const y=t[m];let b=p,x=p+this._computeAngle(m,o,v),E=s.getDataVisibility(m)?c.getDistanceFromCenterForValue(this.getParsed(m).r):0;p=x,i&&(l.animateScale&&(E=0),l.animateRotate&&(b=x=f));const R={x:u,y:d,innerRadius:0,outerRadius:E,startAngle:b,endAngle:x,options:this.resolveDataElementOptions(m,y.active?"active":o)};this.updateElement(y,m,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)?Si(this.resolveDataElementOptions(t,n).angle||r):0}}Ne(Oh,"id","polarArea"),Ne(Oh,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Ne(Oh,"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 bC extends Xl{}Ne(bC,"id","pie"),Ne(bC,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Xv extends ei{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 o6.bind(this)(t,n,r,o)}update(t){const n=this._cachedMeta,r=n.dataset,o=n.data||[],i=n.iScale.getLabels();if(r.points=o,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:i.length===o.length,options:s};this.updateElement(r,void 0,a,t)}this.updateElements(o,0,o.length,t)}updateElements(t,n,r,o){const i=this._cachedMeta.rScale,s=o==="reset";for(let a=n;a<n+r;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":o),u=i.getPointPositionForValue(a,this.getParsed(a).r),d=s?i.xCenter:u.x,f=s?i.yCenter:u.y,p={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,a,p,o)}}}Ne(Xv,"id","radar"),Ne(Xv,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Ne(Xv,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Qv extends ei{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}=K4(n,r,o);if(this._drawStart=i,this._drawCount=s,X4(n)&&(i=0,s=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!o,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(r,i,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,o),d=this.getSharedOptions(u),f=this.includeOptions(o,d),p=s.axis,m=a.axis,{spanGaps:v,segment:y}=this.options,b=Pd(v)?v:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||i||o==="none";let E=n>0&&this.getParsed(n-1);for(let R=n;R<n+r;++R){const P=t[R],O=this.getParsed(R),A=x?P:{},D=Pt(O[m]),I=A[p]=s.getPixelForValue(O[p],R),L=A[m]=i||D?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,O,l):O[m],R);A.skip=isNaN(I)||isNaN(L)||D,A.stop=R>0&&Math.abs(O[p]-E[p])>b,y&&(A.parsed=O,A.raw=c.data[R]),f&&(A.options=d||this.resolveDataElementOptions(R,P.active?"active":o)),x||this.updateElement(P,R,A,o),E=O}this.updateSharedOptions(d,o,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let l=n.length-1;l>=0;--l)a=Math.max(a,n[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,o=r.options&&r.options.borderWidth||0;if(!n.length)return o;const i=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(o,i,s)/2}}Ne(Qv,"id","scatter"),Ne(Qv,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Ne(Qv,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Use=Object.freeze({__proto__:null,BarController:qv,BubbleController:Yv,DoughnutController:Xl,LineController:Kv,PieController:bC,PolarAreaController:Oh,RadarController:Xv,ScatterController:Qv});function Ml(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class DR{constructor(t){Ne(this,"options");this.options=t||{}}static override(t){Object.assign(DR.prototype,t)}init(){}formats(){return Ml()}parse(){return Ml()}format(){return Ml()}add(){return Ml()}diff(){return Ml()}startOf(){return Ml()}endOf(){return Ml()}}var Gse={_date:DR};function qse(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?mie:Bs;if(r){if(o._sharedOptions){const c=i[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(i,t,n-u),f=l(i,t,n+u);return{lo:d.lo,hi:f.hi}}}}else return l(i,t,n)}return{lo:0,hi:i.length-1}}function sg(e,t,n,r,o){const i=e.getSortedVisibleDatasetMetas(),s=n[t];for(let a=0,l=i.length;a<l;++a){const{index:c,data:u}=i[a],{lo:d,hi:f}=qse(i[a],t,s,o);for(let p=d;p<=f;++p){const m=u[p];m.skip||r(m,c,p)}}}function Yse(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 H1(e,t,n,r,o){const i=[];return!o&&!e.isPointInArea(t)||sg(e,n,t,function(a,l,c){!o&&!Vs(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&i.push({element:a,datasetIndex:l,index:c})},!0),i}function Kse(e,t,n,r){let o=[];function i(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=W4(s,{x:t.x,y:t.y});Xh(d,c,u)&&o.push({element:s,datasetIndex:a,index:l})}return sg(e,n,t,i),o}function Xse(e,t,n,r,o,i){let s=[];const a=Yse(n);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const p=u.inRange(t.x,t.y,o);if(r&&!p)return;const m=u.getCenterPoint(o);if(!(!!i||e.isPointInArea(m))&&!p)return;const y=a(t,m);y<l?(s=[{element:u,datasetIndex:d,index:f}],l=y):y===l&&s.push({element:u,datasetIndex:d,index:f})}return sg(e,n,t,c),s}function W1(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?Kse(e,t,n,o):Xse(e,t,n,r,o,i)}function hM(e,t,n,r,o){const i=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return sg(e,n,t,(l,c,u)=>{l[s](t[n],o)&&(i.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,o))}),r&&!a?[]:i}var Qse={evaluateInteractionItems:sg,modes:{index(e,t,n,r){const o=Ll(t,e),i=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?H1(e,o,i,r,s):W1(e,o,i,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,r){const o=Ll(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?H1(e,o,i,r,s):W1(e,o,i,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(e,t,n,r){const o=Ll(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return H1(e,o,i,r,s)},nearest(e,t,n,r){const o=Ll(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return W1(e,o,i,n.intersect,r,s)},x(e,t,n,r){const o=Ll(t,e);return hM(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=Ll(t,e);return hM(e,o,"y",n.intersect,r)}}};const p6=["left","top","right","bottom"];function Nf(e,t){return e.filter(n=>n.pos===t)}function pM(e,t){return e.filter(n=>p6.indexOf(n.pos)===-1&&n.box.axis===t)}function kf(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 Zse(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 Jse(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!p6.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 eae(e,t){const n=Jse(e),{vBoxMaxWidth:r,hBoxMaxHeight:o}=t;let i,s,a;for(i=0,s=e.length;i<s;++i){a=e[i];const{fullSize:l}=a.box,c=n[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*r:l&&t.availableWidth,a.height=o):(a.width=r,a.height=u?u*o:l&&t.availableHeight)}return n}function tae(e){const t=Zse(e),n=kf(t.filter(c=>c.box.fullSize),!0),r=kf(Nf(t,"left"),!0),o=kf(Nf(t,"right")),i=kf(Nf(t,"top"),!0),s=kf(Nf(t,"bottom")),a=pM(t,"x"),l=pM(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:Nf(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(s).concat(a)}}function gM(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function g6(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 nae(e,t,n,r){const{pos:o,box:i}=n,s=e.maxPadding;if(!Dt(o)){n.size&&(e[o]-=n.size);const d=r[n.stack]||{size:0,count:1};d.size=Math.max(d.size,n.horizontal?i.height:i.width),n.size=d.size/d.count,e[o]+=n.size}i.getPadding&&g6(s,i.getPadding());const a=Math.max(0,t.outerWidth-gM(s,e,"left","right")),l=Math.max(0,t.outerHeight-gM(s,e,"top","bottom")),c=a!==e.w,u=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function rae(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 oae(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 ch(e,t,n,r){const o=[];let i,s,a,l,c,u;for(i=0,s=e.length,c=0;i<s;++i){a=e[i],l=a.box,l.update(a.width||t.w,a.height||t.h,oae(a.horizontal,t));const{same:d,other:f}=nae(t,n,a,r);c|=d&&o.length,u=u||f,l.fullSize||o.push(a)}return c&&ch(o,t,n,r)||u}function Um(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 mM(e,t,n,r){const o=n.padding;let{x:i,y:s}=t;for(const a of e){const l=a.box,c=r[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,f=c.size||l.height;Kh(c.start)&&(s=c.start),l.fullSize?Um(l,o.left,s,n.outerWidth-o.right-o.left,f):Um(l,t.left+c.placed,s,d,f),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,f=c.size||l.width;Kh(c.start)&&(i=c.start),l.fullSize?Um(l,i,o.top,f,n.outerHeight-o.bottom-o.top):Um(l,i,t.top+c.placed,f,d),c.start=i,c.placed+=d,i=l.right}}t.x=i,t.y=s}var wr={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=hr(e.options.layout.padding),i=Math.max(t-o.width,0),s=Math.max(n-o.height,0),a=tae(e.boxes),l=a.vertical,c=a.horizontal;Qt(e.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const u=l.reduce((v,y)=>y.box.options&&y.box.options.display===!1?v:v+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:s,vBoxMaxWidth:i/2/u,hBoxMaxHeight:s/2}),f=Object.assign({},o);g6(f,hr(r));const p=Object.assign({maxPadding:f,w:i,h:s,x:o.left,y:o.top},o),m=eae(l.concat(c),d);ch(a.fullSize,p,d,m),ch(l,p,d,m),ch(c,p,d,m)&&ch(l,p,d,m),rae(p),mM(a.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,mM(a.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Qt(a.chartArea,v=>{const y=v.box;Object.assign(y,e.chartArea),y.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class m6{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 iae extends m6{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Zv="$chartjs",sae={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},vM=e=>e===null||e==="";function aae(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[Zv]={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",vM(o)){const i=JD(e,"width");i!==void 0&&(e.width=i)}if(vM(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=JD(e,"height");i!==void 0&&(e.height=i)}return e}const v6=cse?{passive:!0}:!1;function lae(e,t,n){e.addEventListener(t,n,v6)}function cae(e,t,n){e.canvas.removeEventListener(t,n,v6)}function uae(e,t){const n=sae[e.type]||e.type,{x:r,y:o}=Ll(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function Rb(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function dae(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||Rb(a.addedNodes,r),s=s&&!Rb(a.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function fae(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||Rb(a.removedNodes,r),s=s&&!Rb(a.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const Zh=new Map;let bM=0;function b6(){const e=window.devicePixelRatio;e!==bM&&(bM=e,Zh.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function hae(e,t){Zh.size||window.addEventListener("resize",b6),Zh.set(e,t)}function pae(e){Zh.delete(e),Zh.size||window.removeEventListener("resize",b6)}function gae(e,t,n){const r=e.canvas,o=r&&TR(r);if(!o)return;const i=Y4((a,l)=>{const c=o.clientWidth;n(a,l),c<o.clientWidth&&n()},window),s=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||i(c,u)});return s.observe(o),hae(e,i),s}function U1(e,t,n){n&&n.disconnect(),t==="resize"&&pae(e)}function mae(e,t,n){const r=e.canvas,o=Y4(i=>{e.ctx!==null&&n(uae(i,e))},e);return lae(r,t,o),o}class vae extends m6{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(aae(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Zv])return!1;const r=n[Zv].initial;["height","width"].forEach(i=>{const s=r[i];Pt(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[Zv],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),s={attach:dae,detach:fae,resize:gae}[n]||mae;o[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:U1,detach:U1,resize:U1}[n]||cae)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return lse(t,n,r,o)}isAttached(t){const n=TR(t);return!!(n&&n.isConnected)}}function bae(e){return!AR()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?iae:vae}var Gv;let hs=(Gv=class{constructor(){Ne(this,"x");Ne(this,"y");Ne(this,"active",!1);Ne(this,"options");Ne(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return Pd(this.x)&&Pd(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}},Ne(Gv,"defaults",{}),Ne(Gv,"defaultRoutes"),Gv);function yae(e,t){const n=e.options.ticks,r=xae(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?Sae(t):[],s=i.length,a=i[0],l=i[s-1],c=[];if(s>o)return Cae(t,c,i,s/o),c;const u=wae(i,t,o);if(s>0){let d,f;const p=s>1?Math.round((l-a)/(s-1)):null;for(Gm(t,c,u,Pt(p)?0:a-p,a),d=0,f=s-1;d<f;d++)Gm(t,c,u,i[d],i[d+1]);return Gm(t,c,u,l,Pt(p)?t.length:l+p),c}return Gm(t,c,u),c}function xae(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 wae(e,t,n){const r=_ae(e),o=t.length/n;if(!r)return Math.max(o,1);const i=fie(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 Sae(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Cae(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 Gm(e,t,n,r,o){const i=st(r,0),s=Math.min(st(o,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),o&&(l=o-r,n=l/Math.floor(l/n)),u=i;u<0;)a++,u=Math.round(i+a*n);for(c=Math.max(i,0);c<s;c++)c===u&&(t.push(e[c]),a++,u=Math.round(i+a*n))}function _ae(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 Eae=e=>e==="left"?"right":e==="right"?"left":e,yM=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,xM=(e,t)=>Math.min(t||e,e);function wM(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 Rae(e,t,n){const r=e.ticks.length,o=Math.min(t,r-1),i=e._startPixel,s=e._endPixel,a=1e-6;let l=e.getPixelForTick(o),c;if(!(n&&(r===1?c=Math.max(l-i,s-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(o-1))/2,l+=o<t?c:-c,l<i-a||l>s+a)))return l}function Pae(e,t){Qt(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 Lf(e){return e.drawTicks?e.tickLength:0}function SM(e,t){if(!e.display)return 0;const n=Xn(e.font,t),r=hr(e.padding);return(wn(e.text)?e.text.length:1)*n.lineHeight+r.height}function Oae(e,t){return ll(e,{scale:t,type:"scale"})}function Aae(e,t,n){return ll(e,{tick:n,index:t,type:"tick"})}function Tae(e,t,n){let r=CR(e);return(n&&t!=="right"||!n&&t==="right")&&(r=Eae(r)),r}function Dae(e,t,n,r){const{top:o,left:i,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,f,p,m;const v=s-o,y=a-i;if(e.isHorizontal()){if(p=xr(r,i,a),Dt(n)){const b=Object.keys(n)[0],x=n[b];m=u[b].getPixelForValue(x)+v-t}else n==="center"?m=(c.bottom+c.top)/2+v-t:m=yM(e,n,t);f=a-i}else{if(Dt(n)){const b=Object.keys(n)[0],x=n[b];p=u[b].getPixelForValue(x)-y+t}else n==="center"?p=(c.left+c.right)/2-y+t:p=yM(e,n,t);m=xr(r,s,o),d=n==="left"?-Gn:Gn}return{titleX:p,titleY:m,maxWidth:f,rotation:d}}class cl extends hs{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=bo(t,Number.POSITIVE_INFINITY),n=bo(n,Number.NEGATIVE_INFINITY),r=bo(r,Number.POSITIVE_INFINITY),o=bo(o,Number.NEGATIVE_INFINITY),{min:bo(t,r),max:bo(n,o),minDefined:Fn(t),maxDefined:Fn(n)}}getMinMax(t){let{min:n,max:r,minDefined:o,maxDefined:i}=this.getUserBounds(),s;if(o&&i)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)s=a[l].controller.getMinMax(this,t),o||(n=Math.min(n,s.min)),i||(r=Math.max(r,s.max));return n=i&&n>r?r:n,r=o&&n>r?n:r,{min:bo(n,bo(r,n)),max:bo(r,bo(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(){an(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=zie(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?wM(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=yae(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(){an(this.options.afterUpdate,[this])}beforeSetDimensions(){an(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(){an(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),an(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){an(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=an(n.callback,[i.value,r,t],this)}afterTickToLabelConversion(){an(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){an(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=xM(this.ticks.length,t.ticks.maxTicksLimit),o=n.minRotation||0,i=n.maxRotation;let s=o,a,l,c;if(!this._isVisible()||!n.display||o>=i||r<=1||!this.isHorizontal()){this.labelRotation=o;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,p=ir(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:p/(r-1),d+6>a&&(a=p/(r-(t.offset?.5:1)),l=this.maxHeight-Lf(t.grid)-n.padding-SM(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),s=wR(Math.min(Math.asin(ir((u.highest.height+6)/a,-1,1)),Math.asin(ir(l/c,-1,1))-Math.asin(ir(f/c,-1,1)))),s=Math.max(o,Math.min(i,s))),this.labelRotation=s}afterCalculateLabelRotation(){an(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){an(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=SM(o,n.options.font);if(a?(t.width=this.maxWidth,t.height=Lf(i)+l):(t.height=this.maxHeight,t.width=Lf(i)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),p=r.padding*2,m=Si(this.labelRotation),v=Math.cos(m),y=Math.sin(m);if(a){const b=r.mirror?0:y*d.width+v*f.height;t.height=Math.min(this.maxHeight,t.height+b+p)}else{const b=r.mirror?0:v*d.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+b+p)}this._calculatePadding(c,u,y,v)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,o){const{ticks:{align:i,padding:s},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,p=0;l?c?(f=o*t.width,p=r*n.height):(f=r*t.height,p=o*n.width):i==="start"?p=n.width:i==="end"?f=t.width:i!=="inner"&&(f=t.width/2,p=n.width/2),this.paddingLeft=Math.max((f-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-d+s)*this.width/(this.width-d),0)}else{let u=n.height/2,d=t.height/2;i==="start"?(u=0,d=t.height):i==="end"&&(u=n.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+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(){an(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++)Pt(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=wM(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/xM(n,r));let c=0,u=0,d,f,p,m,v,y,b,x,E,R,P;for(d=0;d<n;d+=l){if(m=t[d].label,v=this._resolveTickFontOptions(d),o.font=y=v.string,b=i[y]=i[y]||{data:{},gc:[]},x=v.lineHeight,E=R=0,!Pt(m)&&!wn(m))E=Cb(o,b.data,b.gc,E,m),R=x;else if(wn(m))for(f=0,p=m.length;f<p;++f)P=m[f],!Pt(P)&&!wn(P)&&(E=Cb(o,b.data,b.gc,E,P),R+=x);s.push(E),a.push(R),c=Math.max(E,c),u=Math.max(R,u)}Pae(i,n);const O=s.indexOf(c),A=a.indexOf(u),D=I=>({width:s[I]||0,height:a[I]||0});return{first:D(0),last:D(n-1),widest:D(O),highest:D(A),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 gie(this._alignToPixels?Dl(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=Aae(this.getContext(),t,r))}return this.$context||(this.$context=Oae(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Si(this.labelRotation),r=Math.abs(Math.cos(n)),o=Math.abs(Math.sin(n)),i=this._getLabelSizes(),s=t.autoSkipPadding||0,a=i?i.widest.width+s:0,l=i?i.highest.height+s:0;return this.isHorizontal()?l*r>a*o?a/r:l/o:l*o<a*r?l/r:a/o}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,o=this.options,{grid:i,position:s,border:a}=o,l=i.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Lf(i),p=[],m=a.setContext(this.getContext()),v=m.display?m.width:0,y=v/2,b=function(W){return Dl(r,W,v)};let x,E,R,P,O,A,D,I,L,j,z,K;if(s==="top")x=b(this.bottom),A=this.bottom-f,I=x-y,j=b(t.top)+y,K=t.bottom;else if(s==="bottom")x=b(this.top),j=t.top,K=b(t.bottom)-y,A=x+y,I=this.top+f;else if(s==="left")x=b(this.right),O=this.right-f,D=x-y,L=b(t.left)+y,z=t.right;else if(s==="right")x=b(this.left),L=t.left,z=b(t.right)-y,O=x+y,D=this.left+f;else if(n==="x"){if(s==="center")x=b((t.top+t.bottom)/2+.5);else if(Dt(s)){const W=Object.keys(s)[0],B=s[W];x=b(this.chart.scales[W].getPixelForValue(B))}j=t.top,K=t.bottom,A=x+y,I=A+f}else if(n==="y"){if(s==="center")x=b((t.left+t.right)/2);else if(Dt(s)){const W=Object.keys(s)[0],B=s[W];x=b(this.chart.scales[W].getPixelForValue(B))}O=x-y,D=O-f,L=t.left,z=t.right}const H=st(o.ticks.maxTicksLimit,d),k=Math.max(1,Math.ceil(d/H));for(E=0;E<d;E+=k){const W=this.getContext(E),B=i.setContext(W),U=a.setContext(W),q=B.lineWidth,$=B.color,Y=U.dash||[],X=U.dashOffset,M=B.tickWidth,oe=B.tickColor,te=B.tickBorderDash||[],ie=B.tickBorderDashOffset;R=Rae(this,E,l),R!==void 0&&(P=Dl(r,R,q),c?O=D=L=z=P:A=I=j=K=P,p.push({tx1:O,ty1:A,tx2:D,ty2:I,x1:L,y1:j,x2:z,y2:K,width:q,color:$,borderDash:Y,borderDashOffset:X,tickWidth:M,tickColor:oe,tickBorderDash:te,tickBorderDashOffset:ie}))}return this._ticksLength=d,this._borderValue=x,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:o,ticks:i}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=i,f=Lf(r.grid),p=f+u,m=d?-u:p,v=-Si(this.labelRotation),y=[];let b,x,E,R,P,O,A,D,I,L,j,z,K="middle";if(o==="top")O=this.bottom-m,A=this._getXAxisLabelAlignment();else if(o==="bottom")O=this.top+m,A=this._getXAxisLabelAlignment();else if(o==="left"){const k=this._getYAxisLabelAlignment(f);A=k.textAlign,P=k.x}else if(o==="right"){const k=this._getYAxisLabelAlignment(f);A=k.textAlign,P=k.x}else if(n==="x"){if(o==="center")O=(t.top+t.bottom)/2+p;else if(Dt(o)){const k=Object.keys(o)[0],W=o[k];O=this.chart.scales[k].getPixelForValue(W)+p}A=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")P=(t.left+t.right)/2-p;else if(Dt(o)){const k=Object.keys(o)[0],W=o[k];P=this.chart.scales[k].getPixelForValue(W)}A=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?K="top":l==="end"&&(K="bottom"));const H=this._getLabelSizes();for(b=0,x=a.length;b<x;++b){E=a[b],R=E.label;const k=i.setContext(this.getContext(b));D=this.getPixelForTick(b)+i.labelOffset,I=this._resolveTickFontOptions(b),L=I.lineHeight,j=wn(R)?R.length:1;const W=j/2,B=k.color,U=k.textStrokeColor,q=k.textStrokeWidth;let $=A;s?(P=D,A==="inner"&&(b===x-1?$=this.options.reverse?"left":"right":b===0?$=this.options.reverse?"right":"left":$="center"),o==="top"?c==="near"||v!==0?z=-j*L+L/2:c==="center"?z=-H.highest.height/2-W*L+L:z=-H.highest.height+L/2:c==="near"||v!==0?z=L/2:c==="center"?z=H.highest.height/2-W*L:z=H.highest.height-j*L,d&&(z*=-1),v!==0&&!k.showLabelBackdrop&&(P+=L/2*Math.sin(v))):(O=D,z=(1-j)*L/2);let Y;if(k.showLabelBackdrop){const X=hr(k.backdropPadding),M=H.heights[b],oe=H.widths[b];let te=z-X.top,ie=0-X.left;switch(K){case"middle":te-=M/2;break;case"bottom":te-=M;break}switch(A){case"center":ie-=oe/2;break;case"right":ie-=oe;break;case"inner":b===x-1?ie-=oe:b>0&&(ie-=oe/2);break}Y={left:ie,top:te,width:oe+X.width,height:M+X.height,color:k.backdropColor}}y.push({label:R,font:I,textOffset:z,options:{rotation:v,color:B,strokeColor:U,strokeWidth:q,textAlign:$,textBaseline:K,translation:[P,O],backdrop:Y}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Si(this.labelRotation))return t==="top"?"left":"right";let o="center";return n.align==="start"?o="left":n.align==="end"?o="right":n.align==="inner"&&(o="inner"),o}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:o,padding:i}}=this.options,s=this._getLabelSizes(),a=t+i,l=s.widest.width;let c,u;return n==="left"?o?(u=this.right+i,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?o?(u=this.left+i,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:o,width:i,height:s}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,o,i,s),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const o=this.ticks.findIndex(i=>i.value===t);return o>=0?n.setContext(this.getContext(o)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let i,s;const a=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(i=0,s=o.length;i<s;++i){const l=o[i];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:o}}=this,i=r.setContext(this.getContext()),s=r.display?i.width:0;if(!s)return;const a=o.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=Dl(t,this.left,s)-s/2,u=Dl(t,this.right,a)+a/2,d=f=l):(d=Dl(t,this.top,s)-s/2,f=Dl(t,this.bottom,a)+a/2,c=u=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(c,d),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,o=this._computeLabelArea();o&&dc(r,o);const i=this.getLabelItems(t);for(const s of i){const a=s.options,l=s.font,c=s.label,u=s.textOffset;Dc(r,c,0,u,l,a)}o&&fc(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=Xn(r.font),s=hr(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||Dt(n)?(l+=s.bottom,wn(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=Dae(this,l,n,a);Dc(t,r.text,0,0,i,{color:r.color,maxWidth:d,rotation:f,textAlign:Tae(a,n,o),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=st(t.grid&&t.grid.z,-1),o=st(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==cl.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 Xn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class qm{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;$ae(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,Mae(t,s,r),this.override&&In.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 In[o]&&(delete In[o][r],this.override&&delete Tc[r])}}function Mae(e,t,n){const r=sr(Object.create(null),[n?In.get(n):{},In.get(t),e.defaults]);In.set(t,r),e.defaultRoutes&&Iae(t,e.defaultRoutes),e.descriptors&&In.describe(t,e.descriptors)}function Iae(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(".");In.route(i,o,l,a)})}function $ae(e){return"id"in e&&"defaults"in e}class Nae{constructor(){this.controllers=new qm(ei,"datasets",!0),this.elements=new qm(hs,"elements"),this.plugins=new qm(Object,"plugins"),this.scales=new qm(cl,"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):Qt(o,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const o=xR(t);an(r["before"+o],[],r),n[t](r),an(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 Nr=new Nae;class kae{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(an(a,l,s)===!1&&o.cancelable)return!1}return!0}invalidate(){Pt(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=st(r.options&&r.options.plugins,{}),i=Lae(r);return o===!1&&!n?[]:jae(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 Lae(e){const t={},n=[],r=Object.keys(Nr.plugins.items);for(let i=0;i<r.length;i++)n.push(Nr.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 Fae(e,t){return!t&&e===!1?null:e===!0?{}:e}function jae(e,{plugins:t,localIds:n},r,o){const i=[],s=e.getContext();for(const a of t){const l=a.id,c=Fae(r[l],o);c!==null&&i.push({plugin:a,options:zae(e.config,{plugin:a,local:n[l]},c,s)})}return i}function zae(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 yC(e,t){const n=In.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function Bae(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function Vae(e,t){return e===t?"_index_":"_value_"}function CM(e){if(e==="x"||e==="y"||e==="r")return e}function Hae(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function xC(e,...t){if(CM(e))return e;for(const n of t){const r=n.axis||Hae(n.position)||e.length>1&&CM(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function _M(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Wae(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 _M(e,"x",n[0])||_M(e,"y",n[0])}return{}}function Uae(e,t){const n=Tc[e.type]||{scales:{}},r=t.scales||{},o=yC(e.type,t),i=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!Dt(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=xC(s,a,Wae(s,e),In.scales[a.type]),c=Vae(l,o),u=n.scales||{};i[s]=_h(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||yC(a,t),u=(Tc[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=Bae(d,l),p=s[f+"AxisID"]||f;i[p]=i[p]||Object.create(null),_h(i[p],[{axis:f},r[p],u[d]])})}),Object.keys(i).forEach(s=>{const a=i[s];_h(a,[In.scales[a.type],In.scale])}),i}function y6(e){const t=e.options||(e.options={});t.plugins=st(t.plugins,{}),t.scales=Uae(e,t)}function x6(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Gae(e){return e=e||{},e.data=x6(e.data),y6(e),e}const EM=new Map,w6=new Set;function Ym(e,t){let n=EM.get(e);return n||(n=t(),EM.set(e,n),w6.add(n)),n}const Ff=(e,t,n)=>{const r=Xa(t,n);r!==void 0&&e.add(r)};class qae{constructor(t){this._config=Gae(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=x6(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(),y6(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ym(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Ym(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Ym(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return Ym(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let o=r.get(t);return(!o||n)&&(o=new Map,r.set(t,o)),o}getOptionScopes(t,n,r){const{options:o,type:i}=this,s=this._cachedScopes(t,r),a=s.get(n);if(a)return a;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(d=>Ff(l,t,d))),u.forEach(d=>Ff(l,o,d)),u.forEach(d=>Ff(l,Tc[i]||{},d)),u.forEach(d=>Ff(l,In,d)),u.forEach(d=>Ff(l,vC,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),w6.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Tc[n]||{},In.datasets[n]||{},{type:n},In,vC]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:a}=RM(this._resolverCache,t,o);let l=s;if(Kae(s,n)){i.$shared=!1,r=Qa(r)?r():r;const c=this.createResolver(t,r,a);l=Od(s,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(t,n,r=[""],o){const{resolver:i}=RM(this._resolverCache,t,r);return Dt(n)?Od(i,n,void 0,o):i}}function RM(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:RR(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(o,i)),i}const Yae=e=>Dt(e)&&Object.getOwnPropertyNames(e).some(t=>Qa(e[t]));function Kae(e,t){const{isScriptable:n,isIndexable:r}=e6(e);for(const o of t){const i=n(o),s=r(o),a=(s||i)&&e[o];if(i&&(Qa(a)||Yae(a))||s&&wn(a))return!0}return!1}var Xae="4.4.1";const Qae=["top","bottom","left","right","chartArea"];function PM(e,t){return e==="top"||e==="bottom"||Qae.indexOf(e)===-1&&t==="x"}function OM(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function AM(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),an(n&&n.onComplete,[e],t)}function Zae(e){const t=e.chart,n=t.options.animation;an(n&&n.onProgress,[e],t)}function S6(e){return AR()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Jv={},TM=e=>{const t=S6(e);return Object.values(Jv).filter(n=>n.canvas===t).pop()};function Jae(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 ele(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function Km(e,t,n){return e.options.clip?e[n]:t[n]}function tle(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:Km(n,t,"left"),right:Km(n,t,"right"),top:Km(r,t,"top"),bottom:Km(r,t,"bottom")}:t}class Mn{static register(...t){Nr.add(...t),DM()}static unregister(...t){Nr.remove(...t),DM()}constructor(t,n){const r=this.config=new qae(n),o=S6(t),i=TM(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||bae(o)),this.platform.updateConfig(r);const a=this.platform.acquireContext(o,s.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=rie(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new kae,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=yie(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Jv[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ds.listen(this,"complete",AM),Ds.listen(this,"progress",Zae),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return Pt(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 Nr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ZD(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return KD(this.canvas,this.ctx),this}stop(){return Ds.stop(this),this}resize(t,n){Ds.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,ZD(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),an(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Qt(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=xC(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Qt(i,s=>{const a=s.options,l=a.id,c=xC(l,a),u=st(a.type,s.dtype);(a.position===void 0||PM(a.position,c)!==PM(s.dposition))&&(a.position=s.dposition),o[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=Nr.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),Qt(o,(s,a)=>{s||delete r[a]}),Qt(r,s=>{wr.configure(this,s,s.options),wr.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(OM("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||yC(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=Nr.getController(a),{datasetElementType:c,dataElementType:u}=In.datasets[a];Object.assign(l,{dataElementType:Nr.getElement(u),datasetElementType:c&&Nr.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Qt(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!o&&i.indexOf(d)===-1;d.buildOrUpdateElements(f),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),o||Qt(i,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(OM("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Qt(this.scales,t=>{wr.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!zD(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;Jae(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(!zD(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;wr.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Qt(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,Qa(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&&(Ds.has(this)?this.attached&&!Ds.running(this)&&Ds.start(this):(this.draw(),AM({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=tle(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(o&&dc(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&&fc(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Vs(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=Qse.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=ll(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);Kh(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(),Ds.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(),KD(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Jv[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)};Qt(this.options.events,i=>r(i,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},o=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},i=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const a=()=>{o("attach",a),this.attached=!0,this.resize(),r("resize",i),r("detach",s)};s=()=>{this.attached=!1,o("resize",i),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():s()}unbindEvents(){Qt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Qt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const o=r?"set":"remove";let i,s,a,l;for(n==="dataset"&&(i=this.getDatasetMeta(t[0].datasetIndex),i.controller["_"+o+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){s=t[a];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[o+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:i,index:s})=>{const a=this.getDatasetMeta(i);if(!a)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:a.data[s],index:s}});!xb(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const o=this.options.hover,i=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.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=cie(t),c=ele(t,this._lastEvent,r,l);r&&(this._lastEvent=null,an(i.onHover,[t,a,this],this),l&&an(i.onClick,[t,a,this],this));const u=!xb(a,o);return(u||n)&&(this._active=a,this._updateHoverStyles(a,o,n)),this._lastEvent=c,u}_getActiveElements(t,n,r,o){if(t.type==="mouseout")return[];if(!r)return n;const i=this.options.hover;return this.getElementsAtEventForMode(t,i.mode,i,o)}}Ne(Mn,"defaults",In),Ne(Mn,"instances",Jv),Ne(Mn,"overrides",Tc),Ne(Mn,"registry",Nr),Ne(Mn,"version",Xae),Ne(Mn,"getChart",TM);function DM(){return Qt(Mn.instances,e=>e._plugins.invalidate())}function nle(e,t,n){const{startAngle:r,pixelMargin:o,x:i,y:s,outerRadius:a,innerRadius:l}=t;let c=o/a;e.beginPath(),e.arc(i,s,a,r-c,n+c),l>o?(c=o/l,e.arc(i,s,l,n+c,r-c,!0)):e.arc(i,s,o,n+Gn,r-Gn),e.closePath(),e.clip()}function rle(e){return ER(e,["outerStart","outerEnd","innerStart","innerEnd"])}function ole(e,t,n,r){const o=rle(e.options.borderRadius),i=(n-t)/2,s=Math.min(i,r*t/2),a=l=>{const c=(n-Math.min(i,l))*r/2;return ir(l,0,Math.min(i,c))};return{outerStart:a(o.outerStart),outerEnd:a(o.outerEnd),innerStart:ir(o.innerStart,0,s),innerEnd:ir(o.innerEnd,0,s)}}function wu(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Pb(e,t,n,r,o,i){const{x:s,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-c,0),f=u>0?u+r+n+c:0;let p=0;const m=o-l;if(r){const k=u>0?u-r:0,W=d>0?d-r:0,B=(k+W)/2,U=B!==0?m*B/(B+r):m;p=(m-U)/2}const v=Math.max(.001,m*d-n/Cn)/d,y=(m-v)/2,b=l+y+p,x=o-y-p,{outerStart:E,outerEnd:R,innerStart:P,innerEnd:O}=ole(t,f,d,x-b),A=d-E,D=d-R,I=b+E/A,L=x-R/D,j=f+P,z=f+O,K=b+P/j,H=x-O/z;if(e.beginPath(),i){const k=(I+L)/2;if(e.arc(s,a,d,I,k),e.arc(s,a,d,k,L),R>0){const q=wu(D,L,s,a);e.arc(q.x,q.y,R,L,x+Gn)}const W=wu(z,x,s,a);if(e.lineTo(W.x,W.y),O>0){const q=wu(z,H,s,a);e.arc(q.x,q.y,O,x+Gn,H+Math.PI)}const B=(x-O/f+(b+P/f))/2;if(e.arc(s,a,f,x-O/f,B,!0),e.arc(s,a,f,B,b+P/f,!0),P>0){const q=wu(j,K,s,a);e.arc(q.x,q.y,P,K+Math.PI,b-Gn)}const U=wu(A,b,s,a);if(e.lineTo(U.x,U.y),E>0){const q=wu(A,I,s,a);e.arc(q.x,q.y,E,b-Gn,I)}}else{e.moveTo(s,a);const k=Math.cos(I)*d+s,W=Math.sin(I)*d+a;e.lineTo(k,W);const B=Math.cos(L)*d+s,U=Math.sin(L)*d+a;e.lineTo(B,U)}e.closePath()}function ile(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a}=t;let l=t.endAngle;if(i){Pb(e,t,n,r,l,o);for(let c=0;c<i;++c)e.fill();isNaN(a)||(l=s+(a%Sn||Sn))}return Pb(e,t,n,r,l,o),e.fill(),l}function sle(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=f,p?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let m=t.endAngle;if(i){Pb(e,t,n,r,m,o);for(let v=0;v<i;++v)e.stroke();isNaN(a)||(m=s+(a%Sn||Sn))}p&&nle(e,t,m),i||(Pb(e,t,n,r,m,o),e.stroke())}class Fu extends hs{constructor(n){super();Ne(this,"circumference");Ne(this,"endAngle");Ne(this,"fullCircles");Ne(this,"innerRadius");Ne(this,"outerRadius");Ne(this,"pixelMargin");Ne(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}=W4(i,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),p=(this.options.spacing+this.options.borderWidth)/2,v=st(f,c-l)>=Sn||Xh(s,l,c),y=zs(a,u+p,d+p);return v&&y}getCenterPoint(n){const{x:r,y:o,startAngle:i,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(i+s)/2,f=(a+l+u+c)/2;return{x:r+Math.cos(d)*f,y:o+Math.sin(d)*f}}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>Sn?Math.floor(o/Sn):0,o===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*i,Math.sin(l)*i);const c=1-Math.sin(Math.min(Cn,o||0)),u=i*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,ile(n,this,u,s,a),sle(n,this,u,s,a),n.restore()}}Ne(Fu,"id","arc"),Ne(Fu,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Ne(Fu,"defaultRoutes",{backgroundColor:"backgroundColor"}),Ne(Fu,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function C6(e,t,n=t){e.lineCap=st(n.borderCapStyle,t.borderCapStyle),e.setLineDash(st(n.borderDash,t.borderDash)),e.lineDashOffset=st(n.borderDashOffset,t.borderDashOffset),e.lineJoin=st(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=st(n.borderWidth,t.borderWidth),e.strokeStyle=st(n.borderColor,t.borderColor)}function ale(e,t,n){e.lineTo(n.x,n.y)}function lle(e){return e.stepped?Die:e.tension||e.cubicInterpolationMode==="monotone"?Mie:ale}function _6(e,t,n={}){const r=e.length,{start:o=0,end:i=r-1}=n,{start:s,end:a}=t,l=Math.max(o,s),c=Math.min(i,a),u=o<s&&i<s||o>a&&i>a;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function cle(e,t,n,r){const{points:o,options:i}=t,{count:s,start:a,loop:l,ilen:c}=_6(o,n,r),u=lle(i);let{move:d=!0,reverse:f}=r||{},p,m,v;for(p=0;p<=c;++p)m=o[(a+(f?c-p:p))%s],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):u(e,v,m,f,i.stepped),v=m);return l&&(m=o[(a+(f?c:0))%s],u(e,v,m,f,i.stepped)),!!l}function ule(e,t,n,r){const o=t.points,{count:i,start:s,ilen:a}=_6(o,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,p,m,v,y,b;const x=R=>(s+(c?a-R:R))%i,E=()=>{v!==y&&(e.lineTo(u,y),e.lineTo(u,v),e.lineTo(u,b))};for(l&&(p=o[x(0)],e.moveTo(p.x,p.y)),f=0;f<=a;++f){if(p=o[x(f)],p.skip)continue;const R=p.x,P=p.y,O=R|0;O===m?(P<v?v=P:P>y&&(y=P),u=(d*u+R)/++d):(E(),e.lineTo(R,P),m=O,d=0,v=y=P),b=P}E()}function wC(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?ule:cle}function dle(e){return e.stepped?use:e.tension||e.cubicInterpolationMode==="monotone"?dse:Fl}function fle(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),C6(e,t.options),e.stroke(o)}function hle(e,t,n,r){const{segments:o,options:i}=t,s=wC(t);for(const a of o)C6(e,i,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const ple=typeof Path2D=="function";function gle(e,t,n,r){ple&&!t.options.segment?fle(e,t,n,r):hle(e,t,n,r)}class ja extends hs{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;nse(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=vse(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=u6(this,{property:n,start:o,end:o});if(!s.length)return;const a=[],l=dle(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:f}=s[c],p=i[d],m=i[f];if(p===m){a.push(p);continue}const v=Math.abs((o-p[n])/(m[n]-p[n])),y=l(p,m,v,r.stepped);y[n]=t[n],a.push(y)}return a.length===1?a[0]:a}pathSegment(t,n,r){return wC(this)(t,this,n,r)}path(t,n,r){const o=this.segments,i=wC(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(),gle(t,this,r,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ne(ja,"id","line"),Ne(ja,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Ne(ja,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Ne(ja,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function MM(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class gc extends hs{constructor(n){super();Ne(this,"parsed");Ne(this,"skip");Ne(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 MM(this,n,"x",r)}inYRange(n,r){return MM(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||!Vs(this,r,this.size(o)/2)||(n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.fillStyle=o.backgroundColor,_b(n,o,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Ne(gc,"id","point"),Ne(gc,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Ne(gc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function E6(e,t){const{x:n,y:r,base:o,width:i,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,c,u,d;return e.horizontal?(d=s/2,a=Math.min(n,o),l=Math.max(n,o),c=r-d,u=r+d):(d=i/2,a=n-d,l=n+d,c=Math.min(r,o),u=Math.max(r,o)),{left:a,top:c,right:l,bottom:u}}function za(e,t,n,r){return e?0:ir(t,n,r)}function mle(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=J4(r);return{t:za(o.top,i.top,0,n),r:za(o.right,i.right,0,t),b:za(o.bottom,i.bottom,0,n),l:za(o.left,i.left,0,t)}}function vle(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=hc(o),s=Math.min(t,n),a=e.borderSkipped,l=r||Dt(o);return{topLeft:za(!l||a.top||a.left,i.topLeft,0,s),topRight:za(!l||a.top||a.right,i.topRight,0,s),bottomLeft:za(!l||a.bottom||a.left,i.bottomLeft,0,s),bottomRight:za(!l||a.bottom||a.right,i.bottomRight,0,s)}}function ble(e){const t=E6(e),n=t.right-t.left,r=t.bottom-t.top,o=mle(e,n/2,r/2),i=vle(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 G1(e,t,n,r){const o=t===null,i=n===null,a=e&&!(o&&i)&&E6(e,r);return a&&(o||zs(t,a.left,a.right))&&(i||zs(n,a.top,a.bottom))}function yle(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function xle(e,t){e.rect(t.x,t.y,t.w,t.h)}function q1(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 mc extends hs{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}=ble(this),a=yle(s.radius)?Qh:xle;t.save(),(s.w!==i.w||s.h!==i.h)&&(t.beginPath(),a(t,q1(s,n,i)),t.clip(),a(t,q1(i,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,q1(i,n)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,n,r){return G1(this,t,n,r)}inXRange(t,n){return G1(this,t,null,n)}inYRange(t,n){return G1(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}}Ne(mc,"id","bar"),Ne(mc,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Ne(mc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var wle=Object.freeze({__proto__:null,ArcElement:Fu,BarElement:mc,LineElement:ja,PointElement:gc});const SC=["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)"],IM=SC.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function R6(e){return SC[e%SC.length]}function P6(e){return IM[e%IM.length]}function Sle(e,t){return e.borderColor=R6(t),e.backgroundColor=P6(t),++t}function Cle(e,t){return e.backgroundColor=e.data.map(()=>R6(t++)),t}function _le(e,t){return e.backgroundColor=e.data.map(()=>P6(t++)),t}function Ele(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof Xl?t=Cle(n,t):o instanceof Oh?t=_le(n,t):o&&(t=Sle(n,t))}}function $M(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Rle(e){return e&&(e.borderColor||e.backgroundColor)}var Ple={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&&($M(r)||Rle(o)||i&&$M(i)))return;const s=Ele(e);r.forEach(s)}};function Ole(e,t,n,r,o){const i=o.samples||r;if(i>=n)return e.slice(t,t+n);const s=[],a=(n-2)/(i-2);let l=0;const c=t+n-1;let u=t,d,f,p,m,v;for(s[l++]=e[u],d=0;d<i-2;d++){let y=0,b=0,x;const E=Math.floor((d+1)*a)+1+t,R=Math.min(Math.floor((d+2)*a)+1,n)+t,P=R-E;for(x=E;x<R;x++)y+=e[x].x,b+=e[x].y;y/=P,b/=P;const O=Math.floor(d*a)+1+t,A=Math.min(Math.floor((d+1)*a)+1,n)+t,{x:D,y:I}=e[u];for(p=m=-1,x=O;x<A;x++)m=.5*Math.abs((D-y)*(e[x].y-I)-(D-e[x].x)*(b-I)),m>p&&(p=m,f=e[x],v=x);s[l++]=f,u=v}return s[l++]=e[c],s}function Ale(e,t,n,r){let o=0,i=0,s,a,l,c,u,d,f,p,m,v;const y=[],b=t+n-1,x=e[t].x,R=e[b].x-x;for(s=t;s<t+n;++s){a=e[s],l=(a.x-x)/R*r,c=a.y;const P=l|0;if(P===u)c<m?(m=c,d=s):c>v&&(v=c,f=s),o=(i*o+a.x)/++i;else{const O=s-1;if(!Pt(d)&&!Pt(f)){const A=Math.min(d,f),D=Math.max(d,f);A!==p&&A!==O&&y.push({...e[A],x:o}),D!==p&&D!==O&&y.push({...e[D],x:o})}s>0&&O!==p&&y.push(e[O]),y.push(a),u=P,i=0,m=v=c,d=f=p=s}}return y}function O6(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 NM(e){e.data.datasets.forEach(t=>{O6(t)})}function Tle(e,t){const n=t.length;let r=0,o;const{iScale:i}=e,{min:s,max:a,minDefined:l,maxDefined:c}=i.getUserBounds();return l&&(r=ir(Bs(t,i.axis,s).lo,0,n-1)),c?o=ir(Bs(t,i.axis,a).hi+1,r,n)-r:o=n-r,{start:r,count:o}}var Dle={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){NM(e);return}const r=e.width;e.data.datasets.forEach((o,i)=>{const{_data:s,indexAxis:a}=o,l=e.getDatasetMeta(i),c=s||o.data;if(xn([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:d,count:f}=Tle(l,c);const p=n.threshold||4*r;if(f<=p){O6(o);return}Pt(s)&&(o._data=c,delete o.data,Object.defineProperty(o,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(v){this._data=v}}));let m;switch(n.algorithm){case"lttb":m=Ole(c,d,f,r,n);break;case"min-max":m=Ale(c,d,f,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=m})},destroy(e){NM(e)}};function Mle(e,t,n){const r=e.segments,o=e.points,i=t.points,s=[];for(const a of r){let{start:l,end:c}=a;c=MR(l,c,o);const u=CC(n,o[l],o[c],a.loop);if(!t.segments){s.push({source:a,target:u,start:o[l],end:o[c]});continue}const d=u6(t,u);for(const f of d){const p=CC(n,i[f.start],i[f.end],f.loop),m=c6(a,o,p);for(const v of m)s.push({source:v,target:f,start:{[n]:kM(u,p,"start",Math.max)},end:{[n]:kM(u,p,"end",Math.min)}})}}return s}function CC(e,t,n,r){if(r)return;let o=t[e],i=n[e];return e==="angle"&&(o=wo(o),i=wo(i)),{property:e,start:o,end:i}}function Ile(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:s,end:a})=>{a=MR(s,a,o);const l=o[s],c=o[a];r!==null?(i.push({x:l.x,y:r}),i.push({x:c.x,y:r})):n!==null&&(i.push({x:n,y:l.y}),i.push({x:n,y:c.y}))}),i}function MR(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function kM(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function A6(e,t){let n=[],r=!1;return wn(e)?(r=!0,n=e):n=Ile(e,t),n.length?new ja({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function LM(e){return e&&e.fill!==!1}function $le(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(!Fn(o))return o;if(s=e[o],!s)return!1;if(s.visible)return o;i.push(o),o=s.fill}return!1}function Nle(e,t,n){const r=jle(e);if(Dt(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return Fn(o)&&Math.floor(o)===o?kle(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function kle(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function Lle(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Dt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function Fle(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Dt(e)?r=e.value:r=t.getBaseValue(),r}function jle(e){const t=e.options,n=t.fill;let r=st(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function zle(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,s=r.points,a=Ble(t,n);a.push(A6({x:null,y:t.bottom},r));for(let l=0;l<i.length;l++){const c=i[l];for(let u=c.start;u<=c.end;u++)Vle(o,s[u],a)}return new ja({points:o,options:{}})}function Ble(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 Vle(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:s,last:a,point:l}=Hle(i,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function Hle(e,t,n){const r=e.interpolate(t,n);if(!r)return{};const o=r[n],i=e.segments,s=e.points;let a=!1,l=!1;for(let c=0;c<i.length;c++){const u=i[c],d=s[u.start][n],f=s[u.end][n];if(zs(o,d,f)){a=o===d,l=o===f;break}}return{first:a,last:l,point:r}}class T6{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:Sn},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 Wle(e){const{chart:t,fill:n,line:r}=e;if(Fn(n))return Ule(t,n);if(n==="stack")return zle(e);if(n==="shape")return!0;const o=Gle(e);return o instanceof T6?o:A6(o,r)}function Ule(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Gle(e){return(e.scale||{}).getPointPositionForValue?Yle(e):qle(e)}function qle(e){const{scale:t={},fill:n}=e,r=Lle(n,t);if(Fn(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function Yle(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,s=Fle(n,t,i),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new T6({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 Y1(e,t,n){const r=Wle(t),{line:o,scale:i,axis:s}=t,a=o.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:d=c}=l||{};r&&o.points.length&&(dc(e,n),Kle(e,{line:o,target:r,above:u,below:d,area:n,scale:i,axis:s}),fc(e))}function Kle(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&&(FM(e,r,s.top),jM(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore(),e.save(),FM(e,r,s.bottom)),jM(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore()}function FM(e,t,n){const{segments:r,points:o}=t;let i=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:c}=a,u=o[l],d=o[MR(l,c,o)];i?(e.moveTo(u.x,u.y),i=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),s=!!t.pathSegment(e,a,{move:s}),s?e.closePath():e.lineTo(d.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function jM(e,t){const{line:n,target:r,property:o,color:i,scale:s}=t,a=Mle(n,r,o);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:f=i}={}}=l,p=r!==!0;e.save(),e.fillStyle=f,Xle(e,s,p&&CC(o,u,d)),e.beginPath();const m=!!n.pathSegment(e,l);let v;if(p){m?e.closePath():zM(e,r,d,o);const y=!!r.pathSegment(e,c,{move:m,reverse:!0});v=m&&y,v||zM(e,r,u,o)}e.closePath(),e.fill(v?"evenodd":"nonzero"),e.restore()}}function Xle(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 zM(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var Qle={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 ja&&(l={visible:e.isDatasetVisible(s),index:s,fill:Nle(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=$le(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&&Y1(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;LM(i)&&Y1(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!LM(r)||n.drawTime!=="beforeDatasetDraw"||Y1(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const BM=(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)}},Zle=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class VM extends hs{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=an(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=Xn(r.font),i=o.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=BM(r,i);let c,u;n.font=o.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,i,a,l)+10):(u=this.maxHeight,c=this._fitCols(s,o,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,o){const{ctx:i,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=o+a;let d=t;i.textAlign="left",i.textBaseline="middle";let f=-1,p=-u;return this.legendItems.forEach((m,v)=>{const y=r+n/2+i.measureText(m.text).width;(v===0||c[c.length-1]+y+2*a>s)&&(d+=u,c[c.length-(v>0?0:1)]=0,p+=u,f++),l[v]={left:0,top:p,row:f,width:y,height:o},c[c.length-1]+=y+a}),d}_fitCols(t,n,r,o){const{ctx:i,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=a,f=0,p=0,m=0,v=0;return this.legendItems.forEach((y,b)=>{const{itemWidth:x,itemHeight:E}=Jle(r,n,i,y,o);b>0&&p+E+2*a>u&&(d+=f+a,c.push({width:f,height:p}),m+=f+a,v++,f=p=0),l[b]={left:m,top:p,col:v,width:x,height:E},f=Math.max(f,x),p+=E+a}),d+=f,c.push({width:f,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,s=Yu(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=xr(r,this.left+o,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=xr(r,this.left+o,this.right-this.lineWidths[a])),c.top+=this.top+t+o,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+o}else{let a=0,l=xr(r,this.top+t+o,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=xr(r,this.top+t+o,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+o,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+o}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;dc(t,this),this._draw(),fc(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=t,a=In.color,l=Yu(t.rtl,this.left,this.width),c=Xn(s.font),{padding:u}=s,d=c.size,f=d/2;let p;this.drawTitle(),o.textAlign=l.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=c.string;const{boxWidth:m,boxHeight:v,itemHeight:y}=BM(s,d),b=function(O,A,D){if(isNaN(m)||m<=0||isNaN(v)||v<0)return;o.save();const I=st(D.lineWidth,1);if(o.fillStyle=st(D.fillStyle,a),o.lineCap=st(D.lineCap,"butt"),o.lineDashOffset=st(D.lineDashOffset,0),o.lineJoin=st(D.lineJoin,"miter"),o.lineWidth=I,o.strokeStyle=st(D.strokeStyle,a),o.setLineDash(st(D.lineDash,[])),s.usePointStyle){const L={radius:v*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:I},j=l.xPlus(O,m/2),z=A+f;Z4(o,L,j,z,s.pointStyleWidth&&m)}else{const L=A+Math.max((d-v)/2,0),j=l.leftForLtr(O,m),z=hc(D.borderRadius);o.beginPath(),Object.values(z).some(K=>K!==0)?Qh(o,{x:j,y:L,w:m,h:v,radius:z}):o.rect(j,L,m,v),o.fill(),I!==0&&o.stroke()}o.restore()},x=function(O,A,D){Dc(o,D.text,O,A+y/2,c,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},E=this.isHorizontal(),R=this._computeTitleHeight();E?p={x:xr(i,this.left+u,this.right-r[0]),y:this.top+u+R,line:0}:p={x:this.left+u,y:xr(i,this.top+R+u,this.bottom-n[0].height),line:0},s6(this.ctx,t.textDirection);const P=y+u;this.legendItems.forEach((O,A)=>{o.strokeStyle=O.fontColor,o.fillStyle=O.fontColor;const D=o.measureText(O.text).width,I=l.textAlign(O.textAlign||(O.textAlign=s.textAlign)),L=m+f+D;let j=p.x,z=p.y;l.setWidth(this.width),E?A>0&&j+L+u>this.right&&(z=p.y+=P,p.line++,j=p.x=xr(i,this.left+u,this.right-r[p.line])):A>0&&z+P>this.bottom&&(j=p.x=j+n[p.line].width+u,p.line++,z=p.y=xr(i,this.top+R+u,this.bottom-n[p.line].height));const K=l.x(j);if(b(K,z,O),j=xie(I,j+m+f,E?j+L:this.right,t.rtl),x(l.x(j),z,O),E)p.x+=L+u;else if(typeof O.text!="string"){const H=c.lineHeight;p.y+=D6(O,H)+u}else p.y+=P}),a6(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Xn(n.font),o=hr(n.padding);if(!n.display)return;const i=Yu(t.rtl,this.left,this.width),s=this.ctx,a=n.position,l=r.size/2,c=o.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=xr(t.align,d,this.right-f);else{const m=this.columnSizes.reduce((v,y)=>Math.max(v,y.height),0);u=c+xr(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const p=xr(a,d,d+f);s.textAlign=i.textAlign(CR(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Dc(s,n.text,p,u,r)}_computeTitleHeight(){const t=this.options.title,n=Xn(t.font),r=hr(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,o,i;if(zs(t,this.left,this.right)&&zs(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],zs(t,o.left,o.left+o.width)&&zs(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!nce(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=Zle(o,r);o&&!i&&an(n.onLeave,[t,o,this],this),this._hoveredItem=r,r&&!i&&an(n.onHover,[t,r,this],this)}else r&&an(n.onClick,[t,r,this],this)}}function Jle(e,t,n,r,o){const i=ece(r,e,t,n),s=tce(o,r,t.lineHeight);return{itemWidth:i,itemHeight:s}}function ece(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 tce(e,t,n){let r=e;return typeof t.text!="string"&&(r=D6(t,n)),r}function D6(e,t){const n=e.text?e.text.length:0;return t*n}function nce(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var rce={id:"legend",_element:VM,start(e,t,n){const r=e.legend=new VM({ctx:e.ctx,options:n,chart:e});wr.configure(e,r,n),wr.addBox(e,r)},stop(e){wr.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;wr.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,o=n.chart;o.isDatasetVisible(r)?(o.hide(r),t.hidden=!0):(o.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:o,color:i,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=hr(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:o||c.textAlign,borderRadius:s&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};let IR=class extends hs{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=wn(r.text)?r.text.length:1;this._padding=hr(r.padding);const i=o*Xn(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:r,bottom:o,right:i,options:s}=this,a=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=xr(a,r,i),d=n+t,c=i-r):(s.position==="left"?(u=r+t,d=xr(a,o,n),l=Cn*-.5):(u=i-t,d=xr(a,n,o),l=Cn*.5),c=o-n),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const r=Xn(n.font),i=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(i);Dc(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:CR(n.align),textBaseline:"middle",translation:[s,a]})}};function oce(e,t){const n=new IR({ctx:e.ctx,options:t,chart:e});wr.configure(e,n,t),wr.addBox(e,n),e.titleBlock=n}var ice={id:"title",_element:IR,start(e,t,n){oce(e,n)},stop(e){const t=e.titleBlock;wr.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;wr.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 Xm=new WeakMap;var sce={id:"subtitle",start(e,t,n){const r=new IR({ctx:e.ctx,options:n,chart:e});wr.configure(e,r,n),wr.addBox(e,r),Xm.set(e,r)},stop(e){wr.removeBox(e,Xm.get(e)),Xm.delete(e)},beforeUpdate(e,t,n){const r=Xm.get(e);wr.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 uh={average(e){if(!e.length)return!1;let t,n,r=0,o=0,i=0;for(t=0,n=e.length;t<n;++t){const s=e[t].element;if(s&&s.hasValue()){const a=s.tooltipPosition();r+=a.x,o+=a.y,++i}}return{x:r/i,y:o/i}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,o=Number.POSITIVE_INFINITY,i,s,a;for(i=0,s=e.length;i<s;++i){const l=e[i].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=mC(t,c);u<o&&(o=u,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function Fi(e,t){return t&&(wn(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Ms(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
251
+ `)>-1?e.split(`
252
+ `):e}function ace(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 HM(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:s,boxHeight:a}=t,l=Xn(t.bodyFont),c=Xn(t.titleFont),u=Xn(t.footerFont),d=i.length,f=o.length,p=r.length,m=hr(t.padding);let v=m.height,y=0,b=r.reduce((R,P)=>R+P.before.length+P.lines.length+P.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(v+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const R=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;v+=p*R+(b-p)*l.lineHeight+(b-1)*t.bodySpacing}f&&(v+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let x=0;const E=function(R){y=Math.max(y,n.measureText(R).width+x)};return n.save(),n.font=c.string,Qt(e.title,E),n.font=l.string,Qt(e.beforeBody.concat(e.afterBody),E),x=t.displayColors?s+2+t.boxPadding:0,Qt(r,R=>{Qt(R.before,E),Qt(R.lines,E),Qt(R.after,E)}),x=0,n.font=u.string,Qt(e.footer,E),n.restore(),y+=m.width,{width:y,height:v}}function lce(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function cce(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 uce(e,t,n,r){const{x:o,width:i}=n,{width:s,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=o<=(a+l)/2?"left":"right":o<=i/2?c="left":o>=s-i/2&&(c="right"),cce(c,e,t,n)&&(c="center"),c}function WM(e,t,n){const r=n.yAlign||t.yAlign||lce(e,n);return{xAlign:n.xAlign||t.xAlign||uce(e,t,n,r),yAlign:r}}function dce(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function fce(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function UM(e,t,n,r){const{caretSize:o,caretPadding:i,cornerRadius:s}=e,{xAlign:a,yAlign:l}=n,c=o+i,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=hc(s);let m=dce(t,a);const v=fce(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(u,f)+o:a==="right"&&(m+=Math.max(d,p)+o),{x:ir(m,0,r.width-t.width),y:ir(v,0,r.height-t.height)}}function Qm(e,t,n){const r=hr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function GM(e){return Fi([],Ms(e))}function hce(e,t,n){return ll(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function qM(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const M6={beforeTitle:Ps,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:Ps,beforeBody:Ps,beforeLabel:Ps,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 Pt(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:Ps,afterBody:Ps,beforeFooter:Ps,footer:Ps,afterFooter:Ps};function qr(e,t,n,r){const o=e[t].call(n,r);return typeof o>"u"?M6[t].call(n,r):o}var SS;let YM=(SS=class extends hs{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 d6(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=hce(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=qr(r,"beforeTitle",this,t),i=qr(r,"title",this,t),s=qr(r,"afterTitle",this,t);let a=[];return a=Fi(a,Ms(o)),a=Fi(a,Ms(i)),a=Fi(a,Ms(s)),a}getBeforeBody(t,n){return GM(qr(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return Qt(t,i=>{const s={before:[],lines:[],after:[]},a=qM(r,i);Fi(s.before,Ms(qr(a,"beforeLabel",this,i))),Fi(s.lines,qr(a,"label",this,i)),Fi(s.after,Ms(qr(a,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(t,n){return GM(qr(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=qr(r,"beforeFooter",this,t),i=qr(r,"footer",this,t),s=qr(r,"afterFooter",this,t);let a=[];return a=Fi(a,Ms(o)),a=Fi(a,Ms(i)),a=Fi(a,Ms(s)),a}_createItems(t){const n=this._active,r=this.chart.data,o=[],i=[],s=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(ace(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),Qt(a,u=>{const d=qM(t.callbacks,u);o.push(qr(d,"labelColor",this,u)),i.push(qr(d,"labelPointStyle",this,u)),s.push(qr(d,"labelTextColor",this,u))}),this.labelColors=o,this.labelPointStyles=i,this.labelTextColors=s,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),o=this._active;let i,s=[];if(!o.length)this.opacity!==0&&(i={opacity:0});else{const a=uh[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=HM(this,r),c=Object.assign({},a,l),u=WM(this.chart,r,c),d=UM(r,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,i={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,o){const i=this.getCaretPosition(t,r,o);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(t,n,r){const{xAlign:o,yAlign:i}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=hc(a),{x:f,y:p}=t,{width:m,height:v}=n;let y,b,x,E,R,P;return i==="center"?(R=p+v/2,o==="left"?(y=f,b=y-s,E=R+s,P=R-s):(y=f+m,b=y+s,E=R-s,P=R+s),x=y):(o==="left"?b=f+Math.max(l,u)+s:o==="right"?b=f+m-Math.max(c,d)-s:b=this.caretX,i==="top"?(E=p,R=E-s,y=b-s,x=b+s):(E=p+v,R=E+s,y=b+s,x=b-s),P=E),{x1:y,x2:b,x3:x,y1:E,y2:R,y3:P}}drawTitle(t,n,r){const o=this.title,i=o.length;let s,a,l;if(i){const c=Yu(r.rtl,this.x,this.width);for(t.x=Qm(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=Xn(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=s.string,l=0;l<i;++l)n.fillText(o[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+a,l+1===i&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,o,i){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=i,u=Xn(i.bodyFont),d=Qm(this,"left",i),f=o.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,m=n.y+p;if(i.usePointStyle){const v={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},y=o.leftForLtr(f,c)+c/2,b=m+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,_b(t,v,y,b),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,_b(t,v,y,b)}else{t.lineWidth=Dt(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 v=o.leftForLtr(f,c),y=o.leftForLtr(o.xPlus(f,1),c-2),b=hc(s.borderRadius);Object.values(b).some(x=>x!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,Qh(t,{x:v,y:m,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Qh(t,{x:y,y:m+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(v,m,c,l),t.strokeRect(v,m,c,l),t.fillStyle=s.backgroundColor,t.fillRect(y,m+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:o}=this,{bodySpacing:i,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=Xn(r.bodyFont);let f=d.lineHeight,p=0;const m=Yu(r.rtl,this.x,this.width),v=function(D){n.fillText(D,m.x(t.x+p),t.y+f/2),t.y+=f+i},y=m.textAlign(s);let b,x,E,R,P,O,A;for(n.textAlign=s,n.textBaseline="middle",n.font=d.string,t.x=Qm(this,y,r),n.fillStyle=r.bodyColor,Qt(this.beforeBody,v),p=a&&y!=="right"?s==="center"?c/2+u:c+2+u:0,R=0,O=o.length;R<O;++R){for(b=o[R],x=this.labelTextColors[R],n.fillStyle=x,Qt(b.before,v),E=b.lines,a&&E.length&&(this._drawColorBox(n,t,R,m,r),f=Math.max(d.lineHeight,l)),P=0,A=E.length;P<A;++P)v(E[P]),f=d.lineHeight;Qt(b.after,v)}p=0,f=d.lineHeight,Qt(this.afterBody,v),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let s,a;if(i){const l=Yu(r.rtl,this.x,this.width);for(t.x=Qm(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=Xn(r.footerFont),n.fillStyle=r.footerColor,n.font=s.string,a=0;a<i;++a)n.fillText(o[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,n,r,o){const{xAlign:i,yAlign:s}=this,{x:a,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:m}=hc(o.cornerRadius);n.fillStyle=o.backgroundColor,n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.beginPath(),n.moveTo(a+d,l),s==="top"&&this.drawCaret(t,n,r,o),n.lineTo(a+c-f,l),n.quadraticCurveTo(a+c,l,a+c,l+f),s==="center"&&i==="right"&&this.drawCaret(t,n,r,o),n.lineTo(a+c,l+u-m),n.quadraticCurveTo(a+c,l+u,a+c-m,l+u),s==="bottom"&&this.drawCaret(t,n,r,o),n.lineTo(a+p,l+u),n.quadraticCurveTo(a,l+u,a,l+u-p),s==="center"&&i==="left"&&this.drawCaret(t,n,r,o),n.lineTo(a,l+d),n.quadraticCurveTo(a,l,a+d,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=uh[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=HM(this,t),l=Object.assign({},s,this._size),c=WM(n,t,l),u=UM(t,l,c,n);(o._to!==u.x||i._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const o={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=hr(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),s6(t,n.textDirection),i.y+=s.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),a6(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,o=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),i=!xb(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||!xb(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=uh[i.position].call(this,t,n);return s!==!1&&(r!==s.x||o!==s.y)}},Ne(SS,"positioners",uh),SS);var I6={id:"tooltip",_element:YM,positioners:uh,afterInit(e,t,n){n&&(e.tooltip=new YM({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:M6},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"]},pce=Object.freeze({__proto__:null,Colors:Ple,Decimation:Dle,Filler:Qle,Legend:rce,SubTitle:sce,Title:ice,Tooltip:I6});const gce=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function mce(e,t,n,r){const o=e.indexOf(t);if(o===-1)return gce(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const vce=(e,t)=>e===null?null:ir(Math.round(e),0,t);function KM(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Ob extends cl{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(Pt(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:mce(r,t,st(n,t),this._addedLabels),vce(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 KM.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}}Ne(Ob,"id","category"),Ne(Ob,"defaults",{ticks:{callback:KM}});function bce(e,t){const n=[],{bounds:o,step:i,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=e,p=i||1,m=u-1,{min:v,max:y}=t,b=!Pt(s),x=!Pt(a),E=!Pt(c),R=(y-v)/(d+1);let P=VD((y-v)/m/p)*p,O,A,D,I;if(P<1e-14&&!b&&!x)return[{value:v},{value:y}];I=Math.ceil(y/P)-Math.floor(v/P),I>m&&(P=VD(I*P/m/p)*p),Pt(l)||(O=Math.pow(10,l),P=Math.ceil(P*O)/O),o==="ticks"?(A=Math.floor(v/P)*P,D=Math.ceil(y/P)*P):(A=v,D=y),b&&x&&i&&hie((a-s)/i,P/1e3)?(I=Math.round(Math.min((a-s)/P,u)),P=(a-s)/I,A=s,D=a):E?(A=b?s:A,D=x?a:D,I=c-1,P=(D-A)/I):(I=(D-A)/P,Eh(I,Math.round(I),P/1e3)?I=Math.round(I):I=Math.ceil(I));const L=Math.max(HD(P),HD(A));O=Math.pow(10,Pt(l)?L:l),A=Math.round(A*O)/O,D=Math.round(D*O)/O;let j=0;for(b&&(f&&A!==s?(n.push({value:s}),A<s&&j++,Eh(Math.round((A+j*P)*O)/O,s,XM(s,R,e))&&j++):A<s&&j++);j<I;++j){const z=Math.round((A+j*P)*O)/O;if(x&&z>a)break;n.push({value:z})}return x&&f&&D!==a?n.length&&Eh(n[n.length-1].value,a,XM(a,R,e))?n[n.length-1].value=a:n.push({value:a}):(!x||D===a)&&n.push({value:D}),n}function XM(e,t,{horizontal:n,minRotation:r}){const o=Si(r),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*t*(""+e).length;return Math.min(t/i,s)}class Ab extends cl{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 Pt(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=Zi(o),c=Zi(i);l<0&&c<0?a(0):l>0&&c>0&&s(0)}if(o===i){let l=i===0?1:Math.abs(i*.05);a(i+l),t||s(o-l)}this.min=o,this.max=i}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,o;return r?(o=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),n=n||11),n&&(o=Math.min(n,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const o={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,s=bce(o,i);return t.bounds==="ticks"&&H4(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 ig(t,this.chart.options.locale,this.options.ticks.format)}}class Td extends Ab{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Fn(t)?t:0,this.max=Fn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Si(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}}Ne(Td,"id","linear"),Ne(Td,"defaults",{ticks:{callback:K0.formatters.numeric}});const Jh=e=>Math.floor(Fa(e)),Il=(e,t)=>Math.pow(10,Jh(e)+t);function QM(e){return e/Math.pow(10,Jh(e))===1}function ZM(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function yce(e,t){const n=t-e;let r=Jh(n);for(;ZM(e,t,r)>10;)r++;for(;ZM(e,t,r)<10;)r--;return Math.min(r,Jh(e))}function xce(e,{min:t,max:n}){t=bo(e.min,t);const r=[],o=Jh(t);let i=yce(t,n),s=i<0?Math.pow(10,Math.abs(i)):1;const a=Math.pow(10,i),l=o>i?Math.pow(10,o):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,i)),f=bo(e.min,Math.round((l+u+d*Math.pow(10,i))*s)/s);for(;f<n;)r.push({value:f,major:QM(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(i++,d=2,s=i>=0?1:s),f=Math.round((l+u+d*Math.pow(10,i))*s)/s;const p=bo(e.max,f);return r.push({value:p,major:QM(p),significand:d}),r}class Dd extends cl{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Ab.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Fn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Fn(t)?Math.max(0,t):null,this.max=Fn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Fn(this._userMin)&&(this.min=t===Il(this.min,0)?Il(this.min,-1):Il(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(Il(r,-1)),s(Il(o,1)))),r<=0&&i(Il(o,-1)),o<=0&&s(Il(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=xce(n,this);return t.bounds==="ticks"&&H4(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":ig(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Fa(t),this._valueRange=Fa(this.max)-Fa(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Fa(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Ne(Dd,"id","logarithmic"),Ne(Dd,"defaults",{ticks:{callback:K0.formatters.logarithmic,major:{enabled:!0}}});function _C(e){const t=e.ticks;if(t.display&&e.display){const n=hr(t.backdropPadding);return st(t.font&&t.font.size,In.font.size)+n.height}return 0}function wce(e,t,n){return n=wn(n)?n:[n],{w:Tie(e,t.string,n),h:n.length*t.lineHeight}}function JM(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 Sce(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?Cn/i:0;for(let l=0;l<i;l++){const c=s.setContext(e.getPointLabelContext(l));o[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+o[l],a),d=Xn(c.font),f=wce(e.ctx,d,e._pointLabels[l]);r[l]=f;const p=wo(e.getIndexAngle(l)+a),m=Math.round(wR(p)),v=JM(m,u.x,f.w,0,180),y=JM(m,u.y,f.h,90,270);Cce(n,t,p,v,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=Rce(e,r,o)}function Cce(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 _ce(e,t,n){const r=e.drawingArea,{extra:o,additionalAngle:i,padding:s,size:a}=n,l=e.getPointPosition(t,r+o+s,i),c=Math.round(wR(wo(l.angle+Gn))),u=Ace(l.y,a.h,c),d=Pce(c),f=Oce(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function Ece(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(Vs({x:n,y:r},t)||Vs({x:n,y:i},t)||Vs({x:o,y:r},t)||Vs({x:o,y:i},t))}function Rce(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:s,display:a}=i.pointLabels,l={extra:_C(i)/2,additionalAngle:s?Cn/o:0};let c;for(let u=0;u<o;u++){l.padding=n[u],l.size=t[u];const d=_ce(e,u,l);r.push(d),a==="auto"&&(d.visible=Ece(d,c),d.visible&&(c=d))}return r}function Pce(e){return e===0||e===180?"center":e<180?"left":"right"}function Oce(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function Ace(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function Tce(e,t,n){const{left:r,top:o,right:i,bottom:s}=n,{backdropColor:a}=t;if(!Pt(a)){const l=hc(t.borderRadius),c=hr(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=o-c.top,f=i-r+c.width,p=s-o+c.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),Qh(e,{x:u,y:d,w:f,h:p,radius:l}),e.fill()):e.fillRect(u,d,f,p)}}function Dce(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));Tce(n,s,i);const a=Xn(s.font),{x:l,y:c,textAlign:u}=i;Dc(n,e._pointLabels[o],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function $6(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,Sn);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 Mce(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(),$6(e,n,s,r),i.closePath(),i.stroke(),i.restore())}function Ice(e,t,n){return ll(e,{label:n,index:t,type:"pointLabel"})}class dh extends Ab{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=hr(_C(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=Fn(t)&&!isNaN(t)?t:0,this.max=Fn(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/_C(this.options))}generateTickLabels(t){Ab.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,r)=>{const o=an(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?Sce(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=Sn/(this._pointLabels.length||1),r=this.options.startAngle||0;return wo(t*n+Si(r))}getDistanceFromCenterForValue(t){if(Pt(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(Pt(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 Ice(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const o=this.getIndexAngle(t)-Gn+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(),$6(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:r,grid:o,border:i}=n,s=this._pointLabels.length;let a,l,c;if(n.pointLabels.display&&Dce(this,s),o.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),p=o.setContext(f),m=i.setContext(f);Mce(this,p,l,s,m)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,r=n.ticks;if(!r.display)return;const o=this.getIndexAngle(0);let i,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=Xn(c.font);if(i=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=hr(c.backdropPadding);t.fillRect(-s/2-d.left,-i-u.size/2-d.top,s+d.width,u.size+d.height)}Dc(t,a.label,0,-i,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Ne(dh,"id","radialLinear"),Ne(dh,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:K0.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),Ne(dh,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Ne(dh,"descriptors",{angleLines:{_fallback:"grid"}});const Q0={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}},to=Object.keys(Q0);function eI(e,t){return e-t}function tI(e,t){if(Pt(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)),Fn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(o&&(s=o==="week"&&(Pd(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function nI(e,t,n,r){const o=to.length;for(let i=to.indexOf(e);i<o-1;++i){const s=Q0[to[i]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return to[i]}return to[o-1]}function $ce(e,t,n,r,o){for(let i=to.length-1;i>=to.indexOf(n);i--){const s=to[i];if(Q0[s].common&&e._adapter.diff(o,r,s)>=t-1)return s}return to[n?to.indexOf(n):0]}function Nce(e){for(let t=to.indexOf(e)+1,n=to.length;t<n;++t)if(Q0[to[t]].common)return to[t]}function rI(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=SR(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function kce(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 oI(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:kce(e,r,o,n)}class ep extends cl{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 Gse._date(t.adapters.date);o.init(n),_h(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:tI(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:o,max:i,minDefined:s,maxDefined:a}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(o=Math.min(o,c.min)),!a&&!isNaN(c.max)&&(i=Math.max(i,c.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),o=Fn(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=Fn(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=vie(o,i,s);return this._unit=n.unit||(r.autoSkip?nI(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):$ce(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Nce(this._unit),this.initOffsets(o),t.reverse&&a.reverse(),oI(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=ir(n,0,s),r=ir(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||nI(i.minUnit,n,r,this._getLabelCapacity(n)),a=st(o.ticks.stepSize,1),l=s==="week"?i.isoWeekday:!1,c=Pd(l)||l===!0,u={};let d=n,f,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(r,n,s)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+s);const m=o.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;f<r;f=+t.add(f,a,s),p++)rI(u,f,m);return(f===r||o.bounds==="ticks"||p===1)&&rI(u,f,m),Object.keys(u).sort(eI).map(v=>+v)}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 an(s,[t,n,r],this);const a=i.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=r[n],p=c&&d&&f&&f.major;return this._adapter.format(t,o||(p?d:u))}generateTickLabels(t){let n,r,o;for(n=0,r=t.length;n<r;++n)o=t[n],o.label=this._tickFormatFunction(o.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,o=Si(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,oI(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(tI(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return G4(t.sort(eI))}}Ne(ep,"id","time"),Ne(ep,"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 Zm(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}=Bs(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}=Bs(e,"time",t)),{time:i,pos:a}=e[r],{time:s,pos:l}=e[o]);const c=s-i;return c?a+(l-a)*(t-i)/c:a}class EC extends ep{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=Zm(n,this.min),this._tableRange=Zm(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,o=[],i=[];let s,a,l,c,u;for(s=0,a=t.length;s<a;++s)c=t[s],c>=n&&c<=r&&o.push(c);if(o.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(s=0,a=o.length;s<a;++s)u=o[s+1],l=o[s-1],c=o[s],Math.round((u+l)/2)!==c&&i.push({time:c,pos:s/(a-1)});return i}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((o,i)=>o-i)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Zm(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return Zm(this._table,r*this._tableRange+this._minPos,!0)}}Ne(EC,"id","timeseries"),Ne(EC,"defaults",ep.defaults);var Lce=Object.freeze({__proto__:null,CategoryScale:Ob,LinearScale:Td,LogarithmicScale:Dd,RadialLinearScale:dh,TimeScale:ep,TimeSeriesScale:EC});const Fce=[Use,wle,pce,Lce];class Za{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let o=0;o<this._n&&o<32;o++){const i=n[o],s=t+i,a=Math.abs(t)<Math.abs(i)?t-(s-i):i-(s-t);a&&(n[r++]=a),t=s}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,o,i,s=0;if(n>0){for(s=t[--n];n>0&&(r=s,o=t[--n],s=r+o,i=o-(s-r),!i););n>0&&(i<0&&t[n-1]<0||i>0&&t[n-1]>0)&&(o=i*2,r=s+o,o==r-s&&(s=r))}return s}}function*jce(e){for(const t of e)yield*t}function N6(e){return Array.from(jce(e))}function ju(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(o);++r<o;)i[r]=e+r*n;return i}var Je=1e-6,$R=1e-12,Rt=Math.PI,kn=Rt/2,iI=Rt/4,Ao=Rt*2,Mr=180/Rt,ln=Rt/180,jt=Math.abs,Kd=Math.atan,ns=Math.atan2,ht=Math.cos,Jm=Math.ceil,k6=Math.exp,Tb=Math.log,K1=Math.pow,ct=Math.sin,Jo=Math.sign||function(e){return e>0?1:e<0?-1:0},Lr=Math.sqrt,NR=Math.tan;function L6(e){return e>1?0:e<-1?Rt:Math.acos(e)}function ni(e){return e>1?kn:e<-1?-kn:Math.asin(e)}function or(){}function Db(e,t){e&&aI.hasOwnProperty(e.type)&&aI[e.type](e,t)}var sI={Feature:function(e,t){Db(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)Db(n[r].geometry,t)}},aI={Sphere:function(e,t){t.sphere()},Point:function(e,t){e=e.coordinates,t.point(e[0],e[1],e[2])},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)e=n[r],t.point(e[0],e[1],e[2])},LineString:function(e,t){RC(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)RC(n[r],t,0)},Polygon:function(e,t){lI(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)lI(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)Db(n[r],t)}};function RC(e,t,n){var r=-1,o=e.length-n,i;for(t.lineStart();++r<o;)i=e[r],t.point(i[0],i[1],i[2]);t.lineEnd()}function lI(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)RC(e[n],t,1);t.polygonEnd()}function Vl(e,t){e&&sI.hasOwnProperty(e.type)?sI[e.type](e,t):Db(e,t)}function PC(e){return[ns(e[1],e[0]),ni(e[2])]}function Md(e){var t=e[0],n=e[1],r=ht(n);return[r*ht(t),r*ct(t),ct(n)]}function ev(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Mb(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function X1(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function tv(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function OC(e){var t=Lr(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function AC(e,t){function n(r,o){return r=e(r,o),t(r[0],r[1])}return e.invert&&t.invert&&(n.invert=function(r,o){return r=t.invert(r,o),r&&e.invert(r[0],r[1])}),n}function TC(e,t){return jt(e)>Rt&&(e-=Math.round(e/Ao)*Ao),[e,t]}TC.invert=TC;function F6(e,t,n){return(e%=Ao)?t||n?AC(uI(e),dI(t,n)):uI(e):t||n?dI(t,n):TC}function cI(e){return function(t,n){return t+=e,jt(t)>Rt&&(t-=Math.round(t/Ao)*Ao),[t,n]}}function uI(e){var t=cI(e);return t.invert=cI(-e),t}function dI(e,t){var n=ht(e),r=ct(e),o=ht(t),i=ct(t);function s(a,l){var c=ht(l),u=ht(a)*c,d=ct(a)*c,f=ct(l),p=f*n+u*r;return[ns(d*o-p*i,u*n-f*r),ni(p*o+d*i)]}return s.invert=function(a,l){var c=ht(l),u=ht(a)*c,d=ct(a)*c,f=ct(l),p=f*o-d*i;return[ns(d*o+f*i,u*n+p*r),ni(p*n-u*r)]},s}function zce(e){e=F6(e[0]*ln,e[1]*ln,e.length>2?e[2]*ln:0);function t(n){return n=e(n[0]*ln,n[1]*ln),n[0]*=Mr,n[1]*=Mr,n}return t.invert=function(n){return n=e.invert(n[0]*ln,n[1]*ln),n[0]*=Mr,n[1]*=Mr,n},t}function Bce(e,t,n,r,o,i){if(n){var s=ht(t),a=ct(t),l=r*n;o==null?(o=t+r*Ao,i=t-l/2):(o=fI(s,o),i=fI(s,i),(r>0?o<i:o>i)&&(o+=r*Ao));for(var c,u=o;r>0?u>i:u<i;u-=l)c=PC([s,-a*ht(u),-a*ct(u)]),e.point(c[0],c[1])}}function fI(e,t){t=Md(t),t[0]-=e,OC(t);var n=L6(-t[1]);return((-t[2]<0?-n:n)+Ao-Je)%Ao}function j6(){var e=[],t;return{point:function(n,r,o){t.push([n,r,o])},lineStart:function(){e.push(t=[])},lineEnd:or,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function eb(e,t){return jt(e[0]-t[0])<Je&&jt(e[1]-t[1])<Je}function nv(e,t,n,r){this.x=e,this.z=t,this.o=n,this.e=r,this.v=!1,this.n=this.p=null}function z6(e,t,n,r,o){var i=[],s=[],a,l;if(e.forEach(function(m){if(!((v=m.length-1)<=0)){var v,y=m[0],b=m[v],x;if(eb(y,b)){if(!y[2]&&!b[2]){for(o.lineStart(),a=0;a<v;++a)o.point((y=m[a])[0],y[1]);o.lineEnd();return}b[0]+=2*Je}i.push(x=new nv(y,m,null,!0)),s.push(x.o=new nv(y,null,x,!1)),i.push(x=new nv(b,m,null,!1)),s.push(x.o=new nv(b,null,x,!0))}}),!!i.length){for(s.sort(t),hI(i),hI(s),a=0,l=s.length;a<l;++a)s[a].e=n=!n;for(var c=i[0],u,d;;){for(var f=c,p=!0;f.v;)if((f=f.n)===c)return;u=f.z,o.lineStart();do{if(f.v=f.o.v=!0,f.e){if(p)for(a=0,l=u.length;a<l;++a)o.point((d=u[a])[0],d[1]);else r(f.x,f.n.x,1,o);f=f.n}else{if(p)for(u=f.p.z,a=u.length-1;a>=0;--a)o.point((d=u[a])[0],d[1]);else r(f.x,f.p.x,-1,o);f=f.p}f=f.o,u=f.z,p=!p}while(!f.v);o.lineEnd()}}}function hI(e){if(t=e.length){for(var t,n=0,r=e[0],o;++n<t;)r.n=o=e[n],o.p=r,r=o;r.n=o=e[0],o.p=r}}function Q1(e){return jt(e[0])<=Rt?e[0]:Jo(e[0])*((jt(e[0])+Rt)%Ao-Rt)}function B6(e,t){var n=Q1(t),r=t[1],o=ct(r),i=[ct(n),-ht(n),0],s=0,a=0,l=new Za;o===1?r=kn+Je:o===-1&&(r=-kn-Je);for(var c=0,u=e.length;c<u;++c)if(f=(d=e[c]).length)for(var d,f,p=d[f-1],m=Q1(p),v=p[1]/2+iI,y=ct(v),b=ht(v),x=0;x<f;++x,m=R,y=O,b=A,p=E){var E=d[x],R=Q1(E),P=E[1]/2+iI,O=ct(P),A=ht(P),D=R-m,I=D>=0?1:-1,L=I*D,j=L>Rt,z=y*O;if(l.add(ns(z*I*ct(L),b*A+z*ht(L))),s+=j?D+I*Ao:D,j^m>=n^R>=n){var K=Mb(Md(p),Md(E));OC(K);var H=Mb(i,K);OC(H);var k=(j^D>=0?-1:1)*ni(H[2]);(r>k||r===k&&(K[0]||K[1]))&&(a+=j^D>=0?1:-1)}}return(s<-Je||s<Je&&l<-$R)^a&1}function V6(e,t,n,r){return function(o){var i=t(o),s=j6(),a=t(s),l=!1,c,u,d,f={point:p,lineStart:v,lineEnd:y,polygonStart:function(){f.point=b,f.lineStart=x,f.lineEnd=E,u=[],c=[]},polygonEnd:function(){f.point=p,f.lineStart=v,f.lineEnd=y,u=N6(u);var R=B6(c,r);u.length?(l||(o.polygonStart(),l=!0),z6(u,Hce,R,n,o)):R&&(l||(o.polygonStart(),l=!0),o.lineStart(),n(null,null,1,o),o.lineEnd()),l&&(o.polygonEnd(),l=!1),u=c=null},sphere:function(){o.polygonStart(),o.lineStart(),n(null,null,1,o),o.lineEnd(),o.polygonEnd()}};function p(R,P){e(R,P)&&o.point(R,P)}function m(R,P){i.point(R,P)}function v(){f.point=m,i.lineStart()}function y(){f.point=p,i.lineEnd()}function b(R,P){d.push([R,P]),a.point(R,P)}function x(){a.lineStart(),d=[]}function E(){b(d[0][0],d[0][1]),a.lineEnd();var R=a.clean(),P=s.result(),O,A=P.length,D,I,L;if(d.pop(),c.push(d),d=null,!!A){if(R&1){if(I=P[0],(D=I.length-1)>0){for(l||(o.polygonStart(),l=!0),o.lineStart(),O=0;O<D;++O)o.point((L=I[O])[0],L[1]);o.lineEnd()}return}A>1&&R&2&&P.push(P.pop().concat(P.shift())),u.push(P.filter(Vce))}}return f}}function Vce(e){return e.length>1}function Hce(e,t){return((e=e.x)[0]<0?e[1]-kn-Je:kn-e[1])-((t=t.x)[0]<0?t[1]-kn-Je:kn-t[1])}const pI=V6(function(){return!0},Wce,Gce,[-Rt,-kn]);function Wce(e){var t=NaN,n=NaN,r=NaN,o;return{lineStart:function(){e.lineStart(),o=1},point:function(i,s){var a=i>0?Rt:-Rt,l=jt(i-t);jt(l-Rt)<Je?(e.point(t,n=(n+s)/2>0?kn:-kn),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(i,n),o=0):r!==a&&l>=Rt&&(jt(t-r)<Je&&(t-=r*Je),jt(i-a)<Je&&(i-=a*Je),n=Uce(t,n,i,s),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),o=0),e.point(t=i,n=s),r=a},lineEnd:function(){e.lineEnd(),t=n=NaN},clean:function(){return 2-o}}}function Uce(e,t,n,r){var o,i,s=ct(e-n);return jt(s)>Je?Kd((ct(t)*(i=ht(r))*ct(n)-ct(r)*(o=ht(t))*ct(e))/(o*i*s)):(t+r)/2}function Gce(e,t,n,r){var o;if(e==null)o=n*kn,r.point(-Rt,o),r.point(0,o),r.point(Rt,o),r.point(Rt,0),r.point(Rt,-o),r.point(0,-o),r.point(-Rt,-o),r.point(-Rt,0),r.point(-Rt,o);else if(jt(e[0]-t[0])>Je){var i=e[0]<t[0]?Rt:-Rt;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(t[0],t[1])}function qce(e){var t=ht(e),n=2*ln,r=t>0,o=jt(t)>Je;function i(u,d,f,p){Bce(p,e,n,f,u,d)}function s(u,d){return ht(u)*ht(d)>t}function a(u){var d,f,p,m,v;return{lineStart:function(){m=p=!1,v=1},point:function(y,b){var x=[y,b],E,R=s(y,b),P=r?R?0:c(y,b):R?c(y+(y<0?Rt:-Rt),b):0;if(!d&&(m=p=R)&&u.lineStart(),R!==p&&(E=l(d,x),(!E||eb(d,E)||eb(x,E))&&(x[2]=1)),R!==p)v=0,R?(u.lineStart(),E=l(x,d),u.point(E[0],E[1])):(E=l(d,x),u.point(E[0],E[1],2),u.lineEnd()),d=E;else if(o&&d&&r^R){var O;!(P&f)&&(O=l(x,d,!0))&&(v=0,r?(u.lineStart(),u.point(O[0][0],O[0][1]),u.point(O[1][0],O[1][1]),u.lineEnd()):(u.point(O[1][0],O[1][1]),u.lineEnd(),u.lineStart(),u.point(O[0][0],O[0][1],3)))}R&&(!d||!eb(d,x))&&u.point(x[0],x[1]),d=x,p=R,f=P},lineEnd:function(){p&&u.lineEnd(),d=null},clean:function(){return v|(m&&p)<<1}}}function l(u,d,f){var p=Md(u),m=Md(d),v=[1,0,0],y=Mb(p,m),b=ev(y,y),x=y[0],E=b-x*x;if(!E)return!f&&u;var R=t*b/E,P=-t*x/E,O=Mb(v,y),A=tv(v,R),D=tv(y,P);X1(A,D);var I=O,L=ev(A,I),j=ev(I,I),z=L*L-j*(ev(A,A)-1);if(!(z<0)){var K=Lr(z),H=tv(I,(-L-K)/j);if(X1(H,A),H=PC(H),!f)return H;var k=u[0],W=d[0],B=u[1],U=d[1],q;W<k&&(q=k,k=W,W=q);var $=W-k,Y=jt($-Rt)<Je,X=Y||$<Je;if(!Y&&U<B&&(q=B,B=U,U=q),X?Y?B+U>0^H[1]<(jt(H[0]-k)<Je?B:U):B<=H[1]&&H[1]<=U:$>Rt^(k<=H[0]&&H[0]<=W)){var M=tv(I,(-L+K)/j);return X1(M,A),[H,PC(M)]}}}function c(u,d){var f=r?e:Rt-e,p=0;return u<-f?p|=1:u>f&&(p|=2),d<-f?p|=4:d>f&&(p|=8),p}return V6(s,a,i,r?[0,-e]:[-Rt,e-Rt])}function Yce(e,t,n,r,o,i){var s=e[0],a=e[1],l=t[0],c=t[1],u=0,d=1,f=l-s,p=c-a,m;if(m=n-s,!(!f&&m>0)){if(m/=f,f<0){if(m<u)return;m<d&&(d=m)}else if(f>0){if(m>d)return;m>u&&(u=m)}if(m=o-s,!(!f&&m<0)){if(m/=f,f<0){if(m>d)return;m>u&&(u=m)}else if(f>0){if(m<u)return;m<d&&(d=m)}if(m=r-a,!(!p&&m>0)){if(m/=p,p<0){if(m<u)return;m<d&&(d=m)}else if(p>0){if(m>d)return;m>u&&(u=m)}if(m=i-a,!(!p&&m<0)){if(m/=p,p<0){if(m>d)return;m>u&&(u=m)}else if(p>0){if(m<u)return;m<d&&(d=m)}return u>0&&(e[0]=s+u*f,e[1]=a+u*p),d<1&&(t[0]=s+d*f,t[1]=a+d*p),!0}}}}}var fh=1e9,rv=-fh;function Kce(e,t,n,r){function o(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function i(c,u,d,f){var p=0,m=0;if(c==null||(p=s(c,d))!==(m=s(u,d))||l(c,u)<0^d>0)do f.point(p===0||p===3?e:n,p>1?r:t);while((p=(p+d+4)%4)!==m);else f.point(u[0],u[1])}function s(c,u){return jt(c[0]-e)<Je?u>0?0:3:jt(c[0]-n)<Je?u>0?2:1:jt(c[1]-t)<Je?u>0?1:0:u>0?3:2}function a(c,u){return l(c.x,u.x)}function l(c,u){var d=s(c,1),f=s(u,1);return d!==f?d-f:d===0?u[1]-c[1]:d===1?c[0]-u[0]:d===2?c[1]-u[1]:u[0]-c[0]}return function(c){var u=c,d=j6(),f,p,m,v,y,b,x,E,R,P,O,A={point:D,lineStart:z,lineEnd:K,polygonStart:L,polygonEnd:j};function D(k,W){o(k,W)&&u.point(k,W)}function I(){for(var k=0,W=0,B=p.length;W<B;++W)for(var U=p[W],q=1,$=U.length,Y=U[0],X,M,oe=Y[0],te=Y[1];q<$;++q)X=oe,M=te,Y=U[q],oe=Y[0],te=Y[1],M<=r?te>r&&(oe-X)*(r-M)>(te-M)*(e-X)&&++k:te<=r&&(oe-X)*(r-M)<(te-M)*(e-X)&&--k;return k}function L(){u=d,f=[],p=[],O=!0}function j(){var k=I(),W=O&&k,B=(f=N6(f)).length;(W||B)&&(c.polygonStart(),W&&(c.lineStart(),i(null,null,1,c),c.lineEnd()),B&&z6(f,a,k,i,c),c.polygonEnd()),u=c,f=p=m=null}function z(){A.point=H,p&&p.push(m=[]),P=!0,R=!1,x=E=NaN}function K(){f&&(H(v,y),b&&R&&d.rejoin(),f.push(d.result())),A.point=D,R&&u.lineEnd()}function H(k,W){var B=o(k,W);if(p&&m.push([k,W]),P)v=k,y=W,b=B,P=!1,B&&(u.lineStart(),u.point(k,W));else if(B&&R)u.point(k,W);else{var U=[x=Math.max(rv,Math.min(fh,x)),E=Math.max(rv,Math.min(fh,E))],q=[k=Math.max(rv,Math.min(fh,k)),W=Math.max(rv,Math.min(fh,W))];Yce(U,q,e,t,n,r)?(R||(u.lineStart(),u.point(U[0],U[1])),u.point(q[0],q[1]),B||u.lineEnd(),O=!1):B&&(u.lineStart(),u.point(k,W),O=!1)}x=k,E=W,R=B}return A}}var DC,MC,tb,nb,Id={sphere:or,point:or,lineStart:Xce,lineEnd:or,polygonStart:or,polygonEnd:or};function Xce(){Id.point=Zce,Id.lineEnd=Qce}function Qce(){Id.point=Id.lineEnd=or}function Zce(e,t){e*=ln,t*=ln,MC=e,tb=ct(t),nb=ht(t),Id.point=Jce}function Jce(e,t){e*=ln,t*=ln;var n=ct(t),r=ht(t),o=jt(e-MC),i=ht(o),s=ct(o),a=r*s,l=nb*n-tb*r*i,c=tb*n+nb*r*i;DC.add(ns(Lr(a*a+l*l),c)),MC=e,tb=n,nb=r}function eue(e){return DC=new Za,Vl(e,Id),+DC}var IC=[null,null],tue={type:"LineString",coordinates:IC};function $C(e,t){return IC[0]=e,IC[1]=t,eue(tue)}var gI={Feature:function(e,t){return Ib(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)if(Ib(n[r].geometry,t))return!0;return!1}},mI={Sphere:function(){return!0},Point:function(e,t){return vI(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(vI(n[r],t))return!0;return!1},LineString:function(e,t){return bI(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(bI(n[r],t))return!0;return!1},Polygon:function(e,t){return yI(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(yI(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)if(Ib(n[r],t))return!0;return!1}};function Ib(e,t){return e&&mI.hasOwnProperty(e.type)?mI[e.type](e,t):!1}function vI(e,t){return $C(e,t)===0}function bI(e,t){for(var n,r,o,i=0,s=e.length;i<s;i++){if(r=$C(e[i],t),r===0||i>0&&(o=$C(e[i],e[i-1]),o>0&&n<=o&&r<=o&&(n+r-o)*(1-Math.pow((n-r)/o,2))<$R*o))return!0;n=r}return!1}function yI(e,t){return!!B6(e.map(nue),H6(t))}function nue(e){return e=e.map(H6),e.pop(),e}function H6(e){return[e[0]*ln,e[1]*ln]}function rue(e,t){return(e&&gI.hasOwnProperty(e.type)?gI[e.type]:Ib)(e,t)}function xI(e,t,n){var r=ju(e,t-Je,n).concat(t);return function(o){return r.map(function(i){return[o,i]})}}function wI(e,t,n){var r=ju(e,t-Je,n).concat(t);return function(o){return r.map(function(i){return[i,o]})}}function W6(){var e,t,n,r,o,i,s,a,l=10,c=l,u=90,d=360,f,p,m,v,y=2.5;function b(){return{type:"MultiLineString",coordinates:x()}}function x(){return ju(Jm(r/u)*u,n,u).map(m).concat(ju(Jm(a/d)*d,s,d).map(v)).concat(ju(Jm(t/l)*l,e,l).filter(function(E){return jt(E%u)>Je}).map(f)).concat(ju(Jm(i/c)*c,o,c).filter(function(E){return jt(E%d)>Je}).map(p))}return b.lines=function(){return x().map(function(E){return{type:"LineString",coordinates:E}})},b.outline=function(){return{type:"Polygon",coordinates:[m(r).concat(v(s).slice(1),m(n).reverse().slice(1),v(a).reverse().slice(1))]}},b.extent=function(E){return arguments.length?b.extentMajor(E).extentMinor(E):b.extentMinor()},b.extentMajor=function(E){return arguments.length?(r=+E[0][0],n=+E[1][0],a=+E[0][1],s=+E[1][1],r>n&&(E=r,r=n,n=E),a>s&&(E=a,a=s,s=E),b.precision(y)):[[r,a],[n,s]]},b.extentMinor=function(E){return arguments.length?(t=+E[0][0],e=+E[1][0],i=+E[0][1],o=+E[1][1],t>e&&(E=t,t=e,e=E),i>o&&(E=i,i=o,o=E),b.precision(y)):[[t,i],[e,o]]},b.step=function(E){return arguments.length?b.stepMajor(E).stepMinor(E):b.stepMinor()},b.stepMajor=function(E){return arguments.length?(u=+E[0],d=+E[1],b):[u,d]},b.stepMinor=function(E){return arguments.length?(l=+E[0],c=+E[1],b):[l,c]},b.precision=function(E){return arguments.length?(y=+E,f=xI(i,o,90),p=wI(t,e,y),m=xI(a,s,90),v=wI(r,n,y),b):y},b.extentMajor([[-180,-90+Je],[180,90-Je]]).extentMinor([[-180,-80-Je],[180,80+Je]])}function oue(){return W6()()}const NC=e=>e;var Z1=new Za,kC=new Za,U6,G6,LC,FC,Oa={point:or,lineStart:or,lineEnd:or,polygonStart:function(){Oa.lineStart=iue,Oa.lineEnd=aue},polygonEnd:function(){Oa.lineStart=Oa.lineEnd=Oa.point=or,Z1.add(jt(kC)),kC=new Za},result:function(){var e=Z1/2;return Z1=new Za,e}};function iue(){Oa.point=sue}function sue(e,t){Oa.point=q6,U6=LC=e,G6=FC=t}function q6(e,t){kC.add(FC*e-LC*t),LC=e,FC=t}function aue(){q6(U6,G6)}const SI=Oa;var $d=1/0,$b=$d,tp=-$d,Nb=tp,lue={point:cue,lineStart:or,lineEnd:or,polygonStart:or,polygonEnd:or,result:function(){var e=[[$d,$b],[tp,Nb]];return tp=Nb=-($b=$d=1/0),e}};function cue(e,t){e<$d&&($d=e),e>tp&&(tp=e),t<$b&&($b=t),t>Nb&&(Nb=t)}const kb=lue;var jC=0,zC=0,hh=0,Lb=0,Fb=0,zu=0,BC=0,VC=0,ph=0,Y6,K6,qi,Yi,xi={point:Mc,lineStart:CI,lineEnd:_I,polygonStart:function(){xi.lineStart=fue,xi.lineEnd=hue},polygonEnd:function(){xi.point=Mc,xi.lineStart=CI,xi.lineEnd=_I},result:function(){var e=ph?[BC/ph,VC/ph]:zu?[Lb/zu,Fb/zu]:hh?[jC/hh,zC/hh]:[NaN,NaN];return jC=zC=hh=Lb=Fb=zu=BC=VC=ph=0,e}};function Mc(e,t){jC+=e,zC+=t,++hh}function CI(){xi.point=uue}function uue(e,t){xi.point=due,Mc(qi=e,Yi=t)}function due(e,t){var n=e-qi,r=t-Yi,o=Lr(n*n+r*r);Lb+=o*(qi+e)/2,Fb+=o*(Yi+t)/2,zu+=o,Mc(qi=e,Yi=t)}function _I(){xi.point=Mc}function fue(){xi.point=pue}function hue(){X6(Y6,K6)}function pue(e,t){xi.point=X6,Mc(Y6=qi=e,K6=Yi=t)}function X6(e,t){var n=e-qi,r=t-Yi,o=Lr(n*n+r*r);Lb+=o*(qi+e)/2,Fb+=o*(Yi+t)/2,zu+=o,o=Yi*e-qi*t,BC+=o*(qi+e),VC+=o*(Yi+t),ph+=o*3,Mc(qi=e,Yi=t)}const EI=xi;function Q6(e){this._context=e}Q6.prototype={_radius:4.5,pointRadius:function(e){return this._radius=e,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){this._line===0&&this._context.closePath(),this._point=NaN},point:function(e,t){switch(this._point){case 0:{this._context.moveTo(e,t),this._point=1;break}case 1:{this._context.lineTo(e,t);break}default:{this._context.moveTo(e+this._radius,t),this._context.arc(e,t,this._radius,0,Ao);break}}},result:or};var HC=new Za,J1,Z6,J6,gh,mh,jb={point:or,lineStart:function(){jb.point=gue},lineEnd:function(){J1&&eL(Z6,J6),jb.point=or},polygonStart:function(){J1=!0},polygonEnd:function(){J1=null},result:function(){var e=+HC;return HC=new Za,e}};function gue(e,t){jb.point=eL,Z6=gh=e,J6=mh=t}function eL(e,t){gh-=e,mh-=t,HC.add(Lr(gh*gh+mh*mh)),gh=e,mh=t}const RI=jb;let PI,zb,OI,AI;class TI{constructor(t){this._append=t==null?tL:mue(t),this._radius=4.5,this._=""}pointRadius(t){return this._radius=+t,this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){this._line===0&&(this._+="Z"),this._point=NaN}point(t,n){switch(this._point){case 0:{this._append`M${t},${n}`,this._point=1;break}case 1:{this._append`L${t},${n}`;break}default:{if(this._append`M${t},${n}`,this._radius!==OI||this._append!==zb){const r=this._radius,o=this._;this._="",this._append`m0,${r}a${r},${r} 0 1,1 0,${-2*r}a${r},${r} 0 1,1 0,${2*r}z`,OI=r,zb=this._append,AI=this._,this._=o}this._+=AI;break}}}result(){const t=this._;return this._="",t.length?t:null}}function tL(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function mue(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return tL;if(t!==PI){const n=10**t;PI=t,zb=function(o){let i=1;this._+=o[0];for(const s=o.length;i<s;++i)this._+=Math.round(arguments[i]*n)/n+o[i]}}return zb}function DI(e,t){let n=3,r=4.5,o,i;function s(a){return a&&(typeof r=="function"&&i.pointRadius(+r.apply(this,arguments)),Vl(a,o(i))),i.result()}return s.area=function(a){return Vl(a,o(SI)),SI.result()},s.measure=function(a){return Vl(a,o(RI)),RI.result()},s.bounds=function(a){return Vl(a,o(kb)),kb.result()},s.centroid=function(a){return Vl(a,o(EI)),EI.result()},s.projection=function(a){return arguments.length?(o=a==null?(e=null,NC):(e=a).stream,s):e},s.context=function(a){return arguments.length?(i=a==null?(t=null,new TI(n)):new Q6(t=a),typeof r!="function"&&i.pointRadius(r),s):t},s.pointRadius=function(a){return arguments.length?(r=typeof a=="function"?a:(i.pointRadius(+a),+a),s):r},s.digits=function(a){if(!arguments.length)return n;if(a==null)n=null;else{const l=Math.floor(a);if(!(l>=0))throw new RangeError(`invalid digits: ${a}`);n=l}return t===null&&(i=new TI(n)),s},s.projection(e).digits(n).context(t)}function kR(e){return function(t){var n=new WC;for(var r in e)n[r]=e[r];return n.stream=t,n}}function WC(){}WC.prototype={constructor:WC,point:function(e,t){this.stream.point(e,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function LR(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Vl(n,e.stream(kb)),t(kb.result()),r!=null&&e.clipExtent(r),e}function FR(e,t,n){return LR(e,function(r){var o=t[1][0]-t[0][0],i=t[1][1]-t[0][1],s=Math.min(o/(r[1][0]-r[0][0]),i/(r[1][1]-r[0][1])),a=+t[0][0]+(o-s*(r[1][0]+r[0][0]))/2,l=+t[0][1]+(i-s*(r[1][1]+r[0][1]))/2;e.scale(150*s).translate([a,l])},n)}function nL(e,t,n){return FR(e,[[0,0],t],n)}function rL(e,t,n){return LR(e,function(r){var o=+t,i=o/(r[1][0]-r[0][0]),s=(o-i*(r[1][0]+r[0][0]))/2,a=-i*r[0][1];e.scale(150*i).translate([s,a])},n)}function oL(e,t,n){return LR(e,function(r){var o=+t,i=o/(r[1][1]-r[0][1]),s=-i*r[0][0],a=(o-i*(r[1][1]+r[0][1]))/2;e.scale(150*i).translate([s,a])},n)}var MI=16,vue=ht(30*ln);function II(e,t){return+t?yue(e,t):bue(e)}function bue(e){return kR({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function yue(e,t){function n(r,o,i,s,a,l,c,u,d,f,p,m,v,y){var b=c-r,x=u-o,E=b*b+x*x;if(E>4*t&&v--){var R=s+f,P=a+p,O=l+m,A=Lr(R*R+P*P+O*O),D=ni(O/=A),I=jt(jt(O)-1)<Je||jt(i-d)<Je?(i+d)/2:ns(P,R),L=e(I,D),j=L[0],z=L[1],K=j-r,H=z-o,k=x*K-b*H;(k*k/E>t||jt((b*K+x*H)/E-.5)>.3||s*f+a*p+l*m<vue)&&(n(r,o,i,s,a,l,j,z,I,R/=A,P/=A,O,v,y),y.point(j,z),n(j,z,I,R,P,O,c,u,d,f,p,m,v,y))}}return function(r){var o,i,s,a,l,c,u,d,f,p,m,v,y={point:b,lineStart:x,lineEnd:R,polygonStart:function(){r.polygonStart(),y.lineStart=P},polygonEnd:function(){r.polygonEnd(),y.lineStart=x}};function b(D,I){D=e(D,I),r.point(D[0],D[1])}function x(){d=NaN,y.point=E,r.lineStart()}function E(D,I){var L=Md([D,I]),j=e(D,I);n(d,f,u,p,m,v,d=j[0],f=j[1],u=D,p=L[0],m=L[1],v=L[2],MI,r),r.point(d,f)}function R(){y.point=b,r.lineEnd()}function P(){x(),y.point=O,y.lineEnd=A}function O(D,I){E(o=D,I),i=d,s=f,a=p,l=m,c=v,y.point=E}function A(){n(d,f,u,p,m,v,i,s,o,a,l,c,MI,r),y.lineEnd=R,R()}return y}}var xue=kR({point:function(e,t){this.stream.point(e*ln,t*ln)}});function wue(e){return kR({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Sue(e,t,n,r,o){function i(s,a){return s*=r,a*=o,[t+e*s,n-e*a]}return i.invert=function(s,a){return[(s-t)/e*r,(n-a)/e*o]},i}function $I(e,t,n,r,o,i){if(!i)return Sue(e,t,n,r,o);var s=ht(i),a=ct(i),l=s*e,c=a*e,u=s/e,d=a/e,f=(a*n-s*t)/e,p=(a*t+s*n)/e;function m(v,y){return v*=r,y*=o,[l*v-c*y+t,n-c*v-l*y]}return m.invert=function(v,y){return[r*(u*v-d*y+f),o*(p-d*v-u*y)]},m}function Qs(e){return iL(function(){return e})()}function iL(e){var t,n=150,r=480,o=250,i=0,s=0,a=0,l=0,c=0,u,d=0,f=1,p=1,m=null,v=pI,y=null,b,x,E,R=NC,P=.5,O,A,D,I,L;function j(k){return D(k[0]*ln,k[1]*ln)}function z(k){return k=D.invert(k[0],k[1]),k&&[k[0]*Mr,k[1]*Mr]}j.stream=function(k){return I&&L===k?I:I=xue(wue(u)(v(O(R(L=k)))))},j.preclip=function(k){return arguments.length?(v=k,m=void 0,H()):v},j.postclip=function(k){return arguments.length?(R=k,y=b=x=E=null,H()):R},j.clipAngle=function(k){return arguments.length?(v=+k?qce(m=k*ln):(m=null,pI),H()):m*Mr},j.clipExtent=function(k){return arguments.length?(R=k==null?(y=b=x=E=null,NC):Kce(y=+k[0][0],b=+k[0][1],x=+k[1][0],E=+k[1][1]),H()):y==null?null:[[y,b],[x,E]]},j.scale=function(k){return arguments.length?(n=+k,K()):n},j.translate=function(k){return arguments.length?(r=+k[0],o=+k[1],K()):[r,o]},j.center=function(k){return arguments.length?(i=k[0]%360*ln,s=k[1]%360*ln,K()):[i*Mr,s*Mr]},j.rotate=function(k){return arguments.length?(a=k[0]%360*ln,l=k[1]%360*ln,c=k.length>2?k[2]%360*ln:0,K()):[a*Mr,l*Mr,c*Mr]},j.angle=function(k){return arguments.length?(d=k%360*ln,K()):d*Mr},j.reflectX=function(k){return arguments.length?(f=k?-1:1,K()):f<0},j.reflectY=function(k){return arguments.length?(p=k?-1:1,K()):p<0},j.precision=function(k){return arguments.length?(O=II(A,P=k*k),H()):Lr(P)},j.fitExtent=function(k,W){return FR(j,k,W)},j.fitSize=function(k,W){return nL(j,k,W)},j.fitWidth=function(k,W){return rL(j,k,W)},j.fitHeight=function(k,W){return oL(j,k,W)};function K(){var k=$I(n,0,0,f,p,d).apply(null,t(i,s)),W=$I(n,r-k[0],o-k[1],f,p,d);return u=F6(a,l,c),A=AC(t,W),D=AC(u,A),O=II(A,P),H()}function H(){return I=L=null,j}return function(){return t=e.apply(this,arguments),j.invert=t.invert&&z,K()}}function jR(e){var t=0,n=Rt/3,r=iL(e),o=r(t,n);return o.parallels=function(i){return arguments.length?r(t=i[0]*ln,n=i[1]*ln):[t*Mr,n*Mr]},o}function Cue(e){var t=ht(e);function n(r,o){return[r*t,ct(o)/t]}return n.invert=function(r,o){return[r/t,ni(o*t)]},n}function _ue(e,t){var n=ct(e),r=(n+ct(t))/2;if(jt(r)<Je)return Cue(e);var o=1+n*(2*r-n),i=Lr(o)/r;function s(a,l){var c=Lr(o-2*r*ct(l))/r;return[c*ct(a*=r),i-c*ht(a)]}return s.invert=function(a,l){var c=i-l,u=ns(a,jt(c))*Jo(c);return c*r<0&&(u-=Rt*Jo(a)*Jo(c)),[u/r,ni((o-(a*a+c*c)*r*r)/(2*r))]},s}function Bb(){return jR(_ue).scale(155.424).center([0,33.6442])}function sL(){return Bb().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Eue(e){var t=e.length;return{point:function(n,r){for(var o=-1;++o<t;)e[o].point(n,r)},sphere:function(){for(var n=-1;++n<t;)e[n].sphere()},lineStart:function(){for(var n=-1;++n<t;)e[n].lineStart()},lineEnd:function(){for(var n=-1;++n<t;)e[n].lineEnd()},polygonStart:function(){for(var n=-1;++n<t;)e[n].polygonStart()},polygonEnd:function(){for(var n=-1;++n<t;)e[n].polygonEnd()}}}function Rue(){var e,t,n=sL(),r,o=Bb().rotate([154,0]).center([-2,58.5]).parallels([55,65]),i,s=Bb().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,l,c={point:function(f,p){l=[f,p]}};function u(f){var p=f[0],m=f[1];return l=null,r.point(p,m),l||(i.point(p,m),l)||(a.point(p,m),l)}u.invert=function(f){var p=n.scale(),m=n.translate(),v=(f[0]-m[0])/p,y=(f[1]-m[1])/p;return(y>=.12&&y<.234&&v>=-.425&&v<-.214?o:y>=.166&&y<.234&&v>=-.214&&v<-.115?s:n).invert(f)},u.stream=function(f){return e&&t===f?e:e=Eue([n.stream(t=f),o.stream(f),s.stream(f)])},u.precision=function(f){return arguments.length?(n.precision(f),o.precision(f),s.precision(f),d()):n.precision()},u.scale=function(f){return arguments.length?(n.scale(f),o.scale(f*.35),s.scale(f),u.translate(n.translate())):n.scale()},u.translate=function(f){if(!arguments.length)return n.translate();var p=n.scale(),m=+f[0],v=+f[1];return r=n.translate(f).clipExtent([[m-.455*p,v-.238*p],[m+.455*p,v+.238*p]]).stream(c),i=o.translate([m-.307*p,v+.201*p]).clipExtent([[m-.425*p+Je,v+.12*p+Je],[m-.214*p-Je,v+.234*p-Je]]).stream(c),a=s.translate([m-.205*p,v+.212*p]).clipExtent([[m-.214*p+Je,v+.166*p+Je],[m-.115*p-Je,v+.234*p-Je]]).stream(c),d()},u.fitExtent=function(f,p){return FR(u,f,p)},u.fitSize=function(f,p){return nL(u,f,p)},u.fitWidth=function(f,p){return rL(u,f,p)},u.fitHeight=function(f,p){return oL(u,f,p)};function d(){return e=t=null,u}return u.scale(1070)}function aL(e){return function(t,n){var r=ht(t),o=ht(n),i=e(r*o);return i===1/0?[2,0]:[i*o*ct(t),i*ct(n)]}}function ag(e){return function(t,n){var r=Lr(t*t+n*n),o=e(r),i=ct(o),s=ht(o);return[ns(t*i,r*s),ni(r&&n*i/r)]}}var lL=aL(function(e){return Lr(2/(1+e))});lL.invert=ag(function(e){return 2*ni(e/2)});function Pue(){return Qs(lL).scale(124.75).clipAngle(180-.001)}var cL=aL(function(e){return(e=L6(e))&&e/ct(e)});cL.invert=ag(function(e){return e});function Oue(){return Qs(cL).scale(79.4188).clipAngle(180-.001)}function Z0(e,t){return[e,Tb(NR((kn+t)/2))]}Z0.invert=function(e,t){return[e,2*Kd(k6(t))-kn]};function Aue(){return uL(Z0).scale(961/Ao)}function uL(e){var t=Qs(e),n=t.center,r=t.scale,o=t.translate,i=t.clipExtent,s=null,a,l,c;t.scale=function(d){return arguments.length?(r(d),u()):r()},t.translate=function(d){return arguments.length?(o(d),u()):o()},t.center=function(d){return arguments.length?(n(d),u()):n()},t.clipExtent=function(d){return arguments.length?(d==null?s=a=l=c=null:(s=+d[0][0],a=+d[0][1],l=+d[1][0],c=+d[1][1]),u()):s==null?null:[[s,a],[l,c]]};function u(){var d=Rt*r(),f=t(zce(t.rotate()).invert([0,0]));return i(s==null?[[f[0]-d,f[1]-d],[f[0]+d,f[1]+d]]:e===Z0?[[Math.max(f[0]-d,s),a],[Math.min(f[0]+d,l),c]]:[[s,Math.max(f[1]-d,a)],[l,Math.min(f[1]+d,c)]])}return u()}function ov(e){return NR((kn+e)/2)}function Tue(e,t){var n=ht(e),r=e===t?ct(e):Tb(n/ht(t))/Tb(ov(t)/ov(e)),o=n*K1(ov(e),r)/r;if(!r)return Z0;function i(s,a){o>0?a<-kn+Je&&(a=-kn+Je):a>kn-Je&&(a=kn-Je);var l=o/K1(ov(a),r);return[l*ct(r*s),o-l*ht(r*s)]}return i.invert=function(s,a){var l=o-a,c=Jo(r)*Lr(s*s+l*l),u=ns(s,jt(l))*Jo(l);return l*r<0&&(u-=Rt*Jo(s)*Jo(l)),[u/r,2*Kd(K1(o/c,1/r))-kn]},i}function Due(){return jR(Tue).scale(109.5).parallels([30,30])}function Vb(e,t){return[e,t]}Vb.invert=Vb;function Mue(){return Qs(Vb).scale(152.63)}function Iue(e,t){var n=ht(e),r=e===t?ct(e):(n-ht(t))/(t-e),o=n/r+e;if(jt(r)<Je)return Vb;function i(s,a){var l=o-a,c=r*s;return[l*ct(c),o-l*ht(c)]}return i.invert=function(s,a){var l=o-a,c=ns(s,jt(l))*Jo(l);return l*r<0&&(c-=Rt*Jo(s)*Jo(l)),[c/r,o-Jo(r)*Lr(s*s+l*l)]},i}function $ue(){return jR(Iue).scale(131.154).center([0,13.9389])}var Ah=1.340264,Th=-.081106,Dh=893e-6,Mh=.003796,Hb=Lr(3)/2,Nue=12;function dL(e,t){var n=ni(Hb*ct(t)),r=n*n,o=r*r*r;return[e*ht(n)/(Hb*(Ah+3*Th*r+o*(7*Dh+9*Mh*r))),n*(Ah+Th*r+o*(Dh+Mh*r))]}dL.invert=function(e,t){for(var n=t,r=n*n,o=r*r*r,i=0,s,a,l;i<Nue&&(a=n*(Ah+Th*r+o*(Dh+Mh*r))-t,l=Ah+3*Th*r+o*(7*Dh+9*Mh*r),n-=s=a/l,r=n*n,o=r*r*r,!(jt(s)<$R));++i);return[Hb*e*(Ah+3*Th*r+o*(7*Dh+9*Mh*r))/ht(n),ni(ct(n)/Hb)]};function kue(){return Qs(dL).scale(177.158)}function fL(e,t){var n=ht(t),r=ht(e)*n;return[n*ct(e)/r,ct(t)/r]}fL.invert=ag(Kd);function Lue(){return Qs(fL).scale(144.049).clipAngle(60)}function hL(e,t){var n=t*t,r=n*n;return[e*(.8707-.131979*n+r*(-.013791+r*(.003971*n-.001529*r))),t*(1.007226+n*(.015085+r*(-.044475+.028874*n-.005916*r)))]}hL.invert=function(e,t){var n=t,r=25,o;do{var i=n*n,s=i*i;n-=o=(n*(1.007226+i*(.015085+s*(-.044475+.028874*i-.005916*s)))-t)/(1.007226+i*(.015085*3+s*(-.044475*7+.028874*9*i-.005916*11*s)))}while(jt(o)>Je&&--r>0);return[e/(.8707+(i=n*n)*(-.131979+i*(-.013791+i*i*i*(.003971-.001529*i)))),n]};function Fue(){return Qs(hL).scale(175.295)}function pL(e,t){return[ht(t)*ct(e),ct(t)]}pL.invert=ag(ni);function jue(){return Qs(pL).scale(249.5).clipAngle(90+Je)}function gL(e,t){var n=ht(t),r=1+ht(e)*n;return[n*ct(e)/r,ct(t)/r]}gL.invert=ag(function(e){return 2*Kd(e)});function zue(){return Qs(gL).scale(250).clipAngle(142)}function mL(e,t){return[Tb(NR((kn+t)/2)),-e]}mL.invert=function(e,t){return[-t,2*Kd(k6(e))-kn]};function Bue(){var e=uL(mL),t=e.center,n=e.rotate;return e.center=function(r){return arguments.length?t([-r[1],r[0]]):(r=t(),[r[1],-r[0]])},e.rotate=function(r){return arguments.length?n([r[0],r[1],r.length>2?r[2]+90:90]):(r=n(),[r[0],r[1],r[2]-90])},n([0,0,90]).scale(159.155)}function qt(e){for(var t=e.length/6|0,n=new Array(t),r=0;r<t;)n[r]="#"+e.slice(r*6,++r*6);return n}function J0(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function zR(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Xd(){}var Ic=.7,Nd=1/Ic,Ku="\\s*([+-]?\\d+)\\s*",np="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ji="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Vue=/^#([0-9a-f]{3,8})$/,Hue=new RegExp(`^rgb\\(${Ku},${Ku},${Ku}\\)$`),Wue=new RegExp(`^rgb\\(${Ji},${Ji},${Ji}\\)$`),Uue=new RegExp(`^rgba\\(${Ku},${Ku},${Ku},${np}\\)$`),Gue=new RegExp(`^rgba\\(${Ji},${Ji},${Ji},${np}\\)$`),que=new RegExp(`^hsl\\(${np},${Ji},${Ji}\\)$`),Yue=new RegExp(`^hsla\\(${np},${Ji},${Ji},${np}\\)$`),NI={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};J0(Xd,BR,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:kI,formatHex:kI,formatHex8:Kue,formatHsl:Xue,formatRgb:LI,toString:LI});function kI(){return this.rgb().formatHex()}function Kue(){return this.rgb().formatHex8()}function Xue(){return bL(this).formatHsl()}function LI(){return this.rgb().formatRgb()}function BR(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Vue.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?FI(t):n===3?new Sr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?iv(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?iv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Hue.exec(e))?new Sr(t[1],t[2],t[3],1):(t=Wue.exec(e))?new Sr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Uue.exec(e))?iv(t[1],t[2],t[3],t[4]):(t=Gue.exec(e))?iv(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=que.exec(e))?BI(t[1],t[2]/100,t[3]/100,1):(t=Yue.exec(e))?BI(t[1],t[2]/100,t[3]/100,t[4]):NI.hasOwnProperty(e)?FI(NI[e]):e==="transparent"?new Sr(NaN,NaN,NaN,0):null}function FI(e){return new Sr(e>>16&255,e>>8&255,e&255,1)}function iv(e,t,n,r){return r<=0&&(e=t=n=NaN),new Sr(e,t,n,r)}function vL(e){return e instanceof Xd||(e=BR(e)),e?(e=e.rgb(),new Sr(e.r,e.g,e.b,e.opacity)):new Sr}function rp(e,t,n,r){return arguments.length===1?vL(e):new Sr(e,t,n,r??1)}function Sr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}J0(Sr,rp,zR(Xd,{brighter(e){return e=e==null?Nd:Math.pow(Nd,e),new Sr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ic:Math.pow(Ic,e),new Sr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Sr(vc(this.r),vc(this.g),vc(this.b),Wb(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:jI,formatHex:jI,formatHex8:Que,formatRgb:zI,toString:zI}));function jI(){return`#${Ql(this.r)}${Ql(this.g)}${Ql(this.b)}`}function Que(){return`#${Ql(this.r)}${Ql(this.g)}${Ql(this.b)}${Ql((isNaN(this.opacity)?1:this.opacity)*255)}`}function zI(){const e=Wb(this.opacity);return`${e===1?"rgb(":"rgba("}${vc(this.r)}, ${vc(this.g)}, ${vc(this.b)}${e===1?")":`, ${e})`}`}function Wb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function vc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ql(e){return e=vc(e),(e<16?"0":"")+e.toString(16)}function BI(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new wi(e,t,n,r)}function bL(e){if(e instanceof wi)return new wi(e.h,e.s,e.l,e.opacity);if(e instanceof Xd||(e=BR(e)),!e)return new wi;if(e instanceof wi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,l=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=l<.5?i+o:2-i-o,s*=60):a=l>0&&l<1?0:s,new wi(s,a,l,e.opacity)}function Zue(e,t,n,r){return arguments.length===1?bL(e):new wi(e,t,n,r??1)}function wi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}J0(wi,Zue,zR(Xd,{brighter(e){return e=e==null?Nd:Math.pow(Nd,e),new wi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ic:Math.pow(Ic,e),new wi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Sr(ew(e>=240?e-240:e+120,o,r),ew(e,o,r),ew(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new wi(VI(this.h),sv(this.s),sv(this.l),Wb(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Wb(this.opacity);return`${e===1?"hsl(":"hsla("}${VI(this.h)}, ${sv(this.s)*100}%, ${sv(this.l)*100}%${e===1?")":`, ${e})`}`}}));function VI(e){return e=(e||0)%360,e<0?e+360:e}function sv(e){return Math.max(0,Math.min(1,e||0))}function ew(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Jue=Math.PI/180,ede=180/Math.PI;var yL=-.14861,VR=1.78277,HR=-.29227,ey=-.90649,op=1.97294,HI=op*ey,WI=op*VR,UI=VR*HR-ey*yL;function tde(e){if(e instanceof bc)return new bc(e.h,e.s,e.l,e.opacity);e instanceof Sr||(e=vL(e));var t=e.r/255,n=e.g/255,r=e.b/255,o=(UI*r+HI*t-WI*n)/(UI+HI-WI),i=r-o,s=(op*(n-o)-HR*i)/ey,a=Math.sqrt(s*s+i*i)/(op*o*(1-o)),l=a?Math.atan2(s,i)*ede-120:NaN;return new bc(l<0?l+360:l,a,o,e.opacity)}function rs(e,t,n,r){return arguments.length===1?tde(e):new bc(e,t,n,r??1)}function bc(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}J0(bc,rs,zR(Xd,{brighter(e){return e=e==null?Nd:Math.pow(Nd,e),new bc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ic:Math.pow(Ic,e),new bc(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Jue,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),o=Math.sin(e);return new Sr(255*(t+n*(yL*r+VR*o)),255*(t+n*(HR*r+ey*o)),255*(t+n*(op*r)),this.opacity)}}));function nde(e,t,n,r,o){var i=e*e,s=i*e;return((1-3*e+3*i-s)*t+(4-6*i+3*s)*n+(1+3*e+3*i-3*s)*r+s*o)/6}function rde(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),o=e[r],i=e[r+1],s=r>0?e[r-1]:2*o-i,a=r<t-1?e[r+2]:2*i-o;return nde((n-r/t)*t,s,o,i,a)}}const WR=e=>()=>e;function xL(e,t){return function(n){return e+n*t}}function ode(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function ide(e,t){var n=t-e;return n?xL(e,n>180||n<-180?n-360*Math.round(n/360):n):WR(isNaN(e)?t:e)}function sde(e){return(e=+e)==1?Xu:function(t,n){return n-t?ode(t,n,e):WR(isNaN(t)?n:t)}}function Xu(e,t){var n=t-e;return n?xL(e,n):WR(isNaN(e)?t:e)}(function e(t){var n=sde(t);function r(o,i){var s=n((o=rp(o)).r,(i=rp(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),c=Xu(o.opacity,i.opacity);return function(u){return o.r=s(u),o.g=a(u),o.b=l(u),o.opacity=c(u),o+""}}return r.gamma=e,r})(1);function ade(e){return function(t){var n=t.length,r=new Array(n),o=new Array(n),i=new Array(n),s,a;for(s=0;s<n;++s)a=rp(t[s]),r[s]=a.r||0,o[s]=a.g||0,i[s]=a.b||0;return r=e(r),o=e(o),i=e(i),a.opacity=1,function(l){return a.r=r(l),a.g=o(l),a.b=i(l),a+""}}}var lde=ade(rde);function wL(e){return function t(n){n=+n;function r(o,i){var s=e((o=rs(o)).h,(i=rs(i)).h),a=Xu(o.s,i.s),l=Xu(o.l,i.l),c=Xu(o.opacity,i.opacity);return function(u){return o.h=s(u),o.s=a(u),o.l=l(Math.pow(u,n)),o.opacity=c(u),o+""}}return r.gamma=t,r}(1)}wL(ide);var UR=wL(Xu);const dn=e=>lde(e[e.length-1]);var cde=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(qt);const ude=dn(cde);var dde=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(qt);const fde=dn(dde);var hde=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(qt);const pde=dn(hde);var gde=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(qt);const mde=dn(gde);var vde=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(qt);const bde=dn(vde);var yde=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(qt);const xde=dn(yde);var wde=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(qt);const Sde=dn(wde);var Cde=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(qt);const _de=dn(Cde);var Ede=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(qt);const Rde=dn(Ede);var Pde=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(qt);const Ode=dn(Pde);var Ade=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(qt);const Tde=dn(Ade);var Dde=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(qt);const Mde=dn(Dde);var Ide=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(qt);const $de=dn(Ide);var Nde=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(qt);const kde=dn(Nde);var Lde=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(qt);const Fde=dn(Lde);var jde=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(qt);const zde=dn(jde);var Bde=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(qt);const Vde=dn(Bde);var Hde=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(qt);const Wde=dn(Hde);var Ude=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(qt);const Gde=dn(Ude);var qde=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(qt);const Yde=dn(qde);var Kde=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(qt);const Xde=dn(Kde);var Qde=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(qt);const Zde=dn(Qde);var Jde=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(qt);const efe=dn(Jde);var tfe=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(qt);const nfe=dn(tfe);var rfe=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(qt);const ofe=dn(rfe);var ife=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(qt);const sfe=dn(ife);var afe=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(qt);const lfe=dn(afe);function cfe(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(-4.54-e*(35.34-e*(2381.73-e*(6402.7-e*(7024.72-e*2710.57)))))))+", "+Math.max(0,Math.min(255,Math.round(32.49+e*(170.73+e*(52.82-e*(131.46-e*(176.58-e*67.37)))))))+", "+Math.max(0,Math.min(255,Math.round(81.24+e*(442.36-e*(2482.43-e*(6167.24-e*(6614.94-e*2475.67)))))))+")"}const ufe=UR(rs(300,.5,0),rs(-240,.5,1));var dfe=UR(rs(-100,.75,.35),rs(80,1.5,.8)),ffe=UR(rs(260,.75,.35),rs(80,1.5,.8)),av=rs();function hfe(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return av.h=360*e-100,av.s=1.5-1.5*t,av.l=.8-.9*t,av+""}var lv=rp(),pfe=Math.PI/3,gfe=Math.PI*2/3;function mfe(e){var t;return e=(.5-e)*Math.PI,lv.r=255*(t=Math.sin(e))*t,lv.g=255*(t=Math.sin(e+pfe))*t,lv.b=255*(t=Math.sin(e+gfe))*t,lv+""}function vfe(e){return e=Math.max(0,Math.min(1,e)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+e*(1172.33-e*(10793.56-e*(33300.12-e*(38394.49-e*14825.05)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+e*(557.33+e*(1225.33-e*(3574.96-e*(1073.77+e*707.56)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+e*(3211.1-e*(15327.97-e*(27814-e*(22569.18-e*6838.66)))))))+")"}function ty(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const bfe=ty(qt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var yfe=ty(qt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),xfe=ty(qt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),wfe=ty(qt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Sfe(e){return e}function Cfe(e){if(e==null)return Sfe;var t,n,r=e.scale[0],o=e.scale[1],i=e.translate[0],s=e.translate[1];return function(a,l){l||(t=n=0);var c=2,u=a.length,d=new Array(u);for(d[0]=(t+=a[0])*r+i,d[1]=(n+=a[1])*o+s;c<u;)d[c]=a[c],++c;return d}}function _fe(e,t){for(var n,r=e.length,o=r-t;o<--r;)n=e[o],e[o++]=e[r],e[r]=n}function Efe(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return GI(e,n)})}:GI(e,t)}function GI(e,t){var n=t.id,r=t.bbox,o=t.properties==null?{}:t.properties,i=Rfe(e,t);return n==null&&r==null?{type:"Feature",properties:o,geometry:i}:r==null?{type:"Feature",id:n,properties:o,geometry:i}:{type:"Feature",id:n,bbox:r,properties:o,geometry:i}}function Rfe(e,t){var n=Cfe(e.transform),r=e.arcs;function o(u,d){d.length&&d.pop();for(var f=r[u<0?~u:u],p=0,m=f.length;p<m;++p)d.push(n(f[p],p));u<0&&_fe(d,m)}function i(u){return n(u)}function s(u){for(var d=[],f=0,p=u.length;f<p;++f)o(u[f],d);return d.length<2&&d.push(d[0]),d}function a(u){for(var d=s(u);d.length<4;)d.push(d[0]);return d}function l(u){return u.map(a)}function c(u){var d=u.type,f;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":f=i(u.coordinates);break;case"MultiPoint":f=u.coordinates.map(i);break;case"LineString":f=s(u.arcs);break;case"MultiLineString":f=u.arcs.map(s);break;case"Polygon":f=l(u.arcs);break;case"MultiPolygon":f=u.arcs.map(l);break;default:return null}return{type:d,coordinates:f}}return c(t)}const Ih={geoAzimuthalEqualArea:Pue,geoAzimuthalEquidistant:Oue,geoGnomonic:Lue,geoOrthographic:jue,geoStereographic:zue,geoEqualEarth:kue,geoAlbers:sL,geoAlbersUsa:Rue,geoConicConformal:Due,geoConicEqualArea:Bb,geoConicEquidistant:$ue,geoEquirectangular:Mue,geoMercator:Aue,geoTransverseMercator:Bue,geoNaturalEarth1:Fue};Object.keys(Ih).forEach(e=>{Ih[`${e.charAt(3).toLowerCase()}${e.slice(4)}`]=Ih[e]});class Yc extends cl{constructor(t){super(t),this.outlineBounds=null,this.oldChartBounds=null,this.geoPath=DI()}init(t){t.position="chartArea",super.init(t),typeof t.projection=="function"?this.projection=t.projection:this.projection=(Ih[t.projection]||Ih.albersUsa)(),this.geoPath.projection(this.projection),this.outlineBounds=null,this.oldChartBounds=null}computeBounds(t){const n=DI(this.projection.fitWidth(1e3,t)).bounds(t),r=Math.ceil(n[1][1]-n[0][1]),o=Math.ceil(n[1][0]-n[0][0]),i=this.projection.translate();this.outlineBounds={width:o,height:r,aspectRatio:o/r,refScale:this.projection.scale(),refX:i[0],refY:i[1]}}updateBounds(){const t=this.chart.chartArea,n=this.outlineBounds;if(!n)return!1;const r=this.options.padding,o=typeof r=="number"?r:r.top,i=typeof r=="number"?r:r.left,s=typeof r=="number"?r:r.bottom,a=typeof r=="number"?r:r.right,l=t.right-t.left-i-a,c=t.bottom-t.top-o-s,u=this.oldChartBounds;this.oldChartBounds={chartWidth:l,chartHeight:c};const d=Math.min(l/n.width,c/n.height),f=n.width*d,p=n.height*d,m=(l-f)*.5+t.left+i,v=(c-p)*.5+t.top+o,y=this.options;return this.projection.scale(n.refScale*d*y.projectionScale).translate([d*n.refX+m+y.projectionOffset[0],d*n.refY+v+y.projectionOffset[1]]),!u||u.chartWidth!==this.oldChartBounds.chartWidth||u.chartHeight!==this.oldChartBounds.chartHeight}}Yc.id="projection";Yc.defaults={projection:"albersUsa",projectionScale:1,projectionOffset:[0,0],padding:0};Yc.descriptors={_scriptable:e=>e!=="projection",_indexable:e=>e!=="projectionOffset"};const ny={position:"chartArea",property:"value",grid:{z:1,drawOnChartArea:!1},ticks:{z:1},legend:{align:"right",position:"bottom-right",length:100,width:50,margin:8,indicatorWidth:10}};function Pfe(e){const{indicatorWidth:t,align:n,margin:r}=e,o=(typeof r=="number"?r:r.left)+(n==="right"?t:0),i=(typeof r=="number"?r:r.top)+(n==="bottom"?t:0),s=(typeof r=="number"?r:r.right)+(n==="left"?t:0),a=(typeof r=="number"?r:r.bottom)+(n==="top"?t:0);return{left:o,top:i,right:s,bottom:a}}function Ofe(e,t,n,r,o){const{indicatorWidth:i,align:s,position:a}=t,l=s==="top"||s==="bottom",c=(s==="left"?o.w:n)+(l?i:0),u=(s==="top"?o.h:r)+(l?0:i),d=Pfe(t);if(typeof a=="string")switch(a){case"top-left":return[d.left,d.top];case"top":return[(e.right-c)/2,d.top];case"left":return[d.left,(e.bottom-u)/2];case"top-right":return[e.right-c-d.right,d.top];case"bottom-right":return[e.right-c-d.right,e.bottom-u-d.bottom];case"bottom":return[(e.right-c)/2,e.bottom-u-d.bottom];case"bottom-left":return[d.left,e.bottom-u-d.bottom];default:return[e.right-c-d.right,(e.bottom-u)/2]}return[a.x,a.y]}class Bu extends Td{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){t.position="chartArea",super.init(t),this.axis="r"}parse(t,n){return t&&typeof t[this.options.property]=="number"?t[this.options.property]:super.parse(t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(t-this._startValue)/this._valueRange}update(t,n,r){const o=Math.min(n,this.bottom==null?Number.POSITIVE_INFINITY:this.bottom),i=Math.min(t,this.right==null?Number.POSITIVE_INFINITY:this.right),s=this.options.legend,a=this.isHorizontal(),l=(p,m)=>p<1?m*p:p,c=Math.min(i,l(a?s.length:s.width,i))-(a?0:s.indicatorWidth),u=Math.min(o,l(a?s.width:s.length,o))-(a?s.indicatorWidth:0);this.legendSize={w:c,h:u},this.bottom=u,this.height=u,this.right=c,this.width=c;const d=this.options.position;this.options.position=this.options.legend.align;const f=super.update(c,u,r);return this.options.position=d,this.height=Math.min(u,this.height),this.width=Math.min(c,this.width),f}_computeLabelArea(){}draw(t){if(!this._isVisible())return;const n=Ofe(t,this.options.legend,this.width,this.height,this.legendSize),{ctx:r}=this;r.save(),r.translate(n[0],n[1]);const o=this.options.position;this.options.position=this.options.legend.align,super.draw({...t,bottom:this.height+10,right:this.width}),this.options.position=o;const{indicatorWidth:i}=this.options.legend;switch(this.options.legend.align){case"left":r.translate(this.legendSize.w,0);break;case"top":r.translate(0,this.legendSize.h);break;case"bottom":r.translate(0,-i);break;default:r.translate(-i,0);break}this._drawIndicator(),r.restore()}_drawIndicator(){}}class SL extends Dd{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){Bu.prototype.init.call(this,t)}parse(t,n){return Bu.prototype.parse.call(this,t,n)}isHorizontal(){return this.options.legend.align==="top"||this.options.legend.align==="bottom"}_getNormalizedValue(t){return t==null||Number.isNaN(t)?null:(Math.log10(t)-this._startValue)/this._valueRange}update(t,n,r){return Bu.prototype.update.call(this,t,n,r)}_computeLabelArea(){}draw(t){return Bu.prototype.draw.call(this,t)}_drawIndicator(){}}const Ls={interpolateBlues:Zde,interpolateBrBG:ude,interpolateBuGn:Ode,interpolateBuPu:Tde,interpolateCividis:cfe,interpolateCool:ffe,interpolateCubehelixDefault:ufe,interpolateGnBu:Mde,interpolateGreens:efe,interpolateGreys:nfe,interpolateInferno:xfe,interpolateMagma:yfe,interpolateOrRd:$de,interpolateOranges:lfe,interpolatePRGn:fde,interpolatePiYG:pde,interpolatePlasma:wfe,interpolatePuBu:Fde,interpolatePuBuGn:kde,interpolatePuOr:mde,interpolatePuRd:zde,interpolatePurples:ofe,interpolateRainbow:hfe,interpolateRdBu:bde,interpolateRdGy:xde,interpolateRdPu:Vde,interpolateRdYlBu:Sde,interpolateRdYlGn:_de,interpolateReds:sfe,interpolateSinebow:mfe,interpolateSpectral:Rde,interpolateTurbo:vfe,interpolateViridis:bfe,interpolateWarm:dfe,interpolateYlGn:Gde,interpolateYlGnBu:Wde,interpolateYlOrBr:Yde,interpolateYlOrRd:Xde};Object.keys(Ls).forEach(e=>{Ls[`${e.charAt(11).toLowerCase()}${e.slice(12)}`]=Ls[e],Ls[e.slice(11)]=Ls[e]});function CL(e,t){const n=1/t;if(e<=n)return 0;if(e>=1-n)return 1;for(let r=0;r<1;r+=n)if(e<r)return r-n/2;return e}const _L={interpolate:"blues",missing:"transparent",quantize:0};class Ja extends Bu{get interpolate(){const t=this.options;return t?typeof t.interpolate=="function"?t.interpolate:Ls[t.interpolate]||Ls.blues:n=>`rgb(${n},${n},${n})`}getColorForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getColor(n)}getColor(t){let n=t;return this.options.quantize>0&&(n=CL(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){const{indicatorWidth:t}=this.options.legend,n=this._reversePixels;if(this.isHorizontal()){const r=this.width;if(this.options.quantize>0){const o=r/this.options.quantize,i=n?s=>r-o-s:s=>s;for(let s=0;s<r;s+=o){const a=(s+o/2)/r;this.ctx.fillStyle=this.getColor(a),this.ctx.fillRect(i(s),0,o,t)}}else{const o=n?i=>r-1-i:i=>i;for(let i=0;i<r;i+=1)this.ctx.fillStyle=this.getColor((i+.5)/r),this.ctx.fillRect(o(i),0,1,t)}}else{const r=this.height;if(this.options.quantize>0){const o=r/this.options.quantize,i=n?s=>r-o-s:s=>s;for(let s=0;s<r;s+=o){const a=(s+o/2)/r;this.ctx.fillStyle=this.getColor(a),this.ctx.fillRect(0,i(s),t,o)}}else{const o=n?i=>r-1-i:i=>i;for(let i=0;i<r;i+=1)this.ctx.fillStyle=this.getColor((i+.5)/r),this.ctx.fillRect(0,o(i),t,1)}}}}Ja.id="color";Ja.defaults=sr({},[Td.defaults,ny,_L]);Ja.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};class GR extends SL{constructor(){super(...arguments),this.interpolate=t=>`rgb(${t},${t},${t})`}init(t){super.init(t),typeof t.interpolate=="function"?this.interpolate=t.interpolate:this.interpolate=Ls[t.interpolate]||Ls.blues}getColorForValue(t){return Ja.prototype.getColorForValue.call(this,t)}getColor(t){let n=t;return this.options.quantize>0&&(n=CL(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){return Ja.prototype._drawIndicator.call(this)}}GR.id="colorLogarithmic";GR.defaults=sr({},[Dd.defaults,ny,_L]);GR.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};const EL={missing:1,mode:"area",range:[2,20],legend:{align:"bottom",length:90,width:70,indicatorWidth:42}};class el extends Bu{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){const[n,r]=this.options.range;if(this.options.mode==="area"){const i=r*r*Math.PI,s=n*n*Math.PI,a=i-s,l=t*a+s;return Math.sqrt(l/Math.PI)}const o=r-n;return t*o+n}_drawIndicator(){const{ctx:t}=this,n=this.options.legend.indicatorWidth/2,r=this.isHorizontal(),o=this.ticks,i=this.getLabelItems(),s=i?i.map(a=>({[r?"x":"y"]:a.options.translation[r?0:1]})):o.map((a,l)=>({[r?"x":"y"]:this.getPixelForTick(l)}));if((this._gridLineItems||[]).forEach(a=>{if(t.save(),t.strokeStyle=a.color,t.lineWidth=a.width,t.setLineDash&&(t.setLineDash(a.borderDash),t.lineDashOffset=a.borderDashOffset),t.beginPath(),this.options.grid.drawTicks)switch(this.options.legend.align){case"left":t.moveTo(0,a.ty1),t.lineTo(n,a.ty2);break;case"top":t.moveTo(a.tx1,0),t.lineTo(a.tx2,n);break;case"bottom":t.moveTo(a.tx1,n),t.lineTo(a.tx2,n*2);break;default:t.moveTo(n,a.ty1),t.lineTo(n*2,a.ty2);break}t.stroke(),t.restore()}),this._model){const a=this._model;t.strokeStyle=a.borderColor,t.lineWidth=a.borderWidth||0,t.fillStyle=a.backgroundColor}else t.fillStyle="blue";o.forEach((a,l)=>{const c=s[l],u=this.getSizeForValue(a.value),d=r?c.x:n,f=r?n:c.y,p={pointStyle:"circle",borderWidth:0,...this._model||{},radius:u};_b(t,p,d,f)})}}el.id="size";el.defaults=sr({},[Td.defaults,ny,EL]);el.descriptors={_scriptable:!0,_indexable:e=>e!=="range"};class RL extends SL{constructor(){super(...arguments),this._model=null}getSizeForValue(t){const n=this._getNormalizedValue(t);return n==null||Number.isNaN(n)?this.options.missing:this.getSizeImpl(n)}getSizeImpl(t){return el.prototype.getSizeImpl.call(this,t)}_drawIndicator(){el.prototype._drawIndicator.call(this)}}RL.id="sizeLogarithmic";RL.defaults=sr({},[Dd.defaults,ny,EL]);function Afe(e,t){return[[e[0][0]-t,e[0][1]-t],[e[1][0]+t,e[1][1]+t]]}class qs extends hs{constructor(){super(...arguments),this.cache=void 0}inRange(t,n){const r=this.getBounds(),o=(Number.isNaN(t)||t>=r.x&&t<=r.x2)&&(Number.isNaN(n)||n>=r.y&&n<=r.y2),i=this.projectionScale.geoPath.projection();if(o&&!Number.isNaN(t)&&!Number.isNaN(n)&&typeof i.invert=="function"){const s=i.invert([t,n]);return s!=null&&rue(this.feature,s)}return o}inXRange(t){return this.inRange(t,Number.NaN)}inYRange(t){return this.inRange(Number.NaN,t)}getCenterPoint(){if(this.cache&&this.cache.center)return this.cache.center;let t;if(this.center){const n=this.projectionScale.projection([this.center.longitude,this.center.latitude]);t={x:n[0],y:n[1]}}else{const n=this.projectionScale.geoPath.centroid(this.feature);t={x:n[0],y:n[1]}}return this.cache={...this.cache||{},center:t},t}getBounds(){if(this.cache&&this.cache.bounds)return this.cache.bounds;const t=Afe(this.projectionScale.geoPath.bounds(this.feature),this.options.borderWidth/2),n={x:t[0][0],x2:t[1][0],y:t[0][1],y2:t[1][1],width:t[1][0]-t[0][0],height:t[1][1]-t[0][1]};return this.cache={...this.cache||{},bounds:n},n}_drawInCache(t){const n=this.getBounds();if(!Number.isFinite(n.x))return;const r=this.cache&&this.cache.canvas?this.cache.canvas:t.createElement("canvas"),o=Math.floor(n.x),i=Math.floor(n.y),s=Math.ceil(n.x+n.width),a=Math.ceil(n.y+n.height),l=this.pixelRatio||1,c=Math.ceil(Math.max(s-o,1)*l),u=Math.ceil(Math.max(a-i,1)*l);if(c<=0||u<=0)return;r.width=c,r.height=u;const d=r.getContext("2d");d&&(d.clearRect(0,0,r.width,r.height),d.save(),d.scale(l,l),d.translate(-o,-i),this._drawImpl(d),d.restore(),this.cache={...this.cache||{},canvas:r,canvasKey:this._optionsToKey()})}_optionsToKey(){const{options:t}=this;return`${t.backgroundColor};${t.borderColor};${t.borderWidth};${this.pixelRatio}`}_drawImpl(t){const{feature:n}=this,{options:r}=this;t.beginPath(),this.projectionScale.geoPath.context(t)(n),r.backgroundColor&&(t.fillStyle=r.backgroundColor,t.fill()),r.borderColor&&(t.strokeStyle=r.borderColor,t.lineWidth=r.borderWidth,t.stroke())}draw(t){const{feature:n}=this;if(!n)return;(!this.cache||this.cache.canvasKey!==this._optionsToKey())&&t.canvas.ownerDocument!=null&&this._drawInCache(t.canvas.ownerDocument);const r=this.getBounds();if(this.cache&&this.cache.canvas&&this.cache.canvas.width>0&&this.cache.canvas.height>0){const o=Math.floor(r.x),i=Math.floor(r.y),s=Math.ceil(r.x+r.width),a=Math.ceil(r.y+r.height),l=s-o,c=a-i;l>0&&c>0&&t.drawImage(this.cache.canvas,o,i,s-o,a-i)}else Number.isFinite(r.x)&&(t.save(),this._drawImpl(t),t.restore())}}qs.id="geoFeature";qs.defaults={...mc.defaults,outlineBackgroundColor:null,outlineBorderWidth:0,graticuleBorderColor:"#CCCCCC",graticuleBorderWidth:0};qs.defaultRoutes={outlineBorderColor:"borderColor",...mc.defaultRoutes||{}};const PL={showOutline:!1,showGraticule:!1,clipMap:!0},OL={scales:{projection:{axis:"x",type:Yc.id,position:"chartArea",display:!1}}};function qI(e){const t={...e};return Object.keys(e).forEach(n=>{let r=n;if(n.startsWith("outline")){const o=n.slice(7);r=o[0].toLowerCase()+o.slice(1)}else if(n.startsWith("hoverOutline"))r=`hover${n.slice(12)}`;else return;delete t[n],t[r]=e[n]}),t}class AL extends ei{getGeoDataset(){return super.getDataset()}getGeoOptions(){return this.chart.options}getProjectionScale(){return this.getScaleForId("projection")}linkScales(){const t=this.getGeoDataset(),n=this.getMeta();n.xAxisID="projection",t.xAxisID="projection",n.yAxisID="projection",t.yAxisID="projection",n.xScale=this.getScaleForId("projection"),n.yScale=this.getScaleForId("projection"),this.getProjectionScale().computeBounds(this.resolveOutline())}showOutline(){return st(this.getGeoDataset().showOutline,this.getGeoOptions().showOutline)}clipMap(){return st(this.getGeoDataset().clipMap,this.getGeoOptions().clipMap)}getGraticule(){return st(this.getGeoDataset().showGraticule,this.getGeoOptions().showGraticule)}update(t){super.update(t);const n=this.getMeta(),r=this.getProjectionScale(),o=r.updateBounds();if(this.showOutline()){const i=n.dataset;if(o&&delete i.cache,i.projectionScale=r,i.pixelRatio=this.chart.currentDevicePixelRatio,t!=="resize"){const s=qI(this.resolveDatasetElementOptions(t)),a={feature:this.resolveOutline(),options:s};this.updateElement(i,void 0,a,t),this.getGraticule()&&(n.graticule=s)}}else this.getGraticule()&&t!=="resize"&&(n.graticule=qI(this.resolveDatasetElementOptions(t)));this.updateElements(n.data,0,n.data.length,t),o&&n.data.forEach(i=>delete i.cache)}resolveOutline(){const n=this.getGeoDataset().outline||{type:"Sphere"};return Array.isArray(n)?{type:"FeatureCollection",features:n}:n}showGraticule(){const t=this.getGraticule(),n=this.getMeta().graticule;if(!t||!n)return;const{ctx:r}=this.chart,i=this.getProjectionScale().geoPath.context(r);if(r.save(),r.beginPath(),typeof t=="boolean")t&&i(oue());else{const s=W6();t.stepMajor&&s.stepMajor(t.stepMajor),t.stepMinor&&s.stepMinor(t.stepMinor),i(s())}r.strokeStyle=n.graticuleBorderColor,r.lineWidth=n.graticuleBorderWidth,r.stroke(),r.restore()}draw(){const{chart:t}=this,n=this.clipMap();let r=!1;(n===!0||n==="outline"||n==="outline+graticule")&&(r=!0,dc(t.ctx,t.chartArea)),this.showOutline()&&this.getMeta().dataset&&this.getMeta().dataset.draw.call(this.getMeta().dataset,t.ctx,t.chartArea),n===!0||n==="graticule"||n==="outline+graticule"?r||dc(t.ctx,t.chartArea):r&&(r=!1,fc(t.ctx)),this.showGraticule(),n===!0||n==="items"?r||dc(t.ctx,t.chartArea):r&&(r=!1,fc(t.ctx)),this.getMeta().data.forEach(o=>o.draw.call(o,t.ctx,t.chartArea)),r&&(r=!1,fc(t.ctx))}}function TL(e,t,n,r=[],o=[]){Nr.addControllers(n),Array.isArray(r)?Nr.addElements(...r):Nr.addElements(r),Array.isArray(o)?Nr.addScales(...o):Nr.addScales(o);const i=t;return i.type=e,i}class Qd extends AL{initialize(){super.initialize(),this.enableOptionSharing=!0}linkScales(){super.linkScales();const t=this.getGeoDataset(),n=this.getMeta();n.vAxisID="color",n.rAxisID="color",t.vAxisID="color",t.rAxisID="color",n.rScale=this.getScaleForId("color"),n.vScale=n.rScale,n.iScale=n.xScale,n.iAxisID=n.xAxisID,t.iAxisID=n.xAxisID}_getOtherScale(t){return t}parse(t,n){const r=this.getMeta().rScale,{data:o}=this.getDataset(),i=this._cachedMeta;for(let s=t;s<t+n;s+=1)i._parsed[s]={[r.axis]:r.parse(o[s],s)}}updateElements(t,n,r,o){const i=this.resolveDataElementOptions(n,o),s=this.getSharedOptions(i),a=this.includeOptions(o,s),l=this.getProjectionScale();this.updateSharedOptions(s,o,i);for(let c=n;c<n+r;c+=1){const u=t[c];u.projectionScale=l,u.feature=this._data[c].feature,u.center=this._data[c].center,u.pixelRatio=this.chart.currentDevicePixelRatio;const d=u.getCenterPoint(),f={x:d.x,y:d.y};a&&(f.options=s||this.resolveDataElementOptions(c,o)),this.updateElement(u,c,f,o)}}indexToColor(t){const n=this.getMeta().rScale;return n.getColorForValue(this.getParsed(t)[n.axis])}}Qd.id="choropleth";Qd.defaults=sr({},[PL,{datasetElementType:qs.id,dataElementType:qs.id}]);Qd.overrides=sr({},[OL,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,o;return e.formattedValue==null?(n=(t=e.chart.data)===null||t===void 0?void 0:t.labels)===null||n===void 0?void 0:n[e.dataIndex]:`${(o=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o[e.dataIndex]}: ${e.formattedValue}`}}},colors:{enabled:!1}},scales:{color:{type:Ja.id,axis:"x"}},elements:{geoFeature:{backgroundColor(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToColor(e.dataIndex)}}}}]);class Tfe extends Mn{constructor(t,n){super(t,TL("choropleth",n,Qd,qs,[Ja,Yc]))}}Tfe.id=Qd.id;class Zd extends AL{initialize(){super.initialize(),this.enableOptionSharing=!0}linkScales(){super.linkScales();const t=this.getGeoDataset(),n=this.getMeta();n.vAxisID="size",n.rAxisID="size",t.vAxisID="size",t.rAxisID="size",n.rScale=this.getScaleForId("size"),n.vScale=n.rScale,n.iScale=n.xScale,n.iAxisID=n.xAxisID,t.iAxisID=n.xAxisID}_getOtherScale(t){return t}parse(t,n){const r=this.getMeta().rScale,o=this.getDataset().data,i=this._cachedMeta;for(let s=t;s<t+n;s+=1){const a=o[s];i._parsed[s]={x:a.longitude==null?a.x:a.longitude,y:a.latitude==null?a.y:a.latitude,[r.axis]:r.parse(a,s)}}}updateElements(t,n,r,o){const i=o==="reset",s=this.resolveDataElementOptions(n,o),a=this.getSharedOptions(s),l=this.includeOptions(o,a),c=this.getProjectionScale();this.getMeta().rScale._model=s,this.updateSharedOptions(a,o,s);for(let u=n;u<n+r;u+=1){const d=t[u],f=this.getParsed(u),p=c.projection([f.x,f.y]),m={x:p?p[0]:0,y:p?p[1]:0,skip:Number.isNaN(f.x)||Number.isNaN(f.y)};l&&(m.options=a||this.resolveDataElementOptions(u,o),i&&(m.options.radius=0)),this.updateElement(d,u,m,o)}}indexToRadius(t){const n=this.getMeta().rScale;return n.getSizeForValue(this.getParsed(t)[n.axis])}}Zd.id="bubbleMap";Zd.defaults=sr({},[PL,{dataElementType:gc.id,datasetElementType:qs.id,showOutline:!0,clipMap:"outline+graticule"}]);Zd.overrides=sr({},[OL,{plugins:{tooltip:{callbacks:{title(){return""},label(e){var t,n,r,o;return e.formattedValue==null?(n=(t=e.chart.data)===null||t===void 0?void 0:t.labels)===null||n===void 0?void 0:n[e.dataIndex]:`${(o=(r=e.chart.data)===null||r===void 0?void 0:r.labels)===null||o===void 0?void 0:o[e.dataIndex]}: ${e.formattedValue}`}}}},scales:{size:{axis:"x",type:el.id}},elements:{point:{radius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)},hoverRadius(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToRadius(e.dataIndex)+1}}}}]);class Dfe extends Mn{constructor(t,n){super(t,TL("bubbleMap",n,Zd,qs,[el,Yc]))}}Dfe.id=Zd.id;function Mfe(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function Ife(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{beginAtZero:!0,stack:1,reverse:!0},y:{stacked:!0,beginAtZero:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function $fe(e){var n;return{...e,type:"bar",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function Nfe(e,t=!1){var r;return{...e,type:"bar",options:{...e==null?void 0:e.options,indexAxis:"y",scales:{x:{display:!0,beginAtZero:!1},y:{display:!0,stacked:t}},plugins:{...(r=e==null?void 0:e.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center"}}}}}function kfe(e,t){var r,o,i,s,a;return{...e,type:t==="stackedBar"?"bar":"line",options:{...e==null?void 0:e.options,scales:{x:{...(o=(r=e==null?void 0:e.options)==null?void 0:r.scales)==null?void 0:o.x,display:!0,stacked:!0},y:{...(s=(i=e==null?void 0:e.options)==null?void 0:i.scales)==null?void 0:s.y,display:!0,stacked:t==="stackedBar"}},plugins:{...(a=e==null?void 0:e.options)==null?void 0:a.plugins,legend:{position:"bottom",align:"center"}}}}}function Lfe(e){var n;return{...e,type:"line",options:{...e==null?void 0:e.options,scales:{x:{display:!0},y:{display:!0}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function Ffe(e,t){var r;return{...t,type:e,options:{...t==null?void 0:t.options,scales:{x:{display:!1},y:{display:!1}},plugins:{...(r=t==null?void 0:t.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center",maxHeight:0,labels:{useBorderRadius:!0,borderRadius:2}}},borderRadius:0}}}function jfe(e){var n;return{...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1}},plugins:{...(n=e==null?void 0:e.options)==null?void 0:n.plugins,legend:{position:"bottom",align:"center"}}}}}function qR({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s,topoJson:a}){var l,c,u,d,f,p,m,v,y,b;if(t==="map"){if(!a)return null;const x=(l=s==null?void 0:s.mapVisualOptions)==null?void 0:l.objectKey;if(!x)return null;const E=Efe(a,(c=a==null?void 0:a.objects)==null?void 0:c[x]).features;if(!E)return null;const R={plugins:{datalabels:{display:!1}},scales:{x:{display:!1,grid:{display:!1}},y:{display:!1,grid:{display:!1}},projection:{axis:"x",projection:((u=s==null?void 0:s.mapVisualOptions)==null?void 0:u.projection)||"mercator",projectionScale:((d=s==null?void 0:s.mapVisualOptions)==null?void 0:d.projectionScale)||1,projectionOffset:((f=s==null?void 0:s.mapVisualOptions)==null?void 0:f.projectionOffset)||[0,0]},color:{axis:"x",interpolate:((p=s==null?void 0:s.mapVisualOptions)==null?void 0:p.colorScale)||"blues",quantize:5,legend:{position:"bottom-right",align:"right"}}}},{keys:P}=rr(e),O=E.map(z=>{var W;const K=P==null?void 0:P[0],H=P==null?void 0:P[1],k=(W=e.find(B=>(B==null?void 0:B[K])===z.properties.NAME||(B==null?void 0:B[K])===z.properties.name))==null?void 0:W[H];return{feature:z,value:k}}),D=ah([{label:x,data:O,borderColor:"lightgray"}],r),I={type:"choropleth",data:{labels:E.map(z=>z.properties.NAME||z.properties.name),datasets:D},options:R},{options:L}=k4({cfg:I,preferences:s,customCfg:r});return{...I,options:L}}if(t==="bar"){const x=$fe(n);return Al({data:e,cfg:x,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="horizontalBar"){const x=Mfe(n);return Al({data:e,cfg:x,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="pyramid"){const x=Ife(n),{dimensionKeys:E,metricKeys:R}=rr(e),P=yb({dataArray:e,groupKey:E[0],pivotKey:E[1],valueKey:R[0]}),O=Al({data:P,cfg:x,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s}),A="x2";return{...O,data:{...O.data,datasets:O.data.datasets.map((I,L)=>L===1?{...I,xAxisID:A}:I)},options:{...O.options,scales:{...(m=O==null?void 0:O.options)==null?void 0:m.scales,[A]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const x=kfe(n,t),{dimensionKeys:E,metricKeys:R}=rr(e),P=yb({dataArray:e,groupKey:E[0],pivotKey:E[1],valueKey:R[0],sortChart:s==null?void 0:s.sortChart});return Al({data:P,cfg:x,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="line"){const x=Lfe(n);return Al({data:e,cfg:x,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="range"){const x=Nfe(n),E=poe(e),R=ah(E,r),{plugins:P,options:O}=M4((s==null?void 0:s.customVisualCode)||""),A=Xo((x==null?void 0:x.options)||{},(n==null?void 0:n.options)||{}),D=Xo(A,(s==null?void 0:s.chartOptions)||{}),I=Xo(D,(r==null?void 0:r.options)||{}),L=Xo(I,O),j=N4(n,s),z=Xo(L,j),K={...z,plugins:{...z==null?void 0:z.plugins,datalabels:{...(v=z==null?void 0:z.plugins)==null?void 0:v.datalabels,formatter:(U,q)=>U.map(Y=>{var X,M,oe,te;return Us({number:Number(Y),decimalPlaces:((X=s==null?void 0:s.numberAxisFormat)==null?void 0:X.decimalPlaces)||0,useSuffix:!!((M=s==null?void 0:s.numberAxisFormat)!=null&&M.suffix),customSuffix:"",locale:((oe=s==null?void 0:s.numberAxisFormat)==null?void 0:oe.locale)||"",currency:((te=s==null?void 0:s.numberAxisFormat)==null?void 0:te.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:H}=rr(e),k=H[0];return{type:"bar",data:{labels:[...new Set(fC(e,k))],datasets:R},options:K,plugins:[...P]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const x=Ffe(t,n),{dimensionKeys:E,metricKeys:R}=rr(e),P=goe(R,e),O=ah(P,r),A=E[0],D=fC(e,A),I=Xo((x==null?void 0:x.options)||{},(r==null?void 0:r.options)||{}),L=Xo(I,(s==null?void 0:s.chartOptions)||{}),j={...L,plugins:{...L.plugins,datalabels:{...(y=L.plugins)==null?void 0:y.datalabels,formatter:(H,k)=>{var W,B,U,q;return Us({number:Number(H),decimalPlaces:((W=s==null?void 0:s.numberAxisFormat)==null?void 0:W.decimalPlaces)||0,useSuffix:!!((B=s==null?void 0:s.numberAxisFormat)!=null&&B.suffix),customSuffix:"",locale:((U=s==null?void 0:s.numberAxisFormat)==null?void 0:U.locale)||"",currency:((q=s==null?void 0:s.numberAxisFormat)==null?void 0:q.currency)||""})}},tooltip:{...(b=L.plugins)==null?void 0:b.tooltip,callbacks:{label:function(H){let k=H.dataset.label||"";k&&(k+=": ");const B=H.dataset.data.reduce(($,Y)=>$+Y,0),q=(H.parsed/B*100).toFixed(2);return k+=q+"%",k+` (${H.formattedValue})`}}}}};return{type:t,data:{labels:D,datasets:O},options:j,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(H,k,W){var te,ie,ne,Z;const{ctx:B,data:U}=H;B.save();const q=H.getDatasetMeta(0).data[0].x,$=H.getDatasetMeta(0).data[0].y,Y=Sd(Gh()),X=window.getComputedStyle(B.canvas).fontFamily;B.font=`1em ${X}`,B.fontWeight="bolder",B.fillStyle=Y,B.textAlign="center",B.textBaseline="middle";const M=U.datasets[0].data.reduce((ae,ce)=>ae+ce,0),oe=Us({number:Number(M),decimalPlaces:((te=s==null?void 0:s.numberAxisFormat)==null?void 0:te.decimalPlaces)||0,useSuffix:!!((ie=s==null?void 0:s.numberAxisFormat)!=null&&ie.suffix),customSuffix:"",locale:((ne=s==null?void 0:s.numberAxisFormat)==null?void 0:ne.locale)||"",currency:((Z=s==null?void 0:s.numberAxisFormat)==null?void 0:Z.currency)||""});B.fillText(oe,q,$)}}:""]}}if(t==="radar"){const x=jfe(n);return Al({data:e,cfg:x,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:x}=rr(e);if(x.length<3){console.log("Bubble charts require 3 numeric columns");return}const E=hoe(e),R=ah(E,r),P={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:x[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:x[1]},beginAtZero:!0,ticks:{precision:0}}}},O=Xo(P,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:R},options:O}}return Al({data:e,cfg:n,customCfg:r,cardType:t,userSettings:i,provider:o,preferences:s})}function zfe({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const s=we.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)&&Vfe(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&Hfe(e,t,o,i,a),["stackedBar","pyramid"].includes(r)&&Bfe({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function Bfe(e){var a,l,c,u;const{chart:t,elementIndex:n,datasetIndex:r,cfg:o,apply:i,blurColor:s}=e;i?(l=(a=t==null?void 0:t.data)==null?void 0:a.datasets)==null||l.forEach((d,f)=>{var p,m;typeof d.backgroundColor=="string"&&(d.backgroundColor=new Array(d.data.length).fill(d.backgroundColor),d.borderColor=new Array(d.data.length).fill(d.borderColor)),d.backgroundColor=(p=d==null?void 0:d.backgroundColor)==null?void 0:p.map((v,y)=>y===n&&f===r?v:s),d.borderColor=(m=d==null?void 0:d.borderColor)==null?void 0:m.map((v,y)=>y===n&&f===r?v:s)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((d,f)=>{var p,m,v,y,b,x;d.backgroundColor=new Array(d.data.length).fill((v=(m=(p=o==null?void 0:o.data)==null?void 0:p.datasets)==null?void 0:m[f])==null?void 0:v.backgroundColor),d.borderColor=new Array(d.data.length).fill((x=(b=(y=o==null?void 0:o.data)==null?void 0:y.datasets)==null?void 0:b[f])==null?void 0:x.borderColor)}),t==null||t.update()}function Vfe(e,t,n,r,o){var i,s,a,l;r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,d;typeof c.backgroundColor=="string"&&(c.backgroundColor=new Array(c.data.length).fill(c.backgroundColor),c.borderColor=new Array(c.data.length).fill(c.borderColor)),c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((f,p)=>p===t?f:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((f,p)=>p===t?f:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var d,f,p,m,v,y;c.backgroundColor=new Array(c.data.length).fill((p=(f=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:f[u])==null?void 0:p.backgroundColor),c.borderColor=new Array(c.data.length).fill((y=(v=(m=n==null?void 0:n.data)==null?void 0:m.datasets)==null?void 0:v[u])==null?void 0:y.borderColor)}),e==null||e.update()}function Hfe(e,t,n,r,o){var i,s,a,l;r?(s=(i=e==null?void 0:e.data)==null?void 0:i.datasets)==null||s.forEach(c=>{var u,d;c.backgroundColor=(u=c==null?void 0:c.backgroundColor)==null?void 0:u.map((f,p)=>p===t?f:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((f,p)=>p===t?f:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var d,f,p,m,v,y,b,x;typeof c.backgroundColor=="string"&&(c.backgroundColor=(p=(f=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:f[u])==null?void 0:p.backgroundColor,c.borderColor=(y=(v=(m=n==null?void 0:n.data)==null?void 0:m.datasets)==null?void 0:v[u])==null?void 0:y.borderColor),c.backgroundColor=(b=c==null?void 0:c.backgroundColor)==null?void 0:b.map((E,R)=>{var P;return(P=n.data.datasets[u].backgroundColor)==null?void 0:P[R]}),c.borderColor=(x=c==null?void 0:c.borderColor)==null?void 0:x.map((E,R)=>{var P;return(P=n.data.datasets[u].borderColor)==null?void 0:P[R]})}),e==null||e.update()}function Wfe({card:e,data:t,datasetIndex:n,clickIndex:r,value:o}){var i,s,a,l,c,u;try{if(!t)return;const{keys:d,dimensionKeys:f,metricKeys:p}=rr(t);if(e.type==="map"){const m=d[0],v=((s=(i=o==null?void 0:o.feature)==null?void 0:i.properties)==null?void 0:s.name)||((l=(a=o==null?void 0:o.feature)==null?void 0:a.properties)==null?void 0:l.NAME);return[{columnName:m,columnValue:v}]}if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const m=f[0],v=(c=t[r])==null?void 0:c[m];return[{columnName:m,columnValue:v,metric:p[n],value:o}]}if(["stackedBar","pyramid"].includes(e.type)){const m=yb({dataArray:t,groupKey:f[0],pivotKey:f[1],valueKey:p[0]}),v=f[0],y=(u=m[r])==null?void 0:u[v],b=f[1],{metricKeys:x}=rr(m),E=x[n];return[{columnName:v,columnValue:y,metric:p[0],value:o},{columnName:b,columnValue:E,metric:p[0],value:o}]}if(e.type==="bubble"||e.type==="scatter"){const m=f[0],v=o.label;return[{columnName:m,columnValue:v,metric1:p[0],value1:o.x,metric2:p[1],value2:o.y,metric3:p==null?void 0:p[2],value3:o==null?void 0:o.r}]}}catch(d){console.error("Error in getAdhocFilter",d)}}function DL(e){var a,l,c,u,d,f;const t=(((l=(a=e.preferences)==null?void 0:a.mapVisualOptions)==null?void 0:l.topoJsonUrl)==="custom"?(u=(c=e.preferences)==null?void 0:c.mapVisualOptions)==null?void 0:u.customTopoJsonUrl:(f=(d=e.preferences)==null?void 0:d.mapVisualOptions)==null?void 0:f.topoJsonUrl)||"",n=!!t&&e.type==="map",{data:r,isLoading:o,isFetching:i,isError:s}=Zp({queryKey:["topojson",t],queryFn:()=>fetch(t).then(p=>p.json()),enabled:n,staleTime:1/0});return{data:r,isLoading:o,isFetching:i,isError:s}}function Ufe(e){var s,a;const[t]=w.useState({id:"",title:"",type:"bar",data:[]}),{getCard:n}=fr(),r=n(e),o=YR(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 YR(e){var K,H,k,W;const{onChartElementClicked:t}=No(),[n,r]=w.useState(0);((K=e==null?void 0:e.preferences)==null?void 0:K.filterOnClickColumnIndex)===void 0||(H=e.preferences)==null||H.filterOnClickColumnIndex;const o=we(B=>B.isVisualEditing),i=we(B=>B.filteringCards),s=we(B=>B.selectedSheetId),a=we(B=>B.selectedLensId);we(B=>B.selectedCardId),we(B=>B.dashboard),we(B=>B.isDashboardEditing),we(B=>B.themeStyle);const l=we(B=>B.filterValues),c=w.useRef(l),u=(k=e==null?void 0:e.preferences)==null?void 0:k.onClickFilter,{addFilteringCard:d,getCardFrame:f,addOrUpdateFilterValues:p,removeFilterValue:m,removeFilteringCard:v}=fr(),{data:y,isLoading:b,isFetching:x,isError:E,queryKey:R}=Y0(e),{data:P}=DL(e),O=i==null?void 0:i.find(B=>B.id===e.id),A=f(e.id),D=(A==null?void 0:A.cards)||[],I=(D==null?void 0:D.length)==1;let L;y&&y.records&&((W=y.records)==null?void 0:W.length)>0&&e.type!=="custom"&&(L=qR({data:y==null?void 0:y.records,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences,topoJson:P}));const j=w.useRef({filteringCards:i});w.useEffect(()=>{!(y!=null&&y.records)||b||x||O&&I||o||r(B=>B+1)},[y==null?void 0:y.records,b,x,O,I,o]),w.useEffect(()=>{e.connectionId&&!O&&(c.current=l)},[l,a,e.connectionId,O]),w.useEffect(()=>{var U;O&&(j.current.filteringCards=[...i||[]]),!O&&((U=j.current.filteringCards)==null?void 0:U.find(q=>q.id===e.id))&&I&&r(q=>q+1)},[O,I,e.id,i]);function z(B,U,q,$){var M;let Y=!1;if(!(y!=null&&y.records))return;const X=Wfe({card:e,data:y==null?void 0:y.records,datasetIndex:U,clickIndex:q,value:$});if(console.log("fieldValues",X),t==null||t(e,X),!!(((M=e==null?void 0:e.preferences)==null?void 0:M.onClickFilter)??[]).length){if(O){const oe=e.id;m(oe),v(e)}else{if(Y=!0,!X)return;const oe=[];X.forEach((te,ie)=>{const ne=u==null?void 0:u.find(ae=>ae.columnIndex===ie);if(!ne)return;const Z={filterId:e.id+"-"+te.columnName+"-"+s,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:te.columnName,expression:ne.expression,valueType:R0(X[ne.columnIndex].columnValue),operation:"=",values:[X[ne.columnIndex].columnValue]};oe.push(Z)}),p(oe),d(e)}zfe({chart:B,elementIndex:q,datasetIndex:U,cardType:e.type,cfg:L,apply:Y})}}return{isError:E,isLoading:b,isFetching:x,data:y,visualKey:n,handleDatapointClick:z,cfg:L}}function es({children:e,containerClassName:t,className:n,text:r,onSave:o,type:i="input"}){const[s,a]=w.useState(!1),[l,c]=w.useState(r),u=we(p=>p.isDashboardEditing),d=p=>{p.stopPropagation(),u&&a(!0)};function f(){return i==="textarea"?C.jsx("textarea",{className:xe("grow rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:p=>c(p.target.value),value:l,autoFocus:!0,onBlur:()=>a(!1),onKeyDown:p=>{p.stopPropagation(),!(p.key==="Enter"&&p.shiftKey)&&(p.key==="Enter"||p.key==="Tab")&&(a(!1),o(l))}}):C.jsx("input",{onMouseDown:p=>p.stopPropagation(),type:"text",className:xe("rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:p=>c(p.target.value),value:l,autoFocus:!0,onBlur:()=>a(!1),onKeyDown:p=>{p.stopPropagation(),(p.key==="Enter"||p.key==="Tab")&&(a(!1),o(l))}})}return C.jsx("div",{className:xe("flex",t),role:"editable",onDoubleClick:d,children:s?f():e})}function ML(e){const{authToken:t}=No(),n=BZ(t==null?void 0:t.accessToken);function r(){var i,s,a,l,c,u;if((s=(i=e.preferences)==null?void 0:i.formatNumber)!=null&&s.currency&&((l=(a=e.preferences)==null?void 0:a.formatNumber)==null?void 0:l.currency)!=="none")return n!=null&&n.currency?n==null?void 0:n.currency:(u=(c=e.preferences)==null?void 0:c.formatNumber)==null?void 0:u.currency}function o(){var i,s,a,l,c,u;if((s=(i=e.preferences)==null?void 0:i.formatNumber)!=null&&s.locale&&((l=(a=e.preferences)==null?void 0:a.formatNumber)==null?void 0:l.locale)!=="none")return n!=null&&n.locale?n==null?void 0:n.locale:(u=(c=e.preferences)==null?void 0:c.formatNumber)==null?void 0:u.locale}return{getCurrency:r,getLocale:o}}function IL({card:e,data:t}){var x,E,R,P,O,A,D,I,L,j,z,K,H,k,W,B;const n=we(U=>U.actions.setCardTitle),r=we(U=>U.actions.setCardDescription),o=we(U=>U.isVisualEditing),i=$r(U=>U.card),s=$r(U=>U.actions.setCard);$r(U=>U.actions.setNumberFormat);const{getCurrency:a,getLocale:l}=ML(e),c=we(U=>U.selectedSheetId),u=(E=(x=e.preferences)==null?void 0:x.formatNumber)==null?void 0:E.colorRanges,{metricKeys:d}=rr(t),f=(R=t==null?void 0:t[0])==null?void 0:R[d==null?void 0:d[0]],p=(P=t==null?void 0:t[0])==null?void 0:P[d==null?void 0:d[1]],m=t&&t.length>0;function v(U){o?s({...i,title:U}):n(c,e.id,U)}function y(U){o?s({...i,description:U}):r(c,e.id,U)}const b=p&&p-f!==0?(f-p)/p:null;return C.jsxs("div",{className:"kpi-card flex grow flex-col overflow-auto",children:[C.jsxs(P0,{className:"grow pb-3",children:[C.jsx(es,{text:o?i.title:e.title,onSave:v,children:C.jsx("div",{className:"flex items-center gap-2",children:C.jsx(Gd,{className:"text-base font-medium text-muted-foreground",children:e.title})})}),m&&C.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[C.jsx("p",{style:{color:gR(f,u)},className:"text-3xl font-semibold",children:Us({number:f,decimalPlaces:((A=(O=e.preferences)==null?void 0:O.formatNumber)==null?void 0:A.decimalPlaces)||0,useSuffix:!!((I=(D=e.preferences)==null?void 0:D.formatNumber)!=null&&I.suffix),customSuffix:((j=(L=e.preferences)==null?void 0:L.formatNumber)==null?void 0:j.suffix)||"",locale:l()||"",currency:a()||""})}),p&&C.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from  ",Us({number:p,decimalPlaces:((K=(z=e.preferences)==null?void 0:z.formatNumber)==null?void 0:K.decimalPlaces)||0,useSuffix:!!((k=(H=e.preferences)==null?void 0:H.formatNumber)!=null&&k.suffix),customSuffix:((B=(W=e.preferences)==null?void 0:W.formatNumber)==null?void 0:B.suffix)||"",locale:l()||"",currency:a()||""})]})]})]}),b&&C.jsxs(O0,{className:"grow items-start gap-1 pb-4 text-sm",children:[C.jsx($L,{children:b}),C.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[b>0?"up ":"down ",C.jsx(es,{text:e.description||"",onSave:y,children:e.description})]})]})]})}function $L({children:e,className:t}){var i,s;const n=we(a=>a.themeStyle),r=e>0?C.jsx("span",{children:"+"}):C.jsx("span",{children:"-"}),o=`${Math.abs(e*100).toFixed(0)}%`;return C.jsxs("div",{style:{borderRadius:(s=(i=n==null?void 0:n.chart)==null?void 0:i.options)==null?void 0:s.borderRadius},className:xe("flex items-center px-1 text-sm font-semibold",{"bg-green-600/10 text-green-600":e>0,"bg-destructive/10 text-destructive":e<0},t),children:[r,C.jsx("span",{className:"ml-[1px]",children:o})]})}const Gfe=["top","right","bottom","left"],tl=Math.min,Co=Math.max,Ub=Math.round,cv=Math.floor,nl=e=>({x:e,y:e}),qfe={left:"right",right:"left",bottom:"top",top:"bottom"},Yfe={start:"end",end:"start"};function UC(e,t,n){return Co(e,tl(t,n))}function Ys(e,t){return typeof e=="function"?e(t):e}function Ks(e){return e.split("-")[0]}function Jd(e){return e.split("-")[1]}function KR(e){return e==="x"?"y":"x"}function XR(e){return e==="y"?"height":"width"}function ef(e){return["top","bottom"].includes(Ks(e))?"y":"x"}function QR(e){return KR(ef(e))}function Kfe(e,t,n){n===void 0&&(n=!1);const r=Jd(e),o=QR(e),i=XR(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Gb(s)),[s,Gb(s)]}function Xfe(e){const t=Gb(e);return[GC(e),t,GC(t)]}function GC(e){return e.replace(/start|end/g,t=>Yfe[t])}function Qfe(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 Zfe(e,t,n,r){const o=Jd(e);let i=Qfe(Ks(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(GC)))),i}function Gb(e){return e.replace(/left|right|bottom|top/g,t=>qfe[t])}function Jfe(e){return{top:0,right:0,bottom:0,left:0,...e}}function NL(e){return typeof e!="number"?Jfe(e):{top:e,right:e,bottom:e,left:e}}function qb(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function YI(e,t,n){let{reference:r,floating:o}=e;const i=ef(t),s=QR(t),a=XR(s),l=Ks(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Jd(t)){case"start":p[s]-=f*(n&&c?-1:1);break;case"end":p[s]+=f*(n&&c?-1:1);break}return p}const ehe=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=YI(c,r,l),f=r,p={},m=0;for(let v=0;v<a.length;v++){const{name:y,fn:b}=a[v],{x,y:E,data:R,reset:P}=await b({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});if(u=x??u,d=E??d,p={...p,[y]:{...p[y],...R}},P&&m<=50){m++,typeof P=="object"&&(P.placement&&(f=P.placement),P.rects&&(c=P.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:u,y:d}=YI(c,f,l)),v=-1;continue}}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}};async function Ua(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Ys(t,e),m=NL(p),y=a[f?d==="floating"?"reference":"floating":d],b=qb(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),x=d==="floating"?{...s.floating,x:r,y:o}:s.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),R=await(i.isElement==null?void 0:i.isElement(E))?await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1}:{x:1,y:1},P=qb(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:E,strategy:l}):x);return{top:(b.top-P.top+m.top)/R.y,bottom:(P.bottom-b.bottom+m.bottom)/R.y,left:(b.left-P.left+m.left)/R.x,right:(P.right-b.right+m.right)/R.x}}const KI=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Ys(e,t)||{};if(c==null)return{};const d=NL(u),f={x:n,y:r},p=QR(o),m=XR(p),v=await s.getDimensions(c),y=p==="y",b=y?"top":"left",x=y?"bottom":"right",E=y?"clientHeight":"clientWidth",R=i.reference[m]+i.reference[p]-f[p]-i.floating[m],P=f[p]-i.reference[p],O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=O?O[E]:0;(!A||!await(s.isElement==null?void 0:s.isElement(O)))&&(A=a.floating[E]||i.floating[m]);const D=R/2-P/2,I=A/2-v[m]/2-1,L=tl(d[b],I),j=tl(d[x],I),z=L,K=A-v[m]-j,H=A/2-v[m]/2+D,k=UC(z,H,K),W=!l.arrow&&Jd(o)!=null&&H!=k&&i.reference[m]/2-(H<z?L:j)-v[m]/2<0,B=W?H<z?H-z:H-K:0;return{[p]:f[p]+B,data:{[p]:k,centerOffset:H-k-B,...W&&{alignmentOffset:B}},reset:W}}}),the=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...y}=Ys(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Ks(o),x=Ks(a)===a,E=await(l.isRTL==null?void 0:l.isRTL(c.floating)),R=f||(x||!v?[Gb(a)]:Xfe(a));!f&&m!=="none"&&R.push(...Zfe(a,v,m,E));const P=[a,...R],O=await Ua(t,y),A=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&A.push(O[b]),d){const z=Kfe(o,s,E);A.push(O[z[0]],O[z[1]])}if(D=[...D,{placement:o,overflows:A}],!A.every(z=>z<=0)){var I,L;const z=(((I=i.flip)==null?void 0:I.index)||0)+1,K=P[z];if(K)return{data:{index:z,overflows:D},reset:{placement:K}};let H=(L=D.filter(k=>k.overflows[0]<=0).sort((k,W)=>k.overflows[1]-W.overflows[1])[0])==null?void 0:L.placement;if(!H)switch(p){case"bestFit":{var j;const k=(j=D.map(W=>[W.placement,W.overflows.filter(B=>B>0).reduce((B,U)=>B+U,0)]).sort((W,B)=>W[1]-B[1])[0])==null?void 0:j[0];k&&(H=k);break}case"initialPlacement":H=a;break}if(o!==H)return{reset:{placement:H}}}return{}}}};function XI(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function QI(e){return Gfe.some(t=>e[t]>=0)}const nhe=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Ys(e,t);switch(r){case"referenceHidden":{const i=await Ua(t,{...o,elementContext:"reference"}),s=XI(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:QI(s)}}}case"escaped":{const i=await Ua(t,{...o,altBoundary:!0}),s=XI(i,n.floating);return{data:{escapedOffsets:s,escaped:QI(s)}}}default:return{}}}}};async function rhe(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ks(n),a=Jd(n),l=ef(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=Ys(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}const ohe=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 rhe(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}}}}},ihe=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:y=>{let{x:b,y:x}=y;return{x:b,y:x}}},...l}=Ys(e,t),c={x:n,y:r},u=await Ua(t,l),d=ef(Ks(o)),f=KR(d);let p=c[f],m=c[d];if(i){const y=f==="y"?"top":"left",b=f==="y"?"bottom":"right",x=p+u[y],E=p-u[b];p=UC(x,p,E)}if(s){const y=d==="y"?"top":"left",b=d==="y"?"bottom":"right",x=m+u[y],E=m-u[b];m=UC(x,m,E)}const v=a.fn({...t,[f]:p,[d]:m});return{...v,data:{x:v.x-n,y:v.y-r}}}}},she=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Ys(e,t),u={x:n,y:r},d=ef(o),f=KR(d);let p=u[f],m=u[d];const v=Ys(a,t),y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const E=f==="y"?"height":"width",R=i.reference[f]-i.floating[E]+y.mainAxis,P=i.reference[f]+i.reference[E]-y.mainAxis;p<R?p=R:p>P&&(p=P)}if(c){var b,x;const E=f==="y"?"width":"height",R=["top","left"].includes(Ks(o)),P=i.reference[d]-i.floating[E]+(R&&((b=s.offset)==null?void 0:b[d])||0)+(R?0:y.crossAxis),O=i.reference[d]+i.reference[E]+(R?0:((x=s.offset)==null?void 0:x[d])||0)-(R?y.crossAxis:0);m<P?m=P:m>O&&(m=O)}return{[f]:p,[d]:m}}}},ahe=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}=Ys(e,t),l=await Ua(t,a),c=Ks(n),u=Jd(n),d=ef(n)==="y",{width:f,height:p}=r.floating;let m,v;c==="top"||c==="bottom"?(m=c,v=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(v=c,m=u==="end"?"top":"bottom");const y=p-l[m],b=f-l[v],x=!t.middlewareData.shift;let E=y,R=b;if(d){const O=f-l.left-l.right;R=u||x?tl(b,O):O}else{const O=p-l.top-l.bottom;E=u||x?tl(y,O):O}if(x&&!u){const O=Co(l.left,0),A=Co(l.right,0),D=Co(l.top,0),I=Co(l.bottom,0);d?R=f-2*(O!==0||A!==0?O+A:Co(l.left,l.right)):E=p-2*(D!==0||I!==0?D+I:Co(l.top,l.bottom))}await s({...t,availableWidth:R,availableHeight:E});const P=await o.getDimensions(i.floating);return f!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function rl(e){return kL(e)?(e.nodeName||"").toLowerCase():"#document"}function Ro(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Zs(e){var t;return(t=(kL(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function kL(e){return e instanceof Node||e instanceof Ro(e).Node}function Xs(e){return e instanceof Element||e instanceof Ro(e).Element}function os(e){return e instanceof HTMLElement||e instanceof Ro(e).HTMLElement}function ZI(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ro(e).ShadowRoot}function lg(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ri(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function lhe(e){return["table","td","th"].includes(rl(e))}function ZR(e){const t=JR(),n=ri(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 che(e){let t=kd(e);for(;os(t)&&!ry(t);){if(ZR(t))return t;t=kd(t)}return null}function JR(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ry(e){return["html","body","#document"].includes(rl(e))}function ri(e){return Ro(e).getComputedStyle(e)}function oy(e){return Xs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function kd(e){if(rl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ZI(e)&&e.host||Zs(e);return ZI(t)?t.host:t}function LL(e){const t=kd(e);return ry(t)?e.ownerDocument?e.ownerDocument.body:e.body:os(t)&&lg(t)?t:LL(t)}function ip(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=LL(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ro(o);return i?t.concat(s,s.visualViewport||[],lg(o)?o:[],s.frameElement&&n?ip(s.frameElement):[]):t.concat(o,ip(o,[],n))}function FL(e){const t=ri(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=os(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Ub(n)!==i||Ub(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function e2(e){return Xs(e)?e:e.contextElement}function Qu(e){const t=e2(e);if(!os(t))return nl(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=FL(t);let s=(i?Ub(n.width):n.width)/r,a=(i?Ub(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const uhe=nl(0);function jL(e){const t=Ro(e);return!JR()||!t.visualViewport?uhe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dhe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ro(e)?!1:t}function $c(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=e2(e);let s=nl(1);t&&(r?Xs(r)&&(s=Qu(r)):s=Qu(e));const a=dhe(i,n,r)?jL(i):nl(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const f=Ro(i),p=r&&Xs(r)?Ro(r):r;let m=f.frameElement;for(;m&&r&&p!==f;){const v=Qu(m),y=m.getBoundingClientRect(),b=ri(m),x=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*v.x,E=y.top+(m.clientTop+parseFloat(b.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=x,c+=E,m=Ro(m).frameElement}}return qb({width:u,height:d,x:l,y:c})}function fhe(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=os(n),i=Zs(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},a=nl(1);const l=nl(0);if((o||!o&&r!=="fixed")&&((rl(n)!=="body"||lg(i))&&(s=oy(n)),os(n))){const c=$c(n);a=Qu(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}}function hhe(e){return Array.from(e.getClientRects())}function zL(e){return $c(Zs(e)).left+oy(e).scrollLeft}function phe(e){const t=Zs(e),n=oy(e),r=e.ownerDocument.body,o=Co(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Co(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+zL(e);const a=-n.scrollTop;return ri(r).direction==="rtl"&&(s+=Co(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function ghe(e,t){const n=Ro(e),r=Zs(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const c=JR();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function mhe(e,t){const n=$c(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=os(e)?Qu(e):nl(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function JI(e,t,n){let r;if(t==="viewport")r=ghe(e,n);else if(t==="document")r=phe(Zs(e));else if(Xs(t))r=mhe(t,n);else{const o=jL(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return qb(r)}function BL(e,t){const n=kd(e);return n===t||!Xs(n)||ry(n)?!1:ri(n).position==="fixed"||BL(n,t)}function vhe(e,t){const n=t.get(e);if(n)return n;let r=ip(e,[],!1).filter(a=>Xs(a)&&rl(a)!=="body"),o=null;const i=ri(e).position==="fixed";let s=i?kd(e):e;for(;Xs(s)&&!ry(s);){const a=ri(s),l=ZR(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||lg(s)&&!l&&BL(e,s))?r=r.filter(u=>u!==s):o=a,s=kd(s)}return t.set(e,r),r}function bhe(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?vhe(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=JI(t,u,o);return c.top=Co(d.top,c.top),c.right=tl(d.right,c.right),c.bottom=tl(d.bottom,c.bottom),c.left=Co(d.left,c.left),c},JI(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function yhe(e){return FL(e)}function xhe(e,t,n){const r=os(t),o=Zs(t),i=n==="fixed",s=$c(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=nl(0);if(r||!r&&!i)if((rl(t)!=="body"||lg(o))&&(a=oy(t)),r){const c=$c(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=zL(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function e$(e,t){return!os(e)||ri(e).position==="fixed"?null:t?t(e):e.offsetParent}function VL(e,t){const n=Ro(e);if(!os(e))return n;let r=e$(e,t);for(;r&&lhe(r)&&ri(r).position==="static";)r=e$(r,t);return r&&(rl(r)==="html"||rl(r)==="body"&&ri(r).position==="static"&&!ZR(r))?n:r||che(e)||n}const whe=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||VL,i=this.getDimensions;return{reference:xhe(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function She(e){return ri(e).direction==="rtl"}const Che={convertOffsetParentRelativeRectToViewportRelativeRect:fhe,getDocumentElement:Zs,getClippingRect:bhe,getOffsetParent:VL,getElementRects:whe,getClientRects:hhe,getDimensions:yhe,getScale:Qu,isElement:Xs,isRTL:She};function _he(e,t){let n=null,r;const o=Zs(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;const p=cv(u),m=cv(o.clientWidth-(c+d)),v=cv(o.clientHeight-(u+f)),y=cv(c),x={rootMargin:-p+"px "+-m+"px "+-v+"px "+-y+"px",threshold:Co(0,tl(1,l))||1};let E=!0;function R(P){const O=P[0].intersectionRatio;if(O!==l){if(!E)return s();O?s(!1,O):r=setTimeout(()=>{s(!1,1e-7)},100)}E=!1}try{n=new IntersectionObserver(R,{...x,root:o.ownerDocument})}catch{n=new IntersectionObserver(R,x)}n.observe(e)}return s(!0),i}function cg(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=e2(e),u=o||i?[...c?ip(c):[],...ip(t)]:[];u.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const d=c&&a?_he(c,n):null;let f=-1,p=null;s&&(p=new ResizeObserver(b=>{let[x]=b;x&&x.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let m,v=l?$c(e):null;l&&y();function y(){const b=$c(e);v&&(b.x!==v.x||b.y!==v.y||b.width!==v.width||b.height!==v.height)&&n(),v=b,m=requestAnimationFrame(y)}return n(),()=>{u.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d&&d(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const Ehe=(e,t,n)=>{const r=new Map,o={platform:Che,...n},i={...o.platform,_c:r};return ehe(e,t,{...o,platform:i})};var rb=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Yb(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(!Yb(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)&&!Yb(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function HL(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function t$(e,t){const n=HL(e);return Math.round(t*n)/n}function tw(e){const t=S.useRef(e);return rb(()=>{t.current=e}),t}function ug(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=S.useState(r);Yb(f,r)||p(r);const[m,v]=S.useState(null),[y,b]=S.useState(null),x=S.useCallback(U=>{U!==O.current&&(O.current=U,v(U))},[]),E=S.useCallback(U=>{U!==A.current&&(A.current=U,b(U))},[]),R=i||m,P=s||y,O=S.useRef(null),A=S.useRef(null),D=S.useRef(u),I=l!=null,L=tw(l),j=tw(o),z=tw(c),K=S.useCallback(()=>{if(!O.current||!A.current)return;const U={placement:t,strategy:n,middleware:f};j.current&&(U.platform=j.current),Ehe(O.current,A.current,U).then(q=>{const $={...q,isPositioned:z.current!==!1};H.current&&!Yb(D.current,$)&&(D.current=$,Pi.flushSync(()=>{d($)}))})},[f,t,n,j,z]);rb(()=>{c===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(U=>({...U,isPositioned:!1})))},[c]);const H=S.useRef(!1);rb(()=>(H.current=!0,()=>{H.current=!1}),[]),rb(()=>{if(R&&(O.current=R),P&&(A.current=P),R&&P){if(L.current)return L.current(R,P,K);K()}},[R,P,K,L,I]);const k=S.useMemo(()=>({reference:O,floating:A,setReference:x,setFloating:E}),[x,E]),W=S.useMemo(()=>({reference:R,floating:P}),[R,P]),B=S.useMemo(()=>{const U={position:n,left:0,top:0};if(!W.floating)return U;const q=t$(W.floating,u.x),$=t$(W.floating,u.y);return a?{...U,transform:"translate("+q+"px, "+$+"px)",...HL(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:$}},[n,a,W.floating,u.x,u.y]);return S.useMemo(()=>({...u,update:K,refs:k,elements:W,floatingStyles:B}),[u,K,k,W,B])}const Rhe=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?KI({element:r.current,padding:o}).fn(n):{}:r?KI({element:r,padding:o}).fn(n):{}}}},tf=(e,t)=>({...ohe(e),options:[e,t]}),dg=(e,t)=>({...ihe(e),options:[e,t]}),iy=(e,t)=>({...she(e),options:[e,t]}),fg=(e,t)=>({...the(e),options:[e,t]}),hg=(e,t)=>({...ahe(e),options:[e,t]}),sy=(e,t)=>({...nhe(e),options:[e,t]}),ay=(e,t)=>({...Rhe(e),options:[e,t]});function t2(e){const[t,n]=w.useState(void 0);return Oc(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const WL="Popper",[UL,ly]=ls(WL),[Phe,GL]=UL(WL),Ohe=e=>{const{__scopePopper:t,children:n}=e,[r,o]=w.useState(null);return w.createElement(Phe,{scope:t,anchor:r,onAnchorChange:o},n)},Ahe="PopperAnchor",The=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=GL(Ahe,n),s=w.useRef(null),a=so(t,s);return w.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:w.createElement(On.div,He({},o,{ref:a}))}),qL="PopperContent",[Dhe,h3e]=UL(qL),Mhe=w.forwardRef((e,t)=>{var n,r,o,i,s,a,l,c;const{__scopePopper:u,side:d="bottom",sideOffset:f=0,align:p="center",alignOffset:m=0,arrowPadding:v=0,avoidCollisions:y=!0,collisionBoundary:b=[],collisionPadding:x=0,sticky:E="partial",hideWhenDetached:R=!1,updatePositionStrategy:P="optimized",onPlaced:O,...A}=e,D=GL(qL,u),[I,L]=w.useState(null),j=so(t,Se=>L(Se)),[z,K]=w.useState(null),H=t2(z),k=(n=H==null?void 0:H.width)!==null&&n!==void 0?n:0,W=(r=H==null?void 0:H.height)!==null&&r!==void 0?r:0,B=d+(p!=="center"?"-"+p:""),U=typeof x=="number"?x:{top:0,right:0,bottom:0,left:0,...x},q=Array.isArray(b)?b:[b],$=q.length>0,Y={padding:U,boundary:q.filter(Ihe),altBoundary:$},{refs:X,floatingStyles:M,placement:oe,isPositioned:te,middlewareData:ie}=ug({strategy:"fixed",placement:B,whileElementsMounted:(...Se)=>cg(...Se,{animationFrame:P==="always"}),elements:{reference:D.anchor},middleware:[tf({mainAxis:f+W,alignmentAxis:m}),y&&dg({mainAxis:!0,crossAxis:!1,limiter:E==="partial"?iy():void 0,...Y}),y&&fg({...Y}),hg({...Y,apply:({elements:Se,rects:Ae,availableWidth:ze,availableHeight:Ie})=>{const{width:De,height:ot}=Ae.reference,_t=Se.floating.style;_t.setProperty("--radix-popper-available-width",`${ze}px`),_t.setProperty("--radix-popper-available-height",`${Ie}px`),_t.setProperty("--radix-popper-anchor-width",`${De}px`),_t.setProperty("--radix-popper-anchor-height",`${ot}px`)}}),z&&ay({element:z,padding:v}),$he({arrowWidth:k,arrowHeight:W}),R&&sy({strategy:"referenceHidden",...Y})]}),[ne,Z]=YL(oe),ae=Uc(O);Oc(()=>{te&&(ae==null||ae())},[te,ae]);const ce=(o=ie.arrow)===null||o===void 0?void 0:o.x,ve=(i=ie.arrow)===null||i===void 0?void 0:i.y,ee=((s=ie.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[ge,fe]=w.useState();return Oc(()=>{I&&fe(window.getComputedStyle(I).zIndex)},[I]),w.createElement("div",{ref:X.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:te?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ge,"--radix-popper-transform-origin":[(a=ie.transformOrigin)===null||a===void 0?void 0:a.x,(l=ie.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},w.createElement(Dhe,{scope:u,placedSide:ne,onArrowChange:K,arrowX:ce,arrowY:ve,shouldHideArrow:ee},w.createElement(On.div,He({"data-side":ne,"data-align":Z},A,{ref:j,style:{...A.style,animation:te?void 0:"none",opacity:(c=ie.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))});function Ihe(e){return e!==null}const $he=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:a,rects:l,middlewareData:c}=t,d=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,f=d?0:e.arrowWidth,p=d?0:e.arrowHeight,[m,v]=YL(a),y={start:"0%",center:"50%",end:"100%"}[v],b=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+f/2,x=((i=(s=c.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+p/2;let E="",R="";return m==="bottom"?(E=d?y:`${b}px`,R=`${-p}px`):m==="top"?(E=d?y:`${b}px`,R=`${l.floating.height+p}px`):m==="right"?(E=`${-p}px`,R=d?y:`${x}px`):m==="left"&&(E=`${l.floating.width+p}px`,R=d?y:`${x}px`),{data:{x:E,y:R}}}});function YL(e){const[t,n="center"]=e.split("-");return[t,n]}const KL=Ohe,XL=The,QL=Mhe;function Nhe(e,t=globalThis==null?void 0:globalThis.document){const n=Uc(e);w.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const qC="dismissableLayer.update",khe="dismissableLayer.pointerDownOutside",Lhe="dismissableLayer.focusOutside";let n$;const Fhe=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ZL=w.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:l,...c}=e,u=w.useContext(Fhe),[d,f]=w.useState(null),p=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,m]=w.useState({}),v=so(t,D=>f(D)),y=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(b),E=d?y.indexOf(d):-1,R=u.layersWithOutsidePointerEventsDisabled.size>0,P=E>=x,O=jhe(D=>{const I=D.target,L=[...u.branches].some(j=>j.contains(I));!P||L||(i==null||i(D),a==null||a(D),D.defaultPrevented||l==null||l())},p),A=zhe(D=>{const I=D.target;[...u.branches].some(j=>j.contains(I))||(s==null||s(D),a==null||a(D),D.defaultPrevented||l==null||l())},p);return Nhe(D=>{E===u.layers.size-1&&(o==null||o(D),!D.defaultPrevented&&l&&(D.preventDefault(),l()))},p),w.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(n$=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),r$(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=n$)}},[d,p,r,u]),w.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),r$())},[d,u]),w.useEffect(()=>{const D=()=>m({});return document.addEventListener(qC,D),()=>document.removeEventListener(qC,D)},[]),w.createElement(On.div,He({},c,{ref:v,style:{pointerEvents:R?P?"auto":"none":void 0,...e.style},onFocusCapture:Ft(e.onFocusCapture,A.onFocusCapture),onBlurCapture:Ft(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:Ft(e.onPointerDownCapture,O.onPointerDownCapture)}))});function jhe(e,t=globalThis==null?void 0:globalThis.document){const n=Uc(e),r=w.useRef(!1),o=w.useRef(()=>{});return w.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let c=function(){JL(khe,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function zhe(e,t=globalThis==null?void 0:globalThis.document){const n=Uc(e),r=w.useRef(!1);return w.useEffect(()=>{const o=i=>{i.target&&!r.current&&JL(Lhe,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 r$(){const e=new CustomEvent(qC);document.dispatchEvent(e)}function JL(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?See(o,i):o.dispatchEvent(i)}let nw;const e7="HoverCard",[t7,p3e]=ls(e7,[ly]),n2=ly(),[Bhe,r2]=t7(e7),Vhe=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=n2(t),c=w.useRef(0),u=w.useRef(0),d=w.useRef(!1),f=w.useRef(!1),[p=!1,m]=cs({prop:r,defaultProp:o,onChange:i}),v=w.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>m(!0),s)},[s,m]),y=w.useCallback(()=>{clearTimeout(c.current),!d.current&&!f.current&&(u.current=window.setTimeout(()=>m(!1),a))},[a,m]),b=w.useCallback(()=>m(!1),[m]);return w.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),w.createElement(Bhe,{scope:t,open:p,onOpenChange:m,onOpen:v,onClose:y,onDismiss:b,hasSelectionRef:d,isPointerDownOnContentRef:f},w.createElement(KL,l,n))},Hhe="HoverCardTrigger",Whe=w.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=r2(Hhe,n),i=n2(n);return w.createElement(XL,He({asChild:!0},i),w.createElement(On.a,He({"data-state":o.open?"open":"closed"},r,{ref:t,onPointerEnter:Ft(e.onPointerEnter,Kb(o.onOpen)),onPointerLeave:Ft(e.onPointerLeave,Kb(o.onClose)),onFocus:Ft(e.onFocus,o.onOpen),onBlur:Ft(e.onBlur,o.onClose),onTouchStart:Ft(e.onTouchStart,s=>s.preventDefault())})))}),Uhe="HoverCardPortal",[g3e,Ghe]=t7(Uhe,{forceMount:void 0}),YC="HoverCardContent",qhe=w.forwardRef((e,t)=>{const n=Ghe(YC,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=r2(YC,e.__scopeHoverCard);return w.createElement(qd,{present:r||i.open},w.createElement(Yhe,He({"data-state":i.open?"open":"closed"},o,{onPointerEnter:Ft(e.onPointerEnter,Kb(i.onOpen)),onPointerLeave:Ft(e.onPointerLeave,Kb(i.onClose)),ref:t})))}),Yhe=w.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=r2(YC,n),c=n2(n),u=w.useRef(null),d=so(t,u),[f,p]=w.useState(!1);return w.useEffect(()=>{if(f){const m=document.body;return nw=m.style.userSelect||m.style.webkitUserSelect,m.style.userSelect="none",m.style.webkitUserSelect="none",()=>{m.style.userSelect=nw,m.style.webkitUserSelect=nw}}},[f]),w.useEffect(()=>{if(u.current){const m=()=>{p(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var v;((v=document.getSelection())===null||v===void 0?void 0:v.toString())!==""&&(l.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",m),()=>{document.removeEventListener("pointerup",m),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!1}}},[l.isPointerDownOnContentRef,l.hasSelectionRef]),w.useEffect(()=>{u.current&&Khe(u.current).forEach(v=>v.setAttribute("tabindex","-1"))}),w.createElement(ZL,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Ft(i,m=>{m.preventDefault()}),onDismiss:l.onDismiss},w.createElement(QL,He({},c,a,{onPointerDown:Ft(a.onPointerDown,m=>{m.currentTarget.contains(m.target)&&p(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:d,style:{...a.style,userSelect:f?"text":void 0,WebkitUserSelect:f?"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 Kb(e){return t=>t.pointerType==="touch"?void 0:e()}function Khe(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 Xhe=Vhe,Qhe=Whe,n7=qhe,cy=Xhe,uy=Qhe,pg=S.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>C.jsx(n7,{ref:o,align:t,sideOffset:n,className:xe("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}));pg.displayName=n7.displayName;function r7({card:e}){const{setCardInfo:t}=fr();return C.jsxs(cy,{openDelay:0,children:[C.jsx(uy,{children:C.jsx(E4,{className:"size-4 text-muted-foreground/40"})}),C.jsx(pg,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:C.jsx(es,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:C.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}function Zhe({card:e,renderFilterInfo:t}){var m,v,y,b,x,E,R,P,O,A,D,I,L,j,z,K;we(H=>H.themeStyle);const{data:n,isLoading:r}=Y0(e),o=(n==null?void 0:n.records)||[],i=we(H=>H.isDashboardEditing),{getCurrency:s,getLocale:a}=ML(e),l=(v=(m=e.preferences)==null?void 0:m.formatNumber)==null?void 0:v.colorRanges,{metricKeys:c}=rr(o||[]),u=(y=o==null?void 0:o[0])==null?void 0:y[c==null?void 0:c[0]],d=(b=o==null?void 0:o[0])==null?void 0:b[c==null?void 0:c[1]],f=(o==null?void 0:o.length)>0,p=d&&d-u!==0?(u-d)/d:null;return C.jsx("div",{className:"flex min-w-fit grow flex-col overflow-auto",children:C.jsxs("div",{className:"grow",children:[f?C.jsx("div",{className:"",children:C.jsxs("div",{className:xe("flex items-end gap-1.5",{"animate-pulse":r}),children:[C.jsx("p",{style:{color:gR(u,l)},className:"text-3xl font-semibold",children:Us({number:u,decimalPlaces:((E=(x=e.preferences)==null?void 0:x.formatNumber)==null?void 0:E.decimalPlaces)||0,useSuffix:!!((P=(R=e.preferences)==null?void 0:R.formatNumber)!=null&&P.suffix),customSuffix:((A=(O=e.preferences)==null?void 0:O.formatNumber)==null?void 0:A.suffix)||"",locale:a()||"",currency:s()||""})}),p&&C.jsxs("div",{className:"flex items-end gap-1",children:[C.jsx($L,{className:"",children:p}),d&&C.jsx("div",{className:"ml-0.5 mr-1 min-w-fit text-sm font-normal text-muted-foreground",children:`from ${Us({number:d,decimalPlaces:((I=(D=e.preferences)==null?void 0:D.formatNumber)==null?void 0:I.decimalPlaces)||0,useSuffix:!!((j=(L=e.preferences)==null?void 0:L.formatNumber)!=null&&j.suffix),customSuffix:((K=(z=e.preferences)==null?void 0:z.formatNumber)==null?void 0:K.suffix)||"",locale:a()||"",currency:s()||""})}`})]})]})}):C.jsx("div",{className:"flex h-9 items-center justify-center"}),C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsxs(Gd,{className:"flex items-center gap-2 text-base font-medium text-muted-foreground",children:[e.title,(i||e.info)&&C.jsx(r7,{card:e})]}),t==null?void 0:t()]})]})})}const Jhe=w.forwardRef((e,t)=>{const{children:n,...r}=e,o=w.Children.toArray(n),i=o.find(epe);if(i){const s=i.props.children,a=o.map(l=>l===i?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:l);return w.createElement(KC,He({},r,{ref:t}),w.isValidElement(s)?w.cloneElement(s,void 0,a):null)}return w.createElement(KC,He({},r,{ref:t}),n)});Jhe.displayName="Slot";const KC=w.forwardRef((e,t)=>{const{children:n,...r}=e;return w.isValidElement(n)?w.cloneElement(n,{...tpe(r,n.props),ref:t?A0(t,n.ref):n.ref}):w.Children.count(n)>1?w.Children.only(null):null});KC.displayName="SlotClone";const o7=({children:e})=>w.createElement(w.Fragment,null,e);function epe(e){return w.isValidElement(e)&&e.type===o7}function tpe(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}}const npe=w.forwardRef((e,t)=>w.createElement(On.span,He({},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}}))),rpe=npe,[dy,m3e]=ls("Tooltip",[ly]),o2=ly(),ope="TooltipProvider",ipe=700,XC="tooltip.open",[spe,i2]=dy(ope),ape=e=>{const{__scopeTooltip:t,delayDuration:n=ipe,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=w.useState(!0),l=w.useRef(!1),c=w.useRef(0);return w.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),w.createElement(spe,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:w.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:w.useCallback(u=>{l.current=u},[]),disableHoverableContent:o},i)},s2="Tooltip",[lpe,fy]=dy(s2),cpe=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=i2(s2,e.__scopeTooltip),c=o2(t),[u,d]=w.useState(null),f=Jp(),p=w.useRef(0),m=s??l.disableHoverableContent,v=a??l.delayDuration,y=w.useRef(!1),[b=!1,x]=cs({prop:r,defaultProp:o,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(XC))):l.onClose(),i==null||i(A)}}),E=w.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),R=w.useCallback(()=>{window.clearTimeout(p.current),y.current=!1,x(!0)},[x]),P=w.useCallback(()=>{window.clearTimeout(p.current),x(!1)},[x]),O=w.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{y.current=!0,x(!0)},v)},[v,x]);return w.useEffect(()=>()=>window.clearTimeout(p.current),[]),w.createElement(KL,c,w.createElement(lpe,{scope:t,contentId:f,open:b,stateAttribute:E,trigger:u,onTriggerChange:d,onTriggerEnter:w.useCallback(()=>{l.isOpenDelayed?O():R()},[l.isOpenDelayed,O,R]),onTriggerLeave:w.useCallback(()=>{m?P():window.clearTimeout(p.current)},[P,m]),onOpen:R,onClose:P,disableHoverableContent:m},n))},o$="TooltipTrigger",i7=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=fy(o$,n),i=i2(o$,n),s=o2(n),a=w.useRef(null),l=so(t,a,o.onTriggerChange),c=w.useRef(!1),u=w.useRef(!1),d=w.useCallback(()=>c.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),w.createElement(XL,He({asChild:!0},s),w.createElement(On.button,He({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:Ft(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:Ft(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:Ft(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Ft(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Ft(e.onBlur,o.onClose),onClick:Ft(e.onClick,o.onClose)})))}),upe="TooltipPortal",[v3e,dpe]=dy(upe,{forceMount:void 0}),sp="TooltipContent",fpe=w.forwardRef((e,t)=>{const n=dpe(sp,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=fy(sp,e.__scopeTooltip);return w.createElement(qd,{present:r||s.open},s.disableHoverableContent?w.createElement(s7,He({side:o},i,{ref:t})):w.createElement(hpe,He({side:o},i,{ref:t})))}),hpe=w.forwardRef((e,t)=>{const n=fy(sp,e.__scopeTooltip),r=i2(sp,e.__scopeTooltip),o=w.useRef(null),i=so(t,o),[s,a]=w.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,f=w.useCallback(()=>{a(null),d(!1)},[d]),p=w.useCallback((m,v)=>{const y=m.currentTarget,b={x:m.clientX,y:m.clientY},x=gpe(b,y.getBoundingClientRect()),E=mpe(b,x),R=vpe(v.getBoundingClientRect()),P=ype([...E,...R]);a(P),d(!0)},[d]);return w.useEffect(()=>()=>f(),[f]),w.useEffect(()=>{if(l&&u){const m=y=>p(y,u),v=y=>p(y,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",v)}}},[l,u,p,f]),w.useEffect(()=>{if(s){const m=v=>{const y=v.target,b={x:v.clientX,y:v.clientY},x=(l==null?void 0:l.contains(y))||(u==null?void 0:u.contains(y)),E=!bpe(b,s);x?f():E&&(f(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,s,c,f]),w.createElement(s7,He({},e,{ref:i}))}),[ppe,b3e]=dy(s2,{isInside:!1}),s7=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=fy(sp,n),c=o2(n),{onClose:u}=l;return w.useEffect(()=>(document.addEventListener(XC,u),()=>document.removeEventListener(XC,u)),[u]),w.useEffect(()=>{if(l.trigger){const d=f=>{const p=f.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),w.createElement(ZL,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u},w.createElement(QL,He({"data-state":l.stateAttribute},c,a,{ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),w.createElement(o7,null,r),w.createElement(ppe,{scope:n,isInside:!0},w.createElement(rpe,{id:l.contentId,role:"tooltip"},o||r))))});function gpe(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 mpe(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 vpe(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 bpe(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function ype(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),xpe(t)}function xpe(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 wpe=ape,Spe=cpe,Cpe=i7,a7=fpe,_pe=wpe,l7=Spe,c7=Cpe,a2=S.forwardRef(({className:e,sideOffset:t=4,...n},r)=>C.jsx(a7,{ref:r,sideOffset:t,className:xe("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}));a2.displayName=a7.displayName;/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */const{entries:u7,setPrototypeOf:i$,isFrozen:Epe,getPrototypeOf:Rpe,getOwnPropertyDescriptor:Ppe}=Object;let{freeze:Fr,seal:oi,create:d7}=Object,{apply:QC,construct:ZC}=typeof Reflect<"u"&&Reflect;Fr||(Fr=function(t){return t});oi||(oi=function(t){return t});QC||(QC=function(t,n,r){return t.apply(n,r)});ZC||(ZC=function(t,n){return new t(...n)});const uv=To(Array.prototype.forEach),s$=To(Array.prototype.pop),jf=To(Array.prototype.push),ob=To(String.prototype.toLowerCase),rw=To(String.prototype.toString),a$=To(String.prototype.match),zf=To(String.prototype.replace),Ope=To(String.prototype.indexOf),Ape=To(String.prototype.trim),gi=To(Object.prototype.hasOwnProperty),Or=To(RegExp.prototype.test),Bf=Tpe(TypeError);function To(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return QC(e,t,r)}}function Tpe(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return ZC(e,n)}}function Tt(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ob;i$&&i$(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(Epe(t)||(t[r]=i),o=i)}e[o]=!0}return e}function Dpe(e){for(let t=0;t<e.length;t++)gi(e,t)||(e[t]=null);return e}function jl(e){const t=d7(null);for(const[n,r]of u7(e))gi(e,n)&&(Array.isArray(r)?t[n]=Dpe(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=jl(r):t[n]=r);return t}function Vf(e,t){for(;e!==null;){const r=Ppe(e,t);if(r){if(r.get)return To(r.get);if(typeof r.value=="function")return To(r.value)}e=Rpe(e)}function n(){return null}return n}const l$=Fr(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ow=Fr(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),iw=Fr(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Mpe=Fr(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),sw=Fr(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ipe=Fr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),c$=Fr(["#text"]),u$=Fr(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),aw=Fr(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),d$=Fr(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),dv=Fr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$pe=oi(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Npe=oi(/<%[\w\W]*|[\w\W]*%>/gm),kpe=oi(/\${[\w\W]*}/gm),Lpe=oi(/^data-[\-\w.\u00B7-\uFFFF]/),Fpe=oi(/^aria-[\-\w]+$/),f7=oi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jpe=oi(/^(?:\w+script|data):/i),zpe=oi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),h7=oi(/^html$/i),Bpe=oi(/^[a-z][.\w]*(-[.\w]+)+$/i);var f$=Object.freeze({__proto__:null,MUSTACHE_EXPR:$pe,ERB_EXPR:Npe,TMPLIT_EXPR:kpe,DATA_ATTR:Lpe,ARIA_ATTR:Fpe,IS_ALLOWED_URI:f7,IS_SCRIPT_OR_DATA:jpe,ATTR_WHITESPACE:zpe,DOCTYPE_NAME:h7,CUSTOM_ELEMENT:Bpe});const Hf={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Vpe=function(){return typeof window>"u"?null:window},Hpe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function p7(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Vpe();const t=Me=>p7(Me);if(t.version="3.1.6",t.removed=[],!e||!e.document||e.document.nodeType!==Hf.document)return t.isSupported=!1,t;let{document:n}=e;const r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:f,trustedTypes:p}=e,m=l.prototype,v=Vf(m,"cloneNode"),y=Vf(m,"remove"),b=Vf(m,"nextSibling"),x=Vf(m,"childNodes"),E=Vf(m,"parentNode");if(typeof s=="function"){const Me=n.createElement("template");Me.content&&Me.content.ownerDocument&&(n=Me.content.ownerDocument)}let R,P="";const{implementation:O,createNodeIterator:A,createDocumentFragment:D,getElementsByTagName:I}=n,{importNode:L}=r;let j={};t.isSupported=typeof u7=="function"&&typeof E=="function"&&O&&O.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:K,TMPLIT_EXPR:H,DATA_ATTR:k,ARIA_ATTR:W,IS_SCRIPT_OR_DATA:B,ATTR_WHITESPACE:U,CUSTOM_ELEMENT:q}=f$;let{IS_ALLOWED_URI:$}=f$,Y=null;const X=Tt({},[...l$,...ow,...iw,...sw,...c$]);let M=null;const oe=Tt({},[...u$,...aw,...d$,...dv]);let te=Object.seal(d7(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ie=null,ne=null,Z=!0,ae=!0,ce=!1,ve=!0,ee=!1,ge=!0,fe=!1,Se=!1,Ae=!1,ze=!1,Ie=!1,De=!1,ot=!0,_t=!1;const rn="user-content-";let $t=!0,on=!1,pe={},Pe=null;const je=Tt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let qe=null;const tt=Tt({},["audio","video","img","source","image","track"]);let sn=null;const _n=Tt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),mn="http://www.w3.org/1998/Math/MathML",Bn="http://www.w3.org/2000/svg",vn="http://www.w3.org/1999/xhtml";let Bt=vn,cn=!1,An=null;const et=Tt({},[mn,Bn,vn],rw);let pt=null;const Mt=["application/xhtml+xml","text/html"],Jt="text/html";let yt=null,Vn=null;const ai=n.createElement("form"),na=function(J){return J instanceof RegExp||J instanceof Function},li=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Vn&&Vn===J)){if((!J||typeof J!="object")&&(J={}),J=jl(J),pt=Mt.indexOf(J.PARSER_MEDIA_TYPE)===-1?Jt:J.PARSER_MEDIA_TYPE,yt=pt==="application/xhtml+xml"?rw:ob,Y=gi(J,"ALLOWED_TAGS")?Tt({},J.ALLOWED_TAGS,yt):X,M=gi(J,"ALLOWED_ATTR")?Tt({},J.ALLOWED_ATTR,yt):oe,An=gi(J,"ALLOWED_NAMESPACES")?Tt({},J.ALLOWED_NAMESPACES,rw):et,sn=gi(J,"ADD_URI_SAFE_ATTR")?Tt(jl(_n),J.ADD_URI_SAFE_ATTR,yt):_n,qe=gi(J,"ADD_DATA_URI_TAGS")?Tt(jl(tt),J.ADD_DATA_URI_TAGS,yt):tt,Pe=gi(J,"FORBID_CONTENTS")?Tt({},J.FORBID_CONTENTS,yt):je,ie=gi(J,"FORBID_TAGS")?Tt({},J.FORBID_TAGS,yt):{},ne=gi(J,"FORBID_ATTR")?Tt({},J.FORBID_ATTR,yt):{},pe=gi(J,"USE_PROFILES")?J.USE_PROFILES:!1,Z=J.ALLOW_ARIA_ATTR!==!1,ae=J.ALLOW_DATA_ATTR!==!1,ce=J.ALLOW_UNKNOWN_PROTOCOLS||!1,ve=J.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ee=J.SAFE_FOR_TEMPLATES||!1,ge=J.SAFE_FOR_XML!==!1,fe=J.WHOLE_DOCUMENT||!1,ze=J.RETURN_DOM||!1,Ie=J.RETURN_DOM_FRAGMENT||!1,De=J.RETURN_TRUSTED_TYPE||!1,Ae=J.FORCE_BODY||!1,ot=J.SANITIZE_DOM!==!1,_t=J.SANITIZE_NAMED_PROPS||!1,$t=J.KEEP_CONTENT!==!1,on=J.IN_PLACE||!1,$=J.ALLOWED_URI_REGEXP||f7,Bt=J.NAMESPACE||vn,te=J.CUSTOM_ELEMENT_HANDLING||{},J.CUSTOM_ELEMENT_HANDLING&&na(J.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(te.tagNameCheck=J.CUSTOM_ELEMENT_HANDLING.tagNameCheck),J.CUSTOM_ELEMENT_HANDLING&&na(J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(te.attributeNameCheck=J.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),J.CUSTOM_ELEMENT_HANDLING&&typeof J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(te.allowCustomizedBuiltInElements=J.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ee&&(ae=!1),Ie&&(ze=!0),pe&&(Y=Tt({},c$),M=[],pe.html===!0&&(Tt(Y,l$),Tt(M,u$)),pe.svg===!0&&(Tt(Y,ow),Tt(M,aw),Tt(M,dv)),pe.svgFilters===!0&&(Tt(Y,iw),Tt(M,aw),Tt(M,dv)),pe.mathMl===!0&&(Tt(Y,sw),Tt(M,d$),Tt(M,dv))),J.ADD_TAGS&&(Y===X&&(Y=jl(Y)),Tt(Y,J.ADD_TAGS,yt)),J.ADD_ATTR&&(M===oe&&(M=jl(M)),Tt(M,J.ADD_ATTR,yt)),J.ADD_URI_SAFE_ATTR&&Tt(sn,J.ADD_URI_SAFE_ATTR,yt),J.FORBID_CONTENTS&&(Pe===je&&(Pe=jl(Pe)),Tt(Pe,J.FORBID_CONTENTS,yt)),$t&&(Y["#text"]=!0),fe&&Tt(Y,["html","head","body"]),Y.table&&(Tt(Y,["tbody"]),delete ie.tbody),J.TRUSTED_TYPES_POLICY){if(typeof J.TRUSTED_TYPES_POLICY.createHTML!="function")throw Bf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof J.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Bf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=J.TRUSTED_TYPES_POLICY,P=R.createHTML("")}else R===void 0&&(R=Hpe(p,o)),R!==null&&typeof P=="string"&&(P=R.createHTML(""));Fr&&Fr(J),Vn=J}},gs=Tt({},["mi","mo","mn","ms","mtext"]),Mi=Tt({},["foreignobject","annotation-xml"]),ms=Tt({},["title","style","font","a","script"]),ra=Tt({},[...ow,...iw,...Mpe]),Ii=Tt({},[...sw,...Ipe]),vs=function(J){let be=E(J);(!be||!be.tagName)&&(be={namespaceURI:Bt,tagName:"template"});const $e=ob(J.tagName),at=ob(be.tagName);return An[J.namespaceURI]?J.namespaceURI===Bn?be.namespaceURI===vn?$e==="svg":be.namespaceURI===mn?$e==="svg"&&(at==="annotation-xml"||gs[at]):!!ra[$e]:J.namespaceURI===mn?be.namespaceURI===vn?$e==="math":be.namespaceURI===Bn?$e==="math"&&Mi[at]:!!Ii[$e]:J.namespaceURI===vn?be.namespaceURI===Bn&&!Mi[at]||be.namespaceURI===mn&&!gs[at]?!1:!Ii[$e]&&(ms[$e]||!ra[$e]):!!(pt==="application/xhtml+xml"&&An[J.namespaceURI]):!1},er=function(J){jf(t.removed,{element:J});try{E(J).removeChild(J)}catch{y(J)}},$i=function(J,be){try{jf(t.removed,{attribute:be.getAttributeNode(J),from:be})}catch{jf(t.removed,{attribute:null,from:be})}if(be.removeAttribute(J),J==="is"&&!M[J])if(ze||Ie)try{er(be)}catch{}else try{be.setAttribute(J,"")}catch{}},oa=function(J){let be=null,$e=null;if(Ae)J="<remove></remove>"+J;else{const ft=a$(J,/^[\r\n\t ]+/);$e=ft&&ft[0]}pt==="application/xhtml+xml"&&Bt===vn&&(J='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+J+"</body></html>");const at=R?R.createHTML(J):J;if(Bt===vn)try{be=new f().parseFromString(at,pt)}catch{}if(!be||!be.documentElement){be=O.createDocument(Bt,"template",null);try{be.documentElement.innerHTML=cn?P:at}catch{}}const En=be.body||be.documentElement;return J&&$e&&En.insertBefore(n.createTextNode($e),En.childNodes[0]||null),Bt===vn?I.call(be,fe?"html":"body")[0]:fe?be.documentElement:En},ia=function(J){return A.call(J.ownerDocument||J,J,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},N=function(J){return J instanceof d&&(typeof J.nodeName!="string"||typeof J.textContent!="string"||typeof J.removeChild!="function"||!(J.attributes instanceof u)||typeof J.removeAttribute!="function"||typeof J.setAttribute!="function"||typeof J.namespaceURI!="string"||typeof J.insertBefore!="function"||typeof J.hasChildNodes!="function")},se=function(J){return typeof a=="function"&&J instanceof a},he=function(J,be,$e){j[J]&&uv(j[J],at=>{at.call(t,be,$e,Vn)})},Oe=function(J){let be=null;if(he("beforeSanitizeElements",J,null),N(J))return er(J),!0;const $e=yt(J.nodeName);if(he("uponSanitizeElement",J,{tagName:$e,allowedTags:Y}),J.hasChildNodes()&&!se(J.firstElementChild)&&Or(/<[/\w]/g,J.innerHTML)&&Or(/<[/\w]/g,J.textContent)||J.nodeType===Hf.progressingInstruction||ge&&J.nodeType===Hf.comment&&Or(/<[/\w]/g,J.data))return er(J),!0;if(!Y[$e]||ie[$e]){if(!ie[$e]&&Ue($e)&&(te.tagNameCheck instanceof RegExp&&Or(te.tagNameCheck,$e)||te.tagNameCheck instanceof Function&&te.tagNameCheck($e)))return!1;if($t&&!Pe[$e]){const at=E(J)||J.parentNode,En=x(J)||J.childNodes;if(En&&at){const ft=En.length;for(let pr=ft-1;pr>=0;--pr){const Fo=v(En[pr],!0);Fo.__removalCount=(J.__removalCount||0)+1,at.insertBefore(Fo,b(J))}}}return er(J),!0}return J instanceof l&&!vs(J)||($e==="noscript"||$e==="noembed"||$e==="noframes")&&Or(/<\/no(script|embed|frames)/i,J.innerHTML)?(er(J),!0):(ee&&J.nodeType===Hf.text&&(be=J.textContent,uv([z,K,H],at=>{be=zf(be,at," ")}),J.textContent!==be&&(jf(t.removed,{element:J.cloneNode()}),J.textContent=be)),he("afterSanitizeElements",J,null),!1)},Be=function(J,be,$e){if(ot&&(be==="id"||be==="name")&&($e in n||$e in ai))return!1;if(!(ae&&!ne[be]&&Or(k,be))){if(!(Z&&Or(W,be))){if(!M[be]||ne[be]){if(!(Ue(J)&&(te.tagNameCheck instanceof RegExp&&Or(te.tagNameCheck,J)||te.tagNameCheck instanceof Function&&te.tagNameCheck(J))&&(te.attributeNameCheck instanceof RegExp&&Or(te.attributeNameCheck,be)||te.attributeNameCheck instanceof Function&&te.attributeNameCheck(be))||be==="is"&&te.allowCustomizedBuiltInElements&&(te.tagNameCheck instanceof RegExp&&Or(te.tagNameCheck,$e)||te.tagNameCheck instanceof Function&&te.tagNameCheck($e))))return!1}else if(!sn[be]){if(!Or($,zf($e,U,""))){if(!((be==="src"||be==="xlink:href"||be==="href")&&J!=="script"&&Ope($e,"data:")===0&&qe[J])){if(!(ce&&!Or(B,zf($e,U,"")))){if($e)return!1}}}}}}return!0},Ue=function(J){return J!=="annotation-xml"&&a$(J,q)},Fe=function(J){he("beforeSanitizeAttributes",J,null);const{attributes:be}=J;if(!be)return;const $e={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:M};let at=be.length;for(;at--;){const En=be[at],{name:ft,namespaceURI:pr,value:Fo}=En,vl=yt(ft);let tr=ft==="value"?Fo:Ape(Fo);if($e.attrName=vl,$e.attrValue=tr,$e.keepAttr=!0,$e.forceKeepAttr=void 0,he("uponSanitizeAttribute",J,$e),tr=$e.attrValue,ge&&Or(/((--!?|])>)|<\/(style|title)/i,tr)){$i(ft,J);continue}if($e.forceKeepAttr||($i(ft,J),!$e.keepAttr))continue;if(!ve&&Or(/\/>/i,tr)){$i(ft,J);continue}ee&&uv([z,K,H],ff=>{tr=zf(tr,ff," ")});const df=yt(J.nodeName);if(Be(df,vl,tr)){if(_t&&(vl==="id"||vl==="name")&&($i(ft,J),tr=rn+tr),R&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!pr)switch(p.getAttributeType(df,vl)){case"TrustedHTML":{tr=R.createHTML(tr);break}case"TrustedScriptURL":{tr=R.createScriptURL(tr);break}}try{pr?J.setAttributeNS(pr,ft,tr):J.setAttribute(ft,tr),N(J)?er(J):s$(t.removed)}catch{}}}he("afterSanitizeAttributes",J,null)},ke=function Me(J){let be=null;const $e=ia(J);for(he("beforeSanitizeShadowDOM",J,null);be=$e.nextNode();)he("uponSanitizeShadowNode",be,null),!Oe(be)&&(be.content instanceof i&&Me(be.content),Fe(be));he("afterSanitizeShadowDOM",J,null)};return t.sanitize=function(Me){let J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},be=null,$e=null,at=null,En=null;if(cn=!Me,cn&&(Me="<!-->"),typeof Me!="string"&&!se(Me))if(typeof Me.toString=="function"){if(Me=Me.toString(),typeof Me!="string")throw Bf("dirty is not a string, aborting")}else throw Bf("toString is not a function");if(!t.isSupported)return Me;if(Se||li(J),t.removed=[],typeof Me=="string"&&(on=!1),on){if(Me.nodeName){const Fo=yt(Me.nodeName);if(!Y[Fo]||ie[Fo])throw Bf("root node is forbidden and cannot be sanitized in-place")}}else if(Me instanceof a)be=oa("<!---->"),$e=be.ownerDocument.importNode(Me,!0),$e.nodeType===Hf.element&&$e.nodeName==="BODY"||$e.nodeName==="HTML"?be=$e:be.appendChild($e);else{if(!ze&&!ee&&!fe&&Me.indexOf("<")===-1)return R&&De?R.createHTML(Me):Me;if(be=oa(Me),!be)return ze?null:De?P:""}be&&Ae&&er(be.firstChild);const ft=ia(on?Me:be);for(;at=ft.nextNode();)Oe(at)||(at.content instanceof i&&ke(at.content),Fe(at));if(on)return Me;if(ze){if(Ie)for(En=D.call(be.ownerDocument);be.firstChild;)En.appendChild(be.firstChild);else En=be;return(M.shadowroot||M.shadowrootmode)&&(En=L.call(r,En,!0)),En}let pr=fe?be.outerHTML:be.innerHTML;return fe&&Y["!doctype"]&&be.ownerDocument&&be.ownerDocument.doctype&&be.ownerDocument.doctype.name&&Or(h7,be.ownerDocument.doctype.name)&&(pr="<!DOCTYPE "+be.ownerDocument.doctype.name+`>
253
+ `+pr),ee&&uv([z,K,H],Fo=>{pr=zf(pr,Fo," ")}),R&&De?R.createHTML(pr):pr},t.setConfig=function(){let Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};li(Me),Se=!0},t.clearConfig=function(){Vn=null,Se=!1},t.isValidAttribute=function(Me,J,be){Vn||li({});const $e=yt(Me),at=yt(J);return Be($e,at,be)},t.addHook=function(Me,J){typeof J=="function"&&(j[Me]=j[Me]||[],jf(j[Me],J))},t.removeHook=function(Me){if(j[Me])return s$(j[Me])},t.removeHooks=function(Me){j[Me]&&(j[Me]=[])},t.removeAllHooks=function(){j={}},t}var h$=p7();function JC({card:e,isLoading:t,data:n}){var f,p;const r=n||[],{keys:o}=rr(r),i=we(m=>m.selectedSheetId),s=we(m=>m.isVisualEditing),a=(p=(f=e==null?void 0:e.preferences)==null?void 0:f.textVisualOptions)==null?void 0:p.isDynamicText,{setCardDescription:l}=fr(),{setCard:c}=W0();function u(){var b;if(t)return C.jsxs("div",{className:"space-y-2",children:[C.jsx(Gu,{className:"h-3 w-full animate-pulse bg-muted"}),C.jsx(Gu,{className:"h-3 w-3/4 animate-pulse bg-muted"}),C.jsx(Gu,{className:"h-3 w-1/2 animate-pulse bg-muted"})]});const m=(b=r==null?void 0:r[0])==null?void 0:b[o[0]],v=h$.sanitize(m),y=C.jsx("div",{dangerouslySetInnerHTML:{__html:v}});return C.jsx("div",{className:"text-sm hover:cursor-text",onMouseDown:x=>x.stopPropagation(),children:y})}function d(){return C.jsx("div",{onMouseDown:m=>m.stopPropagation(),children:C.jsx(es,{type:"textarea",className:"w-full",text:(e==null?void 0:e.description)||"Double click to add description",onSave:m=>{s===!1&&l(i,e.id,m),s===!0&&c({...e,description:m})},children:C.jsx("div",{dangerouslySetInnerHTML:{__html:h$.sanitize((e==null?void 0:e.description)||"")}})})})}return C.jsxs(C.Fragment,{children:[!a&&d(),a===!0&&u()]})}function Wpe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Upe(...e){return t=>e.forEach(n=>Wpe(n,t))}var hy=S.forwardRef((e,t)=>{const{children:n,...r}=e,o=S.Children.toArray(n),i=o.find(Gpe);if(i){const s=i.props.children,a=o.map(l=>l===i?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:l);return C.jsx(e_,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return C.jsx(e_,{...r,ref:t,children:n})});hy.displayName="Slot";var e_=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const o=Ype(n);return S.cloneElement(n,{...qpe(r,n.props),ref:t?Upe(t,o):o})}return S.Children.count(n)>1?S.Children.only(null):null});e_.displayName="SlotClone";var g7=({children:e})=>C.jsx(C.Fragment,{children:e});function Gpe(e){return S.isValidElement(e)&&e.type===g7}function qpe(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 Ype(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const p$=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,g$=lb,l2=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return g$(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(c=>{const u=n==null?void 0:n[c],d=i==null?void 0:i[c];if(u===null)return null;const f=p$(u)||p$(d);return o[c][f]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,f]=u;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:f,...p}=u;return Object.entries(p).every(m=>{let[v,y]=m;return Array.isArray(y)?y.includes({...i,...a}[v]):{...i,...a}[v]===y})?[...c,d,f]:c},[]);return g$(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},ap=l2("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"}}),ro=S.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?hy:"button";return C.jsx(s,{className:xe(ap({variant:t,size:n,className:e})),ref:i,...o})});ro.displayName="Button";const t_="horizontal",Kpe=["horizontal","vertical"],m7=w.forwardRef((e,t)=>{const{decorative:n,orientation:r=t_,...o}=e,i=v7(r)?r:t_,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return w.createElement(On.div,He({"data-orientation":i},a,o,{ref:t}))});m7.propTypes={orientation(e,t,n){const r=e[t],o=String(r);return r&&!v7(r)?new Error(Xpe(o,n)):null}};function Xpe(e,t){return`Invalid prop \`orientation\` of value \`${e}\` supplied to \`${t}\`, expected one of:
254
+ - horizontal
255
+ - vertical
256
+
257
+ Defaulting to \`${t_}\`.`}function v7(e){return Kpe.includes(e)}const b7=m7,gg=S.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>C.jsx(b7,{ref:o,decorative:n,orientation:t,className:xe("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));gg.displayName=b7.displayName;function Qpe(){var v,y;const e=we(b=>b.themeStyle),t=we(b=>b.filterValues),n=we(b=>b.dashboard.filters),r=we(b=>b.filteringCards),o=we(b=>b.selectedSheetId),{removeFilterValue:i,removeFilteringCard:s,setFilterValues:a,setFilteringCards:l}=fr(),c=n==null?void 0:n.filter(b=>b.sheetId===o||!b.sheetId),u=t==null?void 0:t.filter(b=>(c==null?void 0:c.some(x=>x.id===b.filterId))||b.filterId.endsWith(o));if(!u||u.length===0)return null;const d=u.map(b=>{const x=n==null?void 0:n.find(E=>E.id===b.filterId);return{filterId:b.filterId,name:(x==null?void 0:x.title)||b.name,values:b.values}});function f(b){return b instanceof Date?b.toLocaleDateString():b}function p(b){const x=r==null?void 0:r.find(E=>b.filterId.startsWith(E.id));x&&s(x),i(b.filterId)}function m(b){var x,E;return C.jsxs("div",{className:"space-y-2",children:[C.jsxs("div",{style:{borderRadius:(E=(x=e==null?void 0:e.chart)==null?void 0:x.options)==null?void 0:E.borderRadius},className:"flex w-fit items-center gap-2 bg-muted-foreground px-2 py-1 font-semibold text-muted",children:[C.jsx("span",{className:"break-words",children:b.name}),C.jsx(Yd,{onClick:()=>p(b),className:"size-3 text-muted hover:cursor-pointer hover:text-background"})]}),C.jsx("div",{className:"flex flex-wrap gap-1",children:b.values.map(R=>{var P,O;return C.jsx("span",{style:{borderRadius:(O=(P=e==null?void 0:e.chart)==null?void 0:P.options)==null?void 0:O.borderRadius},className:"inline-block",children:f(R)},R.toString())})})]})}return C.jsxs(cy,{openDelay:100,children:[C.jsx(uy,{children:C.jsx(C4,{className:"z-100 size-3.5 text-muted-foreground/40"})}),C.jsxs(pg,{style:{borderRadius:(y=(v=e==null?void 0:e.chart)==null?void 0:v.options)==null?void 0:y.borderRadius},className:"relative flex min-h-fit w-[300px] flex-col px-0 text-xs",align:"start",children:[C.jsx(dR,{onClick:()=>{l([]),a([])},className:"absolute right-4 size-3.5 text-muted-foreground/40 hover:cursor-pointer"}),C.jsx("div",{className:"h-fit max-h-[150px] min-h-0 grow overflow-auto",children:d==null?void 0:d.map(b=>C.jsxs("div",{className:"px-5",children:[m(b),C.jsx(gg,{className:"my-2"})]},b.name))})]})]})}const c2=S.forwardRef(({className:e,containerClassName:t,containerStyle:n,...r},o)=>C.jsx("div",{style:n,className:xe("relative w-full overflow-auto",t),children:C.jsx("table",{ref:o,className:xe("w-full caption-bottom text-sm",e),...r})}));c2.displayName="Table";const u2=S.forwardRef(({className:e,...t},n)=>C.jsx("thead",{ref:n,className:xe("[&_tr]:border-b",e),...t}));u2.displayName="TableHeader";const d2=S.forwardRef(({className:e,...t},n)=>C.jsx("tbody",{ref:n,className:xe("[&_tr:last-child]:border-0",e),...t}));d2.displayName="TableBody";const Zpe=S.forwardRef(({className:e,...t},n)=>C.jsx("tfoot",{ref:n,className:xe("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Zpe.displayName="TableFooter";const $h=S.forwardRef(({className:e,...t},n)=>C.jsx("tr",{ref:n,className:xe("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));$h.displayName="TableRow";const f2=S.forwardRef(({className:e,...t},n)=>C.jsx("th",{ref:n,className:xe("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));f2.displayName="TableHead";const h2=S.forwardRef(({className:e,...t},n)=>C.jsx("td",{ref:n,className:xe("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));h2.displayName="TableCell";const Jpe=S.forwardRef(({className:e,...t},n)=>C.jsx("caption",{ref:n,className:xe("mt-4 text-sm text-muted-foreground",e),...t}));Jpe.displayName="TableCaption";/**
258
+ * table-core
259
+ *
260
+ * Copyright (c) TanStack
261
+ *
262
+ * This source code is licensed under the MIT license found in the
263
+ * LICENSE.md file in the root directory of this source tree.
264
+ *
265
+ * @license MIT
266
+ */function Ba(e,t){return typeof e=="function"?e(t):e}function Do(e,t){return n=>{t.setState(r=>({...r,[e]:Ba(n,r[e])}))}}function Xb(e){return e instanceof Function}function ege(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function tge(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 lt(e,t,n){let r=[],o;return()=>{let i;n.key&&n.debug&&(i=Date.now());const s=e();if(!(s.length!==r.length||s.some((c,u)=>r[u]!==c)))return o;r=s;let l;if(n.key&&n.debug&&(l=Date.now()),o=t(...s),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-i)*100)/100,u=Math.round((Date.now()-l)*100)/100,d=u/16,f=(p,m)=>{for(p=String(p);p.length<m;)p=" "+p;return p};console.info(`%c⏱ ${f(u,5)} /${f(c,5)} ms`,`
267
+ font-size: .6rem;
268
+ font-weight: bold;
269
+ color: hsl(${Math.max(0,Math.min(120-120*d,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function nge(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?l.replace(".","_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=f=>{let p=f;for(const v of l.split(".")){var m;p=(m=p)==null?void 0:m[v],process.env.NODE_ENV!=="production"&&p===void 0&&console.warn(`"${v}" in deeply nested key "${l}" returned undefined.`)}return p}:u=f=>f[a.accessorKey]),!c)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let d={id:`${String(c)}`,accessorFn:u,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:lt(()=>[!0],()=>{var f;return[d,...(f=d.columns)==null?void 0:f.flatMap(p=>p.getFlatColumns())]},{key:process.env.NODE_ENV==="production"&&"column.getFlatColumns",debug:()=>{var f;return(f=e.options.debugAll)!=null?f:e.options.debugColumns}}),getLeafColumns:lt(()=>[e._getOrderColumnsFn()],f=>{var p;if((p=d.columns)!=null&&p.length){let m=d.columns.flatMap(v=>v.getLeafColumns());return f(m)}return[d]},{key:process.env.NODE_ENV==="production"&&"column.getLeafColumns",debug:()=>{var f;return(f=e.options.debugAll)!=null?f:e.options.debugColumns}})};for(const f of e._features)f.createColumn==null||f.createColumn(d,e);return d}function m$(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 rge={createTable:e=>{e.getHeaderGroups=lt(()=>[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(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?s:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return fv(t,[...a,...c,...l],e)},{key:process.env.NODE_ENV==="development"&&"getHeaderGroups",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}}),e.getCenterHeaderGroups=lt(()=>[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))),fv(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=lt(()=>[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 fv(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=lt(()=>[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 fv(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=lt(()=>[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=lt(()=>[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=lt(()=>[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=lt(()=>[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=lt(()=>[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=lt(()=>[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=lt(()=>[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=lt(()=>[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=lt(()=>[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=lt(()=>[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=lt(()=>[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=lt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,c;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(c=r[0])==null?void 0:c.headers)!=null?l:[]].map(u=>u.getLeafHeaders()).flat()},{key:process.env.NODE_ENV==="development"&&"getLeafHeaders",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugHeaders}})}};function fv(e,t,n,r){var o,i;let s=0;const a=function(f,p){p===void 0&&(p=1),s=Math.max(s,p),f.filter(m=>m.getIsVisible()).forEach(m=>{var v;(v=m.columns)!=null&&v.length&&a(m.columns,p+1)},0)};a(e);let l=[];const c=(f,p)=>{const m={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},v=[];f.forEach(y=>{const b=[...v].reverse()[0],x=y.column.depth===m.depth;let E,R=!1;if(x&&y.column.parent?E=y.column.parent:(E=y.column,R=!0),b&&(b==null?void 0:b.column)===E)b.subHeaders.push(y);else{const P=m$(n,E,{id:[r,p,E.id,y==null?void 0:y.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${v.filter(O=>O.column===E).length}`:void 0,depth:p,index:v.length});P.subHeaders.push(y),v.push(P)}m.headers.push(y),y.headerGroup=m}),l.push(m),p>0&&c(v,p-1)},u=t.map((f,p)=>m$(n,f,{depth:s,index:p}));c(u,s-1),l.reverse();const d=f=>f.filter(m=>m.column.getIsVisible()).map(m=>{let v=0,y=0,b=[0];m.subHeaders&&m.subHeaders.length?(b=[],d(m.subHeaders).forEach(E=>{let{colSpan:R,rowSpan:P}=E;v+=R,b.push(P)})):v=1;const x=Math.min(...b);return y=y+x,m.colSpan=v,m.rowSpan=y,{colSpan:v,rowSpan:y}});return d((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const hv={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},lw=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),oge={getDefaultColumnDef:()=>hv,getInitialState:e=>({columnSizing:{},columnSizingInfo:lw(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Do("columnSizing",e),onColumnSizingInfoChange:Do("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:hv.minSize,(r=i??e.columnDef.size)!=null?r:hv.size),(o=e.columnDef.maxSize)!=null?o:hv.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(),cw(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(b=>[b.column.id,b.column.getSize()]):[[r.id,r.getSize()]],l=cw(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(b,x)=>{typeof x=="number"&&(t.setColumnSizingInfo(E=>{var R,P;const O=t.options.columnResizeDirection==="rtl"?-1:1,A=(x-((R=E==null?void 0:E.startOffset)!=null?R:0))*O,D=Math.max(A/((P=E==null?void 0:E.startSize)!=null?P:0),-.999999);return E.columnSizingStart.forEach(I=>{let[L,j]=I;c[L]=Math.round(Math.max(j+j*D,0)*100)/100}),{...E,deltaOffset:A,deltaPercentage:D}}),(t.options.columnResizeMode==="onChange"||b==="end")&&t.setColumnSizing(E=>({...E,...c})))},d=b=>u("move",b),f=b=>{u("end",b),t.setColumnSizingInfo(x=>({...x,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=n||typeof document<"u"?document:null,m={moveHandler:b=>d(b.clientX),upHandler:b=>{p==null||p.removeEventListener("mousemove",m.moveHandler),p==null||p.removeEventListener("mouseup",m.upHandler),f(b.clientX)}},v={moveHandler:b=>(b.cancelable&&(b.preventDefault(),b.stopPropagation()),d(b.touches[0].clientX),!1),upHandler:b=>{var x;p==null||p.removeEventListener("touchmove",v.moveHandler),p==null||p.removeEventListener("touchend",v.upHandler),b.cancelable&&(b.preventDefault(),b.stopPropagation()),f((x=b.touches[0])==null?void 0:x.clientX)}},y=ige()?{passive:!1}:!1;cw(i)?(p==null||p.addEventListener("touchmove",v.moveHandler,y),p==null||p.addEventListener("touchend",v.upHandler,y)):(p==null||p.addEventListener("mousemove",m.moveHandler,y),p==null||p.addEventListener("mouseup",m.upHandler,y)),t.setColumnSizingInfo(b=>({...b,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?lw():(n=e.initialState.columnSizingInfo)!=null?n:lw())},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 pv=null;function ige(){if(typeof pv=="boolean")return pv;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 pv=e,pv}function cw(e){return e.type==="touchstart"}const sge={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Do("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()}}}},y7=(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))};y7.autoRemove=e=>_i(e);const x7=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};x7.autoRemove=e=>_i(e);const w7=(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())};w7.autoRemove=e=>_i(e);const S7=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};S7.autoRemove=e=>_i(e)||!(e!=null&&e.length);const C7=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});C7.autoRemove=e=>_i(e)||!(e!=null&&e.length);const _7=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});_7.autoRemove=e=>_i(e)||!(e!=null&&e.length);const E7=(e,t,n)=>e.getValue(t)===n;E7.autoRemove=e=>_i(e);const R7=(e,t,n)=>e.getValue(t)==n;R7.autoRemove=e=>_i(e);const p2=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};p2.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]};p2.autoRemove=e=>_i(e)||_i(e[0])&&_i(e[1]);const Os={includesString:y7,includesStringSensitive:x7,equalsString:w7,arrIncludes:S7,arrIncludesAll:C7,arrIncludesSome:_7,equals:E7,weakEquals:R7,inNumberRange:p2};function _i(e){return e==null||e===""}const age={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Do("columnFilters",e),onGlobalFilterChange:Do("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"?Os.includesString:typeof r=="number"?Os.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Os.equals:Array.isArray(r)?Os.arrIncludes:Os.weakEquals},e.getFilterFn=()=>{var n,r;return Xb(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:Os[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(u=>u.id===e.id),s=Ba(n,i?i.value:void 0);if(v$(o,s,e)){var a;return(a=r==null?void 0:r.filter(u=>u.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var c;return(c=r==null?void 0:r.map(u=>u.id===e.id?l:u))!=null?c:[]}return r!=null&&r.length?[...r,l]:[l]})},e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Os.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Xb(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Os[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=Ba(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(v$(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 v$(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const lge=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),cge=(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},uge=(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},dge=(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]},fge=(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},hge=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!ege(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},pge=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),gge=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,mge=(e,t)=>t.length,uw={sum:lge,min:cge,max:uge,extent:dge,mean:fge,median:hge,unique:pge,uniqueCount:gge,count:mge},vge={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:Do("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 uw.sum;if(Object.prototype.toString.call(r)==="[object Date]")return uw.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Xb(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:uw[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 bge(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 yge={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Do("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=lt(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),c=a.findIndex(u=>u.id===l);c>-1&&i.push(a.splice(c,1)[0])}i=[...i,...a]}return bge(i,n,r)},{key:process.env.NODE_ENV==="development"&&"getOrderColumnsFn"})}},n_=0,r_=10,dw=()=>({pageIndex:n_,pageSize:r_}),xge={getInitialState:e=>({...e,pagination:{...dw(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Do("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=>Ba(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?dw():(o=e.initialState.pagination)!=null?o:dw())},e.setPageIndex=r=>{e.setPagination(o=>{let i=Ba(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?n_:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:n_)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?r_:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:r_)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,Ba(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=Ba(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=lt(()=>[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)}}},fw=()=>({left:[],right:[]}),hw=()=>({top:[],bottom:[]}),wge={getInitialState:e=>({columnPinning:fw(),rowPinning:hw(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Do("columnPinning",e),onRowPinningChange:Do("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(d=>!(r!=null&&r.includes(d))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var c,u;return{left:[...((c=o==null?void 0:o.left)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((u=o==null?void 0:o.right)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:c}=l;return c}):[],s=o?e.getParentRows().map(l=>{let{id:c}=l;return c}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var c,u;if(n==="bottom"){var d,f;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(v=>!(a!=null&&a.has(v))),bottom:[...((f=l==null?void 0:l.bottom)!=null?f:[]).filter(v=>!(a!=null&&a.has(v))),...Array.from(a)]}}if(n==="top"){var p,m;return{top:[...((p=l==null?void 0:l.top)!=null?p:[]).filter(v=>!(a!=null&&a.has(v))),...Array.from(a)],bottom:((m=l==null?void 0:l.bottom)!=null?m:[]).filter(v=>!(a!=null&&a.has(v)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(v=>!(a!=null&&a.has(v))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(v=>!(a!=null&&a.has(v)))}})},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=lt(()=>[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=lt(()=>[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=lt(()=>[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?fw():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:fw())},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=lt(()=>[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=lt(()=>[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=lt(()=>[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?hw():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:hw())},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=>lt(()=>[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=lt(()=>[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}})}},Sge={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Do("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=>{o_(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=lt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?pw(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=lt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?pw(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=lt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?pw(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 o_(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return g2(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return i_(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return i_(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)}}}},o_=(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=>o_(e,a.id,n,r,o))};function pw(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=g2(l,n);if(u&&(r.push(l),o[l.id]=l),(c=l.subRows)!=null&&c.length&&(l={...l,subRows:i(l.subRows)}),u)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function g2(e,t){var n;return(n=t[e.id])!=null?n:!1}function i_(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()&&(g2(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=i_(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const s_=/([0-9]+)/gm,Cge=(e,t,n)=>P7(ol(e.getValue(n)).toLowerCase(),ol(t.getValue(n)).toLowerCase()),_ge=(e,t,n)=>P7(ol(e.getValue(n)),ol(t.getValue(n))),Ege=(e,t,n)=>m2(ol(e.getValue(n)).toLowerCase(),ol(t.getValue(n)).toLowerCase()),Rge=(e,t,n)=>m2(ol(e.getValue(n)),ol(t.getValue(n))),Pge=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},Oge=(e,t,n)=>m2(e.getValue(n),t.getValue(n));function m2(e,t){return e===t?0:e>t?1:-1}function ol(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function P7(e,t){const n=e.split(s_).filter(Boolean),r=t.split(s_).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 Wf={alphanumeric:Cge,alphanumericCaseSensitive:_ge,text:Ege,textCaseSensitive:Rge,datetime:Pge,basic:Oge},Age={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Do("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 Wf.datetime;if(typeof i=="string"&&(r=!0,i.split(s_).length>1))return Wf.alphanumeric}return r?Wf.text:Wf.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 Xb(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:Wf[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(p=>p.id===e.id),l=s==null?void 0:s.findIndex(p=>p.id===e.id);let c=[],u,d=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?u="toggle":u="add":s!=null&&s.length&&l!==s.length-1?u="replace":a?u="toggle":u="replace",u==="toggle"&&(i||o||(u="remove")),u==="add"){var f;c=[...s,{id:e.id,desc:d}],c.splice(0,c.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(p=>p.id===e.id?{...p,desc:d}:p):u==="remove"?c=s.filter(p=>p.id!==e.id):c=[{id:e.id,desc:d}];return c})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Tge={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Do("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=lt(()=>[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=lt(()=>[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)=>lt(()=>[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)}}},b$=[rge,Tge,yge,wge,age,Age,vge,sge,xge,Sge,oge];function Dge(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:b$};const r=n._features.reduce((u,d)=>Object.assign(u,d.getDefaultOptions==null?void 0:d.getDefaultOptions(n)),{}),o=u=>n.options.mergeOptions?n.options.mergeOptions(r,u):{...r,...u};let s={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(u=>{var d;s=(d=u.getInitialState==null?void 0:u.getInitialState(s))!=null?d:s});const a=[];let l=!1;const c={_features:b$,options:{...r,...e},initialState:s,_queue:u=>{a.push(u),l||(l=!0,Promise.resolve().then(()=>{for(;a.length;)a.shift()();l=!1}).catch(d=>setTimeout(()=>{throw d})))},reset:()=>{n.setState(n.initialState)},setOptions:u=>{const d=Ba(u,n.options);n.options=o(d)},getState:()=>n.options.state,setState:u=>{n.options.onStateChange==null||n.options.onStateChange(u)},_getRowId:(u,d,f)=>{var p;return(p=n.options.getRowId==null?void 0:n.options.getRowId(u,d,f))!=null?p:`${f?[f.id,d].join("."):d}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(u,d)=>{let f=(d?n.getPrePaginationRowModel():n.getRowModel()).rowsById[u];if(!f&&(f=n.getCoreRowModel().rowsById[u],!f))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${u}`):new Error;return f},_getDefaultColumnDef:lt(()=>[n.options.defaultColumn],u=>{var d;return u=(d=u)!=null?d:{},{header:f=>{const p=f.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:f=>{var p,m;return(p=(m=f.renderValue())==null||m.toString==null?void 0:m.toString())!=null?p:null},...n._features.reduce((f,p)=>Object.assign(f,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...u}},{debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns},key:process.env.NODE_ENV==="development"&&"getDefaultColumnDef"}),_getColumnDefs:()=>n.options.columns,getAllColumns:lt(()=>[n._getColumnDefs()],u=>{const d=function(f,p,m){return m===void 0&&(m=0),f.map(v=>{const y=nge(n,v,m,p),b=v;return y.columns=b.columns?d(b.columns,y,m+1):[],y})};return d(u)},{key:process.env.NODE_ENV==="development"&&"getAllColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllFlatColumns:lt(()=>[n.getAllColumns()],u=>u.flatMap(d=>d.getFlatColumns()),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),_getAllFlatColumnsById:lt(()=>[n.getAllFlatColumns()],u=>u.reduce((d,f)=>(d[f.id]=f,d),{}),{key:process.env.NODE_ENV==="development"&&"getAllFlatColumnsById",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getAllLeafColumns:lt(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(u,d)=>{let f=u.flatMap(p=>p.getLeafColumns());return d(f)},{key:process.env.NODE_ENV==="development"&&"getAllLeafColumns",debug:()=>{var u;return(u=n.options.debugAll)!=null?u:n.options.debugColumns}}),getColumn:u=>{const d=n._getAllFlatColumnsById()[u];return process.env.NODE_ENV!=="production"&&!d&&console.error(`[Table] Column with id '${u}' does not exist.`),d}};Object.assign(n,c);for(let u=0;u<n._features.length;u++){const d=n._features[u];d==null||d.createTable==null||d.createTable(n)}return n}function Mge(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:lt(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),{key:process.env.NODE_ENV==="development"&&"cell.getContext",debug:()=>e.options.debugAll})};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}const Ige=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return a._valuesCache[l]=c.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const c=e.getColumn(l);if(c!=null&&c.accessorFn)return c.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=c.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var c;return(c=a.getValue(l))!=null?c:e.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>tge(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],c=a;for(;;){const u=c.getParentRow();if(!u)break;l.push(u),c=u}return l.reverse()},getAllCells:lt(()=>[e.getAllLeafColumns()],l=>l.map(c=>Mge(e,a,c,c.id)),{key:process.env.NODE_ENV==="development"&&"row.getAllCells",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}}),_getAllCellsByColumnId:lt(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),{key:process.env.NODE_ENV==="production"&&"row.getAllCellsByColumnId",debug:()=>{var l;return(l=e.options.debugAll)!=null?l:e.options.debugRows}})};for(let l=0;l<e._features.length;l++){const c=e._features[l];c==null||c.createRow==null||c.createRow(a,e)}return a};function O7(){return e=>lt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let c=0;c<o.length;c++){const u=Ige(e,e._getRowId(o[c],c,s),o[c],c,i,void 0,s==null?void 0:s.id);if(n.flatRows.push(u),n.rowsById[u.id]=u,a.push(u),e.options.getSubRows){var l;u.originalSubRows=e.options.getSubRows(o[c],c),(l=u.originalSubRows)!=null&&l.length&&(u.subRows=r(u.originalSubRows,i+1,u))}}return a};return n.rows=r(t),n},{key:process.env.NODE_ENV==="development"&&"getRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function A7(){return e=>lt(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var c;return(c=e.getColumn(l.id))==null?void 0:c.getCanSort()}),s={};i.forEach(l=>{const c=e.getColumn(l.id);c&&(s[l.id]={sortUndefined:c.columnDef.sortUndefined,invertSorting:c.columnDef.invertSorting,sortingFn:c.getSortingFn()})});const a=l=>{const c=l.map(u=>({...u}));return c.sort((u,d)=>{for(let p=0;p<i.length;p+=1){var f;const m=i[p],v=s[m.id],y=(f=m==null?void 0:m.desc)!=null?f:!1;let b=0;if(v.sortUndefined){const x=u.getValue(m.id),E=d.getValue(m.id),R=x===void 0,P=E===void 0;(R||P)&&(b=R&&P?0:R?v.sortUndefined:-v.sortUndefined)}if(b===0&&(b=v.sortingFn(u,d,m.id)),b!==0)return y&&(b*=-1),v.invertSorting&&(b*=-1),b}return u.index-d.index}),c.forEach(u=>{var d;o.push(u),(d=u.subRows)!=null&&d.length&&(u.subRows=a(u.subRows))}),c};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},{key:process.env.NODE_ENV==="development"&&"getSortedRowModel",debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function $ge(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 T7(e){return t=>lt(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const c=o*i,u=c+o;s=s.slice(c,u);let d;t.options.paginateExpandedRows?d={rows:s,flatRows:a,rowsById:l}:d=$ge({rows:s,flatRows:a,rowsById:l}),d.flatRows=[];const f=p=>{d.flatRows.push(p),p.subRows.length&&p.subRows.forEach(f)};return d.rows.forEach(f),d},{key:process.env.NODE_ENV==="development"&&"getPaginationRowModel",debug:()=>{var n;return(n=t.options.debugAll)!=null?n:t.options.debugTable}})}/**
270
+ * react-table
271
+ *
272
+ * Copyright (c) TanStack
273
+ *
274
+ * This source code is licensed under the MIT license found in the
275
+ * LICENSE.md file in the root directory of this source tree.
276
+ *
277
+ * @license MIT
278
+ */function a_(e,t){return e?Nge(e)?S.createElement(e,t):e:null}function Nge(e){return kge(e)||typeof e=="function"||Lge(e)}function kge(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Lge(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function D7(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=S.useState(()=>({current:Dge(t)})),[r,o]=S.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 l_(e,[t,n]){return Math.min(n,Math.max(t,e))}function Yn(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 v2(e,t=[]){let n=[];function r(i,s){const a=S.createContext(s),l=n.length;n=[...n,s];const c=d=>{var b;const{scope:f,children:p,...m}=d,v=((b=f==null?void 0:f[e])==null?void 0:b[l])||a,y=S.useMemo(()=>m,Object.values(m));return C.jsx(v.Provider,{value:y,children:p})};c.displayName=i+"Provider";function u(d,f){var v;const p=((v=f==null?void 0:f[e])==null?void 0:v[l])||a,m=S.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>S.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Fge(o,...t)]}function Fge(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function y$(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function M7(...e){return t=>{let n=!1;const r=e.map(o=>{const i=y$(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():y$(e[o],null)}}}}function Cr(...e){return S.useCallback(M7(...e),e)}var lp=S.forwardRef((e,t)=>{const{children:n,...r}=e,o=S.Children.toArray(n),i=o.find(zge);if(i){const s=i.props.children,a=o.map(l=>l===i?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:l);return C.jsx(c_,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return C.jsx(c_,{...r,ref:t,children:n})});lp.displayName="Slot";var c_=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const o=Vge(n);return S.cloneElement(n,{...Bge(r,n.props),ref:t?M7(t,o):o})}return S.Children.count(n)>1?S.Children.only(null):null});c_.displayName="SlotClone";var jge=({children:e})=>C.jsx(C.Fragment,{children:e});function zge(e){return S.isValidElement(e)&&e.type===jge}function Bge(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 Vge(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Hge(e){const t=e+"CollectionProvider",[n,r]=v2(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:m,children:v}=p,y=w.useRef(null),b=w.useRef(new Map).current;return C.jsx(o,{scope:m,itemMap:b,collectionRef:y,children:v})};s.displayName=t;const a=e+"CollectionSlot",l=w.forwardRef((p,m)=>{const{scope:v,children:y}=p,b=i(a,v),x=Cr(m,b.collectionRef);return C.jsx(lp,{ref:x,children:y})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=w.forwardRef((p,m)=>{const{scope:v,children:y,...b}=p,x=w.useRef(null),E=Cr(m,x),R=i(c,v);return w.useEffect(()=>(R.itemMap.set(x,{ref:x,...b}),()=>void R.itemMap.delete(x))),C.jsx(lp,{[u]:"",ref:E,children:y})});d.displayName=c;function f(p){const m=i(e+"CollectionConsumer",p);return w.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((R,P)=>b.indexOf(R.ref.current)-b.indexOf(P.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},f,r]}var Wge=S.createContext(void 0);function Uge(e){const t=S.useContext(Wge);return e||t||"ltr"}var Gge=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Jn=Gge.reduce((e,t)=>{const n=S.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?lp:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function qge(e,t){e&&Pi.flushSync(()=>e.dispatchEvent(t))}function Kc(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Yge(e,t=globalThis==null?void 0:globalThis.document){const n=Kc(e);S.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Kge="DismissableLayer",u_="dismissableLayer.update",Xge="dismissableLayer.pointerDownOutside",Qge="dismissableLayer.focusOutside",x$,I7=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$7=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=S.useContext(I7),[u,d]=S.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=S.useState({}),m=Cr(t,A=>d(A)),v=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=u?v.indexOf(u):-1,E=c.layersWithOutsidePointerEventsDisabled.size>0,R=x>=b,P=eme(A=>{const D=A.target,I=[...c.branches].some(L=>L.contains(D));!R||I||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},f),O=tme(A=>{const D=A.target;[...c.branches].some(L=>L.contains(D))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},f);return Yge(A=>{x===c.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},f),S.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(x$=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),w$(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=x$)}},[u,f,n,c]),S.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),w$())},[u,c]),S.useEffect(()=>{const A=()=>p({});return document.addEventListener(u_,A),()=>document.removeEventListener(u_,A)},[]),C.jsx(Jn.div,{...l,ref:m,style:{pointerEvents:E?R?"auto":"none":void 0,...e.style},onFocusCapture:Yn(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Yn(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Yn(e.onPointerDownCapture,P.onPointerDownCapture)})});$7.displayName=Kge;var Zge="DismissableLayerBranch",Jge=S.forwardRef((e,t)=>{const n=S.useContext(I7),r=S.useRef(null),o=Cr(t,r);return S.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),C.jsx(Jn.div,{...e,ref:o})});Jge.displayName=Zge;function eme(e,t=globalThis==null?void 0:globalThis.document){const n=Kc(e),r=S.useRef(!1),o=S.useRef(()=>{});return S.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){N7(Xge,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}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 tme(e,t=globalThis==null?void 0:globalThis.document){const n=Kc(e),r=S.useRef(!1);return S.useEffect(()=>{const o=i=>{i.target&&!r.current&&N7(Qge,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 w$(){const e=new CustomEvent(u_);document.dispatchEvent(e)}function N7(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?qge(o,i):o.dispatchEvent(i)}var gw=0;function b2(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??S$()),document.body.insertAdjacentElement("beforeend",e[1]??S$()),gw++,()=>{gw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),gw--}},[])}function S$(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}function C$(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function k7(...e){return t=>{let n=!1;const r=e.map(o=>{const i=C$(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():C$(e[o],null)}}}}function nme(...e){return S.useCallback(k7(...e),e)}var L7=S.forwardRef((e,t)=>{const{children:n,...r}=e,o=S.Children.toArray(n),i=o.find(ome);if(i){const s=i.props.children,a=o.map(l=>l===i?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:l);return C.jsx(d_,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return C.jsx(d_,{...r,ref:t,children:n})});L7.displayName="Slot";var d_=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const o=sme(n);return S.cloneElement(n,{...ime(r,n.props),ref:t?k7(t,o):o})}return S.Children.count(n)>1?S.Children.only(null):null});d_.displayName="SlotClone";var rme=({children:e})=>C.jsx(C.Fragment,{children:e});function ome(e){return S.isValidElement(e)&&e.type===rme}function ime(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 sme(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ame=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],lme=ame.reduce((e,t)=>{const n=S.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?L7:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function _$(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var mw="focusScope.autoFocusOnMount",vw="focusScope.autoFocusOnUnmount",E$={bubbles:!1,cancelable:!0},cme="FocusScope",py=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=S.useState(null),c=_$(o),u=_$(i),d=S.useRef(null),f=nme(t,v=>l(v)),p=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let v=function(E){if(p.paused||!a)return;const R=E.target;a.contains(R)?d.current=R:Ca(d.current,{select:!0})},y=function(E){if(p.paused||!a)return;const R=E.relatedTarget;R!==null&&(a.contains(R)||Ca(d.current,{select:!0}))},b=function(E){if(document.activeElement===document.body)for(const P of E)P.removedNodes.length>0&&Ca(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",y);const x=new MutationObserver(b);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),x.disconnect()}}},[r,a,p.paused]),S.useEffect(()=>{if(a){P$.add(p);const v=document.activeElement;if(!a.contains(v)){const b=new CustomEvent(mw,E$);a.addEventListener(mw,c),a.dispatchEvent(b),b.defaultPrevented||(ume(gme(F7(a)),{select:!0}),document.activeElement===v&&Ca(a))}return()=>{a.removeEventListener(mw,c),setTimeout(()=>{const b=new CustomEvent(vw,E$);a.addEventListener(vw,u),a.dispatchEvent(b),b.defaultPrevented||Ca(v??document.body,{select:!0}),a.removeEventListener(vw,u),P$.remove(p)},0)}}},[a,c,u,p]);const m=S.useCallback(v=>{if(!n&&!r||p.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,b=document.activeElement;if(y&&b){const x=v.currentTarget,[E,R]=dme(x);E&&R?!v.shiftKey&&b===R?(v.preventDefault(),n&&Ca(E,{select:!0})):v.shiftKey&&b===E&&(v.preventDefault(),n&&Ca(R,{select:!0})):b===x&&v.preventDefault()}},[n,r,p.paused]);return C.jsx(lme.div,{tabIndex:-1,...s,ref:f,onKeyDown:m})});py.displayName=cme;function ume(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ca(r,{select:t}),document.activeElement!==n)return}function dme(e){const t=F7(e),n=R$(t,e),r=R$(t.reverse(),e);return[n,r]}function F7(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function R$(e,t){for(const n of e)if(!fme(n,{upTo:t}))return n}function fme(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 hme(e){return e instanceof HTMLInputElement&&"select"in e}function Ca(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&hme(e)&&t&&e.select()}}var P$=pme();function pme(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=O$(e,t),e.unshift(t)},remove(t){var n;e=O$(e,t),(n=e[0])==null||n.resume()}}}function O$(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function gme(e){return e.filter(t=>t.tagName!=="A")}var Mo=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},mme=S.useId||(()=>{}),vme=0;function y2(e){const[t,n]=S.useState(mme());return Mo(()=>{e||n(r=>r??String(vme++))},[e]),e||(t?`radix-${t}`:"")}var bme="Arrow",j7=S.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return C.jsx(Jn.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:C.jsx("polygon",{points:"0,0 30,0 15,10"})})});j7.displayName=bme;var yme=j7;function xme(e){const[t,n]=S.useState(void 0);return Mo(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var x2="Popper",[z7,B7]=v2(x2),[wme,V7]=z7(x2),H7=e=>{const{__scopePopper:t,children:n}=e,[r,o]=S.useState(null);return C.jsx(wme,{scope:t,anchor:r,onAnchorChange:o,children:n})};H7.displayName=x2;var W7="PopperAnchor",U7=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=V7(W7,n),s=S.useRef(null),a=Cr(t,s);return S.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:C.jsx(Jn.div,{...o,ref:a})});U7.displayName=W7;var w2="PopperContent",[Sme,Cme]=z7(w2),G7=S.forwardRef((e,t)=>{var ne,Z,ae,ce,ve,ee;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...v}=e,y=V7(w2,n),[b,x]=S.useState(null),E=Cr(t,ge=>x(ge)),[R,P]=S.useState(null),O=xme(R),A=(O==null?void 0:O.width)??0,D=(O==null?void 0:O.height)??0,I=r+(i!=="center"?"-"+i:""),L=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},j=Array.isArray(c)?c:[c],z=j.length>0,K={padding:L,boundary:j.filter(Eme),altBoundary:z},{refs:H,floatingStyles:k,placement:W,isPositioned:B,middlewareData:U}=ug({strategy:"fixed",placement:I,whileElementsMounted:(...ge)=>cg(...ge,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[tf({mainAxis:o+D,alignmentAxis:s}),l&&dg({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?iy():void 0,...K}),l&&fg({...K}),hg({...K,apply:({elements:ge,rects:fe,availableWidth:Se,availableHeight:Ae})=>{const{width:ze,height:Ie}=fe.reference,De=ge.floating.style;De.setProperty("--radix-popper-available-width",`${Se}px`),De.setProperty("--radix-popper-available-height",`${Ae}px`),De.setProperty("--radix-popper-anchor-width",`${ze}px`),De.setProperty("--radix-popper-anchor-height",`${Ie}px`)}}),R&&ay({element:R,padding:a}),Rme({arrowWidth:A,arrowHeight:D}),f&&sy({strategy:"referenceHidden",...K})]}),[q,$]=K7(W),Y=Kc(m);Mo(()=>{B&&(Y==null||Y())},[B,Y]);const X=(ne=U.arrow)==null?void 0:ne.x,M=(Z=U.arrow)==null?void 0:Z.y,oe=((ae=U.arrow)==null?void 0:ae.centerOffset)!==0,[te,ie]=S.useState();return Mo(()=>{b&&ie(window.getComputedStyle(b).zIndex)},[b]),C.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:B?k.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[(ce=U.transformOrigin)==null?void 0:ce.x,(ve=U.transformOrigin)==null?void 0:ve.y].join(" "),...((ee=U.hide)==null?void 0:ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:C.jsx(Sme,{scope:n,placedSide:q,onArrowChange:P,arrowX:X,arrowY:M,shouldHideArrow:oe,children:C.jsx(Jn.div,{"data-side":q,"data-align":$,...v,ref:E,style:{...v.style,animation:B?void 0:"none"}})})})});G7.displayName=w2;var q7="PopperArrow",_me={top:"bottom",right:"left",bottom:"top",left:"right"},Y7=S.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Cme(q7,r),s=_me[i.placedSide];return C.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:C.jsx(yme,{...o,ref:n,style:{...o.style,display:"block"}})})});Y7.displayName=q7;function Eme(e){return e!==null}var Rme=e=>({name:"transformOrigin",options:e,fn(t){var y,b,x;const{placement:n,rects:r,middlewareData:o}=t,s=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=K7(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((b=o.arrow)==null?void 0:b.x)??0)+a/2,p=(((x=o.arrow)==null?void 0:x.y)??0)+l/2;let m="",v="";return c==="bottom"?(m=s?d:`${f}px`,v=`${-l}px`):c==="top"?(m=s?d:`${f}px`,v=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,v=s?d:`${p}px`):c==="left"&&(m=`${r.floating.width+l}px`,v=s?d:`${p}px`),{data:{x:m,y:v}}}});function K7(e){const[t,n="center"]=e.split("-");return[t,n]}var Pme=H7,Ome=U7,Ame=G7,Tme=Y7,Dme="Portal",X7=S.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=S.useState(!1);Mo(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Pn.createPortal(C.jsx(Jn.div,{...r,ref:t}),s):null});X7.displayName=Dme;function A$({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Mme({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Kc(n),l=S.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function Mme({defaultProp:e,onChange:t}){const n=S.useState(e),[r]=n,o=S.useRef(r),i=Kc(t);return S.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Ime(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var $me="VisuallyHidden",Q7=S.forwardRef((e,t)=>C.jsx(Jn.span,{...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}}));Q7.displayName=$me;var Nme=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Su=new WeakMap,gv=new WeakMap,mv={},bw=0,Z7=function(e){return e&&(e.host||Z7(e.parentNode))},kme=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Z7(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})},Lme=function(e,t,n,r){var o=kme(t,Array.isArray(e)?e:[e]);mv[n]||(mv[n]=new WeakMap);var i=mv[n],s=[],a=new Set,l=new Set(o),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};o.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(a.has(f))u(f);else{var p=f.getAttribute(r),m=p!==null&&p!=="false",v=(Su.get(f)||0)+1,y=(i.get(f)||0)+1;Su.set(f,v),i.set(f,y),s.push(f),v===1&&m&&gv.set(f,!0),y===1&&f.setAttribute(n,"true"),m||f.setAttribute(r,"true")}})};return u(t),a.clear(),bw++,function(){s.forEach(function(d){var f=Su.get(d)-1,p=i.get(d)-1;Su.set(d,f),i.set(d,p),f||(gv.has(d)||d.removeAttribute(r),gv.delete(d)),p||d.removeAttribute(n)}),bw--,bw||(Su=new WeakMap,Su=new WeakMap,gv=new WeakMap,mv={})}},mg=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||Nme(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Lme(r,o,n,"aria-hidden")):function(){return null}},Ln=function(){return Ln=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},Ln.apply(this,arguments)};function gy(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 S2(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 Zu="right-scroll-bar-position",Ju="width-before-scroll-bar",Fme="with-scroll-bars-hidden",jme="--removed-body-scroll-bar-size";function yw(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function zme(e,t){var n=w.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}var Bme=typeof window<"u"?S.useLayoutEffect:S.useEffect,T$=new WeakMap;function C2(e,t){var n=zme(t||null,function(r){return e.forEach(function(o){return yw(o,r)})});return Bme(function(){var r=T$.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||yw(a,null)}),i.forEach(function(a){o.has(a)||yw(a,s)})}T$.set(n,e)},[e]),n}function Vme(e){return e}function Hme(e,t){t===void 0&&(t=Vme);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var l=function(){var u=s;s=[],u.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){s.push(u),c()},filter:function(u){return s=s.filter(u),n}}}};return o}function _2(e){e===void 0&&(e={});var t=Hme(null);return t.options=Ln({async:!0,ssr:!1},e),t}var J7=function(e){var t=e.sideCar,n=gy(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 S.createElement(r,Ln({},n))};J7.isSideCarExport=!0;function E2(e,t){return e.useMedium(t),J7}var e8=_2(),xw=function(){},my=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:xw,onWheelCapture:xw,onTouchMoveCapture:xw}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,x=e.gapMode,E=gy(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=f,P=C2([n,t]),O=Ln(Ln({},E),o);return S.createElement(S.Fragment,null,u&&S.createElement(R,{sideCar:e8,removeScrollBar:c,shards:d,noIsolation:p,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:x}),s?S.cloneElement(S.Children.only(a),Ln(Ln({},O),{ref:P})):S.createElement(b,Ln({},O,{className:l,ref:P}),a))});my.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};my.classNames={fullWidth:Ju,zeroRight:Zu};var D$,Wme=function(){if(D$)return D$;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ume(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Wme();return t&&e.setAttribute("nonce",t),e}function Gme(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function qme(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Yme=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ume())&&(Gme(t,n),qme(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Kme=function(){var e=Yme();return function(t,n){S.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vy=function(){var e=Kme(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Xme={left:0,top:0,right:0,gap:0},ww=function(e){return parseInt(e||"",10)||0},Qme=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[ww(n),ww(r),ww(o)]},Zme=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Xme;var t=Qme(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])}},Jme=vy(),ed="data-scroll-locked",eve=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
279
+ .`.concat(Fme,` {
280
+ overflow: hidden `).concat(r,`;
281
+ padding-right: `).concat(a,"px ").concat(r,`;
282
+ }
283
+ body[`).concat(ed,`] {
284
+ overflow: hidden `).concat(r,`;
285
+ overscroll-behavior: contain;
286
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
287
+ padding-left: `.concat(o,`px;
288
+ padding-top: `).concat(i,`px;
289
+ padding-right: `).concat(s,`px;
290
+ margin-left:0;
291
+ margin-top:0;
292
+ margin-right: `).concat(a,"px ").concat(r,`;
293
+ `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
294
+ }
295
+
296
+ .`).concat(Zu,` {
297
+ right: `).concat(a,"px ").concat(r,`;
298
+ }
299
+
300
+ .`).concat(Ju,` {
301
+ margin-right: `).concat(a,"px ").concat(r,`;
302
+ }
303
+
304
+ .`).concat(Zu," .").concat(Zu,` {
305
+ right: 0 `).concat(r,`;
306
+ }
307
+
308
+ .`).concat(Ju," .").concat(Ju,` {
309
+ margin-right: 0 `).concat(r,`;
310
+ }
311
+
312
+ body[`).concat(ed,`] {
313
+ `).concat(jme,": ").concat(a,`px;
314
+ }
315
+ `)},M$=function(){var e=parseInt(document.body.getAttribute(ed)||"0",10);return isFinite(e)?e:0},tve=function(){S.useEffect(function(){return document.body.setAttribute(ed,(M$()+1).toString()),function(){var e=M$()-1;e<=0?document.body.removeAttribute(ed):document.body.setAttribute(ed,e.toString())}},[])},R2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;tve();var i=S.useMemo(function(){return Zme(o)},[o]);return S.createElement(Jme,{styles:eve(i,!t,o,n?"":"!important")})},f_=!1;if(typeof window<"u")try{var vv=Object.defineProperty({},"passive",{get:function(){return f_=!0,!0}});window.addEventListener("test",vv,vv),window.removeEventListener("test",vv,vv)}catch{f_=!1}var Cu=f_?{passive:!1}:!1,nve=function(e){return e.tagName==="TEXTAREA"},t8=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!nve(e)&&n[t]==="visible")},rve=function(e){return t8(e,"overflowY")},ove=function(e){return t8(e,"overflowX")},I$=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=n8(e,r);if(o){var i=r8(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ive=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},sve=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},n8=function(e,t){return e==="v"?rve(t):ove(t)},r8=function(e,t){return e==="v"?ive(t):sve(t)},ave=function(e,t){return e==="h"&&t==="rtl"?-1:1},lve=function(e,t,n,r,o){var i=ave(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,f=0;do{var p=r8(e,a),m=p[0],v=p[1],y=p[2],b=v-y-i*m;(m||b)&&n8(e,a)&&(d+=b,f+=m),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&Math.abs(d)<1||!o&&s>d)||!u&&(o&&Math.abs(f)<1||!o&&-s>f))&&(c=!0),c},bv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$$=function(e){return[e.deltaX,e.deltaY]},N$=function(e){return e&&"current"in e?e.current:e},cve=function(e,t){return e[0]===t[0]&&e[1]===t[1]},uve=function(e){return`
316
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
317
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
318
+ `)},dve=0,_u=[];function fve(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),o=S.useState(dve++)[0],i=S.useState(vy)[0],s=S.useRef(e);S.useEffect(function(){s.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=S2([e.lockRef.current],(e.shards||[]).map(N$),!0).filter(Boolean);return v.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=S.useCallback(function(v,y){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!s.current.allowPinchZoom;var b=bv(v),x=n.current,E="deltaX"in v?v.deltaX:x[0]-b[0],R="deltaY"in v?v.deltaY:x[1]-b[1],P,O=v.target,A=Math.abs(E)>Math.abs(R)?"h":"v";if("touches"in v&&A==="h"&&O.type==="range")return!1;var D=I$(A,O);if(!D)return!0;if(D?P=A:(P=A==="v"?"h":"v",D=I$(A,O)),!D)return!1;if(!r.current&&"changedTouches"in v&&(E||R)&&(r.current=P),!P)return!0;var I=r.current||P;return lve(I,y,v,I==="h"?E:R,!0)},[]),l=S.useCallback(function(v){var y=v;if(!(!_u.length||_u[_u.length-1]!==i)){var b="deltaY"in y?$$(y):bv(y),x=t.current.filter(function(P){return P.name===y.type&&(P.target===y.target||y.target===P.shadowParent)&&cve(P.delta,b)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var E=(s.current.shards||[]).map(N$).filter(Boolean).filter(function(P){return P.contains(y.target)}),R=E.length>0?a(y,E[0]):!s.current.noIsolation;R&&y.cancelable&&y.preventDefault()}}},[]),c=S.useCallback(function(v,y,b,x){var E={name:v,delta:y,target:b,should:x,shadowParent:hve(b)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(R){return R!==E})},1)},[]),u=S.useCallback(function(v){n.current=bv(v),r.current=void 0},[]),d=S.useCallback(function(v){c(v.type,$$(v),v.target,a(v,e.lockRef.current))},[]),f=S.useCallback(function(v){c(v.type,bv(v),v.target,a(v,e.lockRef.current))},[]);S.useEffect(function(){return _u.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Cu),document.addEventListener("touchmove",l,Cu),document.addEventListener("touchstart",u,Cu),function(){_u=_u.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,Cu),document.removeEventListener("touchmove",l,Cu),document.removeEventListener("touchstart",u,Cu)}},[]);var p=e.removeScrollBar,m=e.inert;return S.createElement(S.Fragment,null,m?S.createElement(i,{styles:uve(o)}):null,p?S.createElement(R2,{gapMode:e.gapMode}):null)}function hve(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pve=E2(e8,fve);var o8=S.forwardRef(function(e,t){return S.createElement(my,Ln({},e,{ref:t,sideCar:pve}))});o8.classNames=my.classNames;const P2=o8;var gve=[" ","Enter","ArrowUp","ArrowDown"],mve=[" ","Enter"],vg="Select",[by,yy,vve]=Hge(vg),[nf,y3e]=v2(vg,[vve,B7]),xy=B7(),[bve,ul]=nf(vg),[yve,xve]=nf(vg),i8=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:s,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,v=xy(t),[y,b]=S.useState(null),[x,E]=S.useState(null),[R,P]=S.useState(!1),O=Uge(c),[A=!1,D]=A$({prop:r,defaultProp:o,onChange:i}),[I,L]=A$({prop:s,defaultProp:a,onChange:l}),j=S.useRef(null),z=y?m||!!y.closest("form"):!0,[K,H]=S.useState(new Set),k=Array.from(K).map(W=>W.props.value).join(";");return C.jsx(Pme,{...v,children:C.jsxs(bve,{required:p,scope:t,trigger:y,onTriggerChange:b,valueNode:x,onValueNodeChange:E,valueNodeHasChildren:R,onValueNodeHasChildrenChange:P,contentId:y2(),value:I,onValueChange:L,open:A,onOpenChange:D,dir:O,triggerPointerDownPosRef:j,disabled:f,children:[C.jsx(by.Provider,{scope:t,children:C.jsx(yve,{scope:e.__scopeSelect,onNativeOptionAdd:S.useCallback(W=>{H(B=>new Set(B).add(W))},[]),onNativeOptionRemove:S.useCallback(W=>{H(B=>{const U=new Set(B);return U.delete(W),U})},[]),children:n})}),z?C.jsxs(D8,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:I,onChange:W=>L(W.target.value),disabled:f,form:m,children:[I===void 0?C.jsx("option",{value:""}):null,Array.from(K)]},k):null]})})};i8.displayName=vg;var s8="SelectTrigger",a8=S.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=xy(n),s=ul(s8,n),a=s.disabled||r,l=Cr(t,s.onTriggerChange),c=yy(n),u=S.useRef("touch"),[d,f,p]=M8(v=>{const y=c().filter(E=>!E.disabled),b=y.find(E=>E.value===s.value),x=I8(y,v,b);x!==void 0&&s.onValueChange(x.value)}),m=v=>{a||(s.onOpenChange(!0),p()),v&&(s.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return C.jsx(Ome,{asChild:!0,...i,children:C.jsx(Jn.button,{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":T8(s.value)?"":void 0,...o,ref:l,onClick:Yn(o.onClick,v=>{v.currentTarget.focus(),u.current!=="mouse"&&m(v)}),onPointerDown:Yn(o.onPointerDown,v=>{u.current=v.pointerType;const y=v.target;y.hasPointerCapture(v.pointerId)&&y.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(m(v),v.preventDefault())}),onKeyDown:Yn(o.onKeyDown,v=>{const y=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(y&&v.key===" ")&&gve.includes(v.key)&&(m(),v.preventDefault())})})})});a8.displayName=s8;var l8="SelectValue",c8=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=ul(l8,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=Cr(t,l.onValueNodeChange);return Mo(()=>{c(u)},[c,u]),C.jsx(Jn.span,{...a,ref:d,style:{pointerEvents:"none"},children:T8(l.value)?C.jsx(C.Fragment,{children:s}):i})});c8.displayName=l8;var wve="SelectIcon",u8=S.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return C.jsx(Jn.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});u8.displayName=wve;var Sve="SelectPortal",d8=e=>C.jsx(X7,{asChild:!0,...e});d8.displayName=Sve;var Nc="SelectContent",f8=S.forwardRef((e,t)=>{const n=ul(Nc,e.__scopeSelect),[r,o]=S.useState();if(Mo(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?Pi.createPortal(C.jsx(h8,{scope:e.__scopeSelect,children:C.jsx(by.Slot,{scope:e.__scopeSelect,children:C.jsx("div",{children:e.children})})}),i):null}return C.jsx(p8,{...e,ref:t})});f8.displayName=Nc;var mi=10,[h8,dl]=nf(Nc),Cve="SelectContentImpl",p8=S.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:s,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:v,avoidCollisions:y,...b}=e,x=ul(Nc,n),[E,R]=S.useState(null),[P,O]=S.useState(null),A=Cr(t,ne=>R(ne)),[D,I]=S.useState(null),[L,j]=S.useState(null),z=yy(n),[K,H]=S.useState(!1),k=S.useRef(!1);S.useEffect(()=>{if(E)return mg(E)},[E]),b2();const W=S.useCallback(ne=>{const[Z,...ae]=z().map(ee=>ee.ref.current),[ce]=ae.slice(-1),ve=document.activeElement;for(const ee of ne)if(ee===ve||(ee==null||ee.scrollIntoView({block:"nearest"}),ee===Z&&P&&(P.scrollTop=0),ee===ce&&P&&(P.scrollTop=P.scrollHeight),ee==null||ee.focus(),document.activeElement!==ve))return},[z,P]),B=S.useCallback(()=>W([D,E]),[W,D,E]);S.useEffect(()=>{K&&B()},[K,B]);const{onOpenChange:U,triggerPointerDownPosRef:q}=x;S.useEffect(()=>{if(E){let ne={x:0,y:0};const Z=ce=>{var ve,ee;ne={x:Math.abs(Math.round(ce.pageX)-(((ve=q.current)==null?void 0:ve.x)??0)),y:Math.abs(Math.round(ce.pageY)-(((ee=q.current)==null?void 0:ee.y)??0))}},ae=ce=>{ne.x<=10&&ne.y<=10?ce.preventDefault():E.contains(ce.target)||U(!1),document.removeEventListener("pointermove",Z),q.current=null};return q.current!==null&&(document.addEventListener("pointermove",Z),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Z),document.removeEventListener("pointerup",ae,{capture:!0})}}},[E,U,q]),S.useEffect(()=>{const ne=()=>U(!1);return window.addEventListener("blur",ne),window.addEventListener("resize",ne),()=>{window.removeEventListener("blur",ne),window.removeEventListener("resize",ne)}},[U]);const[$,Y]=M8(ne=>{const Z=z().filter(ve=>!ve.disabled),ae=Z.find(ve=>ve.ref.current===document.activeElement),ce=I8(Z,ne,ae);ce&&setTimeout(()=>ce.ref.current.focus())}),X=S.useCallback((ne,Z,ae)=>{const ce=!k.current&&!ae;(x.value!==void 0&&x.value===Z||ce)&&(I(ne),ce&&(k.current=!0))},[x.value]),M=S.useCallback(()=>E==null?void 0:E.focus(),[E]),oe=S.useCallback((ne,Z,ae)=>{const ce=!k.current&&!ae;(x.value!==void 0&&x.value===Z||ce)&&j(ne)},[x.value]),te=r==="popper"?h_:g8,ie=te===h_?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:v,avoidCollisions:y}:{};return C.jsx(h8,{scope:n,content:E,viewport:P,onViewportChange:O,itemRefCallback:X,selectedItem:D,onItemLeave:M,itemTextRefCallback:oe,focusSelectedItem:B,selectedItemText:L,position:r,isPositioned:K,searchRef:$,children:C.jsx(P2,{as:lp,allowPinchZoom:!0,children:C.jsx(py,{asChild:!0,trapped:x.open,onMountAutoFocus:ne=>{ne.preventDefault()},onUnmountAutoFocus:Yn(o,ne=>{var Z;(Z=x.trigger)==null||Z.focus({preventScroll:!0}),ne.preventDefault()}),children:C.jsx($7,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:ne=>ne.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:C.jsx(te,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:ne=>ne.preventDefault(),...b,...ie,onPlaced:()=>H(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Yn(b.onKeyDown,ne=>{const Z=ne.ctrlKey||ne.altKey||ne.metaKey;if(ne.key==="Tab"&&ne.preventDefault(),!Z&&ne.key.length===1&&Y(ne.key),["ArrowUp","ArrowDown","Home","End"].includes(ne.key)){let ce=z().filter(ve=>!ve.disabled).map(ve=>ve.ref.current);if(["ArrowUp","End"].includes(ne.key)&&(ce=ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(ne.key)){const ve=ne.target,ee=ce.indexOf(ve);ce=ce.slice(ee+1)}setTimeout(()=>W(ce)),ne.preventDefault()}})})})})})})});p8.displayName=Cve;var _ve="SelectItemAlignedPosition",g8=S.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=ul(Nc,n),s=dl(Nc,n),[a,l]=S.useState(null),[c,u]=S.useState(null),d=Cr(t,A=>u(A)),f=yy(n),p=S.useRef(!1),m=S.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:b,focusSelectedItem:x}=s,E=S.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&v&&y&&b){const A=i.trigger.getBoundingClientRect(),D=c.getBoundingClientRect(),I=i.valueNode.getBoundingClientRect(),L=b.getBoundingClientRect();if(i.dir!=="rtl"){const ve=L.left-D.left,ee=I.left-ve,ge=A.left-ee,fe=A.width+ge,Se=Math.max(fe,D.width),Ae=window.innerWidth-mi,ze=l_(ee,[mi,Math.max(mi,Ae-Se)]);a.style.minWidth=fe+"px",a.style.left=ze+"px"}else{const ve=D.right-L.right,ee=window.innerWidth-I.right-ve,ge=window.innerWidth-A.right-ee,fe=A.width+ge,Se=Math.max(fe,D.width),Ae=window.innerWidth-mi,ze=l_(ee,[mi,Math.max(mi,Ae-Se)]);a.style.minWidth=fe+"px",a.style.right=ze+"px"}const j=f(),z=window.innerHeight-mi*2,K=v.scrollHeight,H=window.getComputedStyle(c),k=parseInt(H.borderTopWidth,10),W=parseInt(H.paddingTop,10),B=parseInt(H.borderBottomWidth,10),U=parseInt(H.paddingBottom,10),q=k+W+K+U+B,$=Math.min(y.offsetHeight*5,q),Y=window.getComputedStyle(v),X=parseInt(Y.paddingTop,10),M=parseInt(Y.paddingBottom,10),oe=A.top+A.height/2-mi,te=z-oe,ie=y.offsetHeight/2,ne=y.offsetTop+ie,Z=k+W+ne,ae=q-Z;if(Z<=oe){const ve=j.length>0&&y===j[j.length-1].ref.current;a.style.bottom="0px";const ee=c.clientHeight-v.offsetTop-v.offsetHeight,ge=Math.max(te,ie+(ve?M:0)+ee+B),fe=Z+ge;a.style.height=fe+"px"}else{const ve=j.length>0&&y===j[0].ref.current;a.style.top="0px";const ge=Math.max(oe,k+v.offsetTop+(ve?X:0)+ie)+ae;a.style.height=ge+"px",v.scrollTop=Z-oe+v.offsetTop}a.style.margin=`${mi}px 0`,a.style.minHeight=$+"px",a.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>p.current=!0)}},[f,i.trigger,i.valueNode,a,c,v,y,b,i.dir,r]);Mo(()=>E(),[E]);const[R,P]=S.useState();Mo(()=>{c&&P(window.getComputedStyle(c).zIndex)},[c]);const O=S.useCallback(A=>{A&&m.current===!0&&(E(),x==null||x(),m.current=!1)},[E,x]);return C.jsx(Rve,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:p,onScrollButtonChange:O,children:C.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:C.jsx(Jn.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});g8.displayName=_ve;var Eve="SelectPopperPosition",h_=S.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=mi,...i}=e,s=xy(n);return C.jsx(Ame,{...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)"}})});h_.displayName=Eve;var[Rve,O2]=nf(Nc,{}),p_="SelectViewport",m8=S.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=dl(p_,n),s=O2(p_,n),a=Cr(t,i.onViewportChange),l=S.useRef(0);return C.jsxs(C.Fragment,{children:[C.jsx("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}"},nonce:r}),C.jsx(by.Slot,{scope:n,children:C.jsx(Jn.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Yn(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=s;if(f!=null&&f.current&&d){const p=Math.abs(l.current-u.scrollTop);if(p>0){const m=window.innerHeight-mi*2,v=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),b=Math.max(v,y);if(b<m){const x=b+p,E=Math.min(m,x),R=x-E;d.style.height=E+"px",d.style.bottom==="0px"&&(u.scrollTop=R>0?R:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});m8.displayName=p_;var v8="SelectGroup",[Pve,Ove]=nf(v8),b8=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=y2();return C.jsx(Pve,{scope:n,id:o,children:C.jsx(Jn.div,{role:"group","aria-labelledby":o,...r,ref:t})})});b8.displayName=v8;var y8="SelectLabel",x8=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ove(y8,n);return C.jsx(Jn.div,{id:o.id,...r,ref:t})});x8.displayName=y8;var Qb="SelectItem",[Ave,w8]=nf(Qb),S8=S.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=ul(Qb,n),l=dl(Qb,n),c=a.value===r,[u,d]=S.useState(i??""),[f,p]=S.useState(!1),m=Cr(t,x=>{var E;return(E=l.itemRefCallback)==null?void 0:E.call(l,x,r,o)}),v=y2(),y=S.useRef("touch"),b=()=>{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 C.jsx(Ave,{scope:n,value:r,disabled:o,textId:v,isSelected:c,onItemTextChange:S.useCallback(x=>{d(E=>E||((x==null?void 0:x.textContent)??"").trim())},[]),children:C.jsx(by.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:C.jsx(Jn.div,{role:"option","aria-labelledby":v,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:m,onFocus:Yn(s.onFocus,()=>p(!0)),onBlur:Yn(s.onBlur,()=>p(!1)),onClick:Yn(s.onClick,()=>{y.current!=="mouse"&&b()}),onPointerUp:Yn(s.onPointerUp,()=>{y.current==="mouse"&&b()}),onPointerDown:Yn(s.onPointerDown,x=>{y.current=x.pointerType}),onPointerMove:Yn(s.onPointerMove,x=>{var E;y.current=x.pointerType,o?(E=l.onItemLeave)==null||E.call(l):y.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Yn(s.onPointerLeave,x=>{var E;x.currentTarget===document.activeElement&&((E=l.onItemLeave)==null||E.call(l))}),onKeyDown:Yn(s.onKeyDown,x=>{var R;((R=l.searchRef)==null?void 0:R.current)!==""&&x.key===" "||(mve.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});S8.displayName=Qb;var vh="SelectItemText",C8=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=ul(vh,n),a=dl(vh,n),l=w8(vh,n),c=xve(vh,n),[u,d]=S.useState(null),f=Cr(t,b=>d(b),l.onItemTextChange,b=>{var x;return(x=a.itemTextRefCallback)==null?void 0:x.call(a,b,l.value,l.disabled)}),p=u==null?void 0:u.textContent,m=S.useMemo(()=>C.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=c;return Mo(()=>(v(m),()=>y(m)),[v,y,m]),C.jsxs(C.Fragment,{children:[C.jsx(Jn.span,{id:l.textId,...i,ref:f}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Pi.createPortal(i.children,s.valueNode):null]})});C8.displayName=vh;var _8="SelectItemIndicator",E8=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return w8(_8,n).isSelected?C.jsx(Jn.span,{"aria-hidden":!0,...r,ref:t}):null});E8.displayName=_8;var g_="SelectScrollUpButton",R8=S.forwardRef((e,t)=>{const n=dl(g_,e.__scopeSelect),r=O2(g_,e.__scopeSelect),[o,i]=S.useState(!1),s=Cr(t,r.onScrollButtonChange);return Mo(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;i(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?C.jsx(O8,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});R8.displayName=g_;var m_="SelectScrollDownButton",P8=S.forwardRef((e,t)=>{const n=dl(m_,e.__scopeSelect),r=O2(m_,e.__scopeSelect),[o,i]=S.useState(!1),s=Cr(t,r.onScrollButtonChange);return Mo(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;i(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),o?C.jsx(O8,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});P8.displayName=m_;var O8=S.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=dl("SelectScrollButton",n),s=S.useRef(null),a=yy(n),l=S.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return S.useEffect(()=>()=>l(),[l]),Mo(()=>{var u;const c=a().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),C.jsx(Jn.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Yn(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Yn(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Yn(o.onPointerLeave,()=>{l()})})}),Tve="SelectSeparator",A8=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return C.jsx(Jn.div,{"aria-hidden":!0,...r,ref:t})});A8.displayName=Tve;var v_="SelectArrow",Dve=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=xy(n),i=ul(v_,n),s=dl(v_,n);return i.open&&s.position==="popper"?C.jsx(Tme,{...o,...r,ref:t}):null});Dve.displayName=v_;function T8(e){return e===""||e===void 0}var D8=S.forwardRef((e,t)=>{const{value:n,...r}=e,o=S.useRef(null),i=Cr(t,o),s=Ime(n);return S.useEffect(()=>{const a=o.current,l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(s!==n&&u){const d=new Event("change",{bubbles:!0});u.call(a,n),a.dispatchEvent(d)}},[s,n]),C.jsx(Q7,{asChild:!0,children:C.jsx("select",{...r,ref:i,defaultValue:n})})});D8.displayName="BubbleSelect";function M8(e){const t=Kc(e),n=S.useRef(""),r=S.useRef(0),o=S.useCallback(s=>{const a=n.current+s;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),i=S.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function I8(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=Mve(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.textValue.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function Mve(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Ive=i8,$8=a8,$ve=c8,Nve=u8,kve=d8,N8=f8,Lve=m8,Fve=b8,k8=x8,L8=S8,jve=C8,zve=E8,F8=R8,j8=P8,z8=A8;const Is=Ive,$u=Fve,$s=$ve,Bi=S.forwardRef(({className:e,children:t,...n},r)=>C.jsxs($8,{ref:r,className:xe("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,C.jsx(Nve,{asChild:!0,children:C.jsx(U0,{className:"h-4 w-4 opacity-50"})})]}));Bi.displayName=$8.displayName;const B8=S.forwardRef(({className:e,...t},n)=>C.jsx(F8,{ref:n,className:xe("flex cursor-default items-center justify-center py-1",e),...t,children:C.jsx(w4,{className:"h-4 w-4"})}));B8.displayName=F8.displayName;const V8=S.forwardRef(({className:e,...t},n)=>C.jsx(j8,{ref:n,className:xe("flex cursor-default items-center justify-center py-1",e),...t,children:C.jsx(U0,{className:"h-4 w-4"})}));V8.displayName=j8.displayName;const Vi=S.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>C.jsx(kve,{children:C.jsx(Wc,{children:C.jsxs(N8,{ref:o,className:xe("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:[C.jsx(B8,{}),C.jsx(Lve,{className:xe("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),C.jsx(V8,{})]})})}));Vi.displayName=N8.displayName;const Hl=S.forwardRef(({className:e,...t},n)=>C.jsx(k8,{ref:n,className:xe("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Hl.displayName=k8.displayName;const Un=S.forwardRef(({className:e,children:t,...n},r)=>C.jsxs(L8,{ref:r,className:xe("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:[C.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:C.jsx(zve,{children:C.jsx(rg,{className:"h-4 w-4"})})}),C.jsx(jve,{children:t})]}));Un.displayName=L8.displayName;const Nh=S.forwardRef(({className:e,...t},n)=>C.jsx(z8,{ref:n,className:xe("-mx-1 my-1 h-px bg-muted",e),...t}));Nh.displayName=z8.displayName;const yc=S.forwardRef(({className:e,type:t,...n},r)=>C.jsx("input",{type:t,className:xe("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}));yc.displayName="Input";const Bve=w.forwardRef((e,t)=>w.createElement(On.label,He({},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()}}))),H8=Bve,Vve=l2("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Dn=S.forwardRef(({className:e,...t},n)=>C.jsx(H8,{ref:n,className:xe(Vve(),e),...t}));Dn.displayName=H8.displayName;function Ga(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 k$(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function W8(...e){return t=>{let n=!1;const r=e.map(o=>{const i=k$(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():k$(e[o],null)}}}}function Xc(...e){return S.useCallback(W8(...e),e)}function U8(e,t=[]){let n=[];function r(i,s){const a=S.createContext(s),l=n.length;n=[...n,s];const c=d=>{var b;const{scope:f,children:p,...m}=d,v=((b=f==null?void 0:f[e])==null?void 0:b[l])||a,y=S.useMemo(()=>m,Object.values(m));return C.jsx(v.Provider,{value:y,children:p})};c.displayName=i+"Provider";function u(d,f){var v;const p=((v=f==null?void 0:f[e])==null?void 0:v[l])||a,m=S.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>S.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Hve(o,...t)]}function Hve(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var A2=S.forwardRef((e,t)=>{const{children:n,...r}=e,o=S.Children.toArray(n),i=o.find(Uve);if(i){const s=i.props.children,a=o.map(l=>l===i?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:l);return C.jsx(b_,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return C.jsx(b_,{...r,ref:t,children:n})});A2.displayName="Slot";var b_=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const o=qve(n);return S.cloneElement(n,{...Gve(r,n.props),ref:t?W8(t,o):o})}return S.Children.count(n)>1?S.Children.only(null):null});b_.displayName="SlotClone";var Wve=({children:e})=>C.jsx(C.Fragment,{children:e});function Uve(e){return S.isValidElement(e)&&e.type===Wve}function Gve(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 qve(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Yve=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],fl=Yve.reduce((e,t)=>{const n=S.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?A2:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Kve(e,t){e&&Pi.flushSync(()=>e.dispatchEvent(t))}function rf(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Xve(e,t=globalThis==null?void 0:globalThis.document){const n=rf(e);S.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Qve="DismissableLayer",y_="dismissableLayer.update",Zve="dismissableLayer.pointerDownOutside",Jve="dismissableLayer.focusOutside",L$,G8=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),q8=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=S.useContext(G8),[u,d]=S.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=S.useState({}),m=Xc(t,A=>d(A)),v=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=u?v.indexOf(u):-1,E=c.layersWithOutsidePointerEventsDisabled.size>0,R=x>=b,P=nbe(A=>{const D=A.target,I=[...c.branches].some(L=>L.contains(D));!R||I||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},f),O=rbe(A=>{const D=A.target;[...c.branches].some(L=>L.contains(D))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},f);return Xve(A=>{x===c.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},f),S.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(L$=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),F$(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=L$)}},[u,f,n,c]),S.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),F$())},[u,c]),S.useEffect(()=>{const A=()=>p({});return document.addEventListener(y_,A),()=>document.removeEventListener(y_,A)},[]),C.jsx(fl.div,{...l,ref:m,style:{pointerEvents:E?R?"auto":"none":void 0,...e.style},onFocusCapture:Ga(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ga(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ga(e.onPointerDownCapture,P.onPointerDownCapture)})});q8.displayName=Qve;var ebe="DismissableLayerBranch",tbe=S.forwardRef((e,t)=>{const n=S.useContext(G8),r=S.useRef(null),o=Xc(t,r);return S.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),C.jsx(fl.div,{...e,ref:o})});tbe.displayName=ebe;function nbe(e,t=globalThis==null?void 0:globalThis.document){const n=rf(e),r=S.useRef(!1),o=S.useRef(()=>{});return S.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){Y8(Zve,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}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 rbe(e,t=globalThis==null?void 0:globalThis.document){const n=rf(e),r=S.useRef(!1);return S.useEffect(()=>{const o=i=>{i.target&&!r.current&&Y8(Jve,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 F$(){const e=new CustomEvent(y_);document.dispatchEvent(e)}function Y8(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?Kve(o,i):o.dispatchEvent(i)}var kc=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},obe=S.useId||(()=>{}),ibe=0;function sbe(e){const[t,n]=S.useState(obe());return kc(()=>{e||n(r=>r??String(ibe++))},[e]),e||(t?`radix-${t}`:"")}var abe="Arrow",K8=S.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return C.jsx(fl.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:C.jsx("polygon",{points:"0,0 30,0 15,10"})})});K8.displayName=abe;var lbe=K8;function cbe(e){const[t,n]=S.useState(void 0);return kc(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var T2="Popper",[X8,Q8]=U8(T2),[ube,Z8]=X8(T2),J8=e=>{const{__scopePopper:t,children:n}=e,[r,o]=S.useState(null);return C.jsx(ube,{scope:t,anchor:r,onAnchorChange:o,children:n})};J8.displayName=T2;var e9="PopperAnchor",t9=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Z8(e9,n),s=S.useRef(null),a=Xc(t,s);return S.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:C.jsx(fl.div,{...o,ref:a})});t9.displayName=e9;var D2="PopperContent",[dbe,fbe]=X8(D2),n9=S.forwardRef((e,t)=>{var ne,Z,ae,ce,ve,ee;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...v}=e,y=Z8(D2,n),[b,x]=S.useState(null),E=Xc(t,ge=>x(ge)),[R,P]=S.useState(null),O=cbe(R),A=(O==null?void 0:O.width)??0,D=(O==null?void 0:O.height)??0,I=r+(i!=="center"?"-"+i:""),L=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},j=Array.isArray(c)?c:[c],z=j.length>0,K={padding:L,boundary:j.filter(pbe),altBoundary:z},{refs:H,floatingStyles:k,placement:W,isPositioned:B,middlewareData:U}=ug({strategy:"fixed",placement:I,whileElementsMounted:(...ge)=>cg(...ge,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[tf({mainAxis:o+D,alignmentAxis:s}),l&&dg({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?iy():void 0,...K}),l&&fg({...K}),hg({...K,apply:({elements:ge,rects:fe,availableWidth:Se,availableHeight:Ae})=>{const{width:ze,height:Ie}=fe.reference,De=ge.floating.style;De.setProperty("--radix-popper-available-width",`${Se}px`),De.setProperty("--radix-popper-available-height",`${Ae}px`),De.setProperty("--radix-popper-anchor-width",`${ze}px`),De.setProperty("--radix-popper-anchor-height",`${Ie}px`)}}),R&&ay({element:R,padding:a}),gbe({arrowWidth:A,arrowHeight:D}),f&&sy({strategy:"referenceHidden",...K})]}),[q,$]=i9(W),Y=rf(m);kc(()=>{B&&(Y==null||Y())},[B,Y]);const X=(ne=U.arrow)==null?void 0:ne.x,M=(Z=U.arrow)==null?void 0:Z.y,oe=((ae=U.arrow)==null?void 0:ae.centerOffset)!==0,[te,ie]=S.useState();return kc(()=>{b&&ie(window.getComputedStyle(b).zIndex)},[b]),C.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:B?k.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[(ce=U.transformOrigin)==null?void 0:ce.x,(ve=U.transformOrigin)==null?void 0:ve.y].join(" "),...((ee=U.hide)==null?void 0:ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:C.jsx(dbe,{scope:n,placedSide:q,onArrowChange:P,arrowX:X,arrowY:M,shouldHideArrow:oe,children:C.jsx(fl.div,{"data-side":q,"data-align":$,...v,ref:E,style:{...v.style,animation:B?void 0:"none"}})})})});n9.displayName=D2;var r9="PopperArrow",hbe={top:"bottom",right:"left",bottom:"top",left:"right"},o9=S.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=fbe(r9,r),s=hbe[i.placedSide];return C.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:C.jsx(lbe,{...o,ref:n,style:{...o.style,display:"block"}})})});o9.displayName=r9;function pbe(e){return e!==null}var gbe=e=>({name:"transformOrigin",options:e,fn(t){var y,b,x;const{placement:n,rects:r,middlewareData:o}=t,s=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=i9(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((b=o.arrow)==null?void 0:b.x)??0)+a/2,p=(((x=o.arrow)==null?void 0:x.y)??0)+l/2;let m="",v="";return c==="bottom"?(m=s?d:`${f}px`,v=`${-l}px`):c==="top"?(m=s?d:`${f}px`,v=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,v=s?d:`${p}px`):c==="left"&&(m=`${r.floating.width+l}px`,v=s?d:`${p}px`),{data:{x:m,y:v}}}});function i9(e){const[t,n="center"]=e.split("-");return[t,n]}var mbe=J8,s9=t9,vbe=n9,bbe=o9,ybe="Portal",a9=S.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=S.useState(!1);kc(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Pn.createPortal(C.jsx(fl.div,{...r,ref:t}),s):null});a9.displayName=ybe;function xbe(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var M2=e=>{const{present:t,children:n}=e,r=wbe(t),o=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),i=Xc(r.ref,Sbe(o));return typeof n=="function"||r.isPresent?S.cloneElement(o,{ref:i}):null};M2.displayName="Presence";function wbe(e){const[t,n]=S.useState(),r=S.useRef({}),o=S.useRef(e),i=S.useRef("none"),s=e?"mounted":"unmounted",[a,l]=xbe(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=yv(r.current);i.current=a==="mounted"?c:"none"},[a]),kc(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,p=yv(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),kc(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=p=>{const v=yv(r.current).includes(p.animationName);if(p.target===t&&v&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=p=>{p.target===t&&(i.current=yv(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:S.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function yv(e){return(e==null?void 0:e.animationName)||"none"}function Sbe(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Cbe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=_be({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=rf(n),l=S.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function _be({defaultProp:e,onChange:t}){const n=S.useState(e),[r]=n,o=S.useRef(r),i=rf(t);return S.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var I2="Popover",[l9,x3e]=U8(I2,[Q8]),bg=Q8(),[Ebe,hl]=l9(I2),c9=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=bg(t),l=S.useRef(null),[c,u]=S.useState(!1),[d=!1,f]=Cbe({prop:r,defaultProp:o,onChange:i});return C.jsx(mbe,{...a,children:C.jsx(Ebe,{scope:t,contentId:sbe(),triggerRef:l,open:d,onOpenChange:f,onOpenToggle:S.useCallback(()=>f(p=>!p),[f]),hasCustomAnchor:c,onCustomAnchorAdd:S.useCallback(()=>u(!0),[]),onCustomAnchorRemove:S.useCallback(()=>u(!1),[]),modal:s,children:n})})};c9.displayName=I2;var u9="PopoverAnchor",Rbe=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=hl(u9,n),i=bg(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return S.useEffect(()=>(s(),()=>a()),[s,a]),C.jsx(s9,{...i,...r,ref:t})});Rbe.displayName=u9;var d9="PopoverTrigger",f9=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=hl(d9,n),i=bg(n),s=Xc(t,o.triggerRef),a=C.jsx(fl.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":v9(o.open),...r,ref:s,onClick:Ga(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:C.jsx(s9,{asChild:!0,...i,children:a})});f9.displayName=d9;var $2="PopoverPortal",[Pbe,Obe]=l9($2,{forceMount:void 0}),h9=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=hl($2,t);return C.jsx(Pbe,{scope:t,forceMount:n,children:C.jsx(M2,{present:n||i.open,children:C.jsx(a9,{asChild:!0,container:o,children:r})})})};h9.displayName=$2;var Ld="PopoverContent",p9=S.forwardRef((e,t)=>{const n=Obe(Ld,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=hl(Ld,e.__scopePopover);return C.jsx(M2,{present:r||i.open,children:i.modal?C.jsx(Abe,{...o,ref:t}):C.jsx(Tbe,{...o,ref:t})})});p9.displayName=Ld;var Abe=S.forwardRef((e,t)=>{const n=hl(Ld,e.__scopePopover),r=S.useRef(null),o=Xc(t,r),i=S.useRef(!1);return S.useEffect(()=>{const s=r.current;if(s)return mg(s)},[]),C.jsx(P2,{as:A2,allowPinchZoom:!0,children:C.jsx(g9,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ga(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Ga(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;i.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:Ga(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Tbe=S.forwardRef((e,t)=>{const n=hl(Ld,e.__scopePopover),r=S.useRef(!1),o=S.useRef(!1);return C.jsx(g9,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),g9=S.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,f=hl(Ld,n),p=bg(n);return b2(),C.jsx(py,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:C.jsx(q8,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>f.onOpenChange(!1),children:C.jsx(vbe,{"data-state":v9(f.open),role:"dialog",id:f.contentId,...p,...d,ref:t,style:{...d.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)"}})})})}),m9="PopoverClose",Dbe=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=hl(m9,n);return C.jsx(fl.button,{type:"button",...r,ref:t,onClick:Ga(e.onClick,()=>o.onOpenChange(!1))})});Dbe.displayName=m9;var Mbe="PopoverArrow",Ibe=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=bg(n);return C.jsx(bbe,{...o,...r,ref:t})});Ibe.displayName=Mbe;function v9(e){return e?"open":"closed"}var $be=c9,Nbe=f9,kbe=h9,b9=p9;const wy=$be,Sy=Nbe,yg=S.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>C.jsx(kbe,{children:C.jsx(Wc,{children:C.jsx(b9,{ref:o,align:t,sideOffset:n,className:xe("z-49 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})})}));yg.displayName=b9.displayName;function Lbe(e,t){switch(t){case"full-date-time":return{locale:e,format:"full-date-time",options:{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:!0}};case"short-date-time":return{locale:e,format:"short-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!0}};case"hours-date-time":return{locale:e,format:"hours-date-time",options:{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}};case"short-date":return{format:"short-date",locale:e,options:{}};case"long-date":return{format:"long-date",locale:e,options:{year:"numeric",month:"long",day:"numeric"}};default:return{format:"short-date-time",locale:e,options:{}}}}function y9({colorRanges:e,setColorRanges:t}){const n={start:-1/0,end:100,color:""};function r(s,a,l){const c=[...e];c[s]={...c[s],[a]:l},t(c)}function o(s){const a=[...e];a.splice(s,1),t(a)}function i(){t([...e,n])}return C.jsxs("div",{className:"space-y-3",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx(Dn,{children:"Color Range"}),C.jsx(ro,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:C.jsx(fR,{className:"size-3"})})]}),e.map((s,a)=>C.jsxs("div",{className:"flex items-center gap-2 px-2",children:[C.jsx(yc,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:xe(`h-7 ${Ch}`)}),C.jsx("span",{children:"-"}),C.jsx(yc,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:xe(`h-7 ${Ch}`)}),C.jsx(yc,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:xe(`h-7 min-w-14 p-0 ${Ch}`),type:"color",list:"presetColors"}),C.jsxs("datalist",{id:"presetColors",children:[C.jsx("option",{children:Ut.green[600]}),C.jsx("option",{children:Ut.red[500]}),C.jsx("option",{children:Ut.yellow[400]}),C.jsx("option",{children:Ut.orange[500]})]}),C.jsx(ro,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:C.jsx(Yd,{className:"size-3"})})]},a))]})}const Fbe=w.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=cs({prop:n,onChange:o,defaultProp:r});return w.createElement(On.button,He({type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0},i,{ref:t,onClick:Ft(e.onClick,()=>{e.disabled||a(!s)})}))}),x9=Fbe,jbe=l2("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"}}),N2=S.forwardRef(({className:e,variant:t,size:n,...r},o)=>C.jsx(x9,{ref:o,className:xe(jbe({variant:t,size:n,className:e})),...r}));N2.displayName=x9.displayName;function zbe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.type}function Bbe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.locale)||"en-US"}function Vbe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t&&i.type==="date");return((o=n==null?void 0:n.options)==null?void 0:o.format)||"short-date-time"}function Hbe(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return(o=n==null?void 0:n.options)==null?void 0:o.currency}function Wbe(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.minimumFractionDigits)||0}function Ube(e,t){var r,o;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(i=>i.columnIdx===t);return((o=n==null?void 0:n.options)==null?void 0:o.colorRanges)||[]}function Gbe(e,t){var r,o,i;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(s=>s.columnIdx===t);return((i=(o=n==null?void 0:n.options)==null?void 0:o.options)==null?void 0:i.style)==="percent"}function qbe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.textAlign}function Ybe(e,t){var r;const n=(r=e==null?void 0:e.columnSettings)==null?void 0:r.find(o=>o.columnIdx===t);return n==null?void 0:n.width}function Kbe({columnIndex:e,columnName:t}){const[n,r]=w.useState(!1),o=$r(H=>{var k;return(k=H.card)==null?void 0:k.preferences}),[i,s]=w.useState(zbe(o,e)),[a,l]=w.useState(qbe(o,e)),[c,u]=w.useState(Ybe(o,e)),[d,f]=w.useState(Ube(o,e)),[p,m]=w.useState(Bbe(o,e)),[v,y]=w.useState(Vbe(o,e)),[b,x]=w.useState(Hbe(o,e)),[E,R]=w.useState(Wbe(o,e).toString()),[P,O]=w.useState(Gbe(o,e));w.useState("");const A=$r(H=>H.actions.setCardPreferences);function D(){return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[C.jsx(Dn,{className:"col-span-3",htmlFor:"format",children:"Text Align"}),C.jsxs(Is,{value:a||"left",onValueChange:H=>l(H),children:[C.jsx(Bi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:C.jsx($s,{})}),C.jsxs(Vi,{children:[C.jsx(Un,{value:"left",children:"Left"}),C.jsx(Un,{value:"center",children:"Center"}),C.jsx(Un,{value:"right",children:"Right"})]})]})]}),C.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[C.jsx(Dn,{className:"col-span-3",htmlFor:"format",children:"Width (px)"}),C.jsx(yc,{placeholder:"Auto",value:c?c.toString():"",className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",onChange:H=>{H.target.value===""?u(void 0):u(Number(H.target.value))}})]})]})}function I(){const H=[...new Set($S.map(k=>k.currency))];return C.jsx(C.Fragment,{children:C.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[C.jsx(Dn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),C.jsxs(Is,{value:p,onValueChange:k=>m(k),children:[C.jsx(Bi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:C.jsx($s,{})}),C.jsx(Vi,{children:C.jsxs($u,{children:[C.jsx(Hl,{children:"Locale"}),$S.map(k=>C.jsx(Un,{value:k.locale,children:k.locale},k.locale))]})})]}),C.jsx(Dn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),C.jsxs(Is,{value:b||"none",onValueChange:k=>x(k==="none"?void 0:k),children:[C.jsx(Bi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:C.jsx($s,{})}),C.jsx(Vi,{children:C.jsxs($u,{children:[C.jsx(Hl,{children:"Currency"}),C.jsx(Un,{value:"none",children:"None"}),H.map(k=>C.jsx(Un,{value:k,children:k},k))]})})]}),C.jsx(Dn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),C.jsxs(Is,{value:E,onValueChange:k=>R(k),children:[C.jsx(Bi,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:C.jsx($s,{})}),C.jsx(Vi,{children:["0","1","2","3","4"].map(k=>C.jsx(Un,{value:k,children:k},k))})]}),!b&&C.jsx(N2,{onPressedChange:k=>O(k),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:C.jsx(R4,{className:"size-3"})})]})})}function L(){return C.jsx(C.Fragment,{children:C.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[C.jsx(Dn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),C.jsxs(Is,{defaultValue:"en-US",value:p,onValueChange:H=>m(H),children:[C.jsx(Bi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:C.jsx($s,{})}),C.jsx(Vi,{children:xJ.map(H=>C.jsxs($u,{children:[C.jsx(Hl,{children:H.label}),H.locales.map(k=>C.jsx(Un,{value:k.code,children:k.name},k.code))]},H.label))})]}),C.jsx(Dn,{className:"col-span-3",htmlFor:"format",children:"Format"}),C.jsxs(Is,{defaultValue:"short-date-time",value:v,onValueChange:H=>{console.log("format",H),y(H)},children:[C.jsx(Bi,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:C.jsx($s,{})}),C.jsx(Vi,{className:"",id:"type",children:C.jsxs($u,{children:[C.jsx(Hl,{children:"Option"}),C.jsx(Un,{value:"full-date-time",children:"Full Date-Time"}),C.jsx(Un,{value:"short-date-time",children:"Short Date-Time"}),C.jsx(Un,{value:"hours-date-time",children:"24-Hour Date-Time"}),C.jsx(Un,{value:"short-date",children:"Short Date"}),C.jsx(Un,{value:"long-date",children:"Long Date"})]})})]})]})})}function j(){A({...o,columnSettings:[]})}function z(){var H;A({...o,columnSettings:[...((H=o==null?void 0:o.columnSettings)==null?void 0:H.filter(k=>k.columnIdx!==e))||[]]})}function K(){var H,k,W;if(i==="date"){const B=Lbe(p,v),U={columnIdx:e,type:i,options:B};A({...o,columnSettings:[...((H=o==null?void 0:o.columnSettings)==null?void 0:H.filter(q=>q.columnIdx!==e))||[],U]})}else if(i==="number"){let B;b?B={locale:p,currency:b,options:{style:"currency",currency:b,minimumFractionDigits:Number(E)},colorRanges:d.length>0?d:void 0}:B={locale:p,currency:void 0,options:{style:P?"percent":"decimal",minimumFractionDigits:Number(E)},colorRanges:d.length>0?d:void 0};const U={columnIdx:e,type:i,textAlign:a,width:c,options:B};A({...o,columnSettings:[...((k=o==null?void 0:o.columnSettings)==null?void 0:k.filter(q=>q.columnIdx!==e))||[],U]})}else{const B={columnIdx:e,type:"none",textAlign:a,width:c,options:{}};A({...o,columnSettings:[...((W=o==null?void 0:o.columnSettings)==null?void 0:W.filter(U=>U.columnIdx!==e))||[],B]})}}return C.jsxs(wy,{onOpenChange:H=>r(H),children:[C.jsx(Sy,{asChild:!0,children:C.jsx(hR,{className:"size-3.5 cursor-pointer text-muted"})}),C.jsx(yg,{align:"center",className:"max-w-70 z-20",children:C.jsxs("div",{className:"grid gap-4",children:[C.jsxs("div",{className:"space-y-2",children:[C.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),C.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),C.jsxs("div",{className:"grid gap-2",children:[C.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[C.jsx(Dn,{htmlFor:"scale",children:"Type"}),C.jsxs(Is,{value:i||"none",onValueChange:H=>s(H),children:[C.jsx(Bi,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:C.jsx($s,{})}),C.jsx(Vi,{id:"type",children:C.jsxs($u,{children:[C.jsx(Hl,{children:"Option"}),C.jsx(Un,{value:"number",children:"Number"}),C.jsx(Un,{value:"date",children:"Date"}),C.jsx(Un,{value:"none",children:"None"})]})})]})]}),D(),C.jsx(Nh,{}),i==="number"&&I(),i==="date"&&L(),i==="number"&&C.jsxs(C.Fragment,{children:[C.jsx(Nh,{}),C.jsx(y9,{colorRanges:d,setColorRanges:f})]}),C.jsx(Nh,{}),C.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[C.jsx(ro,{onClick:j,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),C.jsx(ro,{onClick:z,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),C.jsx(ro,{onClick:K,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function Xbe(e){const t=new Date(e);return!isNaN(t.getTime())}function w9({data:e,card:t}){var R,P,O,A;const[n,r]=w.useState([]),{keys:o}=rr(e),i=we(D=>D.filteringCards),s=we(D=>D.themeStyle),a=we(D=>D.isVisualEditing),l=i==null?void 0:i.find(D=>D.id===t.id),c=(R=t==null?void 0:t.preferences)==null?void 0:R.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:d,removeFilterValue:f,removeFilteringCard:p}=fr(),m=t==null?void 0:t.preferences;function v(D,I){if((I==null?void 0:I.type)==="date"&&Xbe(D)){const{locale:L,options:j}=I.options,z=new Date(D);return new Date(z.getTime()).toLocaleDateString(L,j)}if((I==null?void 0:I.type)==="number"){const{locale:L,currency:j,options:z}=I.options;return j?new Intl.NumberFormat(L,{style:"currency",currency:j,...z}).format(D):new Intl.NumberFormat(L,z).format(D)}return D}const y=o.map((D,I)=>({accessorKey:D,header:({column:L})=>{var B;const j=L.getIsSorted(),z=I,K=(B=m==null?void 0:m.columnSettings)==null?void 0:B.find(U=>U.columnIdx===z),H=K==null?void 0:K.textAlign,k=K==null?void 0:K.width,W=k?{width:k}:{};return C.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[C.jsxs("div",{className:xe("flex grow cursor-pointer items-center",{"justify-center":H==="center","justify-end":H==="right","justify-start":H==="left"}),style:W,onClick:()=>L.toggleSorting(L.getIsSorted()==="asc"),children:[D,j==="asc"?C.jsx(v4,{className:"ml-2 h-5 w-5"}):j==="desc"?C.jsx(m4,{className:"ml-2 h-5 w-5"}):null]}),a&&C.jsx(Kbe,{columnName:L.id,columnIndex:I})]})},cell:({cell:L})=>{var W,B;const j=L.getValue(),z=(W=m==null?void 0:m.columnSettings)==null?void 0:W.find(U=>U.columnIdx===I),K=v(j,z),H=gR(j,(B=z==null?void 0:z.options)==null?void 0:B.colorRanges),k=z==null?void 0:z.textAlign;return z!=null&&z.width&&z.width,C.jsx("p",{className:xe("overflow-auto px-2 py-1",{"text-center":k==="center","text-right":k==="right","text-left":k==="left"}),style:{backgroundColor:H},children:K})}})),b=D7({data:e,columns:y,getCoreRowModel:O7(),getPaginationRowModel:T7(),onSortingChange:r,getSortedRowModel:A7(),manualPagination:!0,state:{sorting:n}}),x=b.getSelectedRowModel().rows;w.useEffect(()=>{if(x.length===0){if(l){const D=t.id;f(D),p(t)}return}if(c){const{dimensionKeys:D}=rr(e),I=c.map(L=>{const j=D==null?void 0:D[L.columnIndex],z=x.map(H=>H.getValue(j));return{filterId:t.id+"-"+j,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:j,expression:L.expression,valueType:R0(z[0]===void 0?"":z[0]),operation:"in",values:z}});u(I),d(t)}},[d,u,t,e,l,c,f,p,x]);function E(D){D.toggleSelected()}return C.jsxs(c2,{className:"",containerClassName:"rounded-md",containerStyle:{borderTopRightRadius:(P=s==null?void 0:s.chart)==null?void 0:P.options.borderRadius,borderTopLeftRadius:(O=s==null?void 0:s.chart)==null?void 0:O.options.borderRadius},onMouseDown:D=>D.stopPropagation(),children:[C.jsx(u2,{children:b.getHeaderGroups().map(D=>C.jsx($h,{children:D.headers.map((I,L)=>{var j,z,K,H,k,W,B;return C.jsx(f2,{style:{backgroundColor:(K=(z=(j=s==null?void 0:s.chart)==null?void 0:j.dataset)==null?void 0:z.backgroundColor)==null?void 0:K[0],color:Sd((W=(k=(H=s==null?void 0:s.chart)==null?void 0:H.dataset)==null?void 0:k.backgroundColor)==null?void 0:W[0])},className:xe("sticky -top-[1px] h-9 bg-muted-foreground px-2 text-background",{"border-x":L>0&&L<D.headers.length-1,"border-l":L===1&&D.headers.length==2},(B=s==null?void 0:s.table)==null?void 0:B.tableHeaderColor),children:I.isPlaceholder?null:a_(I.column.columnDef.header,I.getContext())},I.id)})},D.id))}),C.jsx(d2,{children:(A=b.getRowModel().rows)!=null&&A.length?b.getRowModel().rows.map((D,I)=>C.jsx($h,{onClick:()=>E(D),className:xe("whitespace-nowrap p-1",{"cursor-pointer data-[state=selected]:border-2 data-[state=selected]:border-dashed":c&&(c==null?void 0:c.length)>0}),"data-state":D.getIsSelected()&&"selected",children:D.getVisibleCells().map((L,j)=>{var k,W;const z=(k=m==null?void 0:m.columnSettings)==null?void 0:k.find(B=>B.columnIdx===j),K=z==null?void 0:z.width,H=K?{maxWidth:K}:{};return C.jsx("td",{style:H,onClick:B=>{var q;const U=((q=window==null?void 0:window.getSelection())==null?void 0:q.toString())||"";(U==null?void 0:U.length)>0&&B.stopPropagation()},className:xe("",{"border-x":j>0&&j<y.length-1||j===1&&y.length==2,"border-l":j==0,"border-r":j===y.length-1,"border-b":I===((W=b.getRowModel().rows)==null?void 0:W.length)-1}),children:a_(L.column.columnDef.cell,L.getContext())},L.id)})},D.id)):C.jsx($h,{children:C.jsx(h2,{colSpan:y.length,className:"p-1 text-center",children:"No results."})})})]})}async function Qbe(e,t){const n=`${e}/index.js`,r=`${e}/style.css`;return document.querySelector(`link[href="${r}"]`)||await new Promise((i,s)=>{const a=document.createElement("link");a.rel="stylesheet",a.href=r,a.onload=()=>i(void 0),a.onerror=()=>s(new Error("Failed to load CSS")),document.head.appendChild(a)}),{default:(await import(n))[t]}}async function Zbe(e){try{const t=await import(e),n=Object.keys(t),r=[];return n.forEach(o=>{typeof t[o]=="function"&&(o==null?void 0:o[0])===(o==null?void 0:o[0].toUpperCase())&&r.push({name:o,component:o})}),r}catch(t){return console.error("Error loading the library:",t),[]}}async function S9(e){try{const t=await fetch(`${e}/manifest.json`);if(!t.ok)throw new Error(`Failed to fetch manifest: ${t.statusText}`);return await t.json()}catch(t){throw console.error("Error loading manifest:",t),t}}const C9=e=>{const[t,n]=w.useState([]),[r,o]=w.useState(!1),[i,s]=w.useState(null);w.useEffect(()=>{window.React=w,window.ReactDOM=Pn,o(!0)},[]),w.useEffect(()=>{e&&r&&S9(e).then(c=>{n(c.visuals),s(c)}).catch(()=>{Zbe(e).then(c=>{console.log("componentNames",c),n(c)}).catch(c=>{console.error("Error loading manifest:",c)})})},[e,r]);const a=w.useMemo(()=>(t==null?void 0:t.map(c=>{const{name:u,component:d,dataInputs:f}=c;return{name:u,componentName:d,Component:w.lazy(()=>Qbe(e,d)),type:f&&f.length>1?"multiple":"single"}}))||[],[t,e]);function l(c){const u=a==null?void 0:a.find(d=>d.name===c);return u?u.Component:null}return{getCard:l,components:a,manifest:i}};function Jbe({onLoadingStatus:e,card:t}){const{isFetching:n,isLoading:r}=YR(t);return w.useEffect(()=>{e==null||e(r)},[n,r,e]),C.jsx(C.Fragment,{})}function e0e({card:e,frame:t}){var y,b,x,E,R,P,O,A,D;const{authToken:n}=No(),r=T5(n==null?void 0:n.accessToken),o=we(I=>I.themeStyle),i={colors:((b=(y=o==null?void 0:o.chart)==null?void 0:y.dataset)==null?void 0:b.backgroundColor)||[]},[s,a]=w.useState(!1),{getCard:l}=C9(((x=e.customCardPreferences)==null?void 0:x.url)||""),c=((E=e.customCardPreferences)==null?void 0:E.visualType)||"single",u=(R=e.customCardPreferences)==null?void 0:R.componentName,{data:d}=Y0(e);if(!u)return null;const f=l(u),p=I=>{console.log("data",I),e.customCardPreferences},m=Object.keys(((P=e.customCardPreferences)==null?void 0:P.dataInputCardIds)||{}).map(I=>{var z,K,H;const L=(K=(z=e.customCardPreferences)==null?void 0:z.dataInputCardIds)==null?void 0:K[I].cardId,j=(H=t==null?void 0:t.cards)==null?void 0:H.find(k=>k.id===L);return j||null});function v(I){a(I)}return C.jsx("div",{className:"semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto",children:C.jsxs(w.Suspense,{fallback:C.jsx(C.Fragment,{}),children:[f&&c==="single"&&C.jsx(f,{params:r,theme:i,settings:(O=e.customCardPreferences)==null?void 0:O.settings,onDataChange:p,data:(d==null?void 0:d.records)||[]}),f&&c==="multiple"&&C.jsxs(C.Fragment,{children:[Object.keys(((A=e.customCardPreferences)==null?void 0:A.dataInputCardIds)||{}).map(I=>{var z,K,H;const L=(K=(z=e.customCardPreferences)==null?void 0:z.dataInputCardIds)==null?void 0:K[I].cardId,j=(H=t==null?void 0:t.cards)==null?void 0:H.find(k=>k.id===L);return j?C.jsx(Jbe,{onLoadingStatus:v,onDataChange:p,dataInputIndex:I,card:j},j.id):null}),c==="multiple"&&C.jsx("div",{className:xe("flex flex-col gap-2",{"opacity-50":s}),children:C.jsx(f,{params:r,theme:i,onDataChange:p,settings:m.map(I=>{var L;return(L=I==null?void 0:I.customCardPreferences)==null?void 0:L.settings}),data:m.map(I=>(I==null?void 0:I.data)||[])})})]})]},(D=e.customCardPreferences)==null?void 0:D.componentName)})}/*!
319
+ * chartjs-plugin-datalabels v2.2.0
320
+ * https://chartjs-plugin-datalabels.netlify.app
321
+ * (c) 2017-2022 chartjs-plugin-datalabels contributors
322
+ * Released under the MIT license
323
+ */var j$=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}(),kh={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
324
+ `)):Array.isArray(n)?e.push.apply(e,n):Pt(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*j$)/j$}};function Sw(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 t0e(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 n0e=0,_9=1,E9=2,R9=4,P9=8;function xv(e,t,n){var r=n0e;return e<n.left?r|=_9:e>n.right&&(r|=E9),t<n.top?r|=P9:t>n.bottom&&(r|=R9),r}function r0e(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=xv(n,r,t),a=xv(o,i,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&P9?(c=n+(o-n)*(t.top-r)/(i-r),u=t.top):l&R9?(c=n+(o-n)*(t.bottom-r)/(i-r),u=t.bottom):l&E9?(u=r+(i-r)*(t.right-n)/(o-n),c=t.right):l&_9&&(u=r+(i-r)*(t.left-n)/(o-n),c=t.left),l===s?(n=c,r=u,s=xv(n,r,t)):(o=c,i=u,a=xv(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function wv(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=r0e(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),t0e(o,i,e.vx,e.vy,t.align)}var Sv={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 wv({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=Sw(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return wv({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=Sw(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)),wv({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=Sw(e,t.origin);return wv({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)}},Hs=kh.rasterize;function o0e(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 i0e(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 s0e(e){return e instanceof Fu?Sv.arc:e instanceof gc?Sv.point:e instanceof mc?Sv.bar:Sv.fallback}function a0e(e,t,n,r,o,i){var s=Math.PI/2;if(i){var a=Math.min(i,o/2,r/2),l=t+a,c=n+a,u=t+r-a,d=n+o-a;e.moveTo(t,c),l<u&&c<d?(e.arc(l,c,a,-Math.PI,-s),e.arc(u,c,a,-s,0),e.arc(u,d,a,0,s),e.arc(l,d,a,s,Math.PI)):l<u?(e.moveTo(l,n),e.arc(u,c,a,-s,s),e.arc(l,c,a,s,Math.PI+s)):c<d?(e.arc(l,c,a,-Math.PI,0),e.arc(l,d,a,0,Math.PI)):e.arc(l,c,a,-Math.PI,Math.PI),e.closePath(),e.moveTo(t,n)}else e.rect(t,n,r,o)}function l0e(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),a0e(e,Hs(t.x)+i/2,Hs(t.y)+i/2,Hs(t.w)-i,Hs(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 c0e(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 u0e(e,t,n){var r=e.shadowBlur,o=n.stroked,i=Hs(n.x),s=Hs(n.y),a=Hs(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 d0e(e,t,n,r){var o=r.textAlign,i=r.color,s=!!i,a=r.font,l=t.length,c=r.textStrokeColor,u=r.textStrokeWidth,d=c&&u,f;if(!(!l||!s&&!d))for(n=c0e(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),d&&(e.lineJoin="round",e.lineWidth=u,e.strokeStyle=c),f=0,l=t.length;f<l;++f)u0e(e,t[f],{stroked:d,filled:s,w:n.w,x:n.x,y:n.y+n.h*f})}var O9=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};sr(O9.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=Xn(xn([n.font,{}],r,i)),a=xn([n.color,In.color],r,i);return{align:xn([n.align,"center"],r,i),anchor:xn([n.anchor,"center"],r,i),area:r.chart.chartArea,backgroundColor:xn([n.backgroundColor,null],r,i),borderColor:xn([n.borderColor,null],r,i),borderRadius:xn([n.borderRadius,0],r,i),borderWidth:xn([n.borderWidth,0],r,i),clamp:xn([n.clamp,!1],r,i),clip:xn([n.clip,!1],r,i),color:a,display:e,font:s,lines:t,offset:xn([n.offset,4],r,i),opacity:xn([n.opacity,1],r,i),origin:i0e(o._el,r),padding:hr(xn([n.padding,4],r,i)),positioner:s0e(o._el),rotation:xn([n.rotation,0],r,i)*(Math.PI/180),size:kh.textSize(o._ctx,t,s),textAlign:xn([n.textAlign,"start"],r,i),textShadowBlur:xn([n.textShadowBlur,0],r,i),textShadowColor:xn([n.textShadowColor,a],r,i),textStrokeColor:xn([n.textStrokeColor,a],r,i),textStrokeWidth:xn([n.textStrokeWidth,0],r,i)}},update:function(e){var t=this,n=null,r=null,o=t._index,i=t._config,s,a,l,c=xn([i.display,!0],e,o);c&&(s=e.dataset.data[o],a=st(an(i.formatter,[s,e]),s),l=Pt(a)?[]:kh.toTextLines(a),l.length&&(n=t._modelize(c,l,i,e),r=o0e(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=kh.bound(0,o.opacity,1),r.translate(Hs(t.x),Hs(t.y)),r.rotate(o.rotation),l0e(r,i.frame,o),d0e(r,o.lines,i.text,o),r.restore())}});var f0e=Number.MIN_SAFE_INTEGER||-9007199254740991,h0e=Number.MAX_SAFE_INTEGER||9007199254740991;function Uf(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 z$(e,t){var n=h0e,r=f0e,o=t.origin,i,s,a,l,c;for(i=0;i<e.length;++i)s=e[i],a=s.x-o.x,l=s.y-o.y,c=t.vx*a+t.vy*l,n=Math.min(n,c),r=Math.max(r,c);return{min:n,max:r}}function Cv(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 A9=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};sr(A9.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=Uf(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=[Cv(t[0],t[1]),Cv(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(Cv(n[0],n[1]),Cv(n[0],n[3])),o=0;o<r.length;++o)if(i=z$(t,r[o]),s=z$(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[Uf({x:t.x,y:t.y},r,n),Uf({x:t.x+t.w,y:t.y},r,n),Uf({x:t.x+t.w,y:t.y+t.h},r,n),Uf({x:t.x,y:t.y+t.h},r,n)]}});function T9(e,t,n){var r=t.positioner(e,t),o=r.vx,i=r.vy;if(!o&&!i)return{x:r.x,y:r.y};var s=n.w,a=n.h,l=t.rotation,c=Math.abs(s/2*Math.cos(l))+Math.abs(a/2*Math.sin(l)),u=Math.abs(s/2*Math.sin(l))+Math.abs(a/2*Math.cos(l)),d=1/Math.max(Math.abs(o),Math.abs(i));return c*=o*d,u*=i*d,c+=t.offset*o,u+=t.offset*i,{x:r.x+c,y:r.y+u}}function p0e(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 g0e(e){var t,n,r,o,i,s,a;for(t=0,n=e.length;t<n;++t)r=e[t],o=r.$layout,o._visible&&(a=new Proxy(r._el,{get:(l,c)=>l.getProps([c],!0)[c]}),i=r.geometry(),s=T9(a,r.model(),i),o._box.update(s,i,r.rotation()));return p0e(e,function(l,c){var u=l._hidable,d=c._hidable;u&&d||d?c._visible=!1:u&&(l._visible=!1)})}var Lh={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 A9,_hidable:!1,_visible:!0,_set:n,_idx:s._index};return t.sort(function(a,l){var c=a.$layout,u=l.$layout;return c._idx===u._idx?u._set-c._set:u._idx-c._idx}),this.update(t),t},update:function(e){var t=!1,n,r,o,i,s;for(n=0,r=e.length;n<r;++n)o=e[n],i=o.model(),s=o.$layout,s._hidable=i&&i.display==="auto",s._visible=o.visible(),t|=s._hidable;t&&g0e(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=T9(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},m0e=function(e){if(Pt(e))return null;var t=e,n,r,o;if(Dt(e))if(!Pt(e.label))t=e.label;else if(!Pt(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},v0e={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:m0e,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},Xr="$datalabels",D9="$default";function b0e(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=sr({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(sr({},[t,i[a],{_key:a}]))}):o.push(t),r=o.reduce(function(a,l){return Qt(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||D9]=c}),delete l.listeners,a},{}),{labels:o,listeners:r})}function x_(e,t,n,r){if(t){var o=n.$context,i=n.$groups,s;t[i._set]&&(s=t[i._set][i._key],s&&an(s,[o,r])===!0&&(e[Xr]._dirty=!0,n.update(o)))}}function y0e(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&x_(e,t.leave,n,o),i&&x_(e,t.enter,r,o))}function x0e(e,t){var n=e[Xr],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=Lh.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,y0e(e,r,o,i,t)}}function w0e(e,t){var n=e[Xr],r=n._listeners.click,o=r&&Lh.lookup(n._labels,t);o&&x_(e,r,o,t)}var S0e={id:"datalabels",defaults:v0e,beforeInit:function(e){e[Xr]={_actives:[]}},beforeUpdate:function(e){var t=e[Xr];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[Xr],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=b0e(a,n),c=t.meta.data||[],u=e.ctx,d,f,p,m,v,y,b,x;for(u.save(),d=0,p=c.length;d<p;++d)if(b=c[d],b[Xr]=[],s&&b&&e.getDataVisibility(d)&&!b.skip)for(f=0,m=l.labels.length;f<m;++f)v=l.labels[f],y=v._key,x=new O9(v,u,b,d),x.$groups={_set:r,_key:y||D9},x.$context={active:!1,chart:e,dataIndex:d,dataset:a,datasetIndex:r},x.update(x.$context),b[Xr].push(x),i.push(x);u.restore(),sr(o._listeners,l.listeners,{merger:function(E,R,P){R[E]=R[E]||{},R[E][t.index]=P[E],o._listened=!0}})},afterUpdate:function(e){e[Xr]._labels=Lh.prepare(e[Xr]._datasets)},afterDatasetsDraw:function(e){Lh.draw(e,e[Xr]._labels)},beforeEvent:function(e,t){if(e[Xr]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":x0e(e,n);break;case"click":w0e(e,n);break}}},afterEvent:function(e){var t=e[Xr],n=t._actives,r=t._actives=e.getActiveElements(),o=kh.arrayDiff(n,r),i,s,a,l,c,u,d;for(i=0,s=o.length;i<s;++i)if(c=o[i],c[1])for(d=c[0].element[Xr]||[],a=0,l=d.length;a<l;++a)u=d[a],u.$context.active=c[1]===1,u.update(u.$context);(t._dirty||o.length)&&(Lh.update(t._labels),e.render()),delete t._dirty}};Mn.register(...Fce);Mn.register(S0e);Mn.register(gc);Mn.register(Qd);Mn.register(Zd);Mn.register(qs);Mn.register(Yc);Mn.register(Ja);Mn.register(el);Mn.register(Ob);Mn.register(I6);function k2({cfg:e,onDatapointClick:t}){var d;const[n,r]=w.useState(""),o=we(f=>f.selectedLensId),i=w.useRef(null),[s,a]=w.useState(),l=we(f=>f.themeStyle);function c(f,p){var v,y;if((((v=f.data.datasets)==null?void 0:v.filter(b=>!!b.fill))||[]).length>0){const b=(y=f==null?void 0:f.data.datasets)==null?void 0:y.map(E=>({...E,backgroundColor:[E.backgroundColor].map(R=>{const P=p.createLinearGradient(0,0,0,400);return P.addColorStop(0,R),P.addColorStop(.7,I4("--semaphor-background")),P})}));return{...f,data:{...f.data,datasets:b}}}return f}w.useEffect(()=>{if(i.current){const f=window.getComputedStyle(i.current);r(f.fontFamily)}},[]),w.useEffect(()=>{var m,v,y,b;if(!n)return;(v=(m=l==null?void 0:l.chart)==null?void 0:m.font)!=null&&v.family&&(Mn.defaults.font={...Mn.defaults.font,...(y=l==null?void 0:l.chart)==null?void 0:y.font,family:n}),e.options&&(e.options.responsive=!0,e.options.maintainAspectRatio=!1);const f=(b=i==null?void 0:i.current)==null?void 0:b.getContext("2d");if(!f)return;let p;try{const x=c(e,f);p=new Mn(f,x),a(p)}catch(x){console.log("error creating chart",x)}return()=>{p&&p.destroy()}},[(d=l==null?void 0:l.chart)==null?void 0:d.font,o,n]);function u(f){var m,v;if(!s)return;const p=s==null?void 0:s.getElementsAtEventForMode(f,"nearest",{intersect:!0},!0);if(p&&p.length>0){const y=p[0].datasetIndex,b=p[0].index,x=(v=(m=p[0].element)==null?void 0:m.$context)==null?void 0:v.raw;t==null||t(s,y,b,x)}}return C.jsx("div",{onClick:u,className:"relative h-[99%]",children:C.jsx("canvas",{ref:i})})}function B$(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function M9(...e){return t=>{let n=!1;const r=e.map(o=>{const i=B$(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():B$(e[o],null)}}}}function Qc(...e){return S.useCallback(M9(...e),e)}var I9=S.forwardRef((e,t)=>{const{children:n,...r}=e,o=S.Children.toArray(n),i=o.find(_0e);if(i){const s=i.props.children,a=o.map(l=>l===i?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:l);return C.jsx(w_,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return C.jsx(w_,{...r,ref:t,children:n})});I9.displayName="Slot";var w_=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const o=R0e(n);return S.cloneElement(n,{...E0e(r,n.props),ref:t?M9(t,o):o})}return S.Children.count(n)>1?S.Children.only(null):null});w_.displayName="SlotClone";var C0e=({children:e})=>C.jsx(C.Fragment,{children:e});function _0e(e){return S.isValidElement(e)&&e.type===C0e}function E0e(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 R0e(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var P0e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],xg=P0e.reduce((e,t)=>{const n=S.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?I9:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),S_=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{};function O0e(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var wg=e=>{const{present:t,children:n}=e,r=A0e(t),o=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),i=Qc(r.ref,T0e(o));return typeof n=="function"||r.isPresent?S.cloneElement(o,{ref:i}):null};wg.displayName="Presence";function A0e(e){const[t,n]=S.useState(),r=S.useRef({}),o=S.useRef(e),i=S.useRef("none"),s=e?"mounted":"unmounted",[a,l]=O0e(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=_v(r.current);i.current=a==="mounted"?c:"none"},[a]),S_(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,p=_v(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),S_(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=p=>{const v=_v(r.current).includes(p.animationName);if(p.target===t&&v&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=p=>{p.target===t&&(i.current=_v(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:S.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function _v(e){return(e==null?void 0:e.animationName)||"none"}function T0e(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function D0e(e,t=[]){let n=[];function r(i,s){const a=S.createContext(s),l=n.length;n=[...n,s];const c=d=>{var b;const{scope:f,children:p,...m}=d,v=((b=f==null?void 0:f[e])==null?void 0:b[l])||a,y=S.useMemo(()=>m,Object.values(m));return C.jsx(v.Provider,{value:y,children:p})};c.displayName=i+"Provider";function u(d,f){var v;const p=((v=f==null?void 0:f[e])==null?void 0:v[l])||a,m=S.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>S.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,M0e(o,...t)]}function M0e(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Wl(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var I0e=S.createContext(void 0);function $0e(e){const t=S.useContext(I0e);return e||t||"ltr"}function xc(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 N0e(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var L2="ScrollArea",[$9,w3e]=D0e(L2),[k0e,ii]=$9(L2),F2=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=S.useState(null),[c,u]=S.useState(null),[d,f]=S.useState(null),[p,m]=S.useState(null),[v,y]=S.useState(null),[b,x]=S.useState(0),[E,R]=S.useState(0),[P,O]=S.useState(!1),[A,D]=S.useState(!1),I=Qc(t,j=>l(j)),L=$0e(o);return C.jsx(k0e,{scope:n,type:r,dir:L,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:P,onScrollbarXEnabledChange:O,scrollbarY:v,onScrollbarYChange:y,scrollbarYEnabled:A,onScrollbarYEnabledChange:D,onCornerWidthChange:x,onCornerHeightChange:R,children:C.jsx(xg.div,{dir:L,...s,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":b+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});F2.displayName=L2;var N9="ScrollAreaViewport",k9=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=ii(N9,n),a=S.useRef(null),l=Qc(t,a,s.onViewportChange);return C.jsxs(C.Fragment,{children:[C.jsx("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}"},nonce:o}),C.jsx(xg.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:C.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});k9.displayName=N9;var ps="ScrollAreaScrollbar",j2=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ii(ps,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return S.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?C.jsx(L0e,{...r,ref:t,forceMount:n}):o.type==="scroll"?C.jsx(F0e,{...r,ref:t,forceMount:n}):o.type==="auto"?C.jsx(L9,{...r,ref:t,forceMount:n}):o.type==="always"?C.jsx(z2,{...r,ref:t}):null});j2.displayName=ps;var L0e=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ii(ps,e.__scopeScrollArea),[i,s]=S.useState(!1);return S.useEffect(()=>{const a=o.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),s(!0)},u=()=>{l=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",u),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),C.jsx(wg,{present:n||i,children:C.jsx(L9,{"data-state":i?"visible":"hidden",...r,ref:t})})}),F0e=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ii(ps,e.__scopeScrollArea),i=e.orientation==="horizontal",s=_y(()=>l("SCROLL_END"),100),[a,l]=N0e("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 S.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),S.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const f=()=>{const p=c[u];d!==p&&(l("SCROLL"),s()),d=p};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[o.viewport,i,l,s]),C.jsx(wg,{present:n||a!=="hidden",children:C.jsx(z2,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:xc(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:xc(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),L9=S.forwardRef((e,t)=>{const n=ii(ps,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=S.useState(!1),a=e.orientation==="horizontal",l=_y(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return Fd(n.viewport,l),Fd(n.content,l),C.jsx(wg,{present:r||i,children:C.jsx(z2,{"data-state":i?"visible":"hidden",...o,ref:t})})}),z2=S.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=ii(ps,e.__scopeScrollArea),i=S.useRef(null),s=S.useRef(0),[a,l]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=V9(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:f=>s.current=f};function d(f,p){return W0e(f,s.current,a,p)}return n==="horizontal"?C.jsx(j0e,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollLeft,p=V$(f,a,o.dir);i.current.style.transform=`translate3d(${p}px, 0, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollLeft=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollLeft=d(f,o.dir))}}):n==="vertical"?C.jsx(z0e,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const f=o.viewport.scrollTop,p=V$(f,a);i.current.style.transform=`translate3d(0, ${p}px, 0)`}},onWheelScroll:f=>{o.viewport&&(o.viewport.scrollTop=f)},onDragScroll:f=>{o.viewport&&(o.viewport.scrollTop=d(f))}}):null}),j0e=S.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ii(ps,e.__scopeScrollArea),[s,a]=S.useState(),l=S.useRef(null),c=Qc(t,l,i.onScrollbarXChange);return S.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),C.jsx(j9,{"data-orientation":"horizontal",...o,ref:c,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Cy(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(f),W9(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Jb(s.paddingLeft),paddingEnd:Jb(s.paddingRight)}})}})}),z0e=S.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=ii(ps,e.__scopeScrollArea),[s,a]=S.useState(),l=S.useRef(null),c=Qc(t,l,i.onScrollbarYChange);return S.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),C.jsx(j9,{"data-orientation":"vertical",...o,ref:c,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Cy(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const f=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(f),W9(f,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Jb(s.paddingTop),paddingEnd:Jb(s.paddingBottom)}})}})}),[B0e,F9]=$9(ps),j9=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,p=ii(ps,n),[m,v]=S.useState(null),y=Qc(t,I=>v(I)),b=S.useRef(null),x=S.useRef(""),E=p.viewport,R=r.content-r.viewport,P=Wl(u),O=Wl(l),A=_y(d,10);function D(I){if(b.current){const L=I.clientX-b.current.left,j=I.clientY-b.current.top;c({x:L,y:j})}}return S.useEffect(()=>{const I=L=>{const j=L.target;(m==null?void 0:m.contains(j))&&P(L,R)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[E,m,R,P]),S.useEffect(O,[r,O]),Fd(m,A),Fd(p.content,A),C.jsx(B0e,{scope:n,scrollbar:m,hasThumb:o,onThumbChange:Wl(i),onThumbPointerUp:Wl(s),onThumbPositionChange:O,onThumbPointerDown:Wl(a),children:C.jsx(xg.div,{...f,ref:y,style:{position:"absolute",...f.style},onPointerDown:xc(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),b.current=m.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),D(I))}),onPointerMove:xc(e.onPointerMove,D),onPointerUp:xc(e.onPointerUp,I=>{const L=I.target;L.hasPointerCapture(I.pointerId)&&L.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=x.current,p.viewport&&(p.viewport.style.scrollBehavior=""),b.current=null})})})}),Zb="ScrollAreaThumb",z9=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=F9(Zb,e.__scopeScrollArea);return C.jsx(wg,{present:n||o.hasThumb,children:C.jsx(V0e,{ref:t,...r})})}),V0e=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=ii(Zb,n),s=F9(Zb,n),{onThumbPositionChange:a}=s,l=Qc(t,d=>s.onThumbChange(d)),c=S.useRef(void 0),u=_y(()=>{c.current&&(c.current(),c.current=void 0)},100);return S.useEffect(()=>{const d=i.viewport;if(d){const f=()=>{if(u(),!c.current){const p=U0e(d,a);c.current=p,a()}};return a(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[i.viewport,u,a]),C.jsx(xg.div,{"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:xc(e.onPointerDownCapture,d=>{const p=d.target.getBoundingClientRect(),m=d.clientX-p.left,v=d.clientY-p.top;s.onThumbPointerDown({x:m,y:v})}),onPointerUp:xc(e.onPointerUp,s.onThumbPointerUp)})});z9.displayName=Zb;var B2="ScrollAreaCorner",B9=S.forwardRef((e,t)=>{const n=ii(B2,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?C.jsx(H0e,{...e,ref:t}):null});B9.displayName=B2;var H0e=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=ii(B2,n),[i,s]=S.useState(0),[a,l]=S.useState(0),c=!!(i&&a);return Fd(o.scrollbarX,()=>{var d;const u=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(u),l(u)}),Fd(o.scrollbarY,()=>{var d;const u=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(u),s(u)}),c?C.jsx(xg.div,{...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 Jb(e){return e?parseInt(e,10):0}function V9(e,t){const n=e/t;return isNaN(n)?0:n}function Cy(e){const t=V9(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function W0e(e,t,n,r="ltr"){const o=Cy(n),i=o/2,s=t||i,a=o-s,l=n.scrollbar.paddingStart+s,c=n.scrollbar.size-n.scrollbar.paddingEnd-a,u=n.content-n.viewport,d=r==="ltr"?[0,u]:[u*-1,0];return H9([l,c],d)(e)}function V$(e,t,n="ltr"){const r=Cy(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,a=i-r,l=n==="ltr"?[0,s]:[s*-1,0],c=l_(e,l);return H9([0,s],[0,a])(c)}function H9(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 W9(e,t){return e>0&&e<t}var U0e=(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 _y(e,t){const n=Wl(e),r=S.useRef(0);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),S.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Fd(e,t){const n=Wl(t);S_(()=>{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])}var U9=F2,G0e=k9,q0e=B9;const cp=S.forwardRef(({className:e,children:t,...n},r)=>C.jsxs(U9,{ref:r,className:xe("relative overflow-hidden",e),...n,children:[C.jsx(G0e,{className:"h-full w-full rounded-[inherit]",children:t}),C.jsx(Ey,{}),C.jsx(q0e,{})]}));cp.displayName=U9.displayName;const Ey=S.forwardRef(({className:e,orientation:t="vertical",...n},r)=>C.jsx(j2,{ref:r,orientation:t,className:xe("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:C.jsx(z9,{className:"relative flex-1 rounded-full bg-border"})}));Ey.displayName=j2.displayName;function Y0e({card:e,frame:t}){var K,H,k;const{customCards:n}=No();w.useRef(null);const r=we(W=>W.themeStyle),o=we(W=>W.selectedSheetId),i=we(W=>W.isDashboardEditing),s=we(W=>W.selectedLensId),a=we(W=>W.dashboard.filters),l=a==null?void 0:a.find(W=>W.id===t.filterId),{setCardTitle:c,setCardDescription:u,setSelectedFrameId:d,updateFilter:f}=fr(),{updateFrame:p}=fr(),m=((K=e.customCardPreferences)==null?void 0:K.showCardHeader)??!0,{isError:v,isLoading:y,isFetching:b,cfg:x,visualKey:E,data:R,handleDatapointClick:P}=YR(e);function O(){var W;if(n&&n.length>0){const B=n.find(U=>U.cardId===e.id);if(B&&B.replaceDefault){const U=B.content;if(U)return C.jsx(U,{card:e})}}return e.type==="kpi"?C.jsx(IL,{card:e,data:(R==null?void 0:R.records)||[]}):e.type==="text"&&((W=t==null?void 0:t.cards)==null?void 0:W.length)===1?C.jsx(cp,{className:"mx-3 my-6 overflow-y-auto break-words px-3",children:C.jsx(JC,{isLoading:y||b,card:e,data:(R==null?void 0:R.records)||[]})}):z}function A(){return["{{ filters | where }}","{{ filters | and }}"].some(B=>{var U;return(U=e.sql)==null?void 0:U.includes(B)})?C.jsx(Qpe,{}):null}function D(){if(v)return C.jsx("p",{className:"text-sm",children:"Oops! It seems like something went wrong. Please review your connection or filters."});if(e.type==="table"&&(R!=null&&R.records)&&(R==null?void 0:R.records.length)>0)return C.jsx("div",{className:"relative flex min-h-0 flex-1 grow basis-0",children:C.jsx(w9,{card:e,data:(R==null?void 0:R.records)||[]})});if(e.type==="text")return C.jsx(cp,{className:"overflow-y-auto break-words pr-2",children:C.jsx(JC,{isLoading:y||b,card:e,data:(R==null?void 0:R.records)||[]})});if(e.type==="custom")return C.jsx(e0e,{frame:t,card:e});if(n&&n.length>0){const W=n.find(B=>B.cardId===e.id);if(W&&W.content){const B=W.content;return C.jsx(B,{card:e})}}if(x)return C.jsx(k2,{cfg:x,onDatapointClick:P},`${E}-${s}`)}function I(){if(n&&n.length>0){const W=n.find(B=>B.cardId===e.id);if(W&&W.footer){const B=W.footer;if(B)return C.jsx(B,{card:e})}}return null}function L(){var W,B,U;return C.jsx(LE,{value:t.activeCardId,className:"flex items-center justify-end gap-3",onValueChange:q=>{const $={...t,activeCardId:q};p(o,$)},children:C.jsx(T0,{style:{borderRadius:(B=(W=r==null?void 0:r.chart)==null?void 0:W.options)==null?void 0:B.borderRadius},className:"flex-end flex-wrap items-center",children:(U=t.cards.filter(q=>{var $;return!(($=q.tabTitle)!=null&&$.endsWith("__Header"))&&(q.displayTab===!0||q.displayTab===void 0)}))==null?void 0:U.map(q=>{var $,Y;return C.jsx(D0,{style:{borderRadius:(Y=($=r==null?void 0:r.chart)==null?void 0:$.options)==null?void 0:Y.borderRadius},value:q.id,children:q.tabTitle||q.title},q.id)})})})}function j(){let W=t.cards.find(B=>B.type==="kpi"&&B.tabTitle===`${e.tabTitle}__Header`);return W||(W=t.cards.find(B=>B.type==="kpi"&&B.tabTitle==="All__Header")),W?C.jsx("div",{className:"flex items-end gap-2",children:C.jsx(Zhe,{renderFilterInfo:A,card:W})}):C.jsxs(C.Fragment,{children:[C.jsxs("div",{role:"card-title-container",className:"flex items-center gap-2",children:[C.jsx(es,{text:e.title,onSave:B=>c(o,e.id,B),children:C.jsx(Gd,{className:xe("text-base",{}),children:e.title})}),(i||e.info)&&C.jsx(r7,{card:e}),e.refreshInterval&&C.jsxs(l7,{children:[C.jsx(c7,{className:"pr-1",children:C.jsx("div",{className:xe("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":y||b})})}),C.jsx(a2,{side:"right",align:"center",children:C.jsx("p",{className:"text-xs",children:`Realtime (${e==null?void 0:e.refreshInterval})`})})]}),A()]}),C.jsx("div",{role:"card-description-container",children:C.jsx(es,{text:(e==null?void 0:e.description)||"",onSave:B=>u(o,e.id,B),children:C.jsxs(IE,{className:xe("",{}),children:[" ",e.description]})})})]})}if(!e.id)return null;const z=C.jsxs(C.Fragment,{children:[m?C.jsx(P0,{children:C.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[C.jsx("div",{className:"grow",role:"header-container",children:j()}),C.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.cards.length>1&&L(),C.jsx("div",{children:l&&C.jsxs("div",{style:{borderRadius:(k=(H=r==null?void 0:r.chart)==null?void 0:H.options)==null?void 0:k.borderRadius},role:"frame-filter-container",className:"flex h-10 shrink-0 items-center bg-muted p-1",children:[!Ud.includes(l.dataType)&&C.jsx(es,{className:"my-1",containerClassName:"shrink-0",text:l.title||l.column,onSave:W=>f({...l,title:W}),children:C.jsx(Dn,{className:"px-3",children:l.title})}),vP(l)]})})]})]})}):C.jsx("div",{className:"h-8"}),C.jsx(O0,{className:"relative flex min-h-0 grow flex-col",children:D()}),C.jsx(u3,{children:I()})]});return C.jsx("div",{className:xe("flex h-full flex-col",{"animate-pulse":y||b}),children:O()})}function K0e({frame:e,footer:t,className:n,...r}){var v,y;const o=w.useRef(null),i=we(b=>b.themeStyle),s=we(b=>b.selectedFrameId),a=we(b=>b.isDashboardEditing),{setSelectedFrameId:l}=fr(),{setSelectedConnectionId:c,setSelectedDatabaseName:u,setSelectedSchemaName:d,setSelectedTableName:f}=W0(),p=e.cards.find(b=>b.id===e.activeCardId);woe(e,o);function m(b){b.stopPropagation(),l(e.id),p!=null&&p.connectionId&&c(p==null?void 0:p.connectionId),p!=null&&p.lastSelectedDatabase&&u(p==null?void 0:p.lastSelectedDatabase),p!=null&&p.lastSelectedSchema&&d(p==null?void 0:p.lastSelectedSchema),p!=null&&p.lastSelectedTable&&f(p==null?void 0:p.lastSelectedTable)}return C.jsx(q0,{FallbackComponent:pR,children:C.jsxs("div",{tabIndex:-1,ref:o,role:"card-frame",onClick:m,style:{borderRadius:(y=(v=i==null?void 0:i.chart)==null?void 0:v.options)==null?void 0:y.borderRadius},className:xe("relative flex h-full flex-col rounded-sm border bg-background shadow-sm",{"border-dashed border-foreground/50":s===e.id&&a},i==null?void 0:i.dashboardCard,n,"semaphor-card-frame"),...r,children:[C.jsx(D4,{frame:e}),C.jsx(Y0e,{card:p,frame:e},p.id)]})})}function zt(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 Io(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function kr(e,t){const n=zt(e);return isNaN(t)?Io(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Oi(e,t){const n=zt(e);if(isNaN(t))return Io(e,NaN);if(!t)return n;const r=n.getDate(),o=Io(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 V2=6048e5,X0e=864e5;let Q0e={};function Sg(){return Q0e}function is(e,t){var a,l,c,u;const n=Sg(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=zt(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 Lc(e){return is(e,{weekStartsOn:1})}function G9(e){const t=zt(e),n=t.getFullYear(),r=Io(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=Lc(r),i=Io(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=Lc(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function jd(e){const t=zt(e);return t.setHours(0,0,0,0),t}function e0(e){const t=zt(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 Qi(e,t){const n=jd(e),r=jd(t),o=+n-e0(n),i=+r-e0(r);return Math.round((o-i)/X0e)}function Z0e(e){const t=G9(e),n=Io(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Lc(n)}function C_(e,t){const n=t*7;return kr(e,n)}function J0e(e,t){return Oi(e,t*12)}function eye(e){let t;return e.forEach(function(n){const r=zt(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function tye(e){let t;return e.forEach(n=>{const r=zt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function no(e,t){const n=jd(e),r=jd(t);return+n==+r}function H2(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function nye(e){if(!H2(e)&&typeof e!="number")return!1;const t=zt(e);return!isNaN(Number(t))}function up(e,t){const n=zt(e),r=zt(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function rye(e,t,n){const r=is(e,n),o=is(t,n),i=+r-e0(r),s=+o-e0(o);return Math.round((i-s)/V2)}function W2(e){const t=zt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function oo(e){const t=zt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function q9(e){const t=zt(e),n=Io(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function U2(e,t){var a,l,c,u;const n=Sg(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,o=zt(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 Y9(e){return U2(e,{weekStartsOn:1})}const oye={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"}},iye=(e,t,n)=>{let r;const o=oye[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 Cw(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const sye={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},aye={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lye={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},cye={date:Cw({formats:sye,defaultWidth:"full"}),time:Cw({formats:aye,defaultWidth:"full"}),dateTime:Cw({formats:lye,defaultWidth:"full"})},uye={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},dye=(e,t,n,r)=>uye[e];function Gf(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 fye={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},hye={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},pye={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"]},gye={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"]},mye={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"}},vye={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"}},bye=(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"},yye={ordinalNumber:bye,era:Gf({values:fye,defaultWidth:"wide"}),quarter:Gf({values:hye,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Gf({values:pye,defaultWidth:"wide"}),day:Gf({values:gye,defaultWidth:"wide"}),dayPeriod:Gf({values:mye,defaultWidth:"wide",formattingValues:vye,defaultFormattingWidth:"wide"})};function qf(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)?wye(a,d=>d.test(s)):xye(a,d=>d.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(s.length);return{value:c,rest:u}}}function xye(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function wye(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Sye(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 Cye=/^(\d+)(th|st|nd|rd)?/i,_ye=/\d+/i,Eye={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},Rye={any:[/^b/i,/^(a|c)/i]},Pye={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Oye={any:[/1/i,/2/i,/3/i,/4/i]},Aye={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},Tye={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]},Dye={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},Mye={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]},Iye={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},$ye={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}},Nye={ordinalNumber:Sye({matchPattern:Cye,parsePattern:_ye,valueCallback:e=>parseInt(e,10)}),era:qf({matchPatterns:Eye,defaultMatchWidth:"wide",parsePatterns:Rye,defaultParseWidth:"any"}),quarter:qf({matchPatterns:Pye,defaultMatchWidth:"wide",parsePatterns:Oye,defaultParseWidth:"any",valueCallback:e=>e+1}),month:qf({matchPatterns:Aye,defaultMatchWidth:"wide",parsePatterns:Tye,defaultParseWidth:"any"}),day:qf({matchPatterns:Dye,defaultMatchWidth:"wide",parsePatterns:Mye,defaultParseWidth:"any"}),dayPeriod:qf({matchPatterns:Iye,defaultMatchWidth:"any",parsePatterns:$ye,defaultParseWidth:"any"})},K9={code:"en-US",formatDistance:iye,formatLong:cye,formatRelative:dye,localize:yye,match:Nye,options:{weekStartsOn:0,firstWeekContainsDate:1}};function kye(e){const t=zt(e);return Qi(t,q9(t))+1}function X9(e){const t=zt(e),n=+Lc(t)-+Z0e(t);return Math.round(n/V2)+1}function Q9(e,t){var u,d,f,p;const n=zt(e),r=n.getFullYear(),o=Sg(),i=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??o.firstWeekContainsDate??((p=(f=o.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,s=Io(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=is(s,t),l=Io(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=is(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Lye(e,t){var a,l,c,u;const n=Sg(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,o=Q9(e,t),i=Io(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),is(i,t)}function Z9(e,t){const n=zt(e),r=+is(n,t)-+Lye(n,t);return Math.round(r/V2)+1}function tn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const ya={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return tn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):tn(n+1,2)},d(e,t){return tn(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 tn(e.getHours()%12||12,t.length)},H(e,t){return tn(e.getHours(),t.length)},m(e,t){return tn(e.getMinutes(),t.length)},s(e,t){return tn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return tn(o,t.length)}},Eu={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},H$={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 ya.y(e,t)},Y:function(e,t,n,r){const o=Q9(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return tn(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):tn(i,t.length)},R:function(e,t){const n=G9(e);return tn(n,t.length)},u:function(e,t){const n=e.getFullYear();return tn(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 tn(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 tn(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 ya.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 tn(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=Z9(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):tn(o,t.length)},I:function(e,t,n){const r=X9(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):tn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):ya.d(e,t)},D:function(e,t,n){const r=kye(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):tn(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 tn(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 tn(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 tn(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=Eu.noon:r===0?o=Eu.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=Eu.evening:r>=12?o=Eu.afternoon:r>=4?o=Eu.morning:o=Eu.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 ya.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):ya.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):tn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):tn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):ya.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):ya.s(e,t)},S:function(e,t){return ya.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return U$(r);case"XXXX":case"XX":return zl(r);case"XXXXX":case"XXX":default:return zl(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return U$(r);case"xxxx":case"xx":return zl(r);case"xxxxx":case"xxx":default:return zl(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+W$(r,":");case"OOOO":default:return"GMT"+zl(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+W$(r,":");case"zzzz":default:return"GMT"+zl(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return tn(r,t.length)},T:function(e,t,n){const r=e.getTime();return tn(r,t.length)}};function W$(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+tn(i,2)}function U$(e,t){return e%60===0?(e>0?"-":"+")+tn(Math.abs(e)/60,2):zl(e,t)}function zl(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=tn(Math.trunc(r/60),2),i=tn(r%60,2);return n+o+t+i}const G$=(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"})}},J9=(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"})}},Fye=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return G$(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}}",G$(r,t)).replace("{{time}}",J9(o,t))},jye={p:J9,P:Fye},zye=/^D+$/,Bye=/^Y+$/,Vye=["D","DD","YY","YYYY"];function Hye(e){return zye.test(e)}function Wye(e){return Bye.test(e)}function Uye(e,t,n){const r=Gye(e,t,n);if(console.warn(r),Vye.includes(e))throw new RangeError(r)}function Gye(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 qye=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Yye=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Kye=/^'([^]*?)'?$/,Xye=/''/g,Qye=/[a-zA-Z]/;function ts(e,t,n){var u,d,f,p,m,v,y,b;const r=Sg(),o=(n==null?void 0:n.locale)??r.locale??K9,i=(n==null?void 0:n.firstWeekContainsDate)??((d=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??r.firstWeekContainsDate??((p=(f=r.locale)==null?void 0:f.options)==null?void 0:p.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((v=(m=n==null?void 0:n.locale)==null?void 0:m.options)==null?void 0:v.weekStartsOn)??r.weekStartsOn??((b=(y=r.locale)==null?void 0:y.options)==null?void 0:b.weekStartsOn)??0,a=zt(e);if(!nye(a))throw new RangeError("Invalid time value");let l=t.match(Yye).map(x=>{const E=x[0];if(E==="p"||E==="P"){const R=jye[E];return R(x,o.formatLong)}return x}).join("").match(qye).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const E=x[0];if(E==="'")return{isToken:!1,value:Zye(x)};if(H$[E])return{isToken:!0,value:x};if(E.match(Qye))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");return{isToken:!1,value:x}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(x=>{if(!x.isToken)return x.value;const E=x.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Wye(E)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&Hye(E))&&Uye(E,t,String(e));const R=H$[E[0]];return R(a,E,o.localize,c)}).join("")}function Zye(e){const t=e.match(Kye);return t?t[1].replace(Xye,"'"):e}function Jye(e){const t=zt(e),n=t.getFullYear(),r=t.getMonth(),o=Io(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function exe(e){return Math.trunc(+zt(e)/1e3)}function txe(e){const t=zt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function nxe(e,t){return rye(txe(e),oo(e),t)+1}function __(e,t){const n=zt(e),r=zt(t);return n.getTime()>r.getTime()}function eF(e,t){const n=zt(e),r=zt(t);return+n<+r}function G2(e,t){const n=zt(e),r=zt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function rxe(e,t){const n=zt(e),r=zt(t);return n.getFullYear()===r.getFullYear()}function _w(e,t){return kr(e,-t)}function Ew(e,t){const n=zt(e),r=n.getFullYear(),o=n.getDate(),i=Io(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=Jye(i);return n.setMonth(t,Math.min(o,s)),n}function q$(e,t){const n=zt(e);return isNaN(+n)?Io(e,NaN):(n.setFullYear(t),n)}var nt=function(){return nt=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},nt.apply(this,arguments)};function oxe(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 tF(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 E_={exports:{}},Yf={};/**
325
+ * @license React
326
+ * react-jsx-runtime.development.js
327
+ *
328
+ * Copyright (c) Facebook, Inc. and its affiliates.
329
+ *
330
+ * This source code is licensed under the MIT license found in the
331
+ * LICENSE file in the root directory of this source tree.
332
+ */var Y$;function ixe(){return Y$||(Y$=1,process.env.NODE_ENV!=="production"&&function(){var e=w,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m=Symbol.iterator,v="@@iterator";function y(N){if(N===null||typeof N!="object")return null;var se=m&&N[m]||N[v];return typeof se=="function"?se:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(N){{for(var se=arguments.length,he=new Array(se>1?se-1:0),Oe=1;Oe<se;Oe++)he[Oe-1]=arguments[Oe];E("error",N,he)}}function E(N,se,he){{var Oe=b.ReactDebugCurrentFrame,Be=Oe.getStackAddendum();Be!==""&&(se+="%s",he=he.concat([Be]));var Ue=he.map(function(Fe){return String(Fe)});Ue.unshift("Warning: "+se),Function.prototype.apply.call(console[N],console,Ue)}}var R=!1,P=!1,O=!1,A=!1,D=!1,I;I=Symbol.for("react.module.reference");function L(N){return!!(typeof N=="string"||typeof N=="function"||N===r||N===i||D||N===o||N===c||N===u||A||N===p||R||P||O||typeof N=="object"&&N!==null&&(N.$$typeof===f||N.$$typeof===d||N.$$typeof===s||N.$$typeof===a||N.$$typeof===l||N.$$typeof===I||N.getModuleId!==void 0))}function j(N,se,he){var Oe=N.displayName;if(Oe)return Oe;var Be=se.displayName||se.name||"";return Be!==""?he+"("+Be+")":he}function z(N){return N.displayName||"Context"}function K(N){if(N==null)return null;if(typeof N.tag=="number"&&x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof N=="function")return N.displayName||N.name||null;if(typeof N=="string")return N;switch(N){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof N=="object")switch(N.$$typeof){case a:var se=N;return z(se)+".Consumer";case s:var he=N;return z(he._context)+".Provider";case l:return j(N,N.render,"ForwardRef");case d:var Oe=N.displayName||null;return Oe!==null?Oe:K(N.type)||"Memo";case f:{var Be=N,Ue=Be._payload,Fe=Be._init;try{return K(Fe(Ue))}catch{return null}}}return null}var H=Object.assign,k=0,W,B,U,q,$,Y,X;function M(){}M.__reactDisabledLog=!0;function oe(){{if(k===0){W=console.log,B=console.info,U=console.warn,q=console.error,$=console.group,Y=console.groupCollapsed,X=console.groupEnd;var N={configurable:!0,enumerable:!0,value:M,writable:!0};Object.defineProperties(console,{info:N,log:N,warn:N,error:N,group:N,groupCollapsed:N,groupEnd:N})}k++}}function te(){{if(k--,k===0){var N={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:H({},N,{value:W}),info:H({},N,{value:B}),warn:H({},N,{value:U}),error:H({},N,{value:q}),group:H({},N,{value:$}),groupCollapsed:H({},N,{value:Y}),groupEnd:H({},N,{value:X})})}k<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ie=b.ReactCurrentDispatcher,ne;function Z(N,se,he){{if(ne===void 0)try{throw Error()}catch(Be){var Oe=Be.stack.trim().match(/\n( *(at )?)/);ne=Oe&&Oe[1]||""}return`
333
+ `+ne+N}}var ae=!1,ce;{var ve=typeof WeakMap=="function"?WeakMap:Map;ce=new ve}function ee(N,se){if(!N||ae)return"";{var he=ce.get(N);if(he!==void 0)return he}var Oe;ae=!0;var Be=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ue;Ue=ie.current,ie.current=null,oe();try{if(se){var Fe=function(){throw Error()};if(Object.defineProperty(Fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Fe,[])}catch(ft){Oe=ft}Reflect.construct(N,[],Fe)}else{try{Fe.call()}catch(ft){Oe=ft}N.call(Fe.prototype)}}else{try{throw Error()}catch(ft){Oe=ft}N()}}catch(ft){if(ft&&Oe&&typeof ft.stack=="string"){for(var ke=ft.stack.split(`
334
+ `),Me=Oe.stack.split(`
335
+ `),J=ke.length-1,be=Me.length-1;J>=1&&be>=0&&ke[J]!==Me[be];)be--;for(;J>=1&&be>=0;J--,be--)if(ke[J]!==Me[be]){if(J!==1||be!==1)do if(J--,be--,be<0||ke[J]!==Me[be]){var $e=`
336
+ `+ke[J].replace(" at new "," at ");return N.displayName&&$e.includes("<anonymous>")&&($e=$e.replace("<anonymous>",N.displayName)),typeof N=="function"&&ce.set(N,$e),$e}while(J>=1&&be>=0);break}}}finally{ae=!1,ie.current=Ue,te(),Error.prepareStackTrace=Be}var at=N?N.displayName||N.name:"",En=at?Z(at):"";return typeof N=="function"&&ce.set(N,En),En}function ge(N,se,he){return ee(N,!1)}function fe(N){var se=N.prototype;return!!(se&&se.isReactComponent)}function Se(N,se,he){if(N==null)return"";if(typeof N=="function")return ee(N,fe(N));if(typeof N=="string")return Z(N);switch(N){case c:return Z("Suspense");case u:return Z("SuspenseList")}if(typeof N=="object")switch(N.$$typeof){case l:return ge(N.render);case d:return Se(N.type,se,he);case f:{var Oe=N,Be=Oe._payload,Ue=Oe._init;try{return Se(Ue(Be),se,he)}catch{}}}return""}var Ae=Object.prototype.hasOwnProperty,ze={},Ie=b.ReactDebugCurrentFrame;function De(N){if(N){var se=N._owner,he=Se(N.type,N._source,se?se.type:null);Ie.setExtraStackFrame(he)}else Ie.setExtraStackFrame(null)}function ot(N,se,he,Oe,Be){{var Ue=Function.call.bind(Ae);for(var Fe in N)if(Ue(N,Fe)){var ke=void 0;try{if(typeof N[Fe]!="function"){var Me=Error((Oe||"React class")+": "+he+" type `"+Fe+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof N[Fe]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Me.name="Invariant Violation",Me}ke=N[Fe](se,Fe,Oe,he,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(J){ke=J}ke&&!(ke instanceof Error)&&(De(Be),x("%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).",Oe||"React class",he,Fe,typeof ke),De(null)),ke instanceof Error&&!(ke.message in ze)&&(ze[ke.message]=!0,De(Be),x("Failed %s type: %s",he,ke.message),De(null))}}}var _t=Array.isArray;function rn(N){return _t(N)}function $t(N){{var se=typeof Symbol=="function"&&Symbol.toStringTag,he=se&&N[Symbol.toStringTag]||N.constructor.name||"Object";return he}}function on(N){try{return pe(N),!1}catch{return!0}}function pe(N){return""+N}function Pe(N){if(on(N))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",$t(N)),pe(N)}var je=b.ReactCurrentOwner,qe={key:!0,ref:!0,__self:!0,__source:!0},tt,sn,_n;_n={};function mn(N){if(Ae.call(N,"ref")){var se=Object.getOwnPropertyDescriptor(N,"ref").get;if(se&&se.isReactWarning)return!1}return N.ref!==void 0}function Bn(N){if(Ae.call(N,"key")){var se=Object.getOwnPropertyDescriptor(N,"key").get;if(se&&se.isReactWarning)return!1}return N.key!==void 0}function vn(N,se){if(typeof N.ref=="string"&&je.current&&se&&je.current.stateNode!==se){var he=K(je.current.type);_n[he]||(x('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',K(je.current.type),N.ref),_n[he]=!0)}}function Bt(N,se){{var he=function(){tt||(tt=!0,x("%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)",se))};he.isReactWarning=!0,Object.defineProperty(N,"key",{get:he,configurable:!0})}}function cn(N,se){{var he=function(){sn||(sn=!0,x("%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)",se))};he.isReactWarning=!0,Object.defineProperty(N,"ref",{get:he,configurable:!0})}}var An=function(N,se,he,Oe,Be,Ue,Fe){var ke={$$typeof:t,type:N,key:se,ref:he,props:Fe,_owner:Ue};return ke._store={},Object.defineProperty(ke._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ke,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Oe}),Object.defineProperty(ke,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Be}),Object.freeze&&(Object.freeze(ke.props),Object.freeze(ke)),ke};function et(N,se,he,Oe,Be){{var Ue,Fe={},ke=null,Me=null;he!==void 0&&(Pe(he),ke=""+he),Bn(se)&&(Pe(se.key),ke=""+se.key),mn(se)&&(Me=se.ref,vn(se,Be));for(Ue in se)Ae.call(se,Ue)&&!qe.hasOwnProperty(Ue)&&(Fe[Ue]=se[Ue]);if(N&&N.defaultProps){var J=N.defaultProps;for(Ue in J)Fe[Ue]===void 0&&(Fe[Ue]=J[Ue])}if(ke||Me){var be=typeof N=="function"?N.displayName||N.name||"Unknown":N;ke&&Bt(Fe,be),Me&&cn(Fe,be)}return An(N,ke,Me,Be,Oe,je.current,Fe)}}var pt=b.ReactCurrentOwner,Mt=b.ReactDebugCurrentFrame;function Jt(N){if(N){var se=N._owner,he=Se(N.type,N._source,se?se.type:null);Mt.setExtraStackFrame(he)}else Mt.setExtraStackFrame(null)}var yt;yt=!1;function Vn(N){return typeof N=="object"&&N!==null&&N.$$typeof===t}function ai(){{if(pt.current){var N=K(pt.current.type);if(N)return`
337
+
338
+ Check the render method of \``+N+"`."}return""}}function na(N){{if(N!==void 0){var se=N.fileName.replace(/^.*[\\\/]/,""),he=N.lineNumber;return`
339
+
340
+ Check your code at `+se+":"+he+"."}return""}}var li={};function gs(N){{var se=ai();if(!se){var he=typeof N=="string"?N:N.displayName||N.name;he&&(se=`
341
+
342
+ Check the top-level render call using <`+he+">.")}return se}}function Mi(N,se){{if(!N._store||N._store.validated||N.key!=null)return;N._store.validated=!0;var he=gs(se);if(li[he])return;li[he]=!0;var Oe="";N&&N._owner&&N._owner!==pt.current&&(Oe=" It was passed a child from "+K(N._owner.type)+"."),Jt(N),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',he,Oe),Jt(null)}}function ms(N,se){{if(typeof N!="object")return;if(rn(N))for(var he=0;he<N.length;he++){var Oe=N[he];Vn(Oe)&&Mi(Oe,se)}else if(Vn(N))N._store&&(N._store.validated=!0);else if(N){var Be=y(N);if(typeof Be=="function"&&Be!==N.entries)for(var Ue=Be.call(N),Fe;!(Fe=Ue.next()).done;)Vn(Fe.value)&&Mi(Fe.value,se)}}}function ra(N){{var se=N.type;if(se==null||typeof se=="string")return;var he;if(typeof se=="function")he=se.propTypes;else if(typeof se=="object"&&(se.$$typeof===l||se.$$typeof===d))he=se.propTypes;else return;if(he){var Oe=K(se);ot(he,N.props,"prop",Oe,N)}else if(se.PropTypes!==void 0&&!yt){yt=!0;var Be=K(se);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Be||"Unknown")}typeof se.getDefaultProps=="function"&&!se.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ii(N){{for(var se=Object.keys(N.props),he=0;he<se.length;he++){var Oe=se[he];if(Oe!=="children"&&Oe!=="key"){Jt(N),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Oe),Jt(null);break}}N.ref!==null&&(Jt(N),x("Invalid attribute `ref` supplied to `React.Fragment`."),Jt(null))}}function vs(N,se,he,Oe,Be,Ue){{var Fe=L(N);if(!Fe){var ke="";(N===void 0||typeof N=="object"&&N!==null&&Object.keys(N).length===0)&&(ke+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Me=na(Be);Me?ke+=Me:ke+=ai();var J;N===null?J="null":rn(N)?J="array":N!==void 0&&N.$$typeof===t?(J="<"+(K(N.type)||"Unknown")+" />",ke=" Did you accidentally export a JSX literal instead of a component?"):J=typeof N,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",J,ke)}var be=et(N,se,he,Be,Ue);if(be==null)return be;if(Fe){var $e=se.children;if($e!==void 0)if(Oe)if(rn($e)){for(var at=0;at<$e.length;at++)ms($e[at],N);Object.freeze&&Object.freeze($e)}else x("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 ms($e,N)}return N===r?Ii(be):ra(be),be}}function er(N,se,he){return vs(N,se,he,!0)}function $i(N,se,he){return vs(N,se,he,!1)}var oa=$i,ia=er;Yf.Fragment=r,Yf.jsx=oa,Yf.jsxs=ia}()),Yf}var Kf={};/**
343
+ * @license React
344
+ * react-jsx-runtime.production.min.js
345
+ *
346
+ * Copyright (c) Facebook, Inc. and its affiliates.
347
+ *
348
+ * This source code is licensed under the MIT license found in the
349
+ * LICENSE file in the root directory of this source tree.
350
+ */var K$;function sxe(){if(K$)return Kf;K$=1;var e=w,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,d={},f=null,p=null;c!==void 0&&(f=""+c),l.key!==void 0&&(f=""+l.key),l.ref!==void 0&&(p=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:a,key:f,ref:p,props:d,_owner:o.current}}return Kf.Fragment=n,Kf.jsx=s,Kf.jsxs=s,Kf}process.env.NODE_ENV==="production"?E_.exports=sxe():E_.exports=ixe();var Ee=E_.exports;function Cg(e){return e.mode==="multiple"}function _g(e){return e.mode==="range"}function Ry(e){return e.mode==="single"}var axe={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 lxe(e,t){return ts(e,"LLLL y",t)}function cxe(e,t){return ts(e,"d",t)}function uxe(e,t){return ts(e,"LLLL",t)}function dxe(e){return"".concat(e)}function fxe(e,t){return ts(e,"cccccc",t)}function hxe(e,t){return ts(e,"yyyy",t)}var pxe=Object.freeze({__proto__:null,formatCaption:lxe,formatDay:cxe,formatMonthCaption:uxe,formatWeekNumber:dxe,formatWeekdayName:fxe,formatYearCaption:hxe}),gxe=function(e,t,n){return ts(e,"do MMMM (EEEE)",n)},mxe=function(){return"Month: "},vxe=function(){return"Go to next month"},bxe=function(){return"Go to previous month"},yxe=function(e,t){return ts(e,"cccc",t)},xxe=function(e){return"Week n. ".concat(e)},wxe=function(){return"Year: "},Sxe=Object.freeze({__proto__:null,labelDay:gxe,labelMonthDropdown:mxe,labelNext:vxe,labelPrevious:bxe,labelWeekNumber:xxe,labelWeekday:yxe,labelYearDropdown:wxe});function Cxe(){var e="buttons",t=axe,n=K9,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:pxe,labels:Sxe,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function _xe(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=oo(r):t&&(i=new Date(t,0,1)),o?s=W2(o):n&&(s=new Date(n,11,31)),{fromDate:i?jd(i):void 0,toDate:s?jd(s):void 0}}var nF=w.createContext(void 0);function Exe(e){var t,n=e.initialProps,r=Cxe(),o=_xe(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;(Ry(n)||Cg(n)||_g(n))&&(l=n.onSelect);var c=nt(nt(nt({},r),n),{captionLayout:a,classNames:nt(nt({},r.classNames),n.classNames),components:nt({},n.components),formatters:nt(nt({},r.formatters),n.formatters),fromDate:i,labels:nt(nt({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:nt(nt({},r.modifiers),n.modifiers),modifiersClassNames:nt(nt({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:nt(nt({},r.styles),n.styles),toDate:s});return Ee.jsx(nF.Provider,{value:c,children:e.children})}function gn(){var e=w.useContext(nF);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function rF(e){var t=gn(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return Ee.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 Rxe(e){return Ee.jsx("svg",nt({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:Ee.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 oF(e){var t,n,r=e.onChange,o=e.value,i=e.children,s=e.caption,a=e.className,l=e.style,c=gn(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:Rxe;return Ee.jsxs("div",{className:a,style:l,children:[Ee.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),Ee.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:i}),Ee.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,Ee.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function Pxe(e){var t,n=gn(),r=n.fromDate,o=n.toDate,i=n.styles,s=n.locale,a=n.formatters.formatMonthCaption,l=n.classNames,c=n.components,u=n.labels.labelMonthDropdown;if(!r)return Ee.jsx(Ee.Fragment,{});if(!o)return Ee.jsx(Ee.Fragment,{});var d=[];if(rxe(r,o))for(var f=oo(r),p=r.getMonth();p<=o.getMonth();p++)d.push(Ew(f,p));else for(var f=oo(new Date),p=0;p<=11;p++)d.push(Ew(f,p));var m=function(y){var b=Number(y.target.value),x=Ew(oo(e.displayMonth),b);e.onChange(x)},v=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:oF;return Ee.jsx(v,{name:"months","aria-label":u(),className:l.dropdown_month,style:i.dropdown_month,onChange:m,value:e.displayMonth.getMonth(),caption:a(e.displayMonth,{locale:s}),children:d.map(function(y){return Ee.jsx("option",{value:y.getMonth(),children:a(y,{locale:s})},y.getMonth())})})}function Oxe(e){var t,n=e.displayMonth,r=gn(),o=r.fromDate,i=r.toDate,s=r.locale,a=r.styles,l=r.classNames,c=r.components,u=r.formatters.formatYearCaption,d=r.labels.labelYearDropdown,f=[];if(!o)return Ee.jsx(Ee.Fragment,{});if(!i)return Ee.jsx(Ee.Fragment,{});for(var p=o.getFullYear(),m=i.getFullYear(),v=p;v<=m;v++)f.push(q$(q9(new Date),v));var y=function(x){var E=q$(oo(n),Number(x.target.value));e.onChange(E)},b=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:oF;return Ee.jsx(b,{name:"years","aria-label":d(),className:l.dropdown_year,style:a.dropdown_year,onChange:y,value:n.getFullYear(),caption:u(n,{locale:s}),children:f.map(function(x){return Ee.jsx("option",{value:x.getFullYear(),children:u(x,{locale:s})},x.getFullYear())})})}function Axe(e,t){var n=w.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function Txe(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&&up(i,o)<0){var c=-1*(l-1);o=Oi(i,c)}return s&&up(o,s)<0&&(o=s),oo(o)}function Dxe(){var e=gn(),t=Txe(e),n=Axe(t,e.month),r=n[0],o=n[1],i=function(s){var a;if(!e.disableNavigation){var l=oo(s);o(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,i]}function Mxe(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=oo(e),i=oo(Oi(o,r)),s=up(i,o),a=[],l=0;l<s;l++){var c=Oi(o,l);a.push(c)}return n&&(a=a.reverse()),a}function Ixe(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=oo(e);if(!n)return Oi(a,s);var l=up(n,e);if(!(l<i))return Oi(a,s)}}function $xe(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=oo(e);if(!n)return Oi(a,-s);var l=up(a,n);if(!(l<=0))return Oi(a,-s)}}var iF=w.createContext(void 0);function Nxe(e){var t=gn(),n=Dxe(),r=n[0],o=n[1],i=Mxe(r,t),s=Ixe(r,t),a=$xe(r,t),l=function(d){return i.some(function(f){return G2(d,f)})},c=function(d,f){l(d)||(f&&eF(d,f)?o(Oi(d,1+t.numberOfMonths*-1)):o(d))},u={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return Ee.jsx(iF.Provider,{value:u,children:e.children})}function Eg(){var e=w.useContext(iF);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function X$(e){var t,n=gn(),r=n.classNames,o=n.styles,i=n.components,s=Eg().goToMonth,a=function(u){s(Oi(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:rF,c=Ee.jsx(l,{id:e.id,displayMonth:e.displayMonth});return Ee.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[Ee.jsx("div",{className:r.vhidden,children:c}),Ee.jsx(Pxe,{onChange:a,displayMonth:e.displayMonth}),Ee.jsx(Oxe,{onChange:a,displayMonth:e.displayMonth})]})}function kxe(e){return Ee.jsx("svg",nt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:Ee.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 Lxe(e){return Ee.jsx("svg",nt({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:Ee.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 t0=w.forwardRef(function(e,t){var n=gn(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var s=i.join(" "),a=nt(nt({},o.button_reset),o.button);return e.style&&Object.assign(a,e.style),Ee.jsx("button",nt({},e,{ref:t,type:"button",className:s,style:a}))});function Fxe(e){var t,n,r=gn(),o=r.dir,i=r.locale,s=r.classNames,a=r.styles,l=r.labels,c=l.labelPrevious,u=l.labelNext,d=r.components;if(!e.nextMonth&&!e.previousMonth)return Ee.jsx(Ee.Fragment,{});var f=c(e.previousMonth,{locale:i}),p=[s.nav_button,s.nav_button_previous].join(" "),m=u(e.nextMonth,{locale:i}),v=[s.nav_button,s.nav_button_next].join(" "),y=(t=d==null?void 0:d.IconRight)!==null&&t!==void 0?t:Lxe,b=(n=d==null?void 0:d.IconLeft)!==null&&n!==void 0?n:kxe;return Ee.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&Ee.jsx(t0,{name:"previous-month","aria-label":f,className:p,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?Ee.jsx(y,{className:s.nav_icon,style:a.nav_icon}):Ee.jsx(b,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&Ee.jsx(t0,{name:"next-month","aria-label":m,className:v,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?Ee.jsx(b,{className:s.nav_icon,style:a.nav_icon}):Ee.jsx(y,{className:s.nav_icon,style:a.nav_icon})})]})}function Q$(e){var t=gn().numberOfMonths,n=Eg(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(m){return G2(e.displayMonth,m)}),l=a===0,c=a===s.length-1,u=t>1&&(l||!c),d=t>1&&(c||!l),f=function(){r&&i(r)},p=function(){o&&i(o)};return Ee.jsx(Fxe,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:o,previousMonth:r,onPreviousClick:f,onNextClick:p})}function jxe(e){var t,n=gn(),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:rF,c;return o?c=Ee.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=Ee.jsx(X$,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=Ee.jsxs(Ee.Fragment,{children:[Ee.jsx(X$,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),Ee.jsx(Q$,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=Ee.jsxs(Ee.Fragment,{children:[Ee.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),Ee.jsx(Q$,{displayMonth:e.displayMonth,id:e.id})]}),Ee.jsx("div",{className:r.caption,style:i.caption,children:c})}function zxe(e){var t=gn(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?Ee.jsx("tfoot",{className:o,style:r.tfoot,children:Ee.jsx("tr",{children:Ee.jsx("td",{colSpan:8,children:n})})}):Ee.jsx(Ee.Fragment,{})}function Bxe(e,t,n){for(var r=n?Lc(new Date):is(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=kr(r,i);o.push(s)}return o}function Vxe(){var e=gn(),t=e.classNames,n=e.styles,r=e.showWeekNumber,o=e.locale,i=e.weekStartsOn,s=e.ISOWeek,a=e.formatters.formatWeekdayName,l=e.labels.labelWeekday,c=Bxe(o,i,s);return Ee.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&Ee.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,d){return Ee.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":l(u,{locale:o}),children:a(u,{locale:o})},d)})]})}function Hxe(){var e,t=gn(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:Vxe;return Ee.jsx("thead",{style:r.head,className:n.head,children:Ee.jsx(i,{})})}function Wxe(e){var t=gn(),n=t.locale,r=t.formatters.formatDay;return Ee.jsx(Ee.Fragment,{children:r(e.date,{locale:n})})}var q2=w.createContext(void 0);function Uxe(e){if(!Cg(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return Ee.jsx(q2.Provider,{value:t,children:e.children})}return Ee.jsx(Gxe,{initialProps:e.initialProps,children:e.children})}function Gxe(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,s=function(c,u,d){var f,p;(f=t.onDayClick)===null||f===void 0||f.call(t,c,u,d);var m=!!(u.selected&&o&&(r==null?void 0:r.length)===o);if(!m){var v=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!v){var y=r?tF([],r,!0):[];if(u.selected){var b=y.findIndex(function(x){return no(c,x)});y.splice(b,1)}else y.push(c);(p=t.onSelect)===null||p===void 0||p.call(t,y,c,u,d)}}},a={disabled:[]};r&&a.disabled.push(function(c){var u=i&&r.length>i-1,d=r.some(function(f){return no(f,c)});return!!(u&&!d)});var l={selected:r,onDayClick:s,modifiers:a};return Ee.jsx(q2.Provider,{value:l,children:n})}function Y2(){var e=w.useContext(q2);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function qxe(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?no(o,e)&&no(r,e)?void 0:no(o,e)?{from:o,to:void 0}:no(r,e)?void 0:__(r,e)?{from:e,to:o}:{from:r,to:e}:o?__(e,o)?{from:o,to:e}:{from:e,to:o}:r?eF(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var K2=w.createContext(void 0);function Yxe(e){if(!_g(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return Ee.jsx(K2.Provider,{value:t,children:e.children})}return Ee.jsx(Kxe,{initialProps:e.initialProps,children:e.children})}function Kxe(e){var t=e.initialProps,n=e.children,r=t.selected,o=r||{},i=o.from,s=o.to,a=t.min,l=t.max,c=function(p,m,v){var y,b;(y=t.onDayClick)===null||y===void 0||y.call(t,p,m,v);var x=qxe(p,r);(b=t.onSelect)===null||b===void 0||b.call(t,x,p,m,v)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],s?(u.range_end=[s],no(i,s)||(u.range_middle=[{after:i,before:s}])):u.range_end=[i]):s&&(u.range_start=[s],u.range_end=[s]),a&&(i&&!s&&u.disabled.push({after:_w(i,a-1),before:kr(i,a-1)}),i&&s&&u.disabled.push({after:i,before:kr(i,a-1)}),!i&&s&&u.disabled.push({after:_w(s,a-1),before:kr(s,a-1)})),l){if(i&&!s&&(u.disabled.push({before:kr(i,-l+1)}),u.disabled.push({after:kr(i,l-1)})),i&&s){var d=Qi(s,i)+1,f=l-d;u.disabled.push({before:_w(i,f)}),u.disabled.push({after:kr(s,f)})}!i&&s&&(u.disabled.push({before:kr(s,-l+1)}),u.disabled.push({after:kr(s,l-1)}))}return Ee.jsx(K2.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function X2(){var e=w.useContext(K2);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function ib(e){return Array.isArray(e)?tF([],e,!0):e!==void 0?[e]:[]}function Xxe(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=ib(o)}),t}var Ai;(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"})(Ai||(Ai={}));var Qxe=Ai.Selected,As=Ai.Disabled,Zxe=Ai.Hidden,Jxe=Ai.Today,Rw=Ai.RangeEnd,Pw=Ai.RangeMiddle,Ow=Ai.RangeStart,e1e=Ai.Outside;function t1e(e,t,n){var r,o=(r={},r[Qxe]=ib(e.selected),r[As]=ib(e.disabled),r[Zxe]=ib(e.hidden),r[Jxe]=[e.today],r[Rw]=[],r[Pw]=[],r[Ow]=[],r[e1e]=[],r);return e.fromDate&&o[As].push({before:e.fromDate}),e.toDate&&o[As].push({after:e.toDate}),Cg(e)?o[As]=o[As].concat(t.modifiers[As]):_g(e)&&(o[As]=o[As].concat(n.modifiers[As]),o[Ow]=n.modifiers[Ow],o[Pw]=n.modifiers[Pw],o[Rw]=n.modifiers[Rw]),o}var sF=w.createContext(void 0);function n1e(e){var t=gn(),n=Y2(),r=X2(),o=t1e(t,n,r),i=Xxe(t.modifiers),s=nt(nt({},o),i);return Ee.jsx(sF.Provider,{value:s,children:e.children})}function aF(){var e=w.useContext(sF);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function r1e(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function o1e(e){return!!(e&&typeof e=="object"&&"from"in e)}function i1e(e){return!!(e&&typeof e=="object"&&"after"in e)}function s1e(e){return!!(e&&typeof e=="object"&&"before"in e)}function a1e(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function l1e(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=Qi(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var s=Qi(e,r)>=0&&Qi(o,e)>=0;return s}return o?no(o,e):r?no(r,e):!1}function c1e(e){return H2(e)}function u1e(e){return Array.isArray(e)&&e.every(H2)}function d1e(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(c1e(n))return no(e,n);if(u1e(n))return n.includes(e);if(o1e(n))return l1e(e,n);if(a1e(n))return n.dayOfWeek.includes(e.getDay());if(r1e(n)){var r=Qi(n.before,e),o=Qi(n.after,e),i=r>0,s=o<0,a=__(n.before,n.after);return a?s&&i:i||s}return i1e(n)?Qi(e,n.after)>0:s1e(n)?Qi(n.before,e)>0:typeof n=="function"?n(e):!1})}function Q2(e,t,n){var r=Object.keys(t).reduce(function(i,s){var a=t[s];return d1e(e,a)&&i.push(s),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!G2(e,n)&&(o.outside=!0),o}function f1e(e,t){for(var n=oo(e[0]),r=W2(e[e.length-1]),o,i,s=n;s<=r;){var a=Q2(s,t),l=!a.disabled&&!a.hidden;if(!l){s=kr(s,1);continue}if(a.selected)return s;a.today&&!i&&(i=s),o||(o=s),s=kr(s,1)}return i||o}var h1e=365;function lF(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,s=t.retry,a=s===void 0?{count:0,lastFocused:e}:s,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,f={day:kr,week:C_,month:Oi,year:J0e,startOfWeek:function(y){return o.ISOWeek?Lc(y):is(y,{locale:d,weekStartsOn:l})},endOfWeek:function(y){return o.ISOWeek?Y9(y):U2(y,{locale:d,weekStartsOn:l})}},p=f[n](e,r==="after"?1:-1);r==="before"&&c?p=eye([c,p]):r==="after"&&u&&(p=tye([u,p]));var m=!0;if(i){var v=Q2(p,i);m=!v.disabled&&!v.hidden}return m?p:a.count>h1e?a.lastFocused:lF(p,{moveBy:n,direction:r,context:o,modifiers:i,retry:nt(nt({},a),{count:a.count+1})})}var cF=w.createContext(void 0);function p1e(e){var t=Eg(),n=aF(),r=w.useState(),o=r[0],i=r[1],s=w.useState(),a=s[0],l=s[1],c=f1e(t.displayMonths,n),u=o??(a&&t.isDateDisplayed(a))?a:c,d=function(){l(o),i(void 0)},f=function(y){i(y)},p=gn(),m=function(y,b){if(o){var x=lF(o,{moveBy:y,direction:b,context:p,modifiers:n});no(o,x)||(t.goToDate(x,o),f(x))}},v={focusedDay:o,focusTarget:u,blur:d,focus:f,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return Ee.jsx(cF.Provider,{value:v,children:e.children})}function Z2(){var e=w.useContext(cF);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function g1e(e,t){var n=aF(),r=Q2(e,n,t);return r}var J2=w.createContext(void 0);function m1e(e){if(!Ry(e.initialProps)){var t={selected:void 0};return Ee.jsx(J2.Provider,{value:t,children:e.children})}return Ee.jsx(v1e,{initialProps:e.initialProps,children:e.children})}function v1e(e){var t=e.initialProps,n=e.children,r=function(i,s,a){var l,c,u;if((l=t.onDayClick)===null||l===void 0||l.call(t,i,s,a),s.selected&&!t.required){(c=t.onSelect)===null||c===void 0||c.call(t,void 0,i,s,a);return}(u=t.onSelect)===null||u===void 0||u.call(t,i,i,s,a)},o={selected:t.selected,onDayClick:r};return Ee.jsx(J2.Provider,{value:o,children:n})}function uF(){var e=w.useContext(J2);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function b1e(e,t){var n=gn(),r=uF(),o=Y2(),i=X2(),s=Z2(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,d=s.blur,f=s.focus,p=s.focusMonthBefore,m=s.focusMonthAfter,v=s.focusYearBefore,y=s.focusYearAfter,b=s.focusStartOfWeek,x=s.focusEndOfWeek,E=function(B){var U,q,$,Y;Ry(n)?(U=r.onDayClick)===null||U===void 0||U.call(r,e,t,B):Cg(n)?(q=o.onDayClick)===null||q===void 0||q.call(o,e,t,B):_g(n)?($=i.onDayClick)===null||$===void 0||$.call(i,e,t,B):(Y=n.onDayClick)===null||Y===void 0||Y.call(n,e,t,B)},R=function(B){var U;f(e),(U=n.onDayFocus)===null||U===void 0||U.call(n,e,t,B)},P=function(B){var U;d(),(U=n.onDayBlur)===null||U===void 0||U.call(n,e,t,B)},O=function(B){var U;(U=n.onDayMouseEnter)===null||U===void 0||U.call(n,e,t,B)},A=function(B){var U;(U=n.onDayMouseLeave)===null||U===void 0||U.call(n,e,t,B)},D=function(B){var U;(U=n.onDayPointerEnter)===null||U===void 0||U.call(n,e,t,B)},I=function(B){var U;(U=n.onDayPointerLeave)===null||U===void 0||U.call(n,e,t,B)},L=function(B){var U;(U=n.onDayTouchCancel)===null||U===void 0||U.call(n,e,t,B)},j=function(B){var U;(U=n.onDayTouchEnd)===null||U===void 0||U.call(n,e,t,B)},z=function(B){var U;(U=n.onDayTouchMove)===null||U===void 0||U.call(n,e,t,B)},K=function(B){var U;(U=n.onDayTouchStart)===null||U===void 0||U.call(n,e,t,B)},H=function(B){var U;(U=n.onDayKeyUp)===null||U===void 0||U.call(n,e,t,B)},k=function(B){var U;switch(B.key){case"ArrowLeft":B.preventDefault(),B.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":B.preventDefault(),B.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":B.preventDefault(),B.stopPropagation(),c();break;case"ArrowUp":B.preventDefault(),B.stopPropagation(),u();break;case"PageUp":B.preventDefault(),B.stopPropagation(),B.shiftKey?v():p();break;case"PageDown":B.preventDefault(),B.stopPropagation(),B.shiftKey?y():m();break;case"Home":B.preventDefault(),B.stopPropagation(),b();break;case"End":B.preventDefault(),B.stopPropagation(),x();break}(U=n.onDayKeyDown)===null||U===void 0||U.call(n,e,t,B)},W={onClick:E,onFocus:R,onBlur:P,onKeyDown:k,onKeyUp:H,onMouseEnter:O,onMouseLeave:A,onPointerEnter:D,onPointerLeave:I,onTouchCancel:L,onTouchEnd:j,onTouchMove:z,onTouchStart:K};return W}function y1e(){var e=gn(),t=uF(),n=Y2(),r=X2(),o=Ry(e)?t.selected:Cg(e)?n.selected:_g(e)?r.selected:void 0;return o}function x1e(e){return Object.values(Ai).includes(e)}function w1e(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(x1e(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function S1e(e,t){var n=nt({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=nt(nt({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function C1e(e,t,n){var r,o,i,s=gn(),a=Z2(),l=g1e(e,t),c=b1e(e,l),u=y1e(),d=!!(s.onDayClick||s.mode!=="default");w.useEffect(function(){var O;l.outside||a.focusedDay&&d&&no(a.focusedDay,e)&&((O=n.current)===null||O===void 0||O.focus())},[a.focusedDay,e,n,d,l.outside]);var f=w1e(s,l).join(" "),p=S1e(s,l),m=!!(l.outside&&!s.showOutsideDays||l.hidden),v=(i=(o=s.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:Wxe,y=Ee.jsx(v,{date:e,displayMonth:t,activeModifiers:l}),b={style:p,className:f,children:y,role:"gridcell"},x=a.focusTarget&&no(a.focusTarget,e)&&!l.outside,E=a.focusedDay&&no(a.focusedDay,e),R=nt(nt(nt({},b),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=E||x?0:-1,r)),c),P={isButton:d,isHidden:m,activeModifiers:l,selectedDays:u,buttonProps:R,divProps:b};return P}function _1e(e){var t=w.useRef(null),n=C1e(e.date,e.displayMonth,t);return n.isHidden?Ee.jsx("div",{role:"gridcell"}):n.isButton?Ee.jsx(t0,nt({name:"day",ref:t},n.buttonProps)):Ee.jsx("div",nt({},n.divProps))}function E1e(e){var t=e.number,n=e.dates,r=gn(),o=r.onWeekNumberClick,i=r.styles,s=r.classNames,a=r.locale,l=r.labels.labelWeekNumber,c=r.formatters.formatWeekNumber,u=c(Number(t),{locale:a});if(!o)return Ee.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:u});var d=l(Number(t),{locale:a}),f=function(p){o(t,n,p)};return Ee.jsx(t0,{name:"week-number","aria-label":d,className:s.weeknumber,style:i.weeknumber,onClick:f,children:u})}function R1e(e){var t,n,r=gn(),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:_1e,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:E1e,u;return s&&(u=Ee.jsx("td",{className:i.cell,style:o.cell,children:Ee.jsx(c,{number:e.weekNumber,dates:e.dates})})),Ee.jsxs("tr",{className:i.row,style:o.row,children:[u,e.dates.map(function(d){return Ee.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:Ee.jsx(l,{displayMonth:e.displayMonth,date:d})},exe(d))})]})}function Z$(e,t,n){for(var r=n!=null&&n.ISOWeek?Y9(t):U2(t,n),o=n!=null&&n.ISOWeek?Lc(e):is(e,n),i=Qi(r,o),s=[],a=0;a<=i;a++)s.push(kr(o,a));var l=s.reduce(function(c,u){var d=n!=null&&n.ISOWeek?X9(u):Z9(u,n),f=c.find(function(p){return p.weekNumber===d});return f?(f.dates.push(u),c):(c.push({weekNumber:d,dates:[u]}),c)},[]);return l}function P1e(e,t){var n=Z$(oo(e),W2(e),t);if(t!=null&&t.useFixedWeeks){var r=nxe(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=C_(i,6-r),a=Z$(C_(i,1),s,t);n.push.apply(n,a)}}return n}function O1e(e){var t,n,r,o=gn(),i=o.locale,s=o.classNames,a=o.styles,l=o.hideHead,c=o.fixedWeeks,u=o.components,d=o.weekStartsOn,f=o.firstWeekContainsDate,p=o.ISOWeek,m=P1e(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:p,locale:i,weekStartsOn:d,firstWeekContainsDate:f}),v=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:Hxe,y=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:R1e,b=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:zxe;return Ee.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&Ee.jsx(v,{}),Ee.jsx("tbody",{className:s.tbody,style:a.tbody,children:m.map(function(x){return Ee.jsx(y,{displayMonth:e.displayMonth,dates:x.dates,weekNumber:x.weekNumber},x.weekNumber)})}),Ee.jsx(b,{displayMonth:e.displayMonth})]})}function A1e(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var T1e=A1e()?w.useLayoutEffect:w.useEffect,Aw=!1,D1e=0;function J$(){return"react-day-picker-".concat(++D1e)}function M1e(e){var t,n=e??(Aw?J$():null),r=w.useState(n),o=r[0],i=r[1];return T1e(function(){o===null&&i(J$())},[]),w.useEffect(function(){Aw===!1&&(Aw=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function I1e(e){var t,n,r=gn(),o=r.dir,i=r.classNames,s=r.styles,a=r.components,l=Eg().displayMonths,c=M1e(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),u=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,d=[i.month],f=s.month,p=e.displayIndex===0,m=e.displayIndex===l.length-1,v=!p&&!m;o==="rtl"&&(t=[p,m],m=t[0],p=t[1]),p&&(d.push(i.caption_start),f=nt(nt({},f),s.caption_start)),m&&(d.push(i.caption_end),f=nt(nt({},f),s.caption_end)),v&&(d.push(i.caption_between),f=nt(nt({},f),s.caption_between));var y=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:jxe;return Ee.jsxs("div",{className:d.join(" "),style:f,children:[Ee.jsx(y,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),Ee.jsx(O1e,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function $1e(e){var t=gn(),n=t.classNames,r=t.styles;return Ee.jsx("div",{className:n.months,style:r.months,children:e.children})}function N1e(e){var t,n,r=e.initialProps,o=gn(),i=Z2(),s=Eg(),a=w.useState(!1),l=a[0],c=a[1];w.useEffect(function(){o.initialFocus&&i.focusTarget&&(l||(i.focus(i.focusTarget),c(!0)))},[o.initialFocus,l,i.focus,i.focusTarget,i]);var u=[o.classNames.root,o.className];o.numberOfMonths>1&&u.push(o.classNames.multiple_months),o.showWeekNumber&&u.push(o.classNames.with_weeknumber);var d=nt(nt({},o.styles.root),o.style),f=Object.keys(r).filter(function(m){return m.startsWith("data-")}).reduce(function(m,v){var y;return nt(nt({},m),(y={},y[v]=r[v],y))},{}),p=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:$1e;return Ee.jsx("div",nt({className:u.join(" "),style:d,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},f,{children:Ee.jsx(p,{children:s.displayMonths.map(function(m,v){return Ee.jsx(I1e,{displayIndex:v,displayMonth:m},v)})})}))}function k1e(e){var t=e.children,n=oxe(e,["children"]);return Ee.jsx(Exe,{initialProps:n,children:Ee.jsx(Nxe,{children:Ee.jsx(m1e,{initialProps:n,children:Ee.jsx(Uxe,{initialProps:n,children:Ee.jsx(Yxe,{initialProps:n,children:Ee.jsx(n1e,{children:Ee.jsx(p1e,{children:t})})})})})})})}function L1e(e){return Ee.jsx(k1e,nt({},e,{children:Ee.jsx(N1e,{initialProps:e})}))}function dF({className:e,classNames:t,showOutsideDays:n=!0,...r}){return C.jsx(L1e,{showOutsideDays:n,className:xe("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:xe(ap({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:xe(ap({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})=>C.jsx(cR,{...o,className:"h-4 w-4"}),IconRight:({...o})=>C.jsx(G0,{...o,className:"h-4 w-4"})},...r})}dF.displayName="Calendar";function fF(e){const{authToken:t}=No(),n=we(x=>x.dashboard.filters),r=we(x=>x.selectedSheetId),o=we(x=>x.filterValues),[i,s]=w.useState(!0),a=n==null?void 0:n.filter(x=>x.sheetId===r||!x.sheetId),l=o==null?void 0:o.filter(x=>(a==null?void 0:a.some(E=>E.id===x.filterId))||x.filterId.endsWith(r));function c(x){return i?{allowQuery:!0,filterValues:x.filter(P=>P.filterId!==e.id)}:(x==null?void 0:x.find(R=>R.filterId===e.id))?{allowQuery:!1,filterValues:x}:{allowQuery:!0,filterValues:x}}const{allowQuery:u,filterValues:d}=c(l||[]),{data:f,isLoading:p,isFetching:m,isError:v,refetch:y,isSuccess:b}=Zp({queryKey:["filter",e.id,e.sql,JSON.stringify(d)],queryFn:()=>x0("https://semaphor.cloud/api/v1/query",(t==null?void 0:t.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:d,cache_config:OE()}),enabled:!!e.sql&&!!e.connectionId&&u,placeholderData:x=>x});return w.useEffect(()=>{b&&i&&s(!1)},[b,i]),{data:f,isLoading:p,isFetching:m,isError:v,refetch:y}}function F1e({filter:e,className:t}){var E,R,P,O,A,D,I,L;const n=we(j=>j.themeStyle),[r,o]=w.useState(!1),[i,s]=w.useState(),[a,l]=w.useState(),c=we(j=>j.filterValues);No();const u=we(j=>j.actions.addOrUpdateFilterValue),d=we(j=>j.actions.removeFilterValue),{data:f,isLoading:p,isFetching:m,isError:v,refetch:y}=fF(e);w.useEffect(()=>{var j;if(((j=f==null?void 0:f.records)==null?void 0:j.length)>0){const z=f.records[0];if(!z.min||!z.max)return;s({from:new Date(z.min),to:new Date(z.max)}),l({from:new Date(z.min),to:new Date(z.max)})}},[f]),w.useEffect(()=>{if(c&&!c.find(z=>z.filterId===e.id)){s(a);return}},[c,e.id,a]);function b(){d(e.id),s(a),o(!1)}function x(){if(!i)return;console.log(i);const j=[i==null?void 0:i.from,i==null?void 0:i.to];console.log(j);const z={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Wu(e),name:e.column,operation:"between",values:j};u(z),o(!1)}return p?C.jsx("div",{children:C.jsx(Gu,{className:"h-8 w-full bg-foreground/10"})}):v?C.jsx("div",{className:"h-8 w-full bg-muted px-2",children:"Error"}):f?C.jsx("div",{className:xe("grid gap-2",t),children:C.jsxs(wy,{open:r,onOpenChange:o,children:[C.jsx(Sy,{style:{borderRadius:(R=(E=n==null?void 0:n.chart)==null?void 0:E.options)==null?void 0:R.borderRadius},asChild:!0,children:C.jsxs(ro,{size:"sm",id:"date",variant:"outline",className:xe("h-[34px] w-full justify-start rounded-sm text-left font-normal",!i&&"text-muted-foreground"),children:[C.jsx(x4,{className:"mr-2 h-4 w-4"}),i!=null&&i.from?i.to?C.jsxs(C.Fragment,{children:[ts(i.from,"LLL dd, y")," -"," ",ts(i.to,"LLL dd, y")]}):ts(i.from,"LLL dd, y"):C.jsx("span",{children:"Pick a date"})]})}),C.jsxs(yg,{style:{borderRadius:(O=(P=n==null?void 0:n.chart)==null?void 0:P.options)==null?void 0:O.borderRadius},className:"w-auto p-0",align:"start",children:[C.jsx("div",{className:"px-4 pt-3",children:C.jsx(Dn,{children:e.title})}),C.jsx(dF,{initialFocus:!0,mode:"range",defaultMonth:i==null?void 0:i.from,selected:i,onSelect:s,numberOfMonths:2}),C.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[C.jsx(ro,{style:{borderRadius:(D=(A=n==null?void 0:n.chart)==null?void 0:A.options)==null?void 0:D.borderRadius},size:"sm",variant:"outline",onClick:x,children:"Apply"}),C.jsx(ro,{style:{borderRadius:(L=(I=n==null?void 0:n.chart)==null?void 0:I.options)==null?void 0:L.borderRadius},size:"sm",variant:"outline",onClick:b,children:"Clear"})]})]})]})}):C.jsxs(Dn,{className:"w-fulll flex h-8 items-center bg-muted px-2",children:[" ","No Data"]})}const hF=typeof document<"u"?w.useLayoutEffect:()=>{};function j1e(e){const t=w.useRef(null);return hF(()=>{t.current=e},[e]),w.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Rg=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Zl=e=>e&&"window"in e&&e.window===e?e:Rg(e).defaultView||window;function z1e(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function B1e(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function pF(e){let t=null;return()=>(t==null&&(t=e()),t)}const V1e=pF(function(){return B1e(/^Mac/i)}),H1e=pF(function(){return z1e(/Android/i)});function W1e(e){return e.mozInputSource===0&&e.isTrusted?!0:H1e()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class U1e{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function gF(e){let t=w.useRef({isFocused:!1,observer:null});hF(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=j1e(r=>{e==null||e(r)});return w.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,i=s=>{t.current.isFocused=!1,o.disabled&&n(new U1e("blur",s)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var s;(s=t.current.observer)===null||s===void 0||s.disconnect();let a=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:a})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:a}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function G1e(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=w.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),o&&o(!1),!0},[r,o]),s=gF(i),a=w.useCallback(l=>{const c=Rg(l.target);l.target===l.currentTarget&&c.activeElement===l.target&&(n&&n(l),o&&o(!0),s(l))},[o,n,s]);return{focusProps:{onFocus:!t&&(n||o||r)?a:void 0,onBlur:!t&&(r||o)?i:void 0}}}let Pg=null,R_=new Set,Fh=new Map,Fc=!1,P_=!1;const q1e={Tab:!0,Escape:!0};function eP(e,t){for(let n of R_)n(e,t)}function Y1e(e){return!(e.metaKey||!V1e()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function n0(e){Fc=!0,Y1e(e)&&(Pg="keyboard",eP("keyboard",e))}function Qo(e){Pg="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Fc=!0,eP("pointer",e))}function mF(e){W1e(e)&&(Fc=!0,Pg="virtual")}function vF(e){e.target===window||e.target===document||(!Fc&&!P_&&(Pg="virtual",eP("virtual",e)),Fc=!1,P_=!1)}function bF(){Fc=!1,P_=!0}function O_(e){if(typeof window>"u"||Fh.get(Zl(e)))return;const t=Zl(e),n=Rg(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Fc=!0,r.apply(this,arguments)},n.addEventListener("keydown",n0,!0),n.addEventListener("keyup",n0,!0),n.addEventListener("click",mF,!0),t.addEventListener("focus",vF,!0),t.addEventListener("blur",bF,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Qo,!0),n.addEventListener("pointermove",Qo,!0),n.addEventListener("pointerup",Qo,!0)):(n.addEventListener("mousedown",Qo,!0),n.addEventListener("mousemove",Qo,!0),n.addEventListener("mouseup",Qo,!0)),t.addEventListener("beforeunload",()=>{yF(e)},{once:!0}),Fh.set(t,{focus:r})}const yF=(e,t)=>{const n=Zl(e),r=Rg(e);t&&r.removeEventListener("DOMContentLoaded",t),Fh.has(n)&&(n.HTMLElement.prototype.focus=Fh.get(n).focus,r.removeEventListener("keydown",n0,!0),r.removeEventListener("keyup",n0,!0),r.removeEventListener("click",mF,!0),n.removeEventListener("focus",vF,!0),n.removeEventListener("blur",bF,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Qo,!0),r.removeEventListener("pointermove",Qo,!0),r.removeEventListener("pointerup",Qo,!0)):(r.removeEventListener("mousedown",Qo,!0),r.removeEventListener("mousemove",Qo,!0),r.removeEventListener("mouseup",Qo,!0)),Fh.delete(n))};function K1e(e){const t=Rg(e);let n;return t.readyState!=="loading"?O_(e):(n=()=>{O_(e)},t.addEventListener("DOMContentLoaded",n)),()=>yF(e,n)}typeof document<"u"&&K1e();function xF(){return Pg!=="pointer"}const X1e=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Q1e(e,t,n){var r;const o=typeof window<"u"?Zl(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?Zl(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?Zl(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?Zl(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof o&&!X1e.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof i||(n==null?void 0:n.target)instanceof s&&(n==null?void 0:n.target.isContentEditable),!(e&&t==="keyboard"&&n instanceof a&&!q1e[n.key])}function Z1e(e,t,n){O_(),w.useEffect(()=>{let r=(o,i)=>{Q1e(!!(n!=null&&n.isTextInput),o,i)&&e(xF())};return R_.add(r),()=>{R_.delete(r)}},t)}function J1e(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=w.useRef({isFocusWithin:!1}),s=w.useCallback(c=>{i.current.isFocusWithin&&!c.currentTarget.contains(c.relatedTarget)&&(i.current.isFocusWithin=!1,n&&n(c),o&&o(!1))},[n,o,i]),a=gF(s),l=w.useCallback(c=>{!i.current.isFocusWithin&&document.activeElement===c.target&&(r&&r(c),o&&o(!0),i.current.isFocusWithin=!0,a(c))},[r,o,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:s}}}let r0=!1,Tw=0;function A_(){r0=!0,setTimeout(()=>{r0=!1},50)}function eN(e){e.pointerType==="touch"&&A_()}function ewe(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",eN):document.addEventListener("touchend",A_),Tw++,()=>{Tw--,!(Tw>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",eN):document.removeEventListener("touchend",A_))}}function wF(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,s]=w.useState(!1),a=w.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;w.useEffect(ewe,[]);let{hoverProps:l,triggerHoverEnd:c}=w.useMemo(()=>{let u=(p,m)=>{if(a.pointerType=m,o||m==="touch"||a.isHovered||!p.currentTarget.contains(p.target))return;a.isHovered=!0;let v=p.currentTarget;a.target=v,t&&t({type:"hoverstart",target:v,pointerType:m}),n&&n(!0),s(!0)},d=(p,m)=>{if(a.pointerType="",a.target=null,m==="touch"||!a.isHovered)return;a.isHovered=!1;let v=p.currentTarget;r&&r({type:"hoverend",target:v,pointerType:m}),n&&n(!1),s(!1)},f={};return typeof PointerEvent<"u"?(f.onPointerEnter=p=>{r0&&p.pointerType==="mouse"||u(p,p.pointerType)},f.onPointerLeave=p=>{!o&&p.currentTarget.contains(p.target)&&d(p,p.pointerType)}):(f.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},f.onMouseEnter=p=>{!a.ignoreEmulatedMouseEvents&&!r0&&u(p,"mouse"),a.ignoreEmulatedMouseEvents=!1},f.onMouseLeave=p=>{!o&&p.currentTarget.contains(p.target)&&d(p,"mouse")}),{hoverProps:f,triggerHoverEnd:d}},[t,n,r,o,a]);return w.useEffect(()=>{o&&c({currentTarget:a.target},a.pointerType)},[o]),{hoverProps:l,isHovered:i}}function SF(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=w.useRef({isFocused:!1,isFocusVisible:t||xF()}),[i,s]=w.useState(!1),[a,l]=w.useState(()=>o.current.isFocused&&o.current.isFocusVisible),c=w.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),u=w.useCallback(p=>{o.current.isFocused=p,s(p),c()},[c]);Z1e(p=>{o.current.isFocusVisible=p,c()},[],{isTextInput:n});let{focusProps:d}=G1e({isDisabled:r,onFocusChange:u}),{focusWithinProps:f}=J1e({isDisabled:!r,onFocusWithinChange:u});return{isFocused:i,isFocusVisible:a,focusProps:r?f:d}}var twe=Object.defineProperty,nwe=(e,t,n)=>t in e?twe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dw=(e,t,n)=>(nwe(e,typeof t!="symbol"?t+"":t,n),n);let rwe=class{constructor(){Dw(this,"current",this.detect()),Dw(this,"handoffState","pending"),Dw(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"}},wc=new rwe;function Og(e){return wc.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function CF(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function ss(){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 CF(()=>{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=ss();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function of(){let[e]=w.useState(ss);return w.useEffect(()=>()=>e.dispose(),[e]),e}let nn=(e,t)=>{wc.isServer?w.useEffect(e,t):w.useLayoutEffect(e,t)};function pl(e){let t=w.useRef(e);return nn(()=>{t.current=e},[e]),t}let Ze=function(e){let t=pl(e);return w.useCallback((...n)=>t.current(...n),[t])};function owe(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function iwe(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function swe({disabled:e=!1}={}){let t=w.useRef(null),[n,r]=w.useState(!1),o=of(),i=Ze(()=>{t.current=null,r(!1),o.dispose()}),s=Ze(a=>{if(o.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let l=Og(a.currentTarget);o.addEventListener(l,"pointerup",i,!1),o.addEventListener(l,"pointermove",c=>{if(t.current){let u=owe(c);r(iwe(u,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:s,onPointerUp:i,onClick:i}}}let awe=w.createContext(void 0);function tP(){return w.useContext(awe)}function T_(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Ei(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,Ei),r}var o0=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(o0||{}),Va=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Va||{});function ko(){let e=cwe();return w.useCallback(t=>lwe({mergeRefs:e,...t}),[e])}function lwe({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??uwe;let l=_F(t,e);if(i)return Ev(l,n,r,s,a);let c=o??0;if(c&2){let{static:u=!1,...d}=l;if(u)return Ev(d,n,r,s,a)}if(c&1){let{unmount:u=!0,...d}=l;return Ei(u?0:1,{0(){return null},1(){return Ev({...d,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Ev(l,n,r,s,a)}function Ev(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=Mw(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},u=typeof s=="function"?s(t):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let d={};if(t){let f=!1,p=[];for(let[m,v]of Object.entries(t))typeof v=="boolean"&&(f=!0),v===!0&&p.push(m.replace(/([A-Z])/g,y=>`-${y.toLowerCase()}`));if(f){d["data-headlessui-state"]=p.join(" ");for(let m of p)d[`data-${m}`]=""}}if(i===w.Fragment&&(Object.keys(Ra(l)).length>0||Object.keys(Ra(d)).length>0))if(!w.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(Ra(l)).length>0)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(Ra(l)).concat(Object.keys(Ra(d))).map(f=>` - ${f}`).join(`
351
+ `),"","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(f=>` - ${f}`).join(`
352
+ `)].join(`
353
+ `))}else{let f=u.props,p=f==null?void 0:f.className,m=typeof p=="function"?(...b)=>T_(p(...b),l.className):T_(p,l.className),v=m?{className:m}:{},y=_F(u.props,Ra(Mw(l,["ref"])));for(let b in d)b in y&&delete d[b];return w.cloneElement(u,Object.assign({},y,d,c,{ref:o(dwe(u),c.ref)},v))}return w.createElement(i,Object.assign({},Mw(l,["ref"]),i!==w.Fragment&&c,i!==w.Fragment&&d),u)}function cwe(){let e=w.useRef([]),t=w.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function uwe(...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 _F(...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"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);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 nP(...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];for(let r in n)Object.assign(t,{[r](...o){let i=n[r];for(let s of i)s==null||s(...o)}});return t}function ao(e){var t;return Object.assign(w.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Ra(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Mw(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function dwe(e){return w.version.split(".")[0]>="19"?e.props.ref:e.ref}function fwe(e,t,n){let[r,o]=w.useState(n),i=e!==void 0,s=w.useRef(i),a=w.useRef(!1),l=w.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,Ze(c=>(i||o(c),t==null?void 0:t(c)))]}function hwe(e){let[t]=w.useState(e);return t}function EF(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))PF(n,RF(t,r),o);return n}function RF(e,t){return e?e+"["+t+"]":t}function PF(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())PF(e,RF(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,""]):EF(n,t,e)}let pwe="span";var rP=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(rP||{});function gwe(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,hidden:(r&4)===4?!0: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 ko()({ourProps:i,theirProps:o,slot:{},defaultTag:pwe,name:"Hidden"})}let OF=ao(gwe),mwe=w.createContext(null);function vwe({children:e}){let t=w.useContext(mwe);if(!t)return w.createElement(w.Fragment,null,e);let{target:n}=t;return n?Pn.createPortal(w.createElement(w.Fragment,null,e),n):null}function bwe({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,s]=w.useState(null),a=of();return w.useEffect(()=>{if(r&&i)return a.addEventListener(i,"reset",r)},[i,t,r]),w.createElement(vwe,null,w.createElement(ywe,{setForm:s,formId:t}),EF(e).map(([l,c])=>w.createElement(OF,{features:rP.Hidden,...Ra({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:l,value:c,...o})})))}function ywe({setForm:e,formId:t}){return w.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:w.createElement(OF,{features:rP.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let xwe=w.createContext(void 0);function AF(){return w.useContext(xwe)}function wwe(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&&Swe(n)?!1:r}function Swe(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let TF=Symbol();function Cwe(e,t=!0){return Object.assign(e,{[TF]:t})}function Ti(...e){let t=w.useRef(e);w.useEffect(()=>{t.current=e},[e]);let n=Ze(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[TF]))?void 0:n}let oP=w.createContext(null);oP.displayName="DescriptionContext";function DF(){let e=w.useContext(oP);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,DF),t}return e}function _we(){var e,t;return(t=(e=w.useContext(oP))==null?void 0:e.value)!=null?t:void 0}let Ewe="p";function Rwe(e,t){let n=w.useId(),r=tP(),{id:o=`headlessui-description-${n}`,...i}=e,s=DF(),a=Ti(t);nn(()=>s.register(o),[o,s.register]);let l=r||!1,c=w.useMemo(()=>({...s.slot,disabled:l}),[s.slot,l]),u={ref:a,...s.props,id:o};return ko()({ourProps:u,theirProps:i,slot:c,defaultTag:Ewe,name:s.name||"Description"})}let Pwe=ao(Rwe);Object.assign(Pwe,{});var Ir=(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))(Ir||{});let Py=w.createContext(null);Py.displayName="LabelContext";function MF(){let e=w.useContext(Py);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,MF),t}return e}function Oy(e){var t,n,r;let o=(n=(t=w.useContext(Py))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function Owe({inherit:e=!1}={}){let t=Oy(),[n,r]=w.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,w.useMemo(()=>function(i){let s=Ze(l=>(r(c=>[...c,l]),()=>r(c=>{let u=c.slice(),d=u.indexOf(l);return d!==-1&&u.splice(d,1),u}))),a=w.useMemo(()=>({register:s,slot:i.slot,name:i.name,props:i.props,value:i.value}),[s,i.slot,i.name,i.props,i.value]);return w.createElement(Py.Provider,{value:a},i.children)},[r])]}let Awe="label";function Twe(e,t){var n;let r=w.useId(),o=MF(),i=AF(),s=tP(),{id:a=`headlessui-label-${r}`,htmlFor:l=i??((n=o.props)==null?void 0:n.htmlFor),passive:c=!1,...u}=e,d=Ti(t);nn(()=>o.register(a),[a,o.register]);let f=Ze(y=>{let b=y.currentTarget;if(b instanceof HTMLLabelElement&&y.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(y),b instanceof HTMLLabelElement){let x=document.getElementById(b.htmlFor);if(x){let E=x.getAttribute("disabled");if(E==="true"||E==="")return;let R=x.getAttribute("aria-disabled");if(R==="true"||R==="")return;(x instanceof HTMLInputElement&&(x.type==="radio"||x.type==="checkbox")||x.role==="radio"||x.role==="checkbox"||x.role==="switch")&&x.click(),x.focus({preventScroll:!0})}}}),p=s||!1,m=w.useMemo(()=>({...o.slot,disabled:p}),[o.slot,p]),v={ref:d,...o.props,id:a,htmlFor:l,onClick:f};return c&&("onClick"in v&&(delete v.htmlFor,delete v.onClick),"onClick"in u&&delete u.onClick),ko()({ourProps:v,theirProps:u,slot:m,defaultTag:l?Awe:"div",name:o.name||"Label"})}let Dwe=ao(Twe),Mwe=Object.assign(Dwe,{});function Ru(e,t,n){let r=n.initialDeps??[],o;return()=>{var i,s,a,l;let c;n.key&&((i=n.debug)!=null&&i.call(n))&&(c=Date.now());const u=e();if(!(u.length!==r.length||u.some((p,m)=>r[m]!==p)))return o;r=u;let f;if(n.key&&((s=n.debug)!=null&&s.call(n))&&(f=Date.now()),o=t(...u),n.key&&((a=n.debug)!=null&&a.call(n))){const p=Math.round((Date.now()-c)*100)/100,m=Math.round((Date.now()-f)*100)/100,v=m/16,y=(b,x)=>{for(b=String(b);b.length<x;)b=" "+b;return b};console.info(`%c⏱ ${y(m,5)} /${y(p,5)} ms`,`
354
+ font-size: .6rem;
355
+ font-weight: bold;
356
+ color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n==null?void 0:n.key)}return(l=n==null?void 0:n.onChange)==null||l.call(n,o),o}}function Iw(e,t){if(e===void 0)throw new Error(`Unexpected undefined${t?`: ${t}`:""}`);return e}const Iwe=(e,t)=>Math.abs(e-t)<1,$we=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},Nwe=e=>e,kwe=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=t;o<=n;o++)r.push(o);return r},Lwe=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const o=s=>{const{width:a,height:l}=s;t({width:Math.round(a),height:Math.round(l)})};if(o(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(s=>{const a=s[0];if(a!=null&&a.borderBoxSize){const l=a.borderBoxSize[0];if(l){o({width:l.inlineSize,height:l.blockSize});return}}o(n.getBoundingClientRect())});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},tN={passive:!0},Fwe=typeof window>"u"?!0:"onscrollend"in window,jwe=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&Fwe?()=>{}:$we(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=c=>()=>{const{horizontal:u,isRtl:d}=e.options;o=u?n.scrollLeft*(d&&-1||1):n.scrollTop,i(),t(o,c)},a=s(!0),l=s(!1);return l(),n.addEventListener("scroll",a,tN),n.addEventListener("scrollend",l,tN),()=>{n.removeEventListener("scroll",a),n.removeEventListener("scrollend",l)}},zwe=(e,t,n)=>{if(t!=null&&t.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[n.options.horizontal?"width":"height"])},Bwe=(e,{adjustments:t=0,behavior:n},r)=>{var o,i;const s=e+t;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:s,behavior:n})};class Vwe{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{this._measureElement(i.target,i)})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([r,o])=>{typeof o>"u"&&delete n[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Nwe,rangeExtractor:kwe,onChange:()=>{},measureElement:zwe,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=Ru(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o,this.isScrolling=i,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const o=new Map,i=new Map;for(let s=r-1;s>=0;s--){const a=n[s];if(o.has(a.lane))continue;const l=i.get(a.lane);if(l==null||a.end>l.end?i.set(a.lane,a):a.end<l.end&&o.set(a.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((s,a)=>s.end===a.end?s.index-a.index:s.end-a.end)[0]:void 0},this.getMeasurementOptions=Ru(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,o,i,s)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s}),{key:!1}),this.getMeasurements=Ru(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:s},a)=>{if(!s)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(u=>{this.itemSizeCache.set(u.key,u.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let u=l;u<n;u++){const d=i(u),f=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),p=f?f.end+this.options.gap:r+o,m=a.get(d),v=typeof m=="number"?m:this.options.estimateSize(u),y=p+v,b=f?f.lane:u%this.options.lanes;c[u]={index:u,start:p,size:v,end:y,key:d,lane:b}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Ru(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,r,o)=>this.range=n.length>0&&r>0?Hwe({measurements:n,outerSize:r,scrollOffset:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=Ru(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,r,o,i)=>r===null?[]:n({startIndex:r.startIndex,endIndex:r.endIndex,overscan:o,count:i}),{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(n,r)=>{const o=this.indexFromElement(n),i=this.measurementsCache[o];if(!i)return;const s=i.key,a=this.elementsCache.get(s);a!==n&&(a&&this.observer.unobserve(a),this.observer.observe(n),this.elementsCache.set(s,n)),n.isConnected&&this.resizeItem(o,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const o=this.measurementsCache[n];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,s=r-i;s!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,s,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",s),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((r,o)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(o))});return}this._measureElement(n,void 0)},this.getVirtualItems=Ru(()=>[this.getIndexes(),this.getMeasurements()],(n,r)=>{const o=[];for(let i=0,s=n.length;i<s;i++){const a=n[i],l=r[a];o.push(l)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return Iw(r[IF(0,r.length-1,o=>Iw(r[o]).start,n)])},this.getOffsetForAlignment=(n,r)=>{const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&n>=i+o&&(r="end"),r==="end"&&(n-=o);const s=this.options.horizontal?"scrollWidth":"scrollHeight",l=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[s]:this.scrollElement[s]:0)-o;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.measurementsCache[n];if(!o)return;const i=this.getSize(),s=this.getScrollOffset();if(r==="auto")if(o.end>=s+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];const a=o.start-this.options.scrollPaddingStart+(o.size-i)/2;switch(r){case"center":return[this.getOffsetForAlignment(a,r),r];case"end":return[this.getOffsetForAlignment(o.end+this.options.scrollPaddingEnd,r),r];default:return[this.getOffsetForAlignment(o.start-this.options.scrollPaddingStart,r),r]}},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:r="start",behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(n,{align:r="auto",behavior:o}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const i=this.getOffsetForIndex(n,r);if(!i)return;const[s,a]=i;this._scrollToOffset(s,{adjustments:void 0,behavior:o}),o!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=Iw(this.getOffsetForIndex(n,a));Iwe(c,this.getScrollOffset())||this.scrollToIndex(n,{align:a,behavior:o})}else this.scrollToIndex(n,{align:a,behavior:o})}))},this.scrollBy=(n,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let o;return r.length===0?o=this.options.paddingStart:o=this.options.lanes===1?((n=r[r.length-1])==null?void 0:n.end)??0:Math.max(...r.slice(-this.options.lanes).map(i=>i.end)),Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const IF=(e,t,n,r)=>{for(;e<=t;){const o=(e+t)/2|0,i=n(o);if(i<r)e=o+1;else if(i>r)t=o-1;else return o}return e>0?e-1:0};function Hwe({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,i=IF(0,r,a=>e[a].start,n);let s=i;for(;s<r&&e[s].end<n+t;)s++;return{startIndex:i,endIndex:s}}const nN=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Wwe(e){const t=S.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var s;i?Pn.flushSync(t):t(),(s=e.onChange)==null||s.call(e,o,i)}},[r]=S.useState(()=>new Vwe(n));return r.setOptions(n),nN(()=>r._didMount(),[]),nN(()=>r._willUpdate()),r}function Uwe(e){return Wwe({observeElementRect:Lwe,observeElementOffset:jwe,scrollToFn:Bwe,...e})}function Gwe(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function qwe(e=Gwe){return w.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function Ywe(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function rN(e,t=!1){let[n,r]=w.useReducer(()=>({}),{}),o=w.useMemo(()=>Ywe(e),[e,n]);return nn(()=>{if(!e)return;let i=new ResizeObserver(r);return i.observe(e),()=>{i.disconnect()}},[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let Kwe=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function $F(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let s=t[o].call(n,...i);s&&(n=s,r.forEach(a=>a()))}}}function NF(e){return w.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Xwe=new Kwe(()=>$F(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function iP(e,t){let n=Xwe.get(t),r=w.useId(),o=NF(n);if(nn(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let i=o.indexOf(r),s=o.length;return i===-1&&(i=s,s+=1),i===s-1}let D_=new Map,jh=new Map;function oN(e){var t;let n=(t=jh.get(e))!=null?t:0;return jh.set(e,n+1),n!==0?()=>iN(e):(D_.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>iN(e))}function iN(e){var t;let n=(t=jh.get(e))!=null?t:1;if(n===1?jh.delete(e):jh.set(e,n-1),n!==1)return;let r=D_.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,D_.delete(e))}function Qwe(e,{allowed:t,disallowed:n}={}){let r=iP(e,"inert-others");nn(()=>{var o,i;if(!r)return;let s=ss();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&s.add(oN(l));let a=(i=t==null?void 0:t())!=null?i:[];for(let l of a){if(!l)continue;let c=Og(l);if(!c)continue;let u=l.parentElement;for(;u&&u!==c.body;){for(let d of u.children)a.some(f=>d.contains(f))||s.add(oN(d));u=u.parentElement}}return s.dispose},[r,t,n])}function Zwe(e,t,n){let r=pl(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});w.useEffect(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let i=ss();if(typeof ResizeObserver<"u"){let s=new ResizeObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}if(typeof IntersectionObserver<"u"){let s=new IntersectionObserver(()=>r.current(o));s.observe(o),i.add(()=>s.disconnect())}return()=>i.dispose()},[t,r,e])}let M_=["[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 Jwe=(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[e.AutoFocus=64]="AutoFocus",e))(Jwe||{}),eSe=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(eSe||{}),tSe=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(tSe||{}),kF=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(kF||{});function nSe(e,t=0){var n;return e===((n=Og(e))==null?void 0:n.body)?!1:Ei(t,{0(){return e.matches(M_)},1(){let r=e;for(;r!==null;){if(r.matches(M_))return!0;r=r.parentElement}return!1}})}var rSe=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(rSe||{});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 oSe(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 LF(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function iSe(){return/Android/gi.test(window.navigator.userAgent)}function FF(){return LF()||iSe()}function Xf(e,t,n,r){let o=pl(n);w.useEffect(()=>{if(!e)return;function i(s){o.current(s)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function sSe(e,t,n,r){let o=pl(n);w.useEffect(()=>{if(!e)return;function i(s){o.current(s)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const sN=30;function aSe(e,t,n){let r=iP(e,"outside-click"),o=pl(n),i=w.useCallback(function(l,c){if(l.defaultPrevented)return;let u=c(l);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let d=function f(p){return typeof p=="function"?f(p()):Array.isArray(p)||p instanceof Set?p:[p]}(t);for(let f of d)if(f!==null&&(f.contains(u)||l.composed&&l.composedPath().includes(f)))return;return!nSe(u,kF.Loose)&&u.tabIndex!==-1&&l.preventDefault(),o.current(l,u)},[o,t]),s=w.useRef(null);Xf(r,"pointerdown",l=>{var c,u;s.current=((u=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:u[0])||l.target},!0),Xf(r,"mousedown",l=>{var c,u;s.current=((u=(c=l.composedPath)==null?void 0:c.call(l))==null?void 0:u[0])||l.target},!0),Xf(r,"click",l=>{FF()||s.current&&(i(l,()=>s.current),s.current=null)},!0);let a=w.useRef({x:0,y:0});Xf(r,"touchstart",l=>{a.current.x=l.touches[0].clientX,a.current.y=l.touches[0].clientY},!0),Xf(r,"touchend",l=>{let c={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(c.x-a.current.x)>=sN||Math.abs(c.y-a.current.y)>=sN))return i(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),sSe(r,"blur",l=>i(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Ay(...e){return w.useMemo(()=>Og(...e),[...e])}function lSe(e,t,n,r){let o=pl(n);w.useEffect(()=>{e=e??window;function i(s){o.current(s)}return e.addEventListener(t,i,r),()=>e.removeEventListener(t,i,r)},[e,t,r])}function jF(e){let t=w.useRef({value:"",selectionStart:null,selectionEnd:null});return lSe(e,"blur",n=>{let r=n.target;r instanceof HTMLInputElement&&(t.current={value:r.value,selectionStart:r.selectionStart,selectionEnd:r.selectionEnd})}),Ze(()=>{if(document.activeElement!==e&&e instanceof HTMLInputElement&&e.isConnected){if(e.focus({preventScroll:!0}),e.value!==t.current.value)e.setSelectionRange(e.value.length,e.value.length);else{let{selectionStart:n,selectionEnd:r}=t.current;n!==null&&r!==null&&e.setSelectionRange(n,r)}t.current={value:"",selectionStart:null,selectionEnd:null}}})}function cSe(e,t){return w.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function uSe(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function dSe(){return LF()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(i=>i()).some(i=>i.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=ss();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,s=null;t.addEventListener(e,"click",a=>{if(a.target instanceof HTMLElement)try{let l=a.target.closest("a");if(!l)return;let{hash:c}=new URL(l.href),u=e.querySelector(c);u&&!r(u)&&(s=u)}catch{}},!0),t.addEventListener(e,"touchstart",a=>{if(a.target instanceof HTMLElement)if(r(a.target)){let l=a.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(a.target,"touchAction","none")}),t.addEventListener(e,"touchmove",a=>{if(a.target instanceof HTMLElement){if(a.target.tagName==="INPUT")return;if(r(a.target)){let l=a.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()}},{passive:!1}),t.add(()=>{var a;let l=(a=window.scrollY)!=null?a:window.pageYOffset;i!==l&&window.scrollTo(0,i),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{}}function fSe(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function hSe(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Jl=$F(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:ss(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:hSe(n)},o=[dSe(),uSe(),fSe()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Jl.subscribe(()=>{let e=Jl.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Jl.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Jl.dispatch("TEARDOWN",n)}});function pSe(e,t,n=()=>({containers:[]})){let r=NF(Jl),o=t?r.get(t):void 0,i=o?o.count>0:!1;return nn(()=>{if(!(!t||!e))return Jl.dispatch("PUSH",t,n),()=>Jl.dispatch("POP",t,n)},[e,t]),i}function gSe(e,t,n=()=>[document.body]){let r=iP(e,"scroll-lock");pSe(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function aN(e){return[e.screenX,e.screenY]}function mSe(){let e=w.useRef([-1,-1]);return{wasMoved(t){let n=aN(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=aN(t)}}}function vSe(e=0){let[t,n]=w.useState(e),r=w.useCallback(l=>n(l),[t]),o=w.useCallback(l=>n(c=>c|l),[t]),i=w.useCallback(l=>(t&l)===l,[t]),s=w.useCallback(l=>n(c=>c&~l),[n]),a=w.useCallback(l=>n(c=>c^l),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}var lN,cN;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((lN=process==null?void 0:process.env)==null?void 0:lN.NODE_ENV)==="test"&&typeof((cN=Element==null?void 0:Element.prototype)==null?void 0:cN.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
357
+ `)),[]});var bSe=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(bSe||{});function zF(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function BF(e,t,n,r){let[o,i]=w.useState(n),{hasFlag:s,addFlag:a,removeFlag:l}=vSe(e&&o?3:0),c=w.useRef(!1),u=w.useRef(!1),d=of();return nn(()=>{var f;if(e){if(n&&i(!0),!t){n&&a(3);return}return(f=r==null?void 0:r.start)==null||f.call(r,n),ySe(t,{inFlight:c,prepare(){u.current?u.current=!1:u.current=c.current,c.current=!0,!u.current&&(n?(a(3),l(4)):(a(4),l(2)))},run(){u.current?n?(l(3),a(4)):(l(4),a(3)):n?l(1):a(1)},done(){var p;u.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(c.current=!1,l(7),n||i(!1),(p=r==null?void 0:r.end)==null||p.call(r,n))}})}},[e,n,t,d]),e?[o,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function ySe(e,{prepare:t,run:n,done:r,inFlight:o}){let i=ss();return wSe(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(xSe(e,r))})}),i.dispose}function xSe(e,t){var n,r;let o=ss();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!0});let s=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(a=>a instanceof CSSTransition))!=null?r:[];return s.length===0?(t(),o.dispose):(Promise.allSettled(s.map(a=>a.finished)).then(()=>{i||t()}),o.dispose)}function wSe(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function SSe(e,{container:t,accept:n,walk:r}){let o=w.useRef(n),i=w.useRef(r);w.useEffect(()=>{o.current=n,i.current=r},[n,r]),nn(()=>{if(!t||!e)return;let s=Og(t);if(!s)return;let a=o.current,l=i.current,c=Object.assign(d=>a(d),{acceptNode:a}),u=s.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,c,!1);for(;u.nextNode();)l(u.currentNode)},[t,e,o,i])}function uN(e,t){let n=w.useRef([]),r=Ze(e);w.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 CSe(){return typeof window<"u"}function _Se(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bh(e){return CSe()?e instanceof Element||e instanceof _Se(e).Element:!1}function ESe(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const RSe=Math.min,$w=Math.max,PSe=Math.round;function OSe(e,t){return typeof e=="function"?e(t):e}const VF={...S},ASe=VF.useInsertionEffect,TSe=ASe||(e=>e());function HF(e){const t=S.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return TSe(()=>{t.current=e}),S.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var I_=typeof document<"u"?w.useLayoutEffect:w.useEffect;let dN=!1,DSe=0;const fN=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+DSe++;function MSe(){const[e,t]=S.useState(()=>dN?fN():void 0);return I_(()=>{e==null&&t(fN())},[]),S.useEffect(()=>{dN=!0},[]),e}const ISe=VF.useId,$Se=ISe||MSe;let dp;process.env.NODE_ENV!=="production"&&(dp=new Set);function NSe(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=dp)!=null&&e.has(o))){var i;(i=dp)==null||i.add(o),console.warn(o)}}function kSe(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=dp)!=null&&e.has(o))){var i;(i=dp)==null||i.add(o),console.error(o)}}function LSe(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const FSe=S.createContext(null),jSe=S.createContext(null),zSe=()=>{var e;return((e=S.useContext(FSe))==null?void 0:e.id)||null},BSe=()=>S.useContext(jSe),VSe="data-floating-ui-focusable";function HSe(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=$Se(),i=S.useRef({}),[s]=S.useState(()=>LSe()),a=zSe()!=null;if(process.env.NODE_ENV!=="production"){const p=r.reference;p&&!bh(p)&&kSe("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,c]=S.useState(r.reference),u=HF((p,m,v)=>{i.current.openEvent=p?m:void 0,s.emit("openchange",{open:p,event:m,reason:v,nested:a}),n==null||n(p,m,v)}),d=S.useMemo(()=>({setPositionReference:c}),[]),f=S.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return S.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:f,events:s,floatingId:o,refs:d}),[t,u,f,s,o,d])}function WSe(e){e===void 0&&(e={});const{nodeId:t}=e,n=HSe({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=S.useState(null),[a,l]=S.useState(null),u=(o==null?void 0:o.domReference)||i,d=S.useRef(null),f=BSe();I_(()=>{u&&(d.current=u)},[u]);const p=ug({...e,elements:{...o,...a&&{reference:a}}}),m=S.useCallback(E=>{const R=bh(E)?{getBoundingClientRect:()=>E.getBoundingClientRect(),contextElement:E}:E;l(R),p.refs.setReference(R)},[p.refs]),v=S.useCallback(E=>{(bh(E)||E===null)&&(d.current=E,s(E)),(bh(p.refs.reference.current)||p.refs.reference.current===null||E!==null&&!bh(E))&&p.refs.setReference(E)},[p.refs]),y=S.useMemo(()=>({...p.refs,setReference:v,setPositionReference:m,domReference:d}),[p.refs,v,m]),b=S.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),x=S.useMemo(()=>({...p,...r,refs:y,elements:b,nodeId:t}),[p,y,b,t,r]);return I_(()=>{r.dataRef.current.floatingContext=x;const E=f==null?void 0:f.nodesRef.current.find(R=>R.id===t);E&&(E.context=x)}),S.useMemo(()=>({...p,context:x,refs:y,elements:b}),[p,y,b,x])}const hN="active",pN="selected";function Nw(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[hN]:s,[pN]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[VSe]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(l=>{let[c,u]=l;if(!(o&&[hN,pN].includes(c)))if(c.indexOf("on")===0){if(r.has(c)||r.set(c,[]),typeof u=="function"){var d;(d=r.get(c))==null||d.push(u),s[c]=function(){for(var f,p=arguments.length,m=new Array(p),v=0;v<p;v++)m[v]=arguments[v];return(f=r.get(c))==null?void 0:f.map(y=>y(...m)).find(y=>y!==void 0)}}}else s[c]=u}),s),{})}}function USe(e){e===void 0&&(e=[]);const t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=S.useCallback(a=>Nw(a,e,"reference"),t),i=S.useCallback(a=>Nw(a,e,"floating"),n),s=S.useCallback(a=>Nw(a,e,"item"),r);return S.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}function gN(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const GSe=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:s=0,minItemsVisible:a=4,referenceOverflowThreshold:l=0,scrollRef:c,...u}=OSe(e,t),{rects:d,elements:{floating:f}}=t,p=n.current[s],m=(c==null?void 0:c.current)||f,v=f.clientTop||m.clientTop,y=f.clientTop!==0,b=m.clientTop!==0,x=f===m;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||NSe('`placement` side must be "bottom" when using the `inner`',"middleware.")),!p)return{};const E={...t,...await tf(-p.offsetTop-f.clientTop-d.reference.height/2-p.offsetHeight/2-i).fn(t)},R=await Ua(gN(E,m.scrollHeight+v+f.clientTop),u),P=await Ua(E,{...u,elementContext:"reference"}),O=$w(0,R.top),A=E.y+O,L=(m.scrollHeight>m.clientHeight?j=>j:PSe)($w(0,m.scrollHeight+(y&&x||b?v*2:0)-O-$w(0,R.bottom)));if(m.style.maxHeight=L+"px",m.scrollTop=O,o){const j=m.offsetHeight<p.offsetHeight*RSe(a,n.current.length)-1||P.top>=-l||P.bottom>=-l;Pi.flushSync(()=>o(j))}return r&&(r.current=await Ua(gN({...E,y:A},m.offsetHeight+v+f.clientTop),u)),{y:A}}});function qSe(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:s,onChange:a}=t,l=HF(a),c=S.useRef(!1),u=S.useRef(null),d=S.useRef(null);S.useEffect(()=>{if(!o)return;function p(v){if(v.ctrlKey||!m||i.current==null)return;const y=v.deltaY,b=i.current.top>=-.5,x=i.current.bottom>=-.5,E=m.scrollHeight-m.clientHeight,R=y<0?-1:1,P=y<0?"max":"min";m.scrollHeight<=m.clientHeight||(!b&&y>0||!x&&y<0?(v.preventDefault(),Pi.flushSync(()=>{l(O=>O+Math[P](y,E*R))})):/firefox/i.test(ESe())&&(m.scrollTop+=y))}const m=(s==null?void 0:s.current)||r.floating;if(n&&m)return m.addEventListener("wheel",p),requestAnimationFrame(()=>{u.current=m.scrollTop,i.current!=null&&(d.current={...i.current})}),()=>{u.current=null,d.current=null,m.removeEventListener("wheel",p)}},[o,n,r.floating,i,s,l]);const f=S.useMemo(()=>({onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const p=(s==null?void 0:s.current)||r.floating;if(!(!i.current||!p||!c.current)){if(u.current!==null){const m=p.scrollTop-u.current;(i.current.bottom<-.5&&m<-1||i.current.top<-.5&&m>1)&&Pi.flushSync(()=>l(v=>v+m))}requestAnimationFrame(()=>{u.current=p.scrollTop})}}}),[r.floating,l,i,s]);return S.useMemo(()=>o?{floating:f}:{},[o,f])}let Ag=w.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Ag.displayName="FloatingContext";let sP=w.createContext(null);sP.displayName="PlacementContext";function YSe(e){return w.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function KSe(){return w.useContext(Ag).setReference}function XSe(){let{getFloatingProps:e,slot:t}=w.useContext(Ag);return w.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function QSe(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=w.useContext(sP),n=w.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var s;return(s=i==null?void 0:i.outerHTML)!=null?s:i})]);nn(()=>{t==null||t(n??null)},[t,n]);let r=w.useContext(Ag);return w.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let mN=4;function ZSe({children:e,enabled:t=!0}){let[n,r]=w.useState(null),[o,i]=w.useState(0),s=w.useRef(null),[a,l]=w.useState(null);JSe(a);let c=t&&n!==null&&a!==null,{to:u="bottom",gap:d=0,offset:f=0,padding:p=0,inner:m}=eCe(n,a),[v,y="center"]=u.split(" ");nn(()=>{c&&i(0)},[c]);let{refs:b,floatingStyles:x,context:E}=WSe({open:c,placement:v==="selection"?y==="center"?"bottom":`bottom-${y}`:y==="center"?`${v}`:`${v}-${y}`,strategy:"absolute",transform:!1,middleware:[tf({mainAxis:v==="selection"?0:d,crossAxis:f}),dg({padding:p}),v!=="selection"&&fg({padding:p}),v==="selection"&&m?GSe({...m,padding:p,overflowRef:s,offset:o,minItemsVisible:mN,referenceOverflowThreshold:p,onFallbackChange(j){var z,K;if(!j)return;let H=E.elements.floating;if(!H)return;let k=parseFloat(getComputedStyle(H).scrollPaddingBottom)||0,W=Math.min(mN,H.childElementCount),B=0,U=0;for(let q of(K=(z=E.elements.floating)==null?void 0:z.childNodes)!=null?K:[])if(q instanceof HTMLElement){let $=q.offsetTop,Y=$+q.clientHeight+k,X=H.scrollTop,M=X+H.clientHeight;if($>=X&&Y<=M)W--;else{U=Math.max(0,Math.min(Y,M)-Math.max($,X)),B=q.clientHeight;break}}W>=1&&i(q=>{let $=B*W-U+k;return q>=$?q:$})}}):null,hg({padding:p,apply({availableWidth:j,availableHeight:z,elements:K}){Object.assign(K.floating.style,{overflow:"auto",maxWidth:`${j}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${z}px)`})}})].filter(Boolean),whileElementsMounted:cg}),[R=v,P=y]=E.placement.split("-");v==="selection"&&(R="selection");let O=w.useMemo(()=>({anchor:[R,P].filter(Boolean).join(" ")}),[R,P]),A=qSe(E,{overflowRef:s,onChange:i}),{getReferenceProps:D,getFloatingProps:I}=USe([A]),L=Ze(j=>{l(j),b.setFloating(j)});return S.createElement(sP.Provider,{value:r},S.createElement(Ag.Provider,{value:{setFloating:L,setReference:b.setReference,styles:x,getReferenceProps:D,getFloatingProps:I,slot:O}},e))}function JSe(e){nn(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function eCe(e,t){var n,r,o;let i=kw((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),s=kw((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),a=kw((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:s,padding:a}}function kw(e,t,n=void 0){let r=of(),o=Ze((l,c)=>{if(l==null)return[n,null];if(typeof l=="number")return[l,null];if(typeof l=="string"){if(!c)return[n,null];let u=vN(l,c);return[u,d=>{let f=WF(l);{let p=f.map(m=>window.getComputedStyle(c).getPropertyValue(m));r.requestAnimationFrame(function m(){r.nextFrame(m);let v=!1;for(let[b,x]of f.entries()){let E=window.getComputedStyle(c).getPropertyValue(x);if(p[b]!==E){p[b]=E,v=!0;break}}if(!v)return;let y=vN(l,c);u!==y&&(d(y),u=y)})}return r.dispose}]}return[n,null]}),i=w.useMemo(()=>o(e,t)[0],[e,t]),[s=i,a]=w.useState();return nn(()=>{let[l,c]=o(e,t);if(a(l),!!c)return c(a)},[e,t]),s}function WF(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...WF(o)]:[r]}return[]}function vN(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function tCe({children:e,freeze:t}){let n=$_(t,e);return w.createElement(w.Fragment,null,n)}function $_(e,t){let[n,r]=w.useState(t);return!e&&n!==t&&r(t),e?n:t}let aP=w.createContext(null);aP.displayName="OpenClosedContext";var Ci=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Ci||{});function lP(){return w.useContext(aP)}function UF({value:e,children:t}){return w.createElement(aP.Provider,{value:e},t)}function nCe(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let Ul=[];nCe(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||Ul[0]===t.target)return;let n=t.target;n=n.closest(M_),Ul.unshift(n??t.target),Ul=Ul.filter(r=>r!=null&&r.isConnected),Ul.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 rCe(e){throw new Error("Unexpected object: "+e)}var Kn=(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))(Kn||{});function bN(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:{o===-1&&(o=n.length);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:rCe(e)}}var cP=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(cP||{});function oCe(e){let t=Ze(e),n=w.useRef(!1);w.useEffect(()=>(n.current=!1,()=>{n.current=!0,CF(()=>{n.current&&t()})}),[t])}function iCe(){let e=typeof document>"u";return"useSyncExternalStore"in S?(t=>t.useSyncExternalStore)(S)(()=>()=>{},()=>!1,()=>!e):!1}function uP(){let e=iCe(),[t,n]=S.useState(wc.isHandoffComplete);return t&&wc.isHandoffComplete===!1&&n(!1),S.useEffect(()=>{t!==!0&&n(!0)},[t]),S.useEffect(()=>wc.handoff(),[]),e?!1:t}let sCe=w.createContext(!1);function aCe(){return w.useContext(sCe)}function lCe(e){let t=aCe(),n=w.useContext(qF),r=Ay(e),[o,i]=w.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(wc.isServer)return null;let a=r==null?void 0:r.getElementById("headlessui-portal-root");if(a)return a;if(r===null)return null;let l=r.createElement("div");return l.setAttribute("id","headlessui-portal-root"),r.body.appendChild(l)});return w.useEffect(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),w.useEffect(()=>{t||n!==null&&i(n.current)},[n,i,t]),o}let GF=w.Fragment,cCe=ao(function(e,t){let n=e,r=w.useRef(null),o=Ti(Cwe(d=>{r.current=d}),t),i=Ay(r),s=lCe(r),[a]=w.useState(()=>{var d;return wc.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),l=w.useContext(hCe),c=uP();nn(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),nn(()=>{if(a&&l)return l.register(a)},[l,a]),oCe(()=>{var d;!s||!a||(a instanceof Node&&s.contains(a)&&s.removeChild(a),s.childNodes.length<=0&&((d=s.parentElement)==null||d.removeChild(s)))});let u=ko();return c?!s||!a?null:Pn.createPortal(u({ourProps:{ref:o},theirProps:n,slot:{},defaultTag:GF,name:"Portal"}),a):null});function uCe(e,t){let n=Ti(t),{enabled:r=!0,...o}=e,i=ko();return r?w.createElement(cCe,{...o,ref:n}):i({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:GF,name:"Portal"})}let dCe=w.Fragment,qF=w.createContext(null);function fCe(e,t){let{target:n,...r}=e,o={ref:Ti(t)},i=ko();return w.createElement(qF.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:dCe,name:"Popover.Group"}))}let hCe=w.createContext(null),pCe=ao(uCe),gCe=ao(fCe),mCe=Object.assign(pCe,{Group:gCe});var vCe=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(vCe||{}),bCe=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(bCe||{}),yCe=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(yCe||{}),xCe=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.SetTyping=3]="SetTyping",e[e.RegisterOption=4]="RegisterOption",e[e.UnregisterOption=5]="UnregisterOption",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualConfiguration=7]="UpdateVirtualConfiguration",e[e.SetInputElement=8]="SetInputElement",e[e.SetButtonElement=9]="SetButtonElement",e[e.SetOptionsElement=10]="SetOptionsElement",e))(xCe||{});function Lw(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):oSe(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let wCe={1(e){var t;return(t=e.dataRef.current)!=null&&t.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1,isTyping:!1,activationTrigger:2,__demoMode:!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,__demoMode:!1}}return{...e,comboboxState:0,__demoMode:!1}},3(e,t){return e.isTyping===t.isTyping?e:{...e,isTyping:t.isTyping}},2(e,t){var n,r,o,i;if((n=e.dataRef.current)!=null&&n.disabled||e.optionsElement&&!((r=e.dataRef.current)!=null&&r.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let{options:c,disabled:u}=e.virtual,d=t.focus===Kn.Specific?t.idx:bN(t,{resolveItems:()=>c,resolveActiveIndex:()=>{var p,m;return(m=(p=e.activeOptionIndex)!=null?p:c.findIndex(v=>!u(v)))!=null?m:null},resolveDisabled:u,resolveId(){throw new Error("Function not implemented.")}}),f=(o=t.trigger)!=null?o:2;return e.activeOptionIndex===d&&e.activationTrigger===f?e:{...e,activeOptionIndex:d,activationTrigger:f,isTyping:!1,__demoMode:!1}}let s=Lw(e);if(s.activeOptionIndex===null){let c=s.options.findIndex(u=>!u.dataRef.current.disabled);c!==-1&&(s.activeOptionIndex=c)}let a=t.focus===Kn.Specific?t.idx:bN(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:c=>c.id,resolveDisabled:c=>c.dataRef.current.disabled}),l=(i=t.trigger)!=null?i:2;return e.activeOptionIndex===a&&e.activationTrigger===l?e:{...e,...s,isTyping:!1,activeOptionIndex:a,activationTrigger:l,__demoMode:!1}},4:(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=Lw(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},5:(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=Lw(e,o=>{let i=o.findIndex(s=>s.id===t.id);return i!==-1&&o.splice(i,1),o});return{...e,...r,activationTrigger:2}},6:(e,t)=>e.activationTrigger===t.trigger?e:{...e,activationTrigger:t.trigger},7:(e,t)=>{var n,r;if(e.virtual===null)return{...e,virtual:{options:t.options,disabled:(n=t.disabled)!=null?n:()=>!1}};if(e.virtual.options===t.options&&e.virtual.disabled===t.disabled)return e;let o=e.activeOptionIndex;if(e.activeOptionIndex!==null){let i=t.options.indexOf(e.virtual.options[e.activeOptionIndex]);i!==-1?o=i:o=null}return{...e,activeOptionIndex:o,virtual:{options:t.options,disabled:(r=t.disabled)!=null?r:()=>!1}}},8:(e,t)=>e.inputElement===t.element?e:{...e,inputElement:t.element},9:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},10:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element}},dP=w.createContext(null);dP.displayName="ComboboxActionsContext";function Tg(e){let t=w.useContext(dP);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Tg),n}return t}let YF=w.createContext(null);function SCe(e){let t=sf("VirtualProvider"),{options:n}=t.virtual,[r,o]=w.useMemo(()=>{let c=t.optionsElement;if(!c)return[0,0];let u=window.getComputedStyle(c);return[parseFloat(u.paddingBlockStart||u.paddingTop),parseFloat(u.paddingBlockEnd||u.paddingBottom)]},[t.optionsElement]),i=Uwe({enabled:n.length!==0,scrollPaddingStart:r,scrollPaddingEnd:o,count:n.length,estimateSize(){return 40},getScrollElement(){return t.optionsElement},overscan:12}),[s,a]=w.useState(0);nn(()=>{a(c=>c+1)},[n]);let l=i.getVirtualItems();return l.length===0?null:w.createElement(YF.Provider,{value:i},w.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:c=>{c&&t.activationTrigger!==0&&t.activeOptionIndex!==null&&n.length>t.activeOptionIndex&&i.scrollToIndex(t.activeOptionIndex)}},l.map(c=>{var u;return w.createElement(w.Fragment,{key:c.key},w.cloneElement((u=e.children)==null?void 0:u.call(e,{...e.slot,option:n[c.index]}),{key:`${s}-${c.key}`,"data-index":c.index,"aria-setsize":n.length,"aria-posinset":c.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${c.start}px)`,overflowAnchor:"none"}}))})))}let fp=w.createContext(null);fp.displayName="ComboboxDataContext";function sf(e){let t=w.useContext(fp);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,sf),n}return t}function CCe(e,t){return Ei(t.type,wCe,e,t)}let _Ce=w.Fragment;function ECe(e,t){var n,r;let o=tP(),{value:i,defaultValue:s,onChange:a,form:l,name:c,by:u,disabled:d=o||!1,onClose:f,__demoMode:p=!1,multiple:m=!1,immediate:v=!1,virtual:y=null,nullable:b,...x}=e,E=hwe(s),[R=m?[]:void 0,P]=fwe(i,a,E),[O,A]=w.useReducer(CCe,{dataRef:w.createRef(),comboboxState:p?0:1,isTyping:!1,options:[],virtual:y?{options:y.options,disabled:(n=y.disabled)!=null?n:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:p}),D=w.useRef(!1),I=w.useRef({static:!1,hold:!1}),L=qwe(u),j=Ze(fe=>y?u===null?y.options.indexOf(fe):y.options.findIndex(Se=>L(Se,fe)):O.options.findIndex(Se=>L(Se.dataRef.current.value,fe))),z=w.useCallback(fe=>Ei(H.mode,{1:()=>R.some(Se=>L(Se,fe)),0:()=>L(R,fe)}),[R]),K=Ze(fe=>O.activeOptionIndex===j(fe)),H=w.useMemo(()=>({...O,immediate:v,optionsPropsRef:I,value:R,defaultValue:E,disabled:d,mode:m?1:0,virtual:y?O.virtual:null,get activeOptionIndex(){if(D.current&&O.activeOptionIndex===null&&(y?y.options.length>0:O.options.length>0)){if(y){let Se=y.options.findIndex(Ae=>{var ze,Ie;return!((Ie=(ze=y.disabled)==null?void 0:ze.call(y,Ae))!=null&&Ie)});if(Se!==-1)return Se}let fe=O.options.findIndex(Se=>!Se.dataRef.current.disabled);if(fe!==-1)return fe}return O.activeOptionIndex},calculateIndex:j,compare:L,isSelected:z,isActive:K}),[R,E,d,m,p,O,y]);nn(()=>{var fe;y&&A({type:7,options:y.options,disabled:(fe=y.disabled)!=null?fe:null})},[y,y==null?void 0:y.options,y==null?void 0:y.disabled]),nn(()=>{O.dataRef.current=H},[H]);let k=H.comboboxState===0;aSe(k,[H.buttonElement,H.inputElement,H.optionsElement],()=>Z.closeCombobox());let W=w.useMemo(()=>{var fe,Se,Ae;return{open:H.comboboxState===0,disabled:d,activeIndex:H.activeOptionIndex,activeOption:H.activeOptionIndex===null?null:H.virtual?H.virtual.options[(fe=H.activeOptionIndex)!=null?fe:0]:(Ae=(Se=H.options[H.activeOptionIndex])==null?void 0:Se.dataRef.current.value)!=null?Ae:null,value:R}},[H,d,R]),B=Ze(()=>{if(H.activeOptionIndex!==null){if(Z.setIsTyping(!1),H.virtual)M(H.virtual.options[H.activeOptionIndex]);else{let{dataRef:fe}=H.options[H.activeOptionIndex];M(fe.current.value)}Z.goToOption(Kn.Specific,H.activeOptionIndex)}}),U=Ze(()=>{A({type:0}),D.current=!0}),q=Ze(()=>{A({type:1}),D.current=!1,f==null||f()}),$=Ze(fe=>{A({type:3,isTyping:fe})}),Y=Ze((fe,Se,Ae)=>(D.current=!1,fe===Kn.Specific?A({type:2,focus:Kn.Specific,idx:Se,trigger:Ae}):A({type:2,focus:fe,trigger:Ae}))),X=Ze((fe,Se)=>(A({type:4,payload:{id:fe,dataRef:Se}}),()=>{H.isActive(Se.current.value)&&(D.current=!0),A({type:5,id:fe})})),M=Ze(fe=>Ei(H.mode,{0(){return P==null?void 0:P(fe)},1(){let Se=H.value.slice(),Ae=Se.findIndex(ze=>L(ze,fe));return Ae===-1?Se.push(fe):Se.splice(Ae,1),P==null?void 0:P(Se)}})),oe=Ze(fe=>{A({type:6,trigger:fe})}),te=Ze(fe=>{A({type:8,element:fe})}),ie=Ze(fe=>{A({type:9,element:fe})}),ne=Ze(fe=>{A({type:10,element:fe})}),Z=w.useMemo(()=>({onChange:M,registerOption:X,goToOption:Y,setIsTyping:$,closeCombobox:q,openCombobox:U,setActivationTrigger:oe,selectActiveOption:B,setInputElement:te,setButtonElement:ie,setOptionsElement:ne}),[]),[ae,ce]=Owe(),ve=t===null?{}:{ref:t},ee=w.useCallback(()=>{if(E!==void 0)return P==null?void 0:P(E)},[P,E]),ge=ko();return w.createElement(ce,{value:ae,props:{htmlFor:(r=H.inputElement)==null?void 0:r.id},slot:{open:H.comboboxState===0,disabled:d}},w.createElement(ZSe,null,w.createElement(dP.Provider,{value:Z},w.createElement(fp.Provider,{value:H},w.createElement(UF,{value:Ei(H.comboboxState,{0:Ci.Open,1:Ci.Closed})},c!=null&&w.createElement(bwe,{disabled:d,data:R!=null?{[c]:R}:{},form:l,onReset:ee}),ge({ourProps:ve,theirProps:x,slot:W,defaultTag:_Ce,name:"Combobox"}))))))}let RCe="input";function PCe(e,t){var n,r,o,i,s;let a=sf("Combobox.Input"),l=Tg("Combobox.Input"),c=w.useId(),u=AF(),{id:d=u||`headlessui-combobox-input-${c}`,onChange:f,displayValue:p,disabled:m=a.disabled||!1,autoFocus:v=!1,type:y="text",...b}=e,x=w.useRef(null),E=Ti(x,t,KSe(),l.setInputElement),R=Ay(a.inputElement),P=of(),O=Ze(()=>{l.onChange(null),a.optionsElement&&(a.optionsElement.scrollTop=0),l.goToOption(Kn.Nothing)}),A=w.useMemo(()=>{var M;return typeof p=="function"&&a.value!==void 0?(M=p(a.value))!=null?M:"":typeof a.value=="string"?a.value:""},[a.value,p]);uN(([M,oe],[te,ie])=>{if(a.isTyping)return;let ne=x.current;ne&&((ie===0&&oe===1||M!==te)&&(ne.value=M),requestAnimationFrame(()=>{if(a.isTyping||!ne||(R==null?void 0:R.activeElement)!==ne)return;let{selectionStart:Z,selectionEnd:ae}=ne;Math.abs((ae??0)-(Z??0))===0&&Z===0&&ne.setSelectionRange(ne.value.length,ne.value.length)}))},[A,a.comboboxState,R,a.isTyping]),uN(([M],[oe])=>{if(M===0&&oe===1){if(a.isTyping)return;let te=x.current;if(!te)return;let ie=te.value,{selectionStart:ne,selectionEnd:Z,selectionDirection:ae}=te;te.value="",te.value=ie,ae!==null?te.setSelectionRange(ne,Z,ae):te.setSelectionRange(ne,Z)}},[a.comboboxState]);let D=w.useRef(!1),I=Ze(()=>{D.current=!0}),L=Ze(()=>{P.nextFrame(()=>{D.current=!1})}),j=Ze(M=>{switch(l.setIsTyping(!0),M.key){case Ir.Enter:if(a.comboboxState!==0||D.current)return;if(M.preventDefault(),M.stopPropagation(),a.activeOptionIndex===null){l.closeCombobox();return}l.selectActiveOption(),a.mode===0&&l.closeCombobox();break;case Ir.ArrowDown:return M.preventDefault(),M.stopPropagation(),Ei(a.comboboxState,{0:()=>l.goToOption(Kn.Next),1:()=>l.openCombobox()});case Ir.ArrowUp:return M.preventDefault(),M.stopPropagation(),Ei(a.comboboxState,{0:()=>l.goToOption(Kn.Previous),1:()=>{Pn.flushSync(()=>l.openCombobox()),a.value||l.goToOption(Kn.Last)}});case Ir.Home:if(M.shiftKey)break;return M.preventDefault(),M.stopPropagation(),l.goToOption(Kn.First);case Ir.PageUp:return M.preventDefault(),M.stopPropagation(),l.goToOption(Kn.First);case Ir.End:if(M.shiftKey)break;return M.preventDefault(),M.stopPropagation(),l.goToOption(Kn.Last);case Ir.PageDown:return M.preventDefault(),M.stopPropagation(),l.goToOption(Kn.Last);case Ir.Escape:return a.comboboxState!==0?void 0:(M.preventDefault(),a.optionsElement&&!a.optionsPropsRef.current.static&&M.stopPropagation(),a.mode===0&&a.value===null&&O(),l.closeCombobox());case Ir.Tab:if(a.comboboxState!==0)return;a.mode===0&&a.activationTrigger!==1&&l.selectActiveOption(),l.closeCombobox();break}}),z=Ze(M=>{f==null||f(M),a.mode===0&&M.target.value===""&&O(),l.openCombobox()}),K=Ze(M=>{var oe,te,ie;let ne=(oe=M.relatedTarget)!=null?oe:Ul.find(Z=>Z!==M.currentTarget);if(!((te=a.optionsElement)!=null&&te.contains(ne))&&!((ie=a.buttonElement)!=null&&ie.contains(ne))&&a.comboboxState===0)return M.preventDefault(),a.mode===0&&a.value===null&&O(),l.closeCombobox()}),H=Ze(M=>{var oe,te,ie;let ne=(oe=M.relatedTarget)!=null?oe:Ul.find(Z=>Z!==M.currentTarget);(te=a.buttonElement)!=null&&te.contains(ne)||(ie=a.optionsElement)!=null&&ie.contains(ne)||a.disabled||a.immediate&&a.comboboxState!==0&&P.microTask(()=>{Pn.flushSync(()=>l.openCombobox()),l.setActivationTrigger(1)})}),k=Oy(),W=_we(),{isFocused:B,focusProps:U}=SF({autoFocus:v}),{isHovered:q,hoverProps:$}=wF({isDisabled:m}),Y=w.useMemo(()=>({open:a.comboboxState===0,disabled:m,hover:q,focus:B,autofocus:v}),[a,q,B,v,m]),X=nP({ref:E,id:d,role:"combobox",type:y,"aria-controls":(n=a.optionsElement)==null?void 0:n.id,"aria-expanded":a.comboboxState===0,"aria-activedescendant":a.activeOptionIndex===null?void 0:a.virtual?(r=a.options.find(M=>!M.dataRef.current.disabled&&a.compare(M.dataRef.current.value,a.virtual.options[a.activeOptionIndex])))==null?void 0:r.id:(o=a.options[a.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":k,"aria-describedby":W,"aria-autocomplete":"list",defaultValue:(s=(i=e.defaultValue)!=null?i:a.defaultValue!==void 0?p==null?void 0:p(a.defaultValue):null)!=null?s:a.defaultValue,disabled:m||void 0,autoFocus:v,onCompositionStart:I,onCompositionEnd:L,onKeyDown:j,onChange:z,onFocus:H,onBlur:K},U,$);return ko()({ourProps:X,theirProps:b,slot:Y,defaultTag:RCe,name:"Combobox.Input"})}let OCe="button";function ACe(e,t){var n;let r=sf("Combobox.Button"),o=Tg("Combobox.Button"),i=Ti(t,o.setButtonElement),s=w.useId(),{id:a=`headlessui-combobox-button-${s}`,disabled:l=r.disabled||!1,autoFocus:c=!1,...u}=e,d=jF(r.inputElement),f=Ze(A=>{switch(A.key){case Ir.Space:case Ir.Enter:A.preventDefault(),A.stopPropagation(),r.comboboxState===1&&Pn.flushSync(()=>o.openCombobox()),d();return;case Ir.ArrowDown:A.preventDefault(),A.stopPropagation(),r.comboboxState===1&&(Pn.flushSync(()=>o.openCombobox()),r.value||o.goToOption(Kn.First)),d();return;case Ir.ArrowUp:A.preventDefault(),A.stopPropagation(),r.comboboxState===1&&(Pn.flushSync(()=>o.openCombobox()),r.value||o.goToOption(Kn.Last)),d();return;case Ir.Escape:if(r.comboboxState!==0)return;A.preventDefault(),r.optionsElement&&!r.optionsPropsRef.current.static&&A.stopPropagation(),Pn.flushSync(()=>o.closeCombobox()),d();return;default:return}}),p=Ze(A=>{A.preventDefault(),!wwe(A.currentTarget)&&(A.button===cP.Left&&(r.comboboxState===0?o.closeCombobox():o.openCombobox()),d())}),m=Oy([a]),{isFocusVisible:v,focusProps:y}=SF({autoFocus:c}),{isHovered:b,hoverProps:x}=wF({isDisabled:l}),{pressed:E,pressProps:R}=swe({disabled:l}),P=w.useMemo(()=>({open:r.comboboxState===0,active:E||r.comboboxState===0,disabled:l,value:r.value,hover:b,focus:v}),[r,b,v,E,l]),O=nP({ref:i,id:a,type:cSe(e,r.buttonElement),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(n=r.optionsElement)==null?void 0:n.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":m,disabled:l||void 0,autoFocus:c,onMouseDown:p,onKeyDown:f},y,x,R);return ko()({ourProps:O,theirProps:u,slot:P,defaultTag:OCe,name:"Combobox.Button"})}let TCe="div",DCe=o0.RenderStrategy|o0.Static;function MCe(e,t){var n,r,o;let i=w.useId(),{id:s=`headlessui-combobox-options-${i}`,hold:a=!1,anchor:l,portal:c=!1,modal:u=!0,transition:d=!1,...f}=e,p=sf("Combobox.Options"),m=Tg("Combobox.Options"),v=YSe(l);v&&(c=!0);let[y,b]=QSe(v),[x,E]=w.useState(null),R=XSe(),P=Ti(t,v?y:null,m.setOptionsElement,E),O=Ay(p.optionsElement),A=lP(),[D,I]=BF(d,x,A!==null?(A&Ci.Open)===Ci.Open:p.comboboxState===0);Zwe(D,p.inputElement,m.closeCombobox);let L=p.__demoMode?!1:u&&p.comboboxState===0;gSe(L,O);let j=p.__demoMode?!1:u&&p.comboboxState===0;Qwe(j,{allowed:w.useCallback(()=>[p.inputElement,p.buttonElement,p.optionsElement],[p.inputElement,p.buttonElement,p.optionsElement])}),nn(()=>{var X;p.optionsPropsRef.current.static=(X=e.static)!=null?X:!1},[p.optionsPropsRef,e.static]),nn(()=>{p.optionsPropsRef.current.hold=a},[p.optionsPropsRef,a]),SSe(p.comboboxState===0,{container:p.optionsElement,accept(X){return X.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:X.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(X){X.setAttribute("role","none")}});let z=Oy([(n=p.buttonElement)==null?void 0:n.id]),K=w.useMemo(()=>({open:p.comboboxState===0,option:void 0}),[p.comboboxState]),H=Ze(()=>{m.setActivationTrigger(0)}),k=Ze(X=>{X.preventDefault(),m.setActivationTrigger(0)}),W=nP(v?R():{},{"aria-labelledby":z,role:"listbox","aria-multiselectable":p.mode===1?!0:void 0,id:s,ref:P,style:{...f.style,...b,"--input-width":rN(p.inputElement,!0).width,"--button-width":rN(p.buttonElement,!0).width},onWheel:p.activationTrigger===0?void 0:H,onMouseDown:k,...zF(I)}),B=D&&p.comboboxState===1,U=$_(B,(r=p.virtual)==null?void 0:r.options),q=$_(B,p.value),$=Ze(X=>p.compare(q,X));if(p.virtual){if(U===void 0)throw new Error("Missing `options` in virtual mode");Object.assign(f,{children:w.createElement(fp.Provider,{value:U!==p.virtual.options?{...p,virtual:{...p.virtual,options:U}}:p},w.createElement(SCe,{slot:K},f.children))})}let Y=ko();return w.createElement(mCe,{enabled:c?e.static||D:!1},w.createElement(fp.Provider,{value:p.mode===1?p:{...p,isSelected:$}},Y({ourProps:W,theirProps:{...f,children:w.createElement(tCe,{freeze:B},typeof f.children=="function"?(o=f.children)==null?void 0:o.call(f,K):f.children)},slot:K,defaultTag:TCe,features:DCe,visible:D,name:"Combobox.Options"})))}let ICe="div";function $Ce(e,t){var n,r,o,i;let s=sf("Combobox.Option"),a=Tg("Combobox.Option"),l=w.useId(),{id:c=`headlessui-combobox-option-${l}`,value:u,disabled:d=(o=(r=(n=s.virtual)==null?void 0:n.disabled)==null?void 0:r.call(n,u))!=null?o:!1,order:f=null,...p}=e,m=jF(s.inputElement),v=s.virtual?s.activeOptionIndex===s.calculateIndex(u):s.activeOptionIndex===null?!1:((i=s.options[s.activeOptionIndex])==null?void 0:i.id)===c,y=s.isSelected(u),b=w.useRef(null),x=pl({disabled:d,value:u,domRef:b,order:f}),E=w.useContext(YF),R=Ti(t,b,E?E.measureElement:null),P=Ze(()=>{a.setIsTyping(!1),a.onChange(u)});nn(()=>a.registerOption(c,x),[x,c]);let O=w.useRef(!(s.virtual||s.__demoMode));nn(()=>{if(!s.virtual&&!s.__demoMode)return ss().requestAnimationFrame(()=>{O.current=!0})},[s.virtual,s.__demoMode]),nn(()=>{if(O.current&&s.comboboxState===0&&v&&s.activationTrigger!==0)return ss().requestAnimationFrame(()=>{var k,W;(W=(k=b.current)==null?void 0:k.scrollIntoView)==null||W.call(k,{block:"nearest"})})},[b,v,s.comboboxState,s.activationTrigger,s.activeOptionIndex]);let A=Ze(k=>{k.preventDefault(),k.button===cP.Left&&(d||(P(),FF()||requestAnimationFrame(()=>m()),s.mode===0&&a.closeCombobox()))}),D=Ze(()=>{if(d)return a.goToOption(Kn.Nothing);let k=s.calculateIndex(u);a.goToOption(Kn.Specific,k)}),I=mSe(),L=Ze(k=>I.update(k)),j=Ze(k=>{if(!I.wasMoved(k)||d||v)return;let W=s.calculateIndex(u);a.goToOption(Kn.Specific,W,0)}),z=Ze(k=>{I.wasMoved(k)&&(d||v&&(s.optionsPropsRef.current.hold||a.goToOption(Kn.Nothing)))}),K=w.useMemo(()=>({active:v,focus:v,selected:y,disabled:d}),[v,y,d]),H={id:c,ref:R,role:"option",tabIndex:d===!0?void 0:-1,"aria-disabled":d===!0?!0:void 0,"aria-selected":y,disabled:void 0,onMouseDown:A,onFocus:D,onPointerEnter:L,onMouseEnter:L,onPointerMove:j,onMouseMove:j,onPointerLeave:z,onMouseLeave:z};return ko()({ourProps:H,theirProps:p,slot:K,defaultTag:ICe,name:"Combobox.Option"})}let NCe=ao(ECe),kCe=ao(ACe),LCe=ao(PCe),FCe=Mwe,jCe=ao(MCe),zCe=ao($Ce),Qf=Object.assign(NCe,{Input:LCe,Button:kCe,Label:FCe,Options:jCe,Option:zCe});function BCe(){let e=w.useRef(!1);return nn(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function KF(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:QF)!==w.Fragment||w.Children.count(e.children)===1}let Ty=w.createContext(null);Ty.displayName="TransitionContext";var VCe=(e=>(e.Visible="visible",e.Hidden="hidden",e))(VCe||{});function HCe(){let e=w.useContext(Ty);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function WCe(){let e=w.useContext(Dy);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Dy=w.createContext(null);Dy.displayName="NestingContext";function My(e){return"children"in e?My(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function XF(e,t){let n=pl(e),r=w.useRef([]),o=BCe(),i=of(),s=Ze((p,m=Va.Hidden)=>{let v=r.current.findIndex(({el:y})=>y===p);v!==-1&&(Ei(m,{[Va.Unmount](){r.current.splice(v,1)},[Va.Hidden](){r.current[v].state="hidden"}}),i.microTask(()=>{var y;!My(r)&&o.current&&((y=n.current)==null||y.call(n))}))}),a=Ze(p=>{let m=r.current.find(({el:v})=>v===p);return m?m.state!=="visible"&&(m.state="visible"):r.current.push({el:p,state:"visible"}),()=>s(p,Va.Unmount)}),l=w.useRef([]),c=w.useRef(Promise.resolve()),u=w.useRef({enter:[],leave:[]}),d=Ze((p,m,v)=>{l.current.splice(0),t&&(t.chains.current[m]=t.chains.current[m].filter(([y])=>y!==p)),t==null||t.chains.current[m].push([p,new Promise(y=>{l.current.push(y)})]),t==null||t.chains.current[m].push([p,new Promise(y=>{Promise.all(u.current[m].map(([b,x])=>x)).then(()=>y())})]),m==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(m)):v(m)}),f=Ze((p,m,v)=>{Promise.all(u.current[m].splice(0).map(([y,b])=>b)).then(()=>{var y;(y=l.current.shift())==null||y()}).then(()=>v(m))});return w.useMemo(()=>({children:r,register:a,unregister:s,onStart:d,onStop:f,wait:c,chains:u}),[a,s,r,d,f,u,c])}let QF=w.Fragment,ZF=o0.RenderStrategy;function UCe(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:s,beforeLeave:a,afterLeave:l,enter:c,enterFrom:u,enterTo:d,entered:f,leave:p,leaveFrom:m,leaveTo:v,...y}=e,[b,x]=w.useState(null),E=w.useRef(null),R=KF(e),P=Ti(...R?[E,t,x]:t===null?[]:[t]),O=(n=y.unmount)==null||n?Va.Unmount:Va.Hidden,{show:A,appear:D,initial:I}=HCe(),[L,j]=w.useState(A?"visible":"hidden"),z=WCe(),{register:K,unregister:H}=z;nn(()=>K(E),[K,E]),nn(()=>{if(O===Va.Hidden&&E.current){if(A&&L!=="visible"){j("visible");return}return Ei(L,{hidden:()=>H(E),visible:()=>K(E)})}},[L,E,K,H,A,O]);let k=uP();nn(()=>{if(R&&k&&L==="visible"&&E.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[E,L,k,R]);let W=I&&!D,B=D&&A&&I,U=w.useRef(!1),q=XF(()=>{U.current||(j("hidden"),H(E))},z),$=Ze(ne=>{U.current=!0;let Z=ne?"enter":"leave";q.onStart(E,Z,ae=>{ae==="enter"?i==null||i():ae==="leave"&&(a==null||a())})}),Y=Ze(ne=>{let Z=ne?"enter":"leave";U.current=!1,q.onStop(E,Z,ae=>{ae==="enter"?s==null||s():ae==="leave"&&(l==null||l())}),Z==="leave"&&!My(q)&&(j("hidden"),H(E))});w.useEffect(()=>{R&&o||($(A),Y(A))},[A,R,o]);let X=!(!o||!R||!k||W),[,M]=BF(X,b,A,{start:$,end:Y}),oe=Ra({ref:P,className:((r=T_(y.className,B&&c,B&&u,M.enter&&c,M.enter&&M.closed&&u,M.enter&&!M.closed&&d,M.leave&&p,M.leave&&!M.closed&&m,M.leave&&M.closed&&v,!M.transition&&A&&f))==null?void 0:r.trim())||void 0,...zF(M)}),te=0;L==="visible"&&(te|=Ci.Open),L==="hidden"&&(te|=Ci.Closed),M.enter&&(te|=Ci.Opening),M.leave&&(te|=Ci.Closing);let ie=ko();return w.createElement(Dy.Provider,{value:q},w.createElement(UF,{value:te},ie({ourProps:oe,theirProps:y,defaultTag:QF,features:ZF,visible:L==="visible",name:"Transition.Child"})))}function GCe(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=w.useRef(null),a=KF(e),l=Ti(...a?[s,t]:t===null?[]:[t]);uP();let c=lP();if(n===void 0&&c!==null&&(n=(c&Ci.Open)===Ci.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=w.useState(n?"visible":"hidden"),f=XF(()=>{n||d("hidden")}),[p,m]=w.useState(!0),v=w.useRef([n]);nn(()=>{p!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),m(!1))},[v,n]);let y=w.useMemo(()=>({show:n,appear:r,initial:p}),[n,r,p]);nn(()=>{n?d("visible"):!My(f)&&s.current!==null&&d("hidden")},[n,f]);let b={unmount:o},x=Ze(()=>{var P;p&&m(!1),(P=e.beforeEnter)==null||P.call(e)}),E=Ze(()=>{var P;p&&m(!1),(P=e.beforeLeave)==null||P.call(e)}),R=ko();return w.createElement(Dy.Provider,{value:f},w.createElement(Ty.Provider,{value:y},R({ourProps:{...b,as:w.Fragment,children:w.createElement(JF,{ref:l,...b,...i,beforeEnter:x,beforeLeave:E})},theirProps:{},defaultTag:w.Fragment,features:ZF,visible:u==="visible",name:"Transition"})))}function qCe(e,t){let n=w.useContext(Ty)!==null,r=lP()!==null;return w.createElement(w.Fragment,null,!n&&r?w.createElement(N_,{ref:t,...e}):w.createElement(JF,{ref:t,...e}))}let N_=ao(GCe),JF=ao(UCe),YCe=ao(qCe),KCe=Object.assign(N_,{Child:YCe,Root:N_});function XCe(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 QCe(e,t,n){const r=`SELECT ${n}, COUNT(*) FROM ${t} {{ filters | where }} GROUP BY ${n} ORDER BY ${n} ASC LIMIT 50`,o=`SELECT min(${n}) as min, max(${n}) as max FROM ${t} {{ filters | where }}`;return Ud.includes(e)?o:r}function ej(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}const tj="Checkbox",[ZCe,_3e]=ls(tj),[JCe,e_e]=ZCe(tj),t_e=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[d,f]=w.useState(null),p=so(t,E=>f(E)),m=w.useRef(!1),v=d?!!d.closest("form"):!0,[y=!1,b]=cs({prop:o,defaultProp:i,onChange:c}),x=w.useRef(y);return w.useEffect(()=>{const E=d==null?void 0:d.form;if(E){const R=()=>b(x.current);return E.addEventListener("reset",R),()=>E.removeEventListener("reset",R)}},[d,b]),w.createElement(JCe,{scope:n,state:y,disabled:a},w.createElement(On.button,He({type:"button",role:"checkbox","aria-checked":Sc(y)?"mixed":y,"aria-required":s,"data-state":nj(y),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:p,onKeyDown:Ft(e.onKeyDown,E=>{E.key==="Enter"&&E.preventDefault()}),onClick:Ft(e.onClick,E=>{b(R=>Sc(R)?!0:!R),v&&(m.current=E.isPropagationStopped(),m.current||E.stopPropagation())})})),v&&w.createElement(o_e,{control:d,bubbles:!m.current,name:r,value:l,checked:y,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),n_e="CheckboxIndicator",r_e=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=e_e(n_e,n);return w.createElement(qd,{present:r||Sc(i.state)||i.state===!0},w.createElement(On.span,He({"data-state":nj(i.state),"data-disabled":i.disabled?"":void 0},o,{ref:t,style:{pointerEvents:"none",...e.style}})))}),o_e=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=w.useRef(null),s=ej(n),a=t2(t);return w.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const f=new Event("click",{bubbles:r});l.indeterminate=Sc(n),d.call(l,Sc(n)?!1:n),l.dispatchEvent(f)}},[s,n,r]),w.createElement("input",He({type:"checkbox","aria-hidden":!0,defaultChecked:Sc(n)?!1:n},o,{tabIndex:-1,ref:i,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function Sc(e){return e==="indeterminate"}function nj(e){return Sc(e)?"indeterminate":e?"checked":"unchecked"}const rj=t_e,i_e=r_e,Iy=S.forwardRef(({className:e,...t},n)=>C.jsx(rj,{ref:n,className:xe("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:C.jsx(i_e,{className:xe("flex items-center justify-center text-current"),children:C.jsx(rg,{className:"h-4 w-4"})})}));Iy.displayName=rj.displayName;function s_e({filter:e}){const[t,n]=w.useState([]),[r,o]=w.useState(""),[i,s]=w.useState(""),a=w.useRef(null);No();const l=we(D=>D.filterValues),c=we(D=>D.selectedSheetId),u=we(D=>D.actions.addOrUpdateFilterValue),d=we(D=>D.actions.removeFilterValue),{data:f,isLoading:p,isFetching:m,isError:v,refetch:y}=fF(e),b=w.useMemo(()=>{var D;return(D=f==null?void 0:f.records)==null?void 0:D.map(I=>{let L=e.column.split(".").slice(-1)[0].replace(/"/g,"");return I[L]===void 0&&(L=L.toLowerCase()),{id:I[L],value:I[L]}})},[f,e.column]);w.useEffect(()=>{if(l){const D=l.find(I=>I.filterId===e.id);if(!D){n([]);return}if(D.operation==="in"){const I=b==null?void 0:b.filter(L=>D.values.includes(L.value));I&&n(I)}else o(`${D.operation} ${D.values[0]}`)}},[f,c,l]),w.useEffect(()=>{if(l&&!l.find(I=>I.filterId===e.id)){n([]);return}},[l,e.id]);function x(D){const I=XCe(D[0].toString());if(!(I!=null&&I.value)||!(I!=null&&I.operation))return;const L={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Wu(e),name:e.column,operation:I.operation,values:[Number(I.value)]};u(L)}function E(D){if(Array.isArray(D)||(D=[D]),console.log("onComboBoxChange",D),D.length===1&&b.find(L=>L.value===D[0].value)===void 0){x(D);return}if(n(D),D.length===0){d(e.id);return}const I={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Wu(e),operation:e.operation,values:D.map(L=>L.value)};u(I)}function R(D){if(D){n(b);const I={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Wu(e),operation:e.operation,values:b.map(L=>L.value)};u(I)}else n([]),d(e.id)}const P=t.length===(b==null?void 0:b.length);if(p)return C.jsx("div",{children:C.jsx(Gu,{className:"h-8 w-full bg-foreground/10"})});if(v)return C.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"});let O=[];Xp.includes(e.dataType)?O=b:O=i===""?b:b==null?void 0:b.filter(D=>D.value.toLowerCase().replace(/\s+/g,"").includes(i.toLowerCase().replace(/\s+/g,"")));const A=e.type==="single";return C.jsx("div",{className:"w-full",children:C.jsx(Qf,{value:t,multiple:!A,onChange:E,children:C.jsxs("div",{className:"relative",children:[C.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:[C.jsx(Qf.Input,{className:"flex h-8 w-full rounded border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",displayValue:D=>D.map(L=>L.value).join(", ")||r,onChange:D=>{o(D.target.value),s(D.target.value)}}),C.jsx(Qf.Button,{ref:a,className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:C.jsx(zre,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),C.jsx(KCe,{as:w.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>s(""),children:C.jsxs(Qf.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:[e.type==="multiple"||e.type===void 0&&C.jsxs("div",{className:"flex items-center justify-between gap-2 border-b px-4 py-2",children:[C.jsx("span",{children:"Select All"}),C.jsx(Iy,{checked:P,onCheckedChange:R})]}),(O==null?void 0:O.length)===0&&i!==""?C.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):O==null?void 0:O.map(D=>C.jsx(Qf.Option,{className:({active:I})=>`relative cursor-default select-none border-b border-muted py-2 pl-10 pr-4 ${I?"bg-muted":"text-foreground-900"}`,value:D,children:({selected:I,active:L})=>C.jsxs("div",{className:"",children:[C.jsx("span",{className:`block ${I?"font-medium":"font-normal"}`,children:typeof D.value=="boolean"?D.value?"True":"False":D.value}),I?C.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:C.jsx(h4,{className:"h-5 w-5","aria-hidden":"true"})}):null]})},D.value))]})})]})})})}const fP=S.forwardRef(({className:e,...t},n)=>C.jsx("textarea",{className:xe("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}));fP.displayName="Textarea";function Gs(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 yN(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function oj(...e){return t=>{let n=!1;const r=e.map(o=>{const i=yN(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():yN(e[o],null)}}}}function zd(...e){return S.useCallback(oj(...e),e)}function $y(e,t=[]){let n=[];function r(i,s){const a=S.createContext(s),l=n.length;n=[...n,s];const c=d=>{var b;const{scope:f,children:p,...m}=d,v=((b=f==null?void 0:f[e])==null?void 0:b[l])||a,y=S.useMemo(()=>m,Object.values(m));return C.jsx(v.Provider,{value:y,children:p})};c.displayName=i+"Provider";function u(d,f){var v;const p=((v=f==null?void 0:f[e])==null?void 0:v[l])||a,m=S.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>S.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,a_e(o,...t)]}function a_e(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var i0=S.forwardRef((e,t)=>{const{children:n,...r}=e,o=S.Children.toArray(n),i=o.find(c_e);if(i){const s=i.props.children,a=o.map(l=>l===i?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:l);return C.jsx(k_,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return C.jsx(k_,{...r,ref:t,children:n})});i0.displayName="Slot";var k_=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const o=d_e(n);return S.cloneElement(n,{...u_e(r,n.props),ref:t?oj(t,o):o})}return S.Children.count(n)>1?S.Children.only(null):null});k_.displayName="SlotClone";var l_e=({children:e})=>C.jsx(C.Fragment,{children:e});function c_e(e){return S.isValidElement(e)&&e.type===l_e}function u_e(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 d_e(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var f_e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Dg=f_e.reduce((e,t)=>{const n=S.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?i0:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function h_e(e){const t=e+"CollectionProvider",[n,r]=$y(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:m,children:v}=p,y=w.useRef(null),b=w.useRef(new Map).current;return C.jsx(o,{scope:m,itemMap:b,collectionRef:y,children:v})};s.displayName=t;const a=e+"CollectionSlot",l=w.forwardRef((p,m)=>{const{scope:v,children:y}=p,b=i(a,v),x=zd(m,b.collectionRef);return C.jsx(i0,{ref:x,children:y})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=w.forwardRef((p,m)=>{const{scope:v,children:y,...b}=p,x=w.useRef(null),E=zd(m,x),R=i(c,v);return w.useEffect(()=>(R.itemMap.set(x,{ref:x,...b}),()=>void R.itemMap.delete(x))),C.jsx(i0,{[u]:"",ref:E,children:y})});d.displayName=c;function f(p){const m=i(e+"CollectionConsumer",p);return w.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((R,P)=>b.indexOf(R.ref.current)-b.indexOf(P.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},f,r]}var s0=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},p_e=S.useId||(()=>{}),g_e=0;function m_e(e){const[t,n]=S.useState(p_e());return s0(()=>{e||n(r=>r??String(g_e++))},[e]),e||(t?`radix-${t}`:"")}function hP(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function ij({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=v_e({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=hP(n),l=S.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function v_e({defaultProp:e,onChange:t}){const n=S.useState(e),[r]=n,o=S.useRef(r),i=hP(t);return S.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var b_e=S.createContext(void 0);function sj(e){const t=S.useContext(b_e);return e||t||"ltr"}var Fw="rovingFocusGroup.onEntryFocus",y_e={bubbles:!1,cancelable:!0},Ny="RovingFocusGroup",[L_,aj,x_e]=h_e(Ny),[w_e,lj]=$y(Ny,[x_e]),[S_e,C_e]=w_e(Ny),cj=S.forwardRef((e,t)=>C.jsx(L_.Provider,{scope:e.__scopeRovingFocusGroup,children:C.jsx(L_.Slot,{scope:e.__scopeRovingFocusGroup,children:C.jsx(__e,{...e,ref:t})})}));cj.displayName=Ny;var __e=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=S.useRef(null),p=zd(t,f),m=sj(i),[v=null,y]=ij({prop:s,defaultProp:a,onChange:l}),[b,x]=S.useState(!1),E=hP(c),R=aj(n),P=S.useRef(!1),[O,A]=S.useState(0);return S.useEffect(()=>{const D=f.current;if(D)return D.addEventListener(Fw,E),()=>D.removeEventListener(Fw,E)},[E]),C.jsx(S_e,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:v,onItemFocus:S.useCallback(D=>y(D),[y]),onItemShiftTab:S.useCallback(()=>x(!0),[]),onFocusableItemAdd:S.useCallback(()=>A(D=>D+1),[]),onFocusableItemRemove:S.useCallback(()=>A(D=>D-1),[]),children:C.jsx(Dg.div,{tabIndex:b||O===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:Gs(e.onMouseDown,()=>{P.current=!0}),onFocus:Gs(e.onFocus,D=>{const I=!P.current;if(D.target===D.currentTarget&&I&&!b){const L=new CustomEvent(Fw,y_e);if(D.currentTarget.dispatchEvent(L),!L.defaultPrevented){const j=R().filter(W=>W.focusable),z=j.find(W=>W.active),K=j.find(W=>W.id===v),k=[z,K,...j].filter(Boolean).map(W=>W.ref.current);fj(k,u)}}P.current=!1}),onBlur:Gs(e.onBlur,()=>x(!1))})})}),uj="RovingFocusGroupItem",dj=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=m_e(),l=i||a,c=C_e(uj,n),u=c.currentTabStopId===l,d=aj(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=c;return S.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),C.jsx(L_.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:C.jsx(Dg.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:Gs(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:Gs(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Gs(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=P_e(m,c.orientation,c.dir);if(v!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let b=d().filter(x=>x.focusable).map(x=>x.ref.current);if(v==="last")b.reverse();else if(v==="prev"||v==="next"){v==="prev"&&b.reverse();const x=b.indexOf(m.currentTarget);b=c.loop?O_e(b,x+1):b.slice(x+1)}setTimeout(()=>fj(b))}})})})});dj.displayName=uj;var E_e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function R_e(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function P_e(e,t,n){const r=R_e(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return E_e[r]}function fj(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function O_e(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var A_e=cj,T_e=dj;function D_e(e){const[t,n]=S.useState(void 0);return s0(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function M_e(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function I_e(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var hj=e=>{const{present:t,children:n}=e,r=$_e(t),o=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),i=zd(r.ref,N_e(o));return typeof n=="function"||r.isPresent?S.cloneElement(o,{ref:i}):null};hj.displayName="Presence";function $_e(e){const[t,n]=S.useState(),r=S.useRef({}),o=S.useRef(e),i=S.useRef("none"),s=e?"mounted":"unmounted",[a,l]=I_e(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=Rv(r.current);i.current=a==="mounted"?c:"none"},[a]),s0(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,p=Rv(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),s0(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=p=>{const v=Rv(r.current).includes(p.animationName);if(p.target===t&&v&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=p=>{p.target===t&&(i.current=Rv(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:S.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Rv(e){return(e==null?void 0:e.animationName)||"none"}function N_e(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pP="Radio",[k_e,pj]=$y(pP),[L_e,F_e]=k_e(pP),gj=S.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:o=!1,required:i,disabled:s,value:a="on",onCheck:l,form:c,...u}=e,[d,f]=S.useState(null),p=zd(t,y=>f(y)),m=S.useRef(!1),v=d?c||!!d.closest("form"):!0;return C.jsxs(L_e,{scope:n,checked:o,disabled:s,children:[C.jsx(Dg.button,{type:"button",role:"radio","aria-checked":o,"data-state":bj(o),"data-disabled":s?"":void 0,disabled:s,value:a,...u,ref:p,onClick:Gs(e.onClick,y=>{o||l==null||l(),v&&(m.current=y.isPropagationStopped(),m.current||y.stopPropagation())})}),v&&C.jsx(j_e,{control:d,bubbles:!m.current,name:r,value:a,checked:o,required:i,disabled:s,form:c,style:{transform:"translateX(-100%)"}})]})});gj.displayName=pP;var mj="RadioIndicator",vj=S.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=F_e(mj,n);return C.jsx(hj,{present:r||i.checked,children:C.jsx(Dg.span,{"data-state":bj(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});vj.displayName=mj;var j_e=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=S.useRef(null),s=M_e(n),a=D_e(t);return S.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[s,n,r]),C.jsx("input",{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 bj(e){return e?"checked":"unchecked"}var z_e=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],gP="RadioGroup",[B_e,E3e]=$y(gP,[lj,pj]),yj=lj(),xj=pj(),[V_e,H_e]=B_e(gP),wj=S.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:o,value:i,required:s=!1,disabled:a=!1,orientation:l,dir:c,loop:u=!0,onValueChange:d,...f}=e,p=yj(n),m=sj(c),[v,y]=ij({prop:i,defaultProp:o,onChange:d});return C.jsx(V_e,{scope:n,name:r,required:s,disabled:a,value:v,onValueChange:y,children:C.jsx(A_e,{asChild:!0,...p,orientation:l,dir:m,loop:u,children:C.jsx(Dg.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:m,...f,ref:t})})})});wj.displayName=gP;var Sj="RadioGroupItem",Cj=S.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=H_e(Sj,n),s=i.disabled||r,a=yj(n),l=xj(n),c=S.useRef(null),u=zd(t,c),d=i.value===o.value,f=S.useRef(!1);return S.useEffect(()=>{const p=v=>{z_e.includes(v.key)&&(f.current=!0)},m=()=>f.current=!1;return document.addEventListener("keydown",p),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",p),document.removeEventListener("keyup",m)}},[]),C.jsx(T_e,{asChild:!0,...a,focusable:!s,active:d,children:C.jsx(gj,{disabled:s,required:i.required,checked:d,...l,...o,name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:Gs(p=>{p.key==="Enter"&&p.preventDefault()}),onFocus:Gs(o.onFocus,()=>{var p;f.current&&((p=c.current)==null||p.click())})})})});Cj.displayName=Sj;var W_e="RadioGroupIndicator",_j=S.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=xj(n);return C.jsx(vj,{...o,...r,ref:t})});_j.displayName=W_e;var Ej=wj,Rj=Cj,U_e=_j;const mP=S.forwardRef(({className:e,...t},n)=>C.jsx(Ej,{className:xe("grid gap-2",e),...t,ref:n}));mP.displayName=Ej.displayName;const a0=S.forwardRef(({className:e,...t},n)=>C.jsx(Rj,{ref:n,className:xe("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:C.jsx(U_e,{className:"flex items-center justify-center",children:C.jsx(uR,{className:"h-2.5 w-2.5 fill-current text-current"})})}));a0.displayName=Rj.displayName;function G_e({label:e,onCheckedChange:t,checked:n}){return C.jsxs("div",{className:"flex items-center space-x-2",children:[C.jsx(Iy,{onCheckedChange:t,id:"terms",checked:n}),C.jsx("label",{htmlFor:"terms",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function q_e({filter:e}){const[t,n]=w.useState(e.sql),[r,o]=w.useState(!1),i=we(d=>d.selectedSheetId),{updateFilter:s}=fr();function a(){const d={...e,sql:t};s(d),o(!1)}function l(d){console.log("operation",d);const f={...e,operation:d};s(f)}function c(d){const f={...e,type:d};s(f)}function u(d){if(!i)return;const f={...e,sheetId:d?i:void 0};s(f)}return C.jsxs(wy,{open:r,onOpenChange:o,children:[C.jsx(Sy,{children:C.jsx(hR,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),C.jsxs(yg,{onMouseDown:d=>d.stopPropagation(),onDoubleClick:d=>d.stopPropagation(),className:"z-50 m-2 w-full min-w-[350px] space-y-4",children:[C.jsxs("div",{className:"space-y-2",children:[C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx("h4",{className:"font-medium leading-none",children:"Customize Filter"}),C.jsx("p",{className:"rounded-md bg-muted px-2 py-1 text-xs text-muted-foreground",children:e.column})]}),C.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize the filter operation and SQL"})]}),C.jsx(gg,{}),C.jsxs("div",{className:"space-y-2",children:[C.jsx(Dn,{children:"Type"}),C.jsxs(mP,{onValueChange:c,value:e.type||"multiple",className:"flex gap-3",defaultValue:"x",children:[C.jsxs("div",{className:"flex items-center space-x-2",children:[C.jsx(a0,{value:"multiple",id:"r1"}),C.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Multiple"})]}),C.jsxs("div",{className:"flex items-center space-x-2",children:[C.jsx(a0,{value:"single",id:"r2"}),C.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Single"})]})]})]}),C.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[C.jsxs("div",{className:"col-span-2 space-y-1",children:[C.jsx(Dn,{children:"Table Column"}),C.jsx(Dn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),C.jsxs("div",{className:"col-span-2 space-y-1",children:[C.jsx(Dn,{children:"Data Type"}),C.jsx(Dn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),C.jsxs("div",{className:"col-span-2 space-y-1",children:[C.jsx(Dn,{className:"text-sm",children:"Filter Operation"}),C.jsx(Y_e,{updateFilterOperation:l,value:e.operation})]})]}),C.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[C.jsx(Dn,{className:"text-sm",children:"Values SQL"}),C.jsx(fP,{onKeyDown:d=>{d.stopPropagation()},value:t,onChange:d=>n(d.target.value),className:`min-w-full grow resize font-mono text-xs ${Ch}`})]}),C.jsx("div",{children:C.jsx(G_e,{label:"Local to sheet",onCheckedChange:u,checked:!!e.sheetId})}),C.jsx("div",{className:"flex justify-end gap-2",children:C.jsxs(ro,{onClick:a,size:"sm",variant:"outline",children:[C.jsx(rg,{className:"mr-2 size-4"}),"Accept"]})})]})]})}function Y_e({value:e,updateFilterOperation:t}){return C.jsxs(Is,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[C.jsx(Bi,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:C.jsx($s,{placeholder:"Operation"})}),C.jsxs(Vi,{children:[C.jsx(Un,{value:"=",children:"Equals"}),C.jsx(Un,{value:"in",children:"Contains"}),C.jsx(Un,{value:"like",children:"Like"})]})]})}function Pj({filter:e}){const t=we(a=>a.isDashboardEditing),n=we(a=>a.filterValues),r=n==null?void 0:n.some(a=>a.filterId===e.id),{removeFilterValue:o,removeFilter:i,updateFilter:s}=fr();return C.jsx(es,{className:"my-1",text:e.title||e.column,onSave:a=>s({...e,title:a}),children:C.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[C.jsxs("div",{className:"flex grow items-center gap-2",children:[C.jsx(Dn,{className:"inline-block text-sm",children:e.title}),t&&C.jsx(q_e,{filter:e})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[r&&C.jsx("button",{onClick:()=>o(e.id),className:"text-foreground/30 hover:text-foreground/50",children:C.jsx(dR,{className:"size-3.5"})}),t&&C.jsx(Yd,{onClick:()=>{o(e.id),i(e.id)},className:"size-3.5 cursor-pointer text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})]})]})})}var K_e=e=>{switch(e){case"success":return Z_e;case"info":return eEe;case"warning":return J_e;case"error":return tEe;default:return null}},X_e=Array(12).fill(0),Q_e=({visible:e})=>w.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},w.createElement("div",{className:"sonner-spinner"},X_e.map((t,n)=>w.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Z_e=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),J_e=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),eEe=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),tEe=w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},w.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),nEe=()=>{let[e,t]=w.useState(document.hidden);return w.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},F_=1,rEe=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,o=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:F_++,i=this.toasts.find(a=>a.id===o),s=e.dismissible===void 0?!0:e.dismissible;return i?this.toasts=this.toasts.map(a=>a.id===o?(this.publish({...a,...e,id:o,title:n}),{...a,...e,id:o,dismissible:s,title:n}):a):this.addToast({title:n,...r,dismissible:s,id:o}),o},this.dismiss=e=>(e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),o=n!==void 0;return r.then(async i=>{if(iEe(i)&&!i.ok){o=!1;let s=typeof t.error=="function"?await t.error(`HTTP error! status: ${i.status}`):t.error,a=typeof t.description=="function"?await t.description(`HTTP error! status: ${i.status}`):t.description;this.create({id:n,type:"error",message:s,description:a})}else if(t.success!==void 0){o=!1;let s=typeof t.success=="function"?await t.success(i):t.success,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"success",message:s,description:a})}}).catch(async i=>{if(t.error!==void 0){o=!1;let s=typeof t.error=="function"?await t.error(i):t.error,a=typeof t.description=="function"?await t.description(i):t.description;this.create({id:n,type:"error",message:s,description:a})}}).finally(()=>{var i;o&&(this.dismiss(n),n=void 0),(i=t.finally)==null||i.call(t)}),n},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||F_++;return this.create({jsx:e(n),id:n,...t}),n},this.subscribers=[],this.toasts=[]}},yo=new rEe,oEe=(e,t)=>{let n=(t==null?void 0:t.id)||F_++;return yo.addToast({title:e,...t,id:n}),n},iEe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",sEe=oEe,aEe=()=>yo.toasts,Oj=Object.assign(sEe,{success:yo.success,info:yo.info,warning:yo.warning,error:yo.error,custom:yo.custom,message:yo.message,promise:yo.promise,dismiss:yo.dismiss,loading:yo.loading},{getHistory:aEe});function lEe(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}lEe(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
358
+ `);function Pv(e){return e.label!==void 0}var cEe=3,uEe="32px",dEe=4e3,fEe=356,hEe=14,pEe=20,gEe=200;function mEe(...e){return e.filter(Boolean).join(" ")}var vEe=e=>{var t,n,r,o,i,s,a,l,c,u;let{invert:d,toast:f,unstyled:p,interacting:m,setHeights:v,visibleToasts:y,heights:b,index:x,toasts:E,expanded:R,removeToast:P,defaultRichColors:O,closeButton:A,style:D,cancelButtonStyle:I,actionButtonStyle:L,className:j="",descriptionClassName:z="",duration:K,position:H,gap:k,loadingIcon:W,expandByDefault:B,classNames:U,icons:q,closeButtonAriaLabel:$="Close toast",pauseWhenPageIsHidden:Y,cn:X}=e,[M,oe]=w.useState(!1),[te,ie]=w.useState(!1),[ne,Z]=w.useState(!1),[ae,ce]=w.useState(!1),[ve,ee]=w.useState(0),[ge,fe]=w.useState(0),Se=w.useRef(null),Ae=w.useRef(null),ze=x===0,Ie=x+1<=y,De=f.type,ot=f.dismissible!==!1,_t=f.className||"",rn=f.descriptionClassName||"",$t=w.useMemo(()=>b.findIndex(et=>et.toastId===f.id)||0,[b,f.id]),on=w.useMemo(()=>{var et;return(et=f.closeButton)!=null?et:A},[f.closeButton,A]),pe=w.useMemo(()=>f.duration||K||dEe,[f.duration,K]),Pe=w.useRef(0),je=w.useRef(0),qe=w.useRef(0),tt=w.useRef(null),[sn,_n]=H.split("-"),mn=w.useMemo(()=>b.reduce((et,pt,Mt)=>Mt>=$t?et:et+pt.height,0),[b,$t]),Bn=nEe(),vn=f.invert||d,Bt=De==="loading";je.current=w.useMemo(()=>$t*k+mn,[$t,mn]),w.useEffect(()=>{oe(!0)},[]),w.useLayoutEffect(()=>{if(!M)return;let et=Ae.current,pt=et.style.height;et.style.height="auto";let Mt=et.getBoundingClientRect().height;et.style.height=pt,fe(Mt),v(Jt=>Jt.find(yt=>yt.toastId===f.id)?Jt.map(yt=>yt.toastId===f.id?{...yt,height:Mt}:yt):[{toastId:f.id,height:Mt,position:f.position},...Jt])},[M,f.title,f.description,v,f.id]);let cn=w.useCallback(()=>{ie(!0),ee(je.current),v(et=>et.filter(pt=>pt.toastId!==f.id)),setTimeout(()=>{P(f)},gEe)},[f,P,v,je]);w.useEffect(()=>{if(f.promise&&De==="loading"||f.duration===1/0||f.type==="loading")return;let et,pt=pe;return R||m||Y&&Bn?(()=>{if(qe.current<Pe.current){let Mt=new Date().getTime()-Pe.current;pt=pt-Mt}qe.current=new Date().getTime()})():pt!==1/0&&(Pe.current=new Date().getTime(),et=setTimeout(()=>{var Mt;(Mt=f.onAutoClose)==null||Mt.call(f,f),cn()},pt)),()=>clearTimeout(et)},[R,m,B,f,pe,cn,f.promise,De,Y,Bn]),w.useEffect(()=>{let et=Ae.current;if(et){let pt=et.getBoundingClientRect().height;return fe(pt),v(Mt=>[{toastId:f.id,height:pt,position:f.position},...Mt]),()=>v(Mt=>Mt.filter(Jt=>Jt.toastId!==f.id))}},[v,f.id]),w.useEffect(()=>{f.delete&&cn()},[cn,f.delete]);function An(){return q!=null&&q.loading?w.createElement("div",{className:"sonner-loader","data-visible":De==="loading"},q.loading):W?w.createElement("div",{className:"sonner-loader","data-visible":De==="loading"},W):w.createElement(Q_e,{visible:De==="loading"})}return w.createElement("li",{"aria-live":f.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:Ae,className:X(j,_t,U==null?void 0:U.toast,(t=f==null?void 0:f.classNames)==null?void 0:t.toast,U==null?void 0:U.default,U==null?void 0:U[De],(n=f==null?void 0:f.classNames)==null?void 0:n[De]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:O,"data-styled":!(f.jsx||f.unstyled||p),"data-mounted":M,"data-promise":!!f.promise,"data-removed":te,"data-visible":Ie,"data-y-position":sn,"data-x-position":_n,"data-index":x,"data-front":ze,"data-swiping":ne,"data-dismissible":ot,"data-type":De,"data-invert":vn,"data-swipe-out":ae,"data-expanded":!!(R||B&&M),style:{"--index":x,"--toasts-before":x,"--z-index":E.length-x,"--offset":`${te?ve:je.current}px`,"--initial-height":B?"auto":`${ge}px`,...D,...f.style},onPointerDown:et=>{Bt||!ot||(Se.current=new Date,ee(je.current),et.target.setPointerCapture(et.pointerId),et.target.tagName!=="BUTTON"&&(Z(!0),tt.current={x:et.clientX,y:et.clientY}))},onPointerUp:()=>{var et,pt,Mt,Jt;if(ae||!ot)return;tt.current=null;let yt=Number(((et=Ae.current)==null?void 0:et.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Vn=new Date().getTime()-((pt=Se.current)==null?void 0:pt.getTime()),ai=Math.abs(yt)/Vn;if(Math.abs(yt)>=pEe||ai>.11){ee(je.current),(Mt=f.onDismiss)==null||Mt.call(f,f),cn(),ce(!0);return}(Jt=Ae.current)==null||Jt.style.setProperty("--swipe-amount","0px"),Z(!1)},onPointerMove:et=>{var pt;if(!tt.current||!ot)return;let Mt=et.clientY-tt.current.y,Jt=et.clientX-tt.current.x,yt=(sn==="top"?Math.min:Math.max)(0,Mt),Vn=et.pointerType==="touch"?10:2;Math.abs(yt)>Vn?(pt=Ae.current)==null||pt.style.setProperty("--swipe-amount",`${Mt}px`):Math.abs(Jt)>Vn&&(tt.current=null)}},on&&!f.jsx?w.createElement("button",{"aria-label":$,"data-disabled":Bt,"data-close-button":!0,onClick:Bt||!ot?()=>{}:()=>{var et;cn(),(et=f.onDismiss)==null||et.call(f,f)},className:X(U==null?void 0:U.closeButton,(o=f==null?void 0:f.classNames)==null?void 0:o.closeButton)},w.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},w.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),w.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,f.jsx||w.isValidElement(f.title)?f.jsx||f.title:w.createElement(w.Fragment,null,De||f.icon||f.promise?w.createElement("div",{"data-icon":"",className:X(U==null?void 0:U.icon,(i=f==null?void 0:f.classNames)==null?void 0:i.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||An():null,f.type!=="loading"?f.icon||(q==null?void 0:q[De])||K_e(De):null):null,w.createElement("div",{"data-content":"",className:X(U==null?void 0:U.content,(s=f==null?void 0:f.classNames)==null?void 0:s.content)},w.createElement("div",{"data-title":"",className:X(U==null?void 0:U.title,(a=f==null?void 0:f.classNames)==null?void 0:a.title)},f.title),f.description?w.createElement("div",{"data-description":"",className:X(z,rn,U==null?void 0:U.description,(l=f==null?void 0:f.classNames)==null?void 0:l.description)},f.description):null),w.isValidElement(f.cancel)?f.cancel:f.cancel&&Pv(f.cancel)?w.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||I,onClick:et=>{var pt,Mt;Pv(f.cancel)&&ot&&((Mt=(pt=f.cancel).onClick)==null||Mt.call(pt,et),cn())},className:X(U==null?void 0:U.cancelButton,(c=f==null?void 0:f.classNames)==null?void 0:c.cancelButton)},f.cancel.label):null,w.isValidElement(f.action)?f.action:f.action&&Pv(f.action)?w.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||L,onClick:et=>{var pt,Mt;Pv(f.action)&&(et.defaultPrevented||((Mt=(pt=f.action).onClick)==null||Mt.call(pt,et),cn()))},className:X(U==null?void 0:U.actionButton,(u=f==null?void 0:f.classNames)==null?void 0:u.actionButton)},f.action.label):null))};function xN(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}var bEe=e=>{let{invert:t,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:o,closeButton:i,className:s,offset:a,theme:l="light",richColors:c,duration:u,style:d,visibleToasts:f=cEe,toastOptions:p,dir:m=xN(),gap:v=hEe,loadingIcon:y,icons:b,containerAriaLabel:x="Notifications",pauseWhenPageIsHidden:E,cn:R=mEe}=e,[P,O]=w.useState([]),A=w.useMemo(()=>Array.from(new Set([n].concat(P.filter(Y=>Y.position).map(Y=>Y.position)))),[P,n]),[D,I]=w.useState([]),[L,j]=w.useState(!1),[z,K]=w.useState(!1),[H,k]=w.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=w.useRef(null),B=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),U=w.useRef(null),q=w.useRef(!1),$=w.useCallback(Y=>{var X;(X=P.find(M=>M.id===Y.id))!=null&&X.delete||yo.dismiss(Y.id),O(M=>M.filter(({id:oe})=>oe!==Y.id))},[P]);return w.useEffect(()=>yo.subscribe(Y=>{if(Y.dismiss){O(X=>X.map(M=>M.id===Y.id?{...M,delete:!0}:M));return}setTimeout(()=>{Pn.flushSync(()=>{O(X=>{let M=X.findIndex(oe=>oe.id===Y.id);return M!==-1?[...X.slice(0,M),{...X[M],...Y},...X.slice(M+1)]:[Y,...X]})})})}),[]),w.useEffect(()=>{if(l!=="system"){k(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?k("dark"):k("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:Y})=>{k(Y?"dark":"light")})},[l]),w.useEffect(()=>{P.length<=1&&j(!1)},[P]),w.useEffect(()=>{let Y=X=>{var M,oe;r.every(te=>X[te]||X.code===te)&&(j(!0),(M=W.current)==null||M.focus()),X.code==="Escape"&&(document.activeElement===W.current||(oe=W.current)!=null&&oe.contains(document.activeElement))&&j(!1)};return document.addEventListener("keydown",Y),()=>document.removeEventListener("keydown",Y)},[r]),w.useEffect(()=>{if(W.current)return()=>{U.current&&(U.current.focus({preventScroll:!0}),U.current=null,q.current=!1)}},[W.current]),P.length?w.createElement("section",{"aria-label":`${x} ${B}`,tabIndex:-1},A.map((Y,X)=>{var M;let[oe,te]=Y.split("-");return w.createElement("ol",{key:Y,dir:m==="auto"?xN():m,tabIndex:-1,ref:W,className:s,"data-sonner-toaster":!0,"data-theme":H,"data-y-position":oe,"data-x-position":te,style:{"--front-toast-height":`${((M=D[0])==null?void 0:M.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||uEe,"--width":`${fEe}px`,"--gap":`${v}px`,...d},onBlur:ie=>{q.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(q.current=!1,U.current&&(U.current.focus({preventScroll:!0}),U.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||q.current||(q.current=!0,U.current=ie.relatedTarget)},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{z||j(!1)},onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||K(!0)},onPointerUp:()=>K(!1)},P.filter(ie=>!ie.position&&X===0||ie.position===Y).map((ie,ne)=>{var Z,ae;return w.createElement(vEe,{key:ie.id,icons:b,index:ne,toast:ie,defaultRichColors:c,duration:(Z=p==null?void 0:p.duration)!=null?Z:u,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:t,visibleToasts:f,closeButton:(ae=p==null?void 0:p.closeButton)!=null?ae:i,interacting:z,position:Y,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:$,toasts:P.filter(ce=>ce.position==ie.position),heights:D.filter(ce=>ce.position==ie.position),setHeights:I,expandByDefault:o,gap:v,loadingIcon:y,expanded:L,pauseWhenPageIsHidden:E,cn:R})}))})):null};function yEe(){const{getSelectedFrame:e,addFrame:t,setSelectedFrameId:n}=fr(),r=we(l=>l.dashboard.sheets),i=we(l=>l.selectedSheetId)??(r==null?void 0:r[0].id),s=we(l=>l.isDashboardEditing),a=we(l=>l.isVisualEditing);w.useEffect(()=>{if(!s||a)return;async function l(d){const f=d.ctrlKey||d.metaKey;f&&d.key==="c"?(await c(),Oj.success("Card copied to clipboard"),d.preventDefault()):f&&d.key==="v"&&(await u(),d.preventDefault())}async function c(){try{const d=e();d&&await navigator.clipboard.writeText(JSON.stringify(d))}catch(d){console.error("Failed to copy text:",d)}}async function u(){if(!i)return null;try{const d=await navigator.clipboard.readText();try{const f=JSON.parse(d);if(f&&f.id){f.id=Ka();const p=f.activeCardId;f.cards.forEach(m=>{const v=m.id;m.id=Ka(),v===p&&(f.activeCardId=m.id,m.title=`${m.title} (Copy)`)}),t(i,f),n(f.id)}}catch(f){console.error("Failed to parse clipboard contents: ",f)}return d}catch(d){return console.error("Failed to paste text:",d),null}}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[t,e,n,i,s,a])}const xEe=ID.WidthProvider(ID.Responsive),vP=e=>Ud.includes(e.dataType)?C.jsx(F1e,{filter:e}):C.jsx(s_e,{filter:e});function wEe({sheet:e}){var y;const t=we(b=>b.isDashboardEditing);we(b=>b.currentBreakpoint);const n=we(b=>b.themeStyle);w.useState([]);const r=we(b=>b.selectedSheetId);we(b=>b.selectedLensId);const o=e.layouts,i=we(b=>b.dashboard.filters),s=e.frames,{getSelectedSheet:a,setSheetLayouts:l,setCurrentBreakpoint:c}=we(b=>b.actions),u=a();yEe();const d=w.useCallback(b=>{c(b)},[c]),f=w.useCallback((b,x)=>{u!=null&&u.id&&l(u.id,x)},[u==null?void 0:u.id,l]);if(!r)return null;const p=(b,x)=>C.jsx(Aj,{className:"after:content-none",ref:x,handleAxis:b});function m(){const b=i==null?void 0:i.filter(x=>x.sheetId===r||!x.sheetId);return b==null?void 0:b.map(x=>{var E,R;return x.location==="frame"?null:C.jsxs("div",{style:{borderRadius:(R=(E=n==null?void 0:n.chart)==null?void 0:E.options)==null?void 0:R.borderRadius},className:xe("z-50 flex flex-col rounded-md border bg-background px-3 py-2"),children:[C.jsx(Pj,{filter:x}),vP(x)]},x.id)})}function v(){return s==null?void 0:s.map(b=>C.jsx("div",{role:"dashboard-frame-container",className:xe("group overflow-hidden",n==null?void 0:n.dashboardCardContainer),children:C.jsx(q0,{FallbackComponent:({error:x,resetErrorBoundary:E})=>C.jsx(_oe,{error:x,resetErrorBoundary:E,frame:b}),children:C.jsx(K0e,{frame:b})})},b.id))}return C.jsx(C.Fragment,{children:C.jsxs(xEe,{margin:[10,10],isDraggable:t,resizeHandles:t?["sw","nw","ne","se","e","w"]:[],className:xe((y=n==null?void 0:n.gridLayout)==null?void 0:y.className),layouts:o,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:1,onBreakpointChange:d,onLayoutChange:f,resizeHandle:p,children:[m(),v()]})})}const Aj=w.forwardRef(({className:e,handleAxis:t,...n},r)=>(we(o=>o.themeStyle),C.jsx("div",{ref:r,className:xe(`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})));Aj.displayName="ResizeHandle";var Tj="vercel.ai.error",SEe=Symbol.for(Tj),Dj,CEe=class Mj extends Error{constructor({name:t,message:n,cause:r}){super(n),this[Dj]=!0,this.name=t,this.cause=r}static isInstance(t){return Mj.hasMarker(t,Tj)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}};Dj=SEe;var Bd=CEe;function Ij(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var $j="AI_InvalidArgumentError",Nj=`vercel.ai.error.${$j}`,_Ee=Symbol.for(Nj),kj,EEe=class extends Bd{constructor({message:e,cause:t,argument:n}){super({name:$j,message:e,cause:t}),this[kj]=!0,this.argument=n}static isInstance(e){return Bd.hasMarker(e,Nj)}};kj=_Ee;var Lj="AI_JSONParseError",Fj=`vercel.ai.error.${Lj}`,REe=Symbol.for(Fj),jj,wN=class extends Bd{constructor({text:e,cause:t}){super({name:Lj,message:`JSON parsing failed: Text: ${e}.
359
+ Error message: ${Ij(t)}`,cause:t}),this[jj]=!0,this.text=e}static isInstance(e){return Bd.hasMarker(e,Fj)}};jj=REe;var zj="AI_TypeValidationError",Bj=`vercel.ai.error.${zj}`,PEe=Symbol.for(Bj),Vj,OEe=class j_ extends Bd{constructor({value:t,cause:n}){super({name:zj,message:`Type validation failed: Value: ${JSON.stringify(t)}.
360
+ Error message: ${Ij(n)}`,cause:n}),this[Vj]=!0,this.value=t}static isInstance(t){return Bd.hasMarker(t,Bj)}static wrap({value:t,cause:n}){return j_.isInstance(n)&&n.value===t?n:new j_({value:t,cause:n})}};Vj=PEe;var SN=OEe;let AEe=(e,t=21)=>(n=t)=>{let r="",o=n|0;for(;o--;)r+=e[Math.random()*e.length|0];return r};var af={exports:{}};const TEe=typeof Buffer<"u",CN=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,_N=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Hj(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),TEe&&Buffer.isBuffer(e)&&(e=e.toString()),e&&e.charCodeAt(0)===65279&&(e=e.slice(1));const r=JSON.parse(e,t);if(r===null||typeof r!="object")return r;const o=n&&n.protoAction||"error",i=n&&n.constructorAction||"error";if(o==="ignore"&&i==="ignore")return r;if(o!=="ignore"&&i!=="ignore"){if(CN.test(e)===!1&&_N.test(e)===!1)return r}else if(o!=="ignore"&&i==="ignore"){if(CN.test(e)===!1)return r}else if(_N.test(e)===!1)return r;return Wj(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function Wj(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let o=[e];for(;o.length;){const i=o;o=[];for(const s of i){if(t!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"__proto__")){if(r===!0)return null;if(t==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.__proto__}if(n!=="ignore"&&Object.prototype.hasOwnProperty.call(s,"constructor")&&Object.prototype.hasOwnProperty.call(s.constructor,"prototype")){if(r===!0)return null;if(n==="error")throw new SyntaxError("Object contains forbidden prototype property");delete s.constructor}for(const a in s){const l=s[a];l&&typeof l=="object"&&o.push(l)}}}return e}function bP(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return Hj(e,t,n)}finally{Error.stackTraceLimit=r}}function DEe(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return Hj(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}af.exports=bP;af.exports.default=bP;af.exports.parse=bP;af.exports.safeParse=DEe;af.exports.scan=Wj;var MEe=af.exports;const IEe=sl(MEe);var $Ee=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const o=AEe(n,t);if(e==null)return o;if(n.includes(r))throw new EEe({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return i=>`${e}${r}${o(i)}`},Uj=$Ee(),z_=Symbol.for("vercel.ai.validator");function NEe(e){return{[z_]:!0,validate:e}}function kEe(e){return typeof e=="object"&&e!==null&&z_ in e&&e[z_]===!0&&"validate"in e}function LEe(e){return kEe(e)?e:FEe(e)}function FEe(e){return NEe(t=>{const n=e.safeParse(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}})}function jEe({value:e,schema:t}){const n=LEe(t);try{if(n.validate==null)return{success:!0,value:e};const r=n.validate(e);return r.success?r:{success:!1,error:SN.wrap({value:e,cause:r.error})}}catch(r){return{success:!1,error:SN.wrap({value:e,cause:r})}}}function EN({text:e,schema:t}){try{const n=IEe.parse(e);return t==null?{success:!0,value:n}:jEe({value:n,schema:t})}catch(n){return{success:!1,error:wN.isInstance(n)?n:new wN({text:e,cause:n})}}}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var hp={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},pp={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},gp={code:"4",name:"assistant_message",parse:e=>{if(e==null||typeof e!="object"||!("id"in e)||!("role"in e)||!("content"in e)||typeof e.id!="string"||typeof e.role!="string"||e.role!=="assistant"||!Array.isArray(e.content)||!e.content.every(t=>t!=null&&typeof t=="object"&&"type"in t&&t.type==="text"&&"text"in t&&t.text!=null&&typeof t.text=="object"&&"value"in t.text&&typeof t.text.value=="string"))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},mp={code:"5",name:"assistant_control_data",parse:e=>{if(e==null||typeof e!="object"||!("threadId"in e)||!("messageId"in e)||typeof e.threadId!="string"||typeof e.messageId!="string")throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},vp={code:"6",name:"data_message",parse:e=>{if(e==null||typeof e!="object"||!("role"in e)||!("data"in e)||typeof e.role!="string"||e.role!=="data")throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},zEe=[hp,pp,gp,mp,vp];hp.code+"",pp.code+"",gp.code+"",mp.code+"",vp.code+"";hp.name+"",hp.code,pp.name+"",pp.code,gp.name+"",gp.code,mp.name+"",mp.code,vp.name+"",vp.code;zEe.map(e=>e.code);function BEe(e){const t=["ROOT"];let n=-1,r=null;function o(l,c,u){switch(l){case'"':{n=c,t.pop(),t.push(u),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=c,r=c,t.pop(),t.push(u),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c,t.pop(),t.push(u),t.push("INSIDE_NUMBER");break}case"{":{n=c,t.pop(),t.push(u),t.push("INSIDE_OBJECT_START");break}case"[":{n=c,t.pop(),t.push(u),t.push("INSIDE_ARRAY_START");break}}}function i(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=c,t.pop();break}}}function s(l,c){switch(l){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}}}for(let l=0;l<e.length;l++){const c=e[l];switch(t[t.length-1]){case"ROOT":o(c,l,"FINISH");break;case"INSIDE_OBJECT_START":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=l,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(c){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{o(c,l,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{i(c,l);break}case"INSIDE_STRING":{switch(c){case'"':{t.pop(),n=l;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=l}break}case"INSIDE_ARRAY_START":{switch(c){case"]":{n=l,t.pop();break}default:{n=l,o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=l,t.pop();break}default:{n=l;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{o(c,l,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=l;break}case"INSIDE_NUMBER":{switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=l;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&i(c,l);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const d=e.substring(r,l+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?i(c,l):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&s(c,l)):n=l;break}}}let a=e.slice(0,n+1);for(let l=t.length-1;l>=0;l--)switch(t[l]){case"INSIDE_STRING":{a+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{a+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{a+="]";break}case"INSIDE_LITERAL":{const u=e.substring(r,e.length);"true".startsWith(u)?a+="true".slice(u.length):"false".startsWith(u)?a+="false".slice(u.length):"null".startsWith(u)&&(a+="null".slice(u.length))}}return a}function VEe(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=EN({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=EN({text:BEe(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var bp={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},yp={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},xp={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},wp={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},Sp={code:"9",name:"tool_call",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string"||!("args"in e)||typeof e.args!="object")throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},Cp={code:"a",name:"tool_result",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},_p={code:"b",name:"tool_call_streaming_start",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("toolName"in e)||typeof e.toolName!="string")throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},Ep={code:"c",name:"tool_call_delta",parse:e=>{if(e==null||typeof e!="object"||!("toolCallId"in e)||typeof e.toolCallId!="string"||!("argsTextDelta"in e)||typeof e.argsTextDelta!="string")throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},Rp={code:"d",name:"finish_message",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_message" parts expect an object with a "finishReason" property.');const t={finishReason:e.finishReason};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),{type:"finish_message",value:t}}},Pp={code:"e",name:"finish_step",parse:e=>{if(e==null||typeof e!="object"||!("finishReason"in e)||typeof e.finishReason!="string")throw new Error('"finish_step" parts expect an object with a "finishReason" property.');const t={finishReason:e.finishReason,isContinued:!1};return"usage"in e&&e.usage!=null&&typeof e.usage=="object"&&"promptTokens"in e.usage&&"completionTokens"in e.usage&&(t.usage={promptTokens:typeof e.usage.promptTokens=="number"?e.usage.promptTokens:Number.NaN,completionTokens:typeof e.usage.completionTokens=="number"?e.usage.completionTokens:Number.NaN}),"isContinued"in e&&typeof e.isContinued=="boolean"&&(t.isContinued=e.isContinued),{type:"finish_step",value:t}}},Op={code:"f",name:"start_step",parse:e=>{if(e==null||typeof e!="object"||!("messageId"in e)||typeof e.messageId!="string")throw new Error('"start_step" parts expect an object with an "id" property.');return{type:"start_step",value:{messageId:e.messageId}}}},HEe=[bp,yp,xp,wp,Sp,Cp,_p,Ep,Rp,Pp,Op],WEe={[bp.code]:bp,[yp.code]:yp,[xp.code]:xp,[wp.code]:wp,[Sp.code]:Sp,[Cp.code]:Cp,[_p.code]:_p,[Ep.code]:Ep,[Rp.code]:Rp,[Pp.code]:Pp,[Op.code]:Op};bp.name+"",bp.code,yp.name+"",yp.code,xp.name+"",xp.code,wp.name+"",wp.code,Sp.name+"",Sp.code,Cp.name+"",Cp.code,_p.name+"",_p.code,Ep.name+"",Ep.code,Rp.name+"",Rp.code,Pp.name+"",Pp.code,Op.name+"",Op.code;var UEe=HEe.map(e=>e.code),GEe=e=>{const t=e.indexOf(":");if(t===-1)throw new Error("Failed to parse stream string. No separator found.");const n=e.slice(0,t);if(!UEe.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,o=e.slice(t+1),i=JSON.parse(o);return WEe[r].parse(i)},qEe=10;function YEe(e,t){const n=new Uint8Array(t);let r=0;for(const o of e)n.set(o,r),r+=o.length;return e.length=0,n}async function KEe({stream:e,onTextPart:t,onDataPart:n,onErrorPart:r,onToolCallStreamingStartPart:o,onToolCallDeltaPart:i,onToolCallPart:s,onToolResultPart:a,onMessageAnnotationsPart:l,onFinishMessagePart:c,onFinishStepPart:u,onStartStepPart:d}){const f=e.getReader(),p=new TextDecoder,m=[];let v=0;for(;;){const{value:y}=await f.read();if(y&&(m.push(y),v+=y.length,y[y.length-1]!==qEe))continue;if(m.length===0)break;const b=YEe(m,v);v=0;const x=p.decode(b,{stream:!0}).split(`
361
+ `).filter(E=>E!=="").map(GEe);for(const{type:E,value:R}of x)switch(E){case"text":await(t==null?void 0:t(R));break;case"data":await(n==null?void 0:n(R));break;case"error":await(r==null?void 0:r(R));break;case"message_annotations":await(l==null?void 0:l(R));break;case"tool_call_streaming_start":await(o==null?void 0:o(R));break;case"tool_call_delta":await(i==null?void 0:i(R));break;case"tool_call":await(s==null?void 0:s(R));break;case"tool_result":await(a==null?void 0:a(R));break;case"finish_message":await(c==null?void 0:c(R));break;case"finish_step":await(u==null?void 0:u(R));break;case"start_step":await(d==null?void 0:d(R));break;default:{const P=E;throw new Error(`Unknown stream part type: ${P}`)}}}}function XEe({promptTokens:e,completionTokens:t}){return{promptTokens:e,completionTokens:t,totalTokens:e+t}}async function QEe({stream:e,update:t,onToolCall:n,onFinish:r,generateId:o=Uj,getCurrentDate:i=()=>new Date}){const s=i();let a,l=!0,c;const u=[],d=[];let f;const p={};let m={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},v="unknown";function y(){const x=[...d];if(a==null){t(u,x);return}f!=null&&f.length&&(a.annotations=f);const E={...JSON.parse(JSON.stringify(a)),revisionId:o(),createdAt:a.createdAt};t([...u,E],x)}function b(){return(l||a==null)&&(a!=null&&u.push(a),a={id:c??o(),role:"assistant",content:"",createdAt:s},l=!1,c=void 0),a}await KEe({stream:e,onTextPart(x){const E=b();a={...E,content:E.content+x},y()},onToolCallStreamingStartPart(x){const E=b();E.toolInvocations==null&&(E.toolInvocations=[]),p[x.toolCallId]={text:"",toolName:x.toolName,index:E.toolInvocations.length},E.toolInvocations.push({state:"partial-call",toolCallId:x.toolCallId,toolName:x.toolName,args:void 0}),y()},onToolCallDeltaPart(x){const E=b(),R=p[x.toolCallId];R.text+=x.argsTextDelta;const{value:P}=VEe(R.text);E.toolInvocations[R.index]={state:"partial-call",toolCallId:x.toolCallId,toolName:R.toolName,args:P},y()},async onToolCallPart(x){const E=b();if(p[x.toolCallId]!=null?E.toolInvocations[p[x.toolCallId].index]={state:"call",...x}:(E.toolInvocations==null&&(E.toolInvocations=[]),E.toolInvocations.push({state:"call",...x})),n){const R=await n({toolCall:x});R!=null&&(E.toolInvocations[E.toolInvocations.length-1]={state:"result",...x,result:R})}y()},onToolResultPart(x){const R=b().toolInvocations;if(R==null)throw new Error("tool_result must be preceded by a tool_call");const P=R.findIndex(O=>O.toolCallId===x.toolCallId);if(P===-1)throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");R[P]={...R[P],state:"result",...x},y()},onDataPart(x){d.push(...x),y()},onMessageAnnotationsPart(x){f==null?f=[...x]:f.push(...x),y()},onFinishStepPart(x){l=!x.isContinued},onStartStepPart(x){c=x.messageId},onFinishMessagePart(x){v=x.finishReason,x.usage!=null&&(m=XEe(x.usage))},onErrorPart(x){throw new Error(x)}}),r==null||r({message:a,finishReason:v,usage:m})}async function ZEe({stream:e,onTextPart:t}){const n=e.pipeThrough(new TextDecoderStream).getReader();for(;;){const{done:r,value:o}=await n.read();if(r)break;await t(o)}}var JEe=()=>fetch;async function eRe({api:e,body:t,streamProtocol:n="data",credentials:r,headers:o,abortController:i,restoreMessagesOnFailure:s,onResponse:a,onUpdate:l,onFinish:c,onToolCall:u,generateId:d,fetch:f=JEe()}){var p,m;const v=await f(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...o},signal:(p=i==null?void 0:i())==null?void 0:p.signal,credentials:r}).catch(y=>{throw s(),y});if(a)try{await a(v)}catch(y){throw y}if(!v.ok)throw s(),new Error((m=await v.text())!=null?m:"Failed to fetch the chat response.");if(!v.body)throw new Error("The response body is empty.");switch(n){case"text":{const y={id:d(),createdAt:new Date,role:"assistant",content:""};await ZEe({stream:v.body,onTextPart:b=>{y.content+=b,l([{...y}],[])}}),c==null||c(y,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"});return}case"data":{await QEe({stream:v.body,update:l,onToolCall:u,onFinish({message:y,finishReason:b,usage:x}){c&&y!=null&&c(y,{usage:x,finishReason:b})},generateId:d});return}default:{const y=n;throw new Error(`Unknown stream protocol: ${y}`)}}}async function RN(e){if(!e)return[];if(e instanceof FileList)return Promise.all(Array.from(e).map(async t=>{const{name:n,type:r}=t,o=await new Promise((i,s)=>{const a=new FileReader;a.onload=l=>{var c;i((c=l.target)==null?void 0:c.result)},a.onerror=l=>s(l),a.readAsDataURL(t)});return{name:n,contentType:r,url:o}}));if(Array.isArray(e))return e;throw new Error("Invalid attachments type")}const Ha=()=>{},Jr=Ha(),jw=Object,Vt=e=>e===Jr,Ki=e=>typeof e=="function",il=(e,t)=>({...e,...t}),tRe=e=>Ki(e.then),Ov=new WeakMap;let nRe=0;const Ap=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let o,i;if(jw(e)===e&&!r&&n!=RegExp){if(o=Ov.get(e),o)return o;if(o=++nRe+"~",Ov.set(e,o),n==Array){for(o="@",i=0;i<e.length;i++)o+=Ap(e[i])+",";Ov.set(e,o)}if(n==jw){o="#";const s=jw.keys(e).sort();for(;!Vt(i=s.pop());)Vt(e[i])||(o+=i+":"+Ap(e[i])+",");Ov.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},Fs=new WeakMap,zw={},Av={},yP="undefined",ky=typeof window!=yP,B_=typeof document!=yP,rRe=()=>ky&&typeof window.requestAnimationFrame!=yP,Gj=(e,t)=>{const n=Fs.get(e);return[()=>!Vt(t)&&e.get(t)||zw,r=>{if(!Vt(t)){const o=e.get(t);t in Av||(Av[t]=o),n[5](t,il(o,r),o||zw)}},n[6],()=>!Vt(t)&&t in Av?Av[t]:!Vt(t)&&e.get(t)||zw]};let V_=!0;const oRe=()=>V_,[H_,W_]=ky&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Ha,Ha],iRe=()=>{const e=B_&&document.visibilityState;return Vt(e)||e!=="hidden"},sRe=e=>(B_&&document.addEventListener("visibilitychange",e),H_("focus",e),()=>{B_&&document.removeEventListener("visibilitychange",e),W_("focus",e)}),aRe=e=>{const t=()=>{V_=!0,e()},n=()=>{V_=!1};return H_("online",t),H_("offline",n),()=>{W_("online",t),W_("offline",n)}},lRe={isOnline:oRe,isVisible:iRe},cRe={initFocus:sRe,initReconnect:aRe},PN=!w.useId,Tp=!ky||"Deno"in window,uRe=e=>rRe()?window.requestAnimationFrame(e):setTimeout(e,1),Bw=Tp?w.useEffect:w.useLayoutEffect,Vw=typeof navigator<"u"&&navigator.connection,ON=!Tp&&Vw&&(["slow-2g","2g"].includes(Vw.effectiveType)||Vw.saveData),xP=e=>{if(Ki(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Ap(e):"",[e,t]};let dRe=0;const U_=()=>++dRe,qj=0,Yj=1,Kj=2,fRe=3;var Zf={__proto__:null,ERROR_REVALIDATE_EVENT:fRe,FOCUS_EVENT:qj,MUTATE_EVENT:Kj,RECONNECT_EVENT:Yj};async function Xj(...e){const[t,n,r,o]=e,i=il({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let s=i.populateCache;const a=i.rollbackOnError;let l=i.optimisticData;const c=f=>typeof a=="function"?a(f):a!==!1,u=i.throwOnError;if(Ki(n)){const f=n,p=[],m=t.keys();for(const v of m)!/^\$(inf|sub)\$/.test(v)&&f(t.get(v)._k)&&p.push(v);return Promise.all(p.map(d))}return d(n);async function d(f){const[p]=xP(f);if(!p)return;const[m,v]=Gj(t,p),[y,b,x,E]=Fs.get(t),R=()=>{const K=y[p];return(Ki(i.revalidate)?i.revalidate(m().data,f):i.revalidate!==!1)&&(delete x[p],delete E[p],K&&K[0])?K[0](Kj).then(()=>m().data):m().data};if(e.length<3)return R();let P=r,O;const A=U_();b[p]=[A,0];const D=!Vt(l),I=m(),L=I.data,j=I._c,z=Vt(j)?L:j;if(D&&(l=Ki(l)?l(z,L):l,v({data:l,_c:z})),Ki(P))try{P=P(z)}catch(K){O=K}if(P&&tRe(P))if(P=await P.catch(K=>{O=K}),A!==b[p][0]){if(O)throw O;return P}else O&&D&&c(O)&&(s=!0,v({data:z,_c:Jr}));if(s&&!O)if(Ki(s)){const K=s(P,z);v({data:K,error:Jr,_c:Jr})}else v({data:P,error:Jr,_c:Jr});if(b[p][1]=U_(),Promise.resolve(R()).then(()=>{v({_c:Jr})}),O){if(u)throw O;return}return P}}const AN=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},hRe=(e,t)=>{if(!Fs.has(e)){const n=il(cRe,t),r={},o=Xj.bind(Jr,e);let i=Ha;const s={},a=(u,d)=>{const f=s[u]||[];return s[u]=f,f.push(d),()=>f.splice(f.indexOf(d),1)},l=(u,d,f)=>{e.set(u,d);const p=s[u];if(p)for(const m of p)m(d,f)},c=()=>{if(!Fs.has(e)&&(Fs.set(e,[r,{},{},{},o,l,a]),!Tp)){const u=n.initFocus(setTimeout.bind(Jr,AN.bind(Jr,r,qj))),d=n.initReconnect(setTimeout.bind(Jr,AN.bind(Jr,r,Yj)));i=()=>{u&&u(),d&&d(),Fs.delete(e)}}};return c(),[e,o,c,i]}return[e,Fs.get(e)[4]]},pRe=(e,t,n,r,o)=>{const i=n.errorRetryCount,s=o.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!Vt(i)&&s>i||setTimeout(r,a,o)},gRe=(e,t)=>Ap(e)==Ap(t),[Qj,mRe]=hRe(new Map),vRe=il({onLoadingSlow:Ha,onSuccess:Ha,onError:Ha,onErrorRetry:pRe,onDiscarded:Ha,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:ON?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:ON?5e3:3e3,compare:gRe,isPaused:()=>!1,cache:Qj,mutate:mRe,fallback:{}},lRe),bRe=(e,t)=>{const n=il(e,t);if(t){const{use:r,fallback:o}=e,{use:i,fallback:s}=t;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=il(o,s))}return n},yRe=w.createContext({}),xRe="$inf$",Zj=ky&&window.__SWR_DEVTOOLS_USE__,wRe=Zj?window.__SWR_DEVTOOLS_USE__:[],SRe=()=>{Zj&&(window.__SWR_DEVTOOLS_REACT__=w)},CRe=e=>Ki(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],_Re=()=>il(vRe,w.useContext(yRe)),ERe=e=>(t,n,r)=>e(t,n&&((...i)=>{const[s]=xP(t),[,,,a]=Fs.get(Qj);if(s.startsWith(xRe))return n(...i);const l=a[s];return Vt(l)?n(...i):(delete a[s],l)}),r),RRe=wRe.concat(ERe),PRe=e=>function(...n){const r=_Re(),[o,i,s]=CRe(n),a=bRe(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(RRe);for(let d=u.length;d--;)l=u[d](l);return l(o,i||a.fetcher||null,a)},ORe=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const o=r.indexOf(n);o>=0&&(r[o]=r[r.length-1],r.pop())}};SRe();const TN=w.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e)}),Hw={dedupe:!0},ARe=(e,t,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:d,keepPreviousData:f}=n,[p,m,v,y]=Fs.get(r),[b,x]=xP(e),E=w.useRef(!1),R=w.useRef(!1),P=w.useRef(b),O=w.useRef(t),A=w.useRef(n),D=()=>A.current,I=()=>D().isVisible()&&D().isOnline(),[L,j,z,K]=Gj(r,b),H=w.useRef({}).current,k=Vt(s)?n.fallback[b]:s,W=(ee,ge)=>{for(const fe in H){const Se=fe;if(Se==="data"){if(!o(ee[Se],ge[Se])&&(!Vt(ee[Se])||!o(te,ge[Se])))return!1}else if(ge[Se]!==ee[Se])return!1}return!0},B=w.useMemo(()=>{const ee=!b||!t?!1:Vt(a)?D().isPaused()||i?!1:Vt(l)?!0:l:a,ge=De=>{const ot=il(De);return delete ot._k,ee?{isValidating:!0,isLoading:!0,...ot}:ot},fe=L(),Se=K(),Ae=ge(fe),ze=fe===Se?Ae:ge(Se);let Ie=Ae;return[()=>{const De=ge(L());return W(De,Ie)?(Ie.data=De.data,Ie.isLoading=De.isLoading,Ie.isValidating=De.isValidating,Ie.error=De.error,Ie):(Ie=De,De)},()=>ze]},[r,b]),U=wE.useSyncExternalStore(w.useCallback(ee=>z(b,(ge,fe)=>{W(fe,ge)||ee()}),[r,b]),B[0],B[1]),q=!E.current,$=p[b]&&p[b].length>0,Y=U.data,X=Vt(Y)?k:Y,M=U.error,oe=w.useRef(X),te=f?Vt(Y)?oe.current:Y:X,ie=$&&!Vt(M)?!1:q&&!Vt(a)?a:D().isPaused()?!1:i?Vt(X)?!1:l:Vt(X)||l,ne=!!(b&&t&&q&&ie),Z=Vt(U.isValidating)?ne:U.isValidating,ae=Vt(U.isLoading)?ne:U.isLoading,ce=w.useCallback(async ee=>{const ge=O.current;if(!b||!ge||R.current||D().isPaused())return!1;let fe,Se,Ae=!0;const ze=ee||{},Ie=!v[b]||!ze.dedupe,De=()=>PN?!R.current&&b===P.current&&E.current:b===P.current,ot={isValidating:!1,isLoading:!1},_t=()=>{j(ot)},rn=()=>{const on=v[b];on&&on[1]===Se&&delete v[b]},$t={isValidating:!0};Vt(L().data)&&($t.isLoading=!0);try{if(Ie&&(j($t),n.loadingTimeout&&Vt(L().data)&&setTimeout(()=>{Ae&&De()&&D().onLoadingSlow(b,n)},n.loadingTimeout),v[b]=[ge(x),U_()]),[fe,Se]=v[b],fe=await fe,Ie&&setTimeout(rn,n.dedupingInterval),!v[b]||v[b][1]!==Se)return Ie&&De()&&D().onDiscarded(b),!1;ot.error=Jr;const on=m[b];if(!Vt(on)&&(Se<=on[0]||Se<=on[1]||on[1]===0))return _t(),Ie&&De()&&D().onDiscarded(b),!1;const pe=L().data;ot.data=o(pe,fe)?pe:fe,Ie&&De()&&D().onSuccess(fe,b,n)}catch(on){rn();const pe=D(),{shouldRetryOnError:Pe}=pe;pe.isPaused()||(ot.error=on,Ie&&De()&&(pe.onError(on,b,pe),(Pe===!0||Ki(Pe)&&Pe(on))&&(!D().revalidateOnFocus||!D().revalidateOnReconnect||I())&&pe.onErrorRetry(on,b,pe,je=>{const qe=p[b];qe&&qe[0]&&qe[0](Zf.ERROR_REVALIDATE_EVENT,je)},{retryCount:(ze.retryCount||0)+1,dedupe:!0})))}return Ae=!1,_t(),!0},[b,r]),ve=w.useCallback((...ee)=>Xj(r,P.current,...ee),[]);if(Bw(()=>{O.current=t,A.current=n,Vt(Y)||(oe.current=Y)}),Bw(()=>{if(!b)return;const ee=ce.bind(Jr,Hw);let ge=0;const Se=ORe(b,p,(Ae,ze={})=>{if(Ae==Zf.FOCUS_EVENT){const Ie=Date.now();D().revalidateOnFocus&&Ie>ge&&I()&&(ge=Ie+D().focusThrottleInterval,ee())}else if(Ae==Zf.RECONNECT_EVENT)D().revalidateOnReconnect&&I()&&ee();else{if(Ae==Zf.MUTATE_EVENT)return ce();if(Ae==Zf.ERROR_REVALIDATE_EVENT)return ce(ze)}});return R.current=!1,P.current=b,E.current=!0,j({_k:x}),ie&&(Vt(X)||Tp?ee():uRe(ee)),()=>{R.current=!0,Se()}},[b]),Bw(()=>{let ee;function ge(){const Se=Ki(c)?c(L().data):c;Se&&ee!==-1&&(ee=setTimeout(fe,Se))}function fe(){!L().error&&(u||D().isVisible())&&(d||D().isOnline())?ce(Hw).then(ge):ge()}return ge(),()=>{ee&&(clearTimeout(ee),ee=-1)}},[c,u,d,b]),w.useDebugValue(te),i&&Vt(X)&&b){if(!PN&&Tp)throw new Error("Fallback data is required when using suspense in SSR.");O.current=t,A.current=n,R.current=!1;const ee=y[b];if(!Vt(ee)){const ge=ve(ee);TN(ge)}if(Vt(M)){const ge=ce(Hw);Vt(te)||(ge.status="fulfilled",ge.value=!0),TN(ge)}else throw M}return{mutate:ve,get data(){return H.data=!0,te},get error(){return H.error=!0,M},get isValidating(){return H.isValidating=!0,Z},get isLoading(){return H.isLoading=!0,ae}}},Tv=PRe(ARe);function TRe(e,t){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...i){clearTimeout(n);const s=Date.now(),a=s-r,l=t-a;l<=0?(r=s,e.apply(this,i)):n=setTimeout(()=>{r=Date.now(),e.apply(this,i)},l)}}var DRe=TRe;const MRe=sl(DRe);function DN(e,t){return t!=null?MRe(e,t):e}var IRe=async(e,t,n,r,o,i,s,a,l,c,u,d,f,p,m,v,y,b)=>{var x;const E=s.current;n(t.messages,!1);const R=p?t.messages:t.messages.map(({role:O,content:A,experimental_attachments:D,data:I,annotations:L,toolInvocations:j})=>({role:O,content:A,...D!==void 0&&{experimental_attachments:D},...I!==void 0&&{data:I},...L!==void 0&&{annotations:L},...j!==void 0&&{toolInvocations:j}})),P=o.current;return await eRe({api:e,body:(x=m==null?void 0:m({id:b,messages:t.messages,requestData:t.data,requestBody:t.body}))!=null?x:{id:b,messages:R,data:t.data,...i.current.body,...t.body},streamProtocol:c,credentials:i.current.credentials,headers:{...i.current.headers,...t.headers},abortController:()=>a.current,restoreMessagesOnFailure(){y||n(E,!1)},onResponse:d,onUpdate(O,A){n([...t.messages,...O],!1),A!=null&&A.length&&r([...P??[],...A],!1)},onToolCall:f,onFinish:u,generateId:l,fetch:v})};function $Re({api:e="/api/chat",id:t,initialMessages:n,initialInput:r="",sendExtraMessageFields:o,onToolCall:i,experimental_prepareRequestBody:s,maxSteps:a=1,streamProtocol:l="data",onResponse:c,onFinish:u,onError:d,credentials:f,headers:p,body:m,generateId:v=Uj,fetch:y,keepLastMessageOnError:b=!0,experimental_throttle:x}={}){const[E]=w.useState(v),R=t??E,P=typeof e=="string"?[e,R]:R,[O]=w.useState([]),{data:A,mutate:D}=Tv([P,"messages"],null,{fallbackData:n??O}),I=w.useRef(A||[]);w.useEffect(()=>{I.current=A||[]},[A]);const{data:L,mutate:j}=Tv([P,"streamData"],null),z=w.useRef(L);w.useEffect(()=>{z.current=L},[L]);const{data:K=!1,mutate:H}=Tv([P,"loading"],null),{data:k=void 0,mutate:W}=Tv([P,"error"],null),B=w.useRef(null),U=w.useRef({credentials:f,headers:p,body:m});w.useEffect(()=>{U.current={credentials:f,headers:p,body:m}},[f,p,m]);const q=w.useCallback(async ce=>{const ve=I.current.length;try{H(!0),W(void 0);const fe=new AbortController;B.current=fe,await IRe(e,ce,DN(D,x),DN(j,x),z,U,I,B,v,l,u,c,i,o,s,y,b,R),B.current=null}catch(fe){if(fe.name==="AbortError")return B.current=null,null;d&&fe instanceof Error&&d(fe),W(fe)}finally{H(!1)}const ee=I.current,ge=ee[ee.length-1];ee.length>ve&&ge!=null&&a>1&&MN(ge)&&NRe(ee)<a&&await q({messages:ee})},[D,H,e,U,c,u,d,W,j,z,l,o,s,i,a,I,B,v,y,b,x,R]),$=w.useCallback(async(ce,{data:ve,headers:ee,body:ge,experimental_attachments:fe}={})=>{var Se,Ae;const ze=await RN(fe),Ie=I.current.concat({...ce,id:(Se=ce.id)!=null?Se:v(),createdAt:(Ae=ce.createdAt)!=null?Ae:new Date,experimental_attachments:ze.length>0?ze:void 0});return q({messages:Ie,headers:ee,body:ge,data:ve})},[q,v]),Y=w.useCallback(async({data:ce,headers:ve,body:ee}={})=>{const ge=I.current;if(ge.length===0)return null;const fe=ge[ge.length-1];return q({messages:fe.role==="assistant"?ge.slice(0,-1):ge,headers:ve,body:ee,data:ce})},[q]),X=w.useCallback(()=>{B.current&&(B.current.abort(),B.current=null)},[]),M=w.useCallback(ce=>{typeof ce=="function"&&(ce=ce(I.current)),D(ce,!1),I.current=ce},[D]),oe=w.useCallback(ce=>{typeof ce=="function"&&(ce=ce(z.current)),j(ce,!1),z.current=ce},[j]),[te,ie]=w.useState(r),ne=w.useCallback(async(ce,ve={},ee)=>{var ge;if((ge=ce==null?void 0:ce.preventDefault)==null||ge.call(ce),!te&&!ve.allowEmptySubmit)return;ee&&(U.current={...U.current,...ee});const fe=await RN(ve.experimental_attachments),Ae={messages:!te&&!fe.length&&ve.allowEmptySubmit?I.current:I.current.concat({id:v(),createdAt:new Date,role:"user",content:te,experimental_attachments:fe.length>0?fe:void 0}),headers:ve.headers,body:ve.body,data:ve.data};q(Ae),ie("")},[te,v,q]);return{messages:A||[],id:R,setMessages:M,data:L,setData:oe,error:k,append:$,reload:Y,stop:X,input:te,setInput:ie,handleInputChange:ce=>{ie(ce.target.value)},handleSubmit:ne,isLoading:K,addToolResult:({toolCallId:ce,result:ve})=>{const ee=I.current.map((fe,Se,Ae)=>Se===Ae.length-1&&fe.role==="assistant"&&fe.toolInvocations?{...fe,toolInvocations:fe.toolInvocations.map(ze=>ze.toolCallId===ce?{...ze,result:ve,state:"result"}:ze)}:fe);D(ee,!1);const ge=ee[ee.length-1];MN(ge)&&q({messages:ee})}}}function MN(e){return e.role==="assistant"&&e.toolInvocations&&e.toolInvocations.length>0&&e.toolInvocations.every(t=>"result"in t)}function NRe(e){let t=0;for(let n=e.length-1;n>=0&&e[n].role==="assistant";n--)t++;return t}const Jj="Switch",[kRe,R3e]=ls(Jj),[LRe,FRe]=kRe(Jj),jRe=w.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,...u}=e,[d,f]=w.useState(null),p=so(t,x=>f(x)),m=w.useRef(!1),v=d?!!d.closest("form"):!0,[y=!1,b]=cs({prop:o,defaultProp:i,onChange:c});return w.createElement(LRe,{scope:n,checked:y,disabled:a},w.createElement(On.button,He({type:"button",role:"switch","aria-checked":y,"aria-required":s,"data-state":ez(y),"data-disabled":a?"":void 0,disabled:a,value:l},u,{ref:p,onClick:Ft(e.onClick,x=>{b(E=>!E),v&&(m.current=x.isPropagationStopped(),m.current||x.stopPropagation())})})),v&&w.createElement(VRe,{control:d,bubbles:!m.current,name:r,value:l,checked:y,required:s,disabled:a,style:{transform:"translateX(-100%)"}}))}),zRe="SwitchThumb",BRe=w.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=FRe(zRe,n);return w.createElement(On.span,He({"data-state":ez(o.checked),"data-disabled":o.disabled?"":void 0},r,{ref:t}))}),VRe=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=w.useRef(null),s=ej(n),a=t2(t);return w.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[s,n,r]),w.createElement("input",He({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 ez(e){return e?"checked":"unchecked"}const Ly=jRe,tz=BRe,nz=S.forwardRef(({className:e,...t},n)=>C.jsx(Ly,{className:xe("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:C.jsx(tz,{className:xe("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")})}));nz.displayName=Ly.displayName;const HRe=S.forwardRef(({className:e,...t},n)=>C.jsx(Ly,{className:xe("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:C.jsx(tz,{className:xe("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")})}));HRe.displayName=Ly.displayName;function WRe(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const URe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,GRe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,qRe={};function IN(e,t){return((t||qRe).jsx?GRe:URe).test(e)}const YRe=/[ \t\n\f\r]/g;function KRe(e){return typeof e=="object"?e.type==="text"?$N(e.value):!1:$N(e)}function $N(e){return e.replace(YRe,"")===""}class Mg{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}Mg.prototype.property={};Mg.prototype.normal={};Mg.prototype.space=null;function rz(e,t){const n={},r={};let o=-1;for(;++o<e.length;)Object.assign(n,e[o].property),Object.assign(r,e[o].normal);return new Mg(n,r,t)}function G_(e){return e.toLowerCase()}class si{constructor(t,n){this.property=t,this.attribute=n}}si.prototype.space=null;si.prototype.boolean=!1;si.prototype.booleanish=!1;si.prototype.overloadedBoolean=!1;si.prototype.number=!1;si.prototype.commaSeparated=!1;si.prototype.spaceSeparated=!1;si.prototype.commaOrSpaceSeparated=!1;si.prototype.mustUseProperty=!1;si.prototype.defined=!1;let XRe=0;const bt=Zc(),qn=Zc(),oz=Zc(),Te=Zc(),hn=Zc(),td=Zc(),vo=Zc();function Zc(){return 2**++XRe}const q_=Object.freeze(Object.defineProperty({__proto__:null,boolean:bt,booleanish:qn,commaOrSpaceSeparated:vo,commaSeparated:td,number:Te,overloadedBoolean:oz,spaceSeparated:hn},Symbol.toStringTag,{value:"Module"})),Ww=Object.keys(q_);class wP extends si{constructor(t,n,r,o){let i=-1;if(super(t,n),NN(this,"space",o),typeof r=="number")for(;++i<Ww.length;){const s=Ww[i];NN(this,Ww[i],(r&q_[s])===q_[s])}}}wP.prototype.defined=!0;function NN(e,t,n){n&&(e[t]=n)}const QRe={}.hasOwnProperty;function lf(e){const t={},n={};let r;for(r in e.properties)if(QRe.call(e.properties,r)){const o=e.properties[r],i=new wP(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[G_(r)]=r,n[G_(i.attribute)]=r}return new Mg(t,n,e.space)}const iz=lf({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),sz=lf({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function az(e,t){return t in e?e[t]:t}function lz(e,t){return az(e,t.toLowerCase())}const cz=lf({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:lz,properties:{xmlns:null,xmlnsXLink:null}}),uz=lf({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:qn,ariaAutoComplete:null,ariaBusy:qn,ariaChecked:qn,ariaColCount:Te,ariaColIndex:Te,ariaColSpan:Te,ariaControls:hn,ariaCurrent:null,ariaDescribedBy:hn,ariaDetails:null,ariaDisabled:qn,ariaDropEffect:hn,ariaErrorMessage:null,ariaExpanded:qn,ariaFlowTo:hn,ariaGrabbed:qn,ariaHasPopup:null,ariaHidden:qn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:hn,ariaLevel:Te,ariaLive:null,ariaModal:qn,ariaMultiLine:qn,ariaMultiSelectable:qn,ariaOrientation:null,ariaOwns:hn,ariaPlaceholder:null,ariaPosInSet:Te,ariaPressed:qn,ariaReadOnly:qn,ariaRelevant:null,ariaRequired:qn,ariaRoleDescription:hn,ariaRowCount:Te,ariaRowIndex:Te,ariaRowSpan:Te,ariaSelected:qn,ariaSetSize:Te,ariaSort:null,ariaValueMax:Te,ariaValueMin:Te,ariaValueNow:Te,ariaValueText:null,role:null}}),ZRe=lf({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:lz,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:td,acceptCharset:hn,accessKey:hn,action:null,allow:null,allowFullScreen:bt,allowPaymentRequest:bt,allowUserMedia:bt,alt:null,as:null,async:bt,autoCapitalize:null,autoComplete:hn,autoFocus:bt,autoPlay:bt,blocking:hn,capture:null,charSet:null,checked:bt,cite:null,className:hn,cols:Te,colSpan:null,content:null,contentEditable:qn,controls:bt,controlsList:hn,coords:Te|td,crossOrigin:null,data:null,dateTime:null,decoding:null,default:bt,defer:bt,dir:null,dirName:null,disabled:bt,download:oz,draggable:qn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:bt,formTarget:null,headers:hn,height:Te,hidden:bt,high:Te,href:null,hrefLang:null,htmlFor:hn,httpEquiv:hn,id:null,imageSizes:null,imageSrcSet:null,inert:bt,inputMode:null,integrity:null,is:null,isMap:bt,itemId:null,itemProp:hn,itemRef:hn,itemScope:bt,itemType:hn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:bt,low:Te,manifest:null,max:null,maxLength:Te,media:null,method:null,min:null,minLength:Te,multiple:bt,muted:bt,name:null,nonce:null,noModule:bt,noValidate:bt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:bt,optimum:Te,pattern:null,ping:hn,placeholder:null,playsInline:bt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:bt,referrerPolicy:null,rel:hn,required:bt,reversed:bt,rows:Te,rowSpan:Te,sandbox:hn,scope:null,scoped:bt,seamless:bt,selected:bt,shadowRootDelegatesFocus:bt,shadowRootMode:null,shape:null,size:Te,sizes:null,slot:null,span:Te,spellCheck:qn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Te,step:null,style:null,tabIndex:Te,target:null,title:null,translate:null,type:null,typeMustMatch:bt,useMap:null,value:qn,width:Te,wrap:null,align:null,aLink:null,archive:hn,axis:null,background:null,bgColor:null,border:Te,borderColor:null,bottomMargin:Te,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:bt,declare:bt,event:null,face:null,frame:null,frameBorder:null,hSpace:Te,leftMargin:Te,link:null,longDesc:null,lowSrc:null,marginHeight:Te,marginWidth:Te,noResize:bt,noHref:bt,noShade:bt,noWrap:bt,object:null,profile:null,prompt:null,rev:null,rightMargin:Te,rules:null,scheme:null,scrolling:qn,standby:null,summary:null,text:null,topMargin:Te,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Te,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:bt,disableRemotePlayback:bt,prefix:null,property:null,results:Te,security:null,unselectable:null}}),JRe=lf({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:az,properties:{about:vo,accentHeight:Te,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Te,amplitude:Te,arabicForm:null,ascent:Te,attributeName:null,attributeType:null,azimuth:Te,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Te,by:null,calcMode:null,capHeight:Te,className:hn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Te,diffuseConstant:Te,direction:null,display:null,dur:null,divisor:Te,dominantBaseline:null,download:bt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Te,enableBackground:null,end:null,event:null,exponent:Te,externalResourcesRequired:null,fill:null,fillOpacity:Te,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:td,g2:td,glyphName:td,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Te,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Te,horizOriginX:Te,horizOriginY:Te,id:null,ideographic:Te,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Te,k:Te,k1:Te,k2:Te,k3:Te,k4:Te,kernelMatrix:vo,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Te,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Te,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Te,overlineThickness:Te,paintOrder:null,panose1:null,path:null,pathLength:Te,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:hn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Te,pointsAtY:Te,pointsAtZ:Te,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:vo,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:vo,rev:vo,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:vo,requiredFeatures:vo,requiredFonts:vo,requiredFormats:vo,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Te,specularExponent:Te,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Te,strikethroughThickness:Te,string:null,stroke:null,strokeDashArray:vo,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Te,strokeOpacity:Te,strokeWidth:null,style:null,surfaceScale:Te,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:vo,tabIndex:Te,tableValues:null,target:null,targetX:Te,targetY:Te,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:vo,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Te,underlineThickness:Te,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Te,values:null,vAlphabetic:Te,vMathematical:Te,vectorEffect:null,vHanging:Te,vIdeographic:Te,version:null,vertAdvY:Te,vertOriginX:Te,vertOriginY:Te,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Te,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),e2e=/^data[-\w.:]+$/i,kN=/-[a-z]/g,t2e=/[A-Z]/g;function n2e(e,t){const n=G_(t);let r=t,o=si;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&e2e.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(kN,o2e);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!kN.test(i)){let s=i.replace(t2e,r2e);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=wP}return new o(r,t)}function r2e(e){return"-"+e.toLowerCase()}function o2e(e){return e.charAt(1).toUpperCase()}const i2e={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},s2e=rz([sz,iz,cz,uz,ZRe],"html"),SP=rz([sz,iz,cz,uz,JRe],"svg");function a2e(e){return e.join(" ").trim()}var dz={},LN=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,l2e=/\n/g,c2e=/^\s*/,u2e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d2e=/^:\s*/,f2e=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,h2e=/^[;\s]*/,p2e=/^\s+|\s+$/g,g2e=`
362
+ `,FN="/",jN="*",Gl="",m2e="comment",v2e="declaration",b2e=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(m){var v=m.match(l2e);v&&(n+=v.length);var y=m.lastIndexOf(g2e);r=~y?m.length-y:r+m.length}function i(){var m={line:n,column:r};return function(v){return v.position=new s(m),c(),v}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var v=new Error(t.source+":"+n+":"+r+": "+m);if(v.reason=m,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function l(m){var v=m.exec(e);if(v){var y=v[0];return o(y),e=e.slice(y.length),v}}function c(){l(c2e)}function u(m){var v;for(m=m||[];v=d();)v!==!1&&m.push(v);return m}function d(){var m=i();if(!(FN!=e.charAt(0)||jN!=e.charAt(1))){for(var v=2;Gl!=e.charAt(v)&&(jN!=e.charAt(v)||FN!=e.charAt(v+1));)++v;if(v+=2,Gl===e.charAt(v-1))return a("End of comment missing");var y=e.slice(2,v-2);return r+=2,o(y),e=e.slice(v),r+=2,m({type:m2e,comment:y})}}function f(){var m=i(),v=l(u2e);if(v){if(d(),!l(d2e))return a("property missing ':'");var y=l(f2e),b=m({type:v2e,property:zN(v[0].replace(LN,Gl)),value:y?zN(y[0].replace(LN,Gl)):Gl});return l(h2e),b}}function p(){var m=[];u(m);for(var v;v=f();)v!==!1&&(m.push(v),u(m));return m}return c(),p()};function zN(e){return e?e.replace(p2e,Gl):Gl}var y2e=Pa&&Pa.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dz,"__esModule",{value:!0});var x2e=y2e(b2e);function w2e(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,x2e.default)(e),o=typeof t=="function";return r.forEach(function(i){if(i.type==="declaration"){var s=i.property,a=i.value;o?t(s,a,i):a&&(n=n||{},n[s]=a)}}),n}var BN=dz.default=w2e;const S2e=BN.default||BN,fz=hz("end"),CP=hz("start");function hz(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function C2e(e){const t=CP(e),n=fz(e);if(t&&n)return{start:t,end:n}}function zh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?VN(e.position):"start"in e||"end"in e?VN(e):"line"in e||"column"in e?Y_(e):""}function Y_(e){return HN(e&&e.line)+":"+HN(e&&e.column)}function VN(e){return Y_(e&&e.start)+"-"+Y_(e&&e.end)}function HN(e){return e&&typeof e=="number"?e:1}class _r extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let o="",i={},s=!1;if(n&&("line"in n&&"column"in n?i={place:n}:"start"in n&&"end"in n?i={place:n}:"type"in n?i={ancestors:[n],place:n.position}:i={...n}),typeof t=="string"?o=t:!i.cause&&t&&(s=!0,o=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?i.ruleId=r:(i.source=r.slice(0,l),i.ruleId=r.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const a=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=o,this.line=a?a.line:void 0,this.name=zh(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}_r.prototype.file="";_r.prototype.name="";_r.prototype.reason="";_r.prototype.message="";_r.prototype.stack="";_r.prototype.column=void 0;_r.prototype.line=void 0;_r.prototype.ancestors=void 0;_r.prototype.cause=void 0;_r.prototype.fatal=void 0;_r.prototype.place=void 0;_r.prototype.ruleId=void 0;_r.prototype.source=void 0;const _P={}.hasOwnProperty,_2e=new Map,E2e=/[A-Z]/g,R2e=/-([a-z])/g,P2e=new Set(["table","tbody","thead","tfoot","tr"]),O2e=new Set(["td","th"]),pz="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function A2e(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=L2e(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=k2e(n,t.jsx,t.jsxs)}const o={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?SP:s2e,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=gz(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function gz(e,t,n){if(t.type==="element")return T2e(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return D2e(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return I2e(e,t,n);if(t.type==="mdxjsEsm")return M2e(e,t);if(t.type==="root")return $2e(e,t,n);if(t.type==="text")return N2e(e,t)}function T2e(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=SP,e.schema=o),e.ancestors.push(t);const i=vz(e,t.tagName,!1),s=F2e(e,t);let a=RP(e,t);return P2e.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!KRe(l):!0})),mz(e,s,i,t),EP(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function D2e(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Dp(e,t.position)}function M2e(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Dp(e,t.position)}function I2e(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=SP,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:vz(e,t.name,!0),s=j2e(e,t),a=RP(e,t);return mz(e,s,i,t),EP(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function $2e(e,t,n){const r={};return EP(r,RP(e,t)),e.create(t,e.Fragment,r,n)}function N2e(e,t){return t.value}function mz(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function EP(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function k2e(e,t,n){return r;function r(o,i,s,a){const c=Array.isArray(s.children)?n:t;return a?c(i,s,a):c(i,s)}}function L2e(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=CP(r);return t(o,i,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function F2e(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&_P.call(t.properties,o)){const i=z2e(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&O2e.has(t.tagName)?r=a:n[s]=a}}if(r){const i=n.style||(n.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function j2e(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const i=r.data.estree.body[0];i.type;const s=i.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Dp(e,t.position);else{const o=r.name;let i;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,i=e.evaluater.evaluateExpression(a.expression)}else Dp(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function RP(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:_2e;for(;++r<t.children.length;){const i=t.children[r];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=o.get(l)||0;s=l+"-"+c,o.set(l,c+1)}}const a=gz(e,i,s);a!==void 0&&n.push(a)}return n}function z2e(e,t,n){const r=n2e(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?WRe(n):a2e(n)),r.property==="style"){let o=typeof n=="object"?n:B2e(e,String(n));return e.stylePropertyNameCase==="css"&&(o=V2e(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?i2e[r.property]||r.property:r.attribute,n]}}function B2e(e,t){const n={};try{S2e(t,r)}catch(o){if(!e.ignoreInvalidStyle){const i=o,s=new _r("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:i,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=pz+"#cannot-parse-style-attribute",s}}return n;function r(o,i){let s=o;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(R2e,W2e)),n[s]=i}}function vz(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const o=t.split(".");let i=-1,s;for(;++i<o.length;){const a=IN(o[i])?{type:"Identifier",name:o[i]}:{type:"Literal",value:o[i]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(i&&a.type==="Literal"),optional:!1}:a}r=s}else r=IN(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return _P.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Dp(e)}function Dp(e,t){const n=new _r("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=pz+"#cannot-handle-mdx-estrees-without-createevaluater",n}function V2e(e){const t={};let n;for(n in e)_P.call(e,n)&&(t[H2e(n)]=e[n]);return t}function H2e(e){let t=e.replace(E2e,U2e);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function W2e(e,t){return t.toUpperCase()}function U2e(e){return"-"+e.toLowerCase()}const Uw={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},G2e={};function q2e(e,t){const n=t||G2e,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return bz(e,r,o)}function bz(e,t,n){if(Y2e(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return WN(e.children,t,n)}return Array.isArray(e)?WN(e,t,n):""}function WN(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=bz(e[o],t,n);return r.join("")}function Y2e(e){return!!(e&&typeof e=="object")}const UN=document.createElement("i");function PP(e){const t="&"+e+";";UN.innerHTML=t;const n=UN.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function as(e,t,n,r){const o=e.length;let i=0,s;if(t<0?t=-t>o?0:o+t:t=t>o?o:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);i<r.length;)s=r.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function Zo(e,t){return e.length>0?(as(e,e.length,0,t),e):t}const GN={}.hasOwnProperty;function K2e(e){const t={};let n=-1;for(;++n<e.length;)X2e(t,e[n]);return t}function X2e(e,t){let n;for(n in t){const o=(GN.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){GN.call(o,s)||(o[s]=[]);const a=i[s];Q2e(o[s],Array.isArray(a)?a:a?[a]:[])}}}function Q2e(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);as(e,0,0,r)}function yz(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function nd(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Z2e=gl(new RegExp("\\p{P}","u")),Xi=gl(/[A-Za-z]/),_o=gl(/[\dA-Za-z]/),J2e=gl(/[#-'*+\--9=?A-Z^-~]/);function K_(e){return e!==null&&(e<32||e===127)}const X_=gl(/\d/),ePe=gl(/[\dA-Fa-f]/),xz=gl(/[!-/:-@[-`{-~]/);function rt(e){return e!==null&&e<-2}function io(e){return e!==null&&(e<0||e===32)}function Gt(e){return e===-2||e===-1||e===32}function tPe(e){return xz(e)||Z2e(e)}const nPe=gl(/\s/);function gl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function cf(e){const t=[];let n=-1,r=0,o=0;for(;++n<e.length;){const i=e.charCodeAt(n);let s="";if(i===37&&_o(e.charCodeAt(n+1))&&_o(e.charCodeAt(n+2)))o=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const a=e.charCodeAt(n+1);i<56320&&a>56319&&a<57344?(s=String.fromCharCode(i,a),o=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+o+1,s=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}function pn(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Gt(l)?(e.enter(n),a(l)):t(l)}function a(l){return Gt(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const rPe={tokenize:oPe};function oPe(e){const t=e.attempt(this.parser.constructs.contentInitial,r,o);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),pn(e,t,"linePrefix")}function o(a){return e.enter("paragraph"),i(a)}function i(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return rt(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const iPe={tokenize:sPe},qN={tokenize:aPe};function sPe(e){const t=this,n=[];let r=0,o,i,s;return a;function a(E){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,l,c)(E)}return c(E)}function l(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&x();const R=t.events.length;let P=R,O;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){O=t.events[P][1].end;break}b(r);let A=R;for(;A<t.events.length;)t.events[A][1].end=Object.assign({},O),A++;return as(t.events,P+1,0,t.events.slice(R)),t.events.length=A,c(E)}return a(E)}function c(E){if(r===n.length){if(!o)return f(E);if(o.currentConstruct&&o.currentConstruct.concrete)return m(E);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(qN,u,d)(E)}function u(E){return o&&x(),b(r),f(E)}function d(E){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(E)}function f(E){return t.containerState={},e.attempt(qN,p,m)(E)}function p(E){return r++,n.push([t.currentConstruct,t.containerState]),f(E)}function m(E){if(E===null){o&&x(),b(0),e.consume(E);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:i,_tokenizer:o}),v(E)}function v(E){if(E===null){y(e.exit("chunkFlow"),!0),b(0),e.consume(E);return}return rt(E)?(e.consume(E),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(E),v)}function y(E,R){const P=t.sliceStream(E);if(R&&P.push(null),E.previous=i,i&&(i.next=E),i=E,o.defineSkip(E.start),o.write(P),t.parser.lazy[E.start.line]){let O=o.events.length;for(;O--;)if(o.events[O][1].start.offset<s&&(!o.events[O][1].end||o.events[O][1].end.offset>s))return;const A=t.events.length;let D=A,I,L;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(I){L=t.events[D][1].end;break}I=!0}for(b(r),O=A;O<t.events.length;)t.events[O][1].end=Object.assign({},L),O++;as(t.events,D+1,0,t.events.slice(A)),t.events.length=O}}function b(E){let R=n.length;for(;R-- >E;){const P=n[R];t.containerState=P[1],P[0].exit.call(t,e)}n.length=E}function x(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function aPe(e,t,n){return pn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function YN(e){if(e===null||io(e)||nPe(e))return 1;if(tPe(e))return 2}function OP(e,t,n){const r=[];let o=-1;for(;++o<e.length;){const i=e[o].resolveAll;i&&!r.includes(i)&&(t=i(t,n),r.push(i))}return t}const Q_={name:"attention",tokenize:cPe,resolveAll:lPe};function lPe(e,t){let n=-1,r,o,i,s,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d=Object.assign({},e[r][1].end),f=Object.assign({},e[n][1].start);KN(d,-l),KN(f,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:f},i={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o={type:l>1?"strong":"emphasis",start:Object.assign({},s.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},s.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Zo(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Zo(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=Zo(c,OP(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Zo(c,[["exit",i,t],["enter",a,t],["exit",a,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Zo(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,as(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function cPe(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=YN(r);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===i)return e.consume(l),a;const c=e.exit("attentionSequence"),u=YN(l),d=!u||u===2&&o||n.includes(l),f=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?d:d&&(o||!f)),c._close=!!(i===42?f:f&&(u||!d)),t(l)}}function KN(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const uPe={name:"autolink",tokenize:dPe};function dPe(e,t,n){let r=0;return o;function o(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(p){return Xi(p)?(e.consume(p),s):c(p)}function s(p){return p===43||p===45||p===46||_o(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||_o(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||K_(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):J2e(p)?(e.consume(p),c):n(p)}function u(p){return _o(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||_o(p))&&r++<63){const m=p===45?f:d;return e.consume(p),m}return n(p)}}const Fy={tokenize:fPe,partial:!0};function fPe(e,t,n){return r;function r(i){return Gt(i)?pn(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||rt(i)?t(i):n(i)}}const wz={name:"blockQuote",tokenize:hPe,continuation:{tokenize:pPe},exit:gPe};function hPe(e,t,n){const r=this;return o;function o(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return n(s)}function i(s){return Gt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function pPe(e,t,n){const r=this;return o;function o(s){return Gt(s)?pn(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(wz,t,n)(s)}}function gPe(e){e.exit("blockQuote")}const Sz={name:"characterEscape",tokenize:mPe};function mPe(e,t,n){return r;function r(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),o}function o(i){return xz(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const Cz={name:"characterReference",tokenize:vPe};function vPe(e,t,n){const r=this;let o=0,i,s;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,s=_o,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=ePe,u):(e.enter("characterReferenceValue"),i=7,s=X_,u(d))}function u(d){if(d===59&&o){const f=e.exit("characterReferenceValue");return s===_o&&!PP(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&o++<i?(e.consume(d),u):n(d)}}const XN={tokenize:yPe,partial:!0},QN={name:"codeFenced",tokenize:bPe,concrete:!0};function bPe(e,t,n){const r=this,o={tokenize:P,partial:!0};let i=0,s=0,a;return l;function l(O){return c(O)}function c(O){const A=r.events[r.events.length-1];return i=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(O)}function u(O){return O===a?(s++,e.consume(O),u):s<3?n(O):(e.exit("codeFencedFenceSequence"),Gt(O)?pn(e,d,"whitespace")(O):d(O))}function d(O){return O===null||rt(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(XN,v,R)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(O))}function f(O){return O===null||rt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(O)):Gt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),pn(e,p,"whitespace")(O)):O===96&&O===a?n(O):(e.consume(O),f)}function p(O){return O===null||rt(O)?d(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(O))}function m(O){return O===null||rt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(O)):O===96&&O===a?n(O):(e.consume(O),m)}function v(O){return e.attempt(o,R,y)(O)}function y(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),b}function b(O){return i>0&&Gt(O)?pn(e,x,"linePrefix",i+1)(O):x(O)}function x(O){return O===null||rt(O)?e.check(XN,v,R)(O):(e.enter("codeFlowValue"),E(O))}function E(O){return O===null||rt(O)?(e.exit("codeFlowValue"),x(O)):(e.consume(O),E)}function R(O){return e.exit("codeFenced"),t(O)}function P(O,A,D){let I=0;return L;function L(k){return O.enter("lineEnding"),O.consume(k),O.exit("lineEnding"),j}function j(k){return O.enter("codeFencedFence"),Gt(k)?pn(O,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):z(k)}function z(k){return k===a?(O.enter("codeFencedFenceSequence"),K(k)):D(k)}function K(k){return k===a?(I++,O.consume(k),K):I>=s?(O.exit("codeFencedFenceSequence"),Gt(k)?pn(O,H,"whitespace")(k):H(k)):D(k)}function H(k){return k===null||rt(k)?(O.exit("codeFencedFence"),A(k)):D(k)}}}function yPe(e,t,n){const r=this;return o;function o(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Gw={name:"codeIndented",tokenize:wPe},xPe={tokenize:SPe,partial:!0};function wPe(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),pn(e,i,"linePrefix",5)(c)}function i(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?s(c):n(c)}function s(c){return c===null?l(c):rt(c)?e.attempt(xPe,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||rt(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function SPe(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):rt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):pn(e,i,"linePrefix",5)(s)}function i(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):rt(s)?o(s):n(s)}}const CPe={name:"codeText",tokenize:RPe,resolve:_Pe,previous:EPe};function _Pe(e){let t=e.length-4,n=3,r,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)o===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(o=r):(r===t||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),t-=r-o-2,r=o+2),o=void 0);return e}function EPe(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function RPe(e,t,n){let r=0,o,i;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(i=e.enter("codeTextSequence"),o=0,u(d)):rt(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||rt(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),o++,u):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(i.type="codeTextData",c(d))}}function _z(e){const t={};let n=-1,r,o,i,s,a,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,PPe(e,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--&&(s=e[i],s[1].type==="lineEnding"||s[1].type==="lineEndingBlank");)s[0]==="enter"&&(o&&(e[o][1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);o&&(r[1].end=Object.assign({},e[o][1].start),a=e.slice(o,n),a.unshift(r),as(e,o,n-o+1,a))}}return!c}function PPe(e,t){const n=e[t][1],r=e[t][2];let o=t-1;const i=[],s=n._tokenizer||r.parser[n.contentType](n.start),a=s.events,l=[],c={};let u,d,f=-1,p=n,m=0,v=0;const y=[v];for(;p;){for(;e[++o][1]!==p;);i.push(o),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(v=f+1,y.push(v),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):y.pop(),f=y.length;f--;){const b=a.slice(y[f],y[f+1]),x=i.pop();l.unshift([x,x+b.length-1]),as(e,x,2,b)}for(f=-1;++f<l.length;)c[m+l[f][0]]=m+l[f][1],m+=l[f][1]-l[f][0]-1;return c}const OPe={tokenize:DPe,resolve:TPe},APe={tokenize:MPe,partial:!0};function TPe(e){return _z(e),e}function DPe(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),o(a)}function o(a){return a===null?i(a):rt(a)?e.check(APe,s,i)(a):(e.consume(a),o)}function i(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,o}}function MPe(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),pn(e,i,"linePrefix")}function i(s){if(s===null||rt(s))return n(s);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Ez(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(b){return b===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(b),e.exit(i),f):b===null||b===32||b===41||K_(b)?n(b):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),v(b))}function f(b){return b===62?(e.enter(i),e.consume(b),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===62?(e.exit("chunkString"),e.exit(a),f(b)):b===null||b===60||rt(b)?n(b):(e.consume(b),b===92?m:p)}function m(b){return b===60||b===62||b===92?(e.consume(b),p):p(b)}function v(b){return!u&&(b===null||b===41||io(b))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(b)):u<c&&b===40?(e.consume(b),u++,v):b===41?(e.consume(b),u--,v):b===null||b===32||b===40||K_(b)?n(b):(e.consume(b),b===92?y:v)}function y(b){return b===40||b===41||b===92?(e.consume(b),v):v(b)}}function Rz(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(o),e.consume(p),e.exit(o),e.enter(i),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(i),e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):rt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||rt(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!Gt(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function Pz(e,t,n,r,o,i){let s;return a;function a(f){return f===34||f===39||f===40?(e.enter(r),e.enter(o),e.consume(f),e.exit(o),s=f===40?41:f,l):n(f)}function l(f){return f===s?(e.enter(o),e.consume(f),e.exit(o),e.exit(r),t):(e.enter(i),c(f))}function c(f){return f===s?(e.exit(i),l(s)):f===null?n(f):rt(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),pn(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===s||f===null||rt(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:u)}function d(f){return f===s||f===92?(e.consume(f),u):u(f)}}function Bh(e,t){let n;return r;function r(o){return rt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Gt(o)?pn(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const IPe={name:"definition",tokenize:NPe},$Pe={tokenize:kPe,partial:!0};function NPe(e,t,n){const r=this;let o;return i;function i(p){return e.enter("definition"),s(p)}function s(p){return Rz.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return o=nd(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return io(p)?Bh(e,c)(p):c(p)}function c(p){return Ez(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt($Pe,d,d)(p)}function d(p){return Gt(p)?pn(e,f,"whitespace")(p):f(p)}function f(p){return p===null||rt(p)?(e.exit("definition"),r.parser.defined.push(o),t(p)):n(p)}}function kPe(e,t,n){return r;function r(a){return io(a)?Bh(e,o)(a):n(a)}function o(a){return Pz(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Gt(a)?pn(e,s,"whitespace")(a):s(a)}function s(a){return a===null||rt(a)?t(a):n(a)}}const LPe={name:"hardBreakEscape",tokenize:FPe};function FPe(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return rt(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const jPe={name:"headingAtx",tokenize:BPe,resolve:zPe};function zPe(e,t){let n=e.length-2,r=3,o,i;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},i={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},as(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function BPe(e,t,n){let r=0;return o;function o(u){return e.enter("atxHeading"),i(u)}function i(u){return e.enter("atxHeadingSequence"),s(u)}function s(u){return u===35&&r++<6?(e.consume(u),s):u===null||io(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||rt(u)?(e.exit("atxHeading"),t(u)):Gt(u)?pn(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||io(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const VPe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ZN=["pre","script","style","textarea"],HPe={name:"htmlFlow",tokenize:qPe,resolveTo:GPe,concrete:!0},WPe={tokenize:KPe,partial:!0},UPe={tokenize:YPe,partial:!0};function GPe(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function qPe(e,t,n){const r=this;let o,i,s,a,l;return c;function c(M){return u(M)}function u(M){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(M),d}function d(M){return M===33?(e.consume(M),f):M===47?(e.consume(M),i=!0,v):M===63?(e.consume(M),o=3,r.interrupt?t:$):Xi(M)?(e.consume(M),s=String.fromCharCode(M),y):n(M)}function f(M){return M===45?(e.consume(M),o=2,p):M===91?(e.consume(M),o=5,a=0,m):Xi(M)?(e.consume(M),o=4,r.interrupt?t:$):n(M)}function p(M){return M===45?(e.consume(M),r.interrupt?t:$):n(M)}function m(M){const oe="CDATA[";return M===oe.charCodeAt(a++)?(e.consume(M),a===oe.length?r.interrupt?t:z:m):n(M)}function v(M){return Xi(M)?(e.consume(M),s=String.fromCharCode(M),y):n(M)}function y(M){if(M===null||M===47||M===62||io(M)){const oe=M===47,te=s.toLowerCase();return!oe&&!i&&ZN.includes(te)?(o=1,r.interrupt?t(M):z(M)):VPe.includes(s.toLowerCase())?(o=6,oe?(e.consume(M),b):r.interrupt?t(M):z(M)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(M):i?x(M):E(M))}return M===45||_o(M)?(e.consume(M),s+=String.fromCharCode(M),y):n(M)}function b(M){return M===62?(e.consume(M),r.interrupt?t:z):n(M)}function x(M){return Gt(M)?(e.consume(M),x):L(M)}function E(M){return M===47?(e.consume(M),L):M===58||M===95||Xi(M)?(e.consume(M),R):Gt(M)?(e.consume(M),E):L(M)}function R(M){return M===45||M===46||M===58||M===95||_o(M)?(e.consume(M),R):P(M)}function P(M){return M===61?(e.consume(M),O):Gt(M)?(e.consume(M),P):E(M)}function O(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),l=M,A):Gt(M)?(e.consume(M),O):D(M)}function A(M){return M===l?(e.consume(M),l=null,I):M===null||rt(M)?n(M):(e.consume(M),A)}function D(M){return M===null||M===34||M===39||M===47||M===60||M===61||M===62||M===96||io(M)?P(M):(e.consume(M),D)}function I(M){return M===47||M===62||Gt(M)?E(M):n(M)}function L(M){return M===62?(e.consume(M),j):n(M)}function j(M){return M===null||rt(M)?z(M):Gt(M)?(e.consume(M),j):n(M)}function z(M){return M===45&&o===2?(e.consume(M),W):M===60&&o===1?(e.consume(M),B):M===62&&o===4?(e.consume(M),Y):M===63&&o===3?(e.consume(M),$):M===93&&o===5?(e.consume(M),q):rt(M)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(WPe,X,K)(M)):M===null||rt(M)?(e.exit("htmlFlowData"),K(M)):(e.consume(M),z)}function K(M){return e.check(UPe,H,X)(M)}function H(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),k}function k(M){return M===null||rt(M)?K(M):(e.enter("htmlFlowData"),z(M))}function W(M){return M===45?(e.consume(M),$):z(M)}function B(M){return M===47?(e.consume(M),s="",U):z(M)}function U(M){if(M===62){const oe=s.toLowerCase();return ZN.includes(oe)?(e.consume(M),Y):z(M)}return Xi(M)&&s.length<8?(e.consume(M),s+=String.fromCharCode(M),U):z(M)}function q(M){return M===93?(e.consume(M),$):z(M)}function $(M){return M===62?(e.consume(M),Y):M===45&&o===2?(e.consume(M),$):z(M)}function Y(M){return M===null||rt(M)?(e.exit("htmlFlowData"),X(M)):(e.consume(M),Y)}function X(M){return e.exit("htmlFlow"),t(M)}}function YPe(e,t,n){const r=this;return o;function o(s){return rt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):n(s)}function i(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function KPe(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Fy,t,n)}}const XPe={name:"htmlText",tokenize:QPe};function QPe(e,t,n){const r=this;let o,i,s;return a;function a($){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume($),l}function l($){return $===33?(e.consume($),c):$===47?(e.consume($),P):$===63?(e.consume($),E):Xi($)?(e.consume($),D):n($)}function c($){return $===45?(e.consume($),u):$===91?(e.consume($),i=0,m):Xi($)?(e.consume($),x):n($)}function u($){return $===45?(e.consume($),p):n($)}function d($){return $===null?n($):$===45?(e.consume($),f):rt($)?(s=d,B($)):(e.consume($),d)}function f($){return $===45?(e.consume($),p):d($)}function p($){return $===62?W($):$===45?f($):d($)}function m($){const Y="CDATA[";return $===Y.charCodeAt(i++)?(e.consume($),i===Y.length?v:m):n($)}function v($){return $===null?n($):$===93?(e.consume($),y):rt($)?(s=v,B($)):(e.consume($),v)}function y($){return $===93?(e.consume($),b):v($)}function b($){return $===62?W($):$===93?(e.consume($),b):v($)}function x($){return $===null||$===62?W($):rt($)?(s=x,B($)):(e.consume($),x)}function E($){return $===null?n($):$===63?(e.consume($),R):rt($)?(s=E,B($)):(e.consume($),E)}function R($){return $===62?W($):E($)}function P($){return Xi($)?(e.consume($),O):n($)}function O($){return $===45||_o($)?(e.consume($),O):A($)}function A($){return rt($)?(s=A,B($)):Gt($)?(e.consume($),A):W($)}function D($){return $===45||_o($)?(e.consume($),D):$===47||$===62||io($)?I($):n($)}function I($){return $===47?(e.consume($),W):$===58||$===95||Xi($)?(e.consume($),L):rt($)?(s=I,B($)):Gt($)?(e.consume($),I):W($)}function L($){return $===45||$===46||$===58||$===95||_o($)?(e.consume($),L):j($)}function j($){return $===61?(e.consume($),z):rt($)?(s=j,B($)):Gt($)?(e.consume($),j):I($)}function z($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(e.consume($),o=$,K):rt($)?(s=z,B($)):Gt($)?(e.consume($),z):(e.consume($),H)}function K($){return $===o?(e.consume($),o=void 0,k):$===null?n($):rt($)?(s=K,B($)):(e.consume($),K)}function H($){return $===null||$===34||$===39||$===60||$===61||$===96?n($):$===47||$===62||io($)?I($):(e.consume($),H)}function k($){return $===47||$===62||io($)?I($):n($)}function W($){return $===62?(e.consume($),e.exit("htmlTextData"),e.exit("htmlText"),t):n($)}function B($){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),U}function U($){return Gt($)?pn(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)($):q($)}function q($){return e.enter("htmlTextData"),s($)}}const AP={name:"labelEnd",tokenize:rOe,resolveTo:nOe,resolveAll:tOe},ZPe={tokenize:oOe},JPe={tokenize:iOe},eOe={tokenize:sOe};function tOe(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function nOe(e,t){let n=e.length,r=0,o,i,s,a;for(;n--;)if(o=e[n][1],i){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[n][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(i=n,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(s=n);const l={type:e[i][1].type==="labelLink"?"link":"image",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[i][1].start),end:Object.assign({},e[s][1].end)},u={type:"labelText",start:Object.assign({},e[i+r+2][1].end),end:Object.assign({},e[s-2][1].start)};return a=[["enter",l,t],["enter",c,t]],a=Zo(a,e.slice(i+1,i+r+3)),a=Zo(a,[["enter",u,t]]),a=Zo(a,OP(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=Zo(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=Zo(a,e.slice(s+1)),a=Zo(a,[["exit",l,t]]),as(e,i,e.length,a),e}function rOe(e,t,n){const r=this;let o=r.events.length,i,s;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){i=r.events[o][1];break}return a;function a(f){return i?i._inactive?d(f):(s=r.parser.defined.includes(nd(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):n(f)}function l(f){return f===40?e.attempt(ZPe,u,s?u:d)(f):f===91?e.attempt(JPe,u,s?c:d)(f):s?u(f):d(f)}function c(f){return e.attempt(eOe,u,d)(f)}function u(f){return t(f)}function d(f){return i._balanced=!0,n(f)}}function oOe(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),o}function o(d){return io(d)?Bh(e,i)(d):i(d)}function i(d){return d===41?u(d):Ez(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return io(d)?Bh(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?Pz(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return io(d)?Bh(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function iOe(e,t,n){const r=this;return o;function o(a){return Rz.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(nd(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function sOe(e,t,n){return r;function r(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),o}function o(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):n(i)}}const aOe={name:"labelStartImage",tokenize:lOe,resolveAll:AP.resolveAll};function lOe(e,t,n){const r=this;return o;function o(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),i}function i(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const cOe={name:"labelStartLink",tokenize:uOe,resolveAll:AP.resolveAll};function uOe(e,t,n){const r=this;return o;function o(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const qw={name:"lineEnding",tokenize:dOe};function dOe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),pn(e,t,"linePrefix")}}const sb={name:"thematicBreak",tokenize:fOe};function fOe(e,t,n){let r=0,o;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return o=c,a(c)}function a(c){return c===o?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||rt(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Gt(c)?pn(e,a,"whitespace")(c):a(c))}}const Yr={name:"list",tokenize:gOe,continuation:{tokenize:mOe},exit:bOe},hOe={tokenize:yOe,partial:!0},pOe={tokenize:vOe,partial:!0};function gOe(e,t,n){const r=this,o=r.events[r.events.length-1];let i=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,s=0;return a;function a(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:X_(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(sb,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return X_(p)&&++s<10?(e.consume(p),l):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Fy,r.interrupt?n:u,e.attempt(hOe,f,d))}function u(p){return r.containerState.initialBlankLine=!0,i++,f(p)}function d(p){return Gt(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):n(p)}function f(p){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function mOe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Fy,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,pn(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!Gt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(pOe,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,pn(e,e.attempt(Yr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function vOe(e,t,n){const r=this;return pn(e,o,"listItemIndent",r.containerState.size+1);function o(i){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(i):n(i)}}function bOe(e){e.exit(this.containerState.type)}function yOe(e,t,n){const r=this;return pn(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(i){const s=r.events[r.events.length-1];return!Gt(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const JN={name:"setextUnderline",tokenize:wOe,resolveTo:xOe};function xOe(e,t){let n=e.length,r,o,i;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!i&&e[n][1].type==="definition"&&(i=n);const s={type:"setextHeading",start:Object.assign({},e[o][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[o][1].type="setextHeadingText",i?(e.splice(o,0,["enter",s,t]),e.splice(i+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[i][1].end)):e[r][1]=s,e.push(["exit",s,t]),e}function wOe(e,t,n){const r=this;let o;return i;function i(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),o=c,s(c)):n(c)}function s(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===o?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),Gt(c)?pn(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||rt(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const SOe={tokenize:COe};function COe(e){const t=this,n=e.attempt(Fy,r,e.attempt(this.parser.constructs.flowInitial,o,pn(e,e.attempt(this.parser.constructs.flow,o,e.attempt(OPe,o)),"linePrefix")));return n;function r(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const _Oe={resolveAll:Az()},EOe=Oz("string"),ROe=Oz("text");function Oz(e){return{tokenize:t,resolveAll:Az(e==="text"?POe:void 0)};function t(n){const r=this,o=this.parser.constructs[e],i=n.attempt(o,s,a);return s;function s(u){return c(u)?i(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),i(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=o[u];let f=-1;if(d)for(;++f<d.length;){const p=d[f];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function Az(e){return t;function t(n,r){let o=-1,i;for(;++o<=n.length;)i===void 0?n[o]&&n[o][1].type==="data"&&(i=o,o++):(!n[o]||n[o][1].type!=="data")&&(o!==i+2&&(n[i][1].end=n[o-1][1].end,n.splice(i+2,o-i-2),o=i+2),i=void 0);return e?e(n,r):n}}function POe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],o=t.sliceStream(r);let i=o.length,s=-1,a=0,l;for(;i--;){const c=o[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(c===-2)l=!0,a++;else if(c!==-1){i++;break}}if(a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+i,_bufferIndex:i?s:r.start._bufferIndex+s},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function OOe(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const o={},i=[];let s=[],a=[];const l={consume:x,enter:E,exit:R,attempt:A(P),check:A(O),interrupt:A(O,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:p,sliceSerialize:f,now:m,defineSkip:v,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(j){return s=Zo(s,j),y(),s[s.length-1]!==null?[]:(D(t,0),c.events=OP(i,c.events,c),c.events)}function f(j,z){return TOe(p(j),z)}function p(j){return AOe(s,j)}function m(){const{line:j,column:z,offset:K,_index:H,_bufferIndex:k}=r;return{line:j,column:z,offset:K,_index:H,_bufferIndex:k}}function v(j){o[j.line]=j.column,L()}function y(){let j;for(;r._index<s.length;){const z=s[r._index];if(typeof z=="string")for(j=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<z.length;)b(z.charCodeAt(r._bufferIndex));else b(z)}}function b(j){u=u(j)}function x(j){rt(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,L()):j!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=j}function E(j,z){const K=z||{};return K.type=j,K.start=m(),c.events.push(["enter",K,c]),a.push(K),K}function R(j){const z=a.pop();return z.end=m(),c.events.push(["exit",z,c]),z}function P(j,z){D(j,z.from)}function O(j,z){z.restore()}function A(j,z){return K;function K(H,k,W){let B,U,q,$;return Array.isArray(H)?X(H):"tokenize"in H?X([H]):Y(H);function Y(ie){return ne;function ne(Z){const ae=Z!==null&&ie[Z],ce=Z!==null&&ie.null,ve=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(ce)?ce:ce?[ce]:[]];return X(ve)(Z)}}function X(ie){return B=ie,U=0,ie.length===0?W:M(ie[U])}function M(ie){return ne;function ne(Z){return $=I(),q=ie,ie.partial||(c.currentConstruct=ie),ie.name&&c.parser.constructs.disable.null.includes(ie.name)?te():ie.tokenize.call(z?Object.assign(Object.create(c),z):c,l,oe,te)(Z)}}function oe(ie){return j(q,$),k}function te(ie){return $.restore(),++U<B.length?M(B[U]):W}}}function D(j,z){j.resolveAll&&!i.includes(j)&&i.push(j),j.resolve&&as(c.events,z,c.events.length-z,j.resolve(c.events.slice(z),c)),j.resolveTo&&(c.events=j.resolveTo(c.events,c))}function I(){const j=m(),z=c.previous,K=c.currentConstruct,H=c.events.length,k=Array.from(a);return{restore:W,from:H};function W(){r=j,c.previous=z,c.currentConstruct=K,c.events.length=H,a=k,L()}}function L(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function AOe(e,t){const n=t.start._index,r=t.start._bufferIndex,o=t.end._index,i=t.end._bufferIndex;let s;if(n===o)s=[e[n].slice(r,i)];else{if(s=e.slice(n,o),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}i>0&&s.push(e[o].slice(0,i))}return s}function TOe(e,t){let n=-1;const r=[];let o;for(;++n<e.length;){const i=e[n];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
363
+ `;break}case-3:{s=`\r
364
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&o)continue;s=" ";break}default:s=String.fromCharCode(i)}o=i===-2,r.push(s)}return r.join("")}const DOe={42:Yr,43:Yr,45:Yr,48:Yr,49:Yr,50:Yr,51:Yr,52:Yr,53:Yr,54:Yr,55:Yr,56:Yr,57:Yr,62:wz},MOe={91:IPe},IOe={[-2]:Gw,[-1]:Gw,32:Gw},$Oe={35:jPe,42:sb,45:[JN,sb],60:HPe,61:JN,95:sb,96:QN,126:QN},NOe={38:Cz,92:Sz},kOe={[-5]:qw,[-4]:qw,[-3]:qw,33:aOe,38:Cz,42:Q_,60:[uPe,XPe],91:cOe,92:[LPe,Sz],93:AP,95:Q_,96:CPe},LOe={null:[Q_,_Oe]},FOe={null:[42,95]},jOe={null:[]},zOe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:FOe,contentInitial:MOe,disable:jOe,document:DOe,flow:$Oe,flowInitial:IOe,insideSpan:LOe,string:NOe,text:kOe},Symbol.toStringTag,{value:"Module"}));function BOe(e){const n=K2e([zOe,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:o(rPe),document:o(iPe),flow:o(SOe),string:o(EOe),text:o(ROe)};return r;function o(i){return s;function s(a){return OOe(r,i,a)}}}function VOe(e){for(;!_z(e););return e}const ek=/[\0\t\n\r]/g;function HOe(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let c,u,d,f,p;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),d=0,t="",n&&(i.charCodeAt(0)===65279&&d++,n=void 0);d<i.length;){if(ek.lastIndex=d,c=ek.exec(i),f=c&&c.index!==void 0?c.index:i.length,p=i.charCodeAt(f),!c){t=i.slice(d);break}if(p===10&&d===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<f&&(l.push(i.slice(d,f)),e+=f-d),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=f+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const WOe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function UOe(e){return e.replace(WOe,GOe)}function GOe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return yz(n.slice(i?2:1),i?16:10)}return PP(n)||e}const Tz={}.hasOwnProperty;function qOe(e,t,n){return typeof t!="string"&&(n=t,t=void 0),YOe(n)(VOe(BOe(n).document().write(HOe()(e,t,!0))))}function YOe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Ie),autolinkProtocol:I,autolinkEmail:I,atxHeading:i(fe),blockQuote:i(ae),characterEscape:I,characterReference:I,codeFenced:i(ce),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(ce,s),codeText:i(ve,s),codeTextData:I,data:I,codeFlowValue:I,definition:i(ee),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(ge),hardBreakEscape:i(Se),hardBreakTrailing:i(Se),htmlFlow:i(Ae,s),htmlFlowData:I,htmlText:i(Ae,s),htmlTextData:I,image:i(ze),label:s,link:i(Ie),listItem:i(ot),listItemValue:f,listOrdered:i(De,d),listUnordered:i(De),paragraph:i(_t),reference:M,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(fe),strong:i(rn),thematicBreak:i(on)},exit:{atxHeading:l(),atxHeadingSequence:P,autolink:l(),autolinkEmail:Z,autolinkProtocol:ne,blockQuote:l(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:ie,codeFenced:l(y),codeFencedFence:v,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:L,codeIndented:l(b),codeText:l(k),codeTextData:L,data:L,definition:l(),definitionDestinationString:R,definitionLabelString:x,definitionTitleString:E,emphasis:l(),hardBreakEscape:l(z),hardBreakTrailing:l(z),htmlFlow:l(K),htmlFlowData:L,htmlText:l(H),htmlTextData:L,image:l(B),label:q,labelText:U,lineEnding:j,link:l(W),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:oe,resourceDestinationString:$,resourceTitleString:Y,resource:X,setextHeading:l(D),setextHeadingLineSequence:A,setextHeadingText:O,strong:l(),thematicBreak:l()}};Dz(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(pe){let Pe={type:"root",children:[]};const je={stack:[Pe],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},qe=[];let tt=-1;for(;++tt<pe.length;)if(pe[tt][1].type==="listOrdered"||pe[tt][1].type==="listUnordered")if(pe[tt][0]==="enter")qe.push(tt);else{const sn=qe.pop();tt=o(pe,sn,tt)}for(tt=-1;++tt<pe.length;){const sn=t[pe[tt][0]];Tz.call(sn,pe[tt][1].type)&&sn[pe[tt][1].type].call(Object.assign({sliceSerialize:pe[tt][2].sliceSerialize},je),pe[tt][1])}if(je.tokenStack.length>0){const sn=je.tokenStack[je.tokenStack.length-1];(sn[1]||tk).call(je,void 0,sn[0])}for(Pe.position={start:xa(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:xa(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},tt=-1;++tt<t.transforms.length;)Pe=t.transforms[tt](Pe)||Pe;return Pe}function o(pe,Pe,je){let qe=Pe-1,tt=-1,sn=!1,_n,mn,Bn,vn;for(;++qe<=je;){const Bt=pe[qe];switch(Bt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Bt[0]==="enter"?tt++:tt--,vn=void 0;break}case"lineEndingBlank":{Bt[0]==="enter"&&(_n&&!vn&&!tt&&!Bn&&(Bn=qe),vn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:vn=void 0}if(!tt&&Bt[0]==="enter"&&Bt[1].type==="listItemPrefix"||tt===-1&&Bt[0]==="exit"&&(Bt[1].type==="listUnordered"||Bt[1].type==="listOrdered")){if(_n){let cn=qe;for(mn=void 0;cn--;){const An=pe[cn];if(An[1].type==="lineEnding"||An[1].type==="lineEndingBlank"){if(An[0]==="exit")continue;mn&&(pe[mn][1].type="lineEndingBlank",sn=!0),An[1].type="lineEnding",mn=cn}else if(!(An[1].type==="linePrefix"||An[1].type==="blockQuotePrefix"||An[1].type==="blockQuotePrefixWhitespace"||An[1].type==="blockQuoteMarker"||An[1].type==="listItemIndent"))break}Bn&&(!mn||Bn<mn)&&(_n._spread=!0),_n.end=Object.assign({},mn?pe[mn][1].start:Bt[1].end),pe.splice(mn||qe,0,["exit",_n,Bt[2]]),qe++,je++}if(Bt[1].type==="listItemPrefix"){const cn={type:"listItem",_spread:!1,start:Object.assign({},Bt[1].start),end:void 0};_n=cn,pe.splice(qe,0,["enter",cn,Bt[2]]),qe++,je++,Bn=void 0,vn=!0}}}return pe[Pe][1]._spread=sn,je}function i(pe,Pe){return je;function je(qe){a.call(this,pe(qe),qe),Pe&&Pe.call(this,qe)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(pe,Pe,je){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([Pe,je]),pe.position={start:xa(Pe.start),end:void 0}}function l(pe){return Pe;function Pe(je){pe&&pe.call(this,je),c.call(this,je)}}function c(pe,Pe){const je=this.stack.pop(),qe=this.tokenStack.pop();if(qe)qe[0].type!==pe.type&&(Pe?Pe.call(this,pe,qe[0]):(qe[1]||tk).call(this,pe,qe[0]));else throw new Error("Cannot close `"+pe.type+"` ("+zh({start:pe.start,end:pe.end})+"): it’s not open");je.position.end=xa(pe.end)}function u(){return q2e(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(pe){if(this.data.expectingFirstListItemValue){const Pe=this.stack[this.stack.length-2];Pe.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function p(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.lang=pe}function m(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.meta=pe}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function b(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=pe.replace(/(\r?\n|\r)$/g,"")}function x(pe){const Pe=this.resume(),je=this.stack[this.stack.length-1];je.label=Pe,je.identifier=nd(this.sliceSerialize(pe)).toLowerCase()}function E(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.title=pe}function R(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.url=pe}function P(pe){const Pe=this.stack[this.stack.length-1];if(!Pe.depth){const je=this.sliceSerialize(pe).length;Pe.depth=je}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function A(pe){const Pe=this.stack[this.stack.length-1];Pe.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function I(pe){const je=this.stack[this.stack.length-1].children;let qe=je[je.length-1];(!qe||qe.type!=="text")&&(qe=$t(),qe.position={start:xa(pe.start),end:void 0},je.push(qe)),this.stack.push(qe)}function L(pe){const Pe=this.stack.pop();Pe.value+=this.sliceSerialize(pe),Pe.position.end=xa(pe.end)}function j(pe){const Pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const je=Pe.children[Pe.children.length-1];je.position.end=xa(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Pe.type)&&(I.call(this,pe),L.call(this,pe))}function z(){this.data.atHardBreak=!0}function K(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=pe}function H(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=pe}function k(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=pe}function W(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Pe=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Pe,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function B(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Pe=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Pe,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function U(pe){const Pe=this.sliceSerialize(pe),je=this.stack[this.stack.length-2];je.label=UOe(Pe),je.identifier=nd(Pe).toLowerCase()}function q(){const pe=this.stack[this.stack.length-1],Pe=this.resume(),je=this.stack[this.stack.length-1];if(this.data.inReference=!0,je.type==="link"){const qe=pe.children;je.children=qe}else je.alt=Pe}function $(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.url=pe}function Y(){const pe=this.resume(),Pe=this.stack[this.stack.length-1];Pe.title=pe}function X(){this.data.inReference=void 0}function M(){this.data.referenceType="collapsed"}function oe(pe){const Pe=this.resume(),je=this.stack[this.stack.length-1];je.label=Pe,je.identifier=nd(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function te(pe){this.data.characterReferenceType=pe.type}function ie(pe){const Pe=this.sliceSerialize(pe),je=this.data.characterReferenceType;let qe;je?(qe=yz(Pe,je==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):qe=PP(Pe);const tt=this.stack.pop();tt.value+=qe,tt.position.end=xa(pe.end)}function ne(pe){L.call(this,pe);const Pe=this.stack[this.stack.length-1];Pe.url=this.sliceSerialize(pe)}function Z(pe){L.call(this,pe);const Pe=this.stack[this.stack.length-1];Pe.url="mailto:"+this.sliceSerialize(pe)}function ae(){return{type:"blockquote",children:[]}}function ce(){return{type:"code",lang:null,meta:null,value:""}}function ve(){return{type:"inlineCode",value:""}}function ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ge(){return{type:"emphasis",children:[]}}function fe(){return{type:"heading",depth:0,children:[]}}function Se(){return{type:"break"}}function Ae(){return{type:"html",value:""}}function ze(){return{type:"image",title:null,url:"",alt:null}}function Ie(){return{type:"link",title:null,url:"",children:[]}}function De(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function ot(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function _t(){return{type:"paragraph",children:[]}}function rn(){return{type:"strong",children:[]}}function $t(){return{type:"text",value:""}}function on(){return{type:"thematicBreak"}}}function xa(e){return{line:e.line,column:e.column,offset:e.offset}}function Dz(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Dz(e,r):KOe(e,r)}}function KOe(e,t){let n;for(n in t)if(Tz.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function tk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+zh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+zh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+zh({start:t.start,end:t.end})+") is still open")}function XOe(e){const t=this;t.parser=n;function n(r){return qOe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function QOe(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function ZOe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
365
+ `}]}function JOe(e,t){const n=t.value?t.value+`
366
+ `:"",r={};t.lang&&(r.className=["language-"+t.lang]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function eAe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tAe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nAe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=cf(r.toLowerCase()),i=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=i+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+o,id:n+"fnref-"+o+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(s)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function rAe(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function oAe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Mz(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const o=e.all(t),i=o[0];i&&i.type==="text"?i.value="["+i.value:o.unshift({type:"text",value:"["});const s=o[o.length-1];return s&&s.type==="text"?s.value+=r:o.push({type:"text",value:r}),o}function iAe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Mz(e,t);const o={src:cf(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"img",properties:o,children:[]};return e.patch(t,i),e.applyData(t,i)}function sAe(e,t){const n={src:cf(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function aAe(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function lAe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Mz(e,t);const o={href:cf(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const i={type:"element",tagName:"a",properties:o,children:e.all(t)};return e.patch(t,i),e.applyData(t,i)}function cAe(e,t){const n={href:cf(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function uAe(e,t,n){const r=e.all(t),o=n?dAe(n):Iz(t),i={},s=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(o||a!==0||u.type!=="element"||u.tagName!=="p")&&s.push({type:"text",value:`
367
+ `}),u.type==="element"&&u.tagName==="p"&&!o?s.push(...u.children):s.push(u)}const l=r[r.length-1];l&&(o||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
368
+ `});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function dAe(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Iz(n[r])}return t}function Iz(e){const t=e.spread;return t??e.children.length>1}function fAe(e,t){const n={},r=e.all(t);let o=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++o<r.length;){const s=r[o];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const i={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,i),e.applyData(t,i)}function hAe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pAe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function gAe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mAe(e,t){const n=e.all(t),r=n.shift(),o=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),o.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=CP(t.children[1]),l=fz(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),o.push(s)}const i={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,i),e.applyData(t,i)}function vAe(e,t,n){const r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const d=t.children[l],f={},p=s?s[l]:void 0;p&&(f.align=p);let m={type:"element",tagName:i,properties:f,children:[]};d&&(m.children=e.all(d),e.patch(d,m),m=e.applyData(d,m)),c.push(m)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function bAe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const nk=9,rk=32;function yAe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(ok(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(ok(t.slice(o),o>0,!1)),i.join("")}function ok(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===nk||i===rk;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===nk||i===rk;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function xAe(e,t){const n={type:"text",value:yAe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function wAe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const SAe={blockquote:QOe,break:ZOe,code:JOe,delete:eAe,emphasis:tAe,footnoteReference:nAe,heading:rAe,html:oAe,imageReference:iAe,image:sAe,inlineCode:aAe,linkReference:lAe,link:cAe,listItem:uAe,list:fAe,paragraph:hAe,root:pAe,strong:gAe,table:mAe,tableCell:bAe,tableRow:vAe,text:xAe,thematicBreak:wAe,toml:Dv,yaml:Dv,definition:Dv,footnoteDefinition:Dv};function Dv(){}const $z=-1,jy=0,l0=1,c0=2,TP=3,DP=4,MP=5,IP=6,Nz=7,kz=8,ik=typeof self=="object"?self:globalThis,CAe=(e,t)=>{const n=(o,i)=>(e.set(i,o),o),r=o=>{if(e.has(o))return e.get(o);const[i,s]=t[o];switch(i){case jy:case $z:return n(s,o);case l0:{const a=n([],o);for(const l of s)a.push(r(l));return a}case c0:{const a=n({},o);for(const[l,c]of s)a[r(l)]=r(c);return a}case TP:return n(new Date(s),o);case DP:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case MP:{const a=n(new Map,o);for(const[l,c]of s)a.set(r(l),r(c));return a}case IP:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case Nz:{const{name:a,message:l}=s;return n(new ik[a](l),o)}case kz:return n(BigInt(s),o);case"BigInt":return n(Object(BigInt(s)),o)}return n(new ik[i](s),o)};return r},sk=e=>CAe(new Map,e)(0),Pu="",{toString:_Ae}={},{keys:EAe}=Object,Jf=e=>{const t=typeof e;if(t!=="object"||!e)return[jy,t];const n=_Ae.call(e).slice(8,-1);switch(n){case"Array":return[l0,Pu];case"Object":return[c0,Pu];case"Date":return[TP,Pu];case"RegExp":return[DP,Pu];case"Map":return[MP,Pu];case"Set":return[IP,Pu]}return n.includes("Array")?[l0,n]:n.includes("Error")?[Nz,n]:[c0,n]},Mv=([e,t])=>e===jy&&(t==="function"||t==="symbol"),RAe=(e,t,n,r)=>{const o=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},i=s=>{if(n.has(s))return n.get(s);let[a,l]=Jf(s);switch(a){case jy:{let u=s;switch(l){case"bigint":a=kz,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([$z],s)}return o([a,u],s)}case l0:{if(l)return o([l,[...s]],s);const u=[],d=o([a,u],s);for(const f of s)u.push(i(f));return d}case c0:{if(l)switch(l){case"BigInt":return o([l,s.toString()],s);case"Boolean":case"Number":case"String":return o([l,s.valueOf()],s)}if(t&&"toJSON"in s)return i(s.toJSON());const u=[],d=o([a,u],s);for(const f of EAe(s))(e||!Mv(Jf(s[f])))&&u.push([i(f),i(s[f])]);return d}case TP:return o([a,s.toISOString()],s);case DP:{const{source:u,flags:d}=s;return o([a,{source:u,flags:d}],s)}case MP:{const u=[],d=o([a,u],s);for(const[f,p]of s)(e||!(Mv(Jf(f))||Mv(Jf(p))))&&u.push([i(f),i(p)]);return d}case IP:{const u=[],d=o([a,u],s);for(const f of s)(e||!Mv(Jf(f)))&&u.push(i(f));return d}}const{message:c}=s;return o([a,{name:l,message:c}],s)};return i},ak=(e,{json:t,lossy:n}={})=>{const r=[];return RAe(!(t||n),!!t,new Map,r)(e),r},u0=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?sk(ak(e,t)):structuredClone(e):(e,t)=>sk(ak(e,t));function PAe(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function OAe(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function AAe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||PAe,r=e.options.footnoteBackLabel||OAe,o=e.options.footnoteLabel||"Footnotes",i=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),f=cf(d.toLowerCase());let p=0;const m=[],v=e.footnoteCounts.get(d);for(;v!==void 0&&++p<=v;){m.length>0&&m.push({type:"text",value:" "});let x=typeof n=="string"?n:n(l,p);typeof x=="string"&&(x={type:"text",value:x}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(p>1?"-"+p:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,p),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const x=y.children[y.children.length-1];x&&x.type==="text"?x.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...m)}else u.push(...m);const b={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(u,!0)};e.patch(c,b),a.push(b)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...u0(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
369
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
370
+ `}]}}const Lz=function(e){if(e==null)return IAe;if(typeof e=="function")return zy(e);if(typeof e=="object")return Array.isArray(e)?TAe(e):DAe(e);if(typeof e=="string")return MAe(e);throw new Error("Expected function, string, or object as test")};function TAe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Lz(e[n]);return zy(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function DAe(e){const t=e;return zy(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function MAe(e){return zy(t);function t(n){return n&&n.type===e}}function zy(e){return t;function t(n,r,o){return!!($Ae(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function IAe(){return!0}function $Ae(e){return e!==null&&typeof e=="object"&&"type"in e}const Fz=[],NAe=!0,lk=!1,kAe="skip";function LAe(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=Lz(o),s=r?-1:1;a(e,void 0,[])();function a(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const p=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(l.type+(p?"<"+p+">":""))+")"})}return f;function f(){let p=Fz,m,v,y;if((!t||i(l,c,u[u.length-1]||void 0))&&(p=FAe(n(l,u)),p[0]===lk))return p;if("children"in l&&l.children){const b=l;if(b.children&&p[0]!==kAe)for(v=(r?b.children.length:-1)+s,y=u.concat(b);v>-1&&v<b.children.length;){const x=b.children[v];if(m=a(x,v,y)(),m[0]===lk)return m;v=typeof m[1]=="number"?m[1]:v+s}}return p}}}function FAe(e){return Array.isArray(e)?e:typeof e=="number"?[NAe,e]:e==null?Fz:[e]}function jz(e,t,n,r){let o,i,s;typeof t=="function"&&typeof n!="function"?(i=void 0,s=t,o=n):(i=t,s=n,o=r),LAe(e,i,a,o);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return s(l,d,u)}}const Z_={}.hasOwnProperty,jAe={};function zAe(e,t){const n=t||jAe,r=new Map,o=new Map,i=new Map,s={...SAe,...n.handlers},a={all:c,applyData:VAe,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:BAe,wrap:WAe};return jz(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:o,f=String(u.identifier).toUpperCase();d.has(f)||d.set(f,u)}}),a;function l(u,d){const f=u.type,p=a.handlers[f];if(Z_.call(a.handlers,f)&&p)return p(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(f)){if("children"in u){const{children:v,...y}=u,b=u0(y);return b.children=a.all(u),b}return u0(u)}return(a.options.unknownHandler||HAe)(a,u,d)}function c(u){const d=[];if("children"in u){const f=u.children;let p=-1;for(;++p<f.length;){const m=a.one(f[p],u);if(m){if(p&&f[p-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=ck(m.value)),!Array.isArray(m)&&m.type==="element")){const v=m.children[0];v&&v.type==="text"&&(v.value=ck(v.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function BAe(e,t){e.position&&(t.position=C2e(e))}function VAe(e,t){let n=t;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,i=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&i&&Object.assign(n.properties,u0(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function HAe(e,t){const n=t.data||{},r="value"in t&&!(Z_.call(n,"hProperties")||Z_.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function WAe(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
371
+ `});++r<e.length;)r&&n.push({type:"text",value:`
372
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
373
+ `}),n}function ck(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function uk(e,t){const n=zAe(e,t),r=n.one(e,void 0),o=AAe(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
374
+ `},o),i}function UAe(e,t){return e&&"run"in e?async function(n,r){const o=uk(n,{file:r,...t});await e.run(o,r)}:function(n,r){return uk(n,{file:r,...t||e})}}function dk(e){if(e)throw e}var ab=Object.prototype.hasOwnProperty,zz=Object.prototype.toString,fk=Object.defineProperty,hk=Object.getOwnPropertyDescriptor,pk=function(t){return typeof Array.isArray=="function"?Array.isArray(t):zz.call(t)==="[object Array]"},gk=function(t){if(!t||zz.call(t)!=="[object Object]")return!1;var n=ab.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&ab.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||ab.call(t,o)},mk=function(t,n){fk&&n.name==="__proto__"?fk(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},vk=function(t,n){if(n==="__proto__")if(ab.call(t,n)){if(hk)return hk(t,n).value}else return;return t[n]},GAe=function e(){var t,n,r,o,i,s,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=vk(a,n),o=vk(t,n),a!==o&&(u&&o&&(gk(o)||(i=pk(o)))?(i?(i=!1,s=r&&pk(r)?r:[]):s=r&&gk(r)?r:{},mk(a,{name:n,newValue:e(u,s,o)})):typeof o<"u"&&mk(a,{name:n,newValue:o}));return a};const Yw=sl(GAe);function J_(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function qAe(){const e=[],t={run:n,use:r};return t;function n(...o){let i=-1;const s=o.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...o);function a(l,...c){const u=e[++i];let d=-1;if(l){s(l);return}for(;++d<o.length;)(c[d]===null||c[d]===void 0)&&(c[d]=o[d]);o=c,u?YAe(u,a)(...c):s(null,...c)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),t}}function YAe(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(o);try{l=e.apply(this,s)}catch(c){const u=c;if(a&&n)throw u;return o(u)}a||(l instanceof Promise?l.then(i,o):l instanceof Error?o(l):i(l))}function o(s,...a){n||(n=!0,t(s,...a))}function i(s){o(null,s)}}const zi={basename:KAe,dirname:XAe,extname:QAe,join:ZAe,sep:"/"};function KAe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ig(e);let n=0,r=-1,o=e.length,i;if(t===void 0||t.length===0||t.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else r<0&&(i=!0,r=o+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;o--;)if(e.codePointAt(o)===47){if(i){n=o+1;break}}else s<0&&(i=!0,s=o+1),a>-1&&(e.codePointAt(o)===t.codePointAt(a--)?a<0&&(r=o):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function XAe(e){if(Ig(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function QAe(e){Ig(e);let t=e.length,n=-1,r=0,o=-1,i=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?o<0?o=t:i!==1&&(i=1):o>-1&&(i=-1)}return o<0||n<0||i===0||i===1&&o===n-1&&o===r+1?"":e.slice(o,n)}function ZAe(...e){let t=-1,n;for(;++t<e.length;)Ig(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":JAe(n)}function JAe(e){Ig(e);const t=e.codePointAt(0)===47;let n=eTe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function eTe(e,t){let n="",r=0,o=-1,i=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(o===s-1||i===1))if(o!==s-1&&i===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),o=s,i=0;continue}}else if(n.length>0){n="",r=0,o=s,i=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),r=s-o-1;o=s,i=0}else a===46&&i>-1?i++:i=-1}return n}function Ig(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const tTe={cwd:nTe};function nTe(){return"/"}function eE(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function rTe(e){if(typeof e=="string")e=new URL(e);else if(!eE(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return oTe(e)}function oTe(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(t)}const Kw=["history","path","basename","stem","extname","dirname"];class Bz{constructor(t){let n;t?eE(t)?n={path:t}:typeof t=="string"||iTe(t)?n={value:t}:n=t:n={},this.cwd=tTe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Kw.length;){const i=Kw[r];i in n&&n[i]!==void 0&&n[i]!==null&&(this[i]=i==="history"?[...n[i]]:n[i])}let o;for(o in n)Kw.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?zi.basename(this.path):void 0}set basename(t){Qw(t,"basename"),Xw(t,"basename"),this.path=zi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?zi.dirname(this.path):void 0}set dirname(t){bk(this.basename,"dirname"),this.path=zi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?zi.extname(this.path):void 0}set extname(t){if(Xw(t,"extname"),bk(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=zi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){eE(t)&&(t=rTe(t)),Qw(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?zi.basename(this.path,this.extname):void 0}set stem(t){Qw(t,"stem"),Xw(t,"stem"),this.path=zi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const o=this.message(t,n,r);throw o.fatal=!0,o}info(t,n,r){const o=this.message(t,n,r);return o.fatal=void 0,o}message(t,n,r){const o=new _r(t,n,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Xw(e,t){if(e&&e.includes(zi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+zi.sep+"`")}function Qw(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function bk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function iTe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sTe=function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};Object.setPrototypeOf(i,r);const s=Object.getOwnPropertyNames(o);for(const a of s){const l=Object.getOwnPropertyDescriptor(o,a);l&&Object.defineProperty(i,a,l)}return i},aTe={}.hasOwnProperty;class $P extends sTe{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=qAe()}copy(){const t=new $P;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Yw(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(eS("data",this.frozen),this.namespace[t]=n,this):aTe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(eS("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=n.call(t,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Iv(t),r=this.parser||this.Parser;return Zw("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Zw("process",this.parser||this.Parser),Jw("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=Iv(t),l=r.parse(a);r.run(l,a,function(u,d,f){if(u||!d||!f)return c(u);const p=d,m=r.stringify(p,f);uTe(m)?f.value=m:f.result=m,c(u,f)});function c(u,d){u||!d?s(u):i?i(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Zw("processSync",this.parser||this.Parser),Jw("processSync",this.compiler||this.Compiler),this.process(t,o),xk("processSync","process",n),r;function o(i,s){n=!0,dk(i),r=s}}run(t,n,r){yk(t),this.freeze();const o=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?i(void 0,r):new Promise(i);function i(s,a){const l=Iv(n);o.run(t,l,c);function c(u,d,f){const p=d||t;u?a(u):s?s(p):r(void 0,p,f)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),xk("runSync","run",r),o;function i(s,a){dk(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=Iv(n),o=this.compiler||this.Compiler;return Jw("stringify",o),yk(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(eS("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function i(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else s(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function s(c){if(!("plugins"in c)&&!("settings"in c))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(c.plugins),c.settings&&(o.settings=Yw(!0,o.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];i(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,f=-1;for(;++d<r.length;)if(r[d][0]===c){f=d;break}if(f===-1)r.push([c,...u]);else if(u.length>0){let[p,...m]=u;const v=r[f][1];J_(v)&&J_(p)&&(p=Yw(!0,v,p)),r[f]=[c,p,...m]}}}}const lTe=new $P().freeze();function Zw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Jw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function eS(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function yk(e){if(!J_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function xk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Iv(e){return cTe(e)?e:new Bz(e)}function cTe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function uTe(e){return typeof e=="string"||dTe(e)}function dTe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const fTe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",wk=[],Sk={allowDangerousHtml:!0},hTe=/^(https?|ircs?|mailto|xmpp)$/i,pTe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Vz(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",o=e.className,i=e.components,s=e.disallowedElements,a=e.rehypePlugins||wk,l=e.remarkPlugins||wk,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Sk}:Sk,u=e.skipHtml,d=e.unwrapDisallowed,f=e.urlTransform||gTe,p=lTe().use(XOe).use(l).use(UAe,c).use(a),m=new Bz;typeof r=="string"&&(m.value=r);for(const x of pTe)Object.hasOwn(e,x.from)&&(""+x.from+(x.to?"use `"+x.to+"` instead":"remove it")+fTe+x.id,void 0);const v=p.parse(m);let y=p.runSync(v,m);return o&&(y={type:"element",tagName:"div",properties:{className:o},children:y.type==="root"?y.children:[y]}),jz(y,b),A2e(y,{Fragment:C.Fragment,components:i,ignoreInvalidStyle:!0,jsx:C.jsx,jsxs:C.jsxs,passKeys:!0,passNode:!0});function b(x,E,R){if(x.type==="raw"&&R&&typeof E=="number")return u?R.children.splice(E,1):R.children[E]={type:"text",value:x.value},E;if(x.type==="element"){let P;for(P in Uw)if(Object.hasOwn(Uw,P)&&Object.hasOwn(x.properties,P)){const O=x.properties[P],A=Uw[P];(A===null||A.includes(x.tagName))&&(x.properties[P]=f(String(O||""),P,x))}}if(x.type==="element"){let P=t?!t.includes(x.tagName):s?s.includes(x.tagName):!1;if(!P&&n&&typeof E=="number"&&(P=!n(x,E,R)),P&&R&&typeof E=="number")return d&&x.children?R.children.splice(E,1,...x.children):R.children.splice(E,1),E}}}function gTe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t<0||o>-1&&t>o||n>-1&&t>n||r>-1&&t>r||hTe.test(e.slice(0,t))?e:""}function mTe(){const e=w.useRef(null),[t,n]=w.useState(""),[r,o]=w.useState(!1),i=we(I=>I.dashboard.aiScopeTables);W0();const s=we(I=>I.selectedSheetId),{addFrame:a,setSelectedFrameId:l,setIsDashboardEditing:c}=fr(),{authToken:u}=No(),d=ME(),{messages:f,input:p,handleInputChange:m,handleSubmit:v,addToolResult:y,stop:b,isLoading:x}=$Re({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${u==null?void 0:u.accessToken}`},async onToolCall({toolCall:I}){if(R(I.toolName),I.toolName==="getLocation"){const L=["New York","Los Angeles","Chicago","San Francisco"];return L[Math.floor(Math.random()*L.length)]}if(I.toolName==="getTables")return JSON.stringify(i||[]);if(I.toolName==="getData"){console.log(I.args);const L=I.args;if(!(L!=null&&L.sql)||!(L!=null&&L.connectionId))return"Please provide sql, connectionId and table";const j=await d.fetchQuery({queryKey:["chat",L.connectionId,L.sql],queryFn:()=>x0("https://semaphor.cloud/api/v1/query",(u==null?void 0:u.accessToken)||(u==null?void 0:u.accessToken)||"",{connection_id:L.connectionId,sql:L.sql,cache_config:OE()})});return n("Summarizing"),JSON.stringify(j)}},onFinish(I,L){console.log("onFinish",I,L),I.content&&n("")}}),E=()=>{var I;(I=e.current)==null||I.scrollIntoView({behavior:"smooth"})};w.useEffect(()=>{E()},[f]);function R(I){I==="getTables"&&n("Initializing"),I==="getSchemas"&&n("Analyzing"),I==="getData"&&n("Fetching")}function P(I){const L=I.toolInvocations||[];return L.length===0||L.find(z=>z.toolName==="getData"&&"result"in z)?!0:r}function O(I){return I==null?void 0:I.map(L=>{var z;const j=L.role==="user";return P(L)?C.jsxs("div",{className:xe("relative rounded-md bg-background px-4 py-4 text-sm text-foreground/80",{"bg-muted":j}),children:[C.jsx("div",{className:"space-y-2",children:C.jsxs("div",{className:"flex shrink-0 items-start gap-3",children:[C.jsx("div",{className:"text-muted-foreground",children:j?C.jsx(T4,{className:"size-5 shrink-0"}):C.jsx(hC,{className:"size-5 shrink-0"})}),C.jsx("div",{children:C.jsx(Vz,{components:vTe,children:L.content})})]})}),(z=L.toolInvocations)==null?void 0:z.map(K=>{const H=K.toolCallId;return"result"in K?C.jsx("div",{children:A(K)},H):C.jsxs("div",{children:["Calling ",K.toolName,"..."]},H)})]},L.id):null})}function A(I){if("result"in I){let L;try{const j=JSON.parse(I.result);if(L=C.jsx("pre",{className:"whitespace-normal text-xs",children:JSON.stringify(j,null,2)}),I.toolName==="getData"){const z=qR({cardType:I.args.chartType,data:j.records});return C.jsxs("div",{className:"space-y-2",children:[r&&C.jsxs("div",{children:[C.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${I.toolName}: `,L]}),C.jsxs("div",{className:"flex h-[350px] w-[99%] grow flex-col py-2",children:[C.jsx(ro,{onClick:()=>{const K=I.args.chartTitle,H=I.args.connectionId;D({sql:I.args.sql,data:j.records,cardType:I.args.chartType,cardCfg:z,cardTitle:K,connectionId:H})},variant:"secondary",size:"sm",className:"absolute right-3 top-3",children:"Add"}),z&&C.jsx(k2,{cfg:z})]})]})}}catch{L=C.jsx("span",{children:I.result})}return C.jsxs("div",{children:[C.jsx("span",{className:"font-semibold text-blue-700",children:"Tool call"})," ",`${I.toolName}: `,L]})}return`Calling ${I.toolName}...`}function D({sql:I,data:L,cardCfg:j,cardTitle:z,connectionId:K,cardType:H}){if(!s)return;const k={id:Ka(),title:z||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:H==="horizontalBar"?"y":"x"}},type:j.type,cfg:j,sql:I,data:L,connectionId:K},W={id:Ka(),cards:[k],activeCardId:k.id};c(!0),a(s,W,"start"),l(W.id)}return C.jsxs("div",{role:"chat-box",className:"flex h-full grow flex-col justify-between break-words rounded-md bg-muted/30 px-6 py-8",children:[C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx(Dn,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),C.jsxs(cy,{openDelay:700,children:[C.jsx(uy,{children:C.jsx(P4,{className:"size-4 text-muted-foreground"})}),C.jsx(pg,{className:"w-70",children:C.jsxs("div",{className:"flex justify-between space-x-2 text-muted-foreground",children:[C.jsx(hC,{className:"size-5"}),C.jsxs("div",{className:"space-y-1",children:[C.jsx("p",{className:"text-sm",children:i&&(i==null?void 0:i.length)>0?"I can analyze following datasets":"No datasets in scope"}),C.jsx("div",{className:"space-y-2 pt-2",children:i==null?void 0:i.map((I,L)=>C.jsxs("div",{className:"flex gap-2 text-xs",children:[C.jsx(A4,{className:"size-4 opacity-70"}),C.jsx("span",{children:I.tableName})]},L))})]})]})})]}),!1]}),C.jsx(gg,{className:"my-4"}),C.jsx("div",{className:"",children:C.jsxs("form",{className:"mb-1 flex w-full grow items-center justify-between gap-2 rounded-md",onSubmit:v,children:[C.jsxs("div",{className:"flex w-full items-center justify-between rounded-md border bg-background",children:[C.jsx(yc,{className:"w-full border-none focus-visible:ring-0 focus-visible:ring-offset-0",value:p,disabled:x,placeholder:"What can I help you with?",onChange:m}),C.jsx("button",{className:"mr-3",children:C.jsx(g4,{className:"size-4 text-muted-foreground/70 hover:text-muted-foreground"})})]}),x&&C.jsx(ro,{size:"sm",className:"rounded-full",onClick:()=>b(),children:C.jsx(ooe,{className:"size-2.5 bg-background"})})]})}),C.jsxs(cp,{className:"flex flex-1 basis-0 flex-col flex-wrap justify-end",children:[C.jsxs("div",{className:"flex items-center text-xs text-foreground/90",children:[x&&t!==""&&C.jsx(Ure,{className:"size-10 animate-pulse"}),t]}),C.jsx("div",{className:"flex flex-col-reverse gap-2 py-2",children:O(f)}),C.jsx(Ey,{orientation:"vertical"})]})]})}const vTe={li:({node:e,...t})=>C.jsx("li",{className:"my-2 ml-5 list-disc rounded-md bg-muted/50 px-2 py-1",...t}),pre:({node:e,...t})=>C.jsx("pre",{className:"word my-2 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted/50 p-2 text-xs text-foreground/80",...t})},{createElement:Vd,createContext:bTe,createRef:P3e,forwardRef:Hz,useCallback:Kr,useContext:Wz,useEffect:Cc,useImperativeHandle:Uz,useLayoutEffect:yTe,useMemo:xTe,useRef:Zr,useState:rd}=S,Ck=S[`useId${Math.random()}`.slice(0,5)],wTe=yTe,By=bTe(null);By.displayName="PanelGroupContext";const _c=wTe,STe=typeof Ck=="function"?Ck:()=>null;let CTe=0;function NP(e=null){const t=STe(),n=Zr(e||t||null);return n.current===null&&(n.current=""+CTe++),e??n.current}function Gz({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:o,forwardedRef:i,id:s,maxSize:a,minSize:l,onCollapse:c,onExpand:u,onResize:d,order:f,style:p,tagName:m="div",...v}){const y=Wz(By);if(y===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:b,expandPanel:x,getPanelSize:E,getPanelStyle:R,groupId:P,isPanelCollapsed:O,reevaluatePanelConstraints:A,registerPanel:D,resizePanel:I,unregisterPanel:L}=y,j=NP(s),z=Zr({callbacks:{onCollapse:c,onExpand:u,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:o,maxSize:a,minSize:l},id:j,idIsFromProps:s!==void 0,order:f});Zr({didLogMissingDefaultSizeWarning:!1}),_c(()=>{const{callbacks:H,constraints:k}=z.current,W={...k};z.current.id=j,z.current.idIsFromProps=s!==void 0,z.current.order=f,H.onCollapse=c,H.onExpand=u,H.onResize=d,k.collapsedSize=n,k.collapsible=r,k.defaultSize=o,k.maxSize=a,k.minSize=l,(W.collapsedSize!==k.collapsedSize||W.collapsible!==k.collapsible||W.maxSize!==k.maxSize||W.minSize!==k.minSize)&&A(z.current,W)}),_c(()=>{const H=z.current;return D(H),()=>{L(H)}},[f,j,D,L]),Uz(i,()=>({collapse:()=>{b(z.current)},expand:H=>{x(z.current,H)},getId(){return j},getSize(){return E(z.current)},isCollapsed(){return O(z.current)},isExpanded(){return!O(z.current)},resize:H=>{I(z.current,H)}}),[b,x,E,O,j,I]);const K=R(z.current,o);return Vd(m,{...v,children:e,className:t,id:s,style:{...K,...p},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":P,"data-panel-id":j,"data-panel-size":parseFloat(""+K.flexGrow).toFixed(1)})}const qz=Hz((e,t)=>Vd(Gz,{...e,forwardedRef:t}));Gz.displayName="Panel";qz.displayName="forwardRef(Panel)";let tE=null,ec=null;function _Te(e,t){if(t){const n=(t&Zz)!==0,r=(t&Jz)!==0,o=(t&eB)!==0,i=(t&tB)!==0;if(n)return o?"se-resize":i?"ne-resize":"e-resize";if(r)return o?"sw-resize":i?"nw-resize":"w-resize";if(o)return"s-resize";if(i)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function ETe(){ec!==null&&(document.head.removeChild(ec),tE=null,ec=null)}function tS(e,t){const n=_Te(e,t);tE!==n&&(tE=n,ec===null&&(ec=document.createElement("style"),document.head.appendChild(ec)),ec.innerHTML=`*{cursor: ${n}!important;}`)}function Yz(e){return e.type==="keydown"}function Kz(e){return e.type.startsWith("pointer")}function Xz(e){return e.type.startsWith("mouse")}function Vy(e){if(Kz(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(Xz(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function RTe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function PTe(e,t,n){return n?e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y:e.x<=t.x+t.width&&e.x+e.width>=t.x&&e.y<=t.y+t.height&&e.y+e.height>=t.y}function OTe(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Rk(e),b:Rk(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;Ct(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:Ek(_k(n.a)),b:Ek(_k(n.b))};if(o.a===o.b){const i=r.childNodes,s={a:n.a.at(-1),b:n.b.at(-1)};let a=i.length;for(;a--;){const l=i[a];if(l===s.a)return 1;if(l===s.b)return-1}}return Math.sign(o.a-o.b)}const ATe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function TTe(e){var t;const n=getComputedStyle((t=Qz(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function DTe(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||TTe(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||ATe.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function _k(e){let t=e.length;for(;t--;){const n=e[t];if(Ct(n,"Missing node"),DTe(n))return n}return null}function Ek(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Rk(e){const t=[];for(;e;)t.push(e),e=Qz(e);return t}function Qz(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const Zz=1,Jz=2,eB=4,tB=8,MTe=RTe()==="coarse";let Ri=[],od=!1,Aa=new Map,Hy=new Map;const Mp=new Set;function ITe(e,t,n,r,o){var i;const{ownerDocument:s}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:o},l=(i=Aa.get(s))!==null&&i!==void 0?i:0;return Aa.set(s,l+1),Mp.add(a),d0(),function(){var u;Hy.delete(e),Mp.delete(a);const d=(u=Aa.get(s))!==null&&u!==void 0?u:1;if(Aa.set(s,d-1),d0(),d===1&&Aa.delete(s),Ri.includes(a)){const f=Ri.indexOf(a);f>=0&&Ri.splice(f,1),LP(),o("up",!0,null)}}}function Pk(e){const{target:t}=e,{x:n,y:r}=Vy(e);od=!0,kP({target:t,x:n,y:r}),d0(),Ri.length>0&&(f0("down",e),e.preventDefault(),e.stopPropagation())}function eh(e){const{x:t,y:n}=Vy(e);if(od&&e.buttons===0&&(od=!1,f0("up",e)),!od){const{target:r}=e;kP({target:r,x:t,y:n})}f0("move",e),LP(),Ri.length>0&&e.preventDefault()}function Ou(e){const{target:t}=e,{x:n,y:r}=Vy(e);Hy.clear(),od=!1,Ri.length>0&&e.preventDefault(),f0("up",e),kP({target:t,x:n,y:r}),LP(),d0()}function kP({target:e,x:t,y:n}){Ri.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),Mp.forEach(o=>{const{element:i,hitAreaMargins:s}=o,a=i.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=a,f=MTe?s.coarse:s.fine;if(t>=c-f&&t<=u+f&&n>=d-f&&n<=l+f){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&OTe(r,i)>0){let m=r,v=!1;for(;m&&!m.contains(i);){if(PTe(m.getBoundingClientRect(),a,!0)){v=!0;break}m=m.parentElement}if(v)return}Ri.push(o)}})}function nS(e,t){Hy.set(e,t)}function LP(){let e=!1,t=!1;Ri.forEach(r=>{const{direction:o}=r;o==="horizontal"?e=!0:t=!0});let n=0;Hy.forEach(r=>{n|=r}),e&&t?tS("intersection",n):e?tS("horizontal",n):t?tS("vertical",n):ETe()}function d0(){Aa.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",Ou),n.removeEventListener("pointerdown",Pk),n.removeEventListener("pointerleave",eh),n.removeEventListener("pointermove",eh)}),window.removeEventListener("pointerup",Ou),window.removeEventListener("pointercancel",Ou),Mp.size>0&&(od?(Ri.length>0&&Aa.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",Ou),n.addEventListener("pointerleave",eh),n.addEventListener("pointermove",eh))}),window.addEventListener("pointerup",Ou),window.addEventListener("pointercancel",Ou)):Aa.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",Pk,{capture:!0}),n.addEventListener("pointermove",eh))}))}function f0(e,t){Mp.forEach(n=>{const{setResizeHandlerState:r}=n,o=Ri.includes(n);r(e,o,t)})}function $Te(){const[e,t]=rd(0);return Kr(()=>t(n=>n+1),[])}function Ct(e,t){if(!e)throw console.error(t),Error(t)}const FP=10;function jc(e,t,n=FP){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function js(e,t,n=FP){return jc(e,t,n)===0}function xo(e,t,n){return jc(e,t,n)===0}function NTe(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const o=e[r],i=t[r];if(!xo(o,i,n))return!1}return!0}function Vu({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];Ct(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(jc(n,a)<0)if(i){const l=(o+a)/2;jc(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(FP)),n}function yh({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:i}){if(xo(e,0))return t;const s=[...t],[a,l]=r;Ct(a!=null,"Invalid first pivot index"),Ct(l!=null,"Invalid second pivot index");let c=0;if(i==="keyboard"){{const d=e<0?l:a,f=n[d];Ct(f,`Panel constraints not found for index ${d}`);const{collapsedSize:p=0,collapsible:m,minSize:v=0}=f;if(m){const y=t[d];if(Ct(y!=null,`Previous layout not found for panel index ${d}`),xo(y,p)){const b=v-y;jc(b,Math.abs(e))>0&&(e=e<0?0-b:b)}}}{const d=e<0?a:l,f=n[d];Ct(f,`No panel constraints found for index ${d}`);const{collapsedSize:p=0,collapsible:m,minSize:v=0}=f;if(m){const y=t[d];if(Ct(y!=null,`Previous layout not found for panel index ${d}`),xo(y,v)){const b=y-p;jc(b,Math.abs(e))>0&&(e=e<0?0-b:b)}}}}{const d=e<0?1:-1;let f=e<0?l:a,p=0;for(;;){const v=t[f];Ct(v!=null,`Previous layout not found for panel index ${f}`);const b=Vu({panelConstraints:n,panelIndex:f,size:100})-v;if(p+=b,f+=d,f<0||f>=n.length)break}const m=Math.min(Math.abs(e),Math.abs(p));e=e<0?0-m:m}{let f=e<0?a:l;for(;f>=0&&f<n.length;){const p=Math.abs(e)-Math.abs(c),m=t[f];Ct(m!=null,`Previous layout not found for panel index ${f}`);const v=m-p,y=Vu({panelConstraints:n,panelIndex:f,size:v});if(!xo(m,y)&&(c+=m-y,s[f]=y,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?f--:f++}}if(NTe(o,s))return o;{const d=e<0?l:a,f=t[d];Ct(f!=null,`Previous layout not found for panel index ${d}`);const p=f+c,m=Vu({panelConstraints:n,panelIndex:d,size:p});if(s[d]=m,!xo(m,p)){let v=p-m,b=e<0?l:a;for(;b>=0&&b<n.length;){const x=s[b];Ct(x!=null,`Previous layout not found for panel index ${b}`);const E=x+v,R=Vu({panelConstraints:n,panelIndex:b,size:E});if(xo(x,R)||(v-=R-x,s[b]=R),xo(v,0))break;e>0?b--:b++}}}const u=s.reduce((d,f)=>f+d,0);return xo(u,100)?s:o}function kTe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];Ct(a!=null,"No pivot index found"),t.forEach((d,f)=>{const{constraints:p}=d,{maxSize:m=100,minSize:v=0}=p;f===a?(r=v,o=m):(i+=v,s+=m)});const l=Math.min(o,100-i),c=Math.max(r,100-s),u=e[a];return{valueMax:l,valueMin:c,valueNow:u}}function Ip(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function nB(e,t,n=document){const o=Ip(e,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return o??null}function rB(e,t,n){const r=nB(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function oB(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function Wy(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function LTe(e,t,n,r=document){var o,i,s,a;const l=Wy(t,r),c=Ip(e,r),u=l?c.indexOf(l):-1,d=(o=(i=n[u])===null||i===void 0?void 0:i.id)!==null&&o!==void 0?o:null,f=(s=(a=n[u+1])===null||a===void 0?void 0:a.id)!==null&&s!==void 0?s:null;return[d,f]}function FTe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,panelGroupElement:i,setLayout:s}){Zr({didWarnAboutMissingResizeHandle:!1}),_c(()=>{if(!i)return;const a=Ip(n,i);for(let l=0;l<o.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=kTe({layout:r,panelsArray:o,pivotIndices:[l,l+1]}),f=a[l];if(f!=null){const p=o[l];Ct(p,`No panel data found for index "${l}"`),f.setAttribute("aria-controls",p.id),f.setAttribute("aria-valuemax",""+Math.round(c)),f.setAttribute("aria-valuemin",""+Math.round(u)),f.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{a.forEach((l,c)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,o,i]),Cc(()=>{if(!i)return;const a=t.current;Ct(a,"Eager values not found");const{panelDataArray:l}=a,c=oB(n,i);Ct(c!=null,`No group found for id "${n}"`);const u=Ip(n,i);Ct(u,`No resize handles found for group id "${n}"`);const d=u.map(f=>{const p=f.getAttribute("data-panel-resize-handle-id");Ct(p,"Resize handle element has no handle id attribute");const[m,v]=LTe(n,p,l,i);if(m==null||v==null)return()=>{};const y=b=>{if(!b.defaultPrevented)switch(b.key){case"Enter":{b.preventDefault();const x=l.findIndex(E=>E.id===m);if(x>=0){const E=l[x];Ct(E,`No panel data found for index ${x}`);const R=r[x],{collapsedSize:P=0,collapsible:O,minSize:A=0}=E.constraints;if(R!=null&&O){const D=yh({delta:xo(R,P)?A-P:P-R,initialLayout:r,panelConstraints:l.map(I=>I.constraints),pivotIndices:rB(n,p,i),prevLayout:r,trigger:"keyboard"});r!==D&&s(D)}}break}}};return f.addEventListener("keydown",y),()=>{f.removeEventListener("keydown",y)}});return()=>{d.forEach(f=>f())}},[i,e,t,n,r,o,s])}function Ok(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 iB(e,t){const n=e==="horizontal",{x:r,y:o}=Vy(t);return n?r:o}function jTe(e,t,n,r,o){const i=n==="horizontal",s=Wy(t,o);Ct(s,`No resize handle element found for id "${t}"`);const a=s.getAttribute("data-panel-group-id");Ct(a,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=iB(n,e),u=oB(a,o);Ct(u,`No group element found for id "${a}"`);const d=u.getBoundingClientRect(),f=i?d.width:d.height;return(c-l)/f*100}function zTe(e,t,n,r,o,i){if(Yz(e)){const s=n==="horizontal";let a=0;e.shiftKey?a=100:o!=null?a=o:a=10;let l=0;switch(e.key){case"ArrowDown":l=s?0:a;break;case"ArrowLeft":l=s?-a:0;break;case"ArrowRight":l=s?a:0;break;case"ArrowUp":l=s?0:-a;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:jTe(e,t,n,r,i)}function BTe({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];Ct(s,`Panel constraints not found for index ${i}`);const{defaultSize:a}=s;a!=null&&(r++,t[i]=a,o-=a)}for(let i=0;i<e.length;i++){const s=n[i];Ct(s,`Panel constraints not found for index ${i}`);const{defaultSize:a}=s;if(a!=null)continue;const l=e.length-r,c=o/l;r++,t[i]=c,o-=c}return t}function Au(e,t,n){t.forEach((r,o)=>{const i=e[o];Ct(i,`Panel data not found for index ${o}`);const{callbacks:s,constraints:a,id:l}=i,{collapsedSize:c=0,collapsible:u}=a,d=n[l];if(d==null||r!==d){n[l]=r;const{onCollapse:f,onExpand:p,onResize:m}=s;m&&m(r,d),u&&(f||p)&&(p&&(d==null||js(d,c))&&!js(r,c)&&p(),f&&(d==null||!js(d,c))&&js(r,c)&&f())}})}function $v(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 VTe({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:o,precision:i=3}){const s=n[o];let a;return s==null?a=e!=null?e.toPrecision(i):"1":r.length===1?a="1":a=s.toPrecision(i),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function HTe(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function Ak(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 sB(e){return`react-resizable-panels:${e}`}function aB(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 lB(e,t){try{const n=sB(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function WTe(e,t,n){var r,o;const i=(r=lB(e,n))!==null&&r!==void 0?r:{},s=aB(t);return(o=i[s])!==null&&o!==void 0?o:null}function UTe(e,t,n,r,o){var i;const s=sB(e),a=aB(t),l=(i=lB(e,o))!==null&&i!==void 0?i:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{o.setItem(s,JSON.stringify(l))}catch(c){console.error(c)}}function Tk({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(!xo(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const s=n[i];Ct(s!=null,`No layout data found for index ${i}`);const a=100/r*s;n[i]=a}let o=0;for(let i=0;i<t.length;i++){const s=n[i];Ct(s!=null,`No layout data found for index ${i}`);const a=Vu({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!xo(o,0))for(let i=0;i<t.length;i++){const s=n[i];Ct(s!=null,`No layout data found for index ${i}`);const a=s+o,l=Vu({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,xo(o,0)))break}return n}const GTe=100,xh={getItem:e=>(Ak(xh),xh.getItem(e)),setItem:(e,t)=>{Ak(xh),xh.setItem(e,t)}},Dk={};function cB({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=xh,style:c,tagName:u="div",...d}){const f=NP(i),p=Zr(null),[m,v]=rd(null),[y,b]=rd([]),x=$Te(),E=Zr({}),R=Zr(new Map),P=Zr(0),O=Zr({autoSaveId:e,direction:r,dragState:m,id:f,keyboardResizeBy:a,onLayout:s,storage:l}),A=Zr({layout:y,panelDataArray:[],panelDataArrayChanged:!1});Zr({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),Uz(o,()=>({getId:()=>O.current.id,getLayout:()=>{const{layout:M}=A.current;return M},setLayout:M=>{const{onLayout:oe}=O.current,{layout:te,panelDataArray:ie}=A.current,ne=Tk({layout:M,panelConstraints:ie.map(Z=>Z.constraints)});Ok(te,ne)||(b(ne),A.current.layout=ne,oe&&oe(ne),Au(ie,ne,E.current))}}),[]),_c(()=>{O.current.autoSaveId=e,O.current.direction=r,O.current.dragState=m,O.current.id=f,O.current.onLayout=s,O.current.storage=l}),FTe({committedValuesRef:O,eagerValuesRef:A,groupId:f,layout:y,panelDataArray:A.current.panelDataArray,setLayout:b,panelGroupElement:p.current}),Cc(()=>{const{panelDataArray:M}=A.current;if(e){if(y.length===0||y.length!==M.length)return;let oe=Dk[e];oe==null&&(oe=HTe(UTe,GTe),Dk[e]=oe);const te=[...M],ie=new Map(R.current);oe(e,te,ie,y,l)}},[e,y,l]),Cc(()=>{});const D=Kr(M=>{const{onLayout:oe}=O.current,{layout:te,panelDataArray:ie}=A.current;if(M.constraints.collapsible){const ne=ie.map(ve=>ve.constraints),{collapsedSize:Z=0,panelSize:ae,pivotIndices:ce}=$l(ie,M,te);if(Ct(ae!=null,`Panel size not found for panel "${M.id}"`),!js(ae,Z)){R.current.set(M.id,ae);const ee=Nu(ie,M)===ie.length-1?ae-Z:Z-ae,ge=yh({delta:ee,initialLayout:te,panelConstraints:ne,pivotIndices:ce,prevLayout:te,trigger:"imperative-api"});$v(te,ge)||(b(ge),A.current.layout=ge,oe&&oe(ge),Au(ie,ge,E.current))}}},[]),I=Kr((M,oe)=>{const{onLayout:te}=O.current,{layout:ie,panelDataArray:ne}=A.current;if(M.constraints.collapsible){const Z=ne.map(fe=>fe.constraints),{collapsedSize:ae=0,panelSize:ce=0,minSize:ve=0,pivotIndices:ee}=$l(ne,M,ie),ge=oe??ve;if(js(ce,ae)){const fe=R.current.get(M.id),Se=fe!=null&&fe>=ge?fe:ge,ze=Nu(ne,M)===ne.length-1?ce-Se:Se-ce,Ie=yh({delta:ze,initialLayout:ie,panelConstraints:Z,pivotIndices:ee,prevLayout:ie,trigger:"imperative-api"});$v(ie,Ie)||(b(Ie),A.current.layout=Ie,te&&te(Ie),Au(ne,Ie,E.current))}}},[]),L=Kr(M=>{const{layout:oe,panelDataArray:te}=A.current,{panelSize:ie}=$l(te,M,oe);return Ct(ie!=null,`Panel size not found for panel "${M.id}"`),ie},[]),j=Kr((M,oe)=>{const{panelDataArray:te}=A.current,ie=Nu(te,M);return VTe({defaultSize:oe,dragState:m,layout:y,panelData:te,panelIndex:ie})},[m,y]),z=Kr(M=>{const{layout:oe,panelDataArray:te}=A.current,{collapsedSize:ie=0,collapsible:ne,panelSize:Z}=$l(te,M,oe);return Ct(Z!=null,`Panel size not found for panel "${M.id}"`),ne===!0&&js(Z,ie)},[]),K=Kr(M=>{const{layout:oe,panelDataArray:te}=A.current,{collapsedSize:ie=0,collapsible:ne,panelSize:Z}=$l(te,M,oe);return Ct(Z!=null,`Panel size not found for panel "${M.id}"`),!ne||jc(Z,ie)>0},[]),H=Kr(M=>{const{panelDataArray:oe}=A.current;oe.push(M),oe.sort((te,ie)=>{const ne=te.order,Z=ie.order;return ne==null&&Z==null?0:ne==null?-1:Z==null?1:ne-Z}),A.current.panelDataArrayChanged=!0,x()},[x]);_c(()=>{if(A.current.panelDataArrayChanged){A.current.panelDataArrayChanged=!1;const{autoSaveId:M,onLayout:oe,storage:te}=O.current,{layout:ie,panelDataArray:ne}=A.current;let Z=null;if(M){const ce=WTe(M,ne,te);ce&&(R.current=new Map(Object.entries(ce.expandToSizes)),Z=ce.layout)}Z==null&&(Z=BTe({panelDataArray:ne}));const ae=Tk({layout:Z,panelConstraints:ne.map(ce=>ce.constraints)});Ok(ie,ae)||(b(ae),A.current.layout=ae,oe&&oe(ae),Au(ne,ae,E.current))}}),_c(()=>{const M=A.current;return()=>{M.layout=[]}},[]);const k=Kr(M=>{let oe=!1;const te=p.current;return te&&window.getComputedStyle(te,null).getPropertyValue("direction")==="rtl"&&(oe=!0),function(ne){ne.preventDefault();const Z=p.current;if(!Z)return()=>null;const{direction:ae,dragState:ce,id:ve,keyboardResizeBy:ee,onLayout:ge}=O.current,{layout:fe,panelDataArray:Se}=A.current,{initialLayout:Ae}=ce??{},ze=rB(ve,M,Z);let Ie=zTe(ne,M,ae,ce,ee,Z);const De=ae==="horizontal";De&&oe&&(Ie=-Ie);const ot=Se.map($t=>$t.constraints),_t=yh({delta:Ie,initialLayout:Ae??fe,panelConstraints:ot,pivotIndices:ze,prevLayout:fe,trigger:Yz(ne)?"keyboard":"mouse-or-touch"}),rn=!$v(fe,_t);(Kz(ne)||Xz(ne))&&P.current!=Ie&&(P.current=Ie,!rn&&Ie!==0?De?nS(M,Ie<0?Zz:Jz):nS(M,Ie<0?eB:tB):nS(M,0)),rn&&(b(_t),A.current.layout=_t,ge&&ge(_t),Au(Se,_t,E.current))}},[]),W=Kr((M,oe)=>{const{onLayout:te}=O.current,{layout:ie,panelDataArray:ne}=A.current,Z=ne.map(fe=>fe.constraints),{panelSize:ae,pivotIndices:ce}=$l(ne,M,ie);Ct(ae!=null,`Panel size not found for panel "${M.id}"`);const ee=Nu(ne,M)===ne.length-1?ae-oe:oe-ae,ge=yh({delta:ee,initialLayout:ie,panelConstraints:Z,pivotIndices:ce,prevLayout:ie,trigger:"imperative-api"});$v(ie,ge)||(b(ge),A.current.layout=ge,te&&te(ge),Au(ne,ge,E.current))},[]),B=Kr((M,oe)=>{const{layout:te,panelDataArray:ie}=A.current,{collapsedSize:ne=0,collapsible:Z}=oe,{collapsedSize:ae=0,collapsible:ce,maxSize:ve=100,minSize:ee=0}=M.constraints,{panelSize:ge}=$l(ie,M,te);ge!=null&&(Z&&ce&&js(ge,ne)?js(ne,ae)||W(M,ae):ge<ee?W(M,ee):ge>ve&&W(M,ve))},[W]),U=Kr((M,oe)=>{const{direction:te}=O.current,{layout:ie}=A.current;if(!p.current)return;const ne=Wy(M,p.current);Ct(ne,`Drag handle element not found for id "${M}"`);const Z=iB(te,oe);v({dragHandleId:M,dragHandleRect:ne.getBoundingClientRect(),initialCursorPosition:Z,initialLayout:ie})},[]),q=Kr(()=>{v(null)},[]),$=Kr(M=>{const{panelDataArray:oe}=A.current,te=Nu(oe,M);te>=0&&(oe.splice(te,1),delete E.current[M.id],A.current.panelDataArrayChanged=!0,x())},[x]),Y=xTe(()=>({collapsePanel:D,direction:r,dragState:m,expandPanel:I,getPanelSize:L,getPanelStyle:j,groupId:f,isPanelCollapsed:z,isPanelExpanded:K,reevaluatePanelConstraints:B,registerPanel:H,registerResizeHandle:k,resizePanel:W,startDragging:U,stopDragging:q,unregisterPanel:$,panelGroupElement:p.current}),[D,m,r,I,L,j,f,z,K,B,H,k,W,U,q,$]),X={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Vd(By.Provider,{value:Y},Vd(u,{...d,children:t,className:n,id:i,ref:p,style:{...X,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":f}))}const uB=Hz((e,t)=>Vd(cB,{...e,forwardedRef:t}));cB.displayName="PanelGroup";uB.displayName="forwardRef(PanelGroup)";function Nu(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function $l(e,t,n){const r=Nu(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],s=n[r];return{...t.constraints,panelSize:s,pivotIndices:i}}function qTe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){Cc(()=>{if(e||n==null||r==null)return;const o=Wy(t,r);if(o==null)return;const i=s=>{if(!s.defaultPrevented)switch(s.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{s.preventDefault(),n(s);break}case"F6":{s.preventDefault();const a=o.getAttribute("data-panel-group-id");Ct(a,`No group element found for id "${a}"`);const l=Ip(a,r),c=nB(a,t,r);Ct(c!==null,`No resize element found for id "${t}"`);const u=s.shiftKey?c>0?c-1:l.length-1:c+1<l.length?c+1:0;l[u].focus();break}}};return o.addEventListener("keydown",i),()=>{o.removeEventListener("keydown",i)}},[r,e,t,n])}function jP({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:o,onBlur:i,onDragging:s,onFocus:a,style:l={},tabIndex:c=0,tagName:u="div",...d}){var f,p;const m=Zr(null),v=Zr({onDragging:s});Cc(()=>{v.current.onDragging=s});const y=Wz(By);if(y===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:b,groupId:x,registerResizeHandle:E,startDragging:R,stopDragging:P,panelGroupElement:O}=y,A=NP(o),[D,I]=rd("inactive"),[L,j]=rd(!1),[z,K]=rd(null),H=Zr({state:D});_c(()=>{H.current.state=D}),Cc(()=>{if(n)K(null);else{const U=E(A);K(()=>U)}},[n,A,E]);const k=(f=r==null?void 0:r.coarse)!==null&&f!==void 0?f:15,W=(p=r==null?void 0:r.fine)!==null&&p!==void 0?p:5;return Cc(()=>{if(n||z==null)return;const U=m.current;return Ct(U,"Element ref not attached"),ITe(A,U,b,{coarse:k,fine:W},($,Y,X)=>{if(Y)switch($){case"down":{I("drag"),Ct(X,'Expected event to be defined for "down" action'),R(A,X);const{onDragging:M}=v.current;M&&M(!0);break}case"move":{const{state:M}=H.current;M!=="drag"&&I("hover"),Ct(X,'Expected event to be defined for "move" action'),z(X);break}case"up":{I("hover"),P();const{onDragging:M}=v.current;M&&M(!1);break}}else I("inactive")})},[k,b,n,W,E,A,z,R,P]),qTe({disabled:n,handleId:A,resizeHandler:z,panelGroupElement:O}),Vd(u,{...d,children:e,className:t,id:o,onBlur:()=>{j(!1),i==null||i()},onFocus:()=>{j(!0),a==null||a()},ref:m,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...l},tabIndex:c,"data-panel-group-direction":b,"data-panel-group-id":x,"data-resize-handle":"","data-resize-handle-active":D==="drag"?"pointer":L?"keyboard":void 0,"data-resize-handle-state":D,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":A})}jP.displayName="PanelResizeHandle";const dB=({className:e,...t})=>C.jsx(uB,{className:xe("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),nE=qz,YTe=({withHandle:e,className:t,...n})=>C.jsx(jP,{className:xe("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",t),...n,children:e&&C.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:C.jsx(_4,{className:"h-2.5 w-2.5"})})}),KTe=({withHandle:e,className:t,onTabClick:n,open:r,...o})=>C.jsx(jP,{className:xe("relative flex w-px items-start justify-end bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",{"justify-start":r},t),...o,children:e&&C.jsx("div",{className:xe("z-50 flex items-center justify-start",{"border-l":r}),children:C.jsx(ro,{variant:"secondary",className:xe("h-7 p-1",{"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":r,"mt-2 rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":!r}),onClick:()=>n(!r),children:r?C.jsx(G0,{className:"size-4"}):C.jsx(cR,{className:"size-4"})})})});function XTe(e,t=[]){let n=[];function r(i,s){const a=S.createContext(s),l=n.length;n=[...n,s];function c(d){const{scope:f,children:p,...m}=d,v=(f==null?void 0:f[e][l])||a,y=S.useMemo(()=>m,Object.values(m));return C.jsx(v.Provider,{value:y,children:p})}function u(d,f){const p=(f==null?void 0:f[e][l])||a,m=S.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>S.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,QTe(o,...t)]}function QTe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function ZTe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function JTe(...e){return t=>e.forEach(n=>ZTe(n,t))}function fB(...e){return S.useCallback(JTe(...e),e)}function qa(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 eDe(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function tDe(...e){return t=>e.forEach(n=>eDe(n,t))}function Jc(...e){return S.useCallback(tDe(...e),e)}function nDe(e,t){const n=S.createContext(t);function r(i){const{children:s,...a}=i,l=S.useMemo(()=>a,Object.values(a));return C.jsx(n.Provider,{value:l,children:s})}function o(i){const s=S.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,o]}function rDe(e,t=[]){let n=[];function r(i,s){const a=S.createContext(s),l=n.length;n=[...n,s];function c(d){const{scope:f,children:p,...m}=d,v=(f==null?void 0:f[e][l])||a,y=S.useMemo(()=>m,Object.values(m));return C.jsx(v.Provider,{value:y,children:p})}function u(d,f){const p=(f==null?void 0:f[e][l])||a,m=S.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>S.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,oDe(o,...t)]}function oDe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var h0=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},iDe=S.useId||(()=>{}),sDe=0;function rS(e){const[t,n]=S.useState(iDe());return h0(()=>{e||n(r=>r??String(sDe++))},[e]),e||(t?`radix-${t}`:"")}function zc(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function aDe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=lDe({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=zc(n),l=S.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function lDe({defaultProp:e,onChange:t}){const n=S.useState(e),[r]=n,o=S.useRef(r),i=zc(t);return S.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var cDe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Js=cDe.reduce((e,t)=>{const n=S.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?hy:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function uDe(e,t){e&&Pi.flushSync(()=>e.dispatchEvent(t))}function dDe(e,t=globalThis==null?void 0:globalThis.document){const n=zc(e);S.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var fDe="DismissableLayer",rE="dismissableLayer.update",hDe="dismissableLayer.pointerDownOutside",pDe="dismissableLayer.focusOutside",Mk,hB=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pB=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=S.useContext(hB),[u,d]=S.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=S.useState({}),m=Jc(t,A=>d(A)),v=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=u?v.indexOf(u):-1,E=c.layersWithOutsidePointerEventsDisabled.size>0,R=x>=b,P=vDe(A=>{const D=A.target,I=[...c.branches].some(L=>L.contains(D));!R||I||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},f),O=bDe(A=>{const D=A.target;[...c.branches].some(L=>L.contains(D))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},f);return dDe(A=>{x===c.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},f),S.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Mk=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Ik(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Mk)}},[u,f,n,c]),S.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Ik())},[u,c]),S.useEffect(()=>{const A=()=>p({});return document.addEventListener(rE,A),()=>document.removeEventListener(rE,A)},[]),C.jsx(Js.div,{...l,ref:m,style:{pointerEvents:E?R?"auto":"none":void 0,...e.style},onFocusCapture:qa(e.onFocusCapture,O.onFocusCapture),onBlurCapture:qa(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:qa(e.onPointerDownCapture,P.onPointerDownCapture)})});pB.displayName=fDe;var gDe="DismissableLayerBranch",mDe=S.forwardRef((e,t)=>{const n=S.useContext(hB),r=S.useRef(null),o=Jc(t,r);return S.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),C.jsx(Js.div,{...e,ref:o})});mDe.displayName=gDe;function vDe(e,t=globalThis==null?void 0:globalThis.document){const n=zc(e),r=S.useRef(!1),o=S.useRef(()=>{});return S.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){gB(hDe,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}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 bDe(e,t=globalThis==null?void 0:globalThis.document){const n=zc(e),r=S.useRef(!1);return S.useEffect(()=>{const o=i=>{i.target&&!r.current&&gB(pDe,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 Ik(){const e=new CustomEvent(rE);document.dispatchEvent(e)}function gB(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?uDe(o,i):o.dispatchEvent(i)}var oS="focusScope.autoFocusOnMount",iS="focusScope.autoFocusOnUnmount",$k={bubbles:!1,cancelable:!0},yDe="FocusScope",mB=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=S.useState(null),c=zc(o),u=zc(i),d=S.useRef(null),f=Jc(t,v=>l(v)),p=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let v=function(E){if(p.paused||!a)return;const R=E.target;a.contains(R)?d.current=R:_a(d.current,{select:!0})},y=function(E){if(p.paused||!a)return;const R=E.relatedTarget;R!==null&&(a.contains(R)||_a(d.current,{select:!0}))},b=function(E){if(document.activeElement===document.body)for(const P of E)P.removedNodes.length>0&&_a(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",y);const x=new MutationObserver(b);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),x.disconnect()}}},[r,a,p.paused]),S.useEffect(()=>{if(a){kk.add(p);const v=document.activeElement;if(!a.contains(v)){const b=new CustomEvent(oS,$k);a.addEventListener(oS,c),a.dispatchEvent(b),b.defaultPrevented||(xDe(EDe(vB(a)),{select:!0}),document.activeElement===v&&_a(a))}return()=>{a.removeEventListener(oS,c),setTimeout(()=>{const b=new CustomEvent(iS,$k);a.addEventListener(iS,u),a.dispatchEvent(b),b.defaultPrevented||_a(v??document.body,{select:!0}),a.removeEventListener(iS,u),kk.remove(p)},0)}}},[a,c,u,p]);const m=S.useCallback(v=>{if(!n&&!r||p.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,b=document.activeElement;if(y&&b){const x=v.currentTarget,[E,R]=wDe(x);E&&R?!v.shiftKey&&b===R?(v.preventDefault(),n&&_a(E,{select:!0})):v.shiftKey&&b===E&&(v.preventDefault(),n&&_a(R,{select:!0})):b===x&&v.preventDefault()}},[n,r,p.paused]);return C.jsx(Js.div,{tabIndex:-1,...s,ref:f,onKeyDown:m})});mB.displayName=yDe;function xDe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(_a(r,{select:t}),document.activeElement!==n)return}function wDe(e){const t=vB(e),n=Nk(t,e),r=Nk(t.reverse(),e);return[n,r]}function vB(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 Nk(e,t){for(const n of e)if(!SDe(n,{upTo:t}))return n}function SDe(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 CDe(e){return e instanceof HTMLInputElement&&"select"in e}function _a(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&CDe(e)&&t&&e.select()}}var kk=_De();function _De(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Lk(e,t),e.unshift(t)},remove(t){var n;e=Lk(e,t),(n=e[0])==null||n.resume()}}}function Lk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function EDe(e){return e.filter(t=>t.tagName!=="A")}var RDe="Portal",bB=S.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=S.useState(!1);h0(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Pn.createPortal(C.jsx(Js.div,{...r,ref:t}),s):null});bB.displayName=RDe;function PDe(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var Uy=e=>{const{present:t,children:n}=e,r=ODe(t),o=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),i=Jc(r.ref,ADe(o));return typeof n=="function"||r.isPresent?S.cloneElement(o,{ref:i}):null};Uy.displayName="Presence";function ODe(e){const[t,n]=S.useState(),r=S.useRef({}),o=S.useRef(e),i=S.useRef("none"),s=e?"mounted":"unmounted",[a,l]=PDe(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=Nv(r.current);i.current=a==="mounted"?c:"none"},[a]),h0(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,p=Nv(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),h0(()=>{if(t){const c=d=>{const p=Nv(r.current).includes(d.animationName);d.target===t&&p&&Pi.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=Nv(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:S.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Nv(e){return(e==null?void 0:e.animationName)||"none"}function ADe(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var sS=0;function TDe(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Fk()),document.body.insertAdjacentElement("beforeend",e[1]??Fk()),sS++,()=>{sS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),sS--}},[])}function Fk(){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}var yB=_2(),aS=function(){},Gy=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:aS,onWheelCapture:aS,onTouchMoveCapture:aS}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,x=e.gapMode,E=gy(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=f,P=C2([n,t]),O=Ln(Ln({},E),o);return S.createElement(S.Fragment,null,u&&S.createElement(R,{sideCar:yB,removeScrollBar:c,shards:d,noIsolation:p,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:x}),s?S.cloneElement(S.Children.only(a),Ln(Ln({},O),{ref:P})):S.createElement(b,Ln({},O,{className:l,ref:P}),a))});Gy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Gy.classNames={fullWidth:Ju,zeroRight:Zu};var oE=!1;if(typeof window<"u")try{var kv=Object.defineProperty({},"passive",{get:function(){return oE=!0,!0}});window.addEventListener("test",kv,kv),window.removeEventListener("test",kv,kv)}catch{oE=!1}var Tu=oE?{passive:!1}:!1,DDe=function(e){return e.tagName==="TEXTAREA"},xB=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!DDe(e)&&n[t]==="visible")},MDe=function(e){return xB(e,"overflowY")},IDe=function(e){return xB(e,"overflowX")},jk=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=wB(e,r);if(o){var i=SB(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},$De=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},NDe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},wB=function(e,t){return e==="v"?MDe(t):IDe(t)},SB=function(e,t){return e==="v"?$De(t):NDe(t)},kDe=function(e,t){return e==="h"&&t==="rtl"?-1:1},LDe=function(e,t,n,r,o){var i=kDe(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,f=0;do{var p=SB(e,a),m=p[0],v=p[1],y=p[2],b=v-y-i*m;(m||b)&&wB(e,a)&&(d+=b,f+=m),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&Math.abs(d)<1||!o&&s>d)||!u&&(o&&Math.abs(f)<1||!o&&-s>f))&&(c=!0),c},Lv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},zk=function(e){return[e.deltaX,e.deltaY]},Bk=function(e){return e&&"current"in e?e.current:e},FDe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},jDe=function(e){return`
375
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
376
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
377
+ `)},zDe=0,Du=[];function BDe(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),o=S.useState(zDe++)[0],i=S.useState(vy)[0],s=S.useRef(e);S.useEffect(function(){s.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=S2([e.lockRef.current],(e.shards||[]).map(Bk),!0).filter(Boolean);return v.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=S.useCallback(function(v,y){if("touches"in v&&v.touches.length===2)return!s.current.allowPinchZoom;var b=Lv(v),x=n.current,E="deltaX"in v?v.deltaX:x[0]-b[0],R="deltaY"in v?v.deltaY:x[1]-b[1],P,O=v.target,A=Math.abs(E)>Math.abs(R)?"h":"v";if("touches"in v&&A==="h"&&O.type==="range")return!1;var D=jk(A,O);if(!D)return!0;if(D?P=A:(P=A==="v"?"h":"v",D=jk(A,O)),!D)return!1;if(!r.current&&"changedTouches"in v&&(E||R)&&(r.current=P),!P)return!0;var I=r.current||P;return LDe(I,y,v,I==="h"?E:R,!0)},[]),l=S.useCallback(function(v){var y=v;if(!(!Du.length||Du[Du.length-1]!==i)){var b="deltaY"in y?zk(y):Lv(y),x=t.current.filter(function(P){return P.name===y.type&&(P.target===y.target||y.target===P.shadowParent)&&FDe(P.delta,b)})[0];if(x&&x.should){y.cancelable&&y.preventDefault();return}if(!x){var E=(s.current.shards||[]).map(Bk).filter(Boolean).filter(function(P){return P.contains(y.target)}),R=E.length>0?a(y,E[0]):!s.current.noIsolation;R&&y.cancelable&&y.preventDefault()}}},[]),c=S.useCallback(function(v,y,b,x){var E={name:v,delta:y,target:b,should:x,shadowParent:VDe(b)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(R){return R!==E})},1)},[]),u=S.useCallback(function(v){n.current=Lv(v),r.current=void 0},[]),d=S.useCallback(function(v){c(v.type,zk(v),v.target,a(v,e.lockRef.current))},[]),f=S.useCallback(function(v){c(v.type,Lv(v),v.target,a(v,e.lockRef.current))},[]);S.useEffect(function(){return Du.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Tu),document.addEventListener("touchmove",l,Tu),document.addEventListener("touchstart",u,Tu),function(){Du=Du.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,Tu),document.removeEventListener("touchmove",l,Tu),document.removeEventListener("touchstart",u,Tu)}},[]);var p=e.removeScrollBar,m=e.inert;return S.createElement(S.Fragment,null,m?S.createElement(i,{styles:jDe(o)}):null,p?S.createElement(R2,{gapMode:e.gapMode}):null)}function VDe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const HDe=E2(yB,BDe);var CB=S.forwardRef(function(e,t){return S.createElement(Gy,Ln({},e,{ref:t,sideCar:HDe}))});CB.classNames=Gy.classNames;const WDe=CB;var zP="Dialog",[_B,EB]=rDe(zP),[UDe,Di]=_B(zP),RB=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=S.useRef(null),l=S.useRef(null),[c=!1,u]=aDe({prop:r,defaultProp:o,onChange:i});return C.jsx(UDe,{scope:t,triggerRef:a,contentRef:l,contentId:rS(),titleId:rS(),descriptionId:rS(),open:c,onOpenChange:u,onOpenToggle:S.useCallback(()=>u(d=>!d),[u]),modal:s,children:n})};RB.displayName=zP;var PB="DialogTrigger",OB=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Di(PB,n),i=Jc(t,o.triggerRef);return C.jsx(Js.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":HP(o.open),...r,ref:i,onClick:qa(e.onClick,o.onOpenToggle)})});OB.displayName=PB;var BP="DialogPortal",[GDe,AB]=_B(BP,{forceMount:void 0}),TB=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Di(BP,t);return C.jsx(GDe,{scope:t,forceMount:n,children:S.Children.map(r,s=>C.jsx(Uy,{present:n||i.open,children:C.jsx(bB,{asChild:!0,container:o,children:s})}))})};TB.displayName=BP;var p0="DialogOverlay",DB=S.forwardRef((e,t)=>{const n=AB(p0,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Di(p0,e.__scopeDialog);return i.modal?C.jsx(Uy,{present:r||i.open,children:C.jsx(qDe,{...o,ref:t})}):null});DB.displayName=p0;var qDe=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Di(p0,n);return C.jsx(WDe,{as:hy,allowPinchZoom:!0,shards:[o.contentRef],children:C.jsx(Js.div,{"data-state":HP(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Bc="DialogContent",MB=S.forwardRef((e,t)=>{const n=AB(Bc,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Di(Bc,e.__scopeDialog);return C.jsx(Uy,{present:r||i.open,children:i.modal?C.jsx(YDe,{...o,ref:t}):C.jsx(KDe,{...o,ref:t})})});MB.displayName=Bc;var YDe=S.forwardRef((e,t)=>{const n=Di(Bc,e.__scopeDialog),r=S.useRef(null),o=Jc(t,n.contentRef,r);return S.useEffect(()=>{const i=r.current;if(i)return mg(i)},[]),C.jsx(IB,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:qa(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:qa(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:qa(e.onFocusOutside,i=>i.preventDefault())})}),KDe=S.forwardRef((e,t)=>{const n=Di(Bc,e.__scopeDialog),r=S.useRef(!1),o=S.useRef(!1);return C.jsx(IB,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),IB=S.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=Di(Bc,n),l=S.useRef(null),c=Jc(t,l);return TDe(),C.jsxs(C.Fragment,{children:[C.jsx(mB,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:C.jsx(pB,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":HP(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),C.jsxs(C.Fragment,{children:[C.jsx(QDe,{titleId:a.titleId}),C.jsx(JDe,{contentRef:l,descriptionId:a.descriptionId})]})]})}),VP="DialogTitle",$B=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Di(VP,n);return C.jsx(Js.h2,{id:o.titleId,...r,ref:t})});$B.displayName=VP;var NB="DialogDescription",kB=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Di(NB,n);return C.jsx(Js.p,{id:o.descriptionId,...r,ref:t})});kB.displayName=NB;var LB="DialogClose",FB=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Di(LB,n);return C.jsx(Js.button,{type:"button",...r,ref:t,onClick:qa(e.onClick,()=>o.onOpenChange(!1))})});FB.displayName=LB;function HP(e){return e?"open":"closed"}var jB="DialogTitleWarning",[XDe,zB]=nDe(jB,{contentName:Bc,titleName:VP,docsSlug:"dialog"}),QDe=({titleId:e})=>{const t=zB(jB),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
378
+
379
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
380
+
381
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ZDe="DialogDescriptionWarning",JDe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${zB(ZDe).contentName}}.`;return S.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},BB=RB,VB=OB,HB=TB,WP=DB,UP=MB,GP=$B,qP=kB,YP=FB;function eMe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}var WB="AlertDialog",[tMe,O3e]=XTe(WB,[EB]),ea=EB(),UB=e=>{const{__scopeAlertDialog:t,...n}=e,r=ea(t);return C.jsx(BB,{...r,...n,modal:!0})};UB.displayName=WB;var nMe="AlertDialogTrigger",rMe=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ea(n);return C.jsx(VB,{...o,...r,ref:t})});rMe.displayName=nMe;var oMe="AlertDialogPortal",GB=e=>{const{__scopeAlertDialog:t,...n}=e,r=ea(t);return C.jsx(HB,{...r,...n})};GB.displayName=oMe;var iMe="AlertDialogOverlay",qB=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ea(n);return C.jsx(WP,{...o,...r,ref:t})});qB.displayName=iMe;var id="AlertDialogContent",[sMe,aMe]=tMe(id),YB=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=ea(n),s=S.useRef(null),a=fB(t,s),l=S.useRef(null);return C.jsx(XDe,{contentName:id,titleName:KB,docsSlug:"alert-dialog",children:C.jsx(sMe,{scope:n,cancelRef:l,children:C.jsxs(UP,{role:"alertdialog",...i,...o,ref:a,onOpenAutoFocus:eMe(o.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[C.jsx(g7,{children:r}),C.jsx(cMe,{contentRef:s})]})})})});YB.displayName=id;var KB="AlertDialogTitle",XB=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ea(n);return C.jsx(GP,{...o,...r,ref:t})});XB.displayName=KB;var QB="AlertDialogDescription",ZB=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ea(n);return C.jsx(qP,{...o,...r,ref:t})});ZB.displayName=QB;var lMe="AlertDialogAction",JB=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=ea(n);return C.jsx(YP,{...o,...r,ref:t})});JB.displayName=lMe;var eV="AlertDialogCancel",tV=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=aMe(eV,n),i=ea(n),s=fB(t,o);return C.jsx(YP,{...i,...r,ref:s})});tV.displayName=eV;var cMe=({contentRef:e})=>{const t=`\`${id}\` requires a description for the component to be accessible for screen reader users.
382
+
383
+ You can add a description to the \`${id}\` by passing a \`${QB}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
384
+
385
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${id}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
386
+
387
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return S.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},uMe=UB,dMe=GB,nV=qB,rV=YB,oV=JB,iV=tV,sV=XB,aV=ZB;const fMe=uMe,hMe=dMe,lV=S.forwardRef(({className:e,...t},n)=>C.jsx(nV,{className:xe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));lV.displayName=nV.displayName;const cV=S.forwardRef(({className:e,...t},n)=>C.jsx(hMe,{children:C.jsxs(Wc,{children:[C.jsx(lV,{}),C.jsx(rV,{ref:n,className:xe("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),...t})]})}));cV.displayName=rV.displayName;const uV=({className:e,...t})=>C.jsx("div",{className:xe("flex flex-col space-y-2 text-center sm:text-left",e),...t});uV.displayName="AlertDialogHeader";const dV=({className:e,...t})=>C.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});dV.displayName="AlertDialogFooter";const fV=S.forwardRef(({className:e,...t},n)=>C.jsx(sV,{ref:n,className:xe("text-lg font-semibold",e),...t}));fV.displayName=sV.displayName;const hV=S.forwardRef(({className:e,...t},n)=>C.jsx(aV,{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));hV.displayName=aV.displayName;const pV=S.forwardRef(({className:e,...t},n)=>C.jsx(oV,{ref:n,className:xe(ap(),e),...t}));pV.displayName=oV.displayName;const gV=S.forwardRef(({className:e,...t},n)=>C.jsx(iV,{ref:n,className:xe(ap({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));gV.displayName=iV.displayName;function pMe({open:e,setOpen:t}){const n=we(i=>i.selectedSheetId),{deleteSheet:r}=fr();function o(){n&&(r(n),t(!1))}return C.jsx(fMe,{open:e,onOpenChange:t,children:C.jsxs(cV,{children:[C.jsxs(uV,{children:[C.jsx(fV,{children:"Delete Sheet"}),C.jsx(hV,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),C.jsxs(dV,{children:[C.jsx(gV,{children:"Cancel"}),C.jsx(pV,{onClick:o,children:"Delete"})]})]})})}function mV(){var y,b;const[e,t]=w.useState(!1),n=we(x=>{var E;return(E=x.dashboard)==null?void 0:E.sheets}),{showAssistant:r}=No(),o=w.useRef(null),[i,s]=w.useState(!1),a=we(x=>x.isDashboardEditing),l=we(x=>x.themeStyle);we(x=>x.isVisualEditing);const c=we(x=>x.selectedSheetId),{setSelectedSheetId:u,setSheetTitle:d,addSheet:f}=fr();if(!n)return null;function p(x){var E,R;x?((E=o.current)==null||E.resize(35),s(!0)):(s(!1),(R=o.current)==null||R.resize(0))}function m(){const x={id:Ka(),title:"New Sheet"};f(x)}function v(){return(l==null?void 0:l.canvasTheme)==="muted"||!(l!=null&&l.canvasTheme)?"hsl(var(--semaphor-muted))":(l==null?void 0:l.canvasTheme)==="clear"?"":l==null?void 0:l.canvasTheme}return C.jsxs(LE,{role:"dashboard-tabs-container",className:xe("relative flex grow flex-col",l==null?void 0:l.dashboardTabsContainer),onValueChange:x=>{u(x)},value:c||n[0].id,children:[C.jsx("div",{children:(n.length>1||a)&&C.jsxs(T0,{role:"tab-list",className:"flex h-11 items-center justify-start gap-2 rounded-none bg-transparent px-2.5 py-3",children:[n==null?void 0:n.map(x=>{var E,R;return C.jsx(es,{text:x.title,onSave:P=>d(x.id,P),children:C.jsxs(D0,{style:{borderRadius:(R=(E=l==null?void 0:l.chart)==null?void 0:E.options)==null?void 0:R.borderRadius},onClick:()=>u(x.id),className:"flex items-center gap-1 rounded-none border px-2 py-1",value:x.id,children:[x.title,a&&c===x.id&&n.length>1&&C.jsx(Yd,{className:"ml-1 size-3",onClick:()=>t(!0)})]})},x.id)}),a&&C.jsx("div",{style:{borderRadius:(b=(y=l==null?void 0:l.chart)==null?void 0:y.options)==null?void 0:b.borderRadius},className:"flex h-7 items-center justify-center border-none bg-muted p-2 hover:cursor-pointer dark:border-l-background",onClick:m,children:C.jsx(fR,{className:"size-3"})})]})}),C.jsxs(dB,{className:"grow",direction:"horizontal",children:[C.jsx(nE,{children:C.jsx("div",{style:{},children:n==null?void 0:n.map(x=>C.jsx(FE,{style:{backgroundColor:v()},className:xe("mt-0",{}),value:x.id,children:C.jsx(wEe,{sheet:x})},x.id))})}),r===!0&&C.jsxs(C.Fragment,{children:[C.jsx(KTe,{open:i,onTabClick:p,withHandle:!0}),C.jsx(nE,{onResize:x=>{x<1?s(!1):i||s(!0)},defaultSize:0,ref:o,children:C.jsx(mTe,{})})]})]}),C.jsx(pMe,{open:e,setOpen:t})]})}function vV({children:e}){return C.jsx(AJ,{defaultTheme:"system",storageKey:"vite-ui-theme",children:C.jsx(_pe,{delayDuration:0,children:e})})}function bV(e){return C.jsx(q0,{FallbackComponent:pR,children:C.jsx(a3,{dashboardProps:e,children:C.jsx(vV,{children:C.jsx(d3,{...e,children:C.jsx(mV,{})})})})})}function g0(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 Vk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function yV(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Vk(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():Vk(e[o],null)}}}}function gMe(e,t=[]){let n=[];function r(i,s){const a=S.createContext(s),l=n.length;n=[...n,s];const c=d=>{var b;const{scope:f,children:p,...m}=d,v=((b=f==null?void 0:f[e])==null?void 0:b[l])||a,y=S.useMemo(()=>m,Object.values(m));return C.jsx(v.Provider,{value:y,children:p})};c.displayName=i+"Provider";function u(d,f){var v;const p=((v=f==null?void 0:f[e])==null?void 0:v[l])||a,m=S.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>S.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,mMe(o,...t)]}function mMe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function xV(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function vMe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=bMe({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=xV(n),l=S.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function bMe({defaultProp:e,onChange:t}){const n=S.useState(e),[r]=n,o=S.useRef(r),i=xV(t);return S.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var wV=S.forwardRef((e,t)=>{const{children:n,...r}=e,o=S.Children.toArray(n),i=o.find(xMe);if(i){const s=i.props.children,a=o.map(l=>l===i?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:l);return C.jsx(iE,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return C.jsx(iE,{...r,ref:t,children:n})});wV.displayName="Slot";var iE=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const o=SMe(n);return S.cloneElement(n,{...wMe(r,n.props),ref:t?yV(t,o):o})}return S.Children.count(n)>1?S.Children.only(null):null});iE.displayName="SlotClone";var yMe=({children:e})=>C.jsx(C.Fragment,{children:e});function xMe(e){return S.isValidElement(e)&&e.type===yMe}function wMe(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 SMe(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var CMe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],_Me=CMe.reduce((e,t)=>{const n=S.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?wV:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Zt(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 qy(e,t=[]){let n=[];function r(i,s){const a=S.createContext(s),l=n.length;n=[...n,s];const c=d=>{var b;const{scope:f,children:p,...m}=d,v=((b=f==null?void 0:f[e])==null?void 0:b[l])||a,y=S.useMemo(()=>m,Object.values(m));return C.jsx(v.Provider,{value:y,children:p})};c.displayName=i+"Provider";function u(d,f){var v;const p=((v=f==null?void 0:f[e])==null?void 0:v[l])||a,m=S.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[c,u]}const o=()=>{const i=n.map(s=>S.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return S.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,EMe(o,...t)]}function EMe(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Hk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function KP(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Hk(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():Hk(e[o],null)}}}}function $o(...e){return S.useCallback(KP(...e),e)}var $p=S.forwardRef((e,t)=>{const{children:n,...r}=e,o=S.Children.toArray(n),i=o.find(PMe);if(i){const s=i.props.children,a=o.map(l=>l===i?S.Children.count(s)>1?S.Children.only(null):S.isValidElement(s)?s.props.children:null:l);return C.jsx(sE,{...r,ref:t,children:S.isValidElement(s)?S.cloneElement(s,void 0,a):null})}return C.jsx(sE,{...r,ref:t,children:n})});$p.displayName="Slot";var sE=S.forwardRef((e,t)=>{const{children:n,...r}=e;if(S.isValidElement(n)){const o=AMe(n);return S.cloneElement(n,{...OMe(r,n.props),ref:t?KP(t,o):o})}return S.Children.count(n)>1?S.Children.only(null):null});sE.displayName="SlotClone";var RMe=({children:e})=>C.jsx(C.Fragment,{children:e});function PMe(e){return S.isValidElement(e)&&e.type===RMe}function OMe(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 AMe(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function SV(e){const t=e+"CollectionProvider",[n,r]=qy(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=p=>{const{scope:m,children:v}=p,y=w.useRef(null),b=w.useRef(new Map).current;return C.jsx(o,{scope:m,itemMap:b,collectionRef:y,children:v})};s.displayName=t;const a=e+"CollectionSlot",l=w.forwardRef((p,m)=>{const{scope:v,children:y}=p,b=i(a,v),x=$o(m,b.collectionRef);return C.jsx($p,{ref:x,children:y})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=w.forwardRef((p,m)=>{const{scope:v,children:y,...b}=p,x=w.useRef(null),E=$o(m,x),R=i(c,v);return w.useEffect(()=>(R.itemMap.set(x,{ref:x,...b}),()=>void R.itemMap.delete(x))),C.jsx($p,{[u]:"",ref:E,children:y})});d.displayName=c;function f(p){const m=i(e+"CollectionConsumer",p);return w.useCallback(()=>{const y=m.collectionRef.current;if(!y)return[];const b=Array.from(y.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((R,P)=>b.indexOf(R.ref.current)-b.indexOf(P.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},f,r]}var TMe=S.createContext(void 0);function CV(e){const t=S.useContext(TMe);return e||t||"ltr"}var DMe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Lo=DMe.reduce((e,t)=>{const n=S.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?$p:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function _V(e,t){e&&Pi.flushSync(()=>e.dispatchEvent(t))}function ta(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function MMe(e,t=globalThis==null?void 0:globalThis.document){const n=ta(e);S.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var IMe="DismissableLayer",aE="dismissableLayer.update",$Me="dismissableLayer.pointerDownOutside",NMe="dismissableLayer.focusOutside",Wk,EV=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),RV=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=S.useContext(EV),[u,d]=S.useState(null),f=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=S.useState({}),m=$o(t,A=>d(A)),v=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=u?v.indexOf(u):-1,E=c.layersWithOutsidePointerEventsDisabled.size>0,R=x>=b,P=FMe(A=>{const D=A.target,I=[...c.branches].some(L=>L.contains(D));!R||I||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},f),O=jMe(A=>{const D=A.target;[...c.branches].some(L=>L.contains(D))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},f);return MMe(A=>{x===c.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},f),S.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Wk=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),Uk(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Wk)}},[u,f,n,c]),S.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),Uk())},[u,c]),S.useEffect(()=>{const A=()=>p({});return document.addEventListener(aE,A),()=>document.removeEventListener(aE,A)},[]),C.jsx(Lo.div,{...l,ref:m,style:{pointerEvents:E?R?"auto":"none":void 0,...e.style},onFocusCapture:Zt(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Zt(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Zt(e.onPointerDownCapture,P.onPointerDownCapture)})});RV.displayName=IMe;var kMe="DismissableLayerBranch",LMe=S.forwardRef((e,t)=>{const n=S.useContext(EV),r=S.useRef(null),o=$o(t,r);return S.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),C.jsx(Lo.div,{...e,ref:o})});LMe.displayName=kMe;function FMe(e,t=globalThis==null?void 0:globalThis.document){const n=ta(e),r=S.useRef(!1),o=S.useRef(()=>{});return S.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){PV($Me,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}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 jMe(e,t=globalThis==null?void 0:globalThis.document){const n=ta(e),r=S.useRef(!1);return S.useEffect(()=>{const o=i=>{i.target&&!r.current&&PV(NMe,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 Uk(){const e=new CustomEvent(aE);document.dispatchEvent(e)}function PV(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?_V(o,i):o.dispatchEvent(i)}var Vc=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},zMe=S.useId||(()=>{}),BMe=0;function VMe(e){const[t,n]=S.useState(zMe());return Vc(()=>{e||n(r=>r??String(BMe++))},[e]),e||(t?`radix-${t}`:"")}var HMe="Arrow",OV=S.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return C.jsx(Lo.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:C.jsx("polygon",{points:"0,0 30,0 15,10"})})});OV.displayName=HMe;var WMe=OV;function UMe(e){const[t,n]=S.useState(void 0);return Vc(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,a=c.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var XP="Popper",[AV,TV]=qy(XP),[GMe,DV]=AV(XP),MV=e=>{const{__scopePopper:t,children:n}=e,[r,o]=S.useState(null);return C.jsx(GMe,{scope:t,anchor:r,onAnchorChange:o,children:n})};MV.displayName=XP;var IV="PopperAnchor",$V=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=DV(IV,n),s=S.useRef(null),a=$o(t,s);return S.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:C.jsx(Lo.div,{...o,ref:a})});$V.displayName=IV;var QP="PopperContent",[qMe,YMe]=AV(QP),NV=S.forwardRef((e,t)=>{var ne,Z,ae,ce,ve,ee;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:m,...v}=e,y=DV(QP,n),[b,x]=S.useState(null),E=$o(t,ge=>x(ge)),[R,P]=S.useState(null),O=UMe(R),A=(O==null?void 0:O.width)??0,D=(O==null?void 0:O.height)??0,I=r+(i!=="center"?"-"+i:""),L=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},j=Array.isArray(c)?c:[c],z=j.length>0,K={padding:L,boundary:j.filter(XMe),altBoundary:z},{refs:H,floatingStyles:k,placement:W,isPositioned:B,middlewareData:U}=ug({strategy:"fixed",placement:I,whileElementsMounted:(...ge)=>cg(...ge,{animationFrame:p==="always"}),elements:{reference:y.anchor},middleware:[tf({mainAxis:o+D,alignmentAxis:s}),l&&dg({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?iy():void 0,...K}),l&&fg({...K}),hg({...K,apply:({elements:ge,rects:fe,availableWidth:Se,availableHeight:Ae})=>{const{width:ze,height:Ie}=fe.reference,De=ge.floating.style;De.setProperty("--radix-popper-available-width",`${Se}px`),De.setProperty("--radix-popper-available-height",`${Ae}px`),De.setProperty("--radix-popper-anchor-width",`${ze}px`),De.setProperty("--radix-popper-anchor-height",`${Ie}px`)}}),R&&ay({element:R,padding:a}),QMe({arrowWidth:A,arrowHeight:D}),f&&sy({strategy:"referenceHidden",...K})]}),[q,$]=FV(W),Y=ta(m);Vc(()=>{B&&(Y==null||Y())},[B,Y]);const X=(ne=U.arrow)==null?void 0:ne.x,M=(Z=U.arrow)==null?void 0:Z.y,oe=((ae=U.arrow)==null?void 0:ae.centerOffset)!==0,[te,ie]=S.useState();return Vc(()=>{b&&ie(window.getComputedStyle(b).zIndex)},[b]),C.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...k,transform:B?k.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:te,"--radix-popper-transform-origin":[(ce=U.transformOrigin)==null?void 0:ce.x,(ve=U.transformOrigin)==null?void 0:ve.y].join(" "),...((ee=U.hide)==null?void 0:ee.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:C.jsx(qMe,{scope:n,placedSide:q,onArrowChange:P,arrowX:X,arrowY:M,shouldHideArrow:oe,children:C.jsx(Lo.div,{"data-side":q,"data-align":$,...v,ref:E,style:{...v.style,animation:B?void 0:"none"}})})})});NV.displayName=QP;var kV="PopperArrow",KMe={top:"bottom",right:"left",bottom:"top",left:"right"},LV=S.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=YMe(kV,r),s=KMe[i.placedSide];return C.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:C.jsx(WMe,{...o,ref:n,style:{...o.style,display:"block"}})})});LV.displayName=kV;function XMe(e){return e!==null}var QMe=e=>({name:"transformOrigin",options:e,fn(t){var y,b,x;const{placement:n,rects:r,middlewareData:o}=t,s=((y=o.arrow)==null?void 0:y.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=FV(n),d={start:"0%",center:"50%",end:"100%"}[u],f=(((b=o.arrow)==null?void 0:b.x)??0)+a/2,p=(((x=o.arrow)==null?void 0:x.y)??0)+l/2;let m="",v="";return c==="bottom"?(m=s?d:`${f}px`,v=`${-l}px`):c==="top"?(m=s?d:`${f}px`,v=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,v=s?d:`${p}px`):c==="left"&&(m=`${r.floating.width+l}px`,v=s?d:`${p}px`),{data:{x:m,y:v}}}});function FV(e){const[t,n="center"]=e.split("-");return[t,n]}var ZMe=MV,JMe=$V,eIe=NV,tIe=LV,nIe="Portal",jV=S.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=S.useState(!1);Vc(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Pn.createPortal(C.jsx(Lo.div,{...r,ref:t}),s):null});jV.displayName=nIe;function rIe(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var $g=e=>{const{present:t,children:n}=e,r=oIe(t),o=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),i=$o(r.ref,iIe(o));return typeof n=="function"||r.isPresent?S.cloneElement(o,{ref:i}):null};$g.displayName="Presence";function oIe(e){const[t,n]=S.useState(),r=S.useRef({}),o=S.useRef(e),i=S.useRef("none"),s=e?"mounted":"unmounted",[a,l]=rIe(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=Fv(r.current);i.current=a==="mounted"?c:"none"},[a]),Vc(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,p=Fv(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Vc(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=p=>{const v=Fv(r.current).includes(p.animationName);if(p.target===t&&v&&(l("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=p=>{p.target===t&&(i.current=Fv(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:S.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Fv(e){return(e==null?void 0:e.animationName)||"none"}function iIe(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function sIe({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=aIe({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=ta(n),l=S.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function aIe({defaultProp:e,onChange:t}){const n=S.useState(e),[r]=n,o=S.useRef(r),i=ta(t);return S.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var lS="rovingFocusGroup.onEntryFocus",lIe={bubbles:!1,cancelable:!0},Yy="RovingFocusGroup",[lE,zV,cIe]=SV(Yy),[uIe,BV]=qy(Yy,[cIe]),[dIe,fIe]=uIe(Yy),VV=S.forwardRef((e,t)=>C.jsx(lE.Provider,{scope:e.__scopeRovingFocusGroup,children:C.jsx(lE.Slot,{scope:e.__scopeRovingFocusGroup,children:C.jsx(hIe,{...e,ref:t})})}));VV.displayName=Yy;var hIe=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,f=S.useRef(null),p=$o(t,f),m=CV(i),[v=null,y]=sIe({prop:s,defaultProp:a,onChange:l}),[b,x]=S.useState(!1),E=ta(c),R=zV(n),P=S.useRef(!1),[O,A]=S.useState(0);return S.useEffect(()=>{const D=f.current;if(D)return D.addEventListener(lS,E),()=>D.removeEventListener(lS,E)},[E]),C.jsx(dIe,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:v,onItemFocus:S.useCallback(D=>y(D),[y]),onItemShiftTab:S.useCallback(()=>x(!0),[]),onFocusableItemAdd:S.useCallback(()=>A(D=>D+1),[]),onFocusableItemRemove:S.useCallback(()=>A(D=>D-1),[]),children:C.jsx(Lo.div,{tabIndex:b||O===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:"none",...e.style},onMouseDown:Zt(e.onMouseDown,()=>{P.current=!0}),onFocus:Zt(e.onFocus,D=>{const I=!P.current;if(D.target===D.currentTarget&&I&&!b){const L=new CustomEvent(lS,lIe);if(D.currentTarget.dispatchEvent(L),!L.defaultPrevented){const j=R().filter(W=>W.focusable),z=j.find(W=>W.active),K=j.find(W=>W.id===v),k=[z,K,...j].filter(Boolean).map(W=>W.ref.current);UV(k,u)}}P.current=!1}),onBlur:Zt(e.onBlur,()=>x(!1))})})}),HV="RovingFocusGroupItem",WV=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=VMe(),l=i||a,c=fIe(HV,n),u=c.currentTabStopId===l,d=zV(n),{onFocusableItemAdd:f,onFocusableItemRemove:p}=c;return S.useEffect(()=>{if(r)return f(),()=>p()},[r,f,p]),C.jsx(lE.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:C.jsx(Lo.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:Zt(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:Zt(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Zt(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const v=mIe(m,c.orientation,c.dir);if(v!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let b=d().filter(x=>x.focusable).map(x=>x.ref.current);if(v==="last")b.reverse();else if(v==="prev"||v==="next"){v==="prev"&&b.reverse();const x=b.indexOf(m.currentTarget);b=c.loop?vIe(b,x+1):b.slice(x+1)}setTimeout(()=>UV(b))}})})})});WV.displayName=HV;var pIe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function gIe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function mIe(e,t,n){const r=gIe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return pIe[r]}function UV(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function vIe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var bIe=VV,yIe=WV,cE=["Enter"," "],xIe=["ArrowDown","PageUp","Home"],GV=["ArrowUp","PageDown","End"],wIe=[...xIe,...GV],SIe={ltr:[...cE,"ArrowRight"],rtl:[...cE,"ArrowLeft"]},CIe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Ng="Menu",[Np,_Ie,EIe]=SV(Ng),[eu,qV]=qy(Ng,[EIe,TV,BV]),Ky=TV(),YV=BV(),[RIe,tu]=eu(Ng),[PIe,kg]=eu(Ng),KV=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=Ky(t),[l,c]=S.useState(null),u=S.useRef(!1),d=ta(i),f=CV(o);return S.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),C.jsx(ZMe,{...a,children:C.jsx(RIe,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:C.jsx(PIe,{scope:t,onClose:S.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:s,children:r})})})};KV.displayName=Ng;var OIe="MenuAnchor",ZP=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Ky(n);return C.jsx(JMe,{...o,...r,ref:t})});ZP.displayName=OIe;var JP="MenuPortal",[AIe,XV]=eu(JP,{forceMount:void 0}),QV=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=tu(JP,t);return C.jsx(AIe,{scope:t,forceMount:n,children:C.jsx($g,{present:n||i.open,children:C.jsx(jV,{asChild:!0,container:o,children:r})})})};QV.displayName=JP;var ti="MenuContent",[TIe,eO]=eu(ti),ZV=S.forwardRef((e,t)=>{const n=XV(ti,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=tu(ti,e.__scopeMenu),s=kg(ti,e.__scopeMenu);return C.jsx(Np.Provider,{scope:e.__scopeMenu,children:C.jsx($g,{present:r||i.open,children:C.jsx(Np.Slot,{scope:e.__scopeMenu,children:s.modal?C.jsx(DIe,{...o,ref:t}):C.jsx(MIe,{...o,ref:t})})})})}),DIe=S.forwardRef((e,t)=>{const n=tu(ti,e.__scopeMenu),r=S.useRef(null),o=$o(t,r);return S.useEffect(()=>{const i=r.current;if(i)return mg(i)},[]),C.jsx(tO,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Zt(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),MIe=S.forwardRef((e,t)=>{const n=tu(ti,e.__scopeMenu);return C.jsx(tO,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),tO=S.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...v}=e,y=tu(ti,n),b=kg(ti,n),x=Ky(n),E=YV(n),R=_Ie(n),[P,O]=S.useState(null),A=S.useRef(null),D=$o(t,A,y.onContentChange),I=S.useRef(0),L=S.useRef(""),j=S.useRef(0),z=S.useRef(null),K=S.useRef("right"),H=S.useRef(0),k=m?P2:S.Fragment,W=m?{as:$p,allowPinchZoom:!0}:void 0,B=q=>{var ne,Z;const $=L.current+q,Y=R().filter(ae=>!ae.disabled),X=document.activeElement,M=(ne=Y.find(ae=>ae.ref.current===X))==null?void 0:ne.textValue,oe=Y.map(ae=>ae.textValue),te=WIe(oe,$,M),ie=(Z=Y.find(ae=>ae.textValue===te))==null?void 0:Z.ref.current;(function ae(ce){L.current=ce,window.clearTimeout(I.current),ce!==""&&(I.current=window.setTimeout(()=>ae(""),1e3))})($),ie&&setTimeout(()=>ie.focus())};S.useEffect(()=>()=>window.clearTimeout(I.current),[]),b2();const U=S.useCallback(q=>{var Y,X;return K.current===((Y=z.current)==null?void 0:Y.side)&&GIe(q,(X=z.current)==null?void 0:X.area)},[]);return C.jsx(TIe,{scope:n,searchRef:L,onItemEnter:S.useCallback(q=>{U(q)&&q.preventDefault()},[U]),onItemLeave:S.useCallback(q=>{var $;U(q)||(($=A.current)==null||$.focus(),O(null))},[U]),onTriggerLeave:S.useCallback(q=>{U(q)&&q.preventDefault()},[U]),pointerGraceTimerRef:j,onPointerGraceIntentChange:S.useCallback(q=>{z.current=q},[]),children:C.jsx(k,{...W,children:C.jsx(py,{asChild:!0,trapped:o,onMountAutoFocus:Zt(i,q=>{var $;q.preventDefault(),($=A.current)==null||$.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:C.jsx(RV,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:C.jsx(bIe,{asChild:!0,...E,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:P,onCurrentTabStopIdChange:O,onEntryFocus:Zt(l,q=>{b.isUsingKeyboardRef.current||q.preventDefault()}),preventScrollOnEntryFocus:!0,children:C.jsx(eIe,{role:"menu","aria-orientation":"vertical","data-state":pH(y.open),"data-radix-menu-content":"",dir:b.dir,...x,...v,ref:D,style:{outline:"none",...v.style},onKeyDown:Zt(v.onKeyDown,q=>{const Y=q.target.closest("[data-radix-menu-content]")===q.currentTarget,X=q.ctrlKey||q.altKey||q.metaKey,M=q.key.length===1;Y&&(q.key==="Tab"&&q.preventDefault(),!X&&M&&B(q.key));const oe=A.current;if(q.target!==oe||!wIe.includes(q.key))return;q.preventDefault();const ie=R().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);GV.includes(q.key)&&ie.reverse(),VIe(ie)}),onBlur:Zt(e.onBlur,q=>{q.currentTarget.contains(q.target)||(window.clearTimeout(I.current),L.current="")}),onPointerMove:Zt(e.onPointerMove,kp(q=>{const $=q.target,Y=H.current!==q.clientX;if(q.currentTarget.contains($)&&Y){const X=q.clientX>H.current?"right":"left";K.current=X,H.current=q.clientX}}))})})})})})})});ZV.displayName=ti;var IIe="MenuGroup",nO=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return C.jsx(Lo.div,{role:"group",...r,ref:t})});nO.displayName=IIe;var $Ie="MenuLabel",JV=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return C.jsx(Lo.div,{...r,ref:t})});JV.displayName=$Ie;var m0="MenuItem",Gk="menu.itemSelect",Xy=S.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=S.useRef(null),s=kg(m0,e.__scopeMenu),a=eO(m0,e.__scopeMenu),l=$o(t,i),c=S.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const f=new CustomEvent(Gk,{bubbles:!0,cancelable:!0});d.addEventListener(Gk,p=>r==null?void 0:r(p),{once:!0}),_V(d,f),f.defaultPrevented?c.current=!1:s.onClose()}};return C.jsx(eH,{...o,ref:l,disabled:n,onClick:Zt(e.onClick,u),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),c.current=!0},onPointerUp:Zt(e.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Zt(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||cE.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Xy.displayName=m0;var eH=S.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=eO(m0,n),a=YV(n),l=S.useRef(null),c=$o(t,l),[u,d]=S.useState(!1),[f,p]=S.useState("");return S.useEffect(()=>{const m=l.current;m&&p((m.textContent??"").trim())},[i.children]),C.jsx(Np.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:C.jsx(yIe,{asChild:!0,...a,focusable:!r,children:C.jsx(Lo.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:Zt(e.onPointerMove,kp(m=>{r?s.onItemLeave(m):(s.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Zt(e.onPointerLeave,kp(m=>s.onItemLeave(m))),onFocus:Zt(e.onFocus,()=>d(!0)),onBlur:Zt(e.onBlur,()=>d(!1))})})})}),NIe="MenuCheckboxItem",tH=S.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return C.jsx(sH,{scope:e.__scopeMenu,checked:n,children:C.jsx(Xy,{role:"menuitemcheckbox","aria-checked":v0(n)?"mixed":n,...o,ref:t,"data-state":oO(n),onSelect:Zt(o.onSelect,()=>r==null?void 0:r(v0(n)?!0:!n),{checkForDefaultPrevented:!1})})})});tH.displayName=NIe;var nH="MenuRadioGroup",[kIe,LIe]=eu(nH,{value:void 0,onValueChange:()=>{}}),rH=S.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=ta(r);return C.jsx(kIe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:C.jsx(nO,{...o,ref:t})})});rH.displayName=nH;var oH="MenuRadioItem",iH=S.forwardRef((e,t)=>{const{value:n,...r}=e,o=LIe(oH,e.__scopeMenu),i=n===o.value;return C.jsx(sH,{scope:e.__scopeMenu,checked:i,children:C.jsx(Xy,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":oO(i),onSelect:Zt(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});iH.displayName=oH;var rO="MenuItemIndicator",[sH,FIe]=eu(rO,{checked:!1}),aH=S.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=FIe(rO,n);return C.jsx($g,{present:r||v0(i.checked)||i.checked===!0,children:C.jsx(Lo.span,{...o,ref:t,"data-state":oO(i.checked)})})});aH.displayName=rO;var jIe="MenuSeparator",lH=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return C.jsx(Lo.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});lH.displayName=jIe;var zIe="MenuArrow",cH=S.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Ky(n);return C.jsx(tIe,{...o,...r,ref:t})});cH.displayName=zIe;var BIe="MenuSub",[A3e,uH]=eu(BIe),wh="MenuSubTrigger",dH=S.forwardRef((e,t)=>{const n=tu(wh,e.__scopeMenu),r=kg(wh,e.__scopeMenu),o=uH(wh,e.__scopeMenu),i=eO(wh,e.__scopeMenu),s=S.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=S.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return S.useEffect(()=>u,[u]),S.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),C.jsx(ZP,{asChild:!0,...c,children:C.jsx(eH,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":pH(n.open),...e,ref:KP(t,o.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Zt(e.onPointerMove,kp(d=>{i.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Zt(e.onPointerLeave,kp(d=>{var p,m;u();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const v=(m=n.content)==null?void 0:m.dataset.side,y=v==="right",b=y?-5:5,x=f[y?"left":"right"],E=f[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+b,y:d.clientY},{x,y:f.top},{x:E,y:f.top},{x:E,y:f.bottom},{x,y:f.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Zt(e.onKeyDown,d=>{var p;const f=i.searchRef.current!=="";e.disabled||f&&d.key===" "||SIe[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});dH.displayName=wh;var fH="MenuSubContent",hH=S.forwardRef((e,t)=>{const n=XV(ti,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=tu(ti,e.__scopeMenu),s=kg(ti,e.__scopeMenu),a=uH(fH,e.__scopeMenu),l=S.useRef(null),c=$o(t,l);return C.jsx(Np.Provider,{scope:e.__scopeMenu,children:C.jsx($g,{present:r||i.open,children:C.jsx(Np.Slot,{scope:e.__scopeMenu,children:C.jsx(tO,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:c,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;s.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Zt(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Zt(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Zt(e.onKeyDown,u=>{var p;const d=u.currentTarget.contains(u.target),f=CIe[s.dir].includes(u.key);d&&f&&(i.onOpenChange(!1),(p=a.trigger)==null||p.focus(),u.preventDefault())})})})})})});hH.displayName=fH;function pH(e){return e?"open":"closed"}function v0(e){return e==="indeterminate"}function oO(e){return v0(e)?"indeterminate":e?"checked":"unchecked"}function VIe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function HIe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function WIe(e,t,n){const o=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=HIe(e,Math.max(i,0));o.length===1&&(s=s.filter(c=>c!==n));const l=s.find(c=>c.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function UIe(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i].x,l=t[i].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(o=!o)}return o}function GIe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return UIe(n,t)}function kp(e){return t=>t.pointerType==="mouse"?e(t):void 0}var qIe=KV,YIe=ZP,KIe=QV,XIe=ZV,QIe=nO,ZIe=JV,JIe=Xy,e$e=tH,t$e=rH,n$e=iH,r$e=aH,o$e=lH,i$e=cH,s$e=dH,a$e=hH,l$e=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},c$e=S.useId||(()=>{}),u$e=0;function qk(e){const[t,n]=S.useState(c$e());return l$e(()=>{e||n(r=>r??String(u$e++))},[e]),e||(t?`radix-${t}`:"")}var iO="DropdownMenu",[d$e,T3e]=gMe(iO,[qV]),zr=qV(),[f$e,gH]=d$e(iO),mH=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=zr(t),c=S.useRef(null),[u=!1,d]=vMe({prop:o,defaultProp:i,onChange:s});return C.jsx(f$e,{scope:t,triggerId:qk(),triggerRef:c,contentId:qk(),open:u,onOpenChange:d,onOpenToggle:S.useCallback(()=>d(f=>!f),[d]),modal:a,children:C.jsx(qIe,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};mH.displayName=iO;var vH="DropdownMenuTrigger",bH=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=gH(vH,n),s=zr(n);return C.jsx(YIe,{asChild:!0,...s,children:C.jsx(_Me.button,{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:yV(t,i.triggerRef),onPointerDown:g0(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:g0(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});bH.displayName=vH;var h$e="DropdownMenuPortal",yH=e=>{const{__scopeDropdownMenu:t,...n}=e,r=zr(t);return C.jsx(KIe,{...r,...n})};yH.displayName=h$e;var xH="DropdownMenuContent",wH=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=gH(xH,n),i=zr(n),s=S.useRef(!1);return C.jsx(XIe,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:g0(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:g0(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!o.modal||u)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});wH.displayName=xH;var p$e="DropdownMenuGroup",g$e=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return C.jsx(QIe,{...o,...r,ref:t})});g$e.displayName=p$e;var m$e="DropdownMenuLabel",SH=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return C.jsx(ZIe,{...o,...r,ref:t})});SH.displayName=m$e;var v$e="DropdownMenuItem",CH=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return C.jsx(JIe,{...o,...r,ref:t})});CH.displayName=v$e;var b$e="DropdownMenuCheckboxItem",_H=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return C.jsx(e$e,{...o,...r,ref:t})});_H.displayName=b$e;var y$e="DropdownMenuRadioGroup",EH=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return C.jsx(t$e,{...o,...r,ref:t})});EH.displayName=y$e;var x$e="DropdownMenuRadioItem",RH=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return C.jsx(n$e,{...o,...r,ref:t})});RH.displayName=x$e;var w$e="DropdownMenuItemIndicator",PH=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return C.jsx(r$e,{...o,...r,ref:t})});PH.displayName=w$e;var S$e="DropdownMenuSeparator",OH=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return C.jsx(o$e,{...o,...r,ref:t})});OH.displayName=S$e;var C$e="DropdownMenuArrow",_$e=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return C.jsx(i$e,{...o,...r,ref:t})});_$e.displayName=C$e;var E$e="DropdownMenuSubTrigger",AH=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return C.jsx(s$e,{...o,...r,ref:t})});AH.displayName=E$e;var R$e="DropdownMenuSubContent",TH=S.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=zr(n);return C.jsx(a$e,{...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)"}})});TH.displayName=R$e;var P$e=mH,O$e=bH,A$e=yH,DH=wH,MH=SH,IH=CH,$H=_H,T$e=EH,NH=RH,kH=PH,LH=OH,FH=AH,jH=TH;const D$e=P$e,M$e=O$e,I$e=T$e,$$e=S.forwardRef(({className:e,inset:t,children:n,...r},o)=>C.jsxs(FH,{ref:o,className:xe("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,C.jsx(G0,{className:"ml-auto h-4 w-4"})]}));$$e.displayName=FH.displayName;const N$e=S.forwardRef(({className:e,...t},n)=>C.jsx(Wc,{children:C.jsx(jH,{ref:n,className:xe("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})}));N$e.displayName=jH.displayName;const zH=S.forwardRef(({className:e,sideOffset:t=4,...n},r)=>C.jsx(A$e,{children:C.jsx(Wc,{children:C.jsx(DH,{ref:r,sideOffset:t,className:xe("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})})}));zH.displayName=DH.displayName;const BH=S.forwardRef(({className:e,inset:t,...n},r)=>C.jsx(IH,{ref:r,className:xe("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}));BH.displayName=IH.displayName;const VH=S.forwardRef(({className:e,children:t,checked:n,...r},o)=>C.jsxs($H,{ref:o,className:xe("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:[C.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:C.jsx(kH,{children:C.jsx(rg,{className:"h-4 w-4"})})}),t]}));VH.displayName=$H.displayName;const HH=S.forwardRef(({className:e,children:t,...n},r)=>C.jsxs(NH,{ref:r,className:xe("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:[C.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:C.jsx(kH,{children:C.jsx(uR,{className:"h-2 w-2 fill-current"})})}),t]}));HH.displayName=NH.displayName;const WH=S.forwardRef(({className:e,inset:t,...n},r)=>C.jsx(MH,{ref:r,className:xe("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));WH.displayName=MH.displayName;const UH=S.forwardRef(({className:e,...t},n)=>C.jsx(LH,{ref:n,className:xe("-mx-1 my-1 h-px bg-muted",e),...t}));UH.displayName=LH.displayName;const k$e=BB,L$e=VB,F$e=HB,GH=S.forwardRef(({className:e,...t},n)=>C.jsx(WP,{ref:n,className:xe("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}));GH.displayName=WP.displayName;const qH=S.forwardRef(({className:e,children:t,...n},r)=>C.jsx(F$e,{children:C.jsxs(Wc,{children:[C.jsx(GH,{}),C.jsxs(UP,{ref:r,className:xe("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,C.jsxs(YP,{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:[C.jsx(Yd,{className:"h-4 w-4"}),C.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));qH.displayName=UP.displayName;const YH=({className:e,...t})=>C.jsx("div",{className:xe("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});YH.displayName="DialogHeader";const KH=({className:e,...t})=>C.jsx("div",{className:xe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});KH.displayName="DialogFooter";const XH=S.forwardRef(({className:e,...t},n)=>C.jsx(GP,{ref:n,className:xe("text-lg font-semibold leading-none tracking-tight",e),...t}));XH.displayName=GP.displayName;const QH=S.forwardRef(({className:e,...t},n)=>C.jsx(qP,{ref:n,className:xe("text-sm text-muted-foreground",e),...t}));QH.displayName=qP.displayName;const ZH=w.forwardRef(({className:e,...t},n)=>C.jsx("div",{role:"editor-panel",ref:n,className:xe("flex grow h-full",e),...t}));ZH.displayName="EditorPanel";const JH=w.forwardRef(({className:e,...t},n)=>C.jsx("div",{ref:n,className:xe(" flex flex-col space-y-2 w-[270px]",e),...t}));JH.displayName="EditorAside";const eW=w.forwardRef(({className:e,...t},n)=>C.jsx("div",{ref:n,className:xe(" grow",e),...t}));eW.displayName="EditorMain";function j$e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yk(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 Kk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yk(Object(n),!0).forEach(function(r){j$e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function z$e(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 B$e(e,t){if(e==null)return{};var n=z$e(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 V$e(e,t){return H$e(e)||W$e(e,t)||U$e(e,t)||G$e()}function H$e(e){if(Array.isArray(e))return e}function W$e(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 U$e(e,t){if(e){if(typeof e=="string")return Xk(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 Xk(e,t)}}function Xk(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 G$e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
388
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q$e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qk(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 Zk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Qk(Object(n),!0).forEach(function(r){q$e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Y$e(){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 Sh(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 b0(e){return{}.toString.call(e).includes("Object")}function K$e(e){return!Object.keys(e).length}function Lp(e){return typeof e=="function"}function X$e(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Q$e(e,t){return b0(t)||Ya("changeType"),Object.keys(t).some(function(n){return!X$e(e,n)})&&Ya("changeField"),t}function Z$e(e){Lp(e)||Ya("selectorType")}function J$e(e){Lp(e)||b0(e)||Ya("handlerType"),b0(e)&&Object.values(e).some(function(t){return!Lp(t)})&&Ya("handlersType")}function eNe(e){e||Ya("initialIsRequired"),b0(e)||Ya("initialType"),K$e(e)&&Ya("initialContent")}function tNe(e,t){throw new Error(e[t]||e.default)}var nNe={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"},Ya=Sh(tNe)(nNe),jv={changes:Q$e,selector:Z$e,handler:J$e,initial:eNe};function rNe(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};jv.initial(e),jv.handler(t);var n={current:e},r=Sh(sNe)(n,t),o=Sh(iNe)(n),i=Sh(jv.changes)(e),s=Sh(oNe)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return jv.selector(c),c(n.current)}function l(c){Y$e(r,o,i,s)(c)}return[a,l]}function oNe(e,t){return Lp(t)?t(e.current):t}function iNe(e,t){return e.current=Zk(Zk({},e.current),t),t}function sNe(e,t,n){return Lp(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 aNe={create:rNe},lNe={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.43.0/min/vs"}};function cNe(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 uNe(e){return{}.toString.call(e).includes("Object")}function dNe(e){return e||Jk("configIsRequired"),uNe(e)||Jk("configType"),e.urls?(fNe(),{paths:{vs:e.urls.monacoBase}}):e}function fNe(){console.warn(tW.deprecation)}function hNe(e,t){throw new Error(e[t]||e.default)}var tW={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!
389
+ You are using deprecated way of configuration.
390
+
391
+ Instead of using
392
+ monaco.config({ urls: { monacoBase: '...' } })
393
+ use
394
+ monaco.config({ paths: { vs: '...' } })
395
+
396
+ For more please check the link https://github.com/suren-atoyan/monaco-loader#config
397
+ `},Jk=cNe(hNe)(tW),pNe={config:dNe},gNe=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 nW(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],nW(e[n],t[n]))}),Kk(Kk({},e),t)}var mNe={type:"cancelation",msg:"operation is manually canceled"};function cS(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(mNe):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var vNe=aNe.create({config:lNe,isInitialized:!1,resolve:null,reject:null,monaco:null}),rW=V$e(vNe,2),Lg=rW[0],Qy=rW[1];function bNe(e){var t=pNe.config(e),n=t.monaco,r=B$e(t,["monaco"]);Qy(function(o){return{config:nW(o.config,r),monaco:n}})}function yNe(){var e=Lg(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(Qy({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),cS(uS);if(window.monaco&&window.monaco.editor)return oW(window.monaco),e.resolve(window.monaco),cS(uS);gNe(xNe,SNe)(CNe)}return cS(uS)}function xNe(e){return document.body.appendChild(e)}function wNe(e){var t=document.createElement("script");return e&&(t.src=e),t}function SNe(e){var t=Lg(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=wNe("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function CNe(){var e=Lg(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){oW(n),e.resolve(n)},function(n){e.reject(n)})}function oW(e){Lg().monaco||Qy({monaco:e})}function _Ne(){return Lg(function(e){var t=e.monaco;return t})}var uS=new Promise(function(e,t){return Qy({resolve:e,reject:t})}),iW={config:bNe,init:yNe,__getMonacoInstance:_Ne},ENe={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},dS=ENe,RNe={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},PNe=RNe;function ONe({children:e}){return w.createElement("div",{style:PNe.container},e)}var ANe=ONe,TNe=ANe;function DNe({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return w.createElement("section",{style:{...dS.wrapper,width:e,height:t},...s},!n&&w.createElement(TNe,null,r),w.createElement("div",{ref:o,style:{...dS.fullWidth,...!n&&dS.hide},className:i}))}var MNe=DNe,sW=w.memo(MNe);function INe(e){w.useEffect(e,[])}var aW=INe;function $Ne(e,t,n=!0){let r=w.useRef(!0);w.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var So=$Ne;function Vh(){}function Hu(e,t,n,r){return NNe(e,r)||kNe(e,t,n,r)}function NNe(e,t){return e.editor.getModel(lW(e,t))}function kNe(e,t,n,r){return e.editor.createModel(t,n,r?lW(e,r):void 0)}function lW(e,t){return e.Uri.parse(t)}function LNe({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:i,modifiedModelPath:s,keepCurrentOriginalModel:a=!1,keepCurrentModifiedModel:l=!1,theme:c="light",loading:u="Loading...",options:d={},height:f="100%",width:p="100%",className:m,wrapperProps:v={},beforeMount:y=Vh,onMount:b=Vh}){let[x,E]=w.useState(!1),[R,P]=w.useState(!0),O=w.useRef(null),A=w.useRef(null),D=w.useRef(null),I=w.useRef(b),L=w.useRef(y),j=w.useRef(!1);aW(()=>{let k=iW.init();return k.then(W=>(A.current=W)&&P(!1)).catch(W=>(W==null?void 0:W.type)!=="cancelation"&&console.error("Monaco initialization: error:",W)),()=>O.current?H():k.cancel()}),So(()=>{if(O.current&&A.current){let k=O.current.getOriginalEditor(),W=Hu(A.current,e||"",r||n||"text",i||"");W!==k.getModel()&&k.setModel(W)}},[i],x),So(()=>{if(O.current&&A.current){let k=O.current.getModifiedEditor(),W=Hu(A.current,t||"",o||n||"text",s||"");W!==k.getModel()&&k.setModel(W)}},[s],x),So(()=>{let k=O.current.getModifiedEditor();k.getOption(A.current.editor.EditorOption.readOnly)?k.setValue(t||""):t!==k.getValue()&&(k.executeEdits("",[{range:k.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),k.pushUndoStop())},[t],x),So(()=>{var k,W;(W=(k=O.current)==null?void 0:k.getModel())==null||W.original.setValue(e||"")},[e],x),So(()=>{let{original:k,modified:W}=O.current.getModel();A.current.editor.setModelLanguage(k,r||n||"text"),A.current.editor.setModelLanguage(W,o||n||"text")},[n,r,o],x),So(()=>{var k;(k=A.current)==null||k.editor.setTheme(c)},[c],x),So(()=>{var k;(k=O.current)==null||k.updateOptions(d)},[d],x);let z=w.useCallback(()=>{var B;if(!A.current)return;L.current(A.current);let k=Hu(A.current,e||"",r||n||"text",i||""),W=Hu(A.current,t||"",o||n||"text",s||"");(B=O.current)==null||B.setModel({original:k,modified:W})},[n,t,o,e,r,i,s]),K=w.useCallback(()=>{var k;!j.current&&D.current&&(O.current=A.current.editor.createDiffEditor(D.current,{automaticLayout:!0,...d}),z(),(k=A.current)==null||k.editor.setTheme(c),E(!0),j.current=!0)},[d,c,z]);w.useEffect(()=>{x&&I.current(O.current,A.current)},[x]),w.useEffect(()=>{!R&&!x&&K()},[R,x,K]);function H(){var W,B,U,q;let k=(W=O.current)==null?void 0:W.getModel();a||((B=k==null?void 0:k.original)==null||B.dispose()),l||((U=k==null?void 0:k.modified)==null||U.dispose()),(q=O.current)==null||q.dispose()}return w.createElement(sW,{width:p,height:f,isEditorReady:x,loading:u,_ref:D,className:m,wrapperProps:v})}var FNe=LNe;w.memo(FNe);function jNe(e){let t=w.useRef();return w.useEffect(()=>{t.current=e},[e]),t.current}var zNe=jNe,zv=new Map;function BNe({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:i,theme:s="light",line:a,loading:l="Loading...",options:c={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:f=!1,width:p="100%",height:m="100%",className:v,wrapperProps:y={},beforeMount:b=Vh,onMount:x=Vh,onChange:E,onValidate:R=Vh}){let[P,O]=w.useState(!1),[A,D]=w.useState(!0),I=w.useRef(null),L=w.useRef(null),j=w.useRef(null),z=w.useRef(x),K=w.useRef(b),H=w.useRef(),k=w.useRef(r),W=zNe(i),B=w.useRef(!1),U=w.useRef(!1);aW(()=>{let Y=iW.init();return Y.then(X=>(I.current=X)&&D(!1)).catch(X=>(X==null?void 0:X.type)!=="cancelation"&&console.error("Monaco initialization: error:",X)),()=>L.current?$():Y.cancel()}),So(()=>{var X,M,oe,te;let Y=Hu(I.current,e||r||"",t||o||"",i||n||"");Y!==((X=L.current)==null?void 0:X.getModel())&&(d&&zv.set(W,(M=L.current)==null?void 0:M.saveViewState()),(oe=L.current)==null||oe.setModel(Y),d&&((te=L.current)==null||te.restoreViewState(zv.get(i))))},[i],P),So(()=>{var Y;(Y=L.current)==null||Y.updateOptions(c)},[c],P),So(()=>{!L.current||r===void 0||(L.current.getOption(I.current.editor.EditorOption.readOnly)?L.current.setValue(r):r!==L.current.getValue()&&(U.current=!0,L.current.executeEdits("",[{range:L.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),L.current.pushUndoStop(),U.current=!1))},[r],P),So(()=>{var X,M;let Y=(X=L.current)==null?void 0:X.getModel();Y&&o&&((M=I.current)==null||M.editor.setModelLanguage(Y,o))},[o],P),So(()=>{var Y;a!==void 0&&((Y=L.current)==null||Y.revealLine(a))},[a],P),So(()=>{var Y;(Y=I.current)==null||Y.editor.setTheme(s)},[s],P);let q=w.useCallback(()=>{var Y;if(!(!j.current||!I.current)&&!B.current){K.current(I.current);let X=i||n,M=Hu(I.current,r||e||"",t||o||"",X||"");L.current=(Y=I.current)==null?void 0:Y.editor.create(j.current,{model:M,automaticLayout:!0,...c},u),d&&L.current.restoreViewState(zv.get(X)),I.current.editor.setTheme(s),a!==void 0&&L.current.revealLine(a),O(!0),B.current=!0}},[e,t,n,r,o,i,c,u,d,s,a]);w.useEffect(()=>{P&&z.current(L.current,I.current)},[P]),w.useEffect(()=>{!A&&!P&&q()},[A,P,q]),k.current=r,w.useEffect(()=>{var Y,X;P&&E&&((Y=H.current)==null||Y.dispose(),H.current=(X=L.current)==null?void 0:X.onDidChangeModelContent(M=>{U.current||E(L.current.getValue(),M)}))},[P,E]),w.useEffect(()=>{if(P){let Y=I.current.editor.onDidChangeMarkers(X=>{var oe;let M=(oe=L.current.getModel())==null?void 0:oe.uri;if(M&&X.find(te=>te.path===M.path)){let te=I.current.editor.getModelMarkers({resource:M});R==null||R(te)}});return()=>{Y==null||Y.dispose()}}return()=>{}},[P,R]);function $(){var Y,X;(Y=H.current)==null||Y.dispose(),f?d&&zv.set(i,L.current.saveViewState()):(X=L.current.getModel())==null||X.dispose(),L.current.dispose()}return w.createElement(sW,{width:p,height:m,isEditorReady:P,loading:l,_ref:j,className:v,wrapperProps:y})}var VNe=BNe,cW=w.memo(VNe),HNe=cW;const uW="Collapsible",[WNe,dW]=ls(uW),[UNe,sO]=WNe(uW),GNe=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=cs({prop:r,defaultProp:o,onChange:s});return w.createElement(UNe,{scope:n,disabled:i,contentId:Jp(),open:l,onOpenToggle:w.useCallback(()=>c(u=>!u),[c])},w.createElement(On.div,He({"data-state":aO(l),"data-disabled":i?"":void 0},a,{ref:t})))}),qNe="CollapsibleTrigger",YNe=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=sO(qNe,n);return w.createElement(On.button,He({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":aO(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},r,{ref:t,onClick:Ft(e.onClick,o.onOpenToggle)}))}),fW="CollapsibleContent",KNe=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=sO(fW,e.__scopeCollapsible);return w.createElement(qd,{present:n||o.open},({present:i})=>w.createElement(XNe,He({},r,{ref:t,present:i})))}),XNe=w.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=sO(fW,n),[a,l]=w.useState(r),c=w.useRef(null),u=so(t,c),d=w.useRef(0),f=d.current,p=w.useRef(0),m=p.current,v=s.open||a,y=w.useRef(v),b=w.useRef();return w.useEffect(()=>{const x=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(x)},[]),Oc(()=>{const x=c.current;if(x){b.current=b.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const E=x.getBoundingClientRect();d.current=E.height,p.current=E.width,y.current||(x.style.transitionDuration=b.current.transitionDuration,x.style.animationName=b.current.animationName),l(r)}},[s.open,r]),w.createElement(On.div,He({"data-state":aO(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!v},i,{ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style}}),v&&o)});function aO(e){return e?"open":"closed"}const QNe=GNe,ZNe=YNe,JNe=KNe,ml="Accordion",eke=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[lO,tke,nke]=f3(ml),[Zy,D3e]=ls(ml,[nke,dW]),cO=dW(),hW=w.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return w.createElement(lO.Provider,{scope:e.__scopeAccordion},n==="multiple"?w.createElement(ske,He({},i,{ref:t})):w.createElement(ike,He({},o,{ref:t})))});hW.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[pW,rke]=Zy(ml),[gW,oke]=Zy(ml,{collapsible:!1}),ike=w.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=cs({prop:n,defaultProp:r,onChange:o});return w.createElement(pW,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:w.useCallback(()=>i&&l(""),[i,l])},w.createElement(gW,{scope:e.__scopeAccordion,collapsible:i},w.createElement(mW,He({},s,{ref:t}))))}),ske=w.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=cs({prop:n,defaultProp:r,onChange:o}),l=w.useCallback(u=>a((d=[])=>[...d,u]),[a]),c=w.useCallback(u=>a((d=[])=>d.filter(f=>f!==u)),[a]);return w.createElement(pW,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c},w.createElement(gW,{scope:e.__scopeAccordion,collapsible:!0},w.createElement(mW,He({},i,{ref:t}))))}),[ake,Jy]=Zy(ml),mW=w.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=w.useRef(null),l=so(a,t),c=tke(n),d=$E(o)==="ltr",f=Ft(e.onKeyDown,p=>{var m;if(!eke.includes(p.key))return;const v=p.target,y=c().filter(I=>{var L;return!((L=I.ref.current)!==null&&L!==void 0&&L.disabled)}),b=y.findIndex(I=>I.ref.current===v),x=y.length;if(b===-1)return;p.preventDefault();let E=b;const R=0,P=x-1,O=()=>{E=b+1,E>P&&(E=R)},A=()=>{E=b-1,E<R&&(E=P)};switch(p.key){case"Home":E=R;break;case"End":E=P;break;case"ArrowRight":i==="horizontal"&&(d?O():A());break;case"ArrowDown":i==="vertical"&&O();break;case"ArrowLeft":i==="horizontal"&&(d?A():O());break;case"ArrowUp":i==="vertical"&&A();break}const D=E%x;(m=y[D].ref.current)===null||m===void 0||m.focus()});return w.createElement(ake,{scope:n,disabled:r,direction:o,orientation:i},w.createElement(lO.Slot,{scope:n},w.createElement(On.div,He({},s,{"data-orientation":i,ref:l,onKeyDown:r?void 0:f}))))}),uE="AccordionItem",[lke,uO]=Zy(uE),cke=w.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Jy(uE,n),s=rke(uE,n),a=cO(n),l=Jp(),c=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return w.createElement(lke,{scope:n,open:c,disabled:u,triggerId:l},w.createElement(QNe,He({"data-orientation":i.orientation,"data-state":vW(c)},a,o,{ref:t,disabled:u,open:c,onOpenChange:d=>{d?s.onItemOpen(r):s.onItemClose(r)}})))}),uke="AccordionHeader",dke=w.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Jy(ml,n),i=uO(uke,n);return w.createElement(On.h3,He({"data-orientation":o.orientation,"data-state":vW(i.open),"data-disabled":i.disabled?"":void 0},r,{ref:t}))}),e5="AccordionTrigger",fke=w.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Jy(ml,n),i=uO(e5,n),s=oke(e5,n),a=cO(n);return w.createElement(lO.ItemSlot,{scope:n},w.createElement(ZNe,He({"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId},a,r,{ref:t})))}),hke="AccordionContent",pke=w.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Jy(ml,n),i=uO(hke,n),s=cO(n);return w.createElement(JNe,He({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 vW(e){return e?"open":"closed"}const gke=hW,mke=cke,vke=dke,bW=fke,yW=pke,bke=gke,xW=S.forwardRef(({className:e,...t},n)=>C.jsx(mke,{ref:n,className:xe("border-b",e),...t}));xW.displayName="AccordionItem";const wW=S.forwardRef(({className:e,children:t,...n},r)=>C.jsx(vke,{className:"flex",children:C.jsxs(bW,{ref:r,className:xe("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,C.jsx(U0,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));wW.displayName=bW.displayName;const SW=S.forwardRef(({className:e,children:t,...n},r)=>C.jsx(yW,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:C.jsx("div",{className:xe("pb-4 pt-0",e),children:t})}));SW.displayName=yW.displayName;function sd(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 yke(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function CW(...e){return t=>e.forEach(n=>yke(n,t))}function Fg(...e){return w.useCallback(CW(...e),e)}function xke(e,t=[]){let n=[];function r(i,s){const a=w.createContext(s),l=n.length;n=[...n,s];function c(d){const{scope:f,children:p,...m}=d,v=(f==null?void 0:f[e][l])||a,y=w.useMemo(()=>m,Object.values(m));return w.createElement(v.Provider,{value:y},p)}function u(d,f){const p=(f==null?void 0:f[e][l])||a,m=w.useContext(p);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(s=>w.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,wke(o,...t)]}function wke(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}const dE=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},Ske=S.useId||(()=>{});let Cke=0;function fS(e){const[t,n]=S.useState(Ske());return dE(()=>{e||n(r=>r??String(Cke++))},[e]),e||(t?`radix-${t}`:"")}function Hc(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function _ke({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=Eke({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Hc(n),l=w.useCallback(c=>{if(i){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else o(c)},[i,e,o,a]);return[s,l]}function Eke({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,o=w.useRef(r),i=Hc(t);return w.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const dO=w.forwardRef((e,t)=>{const{children:n,...r}=e,o=w.Children.toArray(n),i=o.find(Pke);if(i){const s=i.props.children,a=o.map(l=>l===i?w.Children.count(s)>1?w.Children.only(null):w.isValidElement(s)?s.props.children:null:l);return w.createElement(fE,He({},r,{ref:t}),w.isValidElement(s)?w.cloneElement(s,void 0,a):null)}return w.createElement(fE,He({},r,{ref:t}),n)});dO.displayName="Slot";const fE=w.forwardRef((e,t)=>{const{children:n,...r}=e;return w.isValidElement(n)?w.cloneElement(n,{...Oke(r,n.props),ref:CW(t,n.ref)}):w.Children.count(n)>1?w.Children.only(null):null});fE.displayName="SlotClone";const Rke=({children:e})=>w.createElement(w.Fragment,null,e);function Pke(e){return w.isValidElement(e)&&e.type===Rke}function Oke(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?n[r]=(...a)=>{i==null||i(...a),o==null||o(...a)}:r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const Ake=["a","button","div","h2","h3","img","li","nav","ol","p","span","svg","ul"],ex=Ake.reduce((e,t)=>{const n=w.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?dO:t;return w.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),w.createElement(a,He({},s,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Tke(e,t){e&&Pn.flushSync(()=>e.dispatchEvent(t))}function Dke(e){const t=Hc(e);w.useEffect(()=>{const n=r=>{r.key==="Escape"&&t(r)};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[t])}const hE="dismissableLayer.update",Mke="dismissableLayer.pointerDownOutside",Ike="dismissableLayer.focusOutside";let t5;const $ke=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Nke=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=w.useContext($ke),[u,d]=w.useState(null),[,f]=w.useState({}),p=Fg(t,O=>d(O)),m=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),y=m.indexOf(v),b=u?m.indexOf(u):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,E=b>=y,R=kke(O=>{const A=O.target,D=[...c.branches].some(I=>I.contains(A));!E||D||(o==null||o(O),s==null||s(O),O.defaultPrevented||a==null||a())}),P=Lke(O=>{const A=O.target;[...c.branches].some(I=>I.contains(A))||(i==null||i(O),s==null||s(O),O.defaultPrevented||a==null||a())});return Dke(O=>{b===c.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&a&&(O.preventDefault(),a()))}),w.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(t5=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),n5(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(document.body.style.pointerEvents=t5)}},[u,n,c]),w.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),n5())},[u,c]),w.useEffect(()=>{const O=()=>f({});return document.addEventListener(hE,O),()=>document.removeEventListener(hE,O)},[]),w.createElement(ex.div,He({},l,{ref:p,style:{pointerEvents:x?E?"auto":"none":void 0,...e.style},onFocusCapture:sd(e.onFocusCapture,P.onFocusCapture),onBlurCapture:sd(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:sd(e.onPointerDownCapture,R.onPointerDownCapture)}))});function kke(e){const t=Hc(e),n=w.useRef(!1),r=w.useRef(()=>{});return w.useEffect(()=>{const o=s=>{if(s.target&&!n.current){let l=function(){_W(Mke,t,a,{discrete:!0})};const a={originalEvent:s};s.pointerType==="touch"?(document.removeEventListener("click",r.current),r.current=l,document.addEventListener("click",r.current,{once:!0})):l()}n.current=!1},i=window.setTimeout(()=>{document.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),document.removeEventListener("pointerdown",o),document.removeEventListener("click",r.current)}},[t]),{onPointerDownCapture:()=>n.current=!0}}function Lke(e){const t=Hc(e),n=w.useRef(!1);return w.useEffect(()=>{const r=o=>{o.target&&!n.current&&_W(Ike,t,{originalEvent:o},{discrete:!1})};return document.addEventListener("focusin",r),()=>document.removeEventListener("focusin",r)},[t]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function n5(){const e=new CustomEvent(hE);document.dispatchEvent(e)}function _W(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?Tke(o,i):o.dispatchEvent(i)}const hS="focusScope.autoFocusOnMount",pS="focusScope.autoFocusOnUnmount",r5={bubbles:!1,cancelable:!0},Fke=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=w.useState(null),c=Hc(o),u=Hc(i),d=w.useRef(null),f=Fg(t,v=>l(v)),p=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let v=function(b){if(p.paused||!a)return;const x=b.target;a.contains(x)?d.current=x:Bl(d.current,{select:!0})},y=function(b){p.paused||!a||a.contains(b.relatedTarget)||Bl(d.current,{select:!0})};return document.addEventListener("focusin",v),document.addEventListener("focusout",y),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y)}}},[r,a,p.paused]),w.useEffect(()=>{if(a){i5.add(p);const v=document.activeElement;if(!a.contains(v)){const b=new CustomEvent(hS,r5);a.addEventListener(hS,c),a.dispatchEvent(b),b.defaultPrevented||(jke(Wke(EW(a)),{select:!0}),document.activeElement===v&&Bl(a))}return()=>{a.removeEventListener(hS,c),setTimeout(()=>{const b=new CustomEvent(pS,r5);a.addEventListener(pS,u),a.dispatchEvent(b),b.defaultPrevented||Bl(v??document.body,{select:!0}),a.removeEventListener(pS,u),i5.remove(p)},0)}}},[a,c,u,p]);const m=w.useCallback(v=>{if(!n&&!r||p.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,b=document.activeElement;if(y&&b){const x=v.currentTarget,[E,R]=zke(x);E&&R?!v.shiftKey&&b===R?(v.preventDefault(),n&&Bl(E,{select:!0})):v.shiftKey&&b===E&&(v.preventDefault(),n&&Bl(R,{select:!0})):b===x&&v.preventDefault()}},[n,r,p.paused]);return w.createElement(ex.div,He({tabIndex:-1},s,{ref:f,onKeyDown:m}))});function jke(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Bl(r,{select:t}),document.activeElement!==n)return}function zke(e){const t=EW(e),n=o5(t,e),r=o5(t.reverse(),e);return[n,r]}function EW(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 o5(e,t){for(const n of e)if(!Bke(n,{upTo:t}))return n}function Bke(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 Vke(e){return e instanceof HTMLInputElement&&"select"in e}function Bl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Vke(e)&&t&&e.select()}}const i5=Hke();function Hke(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=s5(e,t),e.unshift(t)},remove(t){var n;e=s5(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function s5(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Wke(e){return e.filter(t=>t.tagName!=="A")}const Uke=w.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?Pn.createPortal(w.createElement(ex.div,He({},o,{ref:t})),r):null});function Gke(e,t){return w.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const tx=e=>{const{present:t,children:n}=e,r=qke(t),o=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),i=Fg(r.ref,o.ref);return typeof n=="function"||r.isPresent?w.cloneElement(o,{ref:i}):null};tx.displayName="Presence";function qke(e){const[t,n]=w.useState(),r=w.useRef({}),o=w.useRef(e),i=w.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Gke(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const c=Bv(r.current);i.current=a==="mounted"?c:"none"},[a]),dE(()=>{const c=r.current,u=o.current;if(u!==e){const f=i.current,p=Bv(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&f!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),dE(()=>{if(t){const c=d=>{const p=Bv(r.current).includes(d.animationName);d.target===t&&p&&Pn.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(i.current=Bv(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Bv(e){return(e==null?void 0:e.animationName)||"none"}let gS=0;function Yke(){w.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:a5()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:a5()),gS++,()=>{gS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),gS--}},[])}function a5(){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}var RW=_2(),mS=function(){},nx=S.forwardRef(function(e,t){var n=S.useRef(null),r=S.useState({onScrollCapture:mS,onWheelCapture:mS,onTouchMoveCapture:mS}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,b=y===void 0?"div":y,x=gy(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),E=f,R=C2([n,t]),P=Ln(Ln({},x),o);return S.createElement(S.Fragment,null,u&&S.createElement(E,{sideCar:RW,removeScrollBar:c,shards:d,noIsolation:p,inert:m,setCallbacks:i,allowPinchZoom:!!v,lockRef:n}),s?S.cloneElement(S.Children.only(a),Ln(Ln({},P),{ref:R})):S.createElement(b,Ln({},P,{className:l,ref:R}),a))});nx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};nx.classNames={fullWidth:Ju,zeroRight:Zu};var pE=!1;if(typeof window<"u")try{var Vv=Object.defineProperty({},"passive",{get:function(){return pE=!0,!0}});window.addEventListener("test",Vv,Vv),window.removeEventListener("test",Vv,Vv)}catch{pE=!1}var Mu=pE?{passive:!1}:!1,Kke=function(e){var t=window.getComputedStyle(e);return t.overflowY!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowY==="visible")},Xke=function(e){var t=window.getComputedStyle(e);return t.overflowX!=="hidden"&&!(t.overflowY===t.overflowX&&t.overflowX==="visible")},l5=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=PW(e,n);if(r){var o=OW(e,n),i=o[1],s=o[2];if(i>s)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Qke=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Zke=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},PW=function(e,t){return e==="v"?Kke(t):Xke(t)},OW=function(e,t){return e==="v"?Qke(t):Zke(t)},Jke=function(e,t){return e==="h"&&t==="rtl"?-1:1},e5e=function(e,t,n,r,o){var i=Jke(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,f=0;do{var p=OW(e,a),m=p[0],v=p[1],y=p[2],b=v-y-i*m;(m||b)&&PW(e,a)&&(d+=b,f+=m),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(o&&d===0||!o&&s>d)||!u&&(o&&f===0||!o&&-s>f))&&(c=!0),c},Hv=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},c5=function(e){return[e.deltaX,e.deltaY]},u5=function(e){return e&&"current"in e?e.current:e},t5e=function(e,t){return e[0]===t[0]&&e[1]===t[1]},n5e=function(e){return`
398
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
399
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
400
+ `)},r5e=0,Iu=[];function o5e(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),o=S.useState(r5e++)[0],i=S.useState(function(){return vy()})[0],s=S.useRef(e);S.useEffect(function(){s.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=S2([e.lockRef.current],(e.shards||[]).map(u5),!0).filter(Boolean);return v.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=S.useCallback(function(v,y){if("touches"in v&&v.touches.length===2)return!s.current.allowPinchZoom;var b=Hv(v),x=n.current,E="deltaX"in v?v.deltaX:x[0]-b[0],R="deltaY"in v?v.deltaY:x[1]-b[1],P,O=v.target,A=Math.abs(E)>Math.abs(R)?"h":"v";if("touches"in v&&A==="h"&&O.type==="range")return!1;var D=l5(A,O);if(!D)return!0;if(D?P=A:(P=A==="v"?"h":"v",D=l5(A,O)),!D)return!1;if(!r.current&&"changedTouches"in v&&(E||R)&&(r.current=P),!P)return!0;var I=r.current||P;return e5e(I,y,v,I==="h"?E:R,!0)},[]),l=S.useCallback(function(v){var y=v;if(!(!Iu.length||Iu[Iu.length-1]!==i)){var b="deltaY"in y?c5(y):Hv(y),x=t.current.filter(function(P){return P.name===y.type&&P.target===y.target&&t5e(P.delta,b)})[0];if(x&&x.should){y.preventDefault();return}if(!x){var E=(s.current.shards||[]).map(u5).filter(Boolean).filter(function(P){return P.contains(y.target)}),R=E.length>0?a(y,E[0]):!s.current.noIsolation;R&&y.preventDefault()}}},[]),c=S.useCallback(function(v,y,b,x){var E={name:v,delta:y,target:b,should:x};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(R){return R!==E})},1)},[]),u=S.useCallback(function(v){n.current=Hv(v),r.current=void 0},[]),d=S.useCallback(function(v){c(v.type,c5(v),v.target,a(v,e.lockRef.current))},[]),f=S.useCallback(function(v){c(v.type,Hv(v),v.target,a(v,e.lockRef.current))},[]);S.useEffect(function(){return Iu.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Mu),document.addEventListener("touchmove",l,Mu),document.addEventListener("touchstart",u,Mu),function(){Iu=Iu.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,Mu),document.removeEventListener("touchmove",l,Mu),document.removeEventListener("touchstart",u,Mu)}},[]);var p=e.removeScrollBar,m=e.inert;return S.createElement(S.Fragment,null,m?S.createElement(i,{styles:n5e(o)}):null,p?S.createElement(R2,{gapMode:"margin"}):null)}const i5e=E2(RW,o5e);var AW=S.forwardRef(function(e,t){return S.createElement(nx,Ln({},e,{ref:t,sideCar:i5e}))});AW.classNames=nx.classNames;const s5e=AW,TW="Dialog",[DW,M3e]=xke(TW),[a5e,nu]=DW(TW),l5e=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=w.useRef(null),l=w.useRef(null),[c=!1,u]=_ke({prop:r,defaultProp:o,onChange:i});return w.createElement(a5e,{scope:t,triggerRef:a,contentRef:l,contentId:fS(),titleId:fS(),descriptionId:fS(),open:c,onOpenChange:u,onOpenToggle:w.useCallback(()=>u(d=>!d),[u]),modal:s},n)},MW="DialogPortal",[c5e,IW]=DW(MW,{forceMount:void 0}),u5e=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=nu(MW,t);return w.createElement(c5e,{scope:t,forceMount:n},w.Children.map(r,s=>w.createElement(tx,{present:n||i.open},w.createElement(Uke,{asChild:!0,container:o},s))))},gE="DialogOverlay",d5e=w.forwardRef((e,t)=>{const n=IW(gE,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=nu(gE,e.__scopeDialog);return i.modal?w.createElement(tx,{present:r||i.open},w.createElement(f5e,He({},o,{ref:t}))):null}),f5e=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=nu(gE,n);return w.createElement(s5e,{as:dO,allowPinchZoom:!0,shards:[o.contentRef]},w.createElement(ex.div,He({"data-state":NW(o.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),Fp="DialogContent",h5e=w.forwardRef((e,t)=>{const n=IW(Fp,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=nu(Fp,e.__scopeDialog);return w.createElement(tx,{present:r||i.open},i.modal?w.createElement(p5e,He({},o,{ref:t})):w.createElement(g5e,He({},o,{ref:t})))}),p5e=w.forwardRef((e,t)=>{const n=nu(Fp,e.__scopeDialog),r=w.useRef(null),o=Fg(t,n.contentRef,r);return w.useEffect(()=>{const i=r.current;if(i)return mg(i)},[]),w.createElement($W,He({},e,{ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:sd(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)===null||s===void 0||s.focus()}),onPointerDownOutside:sd(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:sd(e.onFocusOutside,i=>i.preventDefault())}))}),g5e=w.forwardRef((e,t)=>{const n=nu(Fp,e.__scopeDialog),r=w.useRef(!1);return w.createElement($W,He({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i;if((i=e.onCloseAutoFocus)===null||i===void 0||i.call(e,o),!o.defaultPrevented){var s;r.current||(s=n.triggerRef.current)===null||s===void 0||s.focus(),o.preventDefault()}r.current=!1},onInteractOutside:o=>{var i,s;(i=e.onInteractOutside)===null||i===void 0||i.call(e,o),o.defaultPrevented||(r.current=!0);const a=o.target;((s=n.triggerRef.current)===null||s===void 0?void 0:s.contains(a))&&o.preventDefault()}}))}),$W=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=nu(Fp,n),l=w.useRef(null),c=Fg(t,l);return Yke(),w.createElement(w.Fragment,null,w.createElement(Fke,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i},w.createElement(Nke,He({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":NW(a.open)},s,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)});function NW(e){return e?"open":"closed"}const m5e=l5e,v5e=u5e,b5e=d5e,y5e=h5e;var d5=1,x5e=.9,w5e=.3,vS=.1,S5e=0,bS=.999,C5e=.9999,_5e=.99,f5=/[\\\/\-_+.# \t"@\[\(\{&]/,E5e=/[\\\/\-_+.# \t"@\[\(\{&]/g;function mE(e,t,n,r,o,i){if(i===t.length)return o===e.length?d5:_5e;for(var s=r.charAt(i),a=n.indexOf(s,o),l=0,c,u,d;a>=0;)c=mE(e,t,n,r,a+1,i+1),c>l&&(a===o?c*=d5:f5.test(e.charAt(a-1))?(c*=x5e,d=e.slice(o,a-1).match(E5e),d&&o>0&&(c*=Math.pow(bS,d.length))):f5.test(e.slice(o,a-1))?(c*=S5e,o>0&&(c*=Math.pow(bS,a-o))):(c*=w5e,o>0&&(c*=Math.pow(bS,a-o))),e.charAt(a)!==t.charAt(i)&&(c*=C5e)),c<vS&&n.charAt(a-1)===r.charAt(i+1)&&n.charAt(a-1)!==r.charAt(i)&&(u=mE(e,t,n,r,a+1,i+2),u*vS>c&&(c=u*vS)),c>l&&(l=c),a=n.indexOf(s,a+1);return l}function R5e(e,t){return mE(e,t,e.toLowerCase(),t.toLowerCase(),0,0)}var P5e=R5e;const O5e=sl(P5e);var A5e='[cmdk-list-sizer=""]',th='[cmdk-group=""]',yS='[cmdk-group-items=""]',T5e='[cmdk-group-heading=""]',kW='[cmdk-item=""]',h5=`${kW}:not([aria-disabled="true"])`,vE="cmdk-item-select",Ea="data-value",D5e=(e,t)=>O5e(e,t),LW=S.createContext(void 0),jg=()=>S.useContext(LW),FW=S.createContext(void 0),fO=()=>S.useContext(FW),jW=S.createContext(void 0),zW=S.forwardRef((e,t)=>{let n=S.useRef(null),r=ku(()=>({search:"",value:"",filtered:{count:0,items:new Map,groups:new Set}})),o=ku(()=>new Set),i=ku(()=>new Map),s=ku(()=>new Map),a=ku(()=>new Set),l=BW(e),{label:c,children:u,value:d,onValueChange:f,filter:p,shouldFilter:m,...v}=e,y=S.useId(),b=S.useId(),x=S.useId(),E=V5e();uf(()=>{if(d!==void 0){let q=d.trim().toLowerCase();r.current.value=q,E(6,L),R.emit()}},[d]);let R=S.useMemo(()=>({subscribe:q=>(a.current.add(q),()=>a.current.delete(q)),snapshot:()=>r.current,setState:(q,$,Y)=>{var X,M,oe;if(!Object.is(r.current[q],$)){if(r.current[q]=$,q==="search")I(),A(),E(1,D);else if(q==="value")if(((X=l.current)==null?void 0:X.value)!==void 0){(oe=(M=l.current).onValueChange)==null||oe.call(M,$);return}else Y||E(5,L);R.emit()}},emit:()=>{a.current.forEach(q=>q())}}),[]),P=S.useMemo(()=>({value:(q,$)=>{$!==s.current.get(q)&&(s.current.set(q,$),r.current.filtered.items.set(q,O($)),E(2,()=>{A(),R.emit()}))},item:(q,$)=>(o.current.add(q),$&&(i.current.has($)?i.current.get($).add(q):i.current.set($,new Set([q]))),E(3,()=>{I(),A(),r.current.value||D(),R.emit()}),()=>{s.current.delete(q),o.current.delete(q),r.current.filtered.items.delete(q),E(4,()=>{I(),D(),R.emit()})}),group:q=>(i.current.has(q)||i.current.set(q,new Set),()=>{s.current.delete(q),i.current.delete(q)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],listId:y,inputId:x,labelId:b}),[]);function O(q){var $;let Y=(($=l.current)==null?void 0:$.filter)??D5e;return q?Y(q,r.current.search):0}function A(){if(!n.current||!r.current.search||l.current.shouldFilter===!1)return;let q=r.current.filtered.items,$=[];r.current.filtered.groups.forEach(X=>{let M=i.current.get(X),oe=0;M.forEach(te=>{let ie=q.get(te);oe=Math.max(ie,oe)}),$.push([X,oe])});let Y=n.current.querySelector(A5e);z().sort((X,M)=>{let oe=X.getAttribute(Ea),te=M.getAttribute(Ea);return(q.get(te)??0)-(q.get(oe)??0)}).forEach(X=>{let M=X.closest(yS);M?M.appendChild(X.parentElement===M?X:X.closest(`${yS} > *`)):Y.appendChild(X.parentElement===Y?X:X.closest(`${yS} > *`))}),$.sort((X,M)=>M[1]-X[1]).forEach(X=>{let M=n.current.querySelector(`${th}[${Ea}="${X[0]}"]`);M==null||M.parentElement.appendChild(M)})}function D(){let q=z().find(Y=>!Y.ariaDisabled),$=q==null?void 0:q.getAttribute(Ea);R.setState("value",$||void 0)}function I(){if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=o.current.size;return}r.current.filtered.groups=new Set;let q=0;for(let $ of o.current){let Y=s.current.get($),X=O(Y);r.current.filtered.items.set($,X),X>0&&q++}for(let[$,Y]of i.current)for(let X of Y)if(r.current.filtered.items.get(X)>0){r.current.filtered.groups.add($);break}r.current.filtered.count=q}function L(){var q,$,Y;let X=j();X&&(((q=X.parentElement)==null?void 0:q.firstChild)===X&&((Y=($=X.closest(th))==null?void 0:$.querySelector(T5e))==null||Y.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function j(){return n.current.querySelector(`${kW}[aria-selected="true"]`)}function z(){return Array.from(n.current.querySelectorAll(h5))}function K(q){let $=z()[q];$&&R.setState("value",$.getAttribute(Ea))}function H(q){var $;let Y=j(),X=z(),M=X.findIndex(te=>te===Y),oe=X[M+q];($=l.current)!=null&&$.loop&&(oe=M+q<0?X[X.length-1]:M+q===X.length?X[0]:X[M+q]),oe&&R.setState("value",oe.getAttribute(Ea))}function k(q){let $=j(),Y=$==null?void 0:$.closest(th),X;for(;Y&&!X;)Y=q>0?z5e(Y,th):B5e(Y,th),X=Y==null?void 0:Y.querySelector(h5);X?R.setState("value",X.getAttribute(Ea)):H(q)}let W=()=>K(z().length-1),B=q=>{q.preventDefault(),q.metaKey?W():q.altKey?k(1):H(1)},U=q=>{q.preventDefault(),q.metaKey?K(0):q.altKey?k(-1):H(-1)};return S.createElement("div",{ref:zg([n,t]),...v,"cmdk-root":"",onKeyDown:q=>{var $;if(($=v.onKeyDown)==null||$.call(v,q),!q.defaultPrevented)switch(q.key){case"n":case"j":{q.ctrlKey&&B(q);break}case"ArrowDown":{B(q);break}case"p":case"k":{q.ctrlKey&&U(q);break}case"ArrowUp":{U(q);break}case"Home":{q.preventDefault(),K(0);break}case"End":{q.preventDefault(),W();break}case"Enter":{q.preventDefault();let Y=j();if(Y){let X=new Event(vE);Y.dispatchEvent(X)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:P.inputId,id:P.labelId,style:H5e},c),S.createElement(FW.Provider,{value:R},S.createElement(LW.Provider,{value:P},u)))}),M5e=S.forwardRef((e,t)=>{let n=S.useId(),r=S.useRef(null),o=S.useContext(jW),i=jg(),s=BW(e);uf(()=>i.item(n,o),[]);let a=VW(n,r,[e.value,e.children,r]),l=fO(),c=Hd(b=>b.value&&b.value===a.current),u=Hd(b=>i.filter()===!1?!0:b.search?b.filtered.items.get(n)>0:!0);S.useEffect(()=>{let b=r.current;if(!(!b||e.disabled))return b.addEventListener(vE,d),()=>b.removeEventListener(vE,d)},[u,e.onSelect,e.disabled]);function d(){var b,x;(x=(b=s.current).onSelect)==null||x.call(b,a.current)}function f(){l.setState("value",a.current,!0)}if(!u)return null;let{disabled:p,value:m,onSelect:v,...y}=e;return S.createElement("div",{ref:zg([r,t]),...y,"cmdk-item":"",role:"option","aria-disabled":p||void 0,"aria-selected":c||void 0,"data-selected":c||void 0,onPointerMove:p?void 0:f,onClick:p?void 0:d},e.children)}),I5e=S.forwardRef((e,t)=>{let{heading:n,children:r,...o}=e,i=S.useId(),s=S.useRef(null),a=S.useRef(null),l=S.useId(),c=jg(),u=Hd(f=>c.filter()===!1?!0:f.search?f.filtered.groups.has(i):!0);uf(()=>c.group(i),[]),VW(i,s,[e.value,e.heading,a]);let d=S.createElement(jW.Provider,{value:i},r);return S.createElement("div",{ref:zg([s,t]),...o,"cmdk-group":"",role:"presentation",hidden:u?void 0:!0},n&&S.createElement("div",{ref:a,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},d))}),$5e=S.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=S.useRef(null),i=Hd(s=>!s.search);return!n&&!i?null:S.createElement("div",{ref:zg([o,t]),...r,"cmdk-separator":"",role:"separator"})}),N5e=S.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=fO(),s=Hd(l=>l.search),a=jg();return S.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),S.createElement("input",{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":a.listId,"aria-labelledby":a.labelId,id:a.inputId,type:"text",value:o?e.value:s,onChange:l=>{o||i.setState("search",l.target.value),n==null||n(l.target.value)}})}),k5e=S.forwardRef((e,t)=>{let{children:n,...r}=e,o=S.useRef(null),i=S.useRef(null),s=jg();return S.useEffect(()=>{if(i.current&&o.current){let a=i.current,l=o.current,c,u=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let d=a.getBoundingClientRect().height;l.style.setProperty("--cmdk-list-height",d.toFixed(1)+"px")})});return u.observe(a),()=>{cancelAnimationFrame(c),u.unobserve(a)}}},[]),S.createElement("div",{ref:zg([o,t]),...r,"cmdk-list":"",role:"listbox","aria-label":"Suggestions",id:s.listId,"aria-labelledby":s.inputId},S.createElement("div",{ref:i,"cmdk-list-sizer":""},n))}),L5e=S.forwardRef((e,t)=>{let{open:n,onOpenChange:r,container:o,...i}=e;return S.createElement(m5e,{open:n,onOpenChange:r},S.createElement(v5e,{container:o},S.createElement(b5e,{"cmdk-overlay":""}),S.createElement(y5e,{"aria-label":e.label,"cmdk-dialog":""},S.createElement(zW,{ref:t,...i}))))}),F5e=S.forwardRef((e,t)=>{let n=S.useRef(!0),r=Hd(o=>o.filtered.count===0);return S.useEffect(()=>{n.current=!1},[]),n.current||!r?null:S.createElement("div",{ref:t,...e,"cmdk-empty":"",role:"presentation"})}),j5e=S.forwardRef((e,t)=>{let{progress:n,children:r,...o}=e;return S.createElement("div",{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Loading..."},S.createElement("div",{"aria-hidden":!0},r))}),lo=Object.assign(zW,{List:k5e,Item:M5e,Input:N5e,Group:I5e,Separator:$5e,Dialog:L5e,Empty:F5e,Loading:j5e});function z5e(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function B5e(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function BW(e){let t=S.useRef(e);return uf(()=>{t.current=e}),t}var uf=typeof window>"u"?S.useEffect:S.useLayoutEffect;function ku(e){let t=S.useRef();return t.current===void 0&&(t.current=e()),t}function zg(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Hd(e){let t=fO(),n=()=>e(t.snapshot());return S.useSyncExternalStore(t.subscribe,n,n)}function VW(e,t,n){let r=S.useRef(),o=jg();return uf(()=>{var i;let s=(()=>{var a;for(let l of n){if(typeof l=="string")return l.trim().toLowerCase();if(typeof l=="object"&&"current"in l&&l.current)return(a=l.current.textContent)==null?void 0:a.trim().toLowerCase()}})();o.value(e,s),(i=t.current)==null||i.setAttribute(Ea,s),r.current=s}),r}var V5e=()=>{let[e,t]=S.useState(),n=ku(()=>new Map);return uf(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}},H5e={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const HW=S.forwardRef(({className:e,...t},n)=>C.jsx(lo,{ref:n,className:xe("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));HW.displayName=lo.displayName;const WW=S.forwardRef(({className:e,...t},n)=>C.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[C.jsx(O4,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),C.jsx(lo.Input,{ref:n,className:xe("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));WW.displayName=lo.Input.displayName;const UW=S.forwardRef(({className:e,...t},n)=>C.jsx(lo.List,{ref:n,className:xe("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));UW.displayName=lo.List.displayName;const GW=S.forwardRef((e,t)=>C.jsx(lo.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));GW.displayName=lo.Empty.displayName;const qW=S.forwardRef(({className:e,...t},n)=>C.jsx(lo.Group,{ref:n,className:xe("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));qW.displayName=lo.Group.displayName;const W5e=S.forwardRef(({className:e,...t},n)=>C.jsx(lo.Separator,{ref:n,className:xe("-mx-1 h-px bg-border",e),...t}));W5e.displayName=lo.Separator.displayName;const YW=S.forwardRef(({className:e,...t},n)=>C.jsx(lo.Item,{ref:n,className:xe("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));YW.displayName=lo.Item.displayName;var U5e=Object.defineProperty,G5e=(e,t,n)=>t in e?U5e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wv=(e,t,n)=>(G5e(e,typeof t!="symbol"?t+"":t,n),n);const q5e={stringify:e=>e,parse:e=>e},Y5e={stringify:e=>`${e}`,parse:e=>parseFloat(e)},K5e={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},X5e={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}},Q5e={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},xS={string:q5e,number:Y5e,boolean:K5e,function:X5e,json:Q5e},wS=Symbol.for("r2wc.render"),Uv=Symbol.for("r2wc.connected"),Nl=Symbol.for("r2wc.context"),wa=Symbol.for("r2wc.props");function Z5e(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(d=>d!=="container"),a={},l={},c={};for(const d of s){a[d]=Array.isArray(t.props)?"string":t.props[d];const f=J5e(d);l[d]=f,c[f]=d}class u extends HTMLElement{constructor(){super(),Wv(this,r,!0),Wv(this,o),Wv(this,i,{}),Wv(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[wa].container=this.container;for(const f of s){const p=l[f],m=this.getAttribute(p),v=a[f],y=xS[v];m&&y!=null&&y.parse&&(this[wa][f]=y.parse(m,this))}}static get observedAttributes(){return Object.keys(c)}connectedCallback(){this[Uv]=!0,this[wS]()}disconnectedCallback(){this[Uv]=!1,this[Nl]&&n.unmount(this[Nl]),delete this[Nl]}attributeChangedCallback(f,p,m){const v=c[f],y=a[v],b=xS[y];v in a&&b!=null&&b.parse&&(this[wa][v]=b.parse(m,this),this[wS]())}[(r=Uv,o=Nl,i=wa,wS)](){this[Uv]&&(this[Nl]?n.update(this[Nl],this[wa]):this[Nl]=n.mount(this.container,e,this[wa]))}}for(const d of s){const f=l[d],p=a[d];Object.defineProperty(u.prototype,d,{enumerable:!0,configurable:!0,get(){return this[wa][d]},set(m){this[wa][d]=m;const v=xS[p];if(v!=null&&v.stringify){const y=v.stringify(m);this.getAttribute(f)!==y&&this.setAttribute(f,y)}}})}return u}function J5e(e=""){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function e3e(e,t,n){const r=IS(e),o=w.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function t3e({root:e,ReactComponent:t},n){const r=w.createElement(t,n);e.render(r)}function n3e({root:e}){e.unmount()}function r3e(e,t={}){return Z5e(e,t,{mount:e3e,update:t3e,unmount:n3e})}const o3e={id:"string",version:"string",authToken:"json",defaultFilterValues:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onFilterValuesChange:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function",showAssistant:"boolean"},i3e=r3e(bV,{props:o3e});exports.$a093c7e1ec25a057$export$8c610744efcf8a1d=i7;exports.Accordion=bke;exports.AccordionContent=SW;exports.AccordionItem=xW;exports.AccordionTrigger=wW;exports.BOOLEAN_DATA_TYPES=RE;exports.Bot=hC;exports.Button=ro;exports.Calendar=x4;exports.Card=c3;exports.CardContent=O0;exports.CardDescription=IE;exports.CardHeader=P0;exports.CardTitle=Gd;exports.CaretSortIcon=Lre;exports.ChartJsVisual=k2;exports.Check=rg;exports.CheckIcon=h4;exports.Checkbox=Iy;exports.ChevronDown=U0;exports.ChevronLeft=cR;exports.ChevronRight=G0;exports.ChevronUp=w4;exports.Circle=uR;exports.ClipboardCopyIcon=Vre;exports.ColorFormat=y9;exports.Command=HW;exports.CommandEmpty=GW;exports.CommandGroup=qW;exports.CommandInput=WW;exports.CommandItem=YW;exports.CommandList=UW;exports.Cross2Icon=p4;exports.DATAMODEL_NAMESPCACE=W5;exports.DATE_DATA_TYPES=Ud;exports.Dashboard=bV;exports.DashboardPanel=d3;exports.DashboardTabs=mV;exports.DashboardWC=i3e;exports.Dialog=k$e;exports.DialogContent=qH;exports.DialogDescription=QH;exports.DialogFooter=KH;exports.DialogHeader=YH;exports.DialogTitle=XH;exports.DialogTrigger=L$e;exports.Download=S4;exports.DropdownMenu=D$e;exports.DropdownMenuCheckboxItem=VH;exports.DropdownMenuContent=zH;exports.DropdownMenuItem=BH;exports.DropdownMenuLabel=WH;exports.DropdownMenuRadioGroup=I$e;exports.DropdownMenuRadioItem=HH;exports.DropdownMenuSeparator=UH;exports.DropdownMenuTrigger=M$e;exports.Editable=es;exports.EditorAside=JH;exports.EditorMain=eW;exports.EditorPanel=ZH;exports.ErrorBoundary=q0;exports.Fallback=pR;exports.FallbackEditorCard=Eoe;exports.Filter=C4;exports.FilterHeader=Pj;exports.FilterX=dR;exports.Ft=HNe;exports.GripVertical=_4;exports.HoverCard=cy;exports.HoverCardContent=pg;exports.HoverCardTrigger=uy;exports.Icon=y4;exports.Info=E4;exports.InfoCircledIcon=Qre;exports.Input=yc;exports.Jt=Oj;exports.KPICard=IL;exports.LOCALE_CURRENCY_PAIRS=$S;exports.Label=Dn;exports.Markdown=Vz;exports.NUMBER_DATA_TYPES=Xp;exports.PYTHON_DEFAULT_CODE=H5;exports.PaperPlaneIcon=g4;exports.Percent=R4;exports.PlayIcon=eoe;exports.Plus=fR;exports.Popover=wy;exports.PopoverContent=yg;exports.PopoverTrigger=Sy;exports.RadioGroup=mP;exports.RadioGroupItem=a0;exports.ResizableHandle=YTe;exports.ResizablePanel=nE;exports.ResizablePanelGroup=dB;exports.ScanSearch=P4;exports.ScrollArea=cp;exports.ScrollArea$1=F2;exports.ScrollBar=Ey;exports.Search=O4;exports.Select=Is;exports.SelectContent=Vi;exports.SelectGroup=$u;exports.SelectItem=Un;exports.SelectLabel=Hl;exports.SelectSeparator=Nh;exports.SelectTrigger=Bi;exports.SelectValue=$s;exports.SemaphorContextProvider=a3;exports.SemaphorQueryClient=i3;exports.Separator=gg;exports.Settings=hR;exports.SliderIcon=noe;exports.Switch=nz;exports.TEXT_DATA_TYPES=E0;exports.Table=A4;exports.Table$1=c2;exports.TableBody=d2;exports.TableCell=h2;exports.TableHead=f2;exports.TableHeader=u2;exports.TableRow=$h;exports.TableVisual=w9;exports.Tabs=LE;exports.TabsContent=FE;exports.TabsList=T0;exports.TabsTrigger=D0;exports.Te=bEe;exports.TextCard=JC;exports.Textarea=fP;exports.Toggle=N2;exports.Tooltip=l7;exports.TooltipContent=a2;exports.TooltipTrigger=c7;exports.TriangleDownIcon=m4;exports.TriangleUpIcon=v4;exports.UXProvider=vV;exports.UserRound=T4;exports.X=Yd;exports._=cc;exports.cn=xe;exports.copyToClipboard=VZ;exports.createChartConfig=qR;exports.createLucideIcon=zn;exports.createSqlGenConfig=SJ;exports.de=cW;exports.flexRender=a_;exports.fmt=PE;exports.getCanvasBackgroundColor=Gh;exports.getColumnDataType=CJ;exports.getContrastColor=Sd;exports.getCoreRowModel=O7;exports.getCssVariableValue=I4;exports.getDefaultFilterSql=QCe;exports.getFilterComponent=vP;exports.getFilterValueType=Wu;exports.getKeys=rr;exports.getNumberAxis=mR;exports.getPaginationRowModel=T7;exports.getPlugins=qZ;exports.getQualifiedTableName=U5;exports.getRequest=jZ;exports.getSortedRowModel=A7;exports.getSql=wJ;exports.getTenantAndEndUserId=zZ;exports.getTokenParams=T5;exports.isColumnInSqlGen=_J;exports.jsxRuntimeExports=C;exports.loadManifest=S9;exports.pivotData=yb;exports.postRequest=x0;exports.removeRing=Ch;exports.resolveDataType=R0;exports.titleCase=UZ;exports.useCard=Ufe;exports.useCustomVisual=C9;exports.useDashboardActions=fr;exports.useDashboardCardQuery=Y0;exports.useDashboardStore=we;exports.useEditorActions=W0;exports.useEditorStore=$r;exports.useQuery=Zp;exports.useQueryClient=ME;exports.useReactTable=D7;exports.useSemaphorContext=No;exports.useTheme=q5;exports.useTopoJson=DL;exports.v4=Ka;