react-semaphor 0.0.3771 → 0.0.3773
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/index-B2Tf_ZvV.js +440 -0
- package/dist/chunks/index-BJjSj2rW.js +192 -0
- package/dist/chunks/{index-DeoC8wP6.js → index-CP8FsYJ9.js} +1572 -1575
- package/dist/chunks/{index-BO95GMa_.js → index-Ce3dm45I.js} +21606 -21507
- package/dist/chunks/{lucide-react-CslBFmME.js → lucide-react-BakrgOsH.js} +3 -3
- package/dist/chunks/{lucide-react-Dd51A2C_.js → lucide-react-DceOIQtS.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/dashboard.d.ts +0 -5
- package/dist/types/main.d.ts +0 -5
- package/dist/types/surfboard.d.ts +0 -5
- package/dist/types/types.d.ts +0 -5
- package/package.json +2 -2
- package/dist/chunks/index-BoTz0wgQ.js +0 -440
- package/dist/chunks/index-De5ny3c9.js +0 -192
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
"use strict";var VY=Object.defineProperty;var nk=e=>{throw TypeError(e)};var WY=(e,t,n)=>t in e?VY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Oe=(e,t,n)=>WY(e,typeof t!="symbol"?t+"":t,n),ux=(e,t,n)=>t.has(e)||nk("Cannot "+n);var se=(e,t,n)=>(ux(e,t,"read from private field"),n?n.call(e):t.get(e)),Je=(e,t,n)=>t.has(e)?nk("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Be=(e,t,n,r)=>(ux(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ft=(e,t,n)=>(ux(e,t,"access private method"),n);var Lg=(e,t,n,r)=>({set _(o){Be(e,t,o,n)},get _(){return se(e,t,r)}});const T=require("react"),Ar=require("react-dom");function lN(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 P=lN(T),yc=lN(Ar);var Qi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function V_(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 f1={exports:{}},ff={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.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 rk;function UY(){if(rk)return ff;rk=1;var e=T,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={},p=null,h=null;c!==void 0&&(p=""+c),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(h=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:p,ref:h,props:d,_owner:o.current}}return ff.Fragment=n,ff.jsx=s,ff.jsxs=s,ff}var hf={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ok;function GY(){return ok||(ok=1,process.env.NODE_ENV!=="production"&&function(){var e=T,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"),p=Symbol.for("react.lazy"),h=Symbol.for("react.offscreen"),m=Symbol.iterator,b="@@iterator";function v(te){if(te===null||typeof te!="object")return null;var Re=m&&te[m]||te[b];return typeof Re=="function"?Re:null}var x=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(te){{for(var Re=arguments.length,Me=new Array(Re>1?Re-1:0),Ue=1;Ue<Re;Ue++)Me[Ue-1]=arguments[Ue];_("error",te,Me)}}function _(te,Re,Me){{var Ue=x.ReactDebugCurrentFrame,Nt=Ue.getStackAddendum();Nt!==""&&(Re+="%s",Me=Me.concat([Nt]));var Ht=Me.map(function(Ct){return String(Ct)});Ht.unshift("Warning: "+Re),Function.prototype.apply.call(console[te],console,Ht)}}var R=!1,C=!1,E=!1,A=!1,M=!1,D;D=Symbol.for("react.module.reference");function L(te){return!!(typeof te=="string"||typeof te=="function"||te===r||te===i||M||te===o||te===c||te===u||A||te===h||R||C||E||typeof te=="object"&&te!==null&&(te.$$typeof===p||te.$$typeof===d||te.$$typeof===s||te.$$typeof===a||te.$$typeof===l||te.$$typeof===D||te.getModuleId!==void 0))}function j(te,Re,Me){var Ue=te.displayName;if(Ue)return Ue;var Nt=Re.displayName||Re.name||"";return Nt!==""?Me+"("+Nt+")":Me}function z(te){return te.displayName||"Context"}function Q(te){if(te==null)return null;if(typeof te.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof te=="function")return te.displayName||te.name||null;if(typeof te=="string")return te;switch(te){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 te=="object")switch(te.$$typeof){case a:var Re=te;return z(Re)+".Consumer";case s:var Me=te;return z(Me._context)+".Provider";case l:return j(te,te.render,"ForwardRef");case d:var Ue=te.displayName||null;return Ue!==null?Ue:Q(te.type)||"Memo";case p:{var Nt=te,Ht=Nt._payload,Ct=Nt._init;try{return Q(Ct(Ht))}catch{return null}}}return null}var G=Object.assign,F=0,H,$,V,X,I,q,U;function O(){}O.__reactDisabledLog=!0;function ee(){{if(F===0){H=console.log,$=console.info,V=console.warn,X=console.error,I=console.group,q=console.groupCollapsed,U=console.groupEnd;var te={configurable:!0,enumerable:!0,value:O,writable:!0};Object.defineProperties(console,{info:te,log:te,warn:te,error:te,group:te,groupCollapsed:te,groupEnd:te})}F++}}function K(){{if(F--,F===0){var te={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:G({},te,{value:H}),info:G({},te,{value:$}),warn:G({},te,{value:V}),error:G({},te,{value:X}),group:G({},te,{value:I}),groupCollapsed:G({},te,{value:q}),groupEnd:G({},te,{value:U})})}F<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var oe=x.ReactCurrentDispatcher,Y;function J(te,Re,Me){{if(Y===void 0)try{throw Error()}catch(Nt){var Ue=Nt.stack.trim().match(/\n( *(at )?)/);Y=Ue&&Ue[1]||""}return`
|
|
18
|
+
`+Y+te}}var ie=!1,de;{var he=typeof WeakMap=="function"?WeakMap:Map;de=new he}function ae(te,Re){if(!te||ie)return"";{var Me=de.get(te);if(Me!==void 0)return Me}var Ue;ie=!0;var Nt=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ht;Ht=oe.current,oe.current=null,ee();try{if(Re){var Ct=function(){throw Error()};if(Object.defineProperty(Ct.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ct,[])}catch(kt){Ue=kt}Reflect.construct(te,[],Ct)}else{try{Ct.call()}catch(kt){Ue=kt}te.call(Ct.prototype)}}else{try{throw Error()}catch(kt){Ue=kt}te()}}catch(kt){if(kt&&Ue&&typeof kt.stack=="string"){for(var yt=kt.stack.split(`
|
|
19
|
+
`),Ne=Ue.stack.split(`
|
|
20
|
+
`),ne=yt.length-1,Se=Ne.length-1;ne>=1&&Se>=0&&yt[ne]!==Ne[Se];)Se--;for(;ne>=1&&Se>=0;ne--,Se--)if(yt[ne]!==Ne[Se]){if(ne!==1||Se!==1)do if(ne--,Se--,Se<0||yt[ne]!==Ne[Se]){var Ie=`
|
|
21
|
+
`+yt[ne].replace(" at new "," at ");return te.displayName&&Ie.includes("<anonymous>")&&(Ie=Ie.replace("<anonymous>",te.displayName)),typeof te=="function"&&de.set(te,Ie),Ie}while(ne>=1&&Se>=0);break}}}finally{ie=!1,oe.current=Ht,K(),Error.prepareStackTrace=Nt}var It=te?te.displayName||te.name:"",fn=It?J(It):"";return typeof te=="function"&&de.set(te,fn),fn}function ge(te,Re,Me){return ae(te,!1)}function ue(te){var Re=te.prototype;return!!(Re&&Re.isReactComponent)}function Ee(te,Re,Me){if(te==null)return"";if(typeof te=="function")return ae(te,ue(te));if(typeof te=="string")return J(te);switch(te){case c:return J("Suspense");case u:return J("SuspenseList")}if(typeof te=="object")switch(te.$$typeof){case l:return ge(te.render);case d:return Ee(te.type,Re,Me);case p:{var Ue=te,Nt=Ue._payload,Ht=Ue._init;try{return Ee(Ht(Nt),Re,Me)}catch{}}}return""}var Te=Object.prototype.hasOwnProperty,Le={},Ae=x.ReactDebugCurrentFrame;function Fe(te){if(te){var Re=te._owner,Me=Ee(te.type,te._source,Re?Re.type:null);Ae.setExtraStackFrame(Me)}else Ae.setExtraStackFrame(null)}function tt(te,Re,Me,Ue,Nt){{var Ht=Function.call.bind(Te);for(var Ct in te)if(Ht(te,Ct)){var yt=void 0;try{if(typeof te[Ct]!="function"){var Ne=Error((Ue||"React class")+": "+Me+" type `"+Ct+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof te[Ct]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ne.name="Invariant Violation",Ne}yt=te[Ct](Re,Ct,Ue,Me,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ne){yt=ne}yt&&!(yt instanceof Error)&&(Fe(Nt),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Ue||"React class",Me,Ct,typeof yt),Fe(null)),yt instanceof Error&&!(yt.message in Le)&&(Le[yt.message]=!0,Fe(Nt),w("Failed %s type: %s",Me,yt.message),Fe(null))}}}var at=Array.isArray;function cn(te){return at(te)}function St(te){{var Re=typeof Symbol=="function"&&Symbol.toStringTag,Me=Re&&te[Symbol.toStringTag]||te.constructor.name||"Object";return Me}}function Vn(te){try{return Rt(te),!1}catch{return!0}}function Rt(te){return""+te}function fe(te){if(Vn(te))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",St(te)),Rt(te)}var _e=x.ReactCurrentOwner,He={key:!0,ref:!0,__self:!0,__source:!0},We,rt;function An(te){if(Te.call(te,"ref")){var Re=Object.getOwnPropertyDescriptor(te,"ref").get;if(Re&&Re.isReactWarning)return!1}return te.ref!==void 0}function Fn(te){if(Te.call(te,"key")){var Re=Object.getOwnPropertyDescriptor(te,"key").get;if(Re&&Re.isReactWarning)return!1}return te.key!==void 0}function Rn(te,Re){typeof te.ref=="string"&&_e.current}function sn(te,Re){{var Me=function(){We||(We=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Re))};Me.isReactWarning=!0,Object.defineProperty(te,"key",{get:Me,configurable:!0})}}function jn(te,Re){{var Me=function(){rt||(rt=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Re))};Me.isReactWarning=!0,Object.defineProperty(te,"ref",{get:Me,configurable:!0})}}var Xt=function(te,Re,Me,Ue,Nt,Ht,Ct){var yt={$$typeof:t,type:te,key:Re,ref:Me,props:Ct,_owner:Ht};return yt._store={},Object.defineProperty(yt._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(yt,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ue}),Object.defineProperty(yt,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Nt}),Object.freeze&&(Object.freeze(yt.props),Object.freeze(yt)),yt};function or(te,Re,Me,Ue,Nt){{var Ht,Ct={},yt=null,Ne=null;Me!==void 0&&(fe(Me),yt=""+Me),Fn(Re)&&(fe(Re.key),yt=""+Re.key),An(Re)&&(Ne=Re.ref,Rn(Re,Nt));for(Ht in Re)Te.call(Re,Ht)&&!He.hasOwnProperty(Ht)&&(Ct[Ht]=Re[Ht]);if(te&&te.defaultProps){var ne=te.defaultProps;for(Ht in ne)Ct[Ht]===void 0&&(Ct[Ht]=ne[Ht])}if(yt||Ne){var Se=typeof te=="function"?te.displayName||te.name||"Unknown":te;yt&&sn(Ct,Se),Ne&&jn(Ct,Se)}return Xt(te,yt,Ne,Nt,Ue,_e.current,Ct)}}var Xn=x.ReactCurrentOwner,Yo=x.ReactDebugCurrentFrame;function xr(te){if(te){var Re=te._owner,Me=Ee(te.type,te._source,Re?Re.type:null);Yo.setExtraStackFrame(Me)}else Yo.setExtraStackFrame(null)}var ji;ji=!1;function wr(te){return typeof te=="object"&&te!==null&&te.$$typeof===t}function Lr(){{if(Xn.current){var te=Q(Xn.current.type);if(te)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+te+"`."}return""}}function fl(te){return""}var $e={};function _t(te){{var Re=Lr();if(!Re){var Me=typeof te=="string"?te:te.displayName||te.name;Me&&(Re=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+Me+">.")}return Re}}function Ut(te,Re){{if(!te._store||te._store.validated||te.key!=null)return;te._store.validated=!0;var Me=_t(Re);if($e[Me])return;$e[Me]=!0;var Ue="";te&&te._owner&&te._owner!==Xn.current&&(Ue=" It was passed a child from "+Q(te._owner.type)+"."),xr(te),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Me,Ue),xr(null)}}function Qn(te,Re){{if(typeof te!="object")return;if(cn(te))for(var Me=0;Me<te.length;Me++){var Ue=te[Me];wr(Ue)&&Ut(Ue,Re)}else if(wr(te))te._store&&(te._store.validated=!0);else if(te){var Nt=v(te);if(typeof Nt=="function"&&Nt!==te.entries)for(var Ht=Nt.call(te),Ct;!(Ct=Ht.next()).done;)wr(Ct.value)&&Ut(Ct.value,Re)}}}function Zn(te){{var Re=te.type;if(Re==null||typeof Re=="string")return;var Me;if(typeof Re=="function")Me=Re.propTypes;else if(typeof Re=="object"&&(Re.$$typeof===l||Re.$$typeof===d))Me=Re.propTypes;else return;if(Me){var Ue=Q(Re);tt(Me,te.props,"prop",Ue,te)}else if(Re.PropTypes!==void 0&&!ji){ji=!0;var Nt=Q(Re);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Nt||"Unknown")}typeof Re.getDefaultProps=="function"&&!Re.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Fr(te){{for(var Re=Object.keys(te.props),Me=0;Me<Re.length;Me++){var Ue=Re[Me];if(Ue!=="children"&&Ue!=="key"){xr(te),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ue),xr(null);break}}te.ref!==null&&(xr(te),w("Invalid attribute `ref` supplied to `React.Fragment`."),xr(null))}}var fr={};function ir(te,Re,Me,Ue,Nt,Ht){{var Ct=L(te);if(!Ct){var yt="";(te===void 0||typeof te=="object"&&te!==null&&Object.keys(te).length===0)&&(yt+=" 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 Ne=fl();Ne?yt+=Ne:yt+=Lr();var ne;te===null?ne="null":cn(te)?ne="array":te!==void 0&&te.$$typeof===t?(ne="<"+(Q(te.type)||"Unknown")+" />",yt=" Did you accidentally export a JSX literal instead of a component?"):ne=typeof te,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ne,yt)}var Se=or(te,Re,Me,Nt,Ht);if(Se==null)return Se;if(Ct){var Ie=Re.children;if(Ie!==void 0)if(Ue)if(cn(Ie)){for(var It=0;It<Ie.length;It++)Qn(Ie[It],te);Object.freeze&&Object.freeze(Ie)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Qn(Ie,te)}if(Te.call(Re,"key")){var fn=Q(te),kt=Object.keys(Re).filter(function(Cs){return Cs!=="key"}),Wn=kt.length>0?"{key: someKey, "+kt.join(": ..., ")+": ...}":"{key: someKey}";if(!fr[fn+Wn]){var eo=kt.length>0?"{"+kt.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,Wn,fn,eo,fn),fr[fn+Wn]=!0}}return te===r?Fr(Se):Zn(Se),Se}}function bn(te,Re,Me){return ir(te,Re,Me,!0)}function la(te,Re,Me){return ir(te,Re,Me,!1)}var Uc=la,Gc=bn;hf.Fragment=r,hf.jsx=Uc,hf.jsxs=Gc}()),hf}process.env.NODE_ENV==="production"?f1.exports=UY():f1.exports=GY();var y=f1.exports;function cN(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=cN(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function od(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=cN(e))&&(r&&(r+=" "),r+=t);return r}const qY=Object.freeze(Object.defineProperty({__proto__:null,clsx:od,default:od},Symbol.toStringTag,{value:"Module"})),W_="-",YY=e=>{const t=XY(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(W_);return a[0]===""&&a.length!==1&&a.shift(),uN(a,t)||KY(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},uN=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?uN(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(W_);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},ik=/^\[(.+)\]$/,KY=e=>{if(ik.test(e)){const t=ik.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},XY=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ZY(Object.entries(e.classGroups),n).forEach(([i,s])=>{h1(s,r,i,t)}),r},h1=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:sk(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(QY(o)){h1(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{h1(s,sk(t,i),n,r)})})},sk=(e,t)=>{let n=e;return t.split(W_).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},QY=e=>e.isThemeGetter,ZY=(e,t)=>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,JY=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const 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)}}},dN="!",eK=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let c=0,u=0,d;for(let v=0;v<a.length;v++){let x=a[v];if(c===0){if(x===o&&(r||a.slice(v,v+i)===t)){l.push(a.slice(u,v)),u=v+i;continue}if(x==="/"){d=v;continue}}x==="["?c++:x==="]"&&c--}const p=l.length===0?a:a.substring(u),h=p.startsWith(dN),m=h?p.substring(1):p,b=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:b}};return n?a=>n({className:a,parseClassName:s}):s},tK=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},nK=e=>({cache:JY(e.cacheSize),parseClassName:eK(e),...YY(e)}),rK=/\s+/,oK=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(rK);let a="";for(let l=s.length-1;l>=0;l-=1){const c=s[l],{modifiers:u,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:h}=n(c);let m=!!h,b=r(m?p.substring(0,h):p);if(!b){if(!m){a=c+(a.length>0?" "+a:a);continue}if(b=r(p),!b){a=c+(a.length>0?" "+a:a);continue}m=!1}const v=tK(u).join(":"),x=d?v+dN:v,w=x+b;if(i.includes(w))continue;i.push(w);const _=o(b,m);for(let R=0;R<_.length;++R){const C=_[R];i.push(x+C)}a=c+(a.length>0?" "+a:a)}return a};function iK(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=fN(t))&&(r&&(r+=" "),r+=n);return r}const fN=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=fN(e[r]))&&(n&&(n+=" "),n+=t);return n};function sK(e,...t){let n,r,o,i=s;function s(l){const c=t.reduce((u,d)=>d(u),e());return n=nK(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=oK(l,n);return o(l,u),u}return function(){return i(iK.apply(null,arguments))}}const vn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},hN=/^\[(?:([a-z-]+):)?(.+)\]$/i,aK=/^\d+\/\d+$/,lK=new Set(["px","full","screen"]),cK=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uK=/\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$/,dK=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,fK=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hK=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ds=e=>Au(e)||lK.has(e)||aK.test(e),ya=e=>kd(e,"length",wK),Au=e=>!!e&&!Number.isNaN(Number(e)),dx=e=>kd(e,"number",Au),pf=e=>!!e&&Number.isInteger(Number(e)),pK=e=>e.endsWith("%")&&Au(e.slice(0,-1)),gt=e=>hN.test(e),va=e=>cK.test(e),gK=new Set(["length","size","percentage"]),mK=e=>kd(e,gK,pN),bK=e=>kd(e,"position",pN),yK=new Set(["image","url"]),vK=e=>kd(e,yK,_K),xK=e=>kd(e,"",SK),gf=()=>!0,kd=(e,t,n)=>{const r=hN.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},wK=e=>uK.test(e)&&!dK.test(e),pN=()=>!1,SK=e=>fK.test(e),_K=e=>hK.test(e),CK=()=>{const e=vn("colors"),t=vn("spacing"),n=vn("blur"),r=vn("brightness"),o=vn("borderColor"),i=vn("borderRadius"),s=vn("borderSpacing"),a=vn("borderWidth"),l=vn("contrast"),c=vn("grayscale"),u=vn("hueRotate"),d=vn("invert"),p=vn("gap"),h=vn("gradientColorStops"),m=vn("gradientColorStopPositions"),b=vn("inset"),v=vn("margin"),x=vn("opacity"),w=vn("padding"),_=vn("saturate"),R=vn("scale"),C=vn("sepia"),E=vn("skew"),A=vn("space"),M=vn("translate"),D=()=>["auto","contain","none"],L=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",gt,t],z=()=>[gt,t],Q=()=>["",Ds,ya],G=()=>["auto",Au,gt],F=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],V=()=>["start","end","center","between","around","evenly","stretch"],X=()=>["","0",gt],I=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[Au,gt];return{cacheSize:500,separator:":",theme:{colors:[gf],spacing:[Ds,ya],blur:["none","",va,gt],brightness:q(),borderColor:[e],borderRadius:["none","","full",va,gt],borderSpacing:z(),borderWidth:Q(),contrast:q(),grayscale:X(),hueRotate:q(),invert:X(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[pK,ya],inset:j(),margin:j(),opacity:q(),padding:z(),saturate:q(),scale:q(),sepia:X(),skew:q(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",gt]}],container:["container"],columns:[{columns:[va]}],"break-after":[{"break-after":I()}],"break-before":[{"break-before":I()}],"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","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...F(),gt]}],overflow:[{overflow:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",pf,gt]}],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",gt]}],grow:[{grow:X()}],shrink:[{shrink:X()}],order:[{order:["first","last","none",pf,gt]}],"grid-cols":[{"grid-cols":[gf]}],"col-start-end":[{col:["auto",{span:["full",pf,gt]},gt]}],"col-start":[{"col-start":G()}],"col-end":[{"col-end":G()}],"grid-rows":[{"grid-rows":[gf]}],"row-start-end":[{row:["auto",{span:[pf,gt]},gt]}],"row-start":[{"row-start":G()}],"row-end":[{"row-end":G()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",gt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",gt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...V()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...V(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...V(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"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","svw","lvw","dvw",gt,t]}],"min-w":[{"min-w":[gt,t,"min","max","fit"]}],"max-w":[{"max-w":[gt,t,"none","full","min","max","fit","prose",{screen:[va]},va]}],h:[{h:[gt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[gt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[gt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[gt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",va,ya]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",dx]}],"font-family":[{font:[gf]}],"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-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",gt]}],"line-clamp":[{"line-clamp":["none",Au,dx]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ds,gt]}],"list-image":[{"list-image":["none",gt]}],"list-style-type":[{list:["none","disc","decimal",gt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[x]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[x]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ds,ya]}],"underline-offset":[{"underline-offset":["auto",Ds,gt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",gt]}],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",gt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[x]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...F(),bK]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",mK]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},vK]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],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":[x]}],"border-style":[{border:[...H(),"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":[x]}],"divide-style":[{divide:H()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[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:["",...H()]}],"outline-offset":[{"outline-offset":[Ds,gt]}],"outline-w":[{outline:[Ds,ya]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[x]}],"ring-offset-w":[{"ring-offset":[Ds,ya]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",va,xK]}],"shadow-color":[{shadow:[gf]}],opacity:[{opacity:[x]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",va,gt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[_]}],sepia:[{sepia:[C]}],"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":[x]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"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",gt]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",gt]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",gt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[pf,gt]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",gt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",gt]}],"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",gt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ds,ya,dx]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},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"],size:["w","h"],"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-s","border-color-e","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"]}}},EK=sK(CK);class Ff extends Error{}Ff.prototype.name="InvalidTokenError";function RK(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 PK(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 RK(t)}catch{return atob(t)}}function U_(e,t){if(typeof e!="string")throw new Ff("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 Ff(`Invalid token specified: missing part #${n+1}`);let o;try{o=PK(r)}catch(i){throw new Ff(`Invalid token specified: invalid base64 for part #${n+1} (${i.message})`)}try{return JSON.parse(o)}catch(i){throw new Ff(`Invalid token specified: invalid json for part #${n+1} (${i.message})`)}}const TK={},ak=e=>{let t;const n=new Set,r=(u,d)=>{const p=typeof u=="function"?u(t):u;if(!Object.is(p,t)){const h=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(m=>m(t,h))}},o=()=>t,l={setState:r,getState:o,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(TK?"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()}},c=t=e(r,o,l);return l},kK=e=>e?ak(e):ak;var p1={exports:{}},fx={},Fg={exports:{}},hx={};/**
|
|
31
|
+
* @license React
|
|
32
|
+
* use-sync-external-store-shim.production.js
|
|
33
|
+
*
|
|
34
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the MIT license found in the
|
|
37
|
+
* LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/var lk;function AK(){if(lk)return hx;lk=1;var e=T;function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(d,p){var h=p(),m=r({inst:{value:h,getSnapshot:p}}),b=m[0].inst,v=m[1];return i(function(){b.value=h,b.getSnapshot=p,l(b)&&v({inst:b})},[d,h,p]),o(function(){return l(b)&&v({inst:b}),d(function(){l(b)&&v({inst:b})})},[d]),s(h),h}function l(d){var p=d.getSnapshot;d=d.value;try{var h=p();return!n(d,h)}catch{return!0}}function c(d,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return hx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,hx}var px={};/**
|
|
39
|
+
* @license React
|
|
40
|
+
* use-sync-external-store-shim.development.js
|
|
41
|
+
*
|
|
42
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the MIT license found in the
|
|
45
|
+
* LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/var ck;function OK(){return ck||(ck=1,process.env.NODE_ENV!=="production"&&function(){function e(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}function t(h,m){u||o.startTransition===void 0||(u=!0,console.error("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 b=m();if(!d){var v=m();i(b,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}v=s({inst:{value:b,getSnapshot:m}});var x=v[0].inst,w=v[1];return l(function(){x.value=b,x.getSnapshot=m,n(x)&&w({inst:x})},[h,b,m]),a(function(){return n(x)&&w({inst:x}),h(function(){n(x)&&w({inst:x})})},[h]),c(b),b}function n(h){var m=h.getSnapshot;h=h.value;try{var b=m();return!i(h,b)}catch{return!0}}function r(h,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=T,i=typeof Object.is=="function"?Object.is:e,s=o.useState,a=o.useEffect,l=o.useLayoutEffect,c=o.useDebugValue,u=!1,d=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;px.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),px}var uk;function G_(){return uk||(uk=1,process.env.NODE_ENV==="production"?Fg.exports=AK():Fg.exports=OK()),Fg.exports}/**
|
|
47
|
+
* @license React
|
|
48
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
49
|
+
*
|
|
50
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the MIT license found in the
|
|
53
|
+
* LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/var dk;function MK(){if(dk)return fx;dk=1;var e=T,t=G_();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 fx.useSyncExternalStoreWithSelector=function(c,u,d,p,h){var m=i(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=a(function(){function x(E){if(!w){if(w=!0,_=E,E=p(E),h!==void 0&&b.hasValue){var A=b.value;if(h(A,E))return R=A}return R=E}if(A=R,r(_,E))return A;var M=p(E);return h!==void 0&&h(A,M)?(_=E,A):(_=E,R=M)}var w=!1,_,R,C=d===void 0?null:d;return[function(){return x(u())},C===null?void 0:function(){return x(C())}]},[u,d,p,h]);var v=o(c,m[0],m[1]);return s(function(){b.hasValue=!0,b.value=v},[v]),l(v),v},fx}var gx={};/**
|
|
55
|
+
* @license React
|
|
56
|
+
* use-sync-external-store-shim/with-selector.development.js
|
|
57
|
+
*
|
|
58
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
59
|
+
*
|
|
60
|
+
* This source code is licensed under the MIT license found in the
|
|
61
|
+
* LICENSE file in the root directory of this source tree.
|
|
62
|
+
*/var fk;function IK(){return fk||(fk=1,process.env.NODE_ENV!=="production"&&function(){function e(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=T,n=G_(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,l=t.useDebugValue;gx.useSyncExternalStoreWithSelector=function(c,u,d,p,h){var m=i(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=a(function(){function x(E){if(!w){if(w=!0,_=E,E=p(E),h!==void 0&&b.hasValue){var A=b.value;if(h(A,E))return R=A}return R=E}if(A=R,r(_,E))return A;var M=p(E);return h!==void 0&&h(A,M)?(_=E,A):(_=E,R=M)}var w=!1,_,R,C=d===void 0?null:d;return[function(){return x(u())},C===null?void 0:function(){return x(C())}]},[u,d,p,h]);var v=o(c,m[0],m[1]);return s(function(){b.hasValue=!0,b.value=v},[v]),l(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),gx}process.env.NODE_ENV==="production"?p1.exports=MK():p1.exports=IK();var DK=p1.exports;const NK=nl(DK),gN={},{useDebugValue:LK}=T,{useSyncExternalStoreWithSelector:FK}=NK;let hk=!1;const jK=e=>e;function $K(e,t=jK,n){(gN?"production":void 0)!=="production"&&n&&!hk&&(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"),hk=!0);const r=FK(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return LK(r),r}const zK=e=>{(gN?"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"?kK(e):e,n=(r,o)=>$K(t,r,o);return Object.assign(n,t),n},mN=e=>zK;var bN=Symbol.for("immer-nothing"),pk=Symbol.for("immer-draftable"),Ho=Symbol.for("immer-state"),BK=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 bo(e,...t){if(process.env.NODE_ENV!=="production"){const n=BK[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 id=Object.getPrototypeOf;function sd(e){return!!e&&!!e[Ho]}function vc(e){var t;return e?yN(e)||Array.isArray(e)||!!e[pk]||!!((t=e.constructor)!=null&&t[pk])||w0(e)||S0(e):!1}var HK=Object.prototype.constructor.toString();function yN(e){if(!e||typeof e!="object")return!1;const t=id(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)===HK}function db(e,t){x0(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function x0(e){const t=e[Ho];return t?t.type_:Array.isArray(e)?1:w0(e)?2:S0(e)?3:0}function g1(e,t){return x0(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function vN(e,t,n){const r=x0(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function VK(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function w0(e){return e instanceof Map}function S0(e){return e instanceof Set}function Ol(e){return e.copy_||e.base_}function m1(e,t){if(w0(e))return new Map(e);if(S0(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=yN(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Ho];let o=Reflect.ownKeys(r);for(let i=0;i<o.length;i++){const s=o[i],a=r[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(id(e),r)}else{const r=id(e);if(r!==null&&n)return{...e};const o=Object.create(r);return Object.assign(o,e)}}function q_(e,t=!1){return _0(e)||sd(e)||!vc(e)||(x0(e)>1&&(e.set=e.add=e.clear=e.delete=WK),Object.freeze(e),t&&Object.entries(e).forEach(([n,r])=>q_(r,!0))),e}function WK(){bo(2)}function _0(e){return Object.isFrozen(e)}var UK={};function xc(e){const t=UK[e];return t||bo(0,e),t}var Ch;function xN(){return Ch}function GK(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function gk(e,t){t&&(xc("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function b1(e){y1(e),e.drafts_.forEach(qK),e.drafts_=null}function y1(e){e===Ch&&(Ch=e.parent_)}function mk(e){return Ch=GK(Ch,e)}function qK(e){const t=e[Ho];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function bk(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Ho].modified_&&(b1(t),bo(4)),vc(e)&&(e=fb(t,e),t.parent_||hb(t,e)),t.patches_&&xc("Patches").generateReplacementPatches_(n[Ho].base_,e,t.patches_,t.inversePatches_)):e=fb(t,n,[]),b1(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==bN?e:void 0}function fb(e,t,n){if(_0(t))return t;const r=t[Ho];if(!r)return db(t,(o,i)=>yk(e,r,t,o,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return hb(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),db(i,(a,l)=>yk(e,r,o,a,l,n,s)),hb(e,o,!1),n&&e.patches_&&xc("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function yk(e,t,n,r,o,i,s){if(process.env.NODE_ENV!=="production"&&o===n&&bo(5),sd(o)){const a=i&&t&&t.type_!==3&&!g1(t.assigned_,r)?i.concat(r):void 0,l=fb(e,o,a);if(vN(n,r,l),sd(l))e.canAutoFreeze_=!1;else return}else s&&n.add(o);if(vc(o)&&!_0(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;fb(e,o),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&Object.prototype.propertyIsEnumerable.call(n,r)&&hb(e,o)}}function hb(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&q_(t,n)}function YK(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:xN(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Y_;n&&(o=[r],i=Eh);const{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,a}var Y_={get(e,t){if(t===Ho)return e;const n=Ol(e);if(!g1(n,t))return KK(e,n,t);const r=n[t];return e.finalized_||!vc(r)?r:r===mx(e.base_,t)?(bx(e),e.copy_[t]=x1(r,e)):r},has(e,t){return t in Ol(e)},ownKeys(e){return Reflect.ownKeys(Ol(e))},set(e,t,n){const r=wN(Ol(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const o=mx(Ol(e),t),i=o==null?void 0:o[Ho];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(VK(n,o)&&(n!==void 0||g1(e.base_,t)))return!0;bx(e),v1(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 mx(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,bx(e),v1(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Ol(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){bo(11)},getPrototypeOf(e){return id(e.base_)},setPrototypeOf(){bo(12)}},Eh={};db(Y_,(e,t)=>{Eh[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Eh.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&bo(13),Eh.set.call(this,e,t,void 0)};Eh.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&bo(14),Y_.set.call(this,e[0],t,n,e[0])};function mx(e,t){const n=e[Ho];return(n?Ol(n):e)[t]}function KK(e,t,n){var o;const r=wN(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function wN(e,t){if(!(t in e))return;let n=id(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=id(n)}}function v1(e){e.modified_||(e.modified_=!0,e.parent_&&v1(e.parent_))}function bx(e){e.copy_||(e.copy_=m1(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var XK=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"&&bo(6),r!==void 0&&typeof r!="function"&&bo(7);let o;if(vc(t)){const i=mk(this),s=x1(t,void 0);let a=!0;try{o=n(s),a=!1}finally{a?b1(i):y1(i)}return gk(i,r),bk(o,i)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===bN&&(o=void 0),this.autoFreeze_&&q_(o,!0),r){const i=[],s=[];xc("Patches").generateReplacementPatches_(t,o,i,s),r(i,s)}return o}else bo(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){vc(e)||bo(8),sd(e)&&(e=QK(e));const t=mk(this),n=x1(e,void 0);return n[Ho].isManual_=!0,y1(t),n}finishDraft(e,t){const n=e&&e[Ho];(!n||!n.isManual_)&&bo(9);const{scope_:r}=n;return gk(r,t),bk(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=xc("Patches").applyPatches_;return sd(e)?r(e,t):this.produce(e,o=>r(o,t))}};function x1(e,t){const n=w0(e)?xc("MapSet").proxyMap_(e,t):S0(e)?xc("MapSet").proxySet_(e,t):YK(e,t);return(t?t.scope_:xN()).drafts_.push(n),n}function QK(e){return sd(e)||bo(10,e),SN(e)}function SN(e){if(!vc(e)||_0(e))return e;const t=e[Ho];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=m1(e,t.scope_.immer_.useStrictShallowCopy_)}else n=m1(e,!0);return db(n,(r,o)=>{vN(n,r,SN(o))}),t&&(t.finalized_=!1),n}var Vo=new XK,ZK=Vo.produce;Vo.produceWithPatches.bind(Vo);Vo.setAutoFreeze.bind(Vo);Vo.setUseStrictShallowCopy.bind(Vo);Vo.applyPatches.bind(Vo);Vo.createDraft.bind(Vo);Vo.finishDraft.bind(Vo);const JK=e=>(t,n,r)=>(r.setState=(o,i,...s)=>{const a=typeof o=="function"?ZK(o):o;return t(a,i,...s)},e(r.setState,n,r)),_N=JK;var w1,jg=Ar;if(process.env.NODE_ENV==="production")w1=jg.createRoot,jg.hydrateRoot;else{var vk=jg.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;w1=function(e,t){vk.usingClientEntryPoint=!0;try{return jg.createRoot(e,t)}finally{vk.usingClientEntryPoint=!1}}}var CN={},EN={},K_={exports:{}},mt=String,RN=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}};K_.exports=RN();K_.exports.createColors=RN;var eX=K_.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(eX);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])}}})(EN);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const t=n(EN);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}}})(CN);let yx=CN;var tX=(yx.__esModule?yx:{default:yx}).default;const $t=nl(tX),X_=`import pandas as pd
|
|
63
|
+
df = pd.DataFrame(data) # 'data' contains the query result
|
|
64
|
+
result = df.to_dict('records') # must return 'result' as [dict] type
|
|
65
|
+
`,Q_="dm",S1=[{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"}],nX=[{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)"}]}],Z_=["lg","md","sm","xs","xxs"],pb={default:{dashboardPanel:"",dashboardTabsContainer:"",gridLayout:{className:""},chart:{font:{family:"Open Sans, Arial, sans-serif"},dataset:{backgroundColor:[$t.blue[500],$t.teal[500],$t.amber[500],$t.red[500],$t.indigo[500],$t.green[500]],borderColor:[$t.blue[500],$t.teal[500],$t.amber[500],$t.red[500],$t.indigo[500],$t.green[500]]},options:{interaction:{mode:"index"},plugins:{datalabels:{display:!1,color:_1},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:[$t.blue[500],$t.teal[500],$t.amber[500],$t.red[500],$t.indigo[500],$t.green[500]],borderColor:[$t.blue[500],$t.teal[500],$t.amber[500],$t.red[500],$t.indigo[500],$t.green[500]],datalables:{color:_1}},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:$t.slate[800]}},y:{grid:{display:!0,color:$t.slate[800]}}}}}}};function _1(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=Rh()),(t==null?void 0:t.align)==="start"&&(t==null?void 0:t.anchor)==="start"&&(n=Rh()),ad(n)}function Rh(){return ye.getState().theme==="dark"?"#000000":"#FFFFFF"}function ad(e){let t=0,n=0,r=0,o=0;const i=u=>{if(!u)return $t.gray[500];const d=u.replace("#",""),p=parseInt(d.substring(0,2),16),h=parseInt(d.substring(2,4),16),m=parseInt(d.substring(4,6),16);t+=p,n+=h,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 rX=["text","enum","varchar","nvarchar","nvarchar2","char","character","longtext","nchar","char varying","nchar varying","character varying","string"],oX=["number","integer","int","int64","bigint","smallint","tinyint","byteint","numeric","decimal","dec","double","real","double precision","float","float4","float8","float64"],iX=["date","datetime","time","timestamp","timestamp without time zone","timestamp_ns"],sX=["boolean"];function J_(e){return e.match(/[A-Z]/)?`"${e}"`:e}function C0(e){return rX.includes(e.toLowerCase())||/varchar/i.test(e)}function up(e){return oX.includes(e.toLowerCase())||/int|decimal|float|double/i.test(e)}function Ad(e){return iX.includes(e.toLowerCase())||/date|time|timestamp/i.test(e)}function eC(e){return sX.includes(e.toLowerCase())||/boolean/i.test(e)}function aX(e,t,n,r,o){const{measures:i,dimensions:s}=e,a=i==null?void 0:i.map(d=>`${d.calc}(${d.name}) as ${d.calc}_${d.name.replace(/"/g,"")}`).join(", "),l=(s==null?void 0:s.join(", "))||"";let c="";const u=r?`${Q_}.${r}`:tC(t,n,o);if(a&&l)return c=`SELECT ${l}, COUNT(*) as count, ${a} FROM ${u} GROUP BY ${l} ORDER BY ${l} DESC LIMIT 100`,c;if(!a&&l)return c=`SELECT ${l}, COUNT(*) as count FROM ${u} GROUP BY ${l} ORDER BY ${l} DESC LIMIT 100`,c;if(a&&!l)return c=`SELECT ${a} FROM ${u} LIMIT 100`,c}function lX(e,t,n="AVG"){var i,s,a,l;let r={};const o=J_(e.column_name);return C0(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]}),up(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 Ou(e){return C0(e.dataType)?"string":up(e.dataType)?"number":Ad(e.dataType)?"date":eC(e.dataType)?"boolean":"string"}function cX(e){let t;const n=e.data_type.toLowerCase();return C0(n)?t="T":up(n)?t="#":Ad(n)?t="D":eC(n)?t="B":t="?",t}function uX(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 PN({schemaName:e,tableName:t,modelName:n,connectionType:r}){let o=tC(e,t,r);n&&(o=`${Q_}.${n}`);let i=o;return(a=>/[A-Z]/.test(a))(t)&&(i=i.split(".").map(l=>`"${l}"`).join(".")),i}function tC(e,t,n){return t==="api"||e===J_("NA")||n==="S3"||n==="API"?t:e?`${e}.${t}`:`${t}`}const dX=e=>{const t=new Date(e);return!isNaN(t.getTime())},fX=e=>!isNaN(Number(e))&&!isNaN(parseFloat(e)),E0=e=>{let t;return typeof e=="number"?t="number":typeof e=="string"?dX(e)?t="date":fX(e)?t="number":t="string":typeof e=="boolean"?t="boolean":e instanceof Date?t="date":t="unknown",t};function hX({get:e,dataPoint:t,card:n}){var p;const{addOrUpdateFilterValue:r,addFilteringCard:o,removeFilterValues: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:(p=n.preferences)==null?void 0:p.filterOnClickField,valueType:E0(u),operation:"=",values:[u]};if(l!=null&&l.find(h=>h.id===n.id)){const h=n.id;if(u==null){a(n),i(h);return}else s(d)}o(n),r(d)}var gb={exports:{}};/**
|
|
66
|
+
* @license
|
|
67
|
+
* Lodash <https://lodash.com/>
|
|
68
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
69
|
+
* Released under MIT license <https://lodash.com/license>
|
|
70
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
71
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
72
|
+
*/gb.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,p=2,h=4,m=1,b=2,v=1,x=2,w=4,_=8,R=16,C=32,E=64,A=128,M=256,D=512,L=30,j="...",z=800,Q=16,G=1,F=2,H=3,$=1/0,V=9007199254740991,X=17976931348623157e292,I=NaN,q=4294967295,U=q-1,O=q>>>1,ee=[["ary",A],["bind",v],["bindKey",x],["curry",_],["curryRight",R],["flip",D],["partial",C],["partialRight",E],["rearg",M]],K="[object Arguments]",oe="[object Array]",Y="[object AsyncFunction]",J="[object Boolean]",ie="[object Date]",de="[object DOMException]",he="[object Error]",ae="[object Function]",ge="[object GeneratorFunction]",ue="[object Map]",Ee="[object Number]",Te="[object Null]",Le="[object Object]",Ae="[object Promise]",Fe="[object Proxy]",tt="[object RegExp]",at="[object Set]",cn="[object String]",St="[object Symbol]",Vn="[object Undefined]",Rt="[object WeakMap]",fe="[object WeakSet]",_e="[object ArrayBuffer]",He="[object DataView]",We="[object Float32Array]",rt="[object Float64Array]",An="[object Int8Array]",Fn="[object Int16Array]",Rn="[object Int32Array]",sn="[object Uint8Array]",jn="[object Uint8ClampedArray]",Xt="[object Uint16Array]",or="[object Uint32Array]",Xn=/\b__p \+= '';/g,Yo=/\b(__p \+=) '' \+/g,xr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ji=/&(?:amp|lt|gt|quot|#39);/g,wr=/[&<>"']/g,Lr=RegExp(ji.source),fl=RegExp(wr.source),$e=/<%-([\s\S]+?)%>/g,_t=/<%([\s\S]+?)%>/g,Ut=/<%=([\s\S]+?)%>/g,Qn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zn=/^\w*$/,Fr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fr=/[\\^$.*+?()[\]{}|]/g,ir=RegExp(fr.source),bn=/^\s+/,la=/\s/,Uc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Gc=/\{\n\/\* \[wrapped with (.+)\] \*/,te=/,? & /,Re=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Me=/[()=,{}\[\]\/\s]/,Ue=/\\(\\)?/g,Nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ht=/\w*$/,Ct=/^[-+]0x[0-9a-f]+$/i,yt=/^0b[01]+$/i,Ne=/^\[object .+?Constructor\]$/,ne=/^0o[0-7]+$/i,Se=/^(?:0|[1-9]\d*)$/,Ie=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,It=/($^)/,fn=/['\n\r\u2028\u2029\\]/g,kt="\\ud800-\\udfff",Wn="\\u0300-\\u036f",eo="\\ufe20-\\ufe2f",Cs="\\u20d0-\\u20ff",sr=Wn+eo+Cs,Yd="\\u2700-\\u27bf",Kd="a-z\\xdf-\\xf6\\xf8-\\xff",$B="\\xac\\xb1\\xd7\\xf7",zB="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",BB="\\u2000-\\u206f",HB=" \\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",D2="A-Z\\xc0-\\xd6\\xd8-\\xde",N2="\\ufe0e\\ufe0f",L2=$B+zB+BB+HB,ev="['’]",VB="["+kt+"]",F2="["+L2+"]",Xp="["+sr+"]",j2="\\d+",WB="["+Yd+"]",$2="["+Kd+"]",z2="[^"+kt+L2+j2+Yd+Kd+D2+"]",tv="\\ud83c[\\udffb-\\udfff]",UB="(?:"+Xp+"|"+tv+")",B2="[^"+kt+"]",nv="(?:\\ud83c[\\udde6-\\uddff]){2}",rv="[\\ud800-\\udbff][\\udc00-\\udfff]",qc="["+D2+"]",H2="\\u200d",V2="(?:"+$2+"|"+z2+")",GB="(?:"+qc+"|"+z2+")",W2="(?:"+ev+"(?:d|ll|m|re|s|t|ve))?",U2="(?:"+ev+"(?:D|LL|M|RE|S|T|VE))?",G2=UB+"?",q2="["+N2+"]?",qB="(?:"+H2+"(?:"+[B2,nv,rv].join("|")+")"+q2+G2+")*",YB="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",KB="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Y2=q2+G2+qB,XB="(?:"+[WB,nv,rv].join("|")+")"+Y2,QB="(?:"+[B2+Xp+"?",Xp,nv,rv,VB].join("|")+")",ZB=RegExp(ev,"g"),JB=RegExp(Xp,"g"),ov=RegExp(tv+"(?="+tv+")|"+QB+Y2,"g"),eH=RegExp([qc+"?"+$2+"+"+W2+"(?="+[F2,qc,"$"].join("|")+")",GB+"+"+U2+"(?="+[F2,qc+V2,"$"].join("|")+")",qc+"?"+V2+"+"+W2,qc+"+"+U2,KB,YB,j2,XB].join("|"),"g"),tH=RegExp("["+H2+kt+sr+N2+"]"),nH=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rH=["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"],oH=-1,yn={};yn[We]=yn[rt]=yn[An]=yn[Fn]=yn[Rn]=yn[sn]=yn[jn]=yn[Xt]=yn[or]=!0,yn[K]=yn[oe]=yn[_e]=yn[J]=yn[He]=yn[ie]=yn[he]=yn[ae]=yn[ue]=yn[Ee]=yn[Le]=yn[tt]=yn[at]=yn[cn]=yn[Rt]=!1;var hn={};hn[K]=hn[oe]=hn[_e]=hn[He]=hn[J]=hn[ie]=hn[We]=hn[rt]=hn[An]=hn[Fn]=hn[Rn]=hn[ue]=hn[Ee]=hn[Le]=hn[tt]=hn[at]=hn[cn]=hn[St]=hn[sn]=hn[jn]=hn[Xt]=hn[or]=!0,hn[he]=hn[ae]=hn[Rt]=!1;var iH={À:"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"},sH={"&":"&","<":"<",">":">",'"':""","'":"'"},aH={"&":"&","<":"<",">":">",""":'"',"'":"'"},lH={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},cH=parseFloat,uH=parseInt,K2=typeof Qi=="object"&&Qi&&Qi.Object===Object&&Qi,dH=typeof self=="object"&&self&&self.Object===Object&&self,hr=K2||dH||Function("return this")(),iv=t&&!t.nodeType&&t,hl=iv&&!0&&e&&!e.nodeType&&e,X2=hl&&hl.exports===iv,sv=X2&&K2.process,Ko=function(){try{var le=hl&&hl.require&&hl.require("util").types;return le||sv&&sv.binding&&sv.binding("util")}catch{}}(),Q2=Ko&&Ko.isArrayBuffer,Z2=Ko&&Ko.isDate,J2=Ko&&Ko.isMap,eP=Ko&&Ko.isRegExp,tP=Ko&&Ko.isSet,nP=Ko&&Ko.isTypedArray;function Ro(le,be,pe){switch(pe.length){case 0:return le.call(be);case 1:return le.call(be,pe[0]);case 2:return le.call(be,pe[0],pe[1]);case 3:return le.call(be,pe[0],pe[1],pe[2])}return le.apply(be,pe)}function fH(le,be,pe,ze){for(var ct=-1,Gt=le==null?0:le.length;++ct<Gt;){var Jn=le[ct];be(ze,Jn,pe(Jn),le)}return ze}function Xo(le,be){for(var pe=-1,ze=le==null?0:le.length;++pe<ze&&be(le[pe],pe,le)!==!1;);return le}function hH(le,be){for(var pe=le==null?0:le.length;pe--&&be(le[pe],pe,le)!==!1;);return le}function rP(le,be){for(var pe=-1,ze=le==null?0:le.length;++pe<ze;)if(!be(le[pe],pe,le))return!1;return!0}function ca(le,be){for(var pe=-1,ze=le==null?0:le.length,ct=0,Gt=[];++pe<ze;){var Jn=le[pe];be(Jn,pe,le)&&(Gt[ct++]=Jn)}return Gt}function Qp(le,be){var pe=le==null?0:le.length;return!!pe&&Yc(le,be,0)>-1}function av(le,be,pe){for(var ze=-1,ct=le==null?0:le.length;++ze<ct;)if(pe(be,le[ze]))return!0;return!1}function Pn(le,be){for(var pe=-1,ze=le==null?0:le.length,ct=Array(ze);++pe<ze;)ct[pe]=be(le[pe],pe,le);return ct}function ua(le,be){for(var pe=-1,ze=be.length,ct=le.length;++pe<ze;)le[ct+pe]=be[pe];return le}function lv(le,be,pe,ze){var ct=-1,Gt=le==null?0:le.length;for(ze&&Gt&&(pe=le[++ct]);++ct<Gt;)pe=be(pe,le[ct],ct,le);return pe}function pH(le,be,pe,ze){var ct=le==null?0:le.length;for(ze&&ct&&(pe=le[--ct]);ct--;)pe=be(pe,le[ct],ct,le);return pe}function cv(le,be){for(var pe=-1,ze=le==null?0:le.length;++pe<ze;)if(be(le[pe],pe,le))return!0;return!1}var gH=uv("length");function mH(le){return le.split("")}function bH(le){return le.match(Re)||[]}function oP(le,be,pe){var ze;return pe(le,function(ct,Gt,Jn){if(be(ct,Gt,Jn))return ze=Gt,!1}),ze}function Zp(le,be,pe,ze){for(var ct=le.length,Gt=pe+(ze?1:-1);ze?Gt--:++Gt<ct;)if(be(le[Gt],Gt,le))return Gt;return-1}function Yc(le,be,pe){return be===be?kH(le,be,pe):Zp(le,iP,pe)}function yH(le,be,pe,ze){for(var ct=pe-1,Gt=le.length;++ct<Gt;)if(ze(le[ct],be))return ct;return-1}function iP(le){return le!==le}function sP(le,be){var pe=le==null?0:le.length;return pe?fv(le,be)/pe:I}function uv(le){return function(be){return be==null?n:be[le]}}function dv(le){return function(be){return le==null?n:le[be]}}function aP(le,be,pe,ze,ct){return ct(le,function(Gt,Jn,un){pe=ze?(ze=!1,Gt):be(pe,Gt,Jn,un)}),pe}function vH(le,be){var pe=le.length;for(le.sort(be);pe--;)le[pe]=le[pe].value;return le}function fv(le,be){for(var pe,ze=-1,ct=le.length;++ze<ct;){var Gt=be(le[ze]);Gt!==n&&(pe=pe===n?Gt:pe+Gt)}return pe}function hv(le,be){for(var pe=-1,ze=Array(le);++pe<le;)ze[pe]=be(pe);return ze}function xH(le,be){return Pn(be,function(pe){return[pe,le[pe]]})}function lP(le){return le&&le.slice(0,fP(le)+1).replace(bn,"")}function Po(le){return function(be){return le(be)}}function pv(le,be){return Pn(be,function(pe){return le[pe]})}function Xd(le,be){return le.has(be)}function cP(le,be){for(var pe=-1,ze=le.length;++pe<ze&&Yc(be,le[pe],0)>-1;);return pe}function uP(le,be){for(var pe=le.length;pe--&&Yc(be,le[pe],0)>-1;);return pe}function wH(le,be){for(var pe=le.length,ze=0;pe--;)le[pe]===be&&++ze;return ze}var SH=dv(iH),_H=dv(sH);function CH(le){return"\\"+lH[le]}function EH(le,be){return le==null?n:le[be]}function Kc(le){return tH.test(le)}function RH(le){return nH.test(le)}function PH(le){for(var be,pe=[];!(be=le.next()).done;)pe.push(be.value);return pe}function gv(le){var be=-1,pe=Array(le.size);return le.forEach(function(ze,ct){pe[++be]=[ct,ze]}),pe}function dP(le,be){return function(pe){return le(be(pe))}}function da(le,be){for(var pe=-1,ze=le.length,ct=0,Gt=[];++pe<ze;){var Jn=le[pe];(Jn===be||Jn===u)&&(le[pe]=u,Gt[ct++]=pe)}return Gt}function Jp(le){var be=-1,pe=Array(le.size);return le.forEach(function(ze){pe[++be]=ze}),pe}function TH(le){var be=-1,pe=Array(le.size);return le.forEach(function(ze){pe[++be]=[ze,ze]}),pe}function kH(le,be,pe){for(var ze=pe-1,ct=le.length;++ze<ct;)if(le[ze]===be)return ze;return-1}function AH(le,be,pe){for(var ze=pe+1;ze--;)if(le[ze]===be)return ze;return ze}function Xc(le){return Kc(le)?MH(le):gH(le)}function mi(le){return Kc(le)?IH(le):mH(le)}function fP(le){for(var be=le.length;be--&&la.test(le.charAt(be)););return be}var OH=dv(aH);function MH(le){for(var be=ov.lastIndex=0;ov.test(le);)++be;return be}function IH(le){return le.match(ov)||[]}function DH(le){return le.match(eH)||[]}var NH=function le(be){be=be==null?hr:Qc.defaults(hr.Object(),be,Qc.pick(hr,rH));var pe=be.Array,ze=be.Date,ct=be.Error,Gt=be.Function,Jn=be.Math,un=be.Object,mv=be.RegExp,LH=be.String,Qo=be.TypeError,eg=pe.prototype,FH=Gt.prototype,Zc=un.prototype,tg=be["__core-js_shared__"],ng=FH.toString,nn=Zc.hasOwnProperty,jH=0,hP=function(){var f=/[^.]+$/.exec(tg&&tg.keys&&tg.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""}(),rg=Zc.toString,$H=ng.call(un),zH=hr._,BH=mv("^"+ng.call(nn).replace(fr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),og=X2?be.Buffer:n,fa=be.Symbol,ig=be.Uint8Array,pP=og?og.allocUnsafe:n,sg=dP(un.getPrototypeOf,un),gP=un.create,mP=Zc.propertyIsEnumerable,ag=eg.splice,bP=fa?fa.isConcatSpreadable:n,Qd=fa?fa.iterator:n,pl=fa?fa.toStringTag:n,lg=function(){try{var f=vl(un,"defineProperty");return f({},"",{}),f}catch{}}(),HH=be.clearTimeout!==hr.clearTimeout&&be.clearTimeout,VH=ze&&ze.now!==hr.Date.now&&ze.now,WH=be.setTimeout!==hr.setTimeout&&be.setTimeout,cg=Jn.ceil,ug=Jn.floor,bv=un.getOwnPropertySymbols,UH=og?og.isBuffer:n,yP=be.isFinite,GH=eg.join,qH=dP(un.keys,un),er=Jn.max,Sr=Jn.min,YH=ze.now,KH=be.parseInt,vP=Jn.random,XH=eg.reverse,yv=vl(be,"DataView"),Zd=vl(be,"Map"),vv=vl(be,"Promise"),Jc=vl(be,"Set"),Jd=vl(be,"WeakMap"),ef=vl(un,"create"),dg=Jd&&new Jd,eu={},QH=xl(yv),ZH=xl(Zd),JH=xl(vv),eV=xl(Jc),tV=xl(Jd),fg=fa?fa.prototype:n,tf=fg?fg.valueOf:n,xP=fg?fg.toString:n;function B(f){if(On(f)&&!ut(f)&&!(f instanceof Dt)){if(f instanceof Zo)return f;if(nn.call(f,"__wrapped__"))return wT(f)}return new Zo(f)}var tu=function(){function f(){}return function(g){if(!Tn(g))return{};if(gP)return gP(g);f.prototype=g;var S=new f;return f.prototype=n,S}}();function hg(){}function Zo(f,g){this.__wrapped__=f,this.__actions__=[],this.__chain__=!!g,this.__index__=0,this.__values__=n}B.templateSettings={escape:$e,evaluate:_t,interpolate:Ut,variable:"",imports:{_:B}},B.prototype=hg.prototype,B.prototype.constructor=B,Zo.prototype=tu(hg.prototype),Zo.prototype.constructor=Zo;function Dt(f){this.__wrapped__=f,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=q,this.__views__=[]}function nV(){var f=new Dt(this.__wrapped__);return f.__actions__=to(this.__actions__),f.__dir__=this.__dir__,f.__filtered__=this.__filtered__,f.__iteratees__=to(this.__iteratees__),f.__takeCount__=this.__takeCount__,f.__views__=to(this.__views__),f}function rV(){if(this.__filtered__){var f=new Dt(this);f.__dir__=-1,f.__filtered__=!0}else f=this.clone(),f.__dir__*=-1;return f}function oV(){var f=this.__wrapped__.value(),g=this.__dir__,S=ut(f),k=g<0,N=S?f.length:0,W=mW(0,N,this.__views__),Z=W.start,re=W.end,ce=re-Z,ve=k?re:Z-1,we=this.__iteratees__,Ce=we.length,De=0,Ve=Sr(ce,this.__takeCount__);if(!S||!k&&N==ce&&Ve==ce)return WP(f,this.__actions__);var qe=[];e:for(;ce--&&De<Ve;){ve+=g;for(var vt=-1,Ye=f[ve];++vt<Ce;){var At=we[vt],Lt=At.iteratee,Ao=At.type,zr=Lt(Ye);if(Ao==F)Ye=zr;else if(!zr){if(Ao==G)continue e;break e}}qe[De++]=Ye}return qe}Dt.prototype=tu(hg.prototype),Dt.prototype.constructor=Dt;function gl(f){var g=-1,S=f==null?0:f.length;for(this.clear();++g<S;){var k=f[g];this.set(k[0],k[1])}}function iV(){this.__data__=ef?ef(null):{},this.size=0}function sV(f){var g=this.has(f)&&delete this.__data__[f];return this.size-=g?1:0,g}function aV(f){var g=this.__data__;if(ef){var S=g[f];return S===l?n:S}return nn.call(g,f)?g[f]:n}function lV(f){var g=this.__data__;return ef?g[f]!==n:nn.call(g,f)}function cV(f,g){var S=this.__data__;return this.size+=this.has(f)?0:1,S[f]=ef&&g===n?l:g,this}gl.prototype.clear=iV,gl.prototype.delete=sV,gl.prototype.get=aV,gl.prototype.has=lV,gl.prototype.set=cV;function Es(f){var g=-1,S=f==null?0:f.length;for(this.clear();++g<S;){var k=f[g];this.set(k[0],k[1])}}function uV(){this.__data__=[],this.size=0}function dV(f){var g=this.__data__,S=pg(g,f);if(S<0)return!1;var k=g.length-1;return S==k?g.pop():ag.call(g,S,1),--this.size,!0}function fV(f){var g=this.__data__,S=pg(g,f);return S<0?n:g[S][1]}function hV(f){return pg(this.__data__,f)>-1}function pV(f,g){var S=this.__data__,k=pg(S,f);return k<0?(++this.size,S.push([f,g])):S[k][1]=g,this}Es.prototype.clear=uV,Es.prototype.delete=dV,Es.prototype.get=fV,Es.prototype.has=hV,Es.prototype.set=pV;function Rs(f){var g=-1,S=f==null?0:f.length;for(this.clear();++g<S;){var k=f[g];this.set(k[0],k[1])}}function gV(){this.size=0,this.__data__={hash:new gl,map:new(Zd||Es),string:new gl}}function mV(f){var g=Rg(this,f).delete(f);return this.size-=g?1:0,g}function bV(f){return Rg(this,f).get(f)}function yV(f){return Rg(this,f).has(f)}function vV(f,g){var S=Rg(this,f),k=S.size;return S.set(f,g),this.size+=S.size==k?0:1,this}Rs.prototype.clear=gV,Rs.prototype.delete=mV,Rs.prototype.get=bV,Rs.prototype.has=yV,Rs.prototype.set=vV;function ml(f){var g=-1,S=f==null?0:f.length;for(this.__data__=new Rs;++g<S;)this.add(f[g])}function xV(f){return this.__data__.set(f,l),this}function wV(f){return this.__data__.has(f)}ml.prototype.add=ml.prototype.push=xV,ml.prototype.has=wV;function bi(f){var g=this.__data__=new Es(f);this.size=g.size}function SV(){this.__data__=new Es,this.size=0}function _V(f){var g=this.__data__,S=g.delete(f);return this.size=g.size,S}function CV(f){return this.__data__.get(f)}function EV(f){return this.__data__.has(f)}function RV(f,g){var S=this.__data__;if(S instanceof Es){var k=S.__data__;if(!Zd||k.length<o-1)return k.push([f,g]),this.size=++S.size,this;S=this.__data__=new Rs(k)}return S.set(f,g),this.size=S.size,this}bi.prototype.clear=SV,bi.prototype.delete=_V,bi.prototype.get=CV,bi.prototype.has=EV,bi.prototype.set=RV;function wP(f,g){var S=ut(f),k=!S&&wl(f),N=!S&&!k&&ba(f),W=!S&&!k&&!N&&iu(f),Z=S||k||N||W,re=Z?hv(f.length,LH):[],ce=re.length;for(var ve in f)(g||nn.call(f,ve))&&!(Z&&(ve=="length"||N&&(ve=="offset"||ve=="parent")||W&&(ve=="buffer"||ve=="byteLength"||ve=="byteOffset")||As(ve,ce)))&&re.push(ve);return re}function SP(f){var g=f.length;return g?f[Av(0,g-1)]:n}function PV(f,g){return Pg(to(f),bl(g,0,f.length))}function TV(f){return Pg(to(f))}function xv(f,g,S){(S!==n&&!yi(f[g],S)||S===n&&!(g in f))&&Ps(f,g,S)}function nf(f,g,S){var k=f[g];(!(nn.call(f,g)&&yi(k,S))||S===n&&!(g in f))&&Ps(f,g,S)}function pg(f,g){for(var S=f.length;S--;)if(yi(f[S][0],g))return S;return-1}function kV(f,g,S,k){return ha(f,function(N,W,Z){g(k,N,S(N),Z)}),k}function _P(f,g){return f&&zi(g,ar(g),f)}function AV(f,g){return f&&zi(g,ro(g),f)}function Ps(f,g,S){g=="__proto__"&&lg?lg(f,g,{configurable:!0,enumerable:!0,value:S,writable:!0}):f[g]=S}function wv(f,g){for(var S=-1,k=g.length,N=pe(k),W=f==null;++S<k;)N[S]=W?n:tx(f,g[S]);return N}function bl(f,g,S){return f===f&&(S!==n&&(f=f<=S?f:S),g!==n&&(f=f>=g?f:g)),f}function Jo(f,g,S,k,N,W){var Z,re=g&d,ce=g&p,ve=g&h;if(S&&(Z=N?S(f,k,N,W):S(f)),Z!==n)return Z;if(!Tn(f))return f;var we=ut(f);if(we){if(Z=yW(f),!re)return to(f,Z)}else{var Ce=_r(f),De=Ce==ae||Ce==ge;if(ba(f))return qP(f,re);if(Ce==Le||Ce==K||De&&!N){if(Z=ce||De?{}:fT(f),!re)return ce?aW(f,AV(Z,f)):sW(f,_P(Z,f))}else{if(!hn[Ce])return N?f:{};Z=vW(f,Ce,re)}}W||(W=new bi);var Ve=W.get(f);if(Ve)return Ve;W.set(f,Z),BT(f)?f.forEach(function(Ye){Z.add(Jo(Ye,g,S,Ye,f,W))}):$T(f)&&f.forEach(function(Ye,At){Z.set(At,Jo(Ye,g,S,At,f,W))});var qe=ve?ce?Bv:zv:ce?ro:ar,vt=we?n:qe(f);return Xo(vt||f,function(Ye,At){vt&&(At=Ye,Ye=f[At]),nf(Z,At,Jo(Ye,g,S,At,f,W))}),Z}function OV(f){var g=ar(f);return function(S){return CP(S,f,g)}}function CP(f,g,S){var k=S.length;if(f==null)return!k;for(f=un(f);k--;){var N=S[k],W=g[N],Z=f[N];if(Z===n&&!(N in f)||!W(Z))return!1}return!0}function EP(f,g,S){if(typeof f!="function")throw new Qo(s);return uf(function(){f.apply(n,S)},g)}function rf(f,g,S,k){var N=-1,W=Qp,Z=!0,re=f.length,ce=[],ve=g.length;if(!re)return ce;S&&(g=Pn(g,Po(S))),k?(W=av,Z=!1):g.length>=o&&(W=Xd,Z=!1,g=new ml(g));e:for(;++N<re;){var we=f[N],Ce=S==null?we:S(we);if(we=k||we!==0?we:0,Z&&Ce===Ce){for(var De=ve;De--;)if(g[De]===Ce)continue e;ce.push(we)}else W(g,Ce,k)||ce.push(we)}return ce}var ha=ZP($i),RP=ZP(_v,!0);function MV(f,g){var S=!0;return ha(f,function(k,N,W){return S=!!g(k,N,W),S}),S}function gg(f,g,S){for(var k=-1,N=f.length;++k<N;){var W=f[k],Z=g(W);if(Z!=null&&(re===n?Z===Z&&!ko(Z):S(Z,re)))var re=Z,ce=W}return ce}function IV(f,g,S,k){var N=f.length;for(S=pt(S),S<0&&(S=-S>N?0:N+S),k=k===n||k>N?N:pt(k),k<0&&(k+=N),k=S>k?0:VT(k);S<k;)f[S++]=g;return f}function PP(f,g){var S=[];return ha(f,function(k,N,W){g(k,N,W)&&S.push(k)}),S}function pr(f,g,S,k,N){var W=-1,Z=f.length;for(S||(S=wW),N||(N=[]);++W<Z;){var re=f[W];g>0&&S(re)?g>1?pr(re,g-1,S,k,N):ua(N,re):k||(N[N.length]=re)}return N}var Sv=JP(),TP=JP(!0);function $i(f,g){return f&&Sv(f,g,ar)}function _v(f,g){return f&&TP(f,g,ar)}function mg(f,g){return ca(g,function(S){return Os(f[S])})}function yl(f,g){g=ga(g,f);for(var S=0,k=g.length;f!=null&&S<k;)f=f[Bi(g[S++])];return S&&S==k?f:n}function kP(f,g,S){var k=g(f);return ut(f)?k:ua(k,S(f))}function jr(f){return f==null?f===n?Vn:Te:pl&&pl in un(f)?gW(f):TW(f)}function Cv(f,g){return f>g}function DV(f,g){return f!=null&&nn.call(f,g)}function NV(f,g){return f!=null&&g in un(f)}function LV(f,g,S){return f>=Sr(g,S)&&f<er(g,S)}function Ev(f,g,S){for(var k=S?av:Qp,N=f[0].length,W=f.length,Z=W,re=pe(W),ce=1/0,ve=[];Z--;){var we=f[Z];Z&&g&&(we=Pn(we,Po(g))),ce=Sr(we.length,ce),re[Z]=!S&&(g||N>=120&&we.length>=120)?new ml(Z&&we):n}we=f[0];var Ce=-1,De=re[0];e:for(;++Ce<N&&ve.length<ce;){var Ve=we[Ce],qe=g?g(Ve):Ve;if(Ve=S||Ve!==0?Ve:0,!(De?Xd(De,qe):k(ve,qe,S))){for(Z=W;--Z;){var vt=re[Z];if(!(vt?Xd(vt,qe):k(f[Z],qe,S)))continue e}De&&De.push(qe),ve.push(Ve)}}return ve}function FV(f,g,S,k){return $i(f,function(N,W,Z){g(k,S(N),W,Z)}),k}function of(f,g,S){g=ga(g,f),f=mT(f,g);var k=f==null?f:f[Bi(ti(g))];return k==null?n:Ro(k,f,S)}function AP(f){return On(f)&&jr(f)==K}function jV(f){return On(f)&&jr(f)==_e}function $V(f){return On(f)&&jr(f)==ie}function sf(f,g,S,k,N){return f===g?!0:f==null||g==null||!On(f)&&!On(g)?f!==f&&g!==g:zV(f,g,S,k,sf,N)}function zV(f,g,S,k,N,W){var Z=ut(f),re=ut(g),ce=Z?oe:_r(f),ve=re?oe:_r(g);ce=ce==K?Le:ce,ve=ve==K?Le:ve;var we=ce==Le,Ce=ve==Le,De=ce==ve;if(De&&ba(f)){if(!ba(g))return!1;Z=!0,we=!1}if(De&&!we)return W||(W=new bi),Z||iu(f)?cT(f,g,S,k,N,W):hW(f,g,ce,S,k,N,W);if(!(S&m)){var Ve=we&&nn.call(f,"__wrapped__"),qe=Ce&&nn.call(g,"__wrapped__");if(Ve||qe){var vt=Ve?f.value():f,Ye=qe?g.value():g;return W||(W=new bi),N(vt,Ye,S,k,W)}}return De?(W||(W=new bi),pW(f,g,S,k,N,W)):!1}function BV(f){return On(f)&&_r(f)==ue}function Rv(f,g,S,k){var N=S.length,W=N,Z=!k;if(f==null)return!W;for(f=un(f);N--;){var re=S[N];if(Z&&re[2]?re[1]!==f[re[0]]:!(re[0]in f))return!1}for(;++N<W;){re=S[N];var ce=re[0],ve=f[ce],we=re[1];if(Z&&re[2]){if(ve===n&&!(ce in f))return!1}else{var Ce=new bi;if(k)var De=k(ve,we,ce,f,g,Ce);if(!(De===n?sf(we,ve,m|b,k,Ce):De))return!1}}return!0}function OP(f){if(!Tn(f)||_W(f))return!1;var g=Os(f)?BH:Ne;return g.test(xl(f))}function HV(f){return On(f)&&jr(f)==tt}function VV(f){return On(f)&&_r(f)==at}function WV(f){return On(f)&&Ig(f.length)&&!!yn[jr(f)]}function MP(f){return typeof f=="function"?f:f==null?oo:typeof f=="object"?ut(f)?NP(f[0],f[1]):DP(f):ek(f)}function Pv(f){if(!cf(f))return qH(f);var g=[];for(var S in un(f))nn.call(f,S)&&S!="constructor"&&g.push(S);return g}function UV(f){if(!Tn(f))return PW(f);var g=cf(f),S=[];for(var k in f)k=="constructor"&&(g||!nn.call(f,k))||S.push(k);return S}function Tv(f,g){return f<g}function IP(f,g){var S=-1,k=no(f)?pe(f.length):[];return ha(f,function(N,W,Z){k[++S]=g(N,W,Z)}),k}function DP(f){var g=Vv(f);return g.length==1&&g[0][2]?pT(g[0][0],g[0][1]):function(S){return S===f||Rv(S,f,g)}}function NP(f,g){return Uv(f)&&hT(g)?pT(Bi(f),g):function(S){var k=tx(S,f);return k===n&&k===g?nx(S,f):sf(g,k,m|b)}}function bg(f,g,S,k,N){f!==g&&Sv(g,function(W,Z){if(N||(N=new bi),Tn(W))GV(f,g,Z,S,bg,k,N);else{var re=k?k(qv(f,Z),W,Z+"",f,g,N):n;re===n&&(re=W),xv(f,Z,re)}},ro)}function GV(f,g,S,k,N,W,Z){var re=qv(f,S),ce=qv(g,S),ve=Z.get(ce);if(ve){xv(f,S,ve);return}var we=W?W(re,ce,S+"",f,g,Z):n,Ce=we===n;if(Ce){var De=ut(ce),Ve=!De&&ba(ce),qe=!De&&!Ve&&iu(ce);we=ce,De||Ve||qe?ut(re)?we=re:$n(re)?we=to(re):Ve?(Ce=!1,we=qP(ce,!0)):qe?(Ce=!1,we=YP(ce,!0)):we=[]:df(ce)||wl(ce)?(we=re,wl(re)?we=WT(re):(!Tn(re)||Os(re))&&(we=fT(ce))):Ce=!1}Ce&&(Z.set(ce,we),N(we,ce,k,W,Z),Z.delete(ce)),xv(f,S,we)}function LP(f,g){var S=f.length;if(S)return g+=g<0?S:0,As(g,S)?f[g]:n}function FP(f,g,S){g.length?g=Pn(g,function(W){return ut(W)?function(Z){return yl(Z,W.length===1?W[0]:W)}:W}):g=[oo];var k=-1;g=Pn(g,Po(Ge()));var N=IP(f,function(W,Z,re){var ce=Pn(g,function(ve){return ve(W)});return{criteria:ce,index:++k,value:W}});return vH(N,function(W,Z){return iW(W,Z,S)})}function qV(f,g){return jP(f,g,function(S,k){return nx(f,k)})}function jP(f,g,S){for(var k=-1,N=g.length,W={};++k<N;){var Z=g[k],re=yl(f,Z);S(re,Z)&&af(W,ga(Z,f),re)}return W}function YV(f){return function(g){return yl(g,f)}}function kv(f,g,S,k){var N=k?yH:Yc,W=-1,Z=g.length,re=f;for(f===g&&(g=to(g)),S&&(re=Pn(f,Po(S)));++W<Z;)for(var ce=0,ve=g[W],we=S?S(ve):ve;(ce=N(re,we,ce,k))>-1;)re!==f&&ag.call(re,ce,1),ag.call(f,ce,1);return f}function $P(f,g){for(var S=f?g.length:0,k=S-1;S--;){var N=g[S];if(S==k||N!==W){var W=N;As(N)?ag.call(f,N,1):Iv(f,N)}}return f}function Av(f,g){return f+ug(vP()*(g-f+1))}function KV(f,g,S,k){for(var N=-1,W=er(cg((g-f)/(S||1)),0),Z=pe(W);W--;)Z[k?W:++N]=f,f+=S;return Z}function Ov(f,g){var S="";if(!f||g<1||g>V)return S;do g%2&&(S+=f),g=ug(g/2),g&&(f+=f);while(g);return S}function Et(f,g){return Yv(gT(f,g,oo),f+"")}function XV(f){return SP(su(f))}function QV(f,g){var S=su(f);return Pg(S,bl(g,0,S.length))}function af(f,g,S,k){if(!Tn(f))return f;g=ga(g,f);for(var N=-1,W=g.length,Z=W-1,re=f;re!=null&&++N<W;){var ce=Bi(g[N]),ve=S;if(ce==="__proto__"||ce==="constructor"||ce==="prototype")return f;if(N!=Z){var we=re[ce];ve=k?k(we,ce,re):n,ve===n&&(ve=Tn(we)?we:As(g[N+1])?[]:{})}nf(re,ce,ve),re=re[ce]}return f}var zP=dg?function(f,g){return dg.set(f,g),f}:oo,ZV=lg?function(f,g){return lg(f,"toString",{configurable:!0,enumerable:!1,value:ox(g),writable:!0})}:oo;function JV(f){return Pg(su(f))}function ei(f,g,S){var k=-1,N=f.length;g<0&&(g=-g>N?0:N+g),S=S>N?N:S,S<0&&(S+=N),N=g>S?0:S-g>>>0,g>>>=0;for(var W=pe(N);++k<N;)W[k]=f[k+g];return W}function eW(f,g){var S;return ha(f,function(k,N,W){return S=g(k,N,W),!S}),!!S}function yg(f,g,S){var k=0,N=f==null?k:f.length;if(typeof g=="number"&&g===g&&N<=O){for(;k<N;){var W=k+N>>>1,Z=f[W];Z!==null&&!ko(Z)&&(S?Z<=g:Z<g)?k=W+1:N=W}return N}return Mv(f,g,oo,S)}function Mv(f,g,S,k){var N=0,W=f==null?0:f.length;if(W===0)return 0;g=S(g);for(var Z=g!==g,re=g===null,ce=ko(g),ve=g===n;N<W;){var we=ug((N+W)/2),Ce=S(f[we]),De=Ce!==n,Ve=Ce===null,qe=Ce===Ce,vt=ko(Ce);if(Z)var Ye=k||qe;else ve?Ye=qe&&(k||De):re?Ye=qe&&De&&(k||!Ve):ce?Ye=qe&&De&&!Ve&&(k||!vt):Ve||vt?Ye=!1:Ye=k?Ce<=g:Ce<g;Ye?N=we+1:W=we}return Sr(W,U)}function BP(f,g){for(var S=-1,k=f.length,N=0,W=[];++S<k;){var Z=f[S],re=g?g(Z):Z;if(!S||!yi(re,ce)){var ce=re;W[N++]=Z===0?0:Z}}return W}function HP(f){return typeof f=="number"?f:ko(f)?I:+f}function To(f){if(typeof f=="string")return f;if(ut(f))return Pn(f,To)+"";if(ko(f))return xP?xP.call(f):"";var g=f+"";return g=="0"&&1/f==-1/0?"-0":g}function pa(f,g,S){var k=-1,N=Qp,W=f.length,Z=!0,re=[],ce=re;if(S)Z=!1,N=av;else if(W>=o){var ve=g?null:dW(f);if(ve)return Jp(ve);Z=!1,N=Xd,ce=new ml}else ce=g?[]:re;e:for(;++k<W;){var we=f[k],Ce=g?g(we):we;if(we=S||we!==0?we:0,Z&&Ce===Ce){for(var De=ce.length;De--;)if(ce[De]===Ce)continue e;g&&ce.push(Ce),re.push(we)}else N(ce,Ce,S)||(ce!==re&&ce.push(Ce),re.push(we))}return re}function Iv(f,g){return g=ga(g,f),f=mT(f,g),f==null||delete f[Bi(ti(g))]}function VP(f,g,S,k){return af(f,g,S(yl(f,g)),k)}function vg(f,g,S,k){for(var N=f.length,W=k?N:-1;(k?W--:++W<N)&&g(f[W],W,f););return S?ei(f,k?0:W,k?W+1:N):ei(f,k?W+1:0,k?N:W)}function WP(f,g){var S=f;return S instanceof Dt&&(S=S.value()),lv(g,function(k,N){return N.func.apply(N.thisArg,ua([k],N.args))},S)}function Dv(f,g,S){var k=f.length;if(k<2)return k?pa(f[0]):[];for(var N=-1,W=pe(k);++N<k;)for(var Z=f[N],re=-1;++re<k;)re!=N&&(W[N]=rf(W[N]||Z,f[re],g,S));return pa(pr(W,1),g,S)}function UP(f,g,S){for(var k=-1,N=f.length,W=g.length,Z={};++k<N;){var re=k<W?g[k]:n;S(Z,f[k],re)}return Z}function Nv(f){return $n(f)?f:[]}function Lv(f){return typeof f=="function"?f:oo}function ga(f,g){return ut(f)?f:Uv(f,g)?[f]:xT(Qt(f))}var tW=Et;function ma(f,g,S){var k=f.length;return S=S===n?k:S,!g&&S>=k?f:ei(f,g,S)}var GP=HH||function(f){return hr.clearTimeout(f)};function qP(f,g){if(g)return f.slice();var S=f.length,k=pP?pP(S):new f.constructor(S);return f.copy(k),k}function Fv(f){var g=new f.constructor(f.byteLength);return new ig(g).set(new ig(f)),g}function nW(f,g){var S=g?Fv(f.buffer):f.buffer;return new f.constructor(S,f.byteOffset,f.byteLength)}function rW(f){var g=new f.constructor(f.source,Ht.exec(f));return g.lastIndex=f.lastIndex,g}function oW(f){return tf?un(tf.call(f)):{}}function YP(f,g){var S=g?Fv(f.buffer):f.buffer;return new f.constructor(S,f.byteOffset,f.length)}function KP(f,g){if(f!==g){var S=f!==n,k=f===null,N=f===f,W=ko(f),Z=g!==n,re=g===null,ce=g===g,ve=ko(g);if(!re&&!ve&&!W&&f>g||W&&Z&&ce&&!re&&!ve||k&&Z&&ce||!S&&ce||!N)return 1;if(!k&&!W&&!ve&&f<g||ve&&S&&N&&!k&&!W||re&&S&&N||!Z&&N||!ce)return-1}return 0}function iW(f,g,S){for(var k=-1,N=f.criteria,W=g.criteria,Z=N.length,re=S.length;++k<Z;){var ce=KP(N[k],W[k]);if(ce){if(k>=re)return ce;var ve=S[k];return ce*(ve=="desc"?-1:1)}}return f.index-g.index}function XP(f,g,S,k){for(var N=-1,W=f.length,Z=S.length,re=-1,ce=g.length,ve=er(W-Z,0),we=pe(ce+ve),Ce=!k;++re<ce;)we[re]=g[re];for(;++N<Z;)(Ce||N<W)&&(we[S[N]]=f[N]);for(;ve--;)we[re++]=f[N++];return we}function QP(f,g,S,k){for(var N=-1,W=f.length,Z=-1,re=S.length,ce=-1,ve=g.length,we=er(W-re,0),Ce=pe(we+ve),De=!k;++N<we;)Ce[N]=f[N];for(var Ve=N;++ce<ve;)Ce[Ve+ce]=g[ce];for(;++Z<re;)(De||N<W)&&(Ce[Ve+S[Z]]=f[N++]);return Ce}function to(f,g){var S=-1,k=f.length;for(g||(g=pe(k));++S<k;)g[S]=f[S];return g}function zi(f,g,S,k){var N=!S;S||(S={});for(var W=-1,Z=g.length;++W<Z;){var re=g[W],ce=k?k(S[re],f[re],re,S,f):n;ce===n&&(ce=f[re]),N?Ps(S,re,ce):nf(S,re,ce)}return S}function sW(f,g){return zi(f,Wv(f),g)}function aW(f,g){return zi(f,uT(f),g)}function xg(f,g){return function(S,k){var N=ut(S)?fH:kV,W=g?g():{};return N(S,f,Ge(k,2),W)}}function nu(f){return Et(function(g,S){var k=-1,N=S.length,W=N>1?S[N-1]:n,Z=N>2?S[2]:n;for(W=f.length>3&&typeof W=="function"?(N--,W):n,Z&&$r(S[0],S[1],Z)&&(W=N<3?n:W,N=1),g=un(g);++k<N;){var re=S[k];re&&f(g,re,k,W)}return g})}function ZP(f,g){return function(S,k){if(S==null)return S;if(!no(S))return f(S,k);for(var N=S.length,W=g?N:-1,Z=un(S);(g?W--:++W<N)&&k(Z[W],W,Z)!==!1;);return S}}function JP(f){return function(g,S,k){for(var N=-1,W=un(g),Z=k(g),re=Z.length;re--;){var ce=Z[f?re:++N];if(S(W[ce],ce,W)===!1)break}return g}}function lW(f,g,S){var k=g&v,N=lf(f);function W(){var Z=this&&this!==hr&&this instanceof W?N:f;return Z.apply(k?S:this,arguments)}return W}function eT(f){return function(g){g=Qt(g);var S=Kc(g)?mi(g):n,k=S?S[0]:g.charAt(0),N=S?ma(S,1).join(""):g.slice(1);return k[f]()+N}}function ru(f){return function(g){return lv(ZT(QT(g).replace(ZB,"")),f,"")}}function lf(f){return function(){var g=arguments;switch(g.length){case 0:return new f;case 1:return new f(g[0]);case 2:return new f(g[0],g[1]);case 3:return new f(g[0],g[1],g[2]);case 4:return new f(g[0],g[1],g[2],g[3]);case 5:return new f(g[0],g[1],g[2],g[3],g[4]);case 6:return new f(g[0],g[1],g[2],g[3],g[4],g[5]);case 7:return new f(g[0],g[1],g[2],g[3],g[4],g[5],g[6])}var S=tu(f.prototype),k=f.apply(S,g);return Tn(k)?k:S}}function cW(f,g,S){var k=lf(f);function N(){for(var W=arguments.length,Z=pe(W),re=W,ce=ou(N);re--;)Z[re]=arguments[re];var ve=W<3&&Z[0]!==ce&&Z[W-1]!==ce?[]:da(Z,ce);if(W-=ve.length,W<S)return iT(f,g,wg,N.placeholder,n,Z,ve,n,n,S-W);var we=this&&this!==hr&&this instanceof N?k:f;return Ro(we,this,Z)}return N}function tT(f){return function(g,S,k){var N=un(g);if(!no(g)){var W=Ge(S,3);g=ar(g),S=function(re){return W(N[re],re,N)}}var Z=f(g,S,k);return Z>-1?N[W?g[Z]:Z]:n}}function nT(f){return ks(function(g){var S=g.length,k=S,N=Zo.prototype.thru;for(f&&g.reverse();k--;){var W=g[k];if(typeof W!="function")throw new Qo(s);if(N&&!Z&&Eg(W)=="wrapper")var Z=new Zo([],!0)}for(k=Z?k:S;++k<S;){W=g[k];var re=Eg(W),ce=re=="wrapper"?Hv(W):n;ce&&Gv(ce[0])&&ce[1]==(A|_|C|M)&&!ce[4].length&&ce[9]==1?Z=Z[Eg(ce[0])].apply(Z,ce[3]):Z=W.length==1&&Gv(W)?Z[re]():Z.thru(W)}return function(){var ve=arguments,we=ve[0];if(Z&&ve.length==1&&ut(we))return Z.plant(we).value();for(var Ce=0,De=S?g[Ce].apply(this,ve):we;++Ce<S;)De=g[Ce].call(this,De);return De}})}function wg(f,g,S,k,N,W,Z,re,ce,ve){var we=g&A,Ce=g&v,De=g&x,Ve=g&(_|R),qe=g&D,vt=De?n:lf(f);function Ye(){for(var At=arguments.length,Lt=pe(At),Ao=At;Ao--;)Lt[Ao]=arguments[Ao];if(Ve)var zr=ou(Ye),Oo=wH(Lt,zr);if(k&&(Lt=XP(Lt,k,N,Ve)),W&&(Lt=QP(Lt,W,Z,Ve)),At-=Oo,Ve&&At<ve){var zn=da(Lt,zr);return iT(f,g,wg,Ye.placeholder,S,Lt,zn,re,ce,ve-At)}var vi=Ce?S:this,Is=De?vi[f]:f;return At=Lt.length,re?Lt=kW(Lt,re):qe&&At>1&&Lt.reverse(),we&&ce<At&&(Lt.length=ce),this&&this!==hr&&this instanceof Ye&&(Is=vt||lf(Is)),Is.apply(vi,Lt)}return Ye}function rT(f,g){return function(S,k){return FV(S,f,g(k),{})}}function Sg(f,g){return function(S,k){var N;if(S===n&&k===n)return g;if(S!==n&&(N=S),k!==n){if(N===n)return k;typeof S=="string"||typeof k=="string"?(S=To(S),k=To(k)):(S=HP(S),k=HP(k)),N=f(S,k)}return N}}function jv(f){return ks(function(g){return g=Pn(g,Po(Ge())),Et(function(S){var k=this;return f(g,function(N){return Ro(N,k,S)})})})}function _g(f,g){g=g===n?" ":To(g);var S=g.length;if(S<2)return S?Ov(g,f):g;var k=Ov(g,cg(f/Xc(g)));return Kc(g)?ma(mi(k),0,f).join(""):k.slice(0,f)}function uW(f,g,S,k){var N=g&v,W=lf(f);function Z(){for(var re=-1,ce=arguments.length,ve=-1,we=k.length,Ce=pe(we+ce),De=this&&this!==hr&&this instanceof Z?W:f;++ve<we;)Ce[ve]=k[ve];for(;ce--;)Ce[ve++]=arguments[++re];return Ro(De,N?S:this,Ce)}return Z}function oT(f){return function(g,S,k){return k&&typeof k!="number"&&$r(g,S,k)&&(S=k=n),g=Ms(g),S===n?(S=g,g=0):S=Ms(S),k=k===n?g<S?1:-1:Ms(k),KV(g,S,k,f)}}function Cg(f){return function(g,S){return typeof g=="string"&&typeof S=="string"||(g=ni(g),S=ni(S)),f(g,S)}}function iT(f,g,S,k,N,W,Z,re,ce,ve){var we=g&_,Ce=we?Z:n,De=we?n:Z,Ve=we?W:n,qe=we?n:W;g|=we?C:E,g&=~(we?E:C),g&w||(g&=-4);var vt=[f,g,N,Ve,Ce,qe,De,re,ce,ve],Ye=S.apply(n,vt);return Gv(f)&&bT(Ye,vt),Ye.placeholder=k,yT(Ye,f,g)}function $v(f){var g=Jn[f];return function(S,k){if(S=ni(S),k=k==null?0:Sr(pt(k),292),k&&yP(S)){var N=(Qt(S)+"e").split("e"),W=g(N[0]+"e"+(+N[1]+k));return N=(Qt(W)+"e").split("e"),+(N[0]+"e"+(+N[1]-k))}return g(S)}}var dW=Jc&&1/Jp(new Jc([,-0]))[1]==$?function(f){return new Jc(f)}:ax;function sT(f){return function(g){var S=_r(g);return S==ue?gv(g):S==at?TH(g):xH(g,f(g))}}function Ts(f,g,S,k,N,W,Z,re){var ce=g&x;if(!ce&&typeof f!="function")throw new Qo(s);var ve=k?k.length:0;if(ve||(g&=-97,k=N=n),Z=Z===n?Z:er(pt(Z),0),re=re===n?re:pt(re),ve-=N?N.length:0,g&E){var we=k,Ce=N;k=N=n}var De=ce?n:Hv(f),Ve=[f,g,S,k,N,we,Ce,W,Z,re];if(De&&RW(Ve,De),f=Ve[0],g=Ve[1],S=Ve[2],k=Ve[3],N=Ve[4],re=Ve[9]=Ve[9]===n?ce?0:f.length:er(Ve[9]-ve,0),!re&&g&(_|R)&&(g&=-25),!g||g==v)var qe=lW(f,g,S);else g==_||g==R?qe=cW(f,g,re):(g==C||g==(v|C))&&!N.length?qe=uW(f,g,S,k):qe=wg.apply(n,Ve);var vt=De?zP:bT;return yT(vt(qe,Ve),f,g)}function aT(f,g,S,k){return f===n||yi(f,Zc[S])&&!nn.call(k,S)?g:f}function lT(f,g,S,k,N,W){return Tn(f)&&Tn(g)&&(W.set(g,f),bg(f,g,n,lT,W),W.delete(g)),f}function fW(f){return df(f)?n:f}function cT(f,g,S,k,N,W){var Z=S&m,re=f.length,ce=g.length;if(re!=ce&&!(Z&&ce>re))return!1;var ve=W.get(f),we=W.get(g);if(ve&&we)return ve==g&&we==f;var Ce=-1,De=!0,Ve=S&b?new ml:n;for(W.set(f,g),W.set(g,f);++Ce<re;){var qe=f[Ce],vt=g[Ce];if(k)var Ye=Z?k(vt,qe,Ce,g,f,W):k(qe,vt,Ce,f,g,W);if(Ye!==n){if(Ye)continue;De=!1;break}if(Ve){if(!cv(g,function(At,Lt){if(!Xd(Ve,Lt)&&(qe===At||N(qe,At,S,k,W)))return Ve.push(Lt)})){De=!1;break}}else if(!(qe===vt||N(qe,vt,S,k,W))){De=!1;break}}return W.delete(f),W.delete(g),De}function hW(f,g,S,k,N,W,Z){switch(S){case He:if(f.byteLength!=g.byteLength||f.byteOffset!=g.byteOffset)return!1;f=f.buffer,g=g.buffer;case _e:return!(f.byteLength!=g.byteLength||!W(new ig(f),new ig(g)));case J:case ie:case Ee:return yi(+f,+g);case he:return f.name==g.name&&f.message==g.message;case tt:case cn:return f==g+"";case ue:var re=gv;case at:var ce=k&m;if(re||(re=Jp),f.size!=g.size&&!ce)return!1;var ve=Z.get(f);if(ve)return ve==g;k|=b,Z.set(f,g);var we=cT(re(f),re(g),k,N,W,Z);return Z.delete(f),we;case St:if(tf)return tf.call(f)==tf.call(g)}return!1}function pW(f,g,S,k,N,W){var Z=S&m,re=zv(f),ce=re.length,ve=zv(g),we=ve.length;if(ce!=we&&!Z)return!1;for(var Ce=ce;Ce--;){var De=re[Ce];if(!(Z?De in g:nn.call(g,De)))return!1}var Ve=W.get(f),qe=W.get(g);if(Ve&&qe)return Ve==g&&qe==f;var vt=!0;W.set(f,g),W.set(g,f);for(var Ye=Z;++Ce<ce;){De=re[Ce];var At=f[De],Lt=g[De];if(k)var Ao=Z?k(Lt,At,De,g,f,W):k(At,Lt,De,f,g,W);if(!(Ao===n?At===Lt||N(At,Lt,S,k,W):Ao)){vt=!1;break}Ye||(Ye=De=="constructor")}if(vt&&!Ye){var zr=f.constructor,Oo=g.constructor;zr!=Oo&&"constructor"in f&&"constructor"in g&&!(typeof zr=="function"&&zr instanceof zr&&typeof Oo=="function"&&Oo instanceof Oo)&&(vt=!1)}return W.delete(f),W.delete(g),vt}function ks(f){return Yv(gT(f,n,CT),f+"")}function zv(f){return kP(f,ar,Wv)}function Bv(f){return kP(f,ro,uT)}var Hv=dg?function(f){return dg.get(f)}:ax;function Eg(f){for(var g=f.name+"",S=eu[g],k=nn.call(eu,g)?S.length:0;k--;){var N=S[k],W=N.func;if(W==null||W==f)return N.name}return g}function ou(f){var g=nn.call(B,"placeholder")?B:f;return g.placeholder}function Ge(){var f=B.iteratee||ix;return f=f===ix?MP:f,arguments.length?f(arguments[0],arguments[1]):f}function Rg(f,g){var S=f.__data__;return SW(g)?S[typeof g=="string"?"string":"hash"]:S.map}function Vv(f){for(var g=ar(f),S=g.length;S--;){var k=g[S],N=f[k];g[S]=[k,N,hT(N)]}return g}function vl(f,g){var S=EH(f,g);return OP(S)?S:n}function gW(f){var g=nn.call(f,pl),S=f[pl];try{f[pl]=n;var k=!0}catch{}var N=rg.call(f);return k&&(g?f[pl]=S:delete f[pl]),N}var Wv=bv?function(f){return f==null?[]:(f=un(f),ca(bv(f),function(g){return mP.call(f,g)}))}:lx,uT=bv?function(f){for(var g=[];f;)ua(g,Wv(f)),f=sg(f);return g}:lx,_r=jr;(yv&&_r(new yv(new ArrayBuffer(1)))!=He||Zd&&_r(new Zd)!=ue||vv&&_r(vv.resolve())!=Ae||Jc&&_r(new Jc)!=at||Jd&&_r(new Jd)!=Rt)&&(_r=function(f){var g=jr(f),S=g==Le?f.constructor:n,k=S?xl(S):"";if(k)switch(k){case QH:return He;case ZH:return ue;case JH:return Ae;case eV:return at;case tV:return Rt}return g});function mW(f,g,S){for(var k=-1,N=S.length;++k<N;){var W=S[k],Z=W.size;switch(W.type){case"drop":f+=Z;break;case"dropRight":g-=Z;break;case"take":g=Sr(g,f+Z);break;case"takeRight":f=er(f,g-Z);break}}return{start:f,end:g}}function bW(f){var g=f.match(Gc);return g?g[1].split(te):[]}function dT(f,g,S){g=ga(g,f);for(var k=-1,N=g.length,W=!1;++k<N;){var Z=Bi(g[k]);if(!(W=f!=null&&S(f,Z)))break;f=f[Z]}return W||++k!=N?W:(N=f==null?0:f.length,!!N&&Ig(N)&&As(Z,N)&&(ut(f)||wl(f)))}function yW(f){var g=f.length,S=new f.constructor(g);return g&&typeof f[0]=="string"&&nn.call(f,"index")&&(S.index=f.index,S.input=f.input),S}function fT(f){return typeof f.constructor=="function"&&!cf(f)?tu(sg(f)):{}}function vW(f,g,S){var k=f.constructor;switch(g){case _e:return Fv(f);case J:case ie:return new k(+f);case He:return nW(f,S);case We:case rt:case An:case Fn:case Rn:case sn:case jn:case Xt:case or:return YP(f,S);case ue:return new k;case Ee:case cn:return new k(f);case tt:return rW(f);case at:return new k;case St:return oW(f)}}function xW(f,g){var S=g.length;if(!S)return f;var k=S-1;return g[k]=(S>1?"& ":"")+g[k],g=g.join(S>2?", ":" "),f.replace(Uc,`{
|
|
73
|
+
/* [wrapped with `+g+`] */
|
|
74
|
+
`)}function wW(f){return ut(f)||wl(f)||!!(bP&&f&&f[bP])}function As(f,g){var S=typeof f;return g=g??V,!!g&&(S=="number"||S!="symbol"&&Se.test(f))&&f>-1&&f%1==0&&f<g}function $r(f,g,S){if(!Tn(S))return!1;var k=typeof g;return(k=="number"?no(S)&&As(g,S.length):k=="string"&&g in S)?yi(S[g],f):!1}function Uv(f,g){if(ut(f))return!1;var S=typeof f;return S=="number"||S=="symbol"||S=="boolean"||f==null||ko(f)?!0:Zn.test(f)||!Qn.test(f)||g!=null&&f in un(g)}function SW(f){var g=typeof f;return g=="string"||g=="number"||g=="symbol"||g=="boolean"?f!=="__proto__":f===null}function Gv(f){var g=Eg(f),S=B[g];if(typeof S!="function"||!(g in Dt.prototype))return!1;if(f===S)return!0;var k=Hv(S);return!!k&&f===k[0]}function _W(f){return!!hP&&hP in f}var CW=tg?Os:cx;function cf(f){var g=f&&f.constructor,S=typeof g=="function"&&g.prototype||Zc;return f===S}function hT(f){return f===f&&!Tn(f)}function pT(f,g){return function(S){return S==null?!1:S[f]===g&&(g!==n||f in un(S))}}function EW(f){var g=Og(f,function(k){return S.size===c&&S.clear(),k}),S=g.cache;return g}function RW(f,g){var S=f[1],k=g[1],N=S|k,W=N<(v|x|A),Z=k==A&&S==_||k==A&&S==M&&f[7].length<=g[8]||k==(A|M)&&g[7].length<=g[8]&&S==_;if(!(W||Z))return f;k&v&&(f[2]=g[2],N|=S&v?0:w);var re=g[3];if(re){var ce=f[3];f[3]=ce?XP(ce,re,g[4]):re,f[4]=ce?da(f[3],u):g[4]}return re=g[5],re&&(ce=f[5],f[5]=ce?QP(ce,re,g[6]):re,f[6]=ce?da(f[5],u):g[6]),re=g[7],re&&(f[7]=re),k&A&&(f[8]=f[8]==null?g[8]:Sr(f[8],g[8])),f[9]==null&&(f[9]=g[9]),f[0]=g[0],f[1]=N,f}function PW(f){var g=[];if(f!=null)for(var S in un(f))g.push(S);return g}function TW(f){return rg.call(f)}function gT(f,g,S){return g=er(g===n?f.length-1:g,0),function(){for(var k=arguments,N=-1,W=er(k.length-g,0),Z=pe(W);++N<W;)Z[N]=k[g+N];N=-1;for(var re=pe(g+1);++N<g;)re[N]=k[N];return re[g]=S(Z),Ro(f,this,re)}}function mT(f,g){return g.length<2?f:yl(f,ei(g,0,-1))}function kW(f,g){for(var S=f.length,k=Sr(g.length,S),N=to(f);k--;){var W=g[k];f[k]=As(W,S)?N[W]:n}return f}function qv(f,g){if(!(g==="constructor"&&typeof f[g]=="function")&&g!="__proto__")return f[g]}var bT=vT(zP),uf=WH||function(f,g){return hr.setTimeout(f,g)},Yv=vT(ZV);function yT(f,g,S){var k=g+"";return Yv(f,xW(k,AW(bW(k),S)))}function vT(f){var g=0,S=0;return function(){var k=YH(),N=Q-(k-S);if(S=k,N>0){if(++g>=z)return arguments[0]}else g=0;return f.apply(n,arguments)}}function Pg(f,g){var S=-1,k=f.length,N=k-1;for(g=g===n?k:g;++S<g;){var W=Av(S,N),Z=f[W];f[W]=f[S],f[S]=Z}return f.length=g,f}var xT=EW(function(f){var g=[];return f.charCodeAt(0)===46&&g.push(""),f.replace(Fr,function(S,k,N,W){g.push(N?W.replace(Ue,"$1"):k||S)}),g});function Bi(f){if(typeof f=="string"||ko(f))return f;var g=f+"";return g=="0"&&1/f==-1/0?"-0":g}function xl(f){if(f!=null){try{return ng.call(f)}catch{}try{return f+""}catch{}}return""}function AW(f,g){return Xo(ee,function(S){var k="_."+S[0];g&S[1]&&!Qp(f,k)&&f.push(k)}),f.sort()}function wT(f){if(f instanceof Dt)return f.clone();var g=new Zo(f.__wrapped__,f.__chain__);return g.__actions__=to(f.__actions__),g.__index__=f.__index__,g.__values__=f.__values__,g}function OW(f,g,S){(S?$r(f,g,S):g===n)?g=1:g=er(pt(g),0);var k=f==null?0:f.length;if(!k||g<1)return[];for(var N=0,W=0,Z=pe(cg(k/g));N<k;)Z[W++]=ei(f,N,N+=g);return Z}function MW(f){for(var g=-1,S=f==null?0:f.length,k=0,N=[];++g<S;){var W=f[g];W&&(N[k++]=W)}return N}function IW(){var f=arguments.length;if(!f)return[];for(var g=pe(f-1),S=arguments[0],k=f;k--;)g[k-1]=arguments[k];return ua(ut(S)?to(S):[S],pr(g,1))}var DW=Et(function(f,g){return $n(f)?rf(f,pr(g,1,$n,!0)):[]}),NW=Et(function(f,g){var S=ti(g);return $n(S)&&(S=n),$n(f)?rf(f,pr(g,1,$n,!0),Ge(S,2)):[]}),LW=Et(function(f,g){var S=ti(g);return $n(S)&&(S=n),$n(f)?rf(f,pr(g,1,$n,!0),n,S):[]});function FW(f,g,S){var k=f==null?0:f.length;return k?(g=S||g===n?1:pt(g),ei(f,g<0?0:g,k)):[]}function jW(f,g,S){var k=f==null?0:f.length;return k?(g=S||g===n?1:pt(g),g=k-g,ei(f,0,g<0?0:g)):[]}function $W(f,g){return f&&f.length?vg(f,Ge(g,3),!0,!0):[]}function zW(f,g){return f&&f.length?vg(f,Ge(g,3),!0):[]}function BW(f,g,S,k){var N=f==null?0:f.length;return N?(S&&typeof S!="number"&&$r(f,g,S)&&(S=0,k=N),IV(f,g,S,k)):[]}function ST(f,g,S){var k=f==null?0:f.length;if(!k)return-1;var N=S==null?0:pt(S);return N<0&&(N=er(k+N,0)),Zp(f,Ge(g,3),N)}function _T(f,g,S){var k=f==null?0:f.length;if(!k)return-1;var N=k-1;return S!==n&&(N=pt(S),N=S<0?er(k+N,0):Sr(N,k-1)),Zp(f,Ge(g,3),N,!0)}function CT(f){var g=f==null?0:f.length;return g?pr(f,1):[]}function HW(f){var g=f==null?0:f.length;return g?pr(f,$):[]}function VW(f,g){var S=f==null?0:f.length;return S?(g=g===n?1:pt(g),pr(f,g)):[]}function WW(f){for(var g=-1,S=f==null?0:f.length,k={};++g<S;){var N=f[g];k[N[0]]=N[1]}return k}function ET(f){return f&&f.length?f[0]:n}function UW(f,g,S){var k=f==null?0:f.length;if(!k)return-1;var N=S==null?0:pt(S);return N<0&&(N=er(k+N,0)),Yc(f,g,N)}function GW(f){var g=f==null?0:f.length;return g?ei(f,0,-1):[]}var qW=Et(function(f){var g=Pn(f,Nv);return g.length&&g[0]===f[0]?Ev(g):[]}),YW=Et(function(f){var g=ti(f),S=Pn(f,Nv);return g===ti(S)?g=n:S.pop(),S.length&&S[0]===f[0]?Ev(S,Ge(g,2)):[]}),KW=Et(function(f){var g=ti(f),S=Pn(f,Nv);return g=typeof g=="function"?g:n,g&&S.pop(),S.length&&S[0]===f[0]?Ev(S,n,g):[]});function XW(f,g){return f==null?"":GH.call(f,g)}function ti(f){var g=f==null?0:f.length;return g?f[g-1]:n}function QW(f,g,S){var k=f==null?0:f.length;if(!k)return-1;var N=k;return S!==n&&(N=pt(S),N=N<0?er(k+N,0):Sr(N,k-1)),g===g?AH(f,g,N):Zp(f,iP,N,!0)}function ZW(f,g){return f&&f.length?LP(f,pt(g)):n}var JW=Et(RT);function RT(f,g){return f&&f.length&&g&&g.length?kv(f,g):f}function eU(f,g,S){return f&&f.length&&g&&g.length?kv(f,g,Ge(S,2)):f}function tU(f,g,S){return f&&f.length&&g&&g.length?kv(f,g,n,S):f}var nU=ks(function(f,g){var S=f==null?0:f.length,k=wv(f,g);return $P(f,Pn(g,function(N){return As(N,S)?+N:N}).sort(KP)),k});function rU(f,g){var S=[];if(!(f&&f.length))return S;var k=-1,N=[],W=f.length;for(g=Ge(g,3);++k<W;){var Z=f[k];g(Z,k,f)&&(S.push(Z),N.push(k))}return $P(f,N),S}function Kv(f){return f==null?f:XH.call(f)}function oU(f,g,S){var k=f==null?0:f.length;return k?(S&&typeof S!="number"&&$r(f,g,S)?(g=0,S=k):(g=g==null?0:pt(g),S=S===n?k:pt(S)),ei(f,g,S)):[]}function iU(f,g){return yg(f,g)}function sU(f,g,S){return Mv(f,g,Ge(S,2))}function aU(f,g){var S=f==null?0:f.length;if(S){var k=yg(f,g);if(k<S&&yi(f[k],g))return k}return-1}function lU(f,g){return yg(f,g,!0)}function cU(f,g,S){return Mv(f,g,Ge(S,2),!0)}function uU(f,g){var S=f==null?0:f.length;if(S){var k=yg(f,g,!0)-1;if(yi(f[k],g))return k}return-1}function dU(f){return f&&f.length?BP(f):[]}function fU(f,g){return f&&f.length?BP(f,Ge(g,2)):[]}function hU(f){var g=f==null?0:f.length;return g?ei(f,1,g):[]}function pU(f,g,S){return f&&f.length?(g=S||g===n?1:pt(g),ei(f,0,g<0?0:g)):[]}function gU(f,g,S){var k=f==null?0:f.length;return k?(g=S||g===n?1:pt(g),g=k-g,ei(f,g<0?0:g,k)):[]}function mU(f,g){return f&&f.length?vg(f,Ge(g,3),!1,!0):[]}function bU(f,g){return f&&f.length?vg(f,Ge(g,3)):[]}var yU=Et(function(f){return pa(pr(f,1,$n,!0))}),vU=Et(function(f){var g=ti(f);return $n(g)&&(g=n),pa(pr(f,1,$n,!0),Ge(g,2))}),xU=Et(function(f){var g=ti(f);return g=typeof g=="function"?g:n,pa(pr(f,1,$n,!0),n,g)});function wU(f){return f&&f.length?pa(f):[]}function SU(f,g){return f&&f.length?pa(f,Ge(g,2)):[]}function _U(f,g){return g=typeof g=="function"?g:n,f&&f.length?pa(f,n,g):[]}function Xv(f){if(!(f&&f.length))return[];var g=0;return f=ca(f,function(S){if($n(S))return g=er(S.length,g),!0}),hv(g,function(S){return Pn(f,uv(S))})}function PT(f,g){if(!(f&&f.length))return[];var S=Xv(f);return g==null?S:Pn(S,function(k){return Ro(g,n,k)})}var CU=Et(function(f,g){return $n(f)?rf(f,g):[]}),EU=Et(function(f){return Dv(ca(f,$n))}),RU=Et(function(f){var g=ti(f);return $n(g)&&(g=n),Dv(ca(f,$n),Ge(g,2))}),PU=Et(function(f){var g=ti(f);return g=typeof g=="function"?g:n,Dv(ca(f,$n),n,g)}),TU=Et(Xv);function kU(f,g){return UP(f||[],g||[],nf)}function AU(f,g){return UP(f||[],g||[],af)}var OU=Et(function(f){var g=f.length,S=g>1?f[g-1]:n;return S=typeof S=="function"?(f.pop(),S):n,PT(f,S)});function TT(f){var g=B(f);return g.__chain__=!0,g}function MU(f,g){return g(f),f}function Tg(f,g){return g(f)}var IU=ks(function(f){var g=f.length,S=g?f[0]:0,k=this.__wrapped__,N=function(W){return wv(W,f)};return g>1||this.__actions__.length||!(k instanceof Dt)||!As(S)?this.thru(N):(k=k.slice(S,+S+(g?1:0)),k.__actions__.push({func:Tg,args:[N],thisArg:n}),new Zo(k,this.__chain__).thru(function(W){return g&&!W.length&&W.push(n),W}))});function DU(){return TT(this)}function NU(){return new Zo(this.value(),this.__chain__)}function LU(){this.__values__===n&&(this.__values__=HT(this.value()));var f=this.__index__>=this.__values__.length,g=f?n:this.__values__[this.__index__++];return{done:f,value:g}}function FU(){return this}function jU(f){for(var g,S=this;S instanceof hg;){var k=wT(S);k.__index__=0,k.__values__=n,g?N.__wrapped__=k:g=k;var N=k;S=S.__wrapped__}return N.__wrapped__=f,g}function $U(){var f=this.__wrapped__;if(f instanceof Dt){var g=f;return this.__actions__.length&&(g=new Dt(this)),g=g.reverse(),g.__actions__.push({func:Tg,args:[Kv],thisArg:n}),new Zo(g,this.__chain__)}return this.thru(Kv)}function zU(){return WP(this.__wrapped__,this.__actions__)}var BU=xg(function(f,g,S){nn.call(f,S)?++f[S]:Ps(f,S,1)});function HU(f,g,S){var k=ut(f)?rP:MV;return S&&$r(f,g,S)&&(g=n),k(f,Ge(g,3))}function VU(f,g){var S=ut(f)?ca:PP;return S(f,Ge(g,3))}var WU=tT(ST),UU=tT(_T);function GU(f,g){return pr(kg(f,g),1)}function qU(f,g){return pr(kg(f,g),$)}function YU(f,g,S){return S=S===n?1:pt(S),pr(kg(f,g),S)}function kT(f,g){var S=ut(f)?Xo:ha;return S(f,Ge(g,3))}function AT(f,g){var S=ut(f)?hH:RP;return S(f,Ge(g,3))}var KU=xg(function(f,g,S){nn.call(f,S)?f[S].push(g):Ps(f,S,[g])});function XU(f,g,S,k){f=no(f)?f:su(f),S=S&&!k?pt(S):0;var N=f.length;return S<0&&(S=er(N+S,0)),Dg(f)?S<=N&&f.indexOf(g,S)>-1:!!N&&Yc(f,g,S)>-1}var QU=Et(function(f,g,S){var k=-1,N=typeof g=="function",W=no(f)?pe(f.length):[];return ha(f,function(Z){W[++k]=N?Ro(g,Z,S):of(Z,g,S)}),W}),ZU=xg(function(f,g,S){Ps(f,S,g)});function kg(f,g){var S=ut(f)?Pn:IP;return S(f,Ge(g,3))}function JU(f,g,S,k){return f==null?[]:(ut(g)||(g=g==null?[]:[g]),S=k?n:S,ut(S)||(S=S==null?[]:[S]),FP(f,g,S))}var eG=xg(function(f,g,S){f[S?0:1].push(g)},function(){return[[],[]]});function tG(f,g,S){var k=ut(f)?lv:aP,N=arguments.length<3;return k(f,Ge(g,4),S,N,ha)}function nG(f,g,S){var k=ut(f)?pH:aP,N=arguments.length<3;return k(f,Ge(g,4),S,N,RP)}function rG(f,g){var S=ut(f)?ca:PP;return S(f,Mg(Ge(g,3)))}function oG(f){var g=ut(f)?SP:XV;return g(f)}function iG(f,g,S){(S?$r(f,g,S):g===n)?g=1:g=pt(g);var k=ut(f)?PV:QV;return k(f,g)}function sG(f){var g=ut(f)?TV:JV;return g(f)}function aG(f){if(f==null)return 0;if(no(f))return Dg(f)?Xc(f):f.length;var g=_r(f);return g==ue||g==at?f.size:Pv(f).length}function lG(f,g,S){var k=ut(f)?cv:eW;return S&&$r(f,g,S)&&(g=n),k(f,Ge(g,3))}var cG=Et(function(f,g){if(f==null)return[];var S=g.length;return S>1&&$r(f,g[0],g[1])?g=[]:S>2&&$r(g[0],g[1],g[2])&&(g=[g[0]]),FP(f,pr(g,1),[])}),Ag=VH||function(){return hr.Date.now()};function uG(f,g){if(typeof g!="function")throw new Qo(s);return f=pt(f),function(){if(--f<1)return g.apply(this,arguments)}}function OT(f,g,S){return g=S?n:g,g=f&&g==null?f.length:g,Ts(f,A,n,n,n,n,g)}function MT(f,g){var S;if(typeof g!="function")throw new Qo(s);return f=pt(f),function(){return--f>0&&(S=g.apply(this,arguments)),f<=1&&(g=n),S}}var Qv=Et(function(f,g,S){var k=v;if(S.length){var N=da(S,ou(Qv));k|=C}return Ts(f,k,g,S,N)}),IT=Et(function(f,g,S){var k=v|x;if(S.length){var N=da(S,ou(IT));k|=C}return Ts(g,k,f,S,N)});function DT(f,g,S){g=S?n:g;var k=Ts(f,_,n,n,n,n,n,g);return k.placeholder=DT.placeholder,k}function NT(f,g,S){g=S?n:g;var k=Ts(f,R,n,n,n,n,n,g);return k.placeholder=NT.placeholder,k}function LT(f,g,S){var k,N,W,Z,re,ce,ve=0,we=!1,Ce=!1,De=!0;if(typeof f!="function")throw new Qo(s);g=ni(g)||0,Tn(S)&&(we=!!S.leading,Ce="maxWait"in S,W=Ce?er(ni(S.maxWait)||0,g):W,De="trailing"in S?!!S.trailing:De);function Ve(zn){var vi=k,Is=N;return k=N=n,ve=zn,Z=f.apply(Is,vi),Z}function qe(zn){return ve=zn,re=uf(At,g),we?Ve(zn):Z}function vt(zn){var vi=zn-ce,Is=zn-ve,tk=g-vi;return Ce?Sr(tk,W-Is):tk}function Ye(zn){var vi=zn-ce,Is=zn-ve;return ce===n||vi>=g||vi<0||Ce&&Is>=W}function At(){var zn=Ag();if(Ye(zn))return Lt(zn);re=uf(At,vt(zn))}function Lt(zn){return re=n,De&&k?Ve(zn):(k=N=n,Z)}function Ao(){re!==n&&GP(re),ve=0,k=ce=N=re=n}function zr(){return re===n?Z:Lt(Ag())}function Oo(){var zn=Ag(),vi=Ye(zn);if(k=arguments,N=this,ce=zn,vi){if(re===n)return qe(ce);if(Ce)return GP(re),re=uf(At,g),Ve(ce)}return re===n&&(re=uf(At,g)),Z}return Oo.cancel=Ao,Oo.flush=zr,Oo}var dG=Et(function(f,g){return EP(f,1,g)}),fG=Et(function(f,g,S){return EP(f,ni(g)||0,S)});function hG(f){return Ts(f,D)}function Og(f,g){if(typeof f!="function"||g!=null&&typeof g!="function")throw new Qo(s);var S=function(){var k=arguments,N=g?g.apply(this,k):k[0],W=S.cache;if(W.has(N))return W.get(N);var Z=f.apply(this,k);return S.cache=W.set(N,Z)||W,Z};return S.cache=new(Og.Cache||Rs),S}Og.Cache=Rs;function Mg(f){if(typeof f!="function")throw new Qo(s);return function(){var g=arguments;switch(g.length){case 0:return!f.call(this);case 1:return!f.call(this,g[0]);case 2:return!f.call(this,g[0],g[1]);case 3:return!f.call(this,g[0],g[1],g[2])}return!f.apply(this,g)}}function pG(f){return MT(2,f)}var gG=tW(function(f,g){g=g.length==1&&ut(g[0])?Pn(g[0],Po(Ge())):Pn(pr(g,1),Po(Ge()));var S=g.length;return Et(function(k){for(var N=-1,W=Sr(k.length,S);++N<W;)k[N]=g[N].call(this,k[N]);return Ro(f,this,k)})}),Zv=Et(function(f,g){var S=da(g,ou(Zv));return Ts(f,C,n,g,S)}),FT=Et(function(f,g){var S=da(g,ou(FT));return Ts(f,E,n,g,S)}),mG=ks(function(f,g){return Ts(f,M,n,n,n,g)});function bG(f,g){if(typeof f!="function")throw new Qo(s);return g=g===n?g:pt(g),Et(f,g)}function yG(f,g){if(typeof f!="function")throw new Qo(s);return g=g==null?0:er(pt(g),0),Et(function(S){var k=S[g],N=ma(S,0,g);return k&&ua(N,k),Ro(f,this,N)})}function vG(f,g,S){var k=!0,N=!0;if(typeof f!="function")throw new Qo(s);return Tn(S)&&(k="leading"in S?!!S.leading:k,N="trailing"in S?!!S.trailing:N),LT(f,g,{leading:k,maxWait:g,trailing:N})}function xG(f){return OT(f,1)}function wG(f,g){return Zv(Lv(g),f)}function SG(){if(!arguments.length)return[];var f=arguments[0];return ut(f)?f:[f]}function _G(f){return Jo(f,h)}function CG(f,g){return g=typeof g=="function"?g:n,Jo(f,h,g)}function EG(f){return Jo(f,d|h)}function RG(f,g){return g=typeof g=="function"?g:n,Jo(f,d|h,g)}function PG(f,g){return g==null||CP(f,g,ar(g))}function yi(f,g){return f===g||f!==f&&g!==g}var TG=Cg(Cv),kG=Cg(function(f,g){return f>=g}),wl=AP(function(){return arguments}())?AP:function(f){return On(f)&&nn.call(f,"callee")&&!mP.call(f,"callee")},ut=pe.isArray,AG=Q2?Po(Q2):jV;function no(f){return f!=null&&Ig(f.length)&&!Os(f)}function $n(f){return On(f)&&no(f)}function OG(f){return f===!0||f===!1||On(f)&&jr(f)==J}var ba=UH||cx,MG=Z2?Po(Z2):$V;function IG(f){return On(f)&&f.nodeType===1&&!df(f)}function DG(f){if(f==null)return!0;if(no(f)&&(ut(f)||typeof f=="string"||typeof f.splice=="function"||ba(f)||iu(f)||wl(f)))return!f.length;var g=_r(f);if(g==ue||g==at)return!f.size;if(cf(f))return!Pv(f).length;for(var S in f)if(nn.call(f,S))return!1;return!0}function NG(f,g){return sf(f,g)}function LG(f,g,S){S=typeof S=="function"?S:n;var k=S?S(f,g):n;return k===n?sf(f,g,n,S):!!k}function Jv(f){if(!On(f))return!1;var g=jr(f);return g==he||g==de||typeof f.message=="string"&&typeof f.name=="string"&&!df(f)}function FG(f){return typeof f=="number"&&yP(f)}function Os(f){if(!Tn(f))return!1;var g=jr(f);return g==ae||g==ge||g==Y||g==Fe}function jT(f){return typeof f=="number"&&f==pt(f)}function Ig(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=V}function Tn(f){var g=typeof f;return f!=null&&(g=="object"||g=="function")}function On(f){return f!=null&&typeof f=="object"}var $T=J2?Po(J2):BV;function jG(f,g){return f===g||Rv(f,g,Vv(g))}function $G(f,g,S){return S=typeof S=="function"?S:n,Rv(f,g,Vv(g),S)}function zG(f){return zT(f)&&f!=+f}function BG(f){if(CW(f))throw new ct(i);return OP(f)}function HG(f){return f===null}function VG(f){return f==null}function zT(f){return typeof f=="number"||On(f)&&jr(f)==Ee}function df(f){if(!On(f)||jr(f)!=Le)return!1;var g=sg(f);if(g===null)return!0;var S=nn.call(g,"constructor")&&g.constructor;return typeof S=="function"&&S instanceof S&&ng.call(S)==$H}var ex=eP?Po(eP):HV;function WG(f){return jT(f)&&f>=-9007199254740991&&f<=V}var BT=tP?Po(tP):VV;function Dg(f){return typeof f=="string"||!ut(f)&&On(f)&&jr(f)==cn}function ko(f){return typeof f=="symbol"||On(f)&&jr(f)==St}var iu=nP?Po(nP):WV;function UG(f){return f===n}function GG(f){return On(f)&&_r(f)==Rt}function qG(f){return On(f)&&jr(f)==fe}var YG=Cg(Tv),KG=Cg(function(f,g){return f<=g});function HT(f){if(!f)return[];if(no(f))return Dg(f)?mi(f):to(f);if(Qd&&f[Qd])return PH(f[Qd]());var g=_r(f),S=g==ue?gv:g==at?Jp:su;return S(f)}function Ms(f){if(!f)return f===0?f:0;if(f=ni(f),f===$||f===-1/0){var g=f<0?-1:1;return g*X}return f===f?f:0}function pt(f){var g=Ms(f),S=g%1;return g===g?S?g-S:g:0}function VT(f){return f?bl(pt(f),0,q):0}function ni(f){if(typeof f=="number")return f;if(ko(f))return I;if(Tn(f)){var g=typeof f.valueOf=="function"?f.valueOf():f;f=Tn(g)?g+"":g}if(typeof f!="string")return f===0?f:+f;f=lP(f);var S=yt.test(f);return S||ne.test(f)?uH(f.slice(2),S?2:8):Ct.test(f)?I:+f}function WT(f){return zi(f,ro(f))}function XG(f){return f?bl(pt(f),-9007199254740991,V):f===0?f:0}function Qt(f){return f==null?"":To(f)}var QG=nu(function(f,g){if(cf(g)||no(g)){zi(g,ar(g),f);return}for(var S in g)nn.call(g,S)&&nf(f,S,g[S])}),UT=nu(function(f,g){zi(g,ro(g),f)}),Ng=nu(function(f,g,S,k){zi(g,ro(g),f,k)}),ZG=nu(function(f,g,S,k){zi(g,ar(g),f,k)}),JG=ks(wv);function eq(f,g){var S=tu(f);return g==null?S:_P(S,g)}var tq=Et(function(f,g){f=un(f);var S=-1,k=g.length,N=k>2?g[2]:n;for(N&&$r(g[0],g[1],N)&&(k=1);++S<k;)for(var W=g[S],Z=ro(W),re=-1,ce=Z.length;++re<ce;){var ve=Z[re],we=f[ve];(we===n||yi(we,Zc[ve])&&!nn.call(f,ve))&&(f[ve]=W[ve])}return f}),nq=Et(function(f){return f.push(n,lT),Ro(GT,n,f)});function rq(f,g){return oP(f,Ge(g,3),$i)}function oq(f,g){return oP(f,Ge(g,3),_v)}function iq(f,g){return f==null?f:Sv(f,Ge(g,3),ro)}function sq(f,g){return f==null?f:TP(f,Ge(g,3),ro)}function aq(f,g){return f&&$i(f,Ge(g,3))}function lq(f,g){return f&&_v(f,Ge(g,3))}function cq(f){return f==null?[]:mg(f,ar(f))}function uq(f){return f==null?[]:mg(f,ro(f))}function tx(f,g,S){var k=f==null?n:yl(f,g);return k===n?S:k}function dq(f,g){return f!=null&&dT(f,g,DV)}function nx(f,g){return f!=null&&dT(f,g,NV)}var fq=rT(function(f,g,S){g!=null&&typeof g.toString!="function"&&(g=rg.call(g)),f[g]=S},ox(oo)),hq=rT(function(f,g,S){g!=null&&typeof g.toString!="function"&&(g=rg.call(g)),nn.call(f,g)?f[g].push(S):f[g]=[S]},Ge),pq=Et(of);function ar(f){return no(f)?wP(f):Pv(f)}function ro(f){return no(f)?wP(f,!0):UV(f)}function gq(f,g){var S={};return g=Ge(g,3),$i(f,function(k,N,W){Ps(S,g(k,N,W),k)}),S}function mq(f,g){var S={};return g=Ge(g,3),$i(f,function(k,N,W){Ps(S,N,g(k,N,W))}),S}var bq=nu(function(f,g,S){bg(f,g,S)}),GT=nu(function(f,g,S,k){bg(f,g,S,k)}),yq=ks(function(f,g){var S={};if(f==null)return S;var k=!1;g=Pn(g,function(W){return W=ga(W,f),k||(k=W.length>1),W}),zi(f,Bv(f),S),k&&(S=Jo(S,d|p|h,fW));for(var N=g.length;N--;)Iv(S,g[N]);return S});function vq(f,g){return qT(f,Mg(Ge(g)))}var xq=ks(function(f,g){return f==null?{}:qV(f,g)});function qT(f,g){if(f==null)return{};var S=Pn(Bv(f),function(k){return[k]});return g=Ge(g),jP(f,S,function(k,N){return g(k,N[0])})}function wq(f,g,S){g=ga(g,f);var k=-1,N=g.length;for(N||(N=1,f=n);++k<N;){var W=f==null?n:f[Bi(g[k])];W===n&&(k=N,W=S),f=Os(W)?W.call(f):W}return f}function Sq(f,g,S){return f==null?f:af(f,g,S)}function _q(f,g,S,k){return k=typeof k=="function"?k:n,f==null?f:af(f,g,S,k)}var YT=sT(ar),KT=sT(ro);function Cq(f,g,S){var k=ut(f),N=k||ba(f)||iu(f);if(g=Ge(g,4),S==null){var W=f&&f.constructor;N?S=k?new W:[]:Tn(f)?S=Os(W)?tu(sg(f)):{}:S={}}return(N?Xo:$i)(f,function(Z,re,ce){return g(S,Z,re,ce)}),S}function Eq(f,g){return f==null?!0:Iv(f,g)}function Rq(f,g,S){return f==null?f:VP(f,g,Lv(S))}function Pq(f,g,S,k){return k=typeof k=="function"?k:n,f==null?f:VP(f,g,Lv(S),k)}function su(f){return f==null?[]:pv(f,ar(f))}function Tq(f){return f==null?[]:pv(f,ro(f))}function kq(f,g,S){return S===n&&(S=g,g=n),S!==n&&(S=ni(S),S=S===S?S:0),g!==n&&(g=ni(g),g=g===g?g:0),bl(ni(f),g,S)}function Aq(f,g,S){return g=Ms(g),S===n?(S=g,g=0):S=Ms(S),f=ni(f),LV(f,g,S)}function Oq(f,g,S){if(S&&typeof S!="boolean"&&$r(f,g,S)&&(g=S=n),S===n&&(typeof g=="boolean"?(S=g,g=n):typeof f=="boolean"&&(S=f,f=n)),f===n&&g===n?(f=0,g=1):(f=Ms(f),g===n?(g=f,f=0):g=Ms(g)),f>g){var k=f;f=g,g=k}if(S||f%1||g%1){var N=vP();return Sr(f+N*(g-f+cH("1e-"+((N+"").length-1))),g)}return Av(f,g)}var Mq=ru(function(f,g,S){return g=g.toLowerCase(),f+(S?XT(g):g)});function XT(f){return rx(Qt(f).toLowerCase())}function QT(f){return f=Qt(f),f&&f.replace(Ie,SH).replace(JB,"")}function Iq(f,g,S){f=Qt(f),g=To(g);var k=f.length;S=S===n?k:bl(pt(S),0,k);var N=S;return S-=g.length,S>=0&&f.slice(S,N)==g}function Dq(f){return f=Qt(f),f&&fl.test(f)?f.replace(wr,_H):f}function Nq(f){return f=Qt(f),f&&ir.test(f)?f.replace(fr,"\\$&"):f}var Lq=ru(function(f,g,S){return f+(S?"-":"")+g.toLowerCase()}),Fq=ru(function(f,g,S){return f+(S?" ":"")+g.toLowerCase()}),jq=eT("toLowerCase");function $q(f,g,S){f=Qt(f),g=pt(g);var k=g?Xc(f):0;if(!g||k>=g)return f;var N=(g-k)/2;return _g(ug(N),S)+f+_g(cg(N),S)}function zq(f,g,S){f=Qt(f),g=pt(g);var k=g?Xc(f):0;return g&&k<g?f+_g(g-k,S):f}function Bq(f,g,S){f=Qt(f),g=pt(g);var k=g?Xc(f):0;return g&&k<g?_g(g-k,S)+f:f}function Hq(f,g,S){return S||g==null?g=0:g&&(g=+g),KH(Qt(f).replace(bn,""),g||0)}function Vq(f,g,S){return(S?$r(f,g,S):g===n)?g=1:g=pt(g),Ov(Qt(f),g)}function Wq(){var f=arguments,g=Qt(f[0]);return f.length<3?g:g.replace(f[1],f[2])}var Uq=ru(function(f,g,S){return f+(S?"_":"")+g.toLowerCase()});function Gq(f,g,S){return S&&typeof S!="number"&&$r(f,g,S)&&(g=S=n),S=S===n?q:S>>>0,S?(f=Qt(f),f&&(typeof g=="string"||g!=null&&!ex(g))&&(g=To(g),!g&&Kc(f))?ma(mi(f),0,S):f.split(g,S)):[]}var qq=ru(function(f,g,S){return f+(S?" ":"")+rx(g)});function Yq(f,g,S){return f=Qt(f),S=S==null?0:bl(pt(S),0,f.length),g=To(g),f.slice(S,S+g.length)==g}function Kq(f,g,S){var k=B.templateSettings;S&&$r(f,g,S)&&(g=n),f=Qt(f),g=Ng({},g,k,aT);var N=Ng({},g.imports,k.imports,aT),W=ar(N),Z=pv(N,W),re,ce,ve=0,we=g.interpolate||It,Ce="__p += '",De=mv((g.escape||It).source+"|"+we.source+"|"+(we===Ut?Nt:It).source+"|"+(g.evaluate||It).source+"|$","g"),Ve="//# sourceURL="+(nn.call(g,"sourceURL")?(g.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++oH+"]")+`
|
|
75
|
+
`;f.replace(De,function(Ye,At,Lt,Ao,zr,Oo){return Lt||(Lt=Ao),Ce+=f.slice(ve,Oo).replace(fn,CH),At&&(re=!0,Ce+=`' +
|
|
76
|
+
__e(`+At+`) +
|
|
77
|
+
'`),zr&&(ce=!0,Ce+=`';
|
|
78
|
+
`+zr+`;
|
|
79
|
+
__p += '`),Lt&&(Ce+=`' +
|
|
80
|
+
((__t = (`+Lt+`)) == null ? '' : __t) +
|
|
81
|
+
'`),ve=Oo+Ye.length,Ye}),Ce+=`';
|
|
82
|
+
`;var qe=nn.call(g,"variable")&&g.variable;if(!qe)Ce=`with (obj) {
|
|
83
|
+
`+Ce+`
|
|
84
|
+
}
|
|
85
|
+
`;else if(Me.test(qe))throw new ct(a);Ce=(ce?Ce.replace(Xn,""):Ce).replace(Yo,"$1").replace(xr,"$1;"),Ce="function("+(qe||"obj")+`) {
|
|
86
|
+
`+(qe?"":`obj || (obj = {});
|
|
87
|
+
`)+"var __t, __p = ''"+(re?", __e = _.escape":"")+(ce?`, __j = Array.prototype.join;
|
|
88
|
+
function print() { __p += __j.call(arguments, '') }
|
|
89
|
+
`:`;
|
|
90
|
+
`)+Ce+`return __p
|
|
91
|
+
}`;var vt=JT(function(){return Gt(W,Ve+"return "+Ce).apply(n,Z)});if(vt.source=Ce,Jv(vt))throw vt;return vt}function Xq(f){return Qt(f).toLowerCase()}function Qq(f){return Qt(f).toUpperCase()}function Zq(f,g,S){if(f=Qt(f),f&&(S||g===n))return lP(f);if(!f||!(g=To(g)))return f;var k=mi(f),N=mi(g),W=cP(k,N),Z=uP(k,N)+1;return ma(k,W,Z).join("")}function Jq(f,g,S){if(f=Qt(f),f&&(S||g===n))return f.slice(0,fP(f)+1);if(!f||!(g=To(g)))return f;var k=mi(f),N=uP(k,mi(g))+1;return ma(k,0,N).join("")}function eY(f,g,S){if(f=Qt(f),f&&(S||g===n))return f.replace(bn,"");if(!f||!(g=To(g)))return f;var k=mi(f),N=cP(k,mi(g));return ma(k,N).join("")}function tY(f,g){var S=L,k=j;if(Tn(g)){var N="separator"in g?g.separator:N;S="length"in g?pt(g.length):S,k="omission"in g?To(g.omission):k}f=Qt(f);var W=f.length;if(Kc(f)){var Z=mi(f);W=Z.length}if(S>=W)return f;var re=S-Xc(k);if(re<1)return k;var ce=Z?ma(Z,0,re).join(""):f.slice(0,re);if(N===n)return ce+k;if(Z&&(re+=ce.length-re),ex(N)){if(f.slice(re).search(N)){var ve,we=ce;for(N.global||(N=mv(N.source,Qt(Ht.exec(N))+"g")),N.lastIndex=0;ve=N.exec(we);)var Ce=ve.index;ce=ce.slice(0,Ce===n?re:Ce)}}else if(f.indexOf(To(N),re)!=re){var De=ce.lastIndexOf(N);De>-1&&(ce=ce.slice(0,De))}return ce+k}function nY(f){return f=Qt(f),f&&Lr.test(f)?f.replace(ji,OH):f}var rY=ru(function(f,g,S){return f+(S?" ":"")+g.toUpperCase()}),rx=eT("toUpperCase");function ZT(f,g,S){return f=Qt(f),g=S?n:g,g===n?RH(f)?DH(f):bH(f):f.match(g)||[]}var JT=Et(function(f,g){try{return Ro(f,n,g)}catch(S){return Jv(S)?S:new ct(S)}}),oY=ks(function(f,g){return Xo(g,function(S){S=Bi(S),Ps(f,S,Qv(f[S],f))}),f});function iY(f){var g=f==null?0:f.length,S=Ge();return f=g?Pn(f,function(k){if(typeof k[1]!="function")throw new Qo(s);return[S(k[0]),k[1]]}):[],Et(function(k){for(var N=-1;++N<g;){var W=f[N];if(Ro(W[0],this,k))return Ro(W[1],this,k)}})}function sY(f){return OV(Jo(f,d))}function ox(f){return function(){return f}}function aY(f,g){return f==null||f!==f?g:f}var lY=nT(),cY=nT(!0);function oo(f){return f}function ix(f){return MP(typeof f=="function"?f:Jo(f,d))}function uY(f){return DP(Jo(f,d))}function dY(f,g){return NP(f,Jo(g,d))}var fY=Et(function(f,g){return function(S){return of(S,f,g)}}),hY=Et(function(f,g){return function(S){return of(f,S,g)}});function sx(f,g,S){var k=ar(g),N=mg(g,k);S==null&&!(Tn(g)&&(N.length||!k.length))&&(S=g,g=f,f=this,N=mg(g,ar(g)));var W=!(Tn(S)&&"chain"in S)||!!S.chain,Z=Os(f);return Xo(N,function(re){var ce=g[re];f[re]=ce,Z&&(f.prototype[re]=function(){var ve=this.__chain__;if(W||ve){var we=f(this.__wrapped__),Ce=we.__actions__=to(this.__actions__);return Ce.push({func:ce,args:arguments,thisArg:f}),we.__chain__=ve,we}return ce.apply(f,ua([this.value()],arguments))})}),f}function pY(){return hr._===this&&(hr._=zH),this}function ax(){}function gY(f){return f=pt(f),Et(function(g){return LP(g,f)})}var mY=jv(Pn),bY=jv(rP),yY=jv(cv);function ek(f){return Uv(f)?uv(Bi(f)):YV(f)}function vY(f){return function(g){return f==null?n:yl(f,g)}}var xY=oT(),wY=oT(!0);function lx(){return[]}function cx(){return!1}function SY(){return{}}function _Y(){return""}function CY(){return!0}function EY(f,g){if(f=pt(f),f<1||f>V)return[];var S=q,k=Sr(f,q);g=Ge(g),f-=q;for(var N=hv(k,g);++S<f;)g(S);return N}function RY(f){return ut(f)?Pn(f,Bi):ko(f)?[f]:to(xT(Qt(f)))}function PY(f){var g=++jH;return Qt(f)+g}var TY=Sg(function(f,g){return f+g},0),kY=$v("ceil"),AY=Sg(function(f,g){return f/g},1),OY=$v("floor");function MY(f){return f&&f.length?gg(f,oo,Cv):n}function IY(f,g){return f&&f.length?gg(f,Ge(g,2),Cv):n}function DY(f){return sP(f,oo)}function NY(f,g){return sP(f,Ge(g,2))}function LY(f){return f&&f.length?gg(f,oo,Tv):n}function FY(f,g){return f&&f.length?gg(f,Ge(g,2),Tv):n}var jY=Sg(function(f,g){return f*g},1),$Y=$v("round"),zY=Sg(function(f,g){return f-g},0);function BY(f){return f&&f.length?fv(f,oo):0}function HY(f,g){return f&&f.length?fv(f,Ge(g,2)):0}return B.after=uG,B.ary=OT,B.assign=QG,B.assignIn=UT,B.assignInWith=Ng,B.assignWith=ZG,B.at=JG,B.before=MT,B.bind=Qv,B.bindAll=oY,B.bindKey=IT,B.castArray=SG,B.chain=TT,B.chunk=OW,B.compact=MW,B.concat=IW,B.cond=iY,B.conforms=sY,B.constant=ox,B.countBy=BU,B.create=eq,B.curry=DT,B.curryRight=NT,B.debounce=LT,B.defaults=tq,B.defaultsDeep=nq,B.defer=dG,B.delay=fG,B.difference=DW,B.differenceBy=NW,B.differenceWith=LW,B.drop=FW,B.dropRight=jW,B.dropRightWhile=$W,B.dropWhile=zW,B.fill=BW,B.filter=VU,B.flatMap=GU,B.flatMapDeep=qU,B.flatMapDepth=YU,B.flatten=CT,B.flattenDeep=HW,B.flattenDepth=VW,B.flip=hG,B.flow=lY,B.flowRight=cY,B.fromPairs=WW,B.functions=cq,B.functionsIn=uq,B.groupBy=KU,B.initial=GW,B.intersection=qW,B.intersectionBy=YW,B.intersectionWith=KW,B.invert=fq,B.invertBy=hq,B.invokeMap=QU,B.iteratee=ix,B.keyBy=ZU,B.keys=ar,B.keysIn=ro,B.map=kg,B.mapKeys=gq,B.mapValues=mq,B.matches=uY,B.matchesProperty=dY,B.memoize=Og,B.merge=bq,B.mergeWith=GT,B.method=fY,B.methodOf=hY,B.mixin=sx,B.negate=Mg,B.nthArg=gY,B.omit=yq,B.omitBy=vq,B.once=pG,B.orderBy=JU,B.over=mY,B.overArgs=gG,B.overEvery=bY,B.overSome=yY,B.partial=Zv,B.partialRight=FT,B.partition=eG,B.pick=xq,B.pickBy=qT,B.property=ek,B.propertyOf=vY,B.pull=JW,B.pullAll=RT,B.pullAllBy=eU,B.pullAllWith=tU,B.pullAt=nU,B.range=xY,B.rangeRight=wY,B.rearg=mG,B.reject=rG,B.remove=rU,B.rest=bG,B.reverse=Kv,B.sampleSize=iG,B.set=Sq,B.setWith=_q,B.shuffle=sG,B.slice=oU,B.sortBy=cG,B.sortedUniq=dU,B.sortedUniqBy=fU,B.split=Gq,B.spread=yG,B.tail=hU,B.take=pU,B.takeRight=gU,B.takeRightWhile=mU,B.takeWhile=bU,B.tap=MU,B.throttle=vG,B.thru=Tg,B.toArray=HT,B.toPairs=YT,B.toPairsIn=KT,B.toPath=RY,B.toPlainObject=WT,B.transform=Cq,B.unary=xG,B.union=yU,B.unionBy=vU,B.unionWith=xU,B.uniq=wU,B.uniqBy=SU,B.uniqWith=_U,B.unset=Eq,B.unzip=Xv,B.unzipWith=PT,B.update=Rq,B.updateWith=Pq,B.values=su,B.valuesIn=Tq,B.without=CU,B.words=ZT,B.wrap=wG,B.xor=EU,B.xorBy=RU,B.xorWith=PU,B.zip=TU,B.zipObject=kU,B.zipObjectDeep=AU,B.zipWith=OU,B.entries=YT,B.entriesIn=KT,B.extend=UT,B.extendWith=Ng,sx(B,B),B.add=TY,B.attempt=JT,B.camelCase=Mq,B.capitalize=XT,B.ceil=kY,B.clamp=kq,B.clone=_G,B.cloneDeep=EG,B.cloneDeepWith=RG,B.cloneWith=CG,B.conformsTo=PG,B.deburr=QT,B.defaultTo=aY,B.divide=AY,B.endsWith=Iq,B.eq=yi,B.escape=Dq,B.escapeRegExp=Nq,B.every=HU,B.find=WU,B.findIndex=ST,B.findKey=rq,B.findLast=UU,B.findLastIndex=_T,B.findLastKey=oq,B.floor=OY,B.forEach=kT,B.forEachRight=AT,B.forIn=iq,B.forInRight=sq,B.forOwn=aq,B.forOwnRight=lq,B.get=tx,B.gt=TG,B.gte=kG,B.has=dq,B.hasIn=nx,B.head=ET,B.identity=oo,B.includes=XU,B.indexOf=UW,B.inRange=Aq,B.invoke=pq,B.isArguments=wl,B.isArray=ut,B.isArrayBuffer=AG,B.isArrayLike=no,B.isArrayLikeObject=$n,B.isBoolean=OG,B.isBuffer=ba,B.isDate=MG,B.isElement=IG,B.isEmpty=DG,B.isEqual=NG,B.isEqualWith=LG,B.isError=Jv,B.isFinite=FG,B.isFunction=Os,B.isInteger=jT,B.isLength=Ig,B.isMap=$T,B.isMatch=jG,B.isMatchWith=$G,B.isNaN=zG,B.isNative=BG,B.isNil=VG,B.isNull=HG,B.isNumber=zT,B.isObject=Tn,B.isObjectLike=On,B.isPlainObject=df,B.isRegExp=ex,B.isSafeInteger=WG,B.isSet=BT,B.isString=Dg,B.isSymbol=ko,B.isTypedArray=iu,B.isUndefined=UG,B.isWeakMap=GG,B.isWeakSet=qG,B.join=XW,B.kebabCase=Lq,B.last=ti,B.lastIndexOf=QW,B.lowerCase=Fq,B.lowerFirst=jq,B.lt=YG,B.lte=KG,B.max=MY,B.maxBy=IY,B.mean=DY,B.meanBy=NY,B.min=LY,B.minBy=FY,B.stubArray=lx,B.stubFalse=cx,B.stubObject=SY,B.stubString=_Y,B.stubTrue=CY,B.multiply=jY,B.nth=ZW,B.noConflict=pY,B.noop=ax,B.now=Ag,B.pad=$q,B.padEnd=zq,B.padStart=Bq,B.parseInt=Hq,B.random=Oq,B.reduce=tG,B.reduceRight=nG,B.repeat=Vq,B.replace=Wq,B.result=wq,B.round=$Y,B.runInContext=le,B.sample=oG,B.size=aG,B.snakeCase=Uq,B.some=lG,B.sortedIndex=iU,B.sortedIndexBy=sU,B.sortedIndexOf=aU,B.sortedLastIndex=lU,B.sortedLastIndexBy=cU,B.sortedLastIndexOf=uU,B.startCase=qq,B.startsWith=Yq,B.subtract=zY,B.sum=BY,B.sumBy=HY,B.template=Kq,B.times=EY,B.toFinite=Ms,B.toInteger=pt,B.toLength=VT,B.toLower=Xq,B.toNumber=ni,B.toSafeInteger=XG,B.toString=Qt,B.toUpper=Qq,B.trim=Zq,B.trimEnd=Jq,B.trimStart=eY,B.truncate=tY,B.unescape=nY,B.uniqueId=PY,B.upperCase=rY,B.upperFirst=rx,B.each=kT,B.eachRight=AT,B.first=ET,sx(B,function(){var f={};return $i(B,function(g,S){nn.call(B.prototype,S)||(f[S]=g)}),f}(),{chain:!1}),B.VERSION=r,Xo(["bind","bindKey","curry","curryRight","partial","partialRight"],function(f){B[f].placeholder=B}),Xo(["drop","take"],function(f,g){Dt.prototype[f]=function(S){S=S===n?1:er(pt(S),0);var k=this.__filtered__&&!g?new Dt(this):this.clone();return k.__filtered__?k.__takeCount__=Sr(S,k.__takeCount__):k.__views__.push({size:Sr(S,q),type:f+(k.__dir__<0?"Right":"")}),k},Dt.prototype[f+"Right"]=function(S){return this.reverse()[f](S).reverse()}}),Xo(["filter","map","takeWhile"],function(f,g){var S=g+1,k=S==G||S==H;Dt.prototype[f]=function(N){var W=this.clone();return W.__iteratees__.push({iteratee:Ge(N,3),type:S}),W.__filtered__=W.__filtered__||k,W}}),Xo(["head","last"],function(f,g){var S="take"+(g?"Right":"");Dt.prototype[f]=function(){return this[S](1).value()[0]}}),Xo(["initial","tail"],function(f,g){var S="drop"+(g?"":"Right");Dt.prototype[f]=function(){return this.__filtered__?new Dt(this):this[S](1)}}),Dt.prototype.compact=function(){return this.filter(oo)},Dt.prototype.find=function(f){return this.filter(f).head()},Dt.prototype.findLast=function(f){return this.reverse().find(f)},Dt.prototype.invokeMap=Et(function(f,g){return typeof f=="function"?new Dt(this):this.map(function(S){return of(S,f,g)})}),Dt.prototype.reject=function(f){return this.filter(Mg(Ge(f)))},Dt.prototype.slice=function(f,g){f=pt(f);var S=this;return S.__filtered__&&(f>0||g<0)?new Dt(S):(f<0?S=S.takeRight(-f):f&&(S=S.drop(f)),g!==n&&(g=pt(g),S=g<0?S.dropRight(-g):S.take(g-f)),S)},Dt.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},Dt.prototype.toArray=function(){return this.take(q)},$i(Dt.prototype,function(f,g){var S=/^(?:filter|find|map|reject)|While$/.test(g),k=/^(?:head|last)$/.test(g),N=B[k?"take"+(g=="last"?"Right":""):g],W=k||/^find/.test(g);N&&(B.prototype[g]=function(){var Z=this.__wrapped__,re=k?[1]:arguments,ce=Z instanceof Dt,ve=re[0],we=ce||ut(Z),Ce=function(At){var Lt=N.apply(B,ua([At],re));return k&&De?Lt[0]:Lt};we&&S&&typeof ve=="function"&&ve.length!=1&&(ce=we=!1);var De=this.__chain__,Ve=!!this.__actions__.length,qe=W&&!De,vt=ce&&!Ve;if(!W&&we){Z=vt?Z:new Dt(this);var Ye=f.apply(Z,re);return Ye.__actions__.push({func:Tg,args:[Ce],thisArg:n}),new Zo(Ye,De)}return qe&&vt?f.apply(this,re):(Ye=this.thru(Ce),qe?k?Ye.value()[0]:Ye.value():Ye)})}),Xo(["pop","push","shift","sort","splice","unshift"],function(f){var g=eg[f],S=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",k=/^(?:pop|shift)$/.test(f);B.prototype[f]=function(){var N=arguments;if(k&&!this.__chain__){var W=this.value();return g.apply(ut(W)?W:[],N)}return this[S](function(Z){return g.apply(ut(Z)?Z:[],N)})}}),$i(Dt.prototype,function(f,g){var S=B[g];if(S){var k=S.name+"";nn.call(eu,k)||(eu[k]=[]),eu[k].push({name:g,func:S})}}),eu[wg(n,x).name]=[{name:"wrapper",func:n}],Dt.prototype.clone=nV,Dt.prototype.reverse=rV,Dt.prototype.value=oV,B.prototype.at=IU,B.prototype.chain=DU,B.prototype.commit=NU,B.prototype.next=LU,B.prototype.plant=jU,B.prototype.reverse=$U,B.prototype.toJSON=B.prototype.valueOf=B.prototype.value=zU,B.prototype.first=B.prototype.head,Qd&&(B.prototype[Qd]=FU),B},Qc=NH();hl?((hl.exports=Qc)._=Qc,iv._=Qc):hr._=Qc}).call(Qi)})(gb,gb.exports);var jf=gb.exports;const rc=nl(jf);function xk({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 Z_.forEach(c=>{l[c]||(l[c]=[]);const u=l[c].reduce((d,p)=>Math.max(d,p.y+p.h),0);a.y=a.y===1/0?u:a.y,l[c].push({...a})}),l}function wk(e,t){if(!t)return;const n={...t};return Z_.forEach(r=>{n[r]&&(n[r]=n[r].filter(o=>o.i!==e))}),n}function nC(e){const t=ye.getState().dashboard.globalCacheConfig,{card:n,filter:r}=e;return t}const ye=mN()(_N((e,t)=>({isSessionExpired:!1,currentBreakpoint:"lg",dashboard:{id:"",style:pb},showContext:!1,selectedSheetId:null,selectedCardId:null,selectedFrameId:null,selectedCard:null,showFilters:!1,isDashboardEditing:!1,isVisualEditing:!1,showDashboardJSON:!1,filteringCards:[],actions:{setInitStore:()=>{e(n=>{n.isSessionExpired=!1,n.currentBreakpoint="lg",n.dashboard={id:"",style:pb},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})},setIsDownloadingPdf:n=>{e(r=>{r.isDownloadingPdf=n})},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,p;const o=(i=r.dashboard.sheets)==null?void 0:i.findIndex(h=>h.id===n);if(o!==void 0&&o>-1){(s=r.dashboard.sheets)==null||s.splice(o,1);const h=(a=r.dashboard.filters)==null?void 0:a.filter(b=>b.sheetId===n),m=(l=r.filterValues)==null?void 0:l.filter(b=>h==null?void 0:h.some(v=>v.id===b.filterId));r.filterValues=(c=r.filterValues)==null?void 0:c.filter(b=>!(m!=null&&m.some(v=>v.filterId===b.filterId))),r.dashboard.filters=(u=r.dashboard.filters)==null?void 0:u.filter(b=>b.sheetId!==n),r.selectedSheetId=(p=(d=r.dashboard.sheets)==null?void 0:d[0])==null?void 0:p.id}})},addSheet:n=>{e(r=>{r.dashboard.sheets||(r.dashboard.sheets=[]);const o=r.dashboard.filters;let i={};o==null||o.forEach(a=>{Z_.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})},addToAIScope:n=>{e(r=>{const{connectionId:o,connectionType:i,databaseName:s,schemaName:a,tableName:l,datamodelName:c}=n,u={connectionId:o||"",connectionType:i||"",databaseName:s||"",schemaName:a||"",tableName:l||"",datamodelName:c||""};let p=[...r.dashboard.aiScopeTables||[],u];p=p.filter((h,m,b)=>b.findIndex(v=>v.tableName===h.tableName&&v.datamodelName===h.datamodelName)===m),r.dashboard.aiScopeTables=p})},removeFromAIScope:n=>{e(r=>{const{connectionId:o,tableName:i,datamodelName:s}=n,a=r.dashboard.aiScopeTables||[];if(s){const l=a.filter(c=>!(c.datamodelName===s&&c.connectionId===o));r.dashboard.aiScopeTables=l}else if(i){const l=a.filter(c=>!(c.tableName===i&&c.connectionId===o));r.dashboard.aiScopeTables=l}})},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&&jf.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&&jf.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(p=>p.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&&jf.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&&jf.forEach(s.frames,c=>{var d;const u=(d=c.cards)==null?void 0:d.find(p=>p.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(p=>p.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})},removeFilterValues: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=>{xk({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=wk(n,c.layouts);c.layouts=u})}}})},updateFrameCard:(n,r,o)=>{e(i=>{var l,c,u,d,p;const s=(c=(l=i.dashboard)==null?void 0:l.sheets)==null?void 0:c.find(h=>h.id===n);if(!s)return;const a=(u=s==null?void 0:s.frames)==null?void 0:u.find(h=>h.id===r);if(a){const h=(d=a.cards)==null?void 0:d.findIndex(m=>m.id===o.id);h>-1&&((p=a.cards)==null||p.splice(h,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))}})},updateFilterId:(n,r)=>{e(o=>{var a,l;const i=(a=o.dashboard.filters)==null?void 0:a.find(c=>c.id===n),s=(l=o.dashboard.filters)==null?void 0:l.some(c=>c.id===r);i&&!s&&(i.id=r)})},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 p=0;o==="start"&&(d=0);const h=xk({id:r.id,layouts:s.layouts,minH:10,x:p,y:d});s.layouts=h,(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(p=>p.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),wk(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(p=>p.id===n),s=(c=i==null?void 0:i.frames)==null?void 0:c.findIndex(p=>p.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(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,r),(d=o.onUpdateCard)==null||d.call(o,r,n))})},removeCard:(n,r)=>{e(o=>{var a,l,c,u,d,p;const i=(l=(a=o.dashboard)==null?void 0:a.sheets)==null?void 0:l.find(h=>h.id===n),s=(c=i==null?void 0:i.cards)==null?void 0:c.findIndex(h=>h.id===r.id);i&&((u=i.cards)==null||u.splice(s,1),(d=i.layout)==null||d.splice(s,1),(p=o.onRemoveCard)==null||p.call(o,r,n))})},setStyle:n=>{e(r=>{r.dashboard&&(r.dashboard.style=n)})},setSelectedCardId:(n,r)=>{e(o=>{var s,a,l;const i=(a=(s=o.dashboard)==null?void 0:s.sheets)==null?void 0:a.find(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)=>{hX({card:n,dataPoint:r,get:t})}}}))),Hn=()=>ye(e=>e.actions);async function pX(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 TN(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),p=>p.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 p=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:l},s,d);return{decryptedData:o.decode(p)}}catch(p){throw new Error(`Decryption failed: ${p}`)}}function me(...e){return EK(od(e))}const gX=e=>Object.keys(e).length===0;async function mX(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 R0(e,t,n={}){try{const r=JSON.stringify(n),o=await pX(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 TN(s.payload,t);return JSON.parse(a.decryptedData)}return s}catch(r){throw console.error("Error during fetch:",r),r}}function bX(e){if(!e)return{tenantId:"",endUserId:""};const t=U_(e);return{tenantId:t==null?void 0:t.tenantId,endUserId:t==null?void 0:t.endUserId}}function yX(e){if(!e)return;const t=U_(e);if(t.params&&t.params.currencyFormat)return t.params.currencyFormat}function kN(e){return e?U_(e).params:void 0}function vX(e){return e.charAt(0).toUpperCase()+e.slice(1)}const nh="focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";async function xX(){var o,i;const e=(i=(o=ye.getState())==null?void 0:o.authToken)==null?void 0:i.accessToken;if(!e)return;const n=await fetch("https://semaphor.cloud/api/v1/invalidate-token",{method:"POST",headers:{Authorization:`Bearer ${e}`}});if(!n.ok)throw new Error("Failed to invalidate token");const r=await n.json();return console.log("invalidateToken",r),r}async function wX(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();o&&(n+=`?${o}`);let s=await(await fetch(n,{headers:{Authorization:`Bearer ${e}`}})).json();if("payload"in s){const a=await TN(atob(s.payload),e);s=JSON.parse(a.decryptedData)}return s}async function SX(e){return e?await(await fetch("https://semaphor.cloud/api/v1/plugins",{headers:{Authorization:`Bearer ${e}`}})).json():null}const _X={theme:"system",setTheme:()=>null},AN=T.createContext(_X);function CX({children:e,defaultTheme:t="system",storageKey:n="vite-ui-theme",...r}){const[o,i]=T.useState(()=>localStorage.getItem(n)||t);T.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 y.jsx(AN.Provider,{...r,value:s,children:e})}const ON=()=>{const e=T.useContext(AN);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e};var dp=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(){}},wc=typeof window>"u"||"Deno"in globalThis;function ii(){}function EX(e,t){return typeof e=="function"?e(t):e}function C1(e){return typeof e=="number"&&e>=0&&e!==1/0}function MN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Mu(e,t){return typeof e=="function"?e(t):e}function Ri(e,t){return typeof e=="function"?e(t):e}function Sk(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==rC(s,t.options))return!1}else if(!Th(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 _k(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Ph(t.options.mutationKey)!==Ph(i))return!1}else if(!Th(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function rC(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ph)(e)}function Ph(e){return JSON.stringify(e,(t,n)=>P1(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Th(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Th(e[n],t[n])):!1}function E1(e,t){if(e===t)return e;const n=Ck(e)&&Ck(t);if(n||P1(e)&&P1(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]=E1(e[u],t[u]),a[u]===e[u]&&e[u]!==void 0&&l++)}return o===s&&l===o?e:a}return t}function R1(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 Ck(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function P1(e){if(!Ek(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ek(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ek(e){return Object.prototype.toString.call(e)==="[object Object]"}function RX(e){return new Promise(t=>{setTimeout(t,e)})}function T1(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 E1(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 E1(e,t)}return t}function PX(e){return e}function TX(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function kX(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var mb=Symbol();function IN(e,t){return process.env.NODE_ENV!=="production"&&e.queryFn===mb&&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===mb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Kl,Ta,Uu,JD,AX=(JD=class extends dp{constructor(){super();Je(this,Kl);Je(this,Ta);Je(this,Uu);Be(this,Uu,t=>{if(!wc&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){se(this,Ta)||this.setEventListener(se(this,Uu))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,Ta))==null||t.call(this),Be(this,Ta,void 0))}setEventListener(t){var n;Be(this,Uu,t),(n=se(this,Ta))==null||n.call(this),Be(this,Ta,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){se(this,Kl)!==t&&(Be(this,Kl,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof se(this,Kl)=="boolean"?se(this,Kl):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Kl=new WeakMap,Ta=new WeakMap,Uu=new WeakMap,JD),oC=new AX,Gu,ka,qu,eN,OX=(eN=class extends dp{constructor(){super();Je(this,Gu,!0);Je(this,ka);Je(this,qu);Be(this,qu,t=>{if(!wc&&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(){se(this,ka)||this.setEventListener(se(this,qu))}onUnsubscribe(){var t;this.hasListeners()||((t=se(this,ka))==null||t.call(this),Be(this,ka,void 0))}setEventListener(t){var n;Be(this,qu,t),(n=se(this,ka))==null||n.call(this),Be(this,ka,t(this.setOnline.bind(this)))}setOnline(t){se(this,Gu)!==t&&(Be(this,Gu,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return se(this,Gu)}},Gu=new WeakMap,ka=new WeakMap,qu=new WeakMap,eN),bb=new OX;function k1(){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 MX(e){return Math.min(1e3*2**e,3e4)}function DN(e){return(e??"online")==="online"?bb.isOnline():!0}var NN=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function vx(e){return e instanceof NN}function LN(e){let t=!1,n=0,r=!1,o;const i=k1(),s=b=>{var v;r||(p(new NN(b)),(v=e.abort)==null||v.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>oC.isFocused()&&(e.networkMode==="always"||bb.isOnline())&&e.canRun(),u=()=>DN(e.networkMode)&&e.canRun(),d=b=>{var v;r||(r=!0,(v=e.onSuccess)==null||v.call(e,b),o==null||o(),i.resolve(b))},p=b=>{var v;r||(r=!0,(v=e.onError)==null||v.call(e,b),o==null||o(),i.reject(b))},h=()=>new Promise(b=>{var v;o=x=>{(r||c())&&b(x)},(v=e.onPause)==null||v.call(e)}).then(()=>{var b;o=void 0,r||(b=e.onContinue)==null||b.call(e)}),m=()=>{if(r)return;let b;const v=n===0?e.initialPromise:void 0;try{b=v??e.fn()}catch(x){b=Promise.reject(x)}Promise.resolve(b).then(d).catch(x=>{var E;if(r)return;const w=e.retry??(wc?0:3),_=e.retryDelay??MX,R=typeof _=="function"?_(n,x):_,C=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,x);if(t||!C){p(x);return}n++,(E=e.onFail)==null||E.call(e,n,x),RX(R).then(()=>c()?void 0:h()).then(()=>{t?p(x):m()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?m():h().then(m),i)}}function IX(){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 br=IX(),Xl,tN,FN=(tN=class{constructor(){Je(this,Xl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),C1(this.gcTime)&&Be(this,Xl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(wc?1/0:5*60*1e3))}clearGcTimeout(){se(this,Xl)&&(clearTimeout(se(this,Xl)),Be(this,Xl,void 0))}},Xl=new WeakMap,tN),Yu,Ku,oi,Ql,Pr,sp,Zl,Ci,js,nN,DX=(nN=class extends FN{constructor(t){super();Je(this,Ci);Je(this,Yu);Je(this,Ku);Je(this,oi);Je(this,Ql);Je(this,Pr);Je(this,sp);Je(this,Zl);Be(this,Zl,!1),Be(this,sp,t.defaultOptions),this.setOptions(t.options),this.observers=[],Be(this,Ql,t.client),Be(this,oi,se(this,Ql).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Be(this,Yu,NX(this.options)),this.state=t.state??se(this,Yu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=se(this,Pr))==null?void 0:t.promise}setOptions(t){this.options={...se(this,sp),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&se(this,oi).remove(this)}setData(t,n){const r=T1(this.state.data,t,this.options);return Ft(this,Ci,js).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ft(this,Ci,js).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=se(this,Pr))==null?void 0:r.promise;return(o=se(this,Pr))==null||o.cancel(t),n?n.then(ii).catch(ii):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(se(this,Yu))}isActive(){return this.observers.some(t=>Ri(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mb||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||!MN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=se(this,Pr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=se(this,Pr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),se(this,oi).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(se(this,Pr)&&(se(this,Zl)?se(this,Pr).cancel({revert:!0}):se(this,Pr).cancelRetry()),this.scheduleGc()),se(this,oi).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ft(this,Ci,js).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(se(this,Pr))return se(this,Pr).continueRetry(),se(this,Pr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(p=>p.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:()=>(Be(this,Zl,!0),r.signal)})},i=()=>{const d=IN(this.options,n),p={client:se(this,Ql),queryKey:this.queryKey,meta:this.meta};return o(p),Be(this,Zl,!1),this.options.persister?this.options.persister(d,p,this):d(p)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:se(this,Ql),state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),Be(this,Ku,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=s.fetchOptions)==null?void 0:c.meta))&&Ft(this,Ci,js).call(this,{type:"fetch",meta:(u=s.fetchOptions)==null?void 0:u.meta});const a=d=>{var p,h,m,b;vx(d)&&d.silent||Ft(this,Ci,js).call(this,{type:"error",error:d}),vx(d)||((h=(p=se(this,oi).config).onError)==null||h.call(p,d,this),(b=(m=se(this,oi).config).onSettled)==null||b.call(m,this.state.data,d,this)),this.scheduleGc()};return Be(this,Pr,LN({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var p,h,m,b;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(v){a(v);return}(h=(p=se(this,oi).config).onSuccess)==null||h.call(p,d,this),(b=(m=se(this,oi).config).onSettled)==null||b.call(m,d,this.state.error,this),this.scheduleGc()},onError:a,onFail:(d,p)=>{Ft(this,Ci,js).call(this,{type:"failed",failureCount:d,error:p})},onPause:()=>{Ft(this,Ci,js).call(this,{type:"pause"})},onContinue:()=>{Ft(this,Ci,js).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),se(this,Pr).start()}},Yu=new WeakMap,Ku=new WeakMap,oi=new WeakMap,Ql=new WeakMap,Pr=new WeakMap,sp=new WeakMap,Zl=new WeakMap,Ci=new WeakSet,js=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,...jN(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 vx(o)&&o.revert&&se(this,Ku)?{...se(this,Ku),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),br.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),se(this,oi).notify({query:this,type:"updated",action:t})})},nN);function jN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:DN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function NX(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 qi,rN,$N=(rN=class extends dp{constructor(t={}){super();Je(this,qi);this.config=t,Be(this,qi,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??rC(o,n);let s=this.get(i);return s||(s=new DX({client:t,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){se(this,qi).has(t.queryHash)||(se(this,qi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=se(this,qi).get(t.queryHash);n&&(t.destroy(),n===t&&se(this,qi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){br.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return se(this,qi).get(t)}getAll(){return[...se(this,qi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Sk(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Sk(t,r)):n}notify(t){br.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){br.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){br.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},qi=new WeakMap,rN),Yi,Vr,Jl,Ki,Ca,oN,LX=(oN=class extends FN{constructor(t){super();Je(this,Ki);Je(this,Yi);Je(this,Vr);Je(this,Jl);this.mutationId=t.mutationId,Be(this,Vr,t.mutationCache),Be(this,Yi,[]),this.state=t.state||FX(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){se(this,Yi).includes(t)||(se(this,Yi).push(t),this.clearGcTimeout(),se(this,Vr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Be(this,Yi,se(this,Yi).filter(n=>n!==t)),this.scheduleGc(),se(this,Vr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){se(this,Yi).length||(this.state.status==="pending"?this.scheduleGc():se(this,Vr).remove(this))}continue(){var t;return((t=se(this,Jl))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,c,u,d,p,h,m,b,v,x,w,_,R,C,E,A;Be(this,Jl,LN({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(M,D)=>{Ft(this,Ki,Ca).call(this,{type:"failed",failureCount:M,error:D})},onPause:()=>{Ft(this,Ki,Ca).call(this,{type:"pause"})},onContinue:()=>{Ft(this,Ki,Ca).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>se(this,Vr).canRun(this)}));const n=this.state.status==="pending",r=!se(this,Jl).canStart();try{if(!n){Ft(this,Ki,Ca).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=se(this,Vr).config).onMutate)==null?void 0:i.call(o,t,this));const D=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));D!==this.state.context&&Ft(this,Ki,Ca).call(this,{type:"pending",context:D,variables:t,isPaused:r})}const M=await se(this,Jl).start();return await((c=(l=se(this,Vr).config).onSuccess)==null?void 0:c.call(l,M,t,this.state.context,this)),await((d=(u=this.options).onSuccess)==null?void 0:d.call(u,M,t,this.state.context)),await((h=(p=se(this,Vr).config).onSettled)==null?void 0:h.call(p,M,null,this.state.variables,this.state.context,this)),await((b=(m=this.options).onSettled)==null?void 0:b.call(m,M,null,t,this.state.context)),Ft(this,Ki,Ca).call(this,{type:"success",data:M}),M}catch(M){try{throw await((x=(v=se(this,Vr).config).onError)==null?void 0:x.call(v,M,t,this.state.context,this)),await((_=(w=this.options).onError)==null?void 0:_.call(w,M,t,this.state.context)),await((C=(R=se(this,Vr).config).onSettled)==null?void 0:C.call(R,void 0,M,this.state.variables,this.state.context,this)),await((A=(E=this.options).onSettled)==null?void 0:A.call(E,void 0,M,t,this.state.context)),M}finally{Ft(this,Ki,Ca).call(this,{type:"error",error:M})}}finally{se(this,Vr).runNext(this)}}},Yi=new WeakMap,Vr=new WeakMap,Jl=new WeakMap,Ki=new WeakSet,Ca=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),br.batch(()=>{se(this,Yi).forEach(r=>{r.onMutationUpdate(t)}),se(this,Vr).notify({mutation:this,type:"updated",action:t})})},oN);function FX(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Us,Ei,ap,iN,jX=(iN=class extends dp{constructor(t={}){super();Je(this,Us);Je(this,Ei);Je(this,ap);this.config=t,Be(this,Us,new Set),Be(this,Ei,new Map),Be(this,ap,0)}build(t,n,r){const o=new LX({mutationCache:this,mutationId:++Lg(this,ap)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){se(this,Us).add(t);const n=$g(t);if(typeof n=="string"){const r=se(this,Ei).get(n);r?r.push(t):se(this,Ei).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(se(this,Us).delete(t)){const n=$g(t);if(typeof n=="string"){const r=se(this,Ei).get(n);if(r)if(r.length>1){const o=r.indexOf(t);o!==-1&&r.splice(o,1)}else r[0]===t&&se(this,Ei).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=$g(t);if(typeof n=="string"){const r=se(this,Ei).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=$g(t);if(typeof n=="string"){const o=(r=se(this,Ei).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(){br.batch(()=>{se(this,Us).forEach(t=>{this.notify({type:"removed",mutation:t})}),se(this,Us).clear(),se(this,Ei).clear()})}getAll(){return Array.from(se(this,Us))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>_k(n,r))}findAll(t={}){return this.getAll().filter(n=>_k(t,n))}notify(t){br.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return br.batch(()=>Promise.all(t.map(n=>n.continue().catch(ii))))}},Us=new WeakMap,Ei=new WeakMap,ap=new WeakMap,iN);function $g(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Rk(e){return{onFetch:(t,n)=>{var u,d,p,h,m;const r=t.options,o=(p=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:p.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],s=((m=t.state.data)==null?void 0:m.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let b=!1;const v=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(t.signal.aborted?b=!0:t.signal.addEventListener("abort",()=>{b=!0}),t.signal)})},x=IN(t.options,t.fetchOptions),w=async(_,R,C)=>{if(b)return Promise.reject();if(R==null&&_.pages.length)return Promise.resolve(_);const E={client:t.client,queryKey:t.queryKey,pageParam:R,direction:C?"backward":"forward",meta:t.options.meta};v(E);const A=await x(E),{maxPages:M}=t.options,D=C?kX:TX;return{pages:D(_.pages,A,M),pageParams:D(_.pageParams,R,M)}};if(o&&i.length){const _=o==="backward",R=_?$X:Pk,C={pages:i,pageParams:s},E=R(r,C);a=await w(C,E,_)}else{const _=e??i.length;do{const R=l===0?s[0]??r.initialPageParam:Pk(r,a);if(l>0&&R==null)break;a=await w(a,R),l++}while(l<_)}return a};t.options.persister?t.fetchFn=()=>{var b,v;return(v=(b=t.options).persister)==null?void 0:v.call(b,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Pk(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 $X(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 Mn,Aa,Oa,Xu,Qu,Ma,Zu,Ju,sN,zX=(sN=class{constructor(e={}){Je(this,Mn);Je(this,Aa);Je(this,Oa);Je(this,Xu);Je(this,Qu);Je(this,Ma);Je(this,Zu);Je(this,Ju);Be(this,Mn,e.queryCache||new $N),Be(this,Aa,e.mutationCache||new jX),Be(this,Oa,e.defaultOptions||{}),Be(this,Xu,new Map),Be(this,Qu,new Map),Be(this,Ma,0)}mount(){Lg(this,Ma)._++,se(this,Ma)===1&&(Be(this,Zu,oC.subscribe(async e=>{e&&(await this.resumePausedMutations(),se(this,Mn).onFocus())})),Be(this,Ju,bb.subscribe(async e=>{e&&(await this.resumePausedMutations(),se(this,Mn).onOnline())})))}unmount(){var e,t;Lg(this,Ma)._--,se(this,Ma)===0&&((e=se(this,Zu))==null||e.call(this),Be(this,Zu,void 0),(t=se(this,Ju))==null||t.call(this),Be(this,Ju,void 0))}isFetching(e){return se(this,Mn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return se(this,Aa).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=se(this,Mn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=se(this,Mn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Mu(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return se(this,Mn).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=se(this,Mn).get(r.queryHash),i=o==null?void 0:o.state.data,s=EX(t,i);if(s!==void 0)return se(this,Mn).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return br.batch(()=>se(this,Mn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=se(this,Mn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=se(this,Mn);br.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=se(this,Mn);return br.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=br.batch(()=>se(this,Mn).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(ii).catch(ii)}invalidateQueries(e,t={}){return br.batch(()=>(se(this,Mn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=br.batch(()=>se(this,Mn).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(ii)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(ii)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=se(this,Mn).build(this,t);return n.isStaleByTime(Mu(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ii).catch(ii)}fetchInfiniteQuery(e){return e.behavior=Rk(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ii).catch(ii)}ensureInfiniteQueryData(e){return e.behavior=Rk(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return bb.isOnline()?se(this,Aa).resumePausedMutations():Promise.resolve()}getQueryCache(){return se(this,Mn)}getMutationCache(){return se(this,Aa)}getDefaultOptions(){return se(this,Oa)}setDefaultOptions(e){Be(this,Oa,e)}setQueryDefaults(e,t){se(this,Xu).set(Ph(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...se(this,Xu).values()],n={};return t.forEach(r=>{Th(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){se(this,Qu).set(Ph(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...se(this,Qu).values()],n={};return t.forEach(r=>{Th(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...se(this,Oa).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=rC(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===mb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...se(this,Oa).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){se(this,Mn).clear(),se(this,Aa).clear()}},Mn=new WeakMap,Aa=new WeakMap,Oa=new WeakMap,Xu=new WeakMap,Qu=new WeakMap,Ma=new WeakMap,Zu=new WeakMap,Ju=new WeakMap,sN),fo,jt,lp,Wr,ec,ed,Ia,Xi,cp,td,nd,tc,nc,Da,rd,tn,$f,A1,O1,M1,I1,D1,N1,L1,zN,aN,BX=(aN=class extends dp{constructor(t,n){super();Je(this,tn);Je(this,fo);Je(this,jt);Je(this,lp);Je(this,Wr);Je(this,ec);Je(this,ed);Je(this,Ia);Je(this,Xi);Je(this,cp);Je(this,td);Je(this,nd);Je(this,tc);Je(this,nc);Je(this,Da);Je(this,rd,new Set);this.options=n,Be(this,fo,t),Be(this,Xi,null),Be(this,Ia,k1()),this.options.experimental_prefetchInRender||se(this,Ia).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&&(se(this,jt).addObserver(this),Tk(se(this,jt),this.options)?Ft(this,tn,$f).call(this):this.updateResult(),Ft(this,tn,I1).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return F1(se(this,jt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return F1(se(this,jt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ft(this,tn,D1).call(this),Ft(this,tn,N1).call(this),se(this,jt).removeObserver(this)}setOptions(t,n){const r=this.options,o=se(this,jt);if(this.options=se(this,fo).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ri(this.options.enabled,se(this,jt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ft(this,tn,L1).call(this),se(this,jt).setOptions(this.options),r._defaulted&&!R1(this.options,r)&&se(this,fo).getQueryCache().notify({type:"observerOptionsUpdated",query:se(this,jt),observer:this});const i=this.hasListeners();i&&kk(se(this,jt),o,this.options,r)&&Ft(this,tn,$f).call(this),this.updateResult(n),i&&(se(this,jt)!==o||Ri(this.options.enabled,se(this,jt))!==Ri(r.enabled,se(this,jt))||Mu(this.options.staleTime,se(this,jt))!==Mu(r.staleTime,se(this,jt)))&&Ft(this,tn,A1).call(this);const s=Ft(this,tn,O1).call(this);i&&(se(this,jt)!==o||Ri(this.options.enabled,se(this,jt))!==Ri(r.enabled,se(this,jt))||s!==se(this,Da))&&Ft(this,tn,M1).call(this,s)}getOptimisticResult(t){const n=se(this,fo).getQueryCache().build(se(this,fo),t),r=this.createResult(n,t);return VX(this,r)&&(Be(this,Wr,r),Be(this,ed,this.options),Be(this,ec,se(this,jt).state)),r}getCurrentResult(){return se(this,Wr)}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){se(this,rd).add(t)}getCurrentQuery(){return se(this,jt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=se(this,fo).defaultQueryOptions(t),r=se(this,fo).getQueryCache().build(se(this,fo),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ft(this,tn,$f).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),se(this,Wr)))}createResult(t,n){var M;const r=se(this,jt),o=this.options,i=se(this,Wr),s=se(this,ec),a=se(this,ed),c=t!==r?t.state:se(this,lp),{state:u}=t;let d={...u},p=!1,h;if(n._optimisticResults){const D=this.hasListeners(),L=!D&&Tk(t,n),j=D&&kk(t,r,n,o);(L||j)&&(d={...d,...jN(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:m,errorUpdatedAt:b,status:v}=d;if(n.select&&d.data!==void 0)if(i&&d.data===(s==null?void 0:s.data)&&n.select===se(this,cp))h=se(this,td);else try{Be(this,cp,n.select),h=n.select(d.data),h=T1(i==null?void 0:i.data,h,n),Be(this,td,h),Be(this,Xi,null)}catch(D){Be(this,Xi,D)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&v==="pending"){let D;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))D=i.data;else if(D=typeof n.placeholderData=="function"?n.placeholderData((M=se(this,nd))==null?void 0:M.state.data,se(this,nd)):n.placeholderData,n.select&&D!==void 0)try{D=n.select(D),Be(this,Xi,null)}catch(L){Be(this,Xi,L)}D!==void 0&&(v="success",h=T1(i==null?void 0:i.data,D,n),p=!0)}se(this,Xi)&&(m=se(this,Xi),h=se(this,td),b=Date.now(),v="error");const x=d.fetchStatus==="fetching",w=v==="pending",_=v==="error",R=w&&x,C=h!==void 0,A={status:v,fetchStatus:d.fetchStatus,isPending:w,isSuccess:v==="success",isError:_,isInitialLoading:R,isLoading:R,data:h,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:b,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:x,isRefetching:x&&!w,isLoadingError:_&&!C,isPaused:d.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:_&&C,isStale:iC(t,n),refetch:this.refetch,promise:se(this,Ia)};if(this.options.experimental_prefetchInRender){const D=z=>{A.status==="error"?z.reject(A.error):A.data!==void 0&&z.resolve(A.data)},L=()=>{const z=Be(this,Ia,A.promise=k1());D(z)},j=se(this,Ia);switch(j.status){case"pending":t.queryHash===r.queryHash&&D(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=se(this,Wr),r=this.createResult(se(this,jt),this.options);if(Be(this,ec,se(this,jt).state),Be(this,ed,this.options),se(this,ec).data!==void 0&&Be(this,nd,se(this,jt)),R1(r,n))return;Be(this,Wr,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!se(this,rd).size)return!0;const l=new Set(a??se(this,rd));return this.options.throwOnError&&l.add("error"),Object.keys(se(this,Wr)).some(c=>{const u=c;return se(this,Wr)[u]!==n[u]&&l.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),Ft(this,tn,zN).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ft(this,tn,I1).call(this)}},fo=new WeakMap,jt=new WeakMap,lp=new WeakMap,Wr=new WeakMap,ec=new WeakMap,ed=new WeakMap,Ia=new WeakMap,Xi=new WeakMap,cp=new WeakMap,td=new WeakMap,nd=new WeakMap,tc=new WeakMap,nc=new WeakMap,Da=new WeakMap,rd=new WeakMap,tn=new WeakSet,$f=function(t){Ft(this,tn,L1).call(this);let n=se(this,jt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(ii)),n},A1=function(){Ft(this,tn,D1).call(this);const t=Mu(this.options.staleTime,se(this,jt));if(wc||se(this,Wr).isStale||!C1(t))return;const r=MN(se(this,Wr).dataUpdatedAt,t)+1;Be(this,tc,setTimeout(()=>{se(this,Wr).isStale||this.updateResult()},r))},O1=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(se(this,jt)):this.options.refetchInterval)??!1},M1=function(t){Ft(this,tn,N1).call(this),Be(this,Da,t),!(wc||Ri(this.options.enabled,se(this,jt))===!1||!C1(se(this,Da))||se(this,Da)===0)&&Be(this,nc,setInterval(()=>{(this.options.refetchIntervalInBackground||oC.isFocused())&&Ft(this,tn,$f).call(this)},se(this,Da)))},I1=function(){Ft(this,tn,A1).call(this),Ft(this,tn,M1).call(this,Ft(this,tn,O1).call(this))},D1=function(){se(this,tc)&&(clearTimeout(se(this,tc)),Be(this,tc,void 0))},N1=function(){se(this,nc)&&(clearInterval(se(this,nc)),Be(this,nc,void 0))},L1=function(){const t=se(this,fo).getQueryCache().build(se(this,fo),this.options);if(t===se(this,jt))return;const n=se(this,jt);Be(this,jt,t),Be(this,lp,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},zN=function(t){br.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(se(this,Wr))}),se(this,fo).getQueryCache().notify({query:se(this,jt),type:"observerResultsUpdated"})})},aN);function HX(e,t){return Ri(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Tk(e,t){return HX(e,t)||e.state.data!==void 0&&F1(e,t,t.refetchOnMount)}function F1(e,t,n){if(Ri(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&iC(e,t)}return!1}function kk(e,t,n,r){return(e!==t||Ri(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&iC(e,n)}function iC(e,t){return Ri(t.enabled,e)!==!1&&e.isStaleByTime(Mu(t.staleTime,e))}function VX(e,t){return!R1(e.getCurrentResult(),t)}var sC=P.createContext(void 0),aC=e=>{const t=P.useContext(sC);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},WX=({client:e,children:t})=>(P.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),y.jsx(sC.Provider,{value:e,children:t})),BN=P.createContext(!1),UX=()=>P.useContext(BN);BN.Provider;function GX(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var qX=P.createContext(GX()),YX=()=>P.useContext(qX);function KX(e,t){return typeof e=="function"?e(...t):!!e}function Ak(){}var XX=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},QX=e=>{P.useEffect(()=>{e.clearReset()},[e])},ZX=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(o&&e.data===void 0||KX(n,[e.error,r])),JX=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)))},eQ=(e,t)=>e.isLoading&&e.isFetching&&!t,tQ=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Ok=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function nQ(e,t,n){var d,p,h,m,b;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=aC(),o=UX(),i=YX(),s=r.defaultQueryOptions(e);(p=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||p.call(d,s),process.env.NODE_ENV!=="production"&&(s.queryFn||console.error(`[${s.queryHash}]: No queryFn was passed as an option, and no default queryFn was found. The queryFn parameter is only optional when using a default queryFn. More info here: https://tanstack.com/query/latest/docs/framework/react/guides/default-query-function`)),s._optimisticResults=o?"isRestoring":"optimistic",JX(s),XX(s,i),QX(i);const a=!r.getQueryCache().get(s.queryHash),[l]=P.useState(()=>new t(r,s)),c=l.getOptimisticResult(s),u=!o&&e.subscribed!==!1;if(P.useSyncExternalStore(P.useCallback(v=>{const x=u?l.subscribe(br.batchCalls(v)):Ak;return l.updateResult(),x},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),P.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),tQ(s,c))throw Ok(s,l,i);if(ZX({result:c,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash),suspense:s.suspense}))throw c.error;if((m=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||m.call(h,s,c),s.experimental_prefetchInRender&&!wc&&eQ(c,o)){const v=a?Ok(s,l,i):(b=r.getQueryCache().get(s.queryHash))==null?void 0:b.promise;v==null||v.catch(Ak).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?c:l.trackResult(c)}function fp(e,t){return nQ(e,BX)}function rQ(){const e=T.useContext(sC);if(e&&e.isSemaphorClient)return e}function HN({children:e}){const{setIsSessionExpired:t}=Hn(),n=rQ(),[r]=T.useState(()=>{const o=new zX({queryCache:new $N({onError:i=>{i instanceof Error?(console.error(`Something went wrong: ${i.message}`),i.message==="invalid token"&&t(!0)):console.error("Something went wrong:",i)}}),defaultOptions:{queries:{gcTime:36e5,staleTime:3e5,refetchOnWindowFocus:!1,retry:1}}});return o.isSemaphorClient=!0,o});return n?y.jsx(y.Fragment,{children:e}):y.jsx(WX,{client:r,children:e})}const Nc=T.forwardRef(({children:e,className:t,...n},r)=>y.jsx("div",{className:me("semaphor-scope",t),ref:r,...n,children:e})),oQ={id:"",authToken:void 0},VN=T.createContext(oQ),WN=({children:e,dashboardProps:t})=>y.jsx(HN,{children:y.jsx(VN.Provider,{value:t,children:y.jsx(Nc,{style:{height:"100%"},children:e})})});function Go(){const e=T.useContext(VN);if(e===void 0)throw new Error("useApplicationContext must be used within a ApplicationContextProvider");return e}function iQ(){const{authToken:e,version:t}=Go(),n=ye(a=>a.selectedLensId),{data:r,isLoading:o,isFetching:i,isError:s}=fp({queryKey:["dashboard",n,e==null?void 0:e.accessToken],queryFn:()=>wX(e==null?void 0:e.accessToken,{lensId:n,version:t}),enabled:!!(e!=null&&e.accessToken)});return{data:r,isLoading:o,isFetching:i,isError:s}}function sQ(){const{authToken:e}=Go(),t=ye(r=>r.authToken),{setAuthToken:n}=Hn();return T.useEffect(()=>{e&&(e==null?void 0:e.toString())!==(t==null?void 0:t.toString())&&n(e)},[e,t,n]),e}function UN(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function Mk(e,t){const n=UN(e);return n==="dark"?rc.merge({...t==null?void 0:t.default},{...t==null?void 0:t.dark}):t==null?void 0:t.default}function aQ({customStyle:e,currentTheme:t,onSave:n,onEvent:r,defaultFilterValues:o,selectedSheetId:i,onFilterValuesChange:s}){const{authToken:a}=Go();sQ();const l=ye(H=>H.selectedLensId),{data:c,isLoading:u,isFetching:d,isError:p}=iQ(),[h,m]=T.useState(o||[]),{theme:b,setTheme:v}=ON(),x=ye(H=>H.dashboard.globalStyle),{setDashboard:w,setDashboardWithFilterValues:_,setSelectedSheetId:R,setStyle:C,setOnSaveFunction:E,setLenses:A,setSelectedLensId:M,setInitStore:D}=Hn();ye(H=>H.actions.setCustomCards);const L=ye(H=>H.actions.setFilterValues),j=ye(H=>H.filterValues),z=ye(H=>H.actions.setThemeStyle),Q=ye(H=>H.actions.setDashboardTheme),G=ye(H=>H.actions.setOnEvent);T.useEffect(()=>{a&&D()},[a,D]),T.useEffect(()=>{if(b){const H=UN(b);Q(H)}},[b,Q]),T.useEffect(()=>{t&&v(t)},[t,v]);const F=T.useCallback(()=>{const H=rc.cloneDeep(pb),$=rc.merge(H,x);if(e){const V=rc.merge($,e),X=Mk(b,V);z(X),C(V)}else{const V=Mk(b,$);z(V),C(pb)}},[b,e,x,z,C]);return T.useEffect(()=>{c&&c.dashboard&&F()},[b,e,x,F,c]),T.useEffect(()=>{var U,O;function H(ee,K){const oe=ee.filters||[],Y=[];for(const J of K){const ie=oe.find(de=>de.id===J.filterId);ie&&Y.push({filterId:J.filterId,connectionType:ie.database==="NA"?"api":"database",name:ie.column,operation:ie.operation,valueType:Ou(ie),values:J.values})}return Y}if(!c||!c.dashboard)return;const{dashboard:$,filterValues:V,defaultLensId:X,lenses:I}=c,q=H($,h||[]);_($,(!V||(V==null?void 0:V.length)===0?q:V)||[]),X&&M(X),I&&A(I),R(i||((O=(U=$==null?void 0:$.sheets)==null?void 0:U[0])==null?void 0:O.id)||null)},[c,w,R,L,l,A,_,M,h,i]),T.useEffect(()=>{s&&j&&s(j)},[j,s]),T.useEffect(()=>{n&&E(n),r&&G(r)},[n,E,r,G]),{isFetching:d,isLoading:u,isError:p}}function Iu({className:e,...t}){return y.jsx("div",{className:me("animate-pulse rounded-md bg-muted",e),...t})}const GN=P.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:me("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));GN.displayName="Card";const P0=P.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:me("flex flex-col space-y-1.5 p-6",e),...t}));P0.displayName="CardHeader";const Od=P.forwardRef(({className:e,...t},n)=>y.jsx("h3",{ref:n,className:me("text-2xl font-semibold leading-none tracking-tight",e),...t}));Od.displayName="CardTitle";const lC=P.forwardRef(({className:e,...t},n)=>y.jsx("p",{ref:n,className:me("text-sm text-muted-foreground",e),...t}));lC.displayName="CardDescription";const T0=P.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:me("px-6 pt-0",e),...t}));T0.displayName="CardContent";const qN=P.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:me("flex items-center p-6 pt-0",e),...t}));qN.displayName="CardFooter";function YN({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:p,defaultFilterValues:h,onFilterValuesChange:m,selectedSheetId:b,...v}){const{placeholders:x}=Go(),w=ye(E=>E.themeStyle),_=ye(E=>E.isSessionExpired),{isLoading:R,isError:C}=aQ({customStyle:t,currentTheme:c,onSave:n,onEvent:r,defaultFilterValues:h,onFilterValuesChange:m,selectedSheetId:b});return R||!l?(r==null||r({type:"info",message:"Loading dashboard"}),o?y.jsx(o,{message:"loading"}):y.jsx("div",{className:"flex items-center gap-3",children:y.jsx(Iu,{className:"h-1 w-full dark:h-[2px]"})})):C?(r==null||r({type:"error",message:"Error fetching dashboard"}),i?(console.log("Error fetching dashboard"),y.jsx(i,{})):y.jsx("div",{children:"Error"})):_?(r==null||r({type:"error",message:"Session Expired"}),x!=null&&x.SessionExpired?y.jsx("div",{className:"flex h-full items-center justify-center",children:y.jsx("div",{children:x.SessionExpired})}):y.jsx("div",{className:"flex h-full items-center justify-center",children:y.jsxs("div",{className:"space-y-4 rounded-md border border-muted p-10",children:[y.jsx(Od,{children:"Session Expired"}),y.jsx("p",{className:"text-muted-foreground",children:"Please refresh your page to continue."})]})})):y.jsx("div",{className:me("flex h-full flex-col justify-between",w==null?void 0:w.dashboardPanel,e),style:{},role:"dashboard-panel",...v})}function Pe(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 lQ(e,t){const n=P.createContext(t),r=i=>{const{children:s,...a}=i,l=P.useMemo(()=>a,Object.values(a));return y.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=P.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function rr(e,t=[]){let n=[];function r(i,s){const a=P.createContext(s),l=n.length;n=[...n,s];const c=d=>{var x;const{scope:p,children:h,...m}=d,b=((x=p==null?void 0:p[e])==null?void 0:x[l])||a,v=P.useMemo(()=>m,Object.values(m));return y.jsx(b.Provider,{value:v,children:h})};c.displayName=i+"Provider";function u(d,p){var b;const h=((b=p==null?void 0:p[e])==null?void 0:b[l])||a,m=P.useContext(h);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=>P.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return P.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,cQ(o,...t)]}function cQ(...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 P.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Ik(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function k0(...e){return t=>{let n=!1;const r=e.map(o=>{const i=Ik(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():Ik(e[o],null)}}}}function st(...e){return P.useCallback(k0(...e),e)}var ta=P.forwardRef((e,t)=>{const{children:n,...r}=e,o=P.Children.toArray(n),i=o.find(uQ);if(i){const s=i.props.children,a=o.map(l=>l===i?P.Children.count(s)>1?P.Children.only(null):P.isValidElement(s)?s.props.children:null:l);return y.jsx(j1,{...r,ref:t,children:P.isValidElement(s)?P.cloneElement(s,void 0,a):null})}return y.jsx(j1,{...r,ref:t,children:n})});ta.displayName="Slot";var j1=P.forwardRef((e,t)=>{const{children:n,...r}=e;if(P.isValidElement(n)){const o=fQ(n),i=dQ(r,n.props);return n.type!==P.Fragment&&(i.ref=t?k0(t,o):o),P.cloneElement(n,i)}return P.Children.count(n)>1?P.Children.only(null):null});j1.displayName="SlotClone";var cC=({children:e})=>y.jsx(y.Fragment,{children:e});function uQ(e){return P.isValidElement(e)&&e.type===cC}function dQ(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 fQ(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 A0(e){const t=e+"CollectionProvider",[n,r]=rr(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=h=>{const{scope:m,children:b}=h,v=T.useRef(null),x=T.useRef(new Map).current;return y.jsx(o,{scope:m,itemMap:x,collectionRef:v,children:b})};s.displayName=t;const a=e+"CollectionSlot",l=T.forwardRef((h,m)=>{const{scope:b,children:v}=h,x=i(a,b),w=st(m,x.collectionRef);return y.jsx(ta,{ref:w,children:v})});l.displayName=a;const c=e+"CollectionItemSlot",u="data-radix-collection-item",d=T.forwardRef((h,m)=>{const{scope:b,children:v,...x}=h,w=T.useRef(null),_=st(m,w),R=i(c,b);return T.useEffect(()=>(R.itemMap.set(w,{ref:w,...x}),()=>void R.itemMap.delete(w))),y.jsx(ta,{[u]:"",ref:_,children:v})});d.displayName=c;function p(h){const m=i(e+"CollectionConsumer",h);return T.useCallback(()=>{const v=m.collectionRef.current;if(!v)return[];const x=Array.from(v.querySelectorAll(`[${u}]`));return Array.from(m.itemMap.values()).sort((R,C)=>x.indexOf(R.ref.current)-x.indexOf(C.ref.current))},[m.collectionRef,m.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},p,r]}var yr=globalThis!=null&&globalThis.document?P.useLayoutEffect:()=>{},hQ=P.useId||(()=>{}),pQ=0;function Yn(e){const[t,n]=P.useState(hQ());return yr(()=>{n(r=>r??String(pQ++))},[e]),t?`radix-${t}`:""}var gQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],je=gQ.reduce((e,t)=>{const n=P.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?ta:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function KN(e,t){e&&yc.flushSync(()=>e.dispatchEvent(t))}function tr(e){const t=P.useRef(e);return P.useEffect(()=>{t.current=e}),P.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Dr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=mQ({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=tr(n),l=P.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 mQ({defaultProp:e,onChange:t}){const n=P.useState(e),[r]=n,o=P.useRef(r),i=tr(t);return P.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}var bQ=P.createContext(void 0);function Lc(e){const t=P.useContext(bQ);return e||t||"ltr"}var xx="rovingFocusGroup.onEntryFocus",yQ={bubbles:!1,cancelable:!0},O0="RovingFocusGroup",[$1,XN,vQ]=A0(O0),[xQ,Md]=rr(O0,[vQ]),[wQ,SQ]=xQ(O0),QN=P.forwardRef((e,t)=>y.jsx($1.Provider,{scope:e.__scopeRovingFocusGroup,children:y.jsx($1.Slot,{scope:e.__scopeRovingFocusGroup,children:y.jsx(_Q,{...e,ref:t})})}));QN.displayName=O0;var _Q=P.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,p=P.useRef(null),h=st(t,p),m=Lc(i),[b=null,v]=Dr({prop:s,defaultProp:a,onChange:l}),[x,w]=P.useState(!1),_=tr(c),R=XN(n),C=P.useRef(!1),[E,A]=P.useState(0);return P.useEffect(()=>{const M=p.current;if(M)return M.addEventListener(xx,_),()=>M.removeEventListener(xx,_)},[_]),y.jsx(wQ,{scope:n,orientation:r,dir:m,loop:o,currentTabStopId:b,onItemFocus:P.useCallback(M=>v(M),[v]),onItemShiftTab:P.useCallback(()=>w(!0),[]),onFocusableItemAdd:P.useCallback(()=>A(M=>M+1),[]),onFocusableItemRemove:P.useCallback(()=>A(M=>M-1),[]),children:y.jsx(je.div,{tabIndex:x||E===0?-1:0,"data-orientation":r,...d,ref:h,style:{outline:"none",...e.style},onMouseDown:Pe(e.onMouseDown,()=>{C.current=!0}),onFocus:Pe(e.onFocus,M=>{const D=!C.current;if(M.target===M.currentTarget&&D&&!x){const L=new CustomEvent(xx,yQ);if(M.currentTarget.dispatchEvent(L),!L.defaultPrevented){const j=R().filter(H=>H.focusable),z=j.find(H=>H.active),Q=j.find(H=>H.id===b),F=[z,Q,...j].filter(Boolean).map(H=>H.ref.current);e5(F,u)}}C.current=!1}),onBlur:Pe(e.onBlur,()=>w(!1))})})}),ZN="RovingFocusGroupItem",JN=P.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=Yn(),l=i||a,c=SQ(ZN,n),u=c.currentTabStopId===l,d=XN(n),{onFocusableItemAdd:p,onFocusableItemRemove:h}=c;return P.useEffect(()=>{if(r)return p(),()=>h()},[r,p,h]),y.jsx($1.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:y.jsx(je.span,{tabIndex:u?0:-1,"data-orientation":c.orientation,...s,ref:t,onMouseDown:Pe(e.onMouseDown,m=>{r?c.onItemFocus(l):m.preventDefault()}),onFocus:Pe(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:Pe(e.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){c.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const b=RQ(m,c.orientation,c.dir);if(b!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let x=d().filter(w=>w.focusable).map(w=>w.ref.current);if(b==="last")x.reverse();else if(b==="prev"||b==="next"){b==="prev"&&x.reverse();const w=x.indexOf(m.currentTarget);x=c.loop?PQ(x,w+1):x.slice(w+1)}setTimeout(()=>e5(x))}})})})});JN.displayName=ZN;var CQ={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function EQ(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function RQ(e,t,n){const r=EQ(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return CQ[r]}function e5(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function PQ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var uC=QN,dC=JN;function TQ(e,t){return P.useReducer((n,r)=>t[n][r]??n,e)}var Kn=e=>{const{present:t,children:n}=e,r=kQ(t),o=typeof n=="function"?n({present:r.isPresent}):P.Children.only(n),i=st(r.ref,AQ(o));return typeof n=="function"||r.isPresent?P.cloneElement(o,{ref:i}):null};Kn.displayName="Presence";function kQ(e){const[t,n]=P.useState(),r=P.useRef({}),o=P.useRef(e),i=P.useRef("none"),s=e?"mounted":"unmounted",[a,l]=TQ(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return P.useEffect(()=>{const c=zg(r.current);i.current=a==="mounted"?c:"none"},[a]),yr(()=>{const c=r.current,u=o.current;if(u!==e){const p=i.current,h=zg(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),yr(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=h=>{const b=zg(r.current).includes(h.animationName);if(h.target===t&&b&&(l("ANIMATION_END"),!o.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},p=h=>{h.target===t&&(i.current=zg(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:P.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function zg(e){return(e==null?void 0:e.animationName)||"none"}function AQ(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 fC="Tabs",[OQ,oOe]=rr(fC,[Md]),t5=Md(),[MQ,hC]=OQ(fC),n5=P.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Lc(a),[d,p]=Dr({prop:r,onChange:o,defaultProp:i});return y.jsx(MQ,{scope:n,baseId:Yn(),value:d,onValueChange:p,orientation:s,dir:u,activationMode:l,children:y.jsx(je.div,{dir:u,"data-orientation":s,...c,ref:t})})});n5.displayName=fC;var r5="TabsList",o5=P.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=hC(r5,n),s=t5(n);return y.jsx(uC,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:y.jsx(je.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});o5.displayName=r5;var i5="TabsTrigger",s5=P.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=hC(i5,n),a=t5(n),l=c5(s.baseId,r),c=u5(s.baseId,r),u=r===s.value;return y.jsx(dC,{asChild:!0,...a,focusable:!o,active:u,children:y.jsx(je.button,{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:Pe(e.onMouseDown,d=>{!o&&d.button===0&&d.ctrlKey===!1?s.onValueChange(r):d.preventDefault()}),onKeyDown:Pe(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&s.onValueChange(r)}),onFocus:Pe(e.onFocus,()=>{const d=s.activationMode!=="manual";!u&&!o&&d&&s.onValueChange(r)})})})});s5.displayName=i5;var a5="TabsContent",l5=P.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=hC(a5,n),l=c5(a.baseId,r),c=u5(a.baseId,r),u=r===a.value,d=P.useRef(u);return P.useEffect(()=>{const p=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(p)},[]),y.jsx(Kn,{present:o||u,children:({present:p})=>y.jsx(je.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!p,id:c,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:p&&i})})});l5.displayName=a5;function c5(e,t){return`${e}-trigger-${t}`}function u5(e,t){return`${e}-content-${t}`}var IQ=n5,d5=o5,f5=s5,h5=l5;const pC=IQ,M0=P.forwardRef(({className:e,...t},n)=>y.jsx(d5,{ref:n,className:me("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));M0.displayName=d5.displayName;const I0=P.forwardRef(({className:e,...t},n)=>y.jsx(f5,{ref:n,className:me("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}));I0.displayName=f5.displayName;const gC=P.forwardRef(({className:e,...t},n)=>y.jsx(h5,{ref:n,className:me("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));gC.displayName=h5.displayName;var p5={exports:{}},hp={},z1={exports:{}};(function(e,t){(function(n,r){r(t)})(Qi,function(n){function r(J){return function(de,he,ae,ge,ue,Ee,Te){return J(de,he,Te)}}function o(J){return function(de,he,ae,ge){if(!de||!he||typeof de!="object"||typeof he!="object")return J(de,he,ae,ge);var ue=ge.get(de),Ee=ge.get(he);if(ue&&Ee)return ue===he&&Ee===de;ge.set(de,he),ge.set(he,de);var Te=J(de,he,ae,ge);return ge.delete(de),ge.delete(he),Te}}function i(J,ie){var de={};for(var he in J)de[he]=J[he];for(var he in ie)de[he]=ie[he];return de}function s(J){return J.constructor===Object||J.constructor==null}function a(J){return typeof J.then=="function"}function l(J,ie){return J===ie||J!==J&&ie!==ie}var c="[object Arguments]",u="[object Boolean]",d="[object Date]",p="[object RegExp]",h="[object Map]",m="[object Number]",b="[object Object]",v="[object Set]",x="[object String]",w=Object.prototype.toString;function _(J){var ie=J.areArraysEqual,de=J.areDatesEqual,he=J.areMapsEqual,ae=J.areObjectsEqual,ge=J.areRegExpsEqual,ue=J.areSetsEqual,Ee=J.createIsNestedEqual,Te=Ee(Le);function Le(Ae,Fe,tt){if(Ae===Fe)return!0;if(!Ae||!Fe||typeof Ae!="object"||typeof Fe!="object")return Ae!==Ae&&Fe!==Fe;if(s(Ae)&&s(Fe))return ae(Ae,Fe,Te,tt);var at=Array.isArray(Ae),cn=Array.isArray(Fe);if(at||cn)return at===cn&&ie(Ae,Fe,Te,tt);var St=w.call(Ae);return St!==w.call(Fe)?!1:St===d?de(Ae,Fe,Te,tt):St===p?ge(Ae,Fe,Te,tt):St===h?he(Ae,Fe,Te,tt):St===v?ue(Ae,Fe,Te,tt):St===b||St===c?a(Ae)||a(Fe)?!1:ae(Ae,Fe,Te,tt):St===u||St===m||St===x?l(Ae.valueOf(),Fe.valueOf()):!1}return Le}function R(J,ie,de,he){var ae=J.length;if(ie.length!==ae)return!1;for(;ae-- >0;)if(!de(J[ae],ie[ae],ae,ae,J,ie,he))return!1;return!0}var C=o(R);function E(J,ie){return l(J.valueOf(),ie.valueOf())}function A(J,ie,de,he){var ae=J.size===ie.size;if(!ae)return!1;if(!J.size)return!0;var ge={},ue=0;return J.forEach(function(Ee,Te){if(ae){var Le=!1,Ae=0;ie.forEach(function(Fe,tt){!Le&&!ge[Ae]&&(Le=de(Te,tt,ue,Ae,J,ie,he)&&de(Ee,Fe,Te,tt,J,ie,he))&&(ge[Ae]=!0),Ae++}),ue++,ae=Le}}),ae}var M=o(A),D="_owner",L=Object.prototype.hasOwnProperty;function j(J,ie,de,he){var ae=Object.keys(J),ge=ae.length;if(Object.keys(ie).length!==ge)return!1;for(var ue;ge-- >0;){if(ue=ae[ge],ue===D){var Ee=!!J.$$typeof,Te=!!ie.$$typeof;if((Ee||Te)&&Ee!==Te)return!1}if(!L.call(ie,ue)||!de(J[ue],ie[ue],ue,ue,J,ie,he))return!1}return!0}var z=o(j);function Q(J,ie){return J.source===ie.source&&J.flags===ie.flags}function G(J,ie,de,he){var ae=J.size===ie.size;if(!ae)return!1;if(!J.size)return!0;var ge={};return J.forEach(function(ue,Ee){if(ae){var Te=!1,Le=0;ie.forEach(function(Ae,Fe){!Te&&!ge[Le]&&(Te=de(ue,Ae,Ee,Fe,J,ie,he))&&(ge[Le]=!0),Le++}),ae=Te}}),ae}var F=o(G),H=Object.freeze({areArraysEqual:R,areDatesEqual:E,areMapsEqual:A,areObjectsEqual:j,areRegExpsEqual:Q,areSetsEqual:G,createIsNestedEqual:r}),$=Object.freeze({areArraysEqual:C,areDatesEqual:E,areMapsEqual:M,areObjectsEqual:z,areRegExpsEqual:Q,areSetsEqual:F,createIsNestedEqual:r}),V=_(H);function X(J,ie){return V(J,ie,void 0)}var I=_(i(H,{createIsNestedEqual:function(){return l}}));function q(J,ie){return I(J,ie,void 0)}var U=_($);function O(J,ie){return U(J,ie,new WeakMap)}var ee=_(i($,{createIsNestedEqual:function(){return l}}));function K(J,ie){return ee(J,ie,new WeakMap)}function oe(J){return _(i(H,J(H)))}function Y(J){var ie=_(i($,J($)));return function(de,he,ae){return ae===void 0&&(ae=new WeakMap),ie(de,he,ae)}}n.circularDeepEqual=O,n.circularShallowEqual=K,n.createCustomCircularEqual=Y,n.createCustomEqual=oe,n.deepEqual=X,n.sameValueZeroEqual=l,n.shallowEqual=q,Object.defineProperty(n,"__esModule",{value:!0})})})(z1,z1.exports);var mC=z1.exports;const bC=V_(qY);var Tt={},DQ=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(Tt,"__esModule",{value:!0});Tt.bottom=yC;Tt.childrenEqual=jQ;Tt.cloneLayout=g5;Tt.cloneLayoutItem=oc;Tt.collides=D0;Tt.compact=b5;Tt.compactItem=y5;Tt.compactType=QQ;Tt.correctBounds=v5;Tt.fastPositionEqual=$Q;Tt.fastRGLPropsEqual=void 0;Tt.getAllCollisions=x5;Tt.getFirstCollision=Bl;Tt.getLayoutItem=vC;Tt.getStatics=xC;Tt.modifyLayout=m5;Tt.moveElement=Bf;Tt.moveElementAwayFromCollision=H1;Tt.noop=void 0;Tt.perc=BQ;Tt.resizeItemInDirection=qQ;Tt.setTopLeft=KQ;Tt.setTransform=YQ;Tt.sortLayoutItems=RC;Tt.sortLayoutItemsByColRow=E5;Tt.sortLayoutItemsByRowCol=C5;Tt.synchronizeLayoutWithChildren=XQ;Tt.validateLayout=R5;Tt.withLayoutItem=FQ;var Dk=mC,zf=NQ(T);function NQ(e){return e&&e.__esModule?e:{default:e}}const LQ=process.env.NODE_ENV==="production";function yC(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 g5(e){const t=Array(e.length);for(let n=0,r=e.length;n<r;n++)t[n]=oc(e[n]);return t}function m5(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 FQ(e,t,n){let r=vC(e,t);return r?(r=n(oc(r)),e=m5(e,r),[e,r]):[e,null]}function oc(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 jQ(e,t){return(0,Dk.deepEqual)(zf.default.Children.map(e,n=>n==null?void 0:n.key),zf.default.Children.map(t,n=>n==null?void 0:n.key))&&(0,Dk.deepEqual)(zf.default.Children.map(e,n=>n==null?void 0:n.props["data-grid"]),zf.default.Children.map(t,n=>n==null?void 0:n.props["data-grid"]))}Tt.fastRGLPropsEqual=DQ;function $Q(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function D0(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 b5(e,t,n,r){const o=xC(e),i=RC(e,t),s=Array(e.length);for(let a=0,l=i.length;a<l;a++){let c=oc(i[a]);c.static||(c=y5(o,c,t,n,i,r),o.push(c)),s[e.indexOf(i[a])]=c,c.moved=!1}return s}const zQ={x:"w",y:"h"};function B1(e,t,n,r){const o=zQ[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;D0(t,a)&&B1(e,a,n+t[o],r)}}t[r]=n}function y5(e,t,n,r,o,i){const s=n==="vertical",a=n==="horizontal";if(s)for(t.y=Math.min(yC(e),t.y);t.y>0&&!Bl(e,t);)t.y--;else if(a)for(;t.x>0&&!Bl(e,t);)t.x--;let l;for(;(l=Bl(e,t))&&!(n===null&&i);)if(a?B1(o,t,l.x+l.w,"x"):B1(o,t,l.y+l.h,"y"),a&&t.x+t.w>r)for(t.x=r-t.w,t.y++;t.x>0&&!Bl(e,t);)t.x--;return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function v5(e,t){const n=xC(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(;Bl(n,i);)i.y++}return e}function vC(e,t){for(let n=0,r=e.length;n<r;n++)if(e[n].i===t)return e[n]}function Bl(e,t){for(let n=0,r=e.length;n<r;n++)if(D0(e[n],t))return e[n]}function x5(e,t){return e.filter(n=>D0(n,t))}function xC(e){return e.filter(t=>t.static)}function Bf(e,t,n,r,o,i,s,a,l){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return e;`${t.i}${String(n)}${String(r)}${t.x}${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=RC(e,s);(s==="vertical"&&typeof r=="number"?u>=r:s==="horizontal"&&typeof n=="number"?c>=n:!1)&&(d=d.reverse());const h=x5(d,t),m=h.length>0;if(m&&l)return g5(e);if(m&&i)return`${t.i}`,t.x=c,t.y=u,t.moved=!1,e;for(let b=0,v=h.length;b<v;b++){const x=h[b];`${t.i}${t.x}${t.y}${x.i}${x.x}${x.y}`,!x.moved&&(x.static?e=H1(e,x,t,o,s):e=H1(e,t,x,o,s))}return e}function H1(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"},p=Bl(e,d),h=p&&p.y+p.h>t.y,m=p&&t.x+t.w>p.x;if(p){if(h&&a)return Bf(e,n,void 0,t.y+1,r,l,o);if(h&&o==null)return t.y=n.y,n.y=n.y+n.h,e;if(m&&s)return Bf(e,t,n.x,void 0,r,l,o)}else return`${n.i}${d.x}${d.y}`,Bf(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:Bf(e,n,s?n.x+1:void 0,a?n.y+1:void 0,r,l,o)}function BQ(e){return e*100+"%"}const w5=(e,t,n,r)=>e+n>r?t:n,S5=(e,t,n)=>e<0?t:n,_5=e=>Math.max(0,e),wC=e=>Math.max(0,e),SC=(e,t,n)=>{let{left:r,height:o,width:i}=t;const s=e.top-(o-e.height);return{left:r,width:i,height:S5(s,e.height,o),top:wC(s)}},_C=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{top:r,height:i,width:w5(e.left,e.width,s,n),left:_5(o)}},CC=(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:w5(e.left,e.width,i,n),top:wC(r),left:_5(s)}},EC=(e,t,n)=>{let{top:r,left:o,height:i,width:s}=t;return{width:s,left:o,height:S5(r,e.height,i),top:wC(r)}},HQ=function(){return SC(arguments.length<=0?void 0:arguments[0],_C(...arguments))},VQ=function(){return SC(arguments.length<=0?void 0:arguments[0],CC(...arguments))},WQ=function(){return EC(arguments.length<=0?void 0:arguments[0],_C(...arguments))},UQ=function(){return EC(arguments.length<=0?void 0:arguments[0],CC(...arguments))},GQ={n:SC,ne:HQ,e:_C,se:WQ,s:EC,sw:UQ,w:CC,nw:VQ};function qQ(e,t,n,r){const o=GQ[e];return o?o(t,{...t,...n},r):n}function YQ(e){let{top:t,left:n,width:r,height:o}=e;const i=`translate(${n}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${r}px`,height:`${o}px`,position:"absolute"}}function KQ(e){let{top:t,left:n,width:r,height:o}=e;return{top:`${t}px`,left:`${n}px`,width:`${r}px`,height:`${o}px`,position:"absolute"}}function RC(e,t){return t==="horizontal"?E5(e):t==="vertical"?C5(e):e}function C5(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 E5(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 XQ(e,t,n,r,o){e=e||[];const i=[];zf.default.Children.forEach(t,a=>{if((a==null?void 0:a.key)==null)return;const l=vC(e,String(a.key)),c=a.props["data-grid"];l&&c==null?i.push(oc(l)):c?(LQ||R5([c],"ReactGridLayout.children"),i.push(oc({...c,i:a.key}))):i.push(oc({w:1,h:1,x:0,y:yC(i),i:String(a.key)}))});const s=v5(i,{cols:n});return o?s:b5(s,r,n)}function R5(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++){const a=n[s],l=i[a];if(typeof l!="number"||Number.isNaN(l))throw new Error(`ReactGridLayout: ${t}[${r}].${a} must be a number! Received: ${l} (${typeof l})`)}if(typeof i.i<"u"&&typeof i.i!="string")throw new Error(`ReactGridLayout: ${t}[${r}].i must be a string! Received: ${i.i} (${typeof i.i})`)}}function QQ(e){const{verticalCompact:t,compactType:n}=e||{};return t===!1?null:n}const ZQ=()=>{};Tt.noop=ZQ;var bs={};Object.defineProperty(bs,"__esModule",{value:!0});bs.calcGridColWidth=N0;bs.calcGridItemPosition=JQ;bs.calcGridItemWHPx=V1;bs.calcWH=tZ;bs.calcXY=eZ;bs.clamp=Hl;function N0(e){const{margin:t,containerPadding:n,containerWidth:r,cols:o}=e;return(r-t[0]*(o-1)-n[0]*2)/o}function V1(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function JQ(e,t,n,r,o,i){const{margin:s,containerPadding:a,rowHeight:l}=e,c=N0(e),u={};return i&&i.resizing?(u.width=Math.round(i.resizing.width),u.height=Math.round(i.resizing.height)):(u.width=V1(r,c,s[0]),u.height=V1(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 eZ(e,t,n,r,o){const{margin:i,containerPadding:s,cols:a,rowHeight:l,maxRows:c}=e,u=N0(e);let d=Math.round((n-s[0])/(u+i[0])),p=Math.round((t-s[1])/(l+i[1]));return d=Hl(d,0,a-r),p=Hl(p,0,c-o),{x:d,y:p}}function tZ(e,t,n,r,o,i){const{margin:s,maxRows:a,cols:l,rowHeight:c}=e,u=N0(e);let d=Math.round((t+s[0])/(u+s[0])),p=Math.round((n+s[1])/(c+s[1])),h=Hl(d,0,l-r),m=Hl(p,0,a-o);return["sw","w","nw"].indexOf(i)!==-1&&(h=Hl(d,0,l)),["nw","n","ne"].indexOf(i)!==-1&&(m=Hl(p,0,a)),{w:h,h:m}}function Hl(e,t,n){return Math.max(Math.min(e,n),t)}var L0={},W1={exports:{}},Bg={exports:{}},Zt={};/** @license React v16.13.1
|
|
92
|
+
* react-is.production.min.js
|
|
93
|
+
*
|
|
94
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
95
|
+
*
|
|
96
|
+
* This source code is licensed under the MIT license found in the
|
|
97
|
+
* LICENSE file in the root directory of this source tree.
|
|
98
|
+
*/var Nk;function nZ(){if(Nk)return Zt;Nk=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,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function _(C){if(typeof C=="object"&&C!==null){var E=C.$$typeof;switch(E){case t:switch(C=C.type,C){case l:case c:case r:case i:case o:case d:return C;default:switch(C=C&&C.$$typeof,C){case a:case u:case m:case h:case s:return C;default:return E}}case n:return E}}}function R(C){return _(C)===c}return Zt.AsyncMode=l,Zt.ConcurrentMode=c,Zt.ContextConsumer=a,Zt.ContextProvider=s,Zt.Element=t,Zt.ForwardRef=u,Zt.Fragment=r,Zt.Lazy=m,Zt.Memo=h,Zt.Portal=n,Zt.Profiler=i,Zt.StrictMode=o,Zt.Suspense=d,Zt.isAsyncMode=function(C){return R(C)||_(C)===l},Zt.isConcurrentMode=R,Zt.isContextConsumer=function(C){return _(C)===a},Zt.isContextProvider=function(C){return _(C)===s},Zt.isElement=function(C){return typeof C=="object"&&C!==null&&C.$$typeof===t},Zt.isForwardRef=function(C){return _(C)===u},Zt.isFragment=function(C){return _(C)===r},Zt.isLazy=function(C){return _(C)===m},Zt.isMemo=function(C){return _(C)===h},Zt.isPortal=function(C){return _(C)===n},Zt.isProfiler=function(C){return _(C)===i},Zt.isStrictMode=function(C){return _(C)===o},Zt.isSuspense=function(C){return _(C)===d},Zt.isValidElementType=function(C){return typeof C=="string"||typeof C=="function"||C===r||C===c||C===i||C===o||C===d||C===p||typeof C=="object"&&C!==null&&(C.$$typeof===m||C.$$typeof===h||C.$$typeof===s||C.$$typeof===a||C.$$typeof===u||C.$$typeof===v||C.$$typeof===x||C.$$typeof===w||C.$$typeof===b)},Zt.typeOf=_,Zt}var Jt={};/** @license React v16.13.1
|
|
99
|
+
* react-is.development.js
|
|
100
|
+
*
|
|
101
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
102
|
+
*
|
|
103
|
+
* This source code is licensed under the MIT license found in the
|
|
104
|
+
* LICENSE file in the root directory of this source tree.
|
|
105
|
+
*/var Lk;function rZ(){return Lk||(Lk=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,p=e?Symbol.for("react.suspense_list"):60120,h=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,b=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function _(ae){return typeof ae=="string"||typeof ae=="function"||ae===r||ae===c||ae===i||ae===o||ae===d||ae===p||typeof ae=="object"&&ae!==null&&(ae.$$typeof===m||ae.$$typeof===h||ae.$$typeof===s||ae.$$typeof===a||ae.$$typeof===u||ae.$$typeof===v||ae.$$typeof===x||ae.$$typeof===w||ae.$$typeof===b)}function R(ae){if(typeof ae=="object"&&ae!==null){var ge=ae.$$typeof;switch(ge){case t:var ue=ae.type;switch(ue){case l:case c:case r:case i:case o:case d:return ue;default:var Ee=ue&&ue.$$typeof;switch(Ee){case a:case u:case m:case h:case s:return Ee;default:return ge}}case n:return ge}}}var C=l,E=c,A=a,M=s,D=t,L=u,j=r,z=m,Q=h,G=n,F=i,H=o,$=d,V=!1;function X(ae){return V||(V=!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.")),I(ae)||R(ae)===l}function I(ae){return R(ae)===c}function q(ae){return R(ae)===a}function U(ae){return R(ae)===s}function O(ae){return typeof ae=="object"&&ae!==null&&ae.$$typeof===t}function ee(ae){return R(ae)===u}function K(ae){return R(ae)===r}function oe(ae){return R(ae)===m}function Y(ae){return R(ae)===h}function J(ae){return R(ae)===n}function ie(ae){return R(ae)===i}function de(ae){return R(ae)===o}function he(ae){return R(ae)===d}Jt.AsyncMode=C,Jt.ConcurrentMode=E,Jt.ContextConsumer=A,Jt.ContextProvider=M,Jt.Element=D,Jt.ForwardRef=L,Jt.Fragment=j,Jt.Lazy=z,Jt.Memo=Q,Jt.Portal=G,Jt.Profiler=F,Jt.StrictMode=H,Jt.Suspense=$,Jt.isAsyncMode=X,Jt.isConcurrentMode=I,Jt.isContextConsumer=q,Jt.isContextProvider=U,Jt.isElement=O,Jt.isForwardRef=ee,Jt.isFragment=K,Jt.isLazy=oe,Jt.isMemo=Y,Jt.isPortal=J,Jt.isProfiler=ie,Jt.isStrictMode=de,Jt.isSuspense=he,Jt.isValidElementType=_,Jt.typeOf=R}()),Jt}var Fk;function P5(){return Fk||(Fk=1,process.env.NODE_ENV==="production"?Bg.exports=nZ():Bg.exports=rZ()),Bg.exports}/*
|
|
106
|
+
object-assign
|
|
107
|
+
(c) Sindre Sorhus
|
|
108
|
+
@license MIT
|
|
109
|
+
*/var wx,jk;function oZ(){if(jk)return wx;jk=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 wx=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 p=0;p<c.length;p++)n.call(a,c[p])&&(l[c[p]]=a[c[p]])}}return l},wx}var Sx,$k;function PC(){if($k)return Sx;$k=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Sx=e,Sx}var _x,zk;function T5(){return zk||(zk=1,_x=Function.call.bind(Object.prototype.hasOwnProperty)),_x}var Cx,Bk;function iZ(){if(Bk)return Cx;Bk=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=PC(),n={},r=T5();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 p=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 p.name="Invariant Violation",p}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 h=c?c():"";e("Failed "+a+" type: "+d.message+(h??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Cx=o,Cx}var Ex,Hk;function sZ(){if(Hk)return Ex;Hk=1;var e=P5(),t=oZ(),n=PC(),r=T5(),o=iZ(),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 Ex=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(I){var q=I&&(c&&I[c]||I[u]);if(typeof q=="function")return q}var p="<<anonymous>>",h={array:x("array"),bigint:x("bigint"),bool:x("boolean"),func:x("function"),number:x("number"),object:x("object"),string:x("string"),symbol:x("symbol"),any:w(),arrayOf:_,element:R(),elementType:C(),instanceOf:E,node:L(),objectOf:M,oneOf:A,oneOfType:D,shape:z,exact:Q};function m(I,q){return I===q?I!==0||1/I===1/q:I!==I&&q!==q}function b(I,q){this.message=I,this.data=q&&typeof q=="object"?q:{},this.stack=""}b.prototype=Error.prototype;function v(I){if(process.env.NODE_ENV!=="production")var q={},U=0;function O(K,oe,Y,J,ie,de,he){if(J=J||p,de=de||Y,he!==n){if(l){var ae=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 ae.name="Invariant Violation",ae}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ge=J+":"+Y;!q[ge]&&U<3&&(i("You are manually calling a React.PropTypes validation function for the `"+de+"` prop on `"+J+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),q[ge]=!0,U++)}}return oe[Y]==null?K?oe[Y]===null?new b("The "+ie+" `"+de+"` is marked as required "+("in `"+J+"`, but its value is `null`.")):new b("The "+ie+" `"+de+"` is marked as required in "+("`"+J+"`, but its value is `undefined`.")):null:I(oe,Y,J,ie,de)}var ee=O.bind(null,!1);return ee.isRequired=O.bind(null,!0),ee}function x(I){function q(U,O,ee,K,oe,Y){var J=U[O],ie=H(J);if(ie!==I){var de=$(J);return new b("Invalid "+K+" `"+oe+"` of type "+("`"+de+"` supplied to `"+ee+"`, expected ")+("`"+I+"`."),{expectedType:I})}return null}return v(q)}function w(){return v(s)}function _(I){function q(U,O,ee,K,oe){if(typeof I!="function")return new b("Property `"+oe+"` of component `"+ee+"` has invalid PropType notation inside arrayOf.");var Y=U[O];if(!Array.isArray(Y)){var J=H(Y);return new b("Invalid "+K+" `"+oe+"` of type "+("`"+J+"` supplied to `"+ee+"`, expected an array."))}for(var ie=0;ie<Y.length;ie++){var de=I(Y,ie,ee,K,oe+"["+ie+"]",n);if(de instanceof Error)return de}return null}return v(q)}function R(){function I(q,U,O,ee,K){var oe=q[U];if(!a(oe)){var Y=H(oe);return new b("Invalid "+ee+" `"+K+"` of type "+("`"+Y+"` supplied to `"+O+"`, expected a single ReactElement."))}return null}return v(I)}function C(){function I(q,U,O,ee,K){var oe=q[U];if(!e.isValidElementType(oe)){var Y=H(oe);return new b("Invalid "+ee+" `"+K+"` of type "+("`"+Y+"` supplied to `"+O+"`, expected a single ReactElement type."))}return null}return v(I)}function E(I){function q(U,O,ee,K,oe){if(!(U[O]instanceof I)){var Y=I.name||p,J=X(U[O]);return new b("Invalid "+K+" `"+oe+"` of type "+("`"+J+"` supplied to `"+ee+"`, expected ")+("instance of `"+Y+"`."))}return null}return v(q)}function A(I){if(!Array.isArray(I))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 q(U,O,ee,K,oe){for(var Y=U[O],J=0;J<I.length;J++)if(m(Y,I[J]))return null;var ie=JSON.stringify(I,function(he,ae){var ge=$(ae);return ge==="symbol"?String(ae):ae});return new b("Invalid "+K+" `"+oe+"` of value `"+String(Y)+"` "+("supplied to `"+ee+"`, expected one of "+ie+"."))}return v(q)}function M(I){function q(U,O,ee,K,oe){if(typeof I!="function")return new b("Property `"+oe+"` of component `"+ee+"` has invalid PropType notation inside objectOf.");var Y=U[O],J=H(Y);if(J!=="object")return new b("Invalid "+K+" `"+oe+"` of type "+("`"+J+"` supplied to `"+ee+"`, expected an object."));for(var ie in Y)if(r(Y,ie)){var de=I(Y,ie,ee,K,oe+"."+ie,n);if(de instanceof Error)return de}return null}return v(q)}function D(I){if(!Array.isArray(I))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var q=0;q<I.length;q++){var U=I[q];if(typeof U!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+V(U)+" at index "+q+"."),s}function O(ee,K,oe,Y,J){for(var ie=[],de=0;de<I.length;de++){var he=I[de],ae=he(ee,K,oe,Y,J,n);if(ae==null)return null;ae.data&&r(ae.data,"expectedType")&&ie.push(ae.data.expectedType)}var ge=ie.length>0?", expected one of type ["+ie.join(", ")+"]":"";return new b("Invalid "+Y+" `"+J+"` supplied to "+("`"+oe+"`"+ge+"."))}return v(O)}function L(){function I(q,U,O,ee,K){return G(q[U])?null:new b("Invalid "+ee+" `"+K+"` supplied to "+("`"+O+"`, expected a ReactNode."))}return v(I)}function j(I,q,U,O,ee){return new b((I||"React class")+": "+q+" type `"+U+"."+O+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+ee+"`.")}function z(I){function q(U,O,ee,K,oe){var Y=U[O],J=H(Y);if(J!=="object")return new b("Invalid "+K+" `"+oe+"` of type `"+J+"` "+("supplied to `"+ee+"`, expected `object`."));for(var ie in I){var de=I[ie];if(typeof de!="function")return j(ee,K,oe,ie,$(de));var he=de(Y,ie,ee,K,oe+"."+ie,n);if(he)return he}return null}return v(q)}function Q(I){function q(U,O,ee,K,oe){var Y=U[O],J=H(Y);if(J!=="object")return new b("Invalid "+K+" `"+oe+"` of type `"+J+"` "+("supplied to `"+ee+"`, expected `object`."));var ie=t({},U[O],I);for(var de in ie){var he=I[de];if(r(I,de)&&typeof he!="function")return j(ee,K,oe,de,$(he));if(!he)return new b("Invalid "+K+" `"+oe+"` key `"+de+"` supplied to `"+ee+"`.\nBad object: "+JSON.stringify(U[O],null," ")+`
|
|
110
|
+
Valid keys: `+JSON.stringify(Object.keys(I),null," "));var ae=he(Y,de,ee,K,oe+"."+de,n);if(ae)return ae}return null}return v(q)}function G(I){switch(typeof I){case"number":case"string":case"undefined":return!0;case"boolean":return!I;case"object":if(Array.isArray(I))return I.every(G);if(I===null||a(I))return!0;var q=d(I);if(q){var U=q.call(I),O;if(q!==I.entries){for(;!(O=U.next()).done;)if(!G(O.value))return!1}else for(;!(O=U.next()).done;){var ee=O.value;if(ee&&!G(ee[1]))return!1}}else return!1;return!0;default:return!1}}function F(I,q){return I==="symbol"?!0:q?q["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&q instanceof Symbol:!1}function H(I){var q=typeof I;return Array.isArray(I)?"array":I instanceof RegExp?"object":F(q,I)?"symbol":q}function $(I){if(typeof I>"u"||I===null)return""+I;var q=H(I);if(q==="object"){if(I instanceof Date)return"date";if(I instanceof RegExp)return"regexp"}return q}function V(I){var q=$(I);switch(q){case"array":case"object":return"an "+q;case"boolean":case"date":case"regexp":return"a "+q;default:return q}}function X(I){return!I.constructor||!I.constructor.name?p:I.constructor.name}return h.checkPropTypes=o,h.resetWarningCache=o.resetWarningCache,h.PropTypes=h,h},Ex}var Rx,Vk;function aZ(){if(Vk)return Rx;Vk=1;var e=PC();function t(){}function n(){}return n.resetWarningCache=t,Rx=function(){function r(s,a,l,c,u,d){if(d!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Rx}if(process.env.NODE_ENV!=="production"){var lZ=P5(),cZ=!0;W1.exports=sZ()(lZ.isElement,cZ)}else W1.exports=aZ()();var rl=W1.exports,F0={exports:{}},k5={};function A5(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=A5(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Wk(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=A5(e))&&(r&&(r+=" "),r+=t);return r}const uZ=Object.freeze(Object.defineProperty({__proto__:null,clsx:Wk,default:Wk},Symbol.toStringTag,{value:"Module"})),dZ=V_(uZ);var Ln={},ys={};Object.defineProperty(ys,"__esModule",{value:!0});ys.dontSetMe=mZ;ys.findInArray=fZ;ys.int=gZ;ys.isFunction=hZ;ys.isNum=pZ;function fZ(e,t){for(let n=0,r=e.length;n<r;n++)if(t.apply(t,[e[n],n,e]))return e[n]}function hZ(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function pZ(e){return typeof e=="number"&&!isNaN(e)}function gZ(e){return parseInt(e,10)}function mZ(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 Fc={};Object.defineProperty(Fc,"__esModule",{value:!0});Fc.browserPrefixToKey=M5;Fc.browserPrefixToStyle=bZ;Fc.default=void 0;Fc.getPrefix=O5;const Px=["Moz","Webkit","O","ms"];function O5(){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<Px.length;r++)if(M5(t,Px[r])in n)return Px[r];return""}function M5(e,t){return t?"".concat(t).concat(yZ(e)):e}function bZ(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e}function yZ(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}Fc.default=O5();Object.defineProperty(Ln,"__esModule",{value:!0});Ln.addClassName=N5;Ln.addEvent=wZ;Ln.addUserSelectStyles=MZ;Ln.createCSSTransform=TZ;Ln.createSVGTransform=kZ;Ln.getTouch=AZ;Ln.getTouchIdentifier=OZ;Ln.getTranslation=TC;Ln.innerHeight=EZ;Ln.innerWidth=RZ;Ln.matchesSelector=D5;Ln.matchesSelectorAndParentsTo=xZ;Ln.offsetXYFromParent=PZ;Ln.outerHeight=_Z;Ln.outerWidth=CZ;Ln.removeClassName=L5;Ln.removeEvent=SZ;Ln.removeUserSelectStyles=IZ;var zo=ys,Uk=vZ(Fc);function I5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(I5=function(r){return r?n:t})(e)}function vZ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=I5(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 Hg="";function D5(e,t){return Hg||(Hg=(0,zo.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(n){return(0,zo.isFunction)(e[n])})),(0,zo.isFunction)(e[Hg])?e[Hg](t):!1}function xZ(e,t,n){let r=e;do{if(D5(r,t))return!0;if(r===n)return!1;r=r.parentNode}while(r);return!1}function wZ(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 SZ(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 _Z(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,zo.int)(n.borderTopWidth),t+=(0,zo.int)(n.borderBottomWidth),t}function CZ(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,zo.int)(n.borderLeftWidth),t+=(0,zo.int)(n.borderRightWidth),t}function EZ(e){let t=e.clientHeight;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,zo.int)(n.paddingTop),t-=(0,zo.int)(n.paddingBottom),t}function RZ(e){let t=e.clientWidth;const n=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,zo.int)(n.paddingLeft),t-=(0,zo.int)(n.paddingRight),t}function PZ(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 TZ(e,t){const n=TC(e,t,"px");return{[(0,Uk.browserPrefixToKey)("transform",Uk.default)]:n}}function kZ(e,t){return TC(e,t,"")}function TC(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 AZ(e,t){return e.targetTouches&&(0,zo.findInArray)(e.targetTouches,n=>t===n.identifier)||e.changedTouches&&(0,zo.findInArray)(e.changedTouches,n=>t===n.identifier)}function OZ(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function MZ(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;}
|
|
111
|
+
`,t.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
112
|
+
`,e.getElementsByTagName("head")[0].appendChild(t)),e.body&&N5(e.body,"react-draggable-transparent-selection")}function IZ(e){if(e)try{if(e.body&&L5(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 N5(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function L5(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}var vs={};Object.defineProperty(vs,"__esModule",{value:!0});vs.canDragX=LZ;vs.canDragY=FZ;vs.createCoreData=$Z;vs.createDraggableData=zZ;vs.getBoundPosition=DZ;vs.getControlPosition=jZ;vs.snapToGrid=NZ;var Io=ys,_u=Ln;function DZ(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r=="string"?r:BZ(r);const o=kC(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,Io.int)(u.paddingLeft)+(0,Io.int)(c.marginLeft),top:-o.offsetTop+(0,Io.int)(u.paddingTop)+(0,Io.int)(c.marginTop),right:(0,_u.innerWidth)(l)-(0,_u.outerWidth)(o)-o.offsetLeft+(0,Io.int)(u.paddingRight)-(0,Io.int)(c.marginRight),bottom:(0,_u.innerHeight)(l)-(0,_u.outerHeight)(o)-o.offsetTop+(0,Io.int)(u.paddingBottom)-(0,Io.int)(c.marginBottom)}}return(0,Io.isNum)(r.right)&&(t=Math.min(t,r.right)),(0,Io.isNum)(r.bottom)&&(n=Math.min(n,r.bottom)),(0,Io.isNum)(r.left)&&(t=Math.max(t,r.left)),(0,Io.isNum)(r.top)&&(n=Math.max(n,r.top)),[t,n]}function NZ(e,t,n){const r=Math.round(t/e[0])*e[0],o=Math.round(n/e[1])*e[1];return[r,o]}function LZ(e){return e.props.axis==="both"||e.props.axis==="x"}function FZ(e){return e.props.axis==="both"||e.props.axis==="y"}function jZ(e,t,n){const r=typeof t=="number"?(0,_u.getTouch)(e,t):null;if(typeof t=="number"&&!r)return null;const o=kC(n),i=n.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,_u.offsetXYFromParent)(r||e,i,n.props.scale)}function $Z(e,t,n){const r=!(0,Io.isNum)(e.lastX),o=kC(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 zZ(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 BZ(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function kC(e){const t=e.findDOMNode();if(!t)throw new Error("<DraggableCore>: Unmounted during event!");return t}var j0={},$0={};Object.defineProperty($0,"__esModule",{value:!0});$0.default=HZ;function HZ(){}Object.defineProperty(j0,"__esModule",{value:!0});j0.default=void 0;var Tx=WZ(T),io=AC(rl),VZ=AC(Ar),Cr=Ln,xa=vs,kx=ys,mf=AC($0);function AC(e){return e&&e.__esModule?e:{default:e}}function F5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(F5=function(r){return r?n:t})(e)}function WZ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=F5(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 Hr(e,t,n){return t=UZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UZ(e){var t=GZ(e,"string");return typeof t=="symbol"?t:String(t)}function GZ(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);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const wi={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let wa=wi.mouse,z0=class extends Tx.Component{constructor(){super(...arguments),Hr(this,"dragging",!1),Hr(this,"lastX",NaN),Hr(this,"lastY",NaN),Hr(this,"touchIdentifier",null),Hr(this,"mounted",!1),Hr(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,Cr.matchesSelectorAndParentsTo)(t.target,this.props.handle,n)||this.props.cancel&&(0,Cr.matchesSelectorAndParentsTo)(t.target,this.props.cancel,n))return;t.type==="touchstart"&&t.preventDefault();const o=(0,Cr.getTouchIdentifier)(t);this.touchIdentifier=o;const i=(0,xa.getControlPosition)(t,o,this);if(i==null)return;const{x:s,y:a}=i,l=(0,xa.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,Cr.addUserSelectStyles)(r),this.dragging=!0,this.lastX=s,this.lastY=a,(0,Cr.addEvent)(r,wa.move,this.handleDrag),(0,Cr.addEvent)(r,wa.stop,this.handleDragStop))}),Hr(this,"handleDrag",t=>{const n=(0,xa.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,xa.snapToGrid)(this.props.grid,a,l),!a&&!l)return;r=this.lastX+a,o=this.lastY+l}const i=(0,xa.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}),Hr(this,"handleDragStop",t=>{if(!this.dragging)return;const n=(0,xa.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,xa.snapToGrid)(this.props.grid,l,c),r=this.lastX+l,o=this.lastY+c}const i=(0,xa.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,Cr.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,Cr.removeEvent)(a.ownerDocument,wa.move,this.handleDrag),(0,Cr.removeEvent)(a.ownerDocument,wa.stop,this.handleDragStop))}),Hr(this,"onMouseDown",t=>(wa=wi.mouse,this.handleDragStart(t))),Hr(this,"onMouseUp",t=>(wa=wi.mouse,this.handleDragStop(t))),Hr(this,"onTouchStart",t=>(wa=wi.touch,this.handleDragStart(t))),Hr(this,"onTouchEnd",t=>(wa=wi.touch,this.handleDragStop(t)))}componentDidMount(){this.mounted=!0;const t=this.findDOMNode();t&&(0,Cr.addEvent)(t,wi.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const t=this.findDOMNode();if(t){const{ownerDocument:n}=t;(0,Cr.removeEvent)(n,wi.mouse.move,this.handleDrag),(0,Cr.removeEvent)(n,wi.touch.move,this.handleDrag),(0,Cr.removeEvent)(n,wi.mouse.stop,this.handleDragStop),(0,Cr.removeEvent)(n,wi.touch.stop,this.handleDragStop),(0,Cr.removeEvent)(t,wi.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,Cr.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:VZ.default.findDOMNode(this)}render(){return Tx.cloneElement(Tx.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};j0.default=z0;Hr(z0,"displayName","DraggableCore");Hr(z0,"propTypes",{allowAnyClick:io.default.bool,children:io.default.node.isRequired,disabled:io.default.bool,enableUserSelectHack:io.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:io.default.arrayOf(io.default.number),handle:io.default.string,cancel:io.default.string,nodeRef:io.default.object,onStart:io.default.func,onDrag:io.default.func,onStop:io.default.func,onMouseDown:io.default.func,scale:io.default.number,className:kx.dontSetMe,style:kx.dontSetMe,transform:kx.dontSetMe});Hr(z0,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1});(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return l.default}}),e.default=void 0;var t=p(T),n=u(rl),r=u(Ar),o=u(dZ),i=Ln,s=vs,a=ys,l=u(j0),c=u($0);function u(w){return w&&w.__esModule?w:{default:w}}function d(w){if(typeof WeakMap!="function")return null;var _=new WeakMap,R=new WeakMap;return(d=function(C){return C?R:_})(w)}function p(w,_){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var R=d(_);if(R&&R.has(w))return R.get(w);var C={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var A in w)if(A!=="default"&&Object.prototype.hasOwnProperty.call(w,A)){var M=E?Object.getOwnPropertyDescriptor(w,A):null;M&&(M.get||M.set)?Object.defineProperty(C,A,M):C[A]=w[A]}return C.default=w,R&&R.set(w,C),C}function h(){return h=Object.assign?Object.assign.bind():function(w){for(var _=1;_<arguments.length;_++){var R=arguments[_];for(var C in R)Object.prototype.hasOwnProperty.call(R,C)&&(w[C]=R[C])}return w},h.apply(this,arguments)}function m(w,_,R){return _=b(_),_ in w?Object.defineProperty(w,_,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[_]=R,w}function b(w){var _=v(w,"string");return typeof _=="symbol"?_:String(_)}function v(w,_){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var C=R.call(w,_);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(w)}class x extends t.Component{static getDerivedStateFromProps(_,R){let{position:C}=_,{prevPropsPosition:E}=R;return C&&(!E||C.x!==E.x||C.y!==E.y)?((0,c.default)("Draggable: getDerivedStateFromProps %j",{position:C,prevPropsPosition:E}),{x:C.x,y:C.y,prevPropsPosition:{...C}}):null}constructor(_){super(_),m(this,"onDragStart",(R,C)=>{if((0,c.default)("Draggable: onDragStart: %j",C),this.props.onStart(R,(0,s.createDraggableData)(this,C))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),m(this,"onDrag",(R,C)=>{if(!this.state.dragging)return!1;(0,c.default)("Draggable: onDrag: %j",C);const E=(0,s.createDraggableData)(this,C),A={x:E.x,y:E.y,slackX:0,slackY:0};if(this.props.bounds){const{x:D,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+(D-A.x),A.slackY=this.state.slackY+(L-A.y),E.x=A.x,E.y=A.y,E.deltaX=A.x-this.state.x,E.deltaY=A.y-this.state.y}if(this.props.onDrag(R,E)===!1)return!1;this.setState(A)}),m(this,"onDragStop",(R,C)=>{if(!this.state.dragging||this.props.onStop(R,(0,s.createDraggableData)(this,C))===!1)return!1;(0,c.default)("Draggable: onDragStop: %j",C);const A={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:D,y:L}=this.props.position;A.x=D,A.y=L}this.setState(A)}),this.state={dragging:!1,dragged:!1,x:_.position?_.position.x:_.defaultPosition.x,y:_.position?_.position.y:_.defaultPosition.y,prevPropsPosition:{..._.position},slackX:0,slackY:0,isElementSVG:!1},_.position&&!(_.onDrag||_.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 _,R;return(_=(R=this.props)===null||R===void 0||(R=R.nodeRef)===null||R===void 0?void 0:R.current)!==null&&_!==void 0?_:r.default.findDOMNode(this)}render(){const{axis:_,bounds:R,children:C,defaultPosition:E,defaultClassName:A,defaultClassNameDragging:M,defaultClassNameDragged:D,position:L,positionOffset:j,scale:z,...Q}=this.props;let G={},F=null;const $=!!!L||this.state.dragging,V=L||E,X={x:(0,s.canDragX)(this)&&$?this.state.x:V.x,y:(0,s.canDragY)(this)&&$?this.state.y:V.y};this.state.isElementSVG?F=(0,i.createSVGTransform)(X,j):G=(0,i.createCSSTransform)(X,j);const I=(0,o.default)(C.props.className||"",A,{[M]:this.state.dragging,[D]:this.state.dragged});return t.createElement(l.default,h({},Q,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(C),{className:I,style:{...C.props.style,...G},transform:F}))}}e.default=x,m(x,"displayName","Draggable"),m(x,"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(x,"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})})(k5);const{default:j5,DraggableCore:qZ}=k5;F0.exports=j5;F0.exports.default=j5;F0.exports.DraggableCore=qZ;var $5=F0.exports,B0={exports:{}},pp={},OC={};OC.__esModule=!0;OC.cloneElement=JZ;var YZ=KZ(T);function KZ(e){return e&&e.__esModule?e:{default:e}}function Gk(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 qk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Gk(Object(n),!0).forEach(function(r){XZ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XZ(e,t,n){return t=QZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QZ(e){var t=ZZ(e,"string");return typeof t=="symbol"?t:String(t)}function ZZ(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);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function JZ(e,t){return t.style&&e.props.style&&(t.style=qk(qk({},e.props.style),t.style)),t.className&&e.props.className&&(t.className=e.props.className+" "+t.className),YZ.default.cloneElement(e,t)}var gp={};gp.__esModule=!0;gp.resizableProps=void 0;var bt=eJ(rl);function eJ(e){return e&&e.__esModule?e:{default:e}}var tJ={axis:bt.default.oneOf(["both","x","y","none"]),className:bt.default.string,children:bt.default.element.isRequired,draggableOpts:bt.default.shape({allowAnyClick:bt.default.bool,cancel:bt.default.string,children:bt.default.node,disabled:bt.default.bool,enableUserSelectHack:bt.default.bool,offsetParent:bt.default.node,grid:bt.default.arrayOf(bt.default.number),handle:bt.default.string,nodeRef:bt.default.object,onStart:bt.default.func,onDrag:bt.default.func,onStop:bt.default.func,onMouseDown:bt.default.func,scale:bt.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=bt.default.number).isRequired.apply(i,n)}return bt.default.number.apply(bt.default,n)},handle:bt.default.oneOfType([bt.default.node,bt.default.func]),handleSize:bt.default.arrayOf(bt.default.number),lockAspectRatio:bt.default.bool,maxConstraints:bt.default.arrayOf(bt.default.number),minConstraints:bt.default.arrayOf(bt.default.number),onResizeStop:bt.default.func,onResizeStart:bt.default.func,onResize:bt.default.func,resizeHandles:bt.default.arrayOf(bt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:bt.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=bt.default.number).isRequired.apply(i,n)}return bt.default.number.apply(bt.default,n)}};gp.resizableProps=tJ;pp.__esModule=!0;pp.default=void 0;var bf=sJ(T),nJ=$5,rJ=OC,oJ=gp,iJ=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function z5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(z5=function(o){return o?n:t})(e)}function sJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=z5(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 U1(){return U1=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},U1.apply(this,arguments)}function aJ(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 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 Ax(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){lJ(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 lJ(e,t,n){return t=cJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cJ(e){var t=uJ(e,"string");return typeof t=="symbol"?t:String(t)}function uJ(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);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function dJ(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,G1(e,t)}function G1(e,t){return G1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},G1(e,t)}var MC=function(e){dJ(t,e);function t(){for(var r,o=arguments.length,i=new Array(o),s=0;s<o;s++)i[s]=arguments[s];return r=e.call.apply(e,[this].concat(i))||this,r.handleRefs={},r.lastHandleRect=null,r.slack=null,r}var n=t.prototype;return n.componentWillUnmount=function(){this.resetData()},n.resetData=function(){this.lastHandleRect=this.slack=null},n.runConstraints=function(o,i){var s=this.props,a=s.minConstraints,l=s.maxConstraints,c=s.lockAspectRatio;if(!a&&!l&&!c)return[o,i];if(c){var u=this.props.width/this.props.height,d=o-this.props.width,p=i-this.props.height;Math.abs(d)>Math.abs(p*u)?i=o/u:o=i*u}var h=o,m=i,b=this.slack||[0,0],v=b[0],x=b[1];return o+=v,i+=x,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=[v+(h-o),x+(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 p=(s.props.axis==="both"||s.props.axis==="x")&&i!=="n"&&i!=="s",h=(s.props.axis==="both"||s.props.axis==="y")&&i!=="e"&&i!=="w";if(!(!p&&!h)){var m=i[0],b=i[i.length-1],v=c.getBoundingClientRect();if(s.lastHandleRect!=null){if(b==="w"){var x=v.left-s.lastHandleRect.left;u+=x}if(m==="n"){var w=v.top-s.lastHandleRect.top;d+=w}}s.lastHandleRect=v,b==="w"&&(u=-u),m==="n"&&(d=-d);var _=s.props.width+(p?u/s.props.transformScale:0),R=s.props.height+(h?d/s.props.transformScale:0),C=s.runConstraints(_,R);_=C[0],R=C[1];var E=_!==s.props.width||R!==s.props.height,A=typeof s.props[o]=="function"?s.props[o]:null,M=o==="onResize"&&!E;A&&!M&&(a.persist==null||a.persist(),A(a,{node:c,size:{width:_,height:R},handle:i})),o==="onResizeStop"&&s.resetData()}}},n.renderResizeHandle=function(o,i){var s=this.props.handle;if(!s)return bf.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=Ax({ref:i},a?{}:{handleAxis:o});return bf.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=aJ(i,iJ);return(0,rJ.cloneElement)(s,Ax(Ax({},u),{},{className:(a?a+" ":"")+"react-resizable",children:[].concat(s.props.children,c.map(function(d){var p,h=(p=o.handleRefs[d])!=null?p:o.handleRefs[d]=bf.createRef();return bf.createElement(nJ.DraggableCore,U1({},l,{nodeRef:h,key:"resizableHandle-"+d,onStop:o.resizeHandler("onResizeStop",d),onStart:o.resizeHandler("onResizeStart",d),onDrag:o.resizeHandler("onResize",d)}),o.renderResizeHandle(d,h))}))}))},t}(bf.Component);pp.default=MC;MC.propTypes=oJ.resizableProps;MC.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1};var H0={};H0.__esModule=!0;H0.default=void 0;var Ox=mJ(T),fJ=B5(rl),hJ=B5(pp),pJ=gp,gJ=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function B5(e){return e&&e.__esModule?e:{default:e}}function H5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(H5=function(o){return o?n:t})(e)}function mJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=H5(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 q1(){return q1=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},q1.apply(this,arguments)}function Kk(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 yb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Kk(Object(n),!0).forEach(function(r){bJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kk(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function bJ(e,t,n){return t=yJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yJ(e){var t=vJ(e,"string");return typeof t=="symbol"?t:String(t)}function vJ(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xJ(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 wJ(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Y1(e,t)}function Y1(e,t){return Y1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Y1(e,t)}var V5=function(e){wJ(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,p=o.lockAspectRatio,h=o.axis;o.width,o.height;var m=o.resizeHandles,b=o.style,v=o.transformScale,x=xJ(o,gJ);return Ox.createElement(hJ.default,{axis:h,draggableOpts:c,handle:i,handleSize:s,height:this.state.height,lockAspectRatio:p,maxConstraints:d,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:l,resizeHandles:m,transformScale:v,width:this.state.width},Ox.createElement("div",q1({},x,{style:yb(yb({},b),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},t}(Ox.Component);H0.default=V5;V5.propTypes=yb(yb({},pJ.resizableProps),{},{children:fJ.default.element});B0.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")};B0.exports.Resizable=pp.default;B0.exports.ResizableBox=H0.default;var SJ=B0.exports,ea={};Object.defineProperty(ea,"__esModule",{value:!0});ea.resizeHandleType=ea.resizeHandleAxesType=ea.default=void 0;var xt=W5(rl),_J=W5(T);function W5(e){return e&&e.__esModule?e:{default:e}}const CJ=ea.resizeHandleAxesType=xt.default.arrayOf(xt.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),EJ=ea.resizeHandleType=xt.default.oneOfType([xt.default.node,xt.default.func]);ea.default={className:xt.default.string,style:xt.default.object,width:xt.default.number,autoSize:xt.default.bool,cols:xt.default.number,draggableCancel:xt.default.string,draggableHandle:xt.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:xt.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;t!==void 0&&Tt.validateLayout(t,"layout")},margin:xt.default.arrayOf(xt.default.number),containerPadding:xt.default.arrayOf(xt.default.number),rowHeight:xt.default.number,maxRows:xt.default.number,isBounded:xt.default.bool,isDraggable:xt.default.bool,isResizable:xt.default.bool,allowOverlap:xt.default.bool,preventCollision:xt.default.bool,useCSSTransforms:xt.default.bool,transformScale:xt.default.number,isDroppable:xt.default.bool,resizeHandles:CJ,resizeHandle:EJ,onLayoutChange:xt.default.func,onDragStart:xt.default.func,onDrag:xt.default.func,onDragStop:xt.default.func,onResizeStart:xt.default.func,onResize:xt.default.func,onResizeStop:xt.default.func,onDrop:xt.default.func,droppingItem:xt.default.shape({i:xt.default.string.isRequired,w:xt.default.number.isRequired,h:xt.default.number.isRequired}),children:function(e,t){const n=e[t],r={};_J.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:xt.default.any};Object.defineProperty(L0,"__esModule",{value:!0});L0.default=void 0;var au=IC(T),qt=IC(rl),RJ=$5,PJ=SJ,lu=Tt,gr=bs,Xk=ea,TJ=IC(bC);function IC(e){return e&&e.__esModule?e:{default:e}}function Vi(e,t,n){return t=kJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kJ(e){var t=AJ(e,"string");return typeof t=="symbol"?t:String(t)}function AJ(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);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class DC extends au.default.Component{constructor(){super(...arguments),Vi(this,"state",{resizing:null,dragging:null,className:""}),Vi(this,"elementRef",au.default.createRef()),Vi(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,p=c.top/i,h=l.top/i;s.left=u-d+a.scrollLeft,s.top=p-h+a.scrollTop,this.setState({dragging:s});const{x:m,y:b}=(0,gr.calcXY)(this.getPositionParams(),s.top,s.left,this.props.w,this.props.h);return o.call(this,this.props.i,m,b,{e:t,node:r,newPosition:s})}),Vi(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:p,containerWidth:h}=this.props,m=this.getPositionParams();if(c){const{offsetParent:w}=r;if(w){const{margin:_,rowHeight:R,containerPadding:C}=this.props,E=w.clientHeight-(0,gr.calcGridItemWHPx)(p,R,_[1]);a=(0,gr.clamp)(a-C[1],0,E);const A=(0,gr.calcGridColWidth)(m),M=h-(0,gr.calcGridItemWHPx)(d,A,_[0]);l=(0,gr.clamp)(l-C[0],0,M)}}const b={top:a,left:l};this.setState({dragging:b});const{x:v,y:x}=(0,gr.calcXY)(m,a,l,d,p);return s.call(this,u,v,x,{e:t,node:r,newPosition:b})}),Vi(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:p}=(0,gr.calcXY)(this.getPositionParams(),c,l,i,s);return o.call(this,a,d,p,{e:t,node:r,newPosition:u})}),Vi(this,"onResizeStop",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStop")),Vi(this,"onResizeStart",(t,n,r)=>this.onResizeHandler(t,n,r,"onResizeStart")),Vi(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,gr.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,gr.calcGridItemPosition)(this.getPositionParams(t),t.x,t.y,t.w,t.h,n);return!(0,lu.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,lu.setTransform)(t):(i=(0,lu.setTopLeft)(t),n&&(i.left=(0,lu.perc)(t.left/r),i.width=(0,lu.perc)(t.width/r))),i}mixinDraggable(t,n){return au.default.createElement(RJ.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,p=this.getPositionParams(),h=(0,gr.calcGridItemPosition)(p,0,0,o,0).width,m=(0,gr.calcGridItemPosition)(p,0,0,i,s),b=(0,gr.calcGridItemPosition)(p,0,0,a,l),v=[m.width,m.height],x=[Math.min(b.width,h),Math.min(b.height,1/0)];return au.default.createElement(PJ.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:n.width,height:n.height,minConstraints:v,maxConstraints:x,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:p,minH:h,containerWidth:m}=this.props,{minW:b,maxW:v}=this.props;let x=s;i&&(x=(0,lu.resizeItemInDirection)(a,r,s,m),this.setState({resizing:o==="onResizeStop"?null:x}));let{w,h:_}=(0,gr.calcWH)(this.getPositionParams(),x.width,x.height,c,u,a);w=(0,gr.clamp)(w,Math.max(b,1),v),_=(0,gr.clamp)(_,h,p),l.call(this,d,w,_,{e:t,node:i,size:x,handle:a})}render(){const{x:t,y:n,w:r,h:o,isDraggable:i,isResizable:s,droppingPosition:a,useCSSTransforms:l}=this.props,c=(0,gr.calcGridItemPosition)(this.getPositionParams(),t,n,r,o,this.state),u=au.default.Children.only(this.props.children);let d=au.default.cloneElement(u,{ref:this.elementRef,className:(0,TJ.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}}L0.default=DC;Vi(DC,"propTypes",{children:qt.default.element,cols:qt.default.number.isRequired,containerWidth:qt.default.number.isRequired,rowHeight:qt.default.number.isRequired,margin:qt.default.array.isRequired,maxRows:qt.default.number.isRequired,containerPadding:qt.default.array.isRequired,x:qt.default.number.isRequired,y:qt.default.number.isRequired,w:qt.default.number.isRequired,h:qt.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:qt.default.string.isRequired,resizeHandles:Xk.resizeHandleAxesType,resizeHandle:Xk.resizeHandleType,onDragStop:qt.default.func,onDragStart:qt.default.func,onDrag:qt.default.func,onResizeStop:qt.default.func,onResizeStart:qt.default.func,onResize:qt.default.func,isDraggable:qt.default.bool.isRequired,isResizable:qt.default.bool.isRequired,isBounded:qt.default.bool.isRequired,static:qt.default.bool,useCSSTransforms:qt.default.bool.isRequired,transformScale:qt.default.number,className:qt.default.string,handle:qt.default.string,cancel:qt.default.string,droppingPosition:qt.default.shape({e:qt.default.object.isRequired,left:qt.default.number.isRequired,top:qt.default.number.isRequired})});Vi(DC,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1});Object.defineProperty(hp,"__esModule",{value:!0});hp.default=void 0;var Sl=DJ(T),Mx=mC,OJ=NC(bC),ot=Tt,MJ=bs,Qk=NC(L0),IJ=NC(ea);function NC(e){return e&&e.__esModule?e:{default:e}}function U5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(U5=function(r){return r?n:t})(e)}function DJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=U5(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},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 Rr(e,t,n){return t=NJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NJ(e){var t=LJ(e,"string");return typeof t=="symbol"?t:String(t)}function LJ(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);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const Zk="react-grid-layout";let G5=!1;try{G5=/firefox/i.test(navigator.userAgent)}catch{}class V0 extends Sl.Component{constructor(){super(...arguments),Rr(this,"state",{activeDrag:null,layout:(0,ot.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,ot.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),Rr(this,"dragEnterCounter",0),Rr(this,"onDragStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,ot.getLayoutItem)(a,t);if(!l)return;const c={w:l.w,h:l.h,x:l.x,y:l.y,placeholder:!0,i:t};return this.setState({oldDragItem:(0,ot.cloneLayoutItem)(l),oldLayout:a,activeDrag:c}),this.props.onDragStart(a,l,l,null,i,s)}),Rr(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,p=(0,ot.getLayoutItem)(l,t);if(!p)return;const h={w:p.w,h:p.h,x:p.x,y:p.y,placeholder:!0,i:t};l=(0,ot.moveElement)(l,p,n,r,!0,d,(0,ot.compactType)(this.props),c,u),this.props.onDrag(l,a,p,h,i,s),this.setState({layout:u?l:(0,ot.compact)(l,(0,ot.compactType)(this.props),c),activeDrag:h})}),Rr(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,p=(0,ot.getLayoutItem)(l,t);if(!p)return;l=(0,ot.moveElement)(l,p,n,r,!0,u,(0,ot.compactType)(this.props),c,d);const m=d?l:(0,ot.compact)(l,(0,ot.compactType)(this.props),c);this.props.onDragStop(m,a,p,null,i,s);const{oldLayout:b}=this.state;this.setState({activeDrag:null,layout:m,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(m,b)}),Rr(this,"onResizeStart",(t,n,r,o)=>{let{e:i,node:s}=o;const{layout:a}=this.state,l=(0,ot.getLayoutItem)(a,t);l&&(this.setState({oldResizeItem:(0,ot.cloneLayoutItem)(l),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(a,l,l,null,i,s))}),Rr(this,"onResize",(t,n,r,o)=>{let{e:i,node:s,size:a,handle:l}=o;const{oldResizeItem:c}=this.state,{layout:u}=this.state,{cols:d,preventCollision:p,allowOverlap:h}=this.props;let m=!1,b,v,x;const[w,_]=(0,ot.withLayoutItem)(u,t,C=>{let E;return v=C.x,x=C.y,["sw","w","nw","n","ne"].indexOf(l)!==-1&&(["sw","nw","w"].indexOf(l)!==-1&&(v=C.x+(C.w-n),n=C.x!==v&&v<0?C.w:n,v=v<0?0:v),["ne","n","nw"].indexOf(l)!==-1&&(x=C.y+(C.h-r),r=C.y!==x&&x<0?C.h:r,x=x<0?0:x),m=!0),p&&!h&&(E=(0,ot.getAllCollisions)(u,{...C,w:n,h:r,x:v,y:x}).filter(M=>M.i!==C.i).length>0,E&&(x=C.y,r=C.h,v=C.x,n=C.w,m=!1)),C.w=n,C.h=r,C});if(!_)return;b=w,m&&(b=(0,ot.moveElement)(w,_,v,x,!0,this.props.preventCollision,(0,ot.compactType)(this.props),d,h));const R={w:_.w,h:_.h,x:_.x,y:_.y,static:!0,i:t};this.props.onResize(b,c,_,R,i,s),this.setState({layout:h?b:(0,ot.compact)(b,(0,ot.compactType)(this.props),d),activeDrag:R})}),Rr(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,ot.getLayoutItem)(a,t),p=u?a:(0,ot.compact)(a,(0,ot.compactType)(this.props),c);this.props.onResizeStop(p,l,d,null,i,s);const{oldLayout:h}=this.state;this.setState({activeDrag:null,layout:p,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(p,h)}),Rr(this,"onDragOver",t=>{var w;if(t.preventDefault(),t.stopPropagation(),G5&&!((w=t.nativeEvent.target)!=null&&w.classList.contains(Zk)))return!1;const{droppingItem:n,onDropDragOver:r,margin:o,cols:i,rowHeight:s,maxRows:a,width:l,containerPadding:c,transformScale:u}=this.props,d=r==null?void 0:r(t);if(d===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const p={...n,...d},{layout:h}=this.state,m=t.currentTarget.getBoundingClientRect(),b=t.clientX-m.left,v=t.clientY-m.top,x={left:b/u,top:v/u,e:t};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:_,top:R}=this.state.droppingPosition;(_!=b||R!=v)&&this.setState({droppingPosition:x})}}else{const _={cols:i,margin:o,maxRows:a,rowHeight:s,containerWidth:l,containerPadding:c||o},R=(0,MJ.calcXY)(_,v,b,p.w,p.h);this.setState({droppingDOMNode:Sl.createElement("div",{key:p.i}),droppingPosition:x,layout:[...h,{...p,x:R.x,y:R.y,static:!1,isDraggable:!0}]})}}),Rr(this,"removeDroppingPlaceholder",()=>{const{droppingItem:t,cols:n}=this.props,{layout:r}=this.state,o=(0,ot.compact)(r.filter(i=>i.i!==t.i),(0,ot.compactType)(this.props),n,this.props.allowOverlap);this.setState({layout:o,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),Rr(this,"onDragLeave",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),Rr(this,"onDragEnter",t=>{t.preventDefault(),t.stopPropagation(),this.dragEnterCounter++}),Rr(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,Mx.deepEqual)(t.layout,n.propsLayout)||t.compactType!==n.compactType?r=t.layout:(0,ot.childrenEqual)(t.children,n.children)||(r=n.layout),r?{layout:(0,ot.synchronizeLayoutWithChildren)(r,t.children,t.cols,(0,ot.compactType)(t),t.allowOverlap),compactType:t.compactType,children:t.children,propsLayout:t.layout}:null)}shouldComponentUpdate(t,n){return this.props.children!==t.children||!(0,ot.fastRGLPropsEqual)(this.props,t,Mx.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,ot.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,Mx.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 Sl.createElement(Qk.default,{w:t.w,h:t.h,x:t.x,y:t.y,i:t.i,className:`react-grid-placeholder ${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},Sl.createElement("div",null))}processGridItem(t,n){if(!t||!t.key)return;const r=(0,ot.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:p,useCSSTransforms:h,transformScale:m,draggableCancel:b,draggableHandle:v,resizeHandles:x,resizeHandle:w}=this.props,{mounted:_,droppingPosition:R}=this.state,C=typeof r.isDraggable=="boolean"?r.isDraggable:!r.static&&u,E=typeof r.isResizable=="boolean"?r.isResizable:!r.static&&d,A=r.resizeHandles||x,M=C&&p&&r.isBounded!==!1;return Sl.createElement(Qk.default,{containerWidth:o,cols:i,margin:s,containerPadding:a||s,maxRows:c,rowHeight:l,cancel:b,handle:v,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:C,isResizable:E,isBounded:M,useCSSTransforms:h&&_,usePercentages:!_,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:w},t)}render(){const{className:t,style:n,isDroppable:r,innerRef:o}=this.props,i=(0,OJ.default)(Zk,t),s={height:this.containerHeight(),...n};return Sl.createElement("div",{ref:o,className:i,style:s,onDrop:r?this.onDrop:ot.noop,onDragLeave:r?this.onDragLeave:ot.noop,onDragEnter:r?this.onDragEnter:ot.noop,onDragOver:r?this.onDragOver:ot.noop},Sl.Children.map(this.props.children,a=>this.processGridItem(a)),r&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}hp.default=V0;Rr(V0,"displayName","ReactGridLayout");Rr(V0,"propTypes",IJ.default);Rr(V0,"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:ot.noop,onDragStart:ot.noop,onDrag:ot.noop,onDragStop:ot.noop,onResizeStart:ot.noop,onResize:ot.noop,onResizeStop:ot.noop,onDrop:ot.noop,onDropDragOver:ot.noop});var W0={},jc={};Object.defineProperty(jc,"__esModule",{value:!0});jc.findOrGenerateResponsiveLayout=$J;jc.getBreakpointFromWidth=FJ;jc.getColsFromBreakpoint=jJ;jc.sortBreakpoints=LC;var Vg=Tt;function FJ(e,t){const n=LC(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 jJ(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]}function $J(e,t,n,r,o,i){if(e[n])return(0,Vg.cloneLayout)(e[n]);let s=e[r];const a=LC(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,Vg.cloneLayout)(s||[]),(0,Vg.compact)((0,Vg.correctBounds)(s,{cols:o}),i,o)}function LC(e){return Object.keys(e).sort(function(n,r){return e[n]-e[r]})}Object.defineProperty(W0,"__esModule",{value:!0});W0.default=void 0;var Jk=BJ(T),so=q5(rl),Ix=mC,Du=Tt,_l=jc,zJ=q5(hp);function q5(e){return e&&e.__esModule?e:{default:e}}function Y5(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(Y5=function(r){return r?n:t})(e)}function BJ(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=Y5(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},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 K1(){return K1=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},K1.apply(this,arguments)}function vb(e,t,n){return t=HJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HJ(e){var t=VJ(e,"string");return typeof t=="symbol"?t:String(t)}function VJ(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const eA=e=>Object.prototype.toString.call(e);function Wg(e,t){return e==null?null:Array.isArray(e)?e:e[t]}class FC extends Jk.Component{constructor(){super(...arguments),vb(this,"state",this.generateInitialState()),vb(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,_l.getBreakpointFromWidth)(n,t),s=(0,_l.getColsFromBreakpoint)(i,o),a=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,_l.findOrGenerateResponsiveLayout)(r,n,i,i,s,a),breakpoint:i,cols:s}}static getDerivedStateFromProps(t,n){if(!(0,Ix.deepEqual)(t.layouts,n.layouts)){const{breakpoint:r,cols:o}=n;return{layout:(0,_l.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,Ix.deepEqual)(this.props.breakpoints,t.breakpoints)||!(0,Ix.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,_l.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),a=this.state.breakpoint,l=(0,_l.getColsFromBreakpoint)(s,r),c={...o};if(a!==s||t.breakpoints!==n||t.cols!==r){a in c||(c[a]=(0,Du.cloneLayout)(this.state.layout));let p=(0,_l.findOrGenerateResponsiveLayout)(c,n,s,a,l,i);p=(0,Du.synchronizeLayoutWithChildren)(p,this.props.children,l,i,this.props.allowOverlap),c[s]=p,this.props.onBreakpointChange(s,l),this.props.onLayoutChange(p,c),this.setState({breakpoint:s,layout:p,cols:l})}const u=Wg(this.props.margin,s),d=Wg(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 Jk.createElement(zJ.default,K1({},u,{margin:Wg(i,this.state.breakpoint),containerPadding:Wg(s,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}}W0.default=FC;vb(FC,"propTypes",{breakpoint:so.default.string,breakpoints:so.default.object,allowOverlap:so.default.bool,cols:so.default.object,margin:so.default.oneOfType([so.default.array,so.default.object]),containerPadding:so.default.oneOfType([so.default.array,so.default.object]),layouts(e,t){if(eA(e[t])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+eA(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,Du.validateLayout)(e.layouts[n],"layouts."+n)})},width:so.default.number.isRequired,onBreakpointChange:so.default.func,onLayoutChange:so.default.func,onWidthChange:so.default.func});vb(FC,"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:Du.noop,onLayoutChange:Du.noop,onWidthChange:Du.noop});var jC={},K5=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}()}(),X1=typeof window<"u"&&typeof document<"u"&&window.document===document,xb=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")()}(),WJ=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(xb):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),UJ=2;function GJ(e,t){var n=!1,r=!1,o=0;function i(){n&&(n=!1,e()),r&&a()}function s(){WJ(i)}function a(){var l=Date.now();if(n){if(l-o<UJ)return;r=!0}else n=!0,r=!1,setTimeout(s,t);o=l}return a}var qJ=20,YJ=["top","right","bottom","left","width","height","size","weight"],KJ=typeof MutationObserver<"u",XJ=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=GJ(this.refresh.bind(this),qJ)}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(){!X1||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),KJ?(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(){!X1||!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=YJ.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}(),X5=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},ld=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||xb},Q5=U0(0,0,0,0);function wb(e){return parseFloat(e)||0}function tA(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+wb(i)},0)}function QJ(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]=wb(s)}return n}function ZJ(e){var t=e.getBBox();return U0(0,0,t.width,t.height)}function JJ(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return Q5;var r=ld(e).getComputedStyle(e),o=QJ(r),i=o.left+o.right,s=o.top+o.bottom,a=wb(r.width),l=wb(r.height);if(r.boxSizing==="border-box"&&(Math.round(a+i)!==t&&(a-=tA(r,"left","right")+i),Math.round(l+s)!==n&&(l-=tA(r,"top","bottom")+s)),!tee(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 U0(o.left,o.top,a,l)}var eee=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ld(e).SVGGraphicsElement}:function(e){return e instanceof ld(e).SVGElement&&typeof e.getBBox=="function"}}();function tee(e){return e===ld(e).document.documentElement}function nee(e){return X1?eee(e)?ZJ(e):JJ(e):Q5}function ree(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 X5(s,{x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:o+n,left:t}),s}function U0(e,t,n,r){return{x:e,y:t,width:n,height:r}}var oee=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=U0(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=nee(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}(),iee=function(){function e(t,n){var r=ree(n);X5(this,{target:t,contentRect:r})}return e}(),see=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new K5,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 ld(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new oee(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 ld(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 iee(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}(),Z5=typeof WeakMap<"u"?new WeakMap:new K5,J5=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=XJ.getInstance(),r=new see(t,n,this);Z5.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){J5.prototype[e]=function(){var t;return(t=Z5.get(this))[e].apply(t,arguments)}});var aee=function(){return typeof xb.ResizeObserver<"u"?xb.ResizeObserver:J5}();const lee=Object.freeze(Object.defineProperty({__proto__:null,default:aee},Symbol.toStringTag,{value:"Module"})),cee=V_(lee);Object.defineProperty(jC,"__esModule",{value:!0});jC.default=bee;var Ug=hee(T),uee=$C(rl),dee=$C(cee),fee=$C(bC);function $C(e){return e&&e.__esModule?e:{default:e}}function eL(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(eL=function(r){return r?n:t})(e)}function hee(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=eL(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},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 Q1(){return Q1=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},Q1.apply(this,arguments)}function cu(e,t,n){return t=pee(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pee(e){var t=gee(e,"string");return typeof t=="symbol"?t:String(t)}function gee(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);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}const mee="react-grid-layout";function bee(e){var t;return t=class extends Ug.Component{constructor(){super(...arguments),cu(this,"state",{width:1280}),cu(this,"elementRef",Ug.createRef()),cu(this,"mounted",!1),cu(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new dee.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?Ug.createElement("div",{className:(0,fee.default)(this.props.className,mee),style:this.props.style,ref:this.elementRef}):Ug.createElement(e,Q1({innerRef:this.elementRef},o,this.state))}},cu(t,"defaultProps",{measureBeforeMount:!1}),cu(t,"propTypes",{measureBeforeMount:uee.default.bool}),t}(function(e){e.exports=hp.default,e.exports.utils=Tt,e.exports.calculateUtils=bs,e.exports.Responsive=W0.default,e.exports.Responsive.utils=jc,e.exports.WidthProvider=jC.default})(p5);var nA=p5.exports;function ol(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 yee=["color"],vee=T.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ol(e,yee);return T.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}),T.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"}))}),xee=["color"],zC=T.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ol(e,xee);return T.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}),T.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"}))}),wee=["color"],tL=T.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ol(e,wee);return T.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}),T.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"}))}),See=["color"],_ee=T.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ol(e,See);return T.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}),T.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"}))}),Cee=["color"],Eee=T.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ol(e,Cee);return T.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}),T.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"}))}),Ree=["color"],Pee=T.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ol(e,Ree);return T.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}),T.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"}))}),Tee=["color"],nL=T.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ol(e,Tee);return T.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}),T.createElement("path",{d:"M4 6H11L7.5 10.5L4 6Z",fill:r}))}),kee=["color"],rL=T.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ol(e,kee);return T.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}),T.createElement("path",{d:"M4 9H11L7.5 4.5L4 9Z",fill:r}))});let Gg;const Aee=new Uint8Array(16);function Oee(){if(!Gg&&(Gg=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Gg))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Gg(Aee)}const mr=[];for(let e=0;e<256;++e)mr.push((e+256).toString(16).slice(1));function Mee(e,t=0){return mr[e[t+0]]+mr[e[t+1]]+mr[e[t+2]]+mr[e[t+3]]+"-"+mr[e[t+4]]+mr[e[t+5]]+"-"+mr[e[t+6]]+mr[e[t+7]]+"-"+mr[e[t+8]]+mr[e[t+9]]+"-"+mr[e[t+10]]+mr[e[t+11]]+mr[e[t+12]]+mr[e[t+13]]+mr[e[t+14]]+mr[e[t+15]]}const Iee=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),rA={randomUUID:Iee};function Ua(e,t,n){if(rA.randomUUID&&!e)return rA.randomUUID();e=e||{};const r=e.random||(e.rng||Oee)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Mee(r)}const go=mN()(_N((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:Ua(),title:"Editor Card",description:"Description",type:"bar",data:[]},frame:{id:Ua(),cards:[],activeCardId:""},actions:{updateCardTab:(n,r)=>{e(o=>{const i=o.frame,s={...i,cards:i.cards.map(l=>l.id===r.id?r:l),activeCardId:n};o.frame=s;const a=s.cards.find(l=>l.id===n);o.card=a})},setActiveTabCardId:n=>{e(r=>{r.activeTabCardId=n})},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}}})},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})},switchCardType:n=>{e(r=>{r.card.type=n,r.card.sql="",r.card.python="",r.card.cfg={},r.card.customCfg={},r.card.preferences={}})},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})}}}))),mp=()=>go(e=>e.actions);function Dee(e){return/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(e)}function Nee(e,t=1){if(!Dee(e)||t===1)return e;e=e.replace(/^#/,"");const n=parseInt(e.substring(0,2),16),r=parseInt(e.substring(2,4),16),o=parseInt(e.substring(4,6),16);return t=Math.min(Math.max(t,0),1),`rgba(${n}, ${r}, ${o}, ${t})`}function Lee(e,t,n,r=1){var c,u,d,p;const o=n==null?void 0:n.datasetOptions,i=ye.getState().themeStyle,s=(u=(c=i==null?void 0:i.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,a=(p=(d=i==null?void 0:i.chart)==null?void 0:d.dataset)==null?void 0:p.borderColor;return e.map((h,m)=>{var R;const b=o==null?void 0:o.find(C=>C.idx===m),v=Nee(s==null?void 0:s[m%s.length],r),x=a==null?void 0:a[m%a.length],w=a==null?void 0:a[m%a.length];return{label:h.charAt(0).toUpperCase()+h.slice(1),data:t.map(C=>C[h]),...b,datalabels:{...b==null?void 0:b.datalabels,color:Fee((R=b==null?void 0:b.datalabels)==null?void 0:R.align,v)},backgroundColor:v,pointBackgroundColor:x,borderColor:w}})}function Fee(e,t){return ad(e==="end"||e==="start"?Rh():t)}function jee(e){var a,l,c,u;const{metricKeys:t,dimensionKeys:n}=lr(e);let r=[];const o=ye.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(p=>({x:p[t[0]],y:p[t[1]],r:p[t[2]],label:p[n==null?void 0:n[0]]}));r=[{label:n==null?void 0:n[0],data:d}]}return(n==null?void 0:n.length)>1&&(r=[...new Set(e.map(p=>p[n==null?void 0:n[1]]))].map((p,h)=>{const m=e.filter(b=>b[n==null?void 0:n[1]]===p);return{label:p,data:m.map(b=>({x:b[t[0]],y:b[t[1]],r:b[t[2]],label:b[n==null?void 0:n[0]]})),backgroundColor:i==null?void 0:i[h%i.length],borderColor:s==null?void 0:s[h%s.length]}})),r}function $ee(e){var c,u,d,p;const{dimensionKeys:t,metricKeys:n}=lr(e),r=ye.getState().themeStyle,o=(u=(c=r==null?void 0:r.chart)==null?void 0:c.dataset)==null?void 0:u.backgroundColor,i=(p=(d=r==null?void 0:r.chart)==null?void 0:d.dataset)==null?void 0:p.borderColor,s=t==null?void 0:t[1];return[...new Set(e.map(h=>h==null?void 0:h[s]))].map((h,m)=>({label:h,data:e.filter(b=>(b==null?void 0:b[s])===h).map(b=>[b==null?void 0:b[n[0]],b==null?void 0:b[n[1]],b==null?void 0:b[n[2]]]),backgroundColor:o==null?void 0:o[m%o.length],borderColor:i==null?void 0:i[m%i.length],borderSkipped:!1}))}function zee(e,t){var s,a,l,c;const n=ye.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,p)=>(d==null?void 0:d._color)||(r==null?void 0:r[p%r.length])),borderColor:t.map((d,p)=>(d==null?void 0:d._color)||(o==null?void 0:o[p%o.length]))}))}function Bee(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 lr(e){if(!e||e.length===0)return{keys:[],dimensionKeys:[],metricKeys:[]};const t=Bee(e),n=Object.keys(e[t]),r=n.filter(i=>{var s,a,l,c,u,d,p,h;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((p=e==null?void 0:e[2])==null?void 0:p[i])&&typeof((h=e==null?void 0:e[2])==null?void 0:h[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 Hf(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==null?void 0:n[s],data:i.data,label:i.label})):e}function Hee(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 Sb({dataArray:e,groupKey:t,pivotKey:n,valueKey:r,sortChart:o}){const i=e.reduce((l,c)=>{const u=c[t],d=c[n],p=c[r];return l[u]||(l[u]={[t]:u}),l[u][d]=p,l},{});let s=Object.values(i);return o!=="none"&&o!==void 0&&(s=Hee(s,o)),s.map(l=>Object.fromEntries(Object.entries(l).filter(([c,u])=>u!==0)))}function ho(e,t){var s;const n=ye.getState().themeStyle,r=(s=n==null?void 0:n.chart)==null?void 0:s.options,o=rc.cloneDeep(r);return rc.merge(o,e,t)}function Z1(e,t){return e.map(n=>n[t]?n[t]:"BLANK")}/**
|
|
113
|
+
* @license lucide-react v0.453.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/const Vee=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),oL=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/**
|
|
118
|
+
* @license lucide-react v0.453.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the ISC license.
|
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
+
*/var Wee={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"};/**
|
|
123
|
+
* @license lucide-react v0.453.0 - ISC
|
|
124
|
+
*
|
|
125
|
+
* This source code is licensed under the ISC license.
|
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
+
*/const iL=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>T.createElement("svg",{ref:l,...Wee,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:oL("lucide",o),...a},[...s.map(([c,u])=>T.createElement(c,u)),...Array.isArray(i)?i:[i]]));/**
|
|
128
|
+
* @license lucide-react v0.453.0 - ISC
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the ISC license.
|
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/const Bt=(e,t)=>{const n=T.forwardRef(({className:r,...o},i)=>T.createElement(iL,{ref:i,iconNode:t,className:oL(`lucide-${Vee(e)}`,r),...o}));return n.displayName=`${e}`,n};/**
|
|
133
|
+
* @license lucide-react v0.453.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/const sL=Bt("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"}]]);/**
|
|
138
|
+
* @license lucide-react v0.453.0 - ISC
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the ISC license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/const Id=Bt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
143
|
+
* @license lucide-react v0.453.0 - ISC
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the ISC license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/const bp=Bt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
148
|
+
* @license lucide-react v0.453.0 - ISC
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the ISC license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/const BC=Bt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
153
|
+
* @license lucide-react v0.453.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/const G0=Bt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
158
|
+
* @license lucide-react v0.453.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/const aL=Bt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
163
|
+
* @license lucide-react v0.453.0 - ISC
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the ISC license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/const HC=Bt("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
|
|
168
|
+
* @license lucide-react v0.453.0 - ISC
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the ISC license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/const VC=Bt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
|
|
173
|
+
* @license lucide-react v0.453.0 - ISC
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the ISC license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/const lL=Bt("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"}]]);/**
|
|
178
|
+
* @license lucide-react v0.453.0 - ISC
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the ISC license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/const cL=Bt("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
183
|
+
* @license lucide-react v0.453.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/const uL=Bt("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
188
|
+
* @license lucide-react v0.453.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/const WC=Bt("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"}]]);/**
|
|
193
|
+
* @license lucide-react v0.453.0 - ISC
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the ISC license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/const dL=Bt("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
198
|
+
* @license lucide-react v0.453.0 - ISC
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the ISC license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/const fL=Bt("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"}]]);/**
|
|
203
|
+
* @license lucide-react v0.453.0 - ISC
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the ISC license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/const hL=Bt("IdCard",[["path",{d:"M16 10h2",key:"8sgtl7"}],["path",{d:"M16 14h2",key:"epxaof"}],["path",{d:"M6.17 15a3 3 0 0 1 5.66 0",key:"n6f512"}],["circle",{cx:"9",cy:"11",r:"2",key:"yxgjnd"}],["rect",{x:"2",y:"5",width:"20",height:"14",rx:"2",key:"qneu4z"}]]);/**
|
|
208
|
+
* @license lucide-react v0.453.0 - ISC
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the ISC license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/const pL=Bt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
213
|
+
* @license lucide-react v0.453.0 - ISC
|
|
214
|
+
*
|
|
215
|
+
* This source code is licensed under the ISC license.
|
|
216
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
+
*/const gL=Bt("LightbulbOff",[["path",{d:"M16.8 11.2c.8-.9 1.2-2 1.2-3.2a6 6 0 0 0-9.3-5",key:"1fkcox"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M6.3 6.3a4.67 4.67 0 0 0 1.2 5.2c.7.7 1.3 1.5 1.5 2.5",key:"10m8kw"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
|
|
218
|
+
* @license lucide-react v0.453.0 - ISC
|
|
219
|
+
*
|
|
220
|
+
* This source code is licensed under the ISC license.
|
|
221
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
+
*/const mL=Bt("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
|
|
223
|
+
* @license lucide-react v0.453.0 - ISC
|
|
224
|
+
*
|
|
225
|
+
* This source code is licensed under the ISC license.
|
|
226
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
+
*/const bL=Bt("Octagon",[["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}]]);/**
|
|
228
|
+
* @license lucide-react v0.453.0 - ISC
|
|
229
|
+
*
|
|
230
|
+
* This source code is licensed under the ISC license.
|
|
231
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
+
*/const yL=Bt("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
233
|
+
* @license lucide-react v0.453.0 - ISC
|
|
234
|
+
*
|
|
235
|
+
* This source code is licensed under the ISC license.
|
|
236
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
+
*/const vL=Bt("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"}]]);/**
|
|
238
|
+
* @license lucide-react v0.453.0 - ISC
|
|
239
|
+
*
|
|
240
|
+
* This source code is licensed under the ISC license.
|
|
241
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
+
*/const xL=Bt("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
243
|
+
* @license lucide-react v0.453.0 - ISC
|
|
244
|
+
*
|
|
245
|
+
* This source code is licensed under the ISC license.
|
|
246
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
+
*/const q0=Bt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
248
|
+
* @license lucide-react v0.453.0 - ISC
|
|
249
|
+
*
|
|
250
|
+
* This source code is licensed under the ISC license.
|
|
251
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
+
*/const wL=Bt("SearchX",[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
253
|
+
* @license lucide-react v0.453.0 - ISC
|
|
254
|
+
*
|
|
255
|
+
* This source code is licensed under the ISC license.
|
|
256
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
+
*/const SL=Bt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
258
|
+
* @license lucide-react v0.453.0 - ISC
|
|
259
|
+
*
|
|
260
|
+
* This source code is licensed under the ISC license.
|
|
261
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
+
*/const _L=Bt("SendHorizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
|
|
263
|
+
* @license lucide-react v0.453.0 - ISC
|
|
264
|
+
*
|
|
265
|
+
* This source code is licensed under the ISC license.
|
|
266
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
+
*/const CL=Bt("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"}]]);/**
|
|
268
|
+
* @license lucide-react v0.453.0 - ISC
|
|
269
|
+
*
|
|
270
|
+
* This source code is licensed under the ISC license.
|
|
271
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
+
*/const EL=Bt("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
|
|
273
|
+
* @license lucide-react v0.453.0 - ISC
|
|
274
|
+
*
|
|
275
|
+
* This source code is licensed under the ISC license.
|
|
276
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
+
*/const RL=Bt("Table2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]);/**
|
|
278
|
+
* @license lucide-react v0.453.0 - ISC
|
|
279
|
+
*
|
|
280
|
+
* This source code is licensed under the ISC license.
|
|
281
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
+
*/const PL=Bt("TreePalm",[["path",{d:"M13 8c0-2.76-2.46-5-5.5-5S2 5.24 2 8h2l1-1 1 1h4",key:"foxbe7"}],["path",{d:"M13 7.14A5.82 5.82 0 0 1 16.5 6c3.04 0 5.5 2.24 5.5 5h-3l-1-1-1 1h-3",key:"18arnh"}],["path",{d:"M5.89 9.71c-2.15 2.15-2.3 5.47-.35 7.43l4.24-4.25.7-.7.71-.71 2.12-2.12c-1.95-1.96-5.27-1.8-7.42.35",key:"ywahnh"}],["path",{d:"M11 15.5c.5 2.5-.17 4.5-1 6.5h4c2-5.5-.5-12-1-14",key:"ft0feo"}]]);/**
|
|
283
|
+
* @license lucide-react v0.453.0 - ISC
|
|
284
|
+
*
|
|
285
|
+
* This source code is licensed under the ISC license.
|
|
286
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
+
*/const TL=Bt("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
288
|
+
* @license lucide-react v0.453.0 - ISC
|
|
289
|
+
*
|
|
290
|
+
* This source code is licensed under the ISC license.
|
|
291
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
+
*/const kL=Bt("UserSearch",[["circle",{cx:"10",cy:"7",r:"4",key:"e45bow"}],["path",{d:"M10.3 15H7a4 4 0 0 0-4 4v2",key:"3bnktk"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["path",{d:"m21 21-1.9-1.9",key:"1g2n9r"}]]);/**
|
|
293
|
+
* @license lucide-react v0.453.0 - ISC
|
|
294
|
+
*
|
|
295
|
+
* This source code is licensed under the ISC license.
|
|
296
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
+
*/const $c=Bt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Uee=({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(`
|
|
298
|
+
`),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 y.jsx(lL,{onClick:n,className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})};var cd=1e3,ud=cd*60,dd=ud*60,Sc=dd*24,Gee=Sc*7,qee=Sc*365.25,Yee=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Kee(e);if(n==="number"&&isFinite(e))return t.long?Qee(e):Xee(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Kee(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*qee;case"weeks":case"week":case"w":return n*Gee;case"days":case"day":case"d":return n*Sc;case"hours":case"hour":case"hrs":case"hr":case"h":return n*dd;case"minutes":case"minute":case"mins":case"min":case"m":return n*ud;case"seconds":case"second":case"secs":case"sec":case"s":return n*cd;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Xee(e){var t=Math.abs(e);return t>=Sc?Math.round(e/Sc)+"d":t>=dd?Math.round(e/dd)+"h":t>=ud?Math.round(e/ud)+"m":t>=cd?Math.round(e/cd)+"s":e+"ms"}function Qee(e){var t=Math.abs(e);return t>=Sc?qg(e,t,Sc,"day"):t>=dd?qg(e,t,dd,"hour"):t>=ud?qg(e,t,ud,"minute"):t>=cd?qg(e,t,cd,"second"):e+" ms"}function qg(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}const Zee=nl(Yee);function Jee(e){const t=ye(u=>u.selectedSheetId),n=ye(u=>u.selectedLensId);ye(u=>u.dashboard.baseQueries);const r=ye(u=>u.dashboard.filters),o=ye(u=>u.filterValues),i=r==null?void 0:r.filter(u=>u.sheetId===t||!u.sheetId),s=o==null?void 0:o.filter(u=>(i==null?void 0:i.some(d=>d.id===u.filterId))||u.filterId.endsWith(t)),a=(e==null?void 0:e.sql)||"",l=ete((e==null?void 0:e.python)||"");return{queryKey:["query",e==null?void 0:e.id,e==null?void 0:e.title,a,l,n||"",JSON.stringify(s)],sql:a,sheetFilterValues:s}}function ete(e){return e===X_?"":e}function Ga(e,t){const{authToken:n}=Go(),r=ye(p=>p.isVisualEditing),o=ye(p=>p.authToken),i=Zee((e==null?void 0:e.refreshInterval)||"0"),{queryKey:s,sql:a,sheetFilterValues:l}=Jee(e);let c={};return r||(c={refetchInterval:i}),{...fp({queryKey:s,queryFn:async()=>{var p;if(!(e!=null&&e.connectionId)||!((p=e==null?void 0:e.sql)!=null&&p.trim()))return null;try{return await R0("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===X_?"":e.python,active_filters:l,cache_config:nC({card:e})})}catch(h){if(r)return{records:[],error:h};throw h}},placeholderData:PX,...c,enabled:!!(e!=null&&e.connectionId)&&!!(e!=null&&e.sql)&&!0&&!r}),queryKey:s}}function AL({frame:e}){var C;const t=ye(E=>E.isDashboardEditing),n=ye(E=>E.filterValues),r=ye(E=>E.isVisualEditing),o=ye(E=>E.selectedSheetId);ye(E=>E.currentBreakpoint);const{removeFrame:i}=ye(E=>E.actions),s=ye(E=>E.actions.setIsVisualEditing),a=go(E=>E.actions.setFilterValues),l=go(E=>E.actions.setApplyFilters),{setCard:c,setFrame:u,setQueryResultColumns:d,setActiveTabCardId:p}=mp(),h=go(E=>E.actions.setSelectedConnectionId),m=go(E=>E.actions.setSelectedDatamodelId),b=go(E=>E.actions.setSelectedDatabaseName),v=go(E=>E.actions.setSelectedSchemaName),x=go(E=>E.actions.setSelectedTableName),w=e.cards.find(E=>E.id===e.activeCardId),{data:_}=Ga(w);function R(){s(!r),c(w),p(e.activeCardId);const{dimensionKeys:E}=lr((_==null?void 0:_.records)||[]);d(E),u(e),w!=null&&w.connectionId&&h(w==null?void 0:w.connectionId),w!=null&&w.datamodelId&&w.datamodelId!=="none"&&(m(w==null?void 0:w.datamodelId),b("")),w!=null&&w.lastSelectedDatabase&&w.lastSelectedDatabase!=="none"&&(b(w==null?void 0:w.lastSelectedDatabase),m("")),w!=null&&w.lastSelectedSchema&&v(w==null?void 0:w.lastSelectedSchema),w!=null&&w.lastSelectedTable&&x(w==null?void 0:w.lastSelectedTable),n&&(a(n),l(!0))}return y.jsx("section",{onMouseDown:E=>{E.stopPropagation()},className:"absolute right-2 top-2 z-50",children:y.jsxs("div",{className:"flex items-center gap-2",children:[t&&(r?y.jsx("button",{onClick:()=>{s(!r)},children:y.jsx(_ee,{className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})}):y.jsx("button",{role:"edit-visual",onClick:R,children:y.jsx(Eee,{className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})})),t&&y.jsx("button",{onClick:()=>i(o,e.id),children:y.jsx(tL,{className:"h-[14px] w-[14px] text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})}),((C=w.preferences)==null?void 0:C.allowDownload)===!0&&y.jsx(Uee,{data:(_==null?void 0:_.records)||[],filename:w.title})]})})}function tte(e,t){ye(c=>c.selectedSheetId);const n=ye(c=>c.selectedFrameId),r=ye(c=>c.isDashboardEditing),o=ye(c=>c.isVisualEditing),{addFrame:i,getSelectedFrame:s,setSelectedFrameId:a}=ye(c=>c.actions);T.useEffect(()=>{n===e.id&&r&&!o&&l()},[n,e.id,r,o]);function l(){const c=t==null?void 0:t.current;c==null||c.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})}}const nte=T.createContext(null),Dx={didCatch:!1,error:null};class Y0 extends T.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Dx}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(Dx)}}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&&rte(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(Dx)}}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=T.createElement(r,l);else if(o!==void 0)a=o;else throw s}return T.createElement(nte.Provider,{value:{didCatch:i,error:s,resetErrorBoundary:this.resetErrorBoundary}},a)}}function rte(){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 UC({error:e}){return y.jsx("div",{className:"flex flex-col items-center justify-center",role:"alert",style:{height:"100%",width:"100%"},children:y.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md bg-muted p-10",children:[y.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),y.jsx("p",{className:"text-sm",children:"Something went wrong:"}),y.jsx("pre",{className:"text-xs",children:e.message})]})})}function ote({error:e,frame:t}){return y.jsxs("div",{className:"flex h-full flex-col items-center justify-center border",role:"alert",children:[y.jsx(AL,{frame:t}),y.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),y.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[y.jsx("p",{className:"text-lg font-semibold",children:"Oops! Looks like we tripped on a loose wire!"}),y.jsx("p",{className:"text-sm",children:"Something went wrong:"}),y.jsx("pre",{className:"text-xs",children:e.message})]})]})}function ite({error:e}){return y.jsxs("div",{className:"flex h-full flex-col items-center justify-center",role:"alert",children:[y.jsx("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10"}),y.jsxs("div",{className:"flex flex-col justify-center space-y-2 rounded-md p-10",children:[y.jsx("p",{className:"text-lg font-semibold",children:"Oops! Something went wrong!"}),y.jsx("p",{className:"text-sm",children:"Something went wrong:"}),y.jsx("pre",{className:"text-xs",children:e.message})]})]})}function ci({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 h=new Intl.NumberFormat(l,d).format(u);return n&&(h+=a),h}function GC(e,t){if(!t)return"";const n=t.find(r=>e>=r.start&&e<=r.end);return(n==null?void 0:n.color)||""}function J1(e){try{const n=new Function("getDatalabelColor",e)(_1);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 ste(e){const t=getComputedStyle(document.documentElement).getPropertyValue(e);return OL(t)}function OL(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 p=0,h=0,m=0;0<=o&&o<60?(p=c,h=u,m=0):60<=o&&o<120?(p=u,h=c,m=0):120<=o&&o<180?(p=0,h=c,m=u):180<=o&&o<240?(p=0,h=u,m=c):240<=o&&o<300?(p=u,h=0,m=c):300<=o&&o<360&&(p=c,h=0,m=u),p=Math.round((p+d)*255),h=Math.round((h+d)*255),m=Math.round((m+d)*255);const b=v=>{const x=v.toString(16);return x.length==1?"0"+x:x};return`#${b(p)}${b(h)}${b(m)}`}function Cl({data:e,cfg:t,customCfg:n,preferences:r,cardType:o}){ye.getState().themeStyle;const i=o==="radar"?.2:1,{dimensionKeys:s,metricKeys:a}=lr(e),l=Lee(a,e,r,i),c=Hf(l,n),u=s[0],d=Z1(e,u);qC(r,t),ML(r);const{options:p,plugins:h}=DL({cfg:t,preferences:r,customCfg:n});return{type:(n==null?void 0:n.type)||(t==null?void 0:t.type)||"bar",data:{labels:d,datasets:c},options:p,plugins:h}}function qC(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 ML(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 IL(e,t){var i,s,a,l,c,u,d,p,h,m,b,v;const n=qC(t,e),r=ML(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:x=>{var w,_,R,C;return ci({number:Number(x),decimalPlaces:((w=t==null?void 0:t.numberAxisFormat)==null?void 0:w.decimalPlaces)||0,useSuffix:!!((_=t==null?void 0:t.numberAxisFormat)!=null&&_.suffix),customSuffix:"",locale:((R=t==null?void 0:t.numberAxisFormat)==null?void 0:R.locale)||"",currency:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.currency)||""})}}},[r]:{...(h=(p=(d=e==null?void 0:e.options)==null?void 0:d.scales)==null?void 0:p[r])==null?void 0:h.ticks,callback:null}},plugins:{...(m=e==null?void 0:e.options)==null?void 0:m.plugins,datalabels:{...(v=(b=e==null?void 0:e.options)==null?void 0:b.plugins)==null?void 0:v.datalabels,formatter:function(x){var w,_,R,C;return ci({number:Number(x),decimalPlaces:((w=t==null?void 0:t.numberAxisFormat)==null?void 0:w.decimalPlaces)||0,useSuffix:!!((_=t==null?void 0:t.numberAxisFormat)!=null&&_.suffix),customSuffix:"",locale:((R=t==null?void 0:t.numberAxisFormat)==null?void 0:R.locale)||"",currency:((C=t==null?void 0:t.numberAxisFormat)==null?void 0:C.currency)||""})}}}}}function DL({cfg:e,preferences:t,customCfg:n}){var p,h,m,b,v,x,w,_,R,C,E,A,M,D,L,j,z,Q,G,F,H,$,V,X,I,q,U,O,ee,K,oe;const r=ye.getState().themeStyle,o=IL(e,t),i=ho((e==null?void 0:e.options)||{},t==null?void 0:t.chartOptions),s=ho(o,i),a=ho(s,(n==null?void 0:n.options)||{}),l={...a,scales:{...a==null?void 0:a.scales,x:{...(p=a==null?void 0:a.scales)==null?void 0:p.x,grid:{...(m=(h=a==null?void 0:a.scales)==null?void 0:h.x)==null?void 0:m.grid,color:(_=(w=(x=(v=(b=r==null?void 0:r.chart)==null?void 0:b.options)==null?void 0:v.scales)==null?void 0:x.x)==null?void 0:w.grid)==null?void 0:_.color}},y:{...(R=a==null?void 0:a.scales)==null?void 0:R.y,grid:{...(E=(C=a==null?void 0:a.scales)==null?void 0:C.y)==null?void 0:E.grid,color:(j=(L=(D=(M=(A=r==null?void 0:r.chart)==null?void 0:A.options)==null?void 0:M.scales)==null?void 0:D.y)==null?void 0:L.grid)==null?void 0:j.color}}},plugins:{...a==null?void 0:a.plugins,tooltip:{filter:function(Y){return Y.raw!==void 0&&Y.raw!==0},callbacks:{title:function(Y){var ie,de,he,ae,ge;const J=((ie=Y==null?void 0:Y[0])==null?void 0:ie.label)||"";if(Y.length>1){const ue=Y.reduce((Te,Le)=>{const Ae=Le.raw;return Ae!==void 0&&Ae!==0?Te+Ae:Te},0),Ee=ci({number:ue,decimalPlaces:((de=t==null?void 0:t.numberAxisFormat)==null?void 0:de.decimalPlaces)||0,useSuffix:!!((he=t==null?void 0:t.numberAxisFormat)!=null&&he.suffix),customSuffix:"",locale:((ae=t==null?void 0:t.numberAxisFormat)==null?void 0:ae.locale)||"",currency:((ge=t==null?void 0:t.numberAxisFormat)==null?void 0:ge.currency)||""});return`${J} (${Ee})`}return J},label:function(Y){var he,ae,ge,ue,Ee;const J=((he=Y==null?void 0:Y.dataset)==null?void 0:he.label)||"",ie=Y==null?void 0:Y.raw;if(ie===void 0||ie===0)return;const de=ci({number:Number(ie),decimalPlaces:((ae=t==null?void 0:t.numberAxisFormat)==null?void 0:ae.decimalPlaces)||0,useSuffix:!!((ge=t==null?void 0:t.numberAxisFormat)!=null&&ge.suffix),customSuffix:"",locale:((ue=t==null?void 0:t.numberAxisFormat)==null?void 0:ue.locale)||"",currency:((Ee=t==null?void 0:t.numberAxisFormat)==null?void 0:Ee.currency)||""});return`${J}: ${de}`},...(Q=(z=a==null?void 0:a.plugins)==null?void 0:z.tooltip)==null?void 0:Q.callbacks},...(G=a==null?void 0:a.plugins)==null?void 0:G.tooltip,backgroundColor:(V=($=(H=(F=r==null?void 0:r.chart)==null?void 0:F.options)==null?void 0:H.plugins)==null?void 0:$.tooltip)==null?void 0:V.backgroundColor,bodyColor:(U=(q=(I=(X=r==null?void 0:r.chart)==null?void 0:X.options)==null?void 0:I.plugins)==null?void 0:q.tooltip)==null?void 0:U.bodyColor,titleColor:(oe=(K=(ee=(O=r==null?void 0:r.chart)==null?void 0:O.options)==null?void 0:ee.plugins)==null?void 0:K.tooltip)==null?void 0:oe.titleColor}}},{plugins:c,options:u}=J1((t==null?void 0:t.customVisualCode)||"");return{options:ho(l,u),plugins:c}}/*!
|
|
299
|
+
* @kurkle/color v0.3.4
|
|
300
|
+
* https://github.com/kurkle/color#readme
|
|
301
|
+
* (c) 2024 Jukka Kurkela
|
|
302
|
+
* Released under the MIT License
|
|
303
|
+
*/function yp(e){return e+.5|0}const Na=(e,t,n)=>Math.max(Math.min(e,n),t);function Vf(e){return Na(yp(e*2.55),0,255)}function Ha(e){return Na(yp(e*255),0,255)}function Ws(e){return Na(yp(e/2.55)/100,0,1)}function oA(e){return Na(yp(e*100),0,100)}const ri={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},eS=[..."0123456789ABCDEF"],ate=e=>eS[e&15],lte=e=>eS[(e&240)>>4]+eS[e&15],Yg=e=>(e&240)>>4===(e&15),cte=e=>Yg(e.r)&&Yg(e.g)&&Yg(e.b)&&Yg(e.a);function ute(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&ri[e[1]]*17,g:255&ri[e[2]]*17,b:255&ri[e[3]]*17,a:t===5?ri[e[4]]*17:255}:(t===7||t===9)&&(n={r:ri[e[1]]<<4|ri[e[2]],g:ri[e[3]]<<4|ri[e[4]],b:ri[e[5]]<<4|ri[e[6]],a:t===9?ri[e[7]]<<4|ri[e[8]]:255})),n}const dte=(e,t)=>e<255?t(e):"";function fte(e){var t=cte(e)?ate:lte;return e?"#"+t(e.r)+t(e.g)+t(e.b)+dte(e.a,t):void 0}const hte=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function NL(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 pte(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 gte(e,t,n){const r=NL(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 mte(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 YC(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=mte(n,r,o,u,i),l=l*60+.5),[l|0,c||0,a]}function KC(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Ha)}function XC(e,t,n){return KC(NL,e,t,n)}function bte(e,t,n){return KC(gte,e,t,n)}function yte(e,t,n){return KC(pte,e,t,n)}function LL(e){return(e%360+360)%360}function vte(e){const t=hte.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Vf(+t[5]):Ha(+t[5]));const o=LL(+t[2]),i=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=bte(o,i,s):t[1]==="hsv"?r=yte(o,i,s):r=XC(o,i,s),{r:r[0],g:r[1],b:r[2],a:n}}function xte(e,t){var n=YC(e);n[0]=LL(n[0]+t),n=XC(n),e.r=n[0],e.g=n[1],e.b=n[2]}function wte(e){if(!e)return;const t=YC(e),n=t[0],r=oA(t[1]),o=oA(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${Ws(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}const iA={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"},sA={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 Ste(){const e={},t=Object.keys(sA),n=Object.keys(iA);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,iA[i]);i=parseInt(sA[s],16),e[a]=[i>>16&255,i>>8&255,i&255]}return e}let Kg;function _te(e){Kg||(Kg=Ste(),Kg.transparent=[0,0,0,0]);const t=Kg[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Cte=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ete(e){const t=Cte.exec(e);let n=255,r,o,i;if(t){if(t[7]!==r){const s=+t[7];n=t[8]?Vf(s):Na(s*255,0,255)}return r=+t[1],o=+t[3],i=+t[5],r=255&(t[2]?Vf(r):Na(r,0,255)),o=255&(t[4]?Vf(o):Na(o,0,255)),i=255&(t[6]?Vf(i):Na(i,0,255)),{r,g:o,b:i,a:n}}}function Rte(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Ws(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Nx=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,uu=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Pte(e,t,n){const r=uu(Ws(e.r)),o=uu(Ws(e.g)),i=uu(Ws(e.b));return{r:Ha(Nx(r+n*(uu(Ws(t.r))-r))),g:Ha(Nx(o+n*(uu(Ws(t.g))-o))),b:Ha(Nx(i+n*(uu(Ws(t.b))-i))),a:e.a+n*(t.a-e.a)}}function Xg(e,t,n){if(e){let r=YC(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=XC(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function FL(e,t){return e&&Object.assign(t||{},e)}function aA(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=Ha(e[3]))):(t=FL(e,{r:0,g:0,b:0,a:1}),t.a=Ha(t.a)),t}function Tte(e){return e.charAt(0)==="r"?Ete(e):vte(e)}let jL=class tS{constructor(t){if(t instanceof tS)return t;const n=typeof t;let r;n==="object"?r=aA(t):n==="string"&&(r=ute(t)||_te(t)||Tte(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=FL(this._rgb);return t&&(t.a=Ws(t.a)),t}set rgb(t){this._rgb=aA(t)}rgbString(){return this._valid?Rte(this._rgb):void 0}hexString(){return this._valid?fte(this._rgb):void 0}hslString(){return this._valid?wte(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=Pte(this._rgb,t._rgb,n)),this}clone(){return new tS(this.rgb)}alpha(t){return this._rgb.a=Ha(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=yp(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 Xg(this._rgb,2,t),this}darken(t){return Xg(this._rgb,2,-t),this}saturate(t){return Xg(this._rgb,1,t),this}desaturate(t){return Xg(this._rgb,1,-t),this}rotate(t){return xte(this._rgb,t),this}};/*!
|
|
304
|
+
* Chart.js v4.4.8
|
|
305
|
+
* https://www.chartjs.org
|
|
306
|
+
* (c) 2025 Chart.js Contributors
|
|
307
|
+
* Released under the MIT License
|
|
308
|
+
*/function Ns(){}const kte=(()=>{let e=0;return()=>e++})();function ht(e){return e==null}function Sn(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 Mt(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Nn(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function No(e,t){return Nn(e)?e:t}function it(e,t){return typeof e>"u"?t:e}const Ate=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,$L=(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 en(e,t,n,r){let o,i,s;if(Sn(e))for(i=e.length,o=0;o<i;o++)t.call(n,e[o],o);else if(Mt(e))for(s=Object.keys(e),i=s.length,o=0;o<i;o++)t.call(n,e[s[o]],s[o])}function _b(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 Cb(e){if(Sn(e))return e.map(Cb);if(Mt(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let o=0;for(;o<r;++o)t[n[o]]=Cb(e[n[o]]);return t}return e}function zL(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Ote(e,t,n,r){if(!zL(e))return;const o=t[e],i=n[e];Mt(o)&&Mt(i)?dr(o,i,r):t[e]=Cb(i)}function dr(e,t,n){const r=Sn(t)?t:[t],o=r.length;if(!Mt(e))return e;n=n||{};const i=n.merger||Ote;let s;for(let a=0;a<o;++a){if(s=r[a],!Mt(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 rh(e,t){return dr(e,t,{merger:Mte})}function Mte(e,t,n){if(!zL(e))return;const r=t[e],o=n[e];Mt(r)&&Mt(o)?rh(r,o):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Cb(o))}const lA={"":e=>e,x:e=>e.x,y:e=>e.y};function Ite(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 Dte(e){const t=Ite(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function qa(e,t){return(lA[t]||(lA[t]=Dte(t)))(e)}function QC(e){return e.charAt(0).toUpperCase()+e.slice(1)}const kh=e=>typeof e<"u",Ya=e=>typeof e=="function",cA=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function Nte(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const En=Math.PI,_n=2*En,Lte=_n+En,Eb=Number.POSITIVE_INFINITY,Fte=En/180,Bn=En/2,El=En/4,uA=En*2/3,La=Math.log10,os=Math.sign;function oh(e,t,n){return Math.abs(e-t)<n}function dA(e){const t=Math.round(e);e=oh(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(La(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function jte(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 $te(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function fd(e){return!$te(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function zte(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function BL(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 Ti(e){return e*(En/180)}function ZC(e){return e*(180/En)}function fA(e){if(!Nn(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function HL(e,t){const n=t.x-e.x,r=t.y-e.y,o=Math.sqrt(n*n+r*r);let i=Math.atan2(r,n);return i<-.5*En&&(i+=_n),{angle:i,distance:o}}function nS(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Bte(e,t){return(e-t+Lte)%_n-En}function Fo(e){return(e%_n+_n)%_n}function Ah(e,t,n,r){const o=Fo(e),i=Fo(t),s=Fo(n),a=Fo(i-o),l=Fo(s-o),c=Fo(o-i),u=Fo(o-s);return o===i||o===s||r&&i===s||a>l&&c<u}function ur(e,t,n){return Math.max(t,Math.min(n,e))}function Hte(e){return ur(e,-32768,32767)}function Xs(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function JC(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 Qs=(e,t,n,r)=>JC(e,n,r?o=>{const i=e[o][t];return i<n||i===n&&e[o+1][t]===n}:o=>e[o][t]<n),Vte=(e,t,n)=>JC(e,n,r=>e[r][t]>=n);function Wte(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 VL=["push","pop","shift","splice","unshift"];function Ute(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),VL.forEach(n=>{const r="_onData"+QC(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 hA(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)&&(VL.forEach(i=>{delete e[i]}),delete e._chartjs)}function WL(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const UL=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function GL(e,t){let n=[],r=!1;return function(...o){n=o,r||(r=!0,UL.call(window,()=>{r=!1,e.apply(t,n)}))}}function Gte(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const eE=e=>e==="start"?"left":e==="end"?"right":"center",Tr=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,qte=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t;function qL(e,t,n){const r=t.length;let o=0,i=r;if(e._sorted){const{iScale:s,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=s.axis,{min:d,max:p,minDefined:h,maxDefined:m}=s.getUserBounds();if(h){if(o=Math.min(Qs(l,u,d).lo,n?r:Qs(t,u,s.getPixelForValue(d)).lo),c){const b=l.slice(0,o+1).reverse().findIndex(v=>!ht(v[a.axis]));o-=Math.max(0,b)}o=ur(o,0,r-1)}if(m){let b=Math.max(Qs(l,s.axis,p,!0).hi+1,n?0:Qs(t,u,s.getPixelForValue(p),!0).hi+1);if(c){const v=l.slice(b-1).findIndex(x=>!ht(x[a.axis]));b+=Math.max(0,v)}i=ur(b,o,r)-o}else i=r-o}return{start:o,count:i}}function YL(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 Qg=e=>e===0||e===1,pA=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*_n/n)),gA=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*_n/n)+1,ih={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*Bn)+1,easeOutSine:e=>Math.sin(e*Bn),easeInOutSine:e=>-.5*(Math.cos(En*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Qg(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=>Qg(e)?e:pA(e,.075,.3),easeOutElastic:e=>Qg(e)?e:gA(e,.075,.3),easeInOutElastic(e){return Qg(e)?e:e<.5?.5*pA(e*2,.1125,.45):.5+.5*gA(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-ih.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?ih.easeInBounce(e*2)*.5:ih.easeOutBounce(e*2-1)*.5+.5};function tE(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function mA(e){return tE(e)?e:new jL(e)}function Lx(e){return tE(e)?e:new jL(e).saturate(.5).darken(.1).hexString()}const Yte=["x","y","borderWidth","radius","tension"],Kte=["color","borderColor","backgroundColor"];function Xte(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:Kte},numbers:{type:"number",properties:Yte}}),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 Qte(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const bA=new Map;function Zte(e,t){t=t||{};const n=e+JSON.stringify(t);let r=bA.get(n);return r||(r=new Intl.NumberFormat(e,t),bA.set(n,r)),r}function vp(e,t,n){return Zte(t,n).format(e)}const KL={values(e){return Sn(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=Jte(e,n)}const s=La(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),vp(e,r,l)},logarithmic(e,t,n){if(e===0)return"0";const r=n[t].significand||e/Math.pow(10,Math.floor(La(e)));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?KL.numeric.call(this,e,t,n):""}};function Jte(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:KL};function ene(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 _c=Object.create(null),rS=Object.create(null);function sh(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 Fx(e,t,n){return typeof t=="string"?dr(sh(e,t),n):dr(sh(e,""),t)}class tne{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)=>Lx(o.backgroundColor),this.hoverBorderColor=(r,o)=>Lx(o.borderColor),this.hoverColor=(r,o)=>Lx(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 Fx(this,t,n)}get(t){return sh(this,t)}describe(t,n){return Fx(rS,t,n)}override(t,n){return Fx(_c,t,n)}route(t,n,r,o){const i=sh(this,t),s=sh(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 Mt(l)?Object.assign({},c,l):it(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var Cn=new tne({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Xte,Qte,ene]);function nne(e){return!e||ht(e.size)||ht(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Rb(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 rne(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,p;for(l=0;l<a;l++)if(d=n[l],d!=null&&!Sn(d))s=Rb(e,o,i,s,d);else if(Sn(d))for(c=0,u=d.length;c<u;c++)p=d[c],p!=null&&!Sn(p)&&(s=Rb(e,o,i,s,p));e.restore();const h=i.length/2;if(h>n.length){for(l=0;l<h;l++)delete o[i[l]];i.splice(0,h)}return s}function Rl(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 yA(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Pb(e,t,n,r){XL(e,t,n,r,null)}function XL(e,t,n,r,o){let i,s,a,l,c,u,d,p;const h=t.pointStyle,m=t.rotation,b=t.radius;let v=(m||0)*Fte;if(h&&typeof h=="object"&&(i=h.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(v),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),e.restore();return}if(!(isNaN(b)||b<=0)){switch(e.beginPath(),h){default:o?e.ellipse(n,r,o/2,b,0,0,_n):e.arc(n,r,b,0,_n),e.closePath();break;case"triangle":u=o?o/2:b,e.moveTo(n+Math.sin(v)*u,r-Math.cos(v)*b),v+=uA,e.lineTo(n+Math.sin(v)*u,r-Math.cos(v)*b),v+=uA,e.lineTo(n+Math.sin(v)*u,r-Math.cos(v)*b),e.closePath();break;case"rectRounded":c=b*.516,l=b-c,s=Math.cos(v+El)*l,d=Math.cos(v+El)*(o?o/2-c:l),a=Math.sin(v+El)*l,p=Math.sin(v+El)*(o?o/2-c:l),e.arc(n-d,r-a,c,v-En,v-Bn),e.arc(n+p,r-s,c,v-Bn,v),e.arc(n+d,r+a,c,v,v+Bn),e.arc(n-p,r+s,c,v+Bn,v+En),e.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*b,u=o?o/2:l,e.rect(n-u,r-l,2*u,2*l);break}v+=El;case"rectRot":d=Math.cos(v)*(o?o/2:b),s=Math.cos(v)*b,a=Math.sin(v)*b,p=Math.sin(v)*(o?o/2:b),e.moveTo(n-d,r-a),e.lineTo(n+p,r-s),e.lineTo(n+d,r+a),e.lineTo(n-p,r+s),e.closePath();break;case"crossRot":v+=El;case"cross":d=Math.cos(v)*(o?o/2:b),s=Math.cos(v)*b,a=Math.sin(v)*b,p=Math.sin(v)*(o?o/2:b),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s);break;case"star":d=Math.cos(v)*(o?o/2:b),s=Math.cos(v)*b,a=Math.sin(v)*b,p=Math.sin(v)*(o?o/2:b),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s),v+=El,d=Math.cos(v)*(o?o/2:b),s=Math.cos(v)*b,a=Math.sin(v)*b,p=Math.sin(v)*(o?o/2:b),e.moveTo(n-d,r-a),e.lineTo(n+d,r+a),e.moveTo(n+p,r-s),e.lineTo(n-p,r+s);break;case"line":s=o?o/2:Math.cos(v)*b,a=Math.sin(v)*b,e.moveTo(n-s,r-a),e.lineTo(n+s,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(v)*(o?o/2:b),r+Math.sin(v)*b);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Zs(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 ic(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function sc(e){e.restore()}function one(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 ine(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 sne(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),ht(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 ane(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 lne(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Cc(e,t,n,r,o,i={}){const s=Sn(t)?t:[t],a=i.strokeWidth>0&&i.strokeColor!=="";let l,c;for(e.save(),e.font=o.string,sne(e,i),l=0;l<s.length;++l)c=s[l],i.backdrop&&lne(e,i.backdrop),a&&(i.strokeColor&&(e.strokeStyle=i.strokeColor),ht(i.strokeWidth)||(e.lineWidth=i.strokeWidth),e.strokeText(c,n,r,i.maxWidth)),e.fillText(c,n,r,i.maxWidth),ane(e,n,r,c,i),r+=Number(o.lineHeight);e.restore()}function Oh(e,t){const{x:n,y:r,w:o,h:i,radius:s}=t;e.arc(n+s.topLeft,r+s.topLeft,s.topLeft,1.5*En,En,!0),e.lineTo(n,r+i-s.bottomLeft),e.arc(n+s.bottomLeft,r+i-s.bottomLeft,s.bottomLeft,En,Bn,!0),e.lineTo(n+o-s.bottomRight,r+i),e.arc(n+o-s.bottomRight,r+i-s.bottomRight,s.bottomRight,Bn,0,!0),e.lineTo(n+o,r+s.topRight),e.arc(n+o-s.topRight,r+s.topRight,s.topRight,0,-Bn,!0),e.lineTo(n+s.topLeft,r)}const cne=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,une=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function dne(e,t){const n=(""+e).match(cne);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 fne=e=>+e||0;function nE(e,t){const n={},r=Mt(t),o=r?Object.keys(t):t,i=Mt(e)?r?s=>it(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of o)n[s]=fne(i(s));return n}function QL(e){return nE(e,{top:"y",right:"x",bottom:"y",left:"x"})}function ac(e){return nE(e,["topLeft","topRight","bottomLeft","bottomRight"])}function vr(e){const t=QL(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function qn(e,t){e=e||{},t=t||Cn.font;let n=it(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=it(e.style,t.style);r&&!(""+r).match(une)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const o={family:it(e.family,t.family),lineHeight:dne(it(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:it(e.weight,t.weight),string:""};return o.string=nne(o),o}function xn(e,t,n,r){let o,i,s;for(o=0,i=e.length;o<i;++o)if(s=e[o],s!==void 0&&(t!==void 0&&typeof s=="function"&&(s=s(t)),n!==void 0&&Sn(s)&&(s=s[n%s.length]),s!==void 0))return s}function hne(e,t,n){const{min:r,max:o}=e,i=$L(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 il(e,t){return Object.assign(Object.create(e),t)}function rE(e,t=[""],n,r,o=()=>e[0]){const i=n||e;typeof r>"u"&&(r=tF("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:o,override:a=>rE([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 JL(a,l,()=>wne(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return xA(a).includes(l)},ownKeys(a){return xA(a)},set(a,l,c){const u=a._storage||(a._storage=o());return a[l]=u[l]=c,delete a._keys,!0}})}function hd(e,t,n,r){const o={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:ZL(e,r),setContext:i=>hd(e,i,n,r),override:i=>hd(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 JL(i,s,()=>gne(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 ZL(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:Ya(n)?n:()=>n,isIndexable:Ya(r)?r:()=>r}}const pne=(e,t)=>e?e+QC(t):t,oE=(e,t)=>Mt(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function JL(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function gne(e,t,n){const{_proxy:r,_context:o,_subProxy:i,_descriptors:s}=e;let a=r[t];return Ya(a)&&s.isScriptable(t)&&(a=mne(t,a,e,n)),Sn(a)&&a.length&&(a=bne(t,a,e,s.isIndexable)),oE(t,a)&&(a=hd(a,o,i&&i[t],s)),a}function mne(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),oE(e,l)&&(l=iE(o._scopes,o,e,l)),l}function bne(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(Mt(t[0])){const l=t,c=o._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=iE(c,o,e,u);t.push(hd(d,i,s&&s[e],a))}}return t}function eF(e,t,n){return Ya(e)?e(t,n):e}const yne=(e,t)=>e===!0?t:typeof e=="string"?qa(t,e):void 0;function vne(e,t,n,r,o){for(const i of t){const s=yne(n,i);if(s){e.add(s);const a=eF(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 iE(e,t,n,r){const o=t._rootScopes,i=eF(t._fallback,n,r),s=[...e,...o],a=new Set;a.add(r);let l=vA(a,s,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=vA(a,s,i,l,r),l===null)?!1:rE(Array.from(a),[""],o,i,()=>xne(t,n,r))}function vA(e,t,n,r,o){for(;n;)n=vne(e,t,n,r,o);return n}function xne(e,t,n){const r=e._getTarget();t in r||(r[t]={});const o=r[t];return Sn(o)&&Mt(n)?n:o||{}}function wne(e,t,n,r){let o;for(const i of t)if(o=tF(pne(i,e),n),typeof o<"u")return oE(e,o)?iE(n,r,e,o):o}function tF(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function xA(e){let t=e._keys;return t||(t=e._keys=Sne(e._scopes)),t}function Sne(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 nF(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(qa(u,i),c)};return s}const _ne=Number.EPSILON||1e-14,pd=(e,t)=>t<e.length&&!e[t].skip&&e[t],rF=e=>e==="x"?"y":"x";function Cne(e,t,n,r){const o=e.skip?t:e,i=t,s=n.skip?t:n,a=nS(i,o),l=nS(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,p=r*u;return{previous:{x:i.x-d*(s.x-o.x),y:i.y-d*(s.y-o.y)},next:{x:i.x+p*(s.x-o.x),y:i.y+p*(s.y-o.y)}}}function Ene(e,t,n){const r=e.length;let o,i,s,a,l,c=pd(e,0);for(let u=0;u<r-1;++u)if(l=c,c=pd(e,u+1),!(!l||!c)){if(oh(t[u],0,_ne)){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 Rne(e,t,n="x"){const r=rF(n),o=e.length;let i,s,a,l=pd(e,0);for(let c=0;c<o;++c){if(s=a,a=l,l=pd(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 Pne(e,t="x"){const n=rF(t),r=e.length,o=Array(r).fill(0),i=Array(r);let s,a,l,c=pd(e,0);for(s=0;s<r;++s)if(a=l,l=c,c=pd(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?os(o[s-1])!==os(o[s])?0:(o[s-1]+o[s])/2:o[s-1]:o[s]}Ene(e,o,i),Rne(e,i,t)}function Zg(e,t,n){return Math.max(Math.min(e,n),t)}function Tne(e,t){let n,r,o,i,s,a=Zs(e[0],t);for(n=0,r=e.length;n<r;++n)s=i,i=a,a=n<r-1&&Zs(e[n+1],t),i&&(o=e[n],s&&(o.cp1x=Zg(o.cp1x,t.left,t.right),o.cp1y=Zg(o.cp1y,t.top,t.bottom)),a&&(o.cp2x=Zg(o.cp2x,t.left,t.right),o.cp2y=Zg(o.cp2y,t.top,t.bottom)))}function kne(e,t,n,r,o){let i,s,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Pne(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=Cne(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&&Tne(e,n)}function sE(){return typeof window<"u"&&typeof document<"u"}function aE(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Tb(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 Ane(e,t){return X0(e).getPropertyValue(t)}const One=["top","right","bottom","left"];function lc(e,t,n){const r={};n=n?"-"+n:"";for(let o=0;o<4;o++){const i=One[o];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const Mne=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Ine(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:o,offsetY:i}=r;let s=!1,a,l;if(Mne(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 Ml(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,o=X0(n),i=o.boxSizing==="border-box",s=lc(o,"padding"),a=lc(o,"border","width"),{x:l,y:c,box:u}=Ine(e,n),d=s.left+(u&&a.left),p=s.top+(u&&a.top);let{width:h,height:m}=t;return i&&(h-=s.width+a.width,m-=s.height+a.height),{x:Math.round((l-d)/h*n.width/r),y:Math.round((c-p)/m*n.height/r)}}function Dne(e,t,n){let r,o;if(t===void 0||n===void 0){const i=e&&aE(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const s=i.getBoundingClientRect(),a=X0(i),l=lc(a,"border","width"),c=lc(a,"padding");t=s.width-c.width-l.width,n=s.height-c.height-l.height,r=Tb(a.maxWidth,i,"clientWidth"),o=Tb(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||Eb,maxHeight:o||Eb}}const Jg=e=>Math.round(e*10)/10;function Nne(e,t,n,r){const o=X0(e),i=lc(o,"margin"),s=Tb(o.maxWidth,e,"clientWidth")||Eb,a=Tb(o.maxHeight,e,"clientHeight")||Eb,l=Dne(e,t,n);let{width:c,height:u}=l;if(o.boxSizing==="content-box"){const p=lc(o,"border","width"),h=lc(o,"padding");c-=h.width+p.width,u-=h.height+p.height}return c=Math.max(0,c-i.width),u=Math.max(0,r?c/r:u-i.height),c=Jg(Math.min(c,s,l.maxWidth)),u=Jg(Math.min(u,a,l.maxHeight)),c&&!u&&(u=Jg(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=Jg(Math.floor(u*r))),{width:c,height:u}}function wA(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 Lne=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};sE()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function SA(e,t){const n=Ane(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Il(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Fne(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 jne(e,t,n,r){const o={x:e.cp2x,y:e.cp2y},i={x:t.cp1x,y:t.cp1y},s=Il(e,o,n),a=Il(o,i,n),l=Il(i,t,n),c=Il(s,a,n),u=Il(a,l,n);return Il(c,u,n)}const $ne=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}}},zne=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Nu(e,t,n){return e?$ne(t,n):zne()}function oF(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 iF(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function sF(e){return e==="angle"?{between:Ah,compare:Bte,normalize:Fo}:{between:Xs,compare:(t,n)=>t-n,normalize:t=>t}}function _A({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 Bne(e,t,n){const{property:r,start:o,end:i}=n,{between:s,normalize:a}=sF(r),l=t.length;let{start:c,end:u,loop:d}=e,p,h;if(d){for(c+=l,u+=l,p=0,h=l;p<h&&s(a(t[c%l][r]),o,i);++p)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:e.style}}function aF(e,t,n){if(!n)return[e];const{property:r,start:o,end:i}=n,s=t.length,{compare:a,between:l,normalize:c}=sF(r),{start:u,end:d,loop:p,style:h}=Bne(e,t,n),m=[];let b=!1,v=null,x,w,_;const R=()=>l(o,_,x)&&a(o,_)!==0,C=()=>a(i,x)===0||l(i,_,x),E=()=>b||R(),A=()=>!b||C();for(let M=u,D=u;M<=d;++M)w=t[M%s],!w.skip&&(x=c(w[r]),x!==_&&(b=l(x,o,i),v===null&&E()&&(v=a(x,o)===0?M:D),v!==null&&A()&&(m.push(_A({start:v,end:M,loop:p,count:s,style:h})),v=null),D=M,_=x));return v!==null&&m.push(_A({start:v,end:d,loop:p,count:s,style:h})),m}function lF(e,t){const n=[],r=e.segments;for(let o=0;o<r.length;o++){const i=aF(r[o],e.points,t);i.length&&n.push(...i)}return n}function Hne(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 Vne(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 Wne(e,t){const n=e.points,r=e.options.spanGaps,o=n.length;if(!o)return[];const i=!!e._loop,{start:s,end:a}=Hne(n,o,i,r);if(r===!0)return CA(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 CA(e,Vne(n,s,l,c),n,t)}function CA(e,t,n,r){return!r||!r.setContext||!n?t:Une(e,t,n,r)}function Une(e,t,n,r){const o=e._chart.getContext(),i=EA(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=n.length,c=[];let u=i,d=t[0].start,p=d;function h(m,b,v,x){const w=a?-1:1;if(m!==b){for(m+=l;n[m%l].skip;)m-=w;for(;n[b%l].skip;)b+=w;m%l!==b%l&&(c.push({start:m%l,end:b%l,loop:v,style:x}),u=x,d=b%l)}}for(const m of t){d=a?d:m.start;let b=n[d%l],v;for(p=d+1;p<=m.end;p++){const x=n[p%l];v=EA(r.setContext(il(o,{type:"segment",p0:b,p1:x,p0DataIndex:(p-1)%l,p1DataIndex:p%l,datasetIndex:s}))),Gne(v,u)&&h(d,p-1,m.loop,u),b=x,u=v}d<p-1&&h(d,p-1,m.loop,u)}return c}function EA(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Gne(e,t){if(!t)return!1;const n=[],r=function(o,i){return tE(i)?(n.includes(i)||n.push(i),n.indexOf(i)):i};return JSON.stringify(e,r)!==JSON.stringify(t,r)}/*!
|
|
309
|
+
* Chart.js v4.4.8
|
|
310
|
+
* https://www.chartjs.org
|
|
311
|
+
* (c) 2025 Chart.js Contributors
|
|
312
|
+
* Released under the MIT License
|
|
313
|
+
*/class qne{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=UL.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 $s=new qne;const RA="transparent",Yne={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=mA(e||RA),o=r.valid&&mA(t||RA);return o&&o.valid?o.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Kne{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||Yne[t.type||typeof s],this._easing=ih[t.easing]||ih.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 cF{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Mt(t))return;const n=Object.keys(Cn.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const i=t[o];if(!Mt(i))return;const s={};for(const a of n)s[a]=i[a];(Sn(i.properties)&&i.properties||[o]).forEach(a=>{(a===o||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,n){const r=n.options,o=Qne(t,r);if(!o)return[];const i=this._createAnimations(o,r);return r.$shared&&Xne(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 p=r.get(c);if(d)if(p&&d.active()){d.update(p,u,a);continue}else d.cancel();if(!p||!p.duration){t[c]=u;continue}i[c]=d=new Kne(p,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 $s.add(this._chart,r),!0}}function Xne(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 Qne(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 PA(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 Zne(e,t,n){if(n===!1)return!1;const r=PA(e,n),o=PA(t,n);return{top:o.end,right:r.end,bottom:o.start,left:r.start}}function Jne(e){let t,n,r,o;return Mt(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 uF(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 TA(e,t,n,r={}){const o=e.keys,i=r.mode==="single";let s,a,l,c;if(t===null)return;let u=!1;for(s=0,a=o.length;s<a;++s){if(l=+o[s],l===n){if(u=!0,r.all)continue;break}c=e.values[l],Nn(c)&&(i||t===0||os(t)===os(c))&&(t+=c)}return!u&&!r.all?0:t}function ere(e,t){const{iScale:n,vScale:r}=t,o=n.axis==="x"?"x":"y",i=r.axis==="x"?"x":"y",s=Object.keys(e),a=new Array(s.length);let l,c,u;for(l=0,c=s.length;l<c;++l)u=s[l],a[l]={[o]:u,[i]:e[u]};return a}function jx(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function tre(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function nre(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 rre(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function kA(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 AA(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=tre(i,s,r),d=t.length;let p;for(let h=0;h<d;++h){const m=t[h],{[l]:b,[c]:v}=m,x=m._stacks||(m._stacks={});p=x[c]=rre(o,u,b),p[a]=v,p._top=kA(p,s,!0,r.type),p._bottom=kA(p,s,!1,r.type);const w=p._visualValues||(p._visualValues={});w[a]=v}}function $x(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function ore(e,t){return il(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function ire(e,t,n){return il(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function yf(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 zx=e=>e==="reset"||e==="none",OA=(e,t)=>t?e:Object.assign({},e),sre=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:uF(n,!0),values:null};class di{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=jx(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&&yf(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),o=(d,p,h,m)=>d==="x"?p:d==="r"?m:h,i=n.xAxisID=it(r.xAxisID,$x(t,"x")),s=n.yAxisID=it(r.yAxisID,$x(t,"y")),a=n.rAxisID=it(r.rAxisID,$x(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&&hA(this._data,this),t._stacked&&yf(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Mt(n)){const o=this._cachedMeta;this._data=ere(n,o)}else if(r!==n){if(r){hA(r,this);const o=this._cachedMeta;yf(o),o._parsed=[]}n&&Object.isExtensible(n)&&Ute(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=jx(n.vScale,n),n.stack!==r.stack&&(o=!0,yf(n),n.stack=r.stack),this._resyncElements(t),(o||i!==n._stacked)&&(AA(this,n._parsed),n._stacked=jx(n.vScale,n))}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,p;if(this._parsing===!1)r._parsed=o,r._sorted=!0,p=o;else{Sn(o[t])?p=this.parseArrayData(r,o,t,n):Mt(o[t])?p=this.parseObjectData(r,o,t,n):p=this.parsePrimitiveData(r,o,t,n);const h=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<n;++u)r._parsed[u+t]=d=p[u],l&&(h()&&(l=!1),c=d);r._sorted=l}s&&AA(this,p)}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 p,h,m;for(p=0,h=o;p<h;++p)m=p+r,d[p]={[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,p,h;for(u=0,d=o;u<d;++u)p=u+r,h=n[p],c[u]={x:i.parse(qa(h,a),p),y:s.parse(qa(h,l),p)};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:uF(o,!0),values:n._stacks[t.axis]._visualValues};return TA(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=TA(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=sre(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=nre(a);let p,h;function m(){h=o[p];const b=h[a.axis];return!Nn(h[t.axis])||u>b||d<b}for(p=0;p<s&&!(!m()&&(this.updateRangeFromParsed(c,t,h,l),i));++p);if(i){for(p=s-1;p>=0;--p)if(!m()){this.updateRangeFromParsed(c,t,h,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],Nn(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=Jne(it(this.options.clip,Zne(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=ire(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=ore(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 OA(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=o?[`${t}Hover`,"hover",t,""]:[t,""],p=c.getOptionScopes(this.getDataset(),u),h=Object.keys(Cn.elements[t]),m=()=>this.getContext(r,o,n),b=c.resolveNamedOptions(p,h,m,d);return b.$shared&&(b.$shared=l,i[s]=Object.freeze(OA(b,l))),b}_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),p=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(p,this.getContext(t,r,n))}const c=new cF(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||zx(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){zx(o)?Object.assign(t,r):this._resolveAnimations(n,o).update(t,r)}updateSharedOptions(t,n,r){t&&!zx(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&&yf(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])}}Oe(di,"defaults",{}),Oe(di,"datasetElementType",null),Oe(di,"dataElementType",null);function are(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=WL(r.sort((o,i)=>o-i))}return e._cache.$bar}function lre(e){const t=e.iScale,n=are(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 cre(e,t,n,r){const o=n.barThickness;let i,s;return ht(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 ure(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 dre(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 dF(e,t,n,r){return Sn(e)?dre(e,t,n,r):t[n.axis]=n.parse(e,r),t}function MA(e,t,n,r){const o=e.iScale,i=e.vScale,s=o.getLabels(),a=o===i,l=[];let c,u,d,p;for(c=n,u=n+r;c<u;++c)p=t[c],d={},d[o.axis]=a||o.parse(s[c],c),l.push(dF(p,d,i,c));return l}function Bx(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function fre(e,t,n){return e!==0?os(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function hre(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 pre(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}=hre(e);o==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?o=c:(n._bottom||0)===r?o=u:(i[IA(u,s,a,l)]=!0,o=c)),i[IA(o,s,a,l)]=!0,e.borderSkipped=i}function IA(e,t,n,r){return r?(e=gre(e,t,n),e=DA(e,n,t)):e=DA(e,t,n),e}function gre(e,t,n){return e===t?n:e===n?t:e}function DA(e,t,n){return e==="start"?t:e==="end"?n:e}function mre(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Ym extends di{parsePrimitiveData(t,n,r,o){return MA(t,n,r,o)}parseArrayData(t,n,r,o){return MA(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 p,h,m,b;for(p=r,h=r+o;p<h;++p)b=n[p],m={},m[i.axis]=i.parse(qa(b,c),p),d.push(dF(qa(b,u),m,s,p));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=Bx(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:p}=this._getSharedOptions(n,o);for(let h=n;h<n+r;h++){const m=this.getParsed(h),b=i||ht(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),v=this._calculateBarIndexPixels(h,u),x=(m._stacks||{})[a.axis],w={horizontal:c,base:b.base,enableBorderRadius:!x||Bx(m._custom)||s===x._top||s===x._bottom,x:c?b.head:v.center,y:c?v.center:b.head,height:c?v.size:Math.abs(b.size),width:c?Math.abs(b.size):v.size};p&&(w.options=d||this.resolveDataElementOptions(h,t[h].active?"active":o));const _=w.options||t[h].options;pre(w,_,x,s),mre(w,_,u.ratio),this.updateElement(t[h],h,w,o)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,o=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),i=r.options.stacked,s=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],c=u=>{const d=u._parsed.find(h=>h[r.axis]===l),p=d&&d[u.vScale.axis];if(ht(p)||isNaN(p))return!0};for(const u of o)if(!(n!==void 0&&c(u))&&((i===!1||s.indexOf(u.stack)===-1||i===void 0&&u.stack===void 0)&&s.push(u.stack),u.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||lre(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=Bx(c);let d=l[n.axis],p=0,h=r?this.applyStack(n,l,r):d,m,b;h!==d&&(p=h-d,h=d),u&&(d=c.barStart,h=c.barEnd-c.barStart,d!==0&&os(d)!==os(c.barEnd)&&(p=0),p+=d);const v=!ht(i)&&!u?i:p;let x=n.getPixelForValue(v);if(this.chart.getDataVisibility(t)?m=n.getPixelForValue(p+h):m=x,b=m-x,Math.abs(b)<s){b=fre(b,n,a)*s,d===a&&(x-=b/2);const w=n.getPixelForDecimal(0),_=n.getPixelForDecimal(1),R=Math.min(w,_),C=Math.max(w,_);x=Math.max(Math.min(x,C),R),m=x+b,r&&!u&&(l._stacks[n.axis]._visualValues[o]=n.getValueForPixel(m)-n.getValueForPixel(x))}if(x===n.getPixelForValue(a)){const w=os(b)*n.getLineWidthForValue(a)/2;x+=w,b-=w}return{size:b,base:x,head:m,center:m+b/2}}_calculateBarIndexPixels(t,n){const r=n.scale,o=this.options,i=o.skipNull,s=it(o.maxBarThickness,1/0);let a,l;if(n.grouped){const c=i?this._getStackCount(t):n.stackCount,u=o.barThickness==="flex"?ure(t,n,o,c):cre(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].hidden&&r[i].draw(this._ctx)}}Oe(Ym,"id","bar"),Oe(Ym,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),Oe(Ym,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Km extends di{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,r,o){const i=super.parsePrimitiveData(t,n,r,o);for(let s=0;s<i.length;s++)i[s]._custom=this.resolveDataElementOptions(s+r).radius;return i}parseArrayData(t,n,r,o){const i=super.parseArrayData(t,n,r,o);for(let s=0;s<i.length;s++){const a=n[r+s];i[s]._custom=it(a[2],this.resolveDataElementOptions(s+r).radius)}return i}parseObjectData(t,n,r,o){const i=super.parseObjectData(t,n,r,o);for(let s=0;s<i.length;s++){const a=n[r+s];i[s]._custom=it(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return i}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let r=t.length-1;r>=0;--r)n=Math.max(n,t[r].size(this.resolveDataElementOptions(r))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart.data.labels||[],{xScale:o,yScale:i}=n,s=this.getParsed(t),a=o.getLabelForValue(s.x),l=i.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,r,o){const i=o==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,o),u=s.axis,d=a.axis;for(let p=n;p<n+r;p++){const h=t[p],m=!i&&this.getParsed(p),b={},v=b[u]=i?s.getPixelForDecimal(.5):s.getPixelForValue(m[u]),x=b[d]=i?a.getBasePixel():a.getPixelForValue(m[d]);b.skip=isNaN(v)||isNaN(x),c&&(b.options=l||this.resolveDataElementOptions(p,h.active?"active":o),i&&(b.options.radius=0)),this.updateElement(h,p,b,o)}}resolveDataElementOptions(t,n){const r=this.getParsed(t);let o=super.resolveDataElementOptions(t,n);o.$shared&&(o=Object.assign({},o,{$shared:!1}));const i=o.radius;return n!=="active"&&(o.radius=0),o.radius+=it(r&&r._custom,i),o}}Oe(Km,"id","bubble"),Oe(Km,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),Oe(Km,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function bre(e,t,n){let r=1,o=1,i=0,s=0;if(t<_n){const a=e,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),p=Math.sin(l),h=(_,R,C)=>Ah(_,a,l,!0)?1:Math.max(R,R*n,C,C*n),m=(_,R,C)=>Ah(_,a,l,!0)?-1:Math.min(R,R*n,C,C*n),b=h(0,c,d),v=h(Bn,u,p),x=m(En,c,d),w=m(En+Bn,u,p);r=(b-x)/2,o=(v-w)/2,i=-(b+x)/2,s=-(v+w)/2}return{ratioX:r,ratioY:o,offsetX:i,offsetY:s}}class Vl extends di{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(Mt(r[t])){const{key:l="value"}=this._parsing;i=c=>+qa(r[c],l)}let s,a;for(s=t,a=t+n;s<a;++s)o._parsed[s]=i(s)}}_getRotation(){return Ti(this.options.rotation-90)}_getCircumference(){return Ti(this.options.circumference)}_getRotationExtents(){let t=_n,n=-_n;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(Ate(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:p,ratioY:h,offsetX:m,offsetY:b}=bre(d,u,l),v=(r.width-s)/p,x=(r.height-s)/h,w=Math.max(Math.min(v,x)/2,0),_=$L(this.options.radius,w),R=Math.max(_*l,0),C=(_-R)/this._getVisibleDatasetWeightTotal();this.offsetX=m*_,this.offsetY=b*_,o.total=this.calculateTotal(),this.outerRadius=_-C*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-C*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/_n)}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,p=i&&c.animateScale,h=p?0:this.innerRadius,m=p?0:this.outerRadius,{sharedOptions:b,includeOptions:v}=this._getSharedOptions(n,o);let x=this._getRotation(),w;for(w=0;w<n;++w)x+=this._circumference(w,i);for(w=n;w<n+r;++w){const _=this._circumference(w,i),R=t[w],C={x:u+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+_,circumference:_,outerRadius:m,innerRadius:h};v&&(C.options=b||this.resolveDataElementOptions(w,R.active?"active":o)),x+=_,this.updateElement(R,w,C,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)?_n*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,o=r.data.labels||[],i=vp(n._parsed[t],r.options.locale);return{label:o[t]||"",value:i}}getMaxBorderWidth(t){let n=0;const r=this.chart;let o,i,s,a,l;if(!t){for(o=0,i=r.data.datasets.length;o<i;++o)if(r.isDatasetVisible(o)){s=r.getDatasetMeta(o),t=s.data,a=s.controller;break}}if(!t)return 0;for(o=0,i=t.length;o<i;++o)l=a.resolveDataElementOptions(o),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,o=t.length;r<o;++r){const i=this.resolveDataElementOptions(r);n=Math.max(n,i.offset||0,i.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(it(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Oe(Vl,"id","doughnut"),Oe(Vl,"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"}),Oe(Vl,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),Oe(Vl,"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 Xm extends di{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}=qL(n,o,s);this._drawStart=a,this._drawCount=l,YL(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),p=s.axis,h=a.axis,{spanGaps:m,segment:b}=this.options,v=fd(m)?m:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||i||o==="none",w=n+r,_=t.length;let R=n>0&&this.getParsed(n-1);for(let C=0;C<_;++C){const E=t[C],A=x?E:{};if(C<n||C>=w){A.skip=!0;continue}const M=this.getParsed(C),D=ht(M[h]),L=A[p]=s.getPixelForValue(M[p],C),j=A[h]=i||D?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,M,l):M[h],C);A.skip=isNaN(L)||isNaN(j)||D,A.stop=C>0&&Math.abs(M[p]-R[p])>v,b&&(A.parsed=M,A.raw=c.data[C]),d&&(A.options=u||this.resolveDataElementOptions(C,E.active?"active":o)),x||this.updateElement(E,C,A,o),R=M}}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()}}Oe(Xm,"id","line"),Oe(Xm,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Oe(Xm,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ah extends di{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=vp(n._parsed[t].r,r.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,n,r,o){return nF.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,p=c.getIndexAngle(0)-.5*En;let h=p,m;const b=360/this.countVisibleElements();for(m=0;m<n;++m)h+=this._computeAngle(m,o,b);for(m=n;m<n+r;m++){const v=t[m];let x=h,w=h+this._computeAngle(m,o,b),_=s.getDataVisibility(m)?c.getDistanceFromCenterForValue(this.getParsed(m).r):0;h=w,i&&(l.animateScale&&(_=0),l.animateRotate&&(x=w=p));const R={x:u,y:d,innerRadius:0,outerRadius:_,startAngle:x,endAngle:w,options:this.resolveDataElementOptions(m,v.active?"active":o)};this.updateElement(v,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)?Ti(this.resolveDataElementOptions(t,n).angle||r):0}}Oe(ah,"id","polarArea"),Oe(ah,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),Oe(ah,"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 oS extends Vl{}Oe(oS,"id","pie"),Oe(oS,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Qm extends di{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 nF.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,p=s?i.yCenter:u.y,h={x:d,y:p,angle:u.angle,skip:isNaN(d)||isNaN(p),options:c};this.updateElement(l,a,h,o)}}}Oe(Qm,"id","radar"),Oe(Qm,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),Oe(Qm,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Zm extends di{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}=qL(n,r,o);if(this._drawStart=i,this._drawCount=s,YL(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),p=this.includeOptions(o,d),h=s.axis,m=a.axis,{spanGaps:b,segment:v}=this.options,x=fd(b)?b:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||i||o==="none";let _=n>0&&this.getParsed(n-1);for(let R=n;R<n+r;++R){const C=t[R],E=this.getParsed(R),A=w?C:{},M=ht(E[m]),D=A[h]=s.getPixelForValue(E[h],R),L=A[m]=i||M?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,E,l):E[m],R);A.skip=isNaN(D)||isNaN(L)||M,A.stop=R>0&&Math.abs(E[h]-_[h])>x,v&&(A.parsed=E,A.raw=c.data[R]),p&&(A.options=d||this.resolveDataElementOptions(R,C.active?"active":o)),w||this.updateElement(C,R,A,o),_=E}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}}Oe(Zm,"id","scatter"),Oe(Zm,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),Oe(Zm,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var yre=Object.freeze({__proto__:null,BarController:Ym,BubbleController:Km,DoughnutController:Vl,LineController:Xm,PieController:oS,PolarAreaController:ah,RadarController:Qm,ScatterController:Zm});function Pl(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class lE{constructor(t){Oe(this,"options");this.options=t||{}}static override(t){Object.assign(lE.prototype,t)}init(){}formats(){return Pl()}parse(){return Pl()}format(){return Pl()}add(){return Pl()}diff(){return Pl()}startOf(){return Pl()}endOf(){return Pl()}}var vre={_date:lE};function xre(e,t,n,r){const{controller:o,data:i,_sorted:s}=e,a=o._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&s&&i.length){const c=a._reversePixels?Vte:Qs;if(r){if(o._sharedOptions){const u=i[0],d=typeof u.getRange=="function"&&u.getRange(t);if(d){const p=c(i,t,n-d),h=c(i,t,n+d);return{lo:p.lo,hi:h.hi}}}}else{const u=c(i,t,n);if(l){const{vScale:d}=o._cachedMeta,{_parsed:p}=e,h=p.slice(0,u.lo+1).reverse().findIndex(b=>!ht(b[d.axis]));u.lo-=Math.max(0,h);const m=p.slice(u.hi).findIndex(b=>!ht(b[d.axis]));u.hi+=Math.max(0,m)}return u}}return{lo:0,hi:i.length-1}}function Q0(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:p}=xre(i[a],t,s,o);for(let h=d;h<=p;++h){const m=u[h];m.skip||r(m,c,h)}}}function wre(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 Hx(e,t,n,r,o){const i=[];return!o&&!e.isPointInArea(t)||Q0(e,n,t,function(a,l,c){!o&&!Zs(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&i.push({element:a,datasetIndex:l,index:c})},!0),i}function Sre(e,t,n,r){let o=[];function i(s,a,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=HL(s,{x:t.x,y:t.y});Ah(d,c,u)&&o.push({element:s,datasetIndex:a,index:l})}return Q0(e,n,t,i),o}function _re(e,t,n,r,o,i){let s=[];const a=wre(n);let l=Number.POSITIVE_INFINITY;function c(u,d,p){const h=u.inRange(t.x,t.y,o);if(r&&!h)return;const m=u.getCenterPoint(o);if(!(!!i||e.isPointInArea(m))&&!h)return;const v=a(t,m);v<l?(s=[{element:u,datasetIndex:d,index:p}],l=v):v===l&&s.push({element:u,datasetIndex:d,index:p})}return Q0(e,n,t,c),s}function Vx(e,t,n,r,o,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?Sre(e,t,n,o):_re(e,t,n,r,o,i)}function NA(e,t,n,r,o){const i=[],s=n==="x"?"inXRange":"inYRange";let a=!1;return Q0(e,n,t,(l,c,u)=>{l[s]&&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 Cre={modes:{index(e,t,n,r){const o=Ml(t,e),i=n.axis||"x",s=n.includeInvisible||!1,a=n.intersect?Hx(e,o,i,r,s):Vx(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=Ml(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;let a=n.intersect?Hx(e,o,i,r,s):Vx(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=Ml(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return Hx(e,o,i,r,s)},nearest(e,t,n,r){const o=Ml(t,e),i=n.axis||"xy",s=n.includeInvisible||!1;return Vx(e,o,i,n.intersect,r,s)},x(e,t,n,r){const o=Ml(t,e);return NA(e,o,"x",n.intersect,r)},y(e,t,n,r){const o=Ml(t,e);return NA(e,o,"y",n.intersect,r)}}};const fF=["left","top","right","bottom"];function vf(e,t){return e.filter(n=>n.pos===t)}function LA(e,t){return e.filter(n=>fF.indexOf(n.pos)===-1&&n.box.axis===t)}function xf(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 Ere(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 Rre(e){const t={};for(const n of e){const{stack:r,pos:o,stackWeight:i}=n;if(!r||!fF.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 Pre(e,t){const n=Rre(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 Tre(e){const t=Ere(e),n=xf(t.filter(c=>c.box.fullSize),!0),r=xf(vf(t,"left"),!0),o=xf(vf(t,"right")),i=xf(vf(t,"top"),!0),s=xf(vf(t,"bottom")),a=LA(t,"x"),l=LA(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:o.concat(l).concat(s).concat(a),chartArea:vf(t,"chartArea"),vertical:r.concat(o).concat(l),horizontal:i.concat(s).concat(a)}}function FA(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function hF(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 kre(e,t,n,r){const{pos:o,box:i}=n,s=e.maxPadding;if(!Mt(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&&hF(s,i.getPadding());const a=Math.max(0,t.outerWidth-FA(s,e,"left","right")),l=Math.max(0,t.outerHeight-FA(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 Are(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 Ore(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 Wf(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,Ore(a.horizontal,t));const{same:d,other:p}=kre(t,n,a,r);c|=d&&o.length,u=u||p,l.fullSize||o.push(a)}return c&&Wf(o,t,n,r)||u}function em(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 jA(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]||{placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,p=c.size||l.height;kh(c.start)&&(s=c.start),l.fullSize?em(l,o.left,s,n.outerWidth-o.right-o.left,p):em(l,t.left+c.placed,s,d,p),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,p=c.size||l.width;kh(c.start)&&(i=c.start),l.fullSize?em(l,i,o.top,p,n.outerHeight-o.bottom-o.top):em(l,i,t.top+c.placed,p,d),c.start=i,c.placed+=d,i=l.right}}t.x=i,t.y=s}var Or={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=vr(e.options.layout.padding),i=Math.max(t-o.width,0),s=Math.max(n-o.height,0),a=Tre(e.boxes),l=a.vertical,c=a.horizontal;en(e.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=l.reduce((b,v)=>v.box.options&&v.box.options.display===!1?b:b+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:o,availableWidth:i,availableHeight:s,vBoxMaxWidth:i/2/u,hBoxMaxHeight:s/2}),p=Object.assign({},o);hF(p,vr(r));const h=Object.assign({maxPadding:p,w:i,h:s,x:o.left,y:o.top},o),m=Pre(l.concat(c),d);Wf(a.fullSize,h,d,m),Wf(l,h,d,m),Wf(c,h,d,m)&&Wf(l,h,d,m),Are(h),jA(a.leftAndTop,h,d,m),h.x+=h.w,h.y+=h.h,jA(a.rightAndBottom,h,d,m),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},en(a.chartArea,b=>{const v=b.box;Object.assign(v,e.chartArea),v.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class pF{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 Mre extends pF{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Jm="$chartjs",Ire={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},$A=e=>e===null||e==="";function Dre(e,t){const n=e.style,r=e.getAttribute("height"),o=e.getAttribute("width");if(e[Jm]={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",$A(o)){const i=SA(e,"width");i!==void 0&&(e.width=i)}if($A(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=SA(e,"height");i!==void 0&&(e.height=i)}return e}const gF=Lne?{passive:!0}:!1;function Nre(e,t,n){e&&e.addEventListener(t,n,gF)}function Lre(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,gF)}function Fre(e,t){const n=Ire[e.type]||e.type,{x:r,y:o}=Ml(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:o!==void 0?o:null}}function kb(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function jre(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||kb(a.addedNodes,r),s=s&&!kb(a.removedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}function $re(e,t,n){const r=e.canvas,o=new MutationObserver(i=>{let s=!1;for(const a of i)s=s||kb(a.removedNodes,r),s=s&&!kb(a.addedNodes,r);s&&n()});return o.observe(document,{childList:!0,subtree:!0}),o}const Mh=new Map;let zA=0;function mF(){const e=window.devicePixelRatio;e!==zA&&(zA=e,Mh.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function zre(e,t){Mh.size||window.addEventListener("resize",mF),Mh.set(e,t)}function Bre(e){Mh.delete(e),Mh.size||window.removeEventListener("resize",mF)}function Hre(e,t,n){const r=e.canvas,o=r&&aE(r);if(!o)return;const i=GL((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),zre(e,i),s}function Wx(e,t,n){n&&n.disconnect(),t==="resize"&&Bre(e)}function Vre(e,t,n){const r=e.canvas,o=GL(i=>{e.ctx!==null&&n(Fre(i,e))},e);return Nre(r,t,o),o}class Wre extends pF{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(Dre(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Jm])return!1;const r=n[Jm].initial;["height","width"].forEach(i=>{const s=r[i];ht(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[Jm],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const o=t.$proxies||(t.$proxies={}),s={attach:jre,detach:$re,resize:Hre}[n]||Vre;o[n]=s(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),o=r[n];if(!o)return;({attach:Wx,detach:Wx,resize:Wx}[n]||Lre)(t,n,o),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,o){return Nne(t,n,r,o)}isAttached(t){const n=t&&aE(t);return!!(n&&n.isConnected)}}function Ure(e){return!sE()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Mre:Wre}var qm;let xs=(qm=class{constructor(){Oe(this,"x");Oe(this,"y");Oe(this,"active",!1);Oe(this,"options");Oe(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return fd(this.x)&&fd(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}},Oe(qm,"defaults",{}),Oe(qm,"defaultRoutes"),qm);function Gre(e,t){const n=e.options.ticks,r=qre(e),o=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?Kre(t):[],s=i.length,a=i[0],l=i[s-1],c=[];if(s>o)return Xre(t,c,i,s/o),c;const u=Yre(i,t,o);if(s>0){let d,p;const h=s>1?Math.round((l-a)/(s-1)):null;for(tm(t,c,u,ht(h)?0:a-h,a),d=0,p=s-1;d<p;d++)tm(t,c,u,i[d],i[d+1]);return tm(t,c,u,l,ht(h)?t.length:l+h),c}return tm(t,c,u),c}function qre(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 Yre(e,t,n){const r=Qre(e),o=t.length/n;if(!r)return Math.max(o,1);const i=jte(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 Kre(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function Xre(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 tm(e,t,n,r,o){const i=it(r,0),s=Math.min(it(o,e.length),e.length);let a=0,l,c,u;for(n=Math.ceil(n),o&&(l=o-r,n=l/Math.floor(l/n)),u=i;u<0;)a++,u=Math.round(i+a*n);for(c=Math.max(i,0);c<s;c++)c===u&&(t.push(e[c]),a++,u=Math.round(i+a*n))}function Qre(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 Zre=e=>e==="left"?"right":e==="right"?"left":e,BA=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,HA=(e,t)=>Math.min(t||e,e);function VA(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 Jre(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 eoe(e,t){en(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 wf(e){return e.drawTicks?e.tickLength:0}function WA(e,t){if(!e.display)return 0;const n=qn(e.font,t),r=vr(e.padding);return(Sn(e.text)?e.text.length:1)*n.lineHeight+r.height}function toe(e,t){return il(e,{scale:t,type:"scale"})}function noe(e,t,n){return il(e,{tick:n,index:t,type:"tick"})}function roe(e,t,n){let r=eE(e);return(n&&t!=="right"||!n&&t==="right")&&(r=Zre(r)),r}function ooe(e,t,n,r){const{top:o,left:i,bottom:s,right:a,chart:l}=e,{chartArea:c,scales:u}=l;let d=0,p,h,m;const b=s-o,v=a-i;if(e.isHorizontal()){if(h=Tr(r,i,a),Mt(n)){const x=Object.keys(n)[0],w=n[x];m=u[x].getPixelForValue(w)+b-t}else n==="center"?m=(c.bottom+c.top)/2+b-t:m=BA(e,n,t);p=a-i}else{if(Mt(n)){const x=Object.keys(n)[0],w=n[x];h=u[x].getPixelForValue(w)-v+t}else n==="center"?h=(c.left+c.right)/2-v+t:h=BA(e,n,t);m=Tr(r,s,o),d=n==="left"?-Bn:Bn}return{titleX:h,titleY:m,maxWidth:p,rotation:d}}class sl extends xs{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=No(t,Number.POSITIVE_INFINITY),n=No(n,Number.NEGATIVE_INFINITY),r=No(r,Number.POSITIVE_INFINITY),o=No(o,Number.NEGATIVE_INFINITY),{min:No(t,r),max:No(n,o),minDefined:Nn(t),maxDefined:Nn(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:No(n,No(r,n)),max:No(r,No(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=hne(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?VA(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=Gre(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=HA(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,p=u.highest.height,h=ur(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),d+6>a&&(a=h/(r-(t.offset?.5:1)),l=this.maxHeight-wf(t.grid)-n.padding-WA(t.title,this.chart.options.font),c=Math.sqrt(d*d+p*p),s=ZC(Math.min(Math.asin(ur((u.highest.height+6)/a,-1,1)),Math.asin(ur(l/c,-1,1))-Math.asin(ur(p/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=WA(o,n.options.font);if(a?(t.width=this.maxWidth,t.height=wf(i)+l):(t.height=this.maxHeight,t.width=wf(i)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:p}=this._getLabelSizes(),h=r.padding*2,m=Ti(this.labelRotation),b=Math.cos(m),v=Math.sin(m);if(a){const x=r.mirror?0:v*d.width+b*p.height;t.height=Math.min(this.maxHeight,t.height+x+h)}else{const x=r.mirror?0:b*d.width+v*p.height;t.width=Math.min(this.maxWidth,t.width+x+h)}this._calculatePadding(c,u,v,b)}}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 p=0,h=0;l?c?(p=o*t.width,h=r*n.height):(p=r*t.height,h=o*n.width):i==="start"?h=n.width:i==="end"?p=t.width:i!=="inner"&&(p=t.width/2,h=n.width/2),this.paddingLeft=Math.max((p-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-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++)ht(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=VA(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/HA(n,r));let c=0,u=0,d,p,h,m,b,v,x,w,_,R,C;for(d=0;d<n;d+=l){if(m=t[d].label,b=this._resolveTickFontOptions(d),o.font=v=b.string,x=i[v]=i[v]||{data:{},gc:[]},w=b.lineHeight,_=R=0,!ht(m)&&!Sn(m))_=Rb(o,x.data,x.gc,_,m),R=w;else if(Sn(m))for(p=0,h=m.length;p<h;++p)C=m[p],!ht(C)&&!Sn(C)&&(_=Rb(o,x.data,x.gc,_,C),R+=w);s.push(_),a.push(R),c=Math.max(_,c),u=Math.max(R,u)}eoe(i,n);const E=s.indexOf(c),A=a.indexOf(u),M=D=>({width:s[D]||0,height:a[D]||0});return{first:M(0),last:M(n-1),widest:M(E),highest:M(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 Hte(this._alignToPixels?Rl(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=noe(this.getContext(),t,r))}return this.$context||(this.$context=toe(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Ti(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),p=wf(i),h=[],m=a.setContext(this.getContext()),b=m.display?m.width:0,v=b/2,x=function(H){return Rl(r,H,b)};let w,_,R,C,E,A,M,D,L,j,z,Q;if(s==="top")w=x(this.bottom),A=this.bottom-p,D=w-v,j=x(t.top)+v,Q=t.bottom;else if(s==="bottom")w=x(this.top),j=t.top,Q=x(t.bottom)-v,A=w+v,D=this.top+p;else if(s==="left")w=x(this.right),E=this.right-p,M=w-v,L=x(t.left)+v,z=t.right;else if(s==="right")w=x(this.left),L=t.left,z=x(t.right)-v,E=w+v,M=this.left+p;else if(n==="x"){if(s==="center")w=x((t.top+t.bottom)/2+.5);else if(Mt(s)){const H=Object.keys(s)[0],$=s[H];w=x(this.chart.scales[H].getPixelForValue($))}j=t.top,Q=t.bottom,A=w+v,D=A+p}else if(n==="y"){if(s==="center")w=x((t.left+t.right)/2);else if(Mt(s)){const H=Object.keys(s)[0],$=s[H];w=x(this.chart.scales[H].getPixelForValue($))}E=w-v,M=E-p,L=t.left,z=t.right}const G=it(o.ticks.maxTicksLimit,d),F=Math.max(1,Math.ceil(d/G));for(_=0;_<d;_+=F){const H=this.getContext(_),$=i.setContext(H),V=a.setContext(H),X=$.lineWidth,I=$.color,q=V.dash||[],U=V.dashOffset,O=$.tickWidth,ee=$.tickColor,K=$.tickBorderDash||[],oe=$.tickBorderDashOffset;R=Jre(this,_,l),R!==void 0&&(C=Rl(r,R,X),c?E=M=L=z=C:A=D=j=Q=C,h.push({tx1:E,ty1:A,tx2:M,ty2:D,x1:L,y1:j,x2:z,y2:Q,width:X,color:I,borderDash:q,borderDashOffset:U,tickWidth:O,tickColor:ee,tickBorderDash:K,tickBorderDashOffset:oe}))}return this._ticksLength=d,this._borderValue=w,h}_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,p=wf(r.grid),h=p+u,m=d?-u:h,b=-Ti(this.labelRotation),v=[];let x,w,_,R,C,E,A,M,D,L,j,z,Q="middle";if(o==="top")E=this.bottom-m,A=this._getXAxisLabelAlignment();else if(o==="bottom")E=this.top+m,A=this._getXAxisLabelAlignment();else if(o==="left"){const F=this._getYAxisLabelAlignment(p);A=F.textAlign,C=F.x}else if(o==="right"){const F=this._getYAxisLabelAlignment(p);A=F.textAlign,C=F.x}else if(n==="x"){if(o==="center")E=(t.top+t.bottom)/2+h;else if(Mt(o)){const F=Object.keys(o)[0],H=o[F];E=this.chart.scales[F].getPixelForValue(H)+h}A=this._getXAxisLabelAlignment()}else if(n==="y"){if(o==="center")C=(t.left+t.right)/2-h;else if(Mt(o)){const F=Object.keys(o)[0],H=o[F];C=this.chart.scales[F].getPixelForValue(H)}A=this._getYAxisLabelAlignment(p).textAlign}n==="y"&&(l==="start"?Q="top":l==="end"&&(Q="bottom"));const G=this._getLabelSizes();for(x=0,w=a.length;x<w;++x){_=a[x],R=_.label;const F=i.setContext(this.getContext(x));M=this.getPixelForTick(x)+i.labelOffset,D=this._resolveTickFontOptions(x),L=D.lineHeight,j=Sn(R)?R.length:1;const H=j/2,$=F.color,V=F.textStrokeColor,X=F.textStrokeWidth;let I=A;s?(C=M,A==="inner"&&(x===w-1?I=this.options.reverse?"left":"right":x===0?I=this.options.reverse?"right":"left":I="center"),o==="top"?c==="near"||b!==0?z=-j*L+L/2:c==="center"?z=-G.highest.height/2-H*L+L:z=-G.highest.height+L/2:c==="near"||b!==0?z=L/2:c==="center"?z=G.highest.height/2-H*L:z=G.highest.height-j*L,d&&(z*=-1),b!==0&&!F.showLabelBackdrop&&(C+=L/2*Math.sin(b))):(E=M,z=(1-j)*L/2);let q;if(F.showLabelBackdrop){const U=vr(F.backdropPadding),O=G.heights[x],ee=G.widths[x];let K=z-U.top,oe=0-U.left;switch(Q){case"middle":K-=O/2;break;case"bottom":K-=O;break}switch(A){case"center":oe-=ee/2;break;case"right":oe-=ee;break;case"inner":x===w-1?oe-=ee:x>0&&(oe-=ee/2);break}q={left:oe,top:K,width:ee+U.width,height:O+U.height,color:F.backdropColor}}v.push({label:R,font:D,textOffset:z,options:{rotation:b,color:$,strokeColor:V,strokeWidth:X,textAlign:I,textBaseline:Q,translation:[C,E],backdrop:q}})}return v}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Ti(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,p;this.isHorizontal()?(c=Rl(t,this.left,s)-s/2,u=Rl(t,this.right,a)+a/2,d=p=l):(d=Rl(t,this.top,s)-s/2,p=Rl(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,p),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,o=this._computeLabelArea();o&&ic(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;Cc(r,c,0,u,l,a)}o&&sc(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:o}}=this;if(!r.display)return;const i=qn(r.font),s=vr(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||Mt(n)?(l+=s.bottom,Sn(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:p}=ooe(this,l,n,a);Cc(t,r.text,0,0,i,{color:r.color,maxWidth:d,rotation:p,textAlign:roe(a,n,o),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=it(t.grid&&t.grid.z,-1),o=it(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==sl.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 qn(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class nm{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;aoe(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,ioe(t,s,r),this.override&&Cn.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 Cn[o]&&(delete Cn[o][r],this.override&&delete _c[r])}}function ioe(e,t,n){const r=dr(Object.create(null),[n?Cn.get(n):{},Cn.get(t),e.defaults]);Cn.set(t,r),e.defaultRoutes&&soe(t,e.defaultRoutes),e.descriptors&&Cn.describe(t,e.descriptors)}function soe(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(".");Cn.route(i,o,l,a)})}function aoe(e){return"id"in e&&"defaults"in e}class loe{constructor(){this.controllers=new nm(di,"datasets",!0),this.elements=new nm(xs,"elements"),this.plugins=new nm(Object,"plugins"),this.scales=new nm(sl,"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):en(o,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,n,r){const o=QC(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 qr=new loe;class coe{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(){ht(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,o=it(r.options&&r.options.plugins,{}),i=uoe(r);return o===!1&&!n?[]:foe(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 uoe(e){const t={},n=[],r=Object.keys(qr.plugins.items);for(let i=0;i<r.length;i++)n.push(qr.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 doe(e,t){return!t&&e===!1?null:e===!0?{}:e}function foe(e,{plugins:t,localIds:n},r,o){const i=[],s=e.getContext();for(const a of t){const l=a.id,c=doe(r[l],o);c!==null&&i.push({plugin:a,options:hoe(e.config,{plugin:a,local:n[l]},c,s)})}return i}function hoe(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 iS(e,t){const n=Cn.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function poe(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function goe(e,t){return e===t?"_index_":"_value_"}function UA(e){if(e==="x"||e==="y"||e==="r")return e}function moe(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function sS(e,...t){if(UA(e))return e;for(const n of t){const r=n.axis||moe(n.position)||e.length>1&&UA(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function GA(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function boe(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 GA(e,"x",n[0])||GA(e,"y",n[0])}return{}}function yoe(e,t){const n=_c[e.type]||{scales:{}},r=t.scales||{},o=iS(e.type,t),i=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!Mt(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=sS(s,a,boe(s,e),Cn.scales[a.type]),c=goe(l,o),u=n.scales||{};i[s]=rh(Object.create(null),[{axis:l},a,u[l],u[c]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||iS(a,t),u=(_c[a]||{}).scales||{};Object.keys(u).forEach(d=>{const p=poe(d,l),h=s[p+"AxisID"]||p;i[h]=i[h]||Object.create(null),rh(i[h],[{axis:p},r[h],u[d]])})}),Object.keys(i).forEach(s=>{const a=i[s];rh(a,[Cn.scales[a.type],Cn.scale])}),i}function bF(e){const t=e.options||(e.options={});t.plugins=it(t.plugins,{}),t.scales=yoe(e,t)}function yF(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function voe(e){return e=e||{},e.data=yF(e.data),bF(e),e}const qA=new Map,vF=new Set;function rm(e,t){let n=qA.get(e);return n||(n=t(),qA.set(e,n),vF.add(n)),n}const Sf=(e,t,n)=>{const r=qa(t,n);r!==void 0&&e.add(r)};class xoe{constructor(t){this._config=voe(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=yF(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(),bF(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return rm(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return rm(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return rm(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return rm(`${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=>Sf(l,t,d))),u.forEach(d=>Sf(l,o,d)),u.forEach(d=>Sf(l,_c[i]||{},d)),u.forEach(d=>Sf(l,Cn,d)),u.forEach(d=>Sf(l,rS,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),vF.has(n)&&s.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,_c[n]||{},Cn.datasets[n]||{},{type:n},Cn,rS]}resolveNamedOptions(t,n,r,o=[""]){const i={$shared:!0},{resolver:s,subPrefixes:a}=YA(this._resolverCache,t,o);let l=s;if(Soe(s,n)){i.$shared=!1,r=Ya(r)?r():r;const c=this.createResolver(t,r,a);l=hd(s,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(t,n,r=[""],o){const{resolver:i}=YA(this._resolverCache,t,r);return Mt(n)?hd(i,n,void 0,o):i}}function YA(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:rE(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(o,i)),i}const woe=e=>Mt(e)&&Object.getOwnPropertyNames(e).some(t=>Ya(e[t]));function Soe(e,t){const{isScriptable:n,isIndexable:r}=ZL(e);for(const o of t){const i=n(o),s=r(o),a=(s||i)&&e[o];if(i&&(Ya(a)||woe(a))||s&&Sn(a))return!0}return!1}var _oe="4.4.8";const Coe=["top","bottom","left","right","chartArea"];function KA(e,t){return e==="top"||e==="bottom"||Coe.indexOf(e)===-1&&t==="x"}function XA(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function QA(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),an(n&&n.onComplete,[e],t)}function Eoe(e){const t=e.chart,n=t.options.animation;an(n&&n.onProgress,[e],t)}function xF(e){return sE()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const eb={},ZA=e=>{const t=xF(e);return Object.values(eb).filter(n=>n.canvas===t).pop()};function Roe(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 Poe(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}function om(e,t,n){return e.options.clip?e[n]:t[n]}function Toe(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:om(n,t,"left"),right:om(n,t,"right"),top:om(r,t,"top"),bottom:om(r,t,"bottom")}:t}class kn{static register(...t){qr.add(...t),JA()}static unregister(...t){qr.remove(...t),JA()}constructor(t,n){const r=this.config=new xoe(n),o=xF(t),i=ZA(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||Ure(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=kte(),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 coe,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Gte(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],eb[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}$s.listen(this,"complete",QA),$s.listen(this,"progress",Eoe),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:o,_aspectRatio:i}=this;return ht(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 qr}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():wA(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return yA(this.canvas,this.ctx),this}stop(){return $s.stop(this),this}resize(t,n){$s.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,wA(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||{};en(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=sS(s,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),en(i,s=>{const a=s.options,l=a.id,c=sS(l,a),u=it(a.type,s.dtype);(a.position===void 0||KA(a.position,c)!==KA(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 p=qr.getScale(u);d=new p({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),en(o,(s,a)=>{s||delete r[a]}),en(r,s=>{Or.configure(this,s,s.options),Or.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(XA("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||iS(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=qr.getController(a),{datasetElementType:c,dataElementType:u}=Cn.datasets[a];Object.assign(l,{dataElementType:qr.getElement(u),datasetElementType:c&&qr.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){en(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),p=!o&&i.indexOf(d)===-1;d.buildOrUpdateElements(p),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),o||en(i,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(XA("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){en(this.scales,t=>{Or.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!cA(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;Roe(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(!cA(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;Or.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],en(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,Ya(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&&($s.has(this)?this.attached&&!$s.running(this)&&$s.start(this):(this.draw(),QA({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:o}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,o)}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=Toe(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(o&&ic(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&&sc(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Zs(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,o){const i=Cre.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=il(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(),$s.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(),yA(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete eb[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)};en(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(){en(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},en(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}});!_b(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=Nte(t),c=Poe(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=!_b(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)}}Oe(kn,"defaults",Cn),Oe(kn,"instances",eb),Oe(kn,"overrides",_c),Oe(kn,"registry",qr),Oe(kn,"version",_oe),Oe(kn,"getChart",ZA);function JA(){return en(kn.instances,e=>e._plugins.invalidate())}function koe(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+Bn,r-Bn),e.closePath(),e.clip()}function Aoe(e){return nE(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Ooe(e,t,n,r){const o=Aoe(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 ur(l,0,Math.min(i,c))};return{outerStart:a(o.outerStart),outerEnd:a(o.outerEnd),innerStart:ur(o.innerStart,0,s),innerEnd:ur(o.innerEnd,0,s)}}function du(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function Ab(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),p=u>0?u+r+n+c:0;let h=0;const m=o-l;if(r){const F=u>0?u-r:0,H=d>0?d-r:0,$=(F+H)/2,V=$!==0?m*$/($+r):m;h=(m-V)/2}const b=Math.max(.001,m*d-n/En)/d,v=(m-b)/2,x=l+v+h,w=o-v-h,{outerStart:_,outerEnd:R,innerStart:C,innerEnd:E}=Ooe(t,p,d,w-x),A=d-_,M=d-R,D=x+_/A,L=w-R/M,j=p+C,z=p+E,Q=x+C/j,G=w-E/z;if(e.beginPath(),i){const F=(D+L)/2;if(e.arc(s,a,d,D,F),e.arc(s,a,d,F,L),R>0){const X=du(M,L,s,a);e.arc(X.x,X.y,R,L,w+Bn)}const H=du(z,w,s,a);if(e.lineTo(H.x,H.y),E>0){const X=du(z,G,s,a);e.arc(X.x,X.y,E,w+Bn,G+Math.PI)}const $=(w-E/p+(x+C/p))/2;if(e.arc(s,a,p,w-E/p,$,!0),e.arc(s,a,p,$,x+C/p,!0),C>0){const X=du(j,Q,s,a);e.arc(X.x,X.y,C,Q+Math.PI,x-Bn)}const V=du(A,x,s,a);if(e.lineTo(V.x,V.y),_>0){const X=du(A,D,s,a);e.arc(X.x,X.y,_,x-Bn,D)}}else{e.moveTo(s,a);const F=Math.cos(D)*d+s,H=Math.sin(D)*d+a;e.lineTo(F,H);const $=Math.cos(L)*d+s,V=Math.sin(L)*d+a;e.lineTo($,V)}e.closePath()}function Moe(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a}=t;let l=t.endAngle;if(i){Ab(e,t,n,r,l,o);for(let c=0;c<i;++c)e.fill();isNaN(a)||(l=s+(a%_n||_n))}return Ab(e,t,n,r,l,o),e.fill(),l}function Ioe(e,t,n,r,o){const{fullCircles:i,startAngle:s,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:p}=l,h=l.borderAlign==="inner";if(!c)return;e.setLineDash(d||[]),e.lineDashOffset=p,h?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let m=t.endAngle;if(i){Ab(e,t,n,r,m,o);for(let b=0;b<i;++b)e.stroke();isNaN(a)||(m=s+(a%_n||_n))}h&&koe(e,t,m),i||(Ab(e,t,n,r,m,o),e.stroke())}class Cu extends xs{constructor(n){super();Oe(this,"circumference");Oe(this,"endAngle");Oe(this,"fullCircles");Oe(this,"innerRadius");Oe(this,"outerRadius");Oe(this,"pixelMargin");Oe(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}=HL(i,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:p}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),h=(this.options.spacing+this.options.borderWidth)/2,m=it(p,c-l),b=Ah(s,l,c)&&l!==c,v=m>=_n||b,x=Xs(a,u+h,d+h);return v&&x}getCenterPoint(n){const{x:r,y:o,startAngle:i,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,d=(i+s)/2,p=(a+l+u+c)/2;return{x:r+Math.cos(d)*p,y:o+Math.sin(d)*p}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:o}=this,i=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=o>_n?Math.floor(o/_n):0,o===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*i,Math.sin(l)*i);const c=1-Math.sin(Math.min(En,o||0)),u=i*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,Moe(n,this,u,s,a),Ioe(n,this,u,s,a),n.restore()}}Oe(Cu,"id","arc"),Oe(Cu,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),Oe(Cu,"defaultRoutes",{backgroundColor:"backgroundColor"}),Oe(Cu,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function wF(e,t,n=t){e.lineCap=it(n.borderCapStyle,t.borderCapStyle),e.setLineDash(it(n.borderDash,t.borderDash)),e.lineDashOffset=it(n.borderDashOffset,t.borderDashOffset),e.lineJoin=it(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=it(n.borderWidth,t.borderWidth),e.strokeStyle=it(n.borderColor,t.borderColor)}function Doe(e,t,n){e.lineTo(n.x,n.y)}function Noe(e){return e.stepped?one:e.tension||e.cubicInterpolationMode==="monotone"?ine:Doe}function SF(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 Loe(e,t,n,r){const{points:o,options:i}=t,{count:s,start:a,loop:l,ilen:c}=SF(o,n,r),u=Noe(i);let{move:d=!0,reverse:p}=r||{},h,m,b;for(h=0;h<=c;++h)m=o[(a+(p?c-h:h))%s],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):u(e,b,m,p,i.stepped),b=m);return l&&(m=o[(a+(p?c:0))%s],u(e,b,m,p,i.stepped)),!!l}function Foe(e,t,n,r){const o=t.points,{count:i,start:s,ilen:a}=SF(o,n,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,p,h,m,b,v,x;const w=R=>(s+(c?a-R:R))%i,_=()=>{b!==v&&(e.lineTo(u,v),e.lineTo(u,b),e.lineTo(u,x))};for(l&&(h=o[w(0)],e.moveTo(h.x,h.y)),p=0;p<=a;++p){if(h=o[w(p)],h.skip)continue;const R=h.x,C=h.y,E=R|0;E===m?(C<b?b=C:C>v&&(v=C),u=(d*u+R)/++d):(_(),e.lineTo(R,C),m=E,d=0,b=v=C),x=C}_()}function aS(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Foe:Loe}function joe(e){return e.stepped?Fne:e.tension||e.cubicInterpolationMode==="monotone"?jne:Il}function $oe(e,t,n,r){let o=t._path;o||(o=t._path=new Path2D,t.path(o,n,r)&&o.closePath()),wF(e,t.options),e.stroke(o)}function zoe(e,t,n,r){const{segments:o,options:i}=t,s=aS(t);for(const a of o)wF(e,i,a.style),e.beginPath(),s(e,t,a,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}const Boe=typeof Path2D=="function";function Hoe(e,t,n,r){Boe&&!t.options.segment?$oe(e,t,n,r):zoe(e,t,n,r)}class Fa extends xs{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;kne(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=Wne(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=lF(this,{property:n,start:o,end:o});if(!s.length)return;const a=[],l=joe(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:p}=s[c],h=i[d],m=i[p];if(h===m){a.push(h);continue}const b=Math.abs((o-h[n])/(m[n]-h[n])),v=l(h,m,b,r.stepped);v[n]=t[n],a.push(v)}return a.length===1?a[0]:a}pathSegment(t,n,r){return aS(this)(t,this,n,r)}path(t,n,r){const o=this.segments,i=aS(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(),Hoe(t,this,r,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Oe(Fa,"id","line"),Oe(Fa,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Oe(Fa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Oe(Fa,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function eO(e,t,n,r){const o=e.options,{[n]:i}=e.getProps([n],r);return Math.abs(t-i)<o.radius+o.hitRadius}class cc extends xs{constructor(n){super();Oe(this,"parsed");Oe(this,"skip");Oe(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 eO(this,n,"x",r)}inYRange(n,r){return eO(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||!Zs(this,r,this.size(o)/2)||(n.strokeStyle=o.borderColor,n.lineWidth=o.borderWidth,n.fillStyle=o.backgroundColor,Pb(n,o,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}Oe(cc,"id","point"),Oe(cc,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Oe(cc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function _F(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 ja(e,t,n,r){return e?0:ur(t,n,r)}function Voe(e,t,n){const r=e.options.borderWidth,o=e.borderSkipped,i=QL(r);return{t:ja(o.top,i.top,0,n),r:ja(o.right,i.right,0,t),b:ja(o.bottom,i.bottom,0,n),l:ja(o.left,i.left,0,t)}}function Woe(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),o=e.options.borderRadius,i=ac(o),s=Math.min(t,n),a=e.borderSkipped,l=r||Mt(o);return{topLeft:ja(!l||a.top||a.left,i.topLeft,0,s),topRight:ja(!l||a.top||a.right,i.topRight,0,s),bottomLeft:ja(!l||a.bottom||a.left,i.bottomLeft,0,s),bottomRight:ja(!l||a.bottom||a.right,i.bottomRight,0,s)}}function Uoe(e){const t=_F(e),n=t.right-t.left,r=t.bottom-t.top,o=Voe(e,n/2,r/2),i=Woe(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 Ux(e,t,n,r){const o=t===null,i=n===null,a=e&&!(o&&i)&&_F(e,r);return a&&(o||Xs(t,a.left,a.right))&&(i||Xs(n,a.top,a.bottom))}function Goe(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function qoe(e,t){e.rect(t.x,t.y,t.w,t.h)}function Gx(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 uc extends xs{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}=Uoe(this),a=Goe(s.radius)?Oh:qoe;t.save(),(s.w!==i.w||s.h!==i.h)&&(t.beginPath(),a(t,Gx(s,n,i)),t.clip(),a(t,Gx(i,-n,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Gx(i,n)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,n,r){return Ux(this,t,n,r)}inXRange(t,n){return Ux(this,t,null,n)}inYRange(t,n){return Ux(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}}Oe(uc,"id","bar"),Oe(uc,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),Oe(uc,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Yoe=Object.freeze({__proto__:null,ArcElement:Cu,BarElement:uc,LineElement:Fa,PointElement:cc});const lS=["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)"],tO=lS.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function CF(e){return lS[e%lS.length]}function EF(e){return tO[e%tO.length]}function Koe(e,t){return e.borderColor=CF(t),e.backgroundColor=EF(t),++t}function Xoe(e,t){return e.backgroundColor=e.data.map(()=>CF(t++)),t}function Qoe(e,t){return e.backgroundColor=e.data.map(()=>EF(t++)),t}function Zoe(e){let t=0;return(n,r)=>{const o=e.getDatasetMeta(r).controller;o instanceof Vl?t=Xoe(n,t):o instanceof ah?t=Qoe(n,t):o&&(t=Koe(n,t))}}function nO(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Joe(e){return e&&(e.borderColor||e.backgroundColor)}function eie(){return Cn.borderColor!=="rgba(0,0,0,0.1)"||Cn.backgroundColor!=="rgba(0,0,0,0.1)"}var tie={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,s=nO(r)||Joe(o)||i&&nO(i)||eie();if(!n.forceOverride&&s)return;const a=Zoe(e);r.forEach(a)}};function nie(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,p,h,m,b;for(s[l++]=e[u],d=0;d<i-2;d++){let v=0,x=0,w;const _=Math.floor((d+1)*a)+1+t,R=Math.min(Math.floor((d+2)*a)+1,n)+t,C=R-_;for(w=_;w<R;w++)v+=e[w].x,x+=e[w].y;v/=C,x/=C;const E=Math.floor(d*a)+1+t,A=Math.min(Math.floor((d+1)*a)+1,n)+t,{x:M,y:D}=e[u];for(h=m=-1,w=E;w<A;w++)m=.5*Math.abs((M-v)*(e[w].y-D)-(M-e[w].x)*(x-D)),m>h&&(h=m,p=e[w],b=w);s[l++]=p,u=b}return s[l++]=e[c],s}function rie(e,t,n,r){let o=0,i=0,s,a,l,c,u,d,p,h,m,b;const v=[],x=t+n-1,w=e[t].x,R=e[x].x-w;for(s=t;s<t+n;++s){a=e[s],l=(a.x-w)/R*r,c=a.y;const C=l|0;if(C===u)c<m?(m=c,d=s):c>b&&(b=c,p=s),o=(i*o+a.x)/++i;else{const E=s-1;if(!ht(d)&&!ht(p)){const A=Math.min(d,p),M=Math.max(d,p);A!==h&&A!==E&&v.push({...e[A],x:o}),M!==h&&M!==E&&v.push({...e[M],x:o})}s>0&&E!==h&&v.push(e[E]),v.push(a),u=C,i=0,m=b=c,d=p=h=s}}return v}function RF(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 rO(e){e.data.datasets.forEach(t=>{RF(t)})}function oie(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=ur(Qs(t,i.axis,s).lo,0,n-1)),c?o=ur(Qs(t,i.axis,a).hi+1,r,n)-r:o=n-r,{start:r,count:o}}var iie={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){rO(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:p}=oie(l,c);const h=n.threshold||4*r;if(p<=h){RF(o);return}ht(s)&&(o._data=c,delete o.data,Object.defineProperty(o,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let m;switch(n.algorithm){case"lttb":m=nie(c,d,p,r,n);break;case"min-max":m=rie(c,d,p,r);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}o._decimated=m})},destroy(e){rO(e)}};function sie(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=cE(l,c,o);const u=cS(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=lF(t,u);for(const p of d){const h=cS(n,i[p.start],i[p.end],p.loop),m=aF(a,o,h);for(const b of m)s.push({source:b,target:p,start:{[n]:oO(u,h,"start",Math.max)},end:{[n]:oO(u,h,"end",Math.min)}})}}return s}function cS(e,t,n,r){if(r)return;let o=t[e],i=n[e];return e==="angle"&&(o=Fo(o),i=Fo(i)),{property:e,start:o,end:i}}function aie(e,t){const{x:n=null,y:r=null}=e||{},o=t.points,i=[];return t.segments.forEach(({start:s,end:a})=>{a=cE(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 cE(e,t,n){for(;t>e;t--){const r=n[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function oO(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function PF(e,t){let n=[],r=!1;return Sn(e)?(r=!0,n=e):n=aie(e,t),n.length?new Fa({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function iO(e){return e&&e.fill!==!1}function lie(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(!Nn(o))return o;if(s=e[o],!s)return!1;if(s.visible)return o;i.push(o),o=s.fill}return!1}function cie(e,t,n){const r=hie(e);if(Mt(r))return isNaN(r.value)?!1:r;let o=parseFloat(r);return Nn(o)&&Math.floor(o)===o?uie(r[0],t,o,n):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function uie(e,t,n,r){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=r?!1:n}function die(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:Mt(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function fie(e,t,n){let r;return e==="start"?r=n:e==="end"?r=t.options.reverse?t.min:t.max:Mt(e)?r=e.value:r=t.getBaseValue(),r}function hie(e){const t=e.options,n=t.fill;let r=it(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function pie(e){const{scale:t,index:n,line:r}=e,o=[],i=r.segments,s=r.points,a=gie(t,n);a.push(PF({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++)mie(o,s[u],a)}return new Fa({points:o,options:{}})}function gie(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 mie(e,t,n){const r=[];for(let o=0;o<n.length;o++){const i=n[o],{first:s,last:a,point:l}=bie(i,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function bie(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],p=s[u.end][n];if(Xs(o,d,p)){a=o===d,l=o===p;break}}return{first:a,last:l,point:r}}class TF{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:_n},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 yie(e){const{chart:t,fill:n,line:r}=e;if(Nn(n))return vie(t,n);if(n==="stack")return pie(e);if(n==="shape")return!0;const o=xie(e);return o instanceof TF?o:PF(o,r)}function vie(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function xie(e){return(e.scale||{}).getPointPositionForValue?Sie(e):wie(e)}function wie(e){const{scale:t={},fill:n}=e,r=die(n,t);if(Nn(r)){const o=t.isHorizontal();return{x:o?r:null,y:o?null:r}}return null}function Sie(e){const{scale:t,fill:n}=e,r=t.options,o=t.getLabels().length,i=r.reverse?t.max:t.min,s=fie(n,t,i),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,i);return new TF({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 qx(e,t,n){const r=yie(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&&(ic(e,n),_ie(e,{line:o,target:r,above:u,below:d,area:n,scale:i,axis:s}),sc(e))}function _ie(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&&(sO(e,r,s.top),aO(e,{line:n,target:r,color:o,scale:a,property:l}),e.restore(),e.save(),sO(e,r,s.bottom)),aO(e,{line:n,target:r,color:i,scale:a,property:l}),e.restore()}function sO(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[cE(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 aO(e,t){const{line:n,target:r,property:o,color:i,scale:s}=t,a=sie(n,r,o);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:p=i}={}}=l,h=r!==!0;e.save(),e.fillStyle=p,Cie(e,s,h&&cS(o,u,d)),e.beginPath();const m=!!n.pathSegment(e,l);let b;if(h){m?e.closePath():lO(e,r,d,o);const v=!!r.pathSegment(e,c,{move:m,reverse:!0});b=m&&v,b||lO(e,r,u,o)}e.closePath(),e.fill(b?"evenodd":"nonzero"),e.restore()}}function Cie(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 lO(e,t,n,r){const o=t.interpolate(n,r);o&&e.lineTo(o.x,o.y)}var Eie={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 Fa&&(l={visible:e.isDatasetVisible(s),index:s,fill:cie(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=lie(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&&qx(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;iO(i)&&qx(e.ctx,i,e.chartArea)}},beforeDatasetDraw(e,t,n){const r=t.meta.$filler;!iO(r)||n.drawTime!=="beforeDatasetDraw"||qx(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const cO=(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)}},Rie=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class uO extends xs{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=qn(r.font),i=o.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=cO(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 p=-1,h=-u;return this.legendItems.forEach((m,b)=>{const v=r+n/2+i.measureText(m.text).width;(b===0||c[c.length-1]+v+2*a>s)&&(d+=u,c[c.length-(b>0?0:1)]=0,h+=u,p++),l[b]={left:0,top:h,row:p,width:v,height:o},c[c.length-1]+=v+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,p=0,h=0,m=0,b=0;return this.legendItems.forEach((v,x)=>{const{itemWidth:w,itemHeight:_}=Pie(r,n,i,v,o);x>0&&h+_+2*a>u&&(d+=p+a,c.push({width:p,height:h}),m+=p+a,b++,p=h=0),l[x]={left:m,top:h,col:b,width:w,height:_},p=Math.max(p,w),h+=_+a}),d+=p,c.push({width:p,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:o},rtl:i}}=this,s=Nu(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=Tr(r,this.left+o,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=Tr(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=Tr(r,this.top+t+o,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=Tr(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;ic(t,this),this._draw(),sc(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:o}=this,{align:i,labels:s}=t,a=Cn.color,l=Nu(t.rtl,this.left,this.width),c=qn(s.font),{padding:u}=s,d=c.size,p=d/2;let h;this.drawTitle(),o.textAlign=l.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=c.string;const{boxWidth:m,boxHeight:b,itemHeight:v}=cO(s,d),x=function(E,A,M){if(isNaN(m)||m<=0||isNaN(b)||b<0)return;o.save();const D=it(M.lineWidth,1);if(o.fillStyle=it(M.fillStyle,a),o.lineCap=it(M.lineCap,"butt"),o.lineDashOffset=it(M.lineDashOffset,0),o.lineJoin=it(M.lineJoin,"miter"),o.lineWidth=D,o.strokeStyle=it(M.strokeStyle,a),o.setLineDash(it(M.lineDash,[])),s.usePointStyle){const L={radius:b*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:D},j=l.xPlus(E,m/2),z=A+p;XL(o,L,j,z,s.pointStyleWidth&&m)}else{const L=A+Math.max((d-b)/2,0),j=l.leftForLtr(E,m),z=ac(M.borderRadius);o.beginPath(),Object.values(z).some(Q=>Q!==0)?Oh(o,{x:j,y:L,w:m,h:b,radius:z}):o.rect(j,L,m,b),o.fill(),D!==0&&o.stroke()}o.restore()},w=function(E,A,M){Cc(o,M.text,E,A+v/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},_=this.isHorizontal(),R=this._computeTitleHeight();_?h={x:Tr(i,this.left+u,this.right-r[0]),y:this.top+u+R,line:0}:h={x:this.left+u,y:Tr(i,this.top+R+u,this.bottom-n[0].height),line:0},oF(this.ctx,t.textDirection);const C=v+u;this.legendItems.forEach((E,A)=>{o.strokeStyle=E.fontColor,o.fillStyle=E.fontColor;const M=o.measureText(E.text).width,D=l.textAlign(E.textAlign||(E.textAlign=s.textAlign)),L=m+p+M;let j=h.x,z=h.y;l.setWidth(this.width),_?A>0&&j+L+u>this.right&&(z=h.y+=C,h.line++,j=h.x=Tr(i,this.left+u,this.right-r[h.line])):A>0&&z+C>this.bottom&&(j=h.x=j+n[h.line].width+u,h.line++,z=h.y=Tr(i,this.top+R+u,this.bottom-n[h.line].height));const Q=l.x(j);if(x(Q,z,E),j=qte(D,j+m+p,_?j+L:this.right,t.rtl),w(l.x(j),z,E),_)h.x+=L+u;else if(typeof E.text!="string"){const G=c.lineHeight;h.y+=kF(E,G)+u}else h.y+=C}),iF(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=qn(n.font),o=vr(n.padding);if(!n.display)return;const i=Nu(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,p=this.width;if(this.isHorizontal())p=Math.max(...this.lineWidths),u=this.top+c,d=Tr(t.align,d,this.right-p);else{const m=this.columnSizes.reduce((b,v)=>Math.max(b,v.height),0);u=c+Tr(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const h=Tr(a,d,d+p);s.textAlign=i.textAlign(eE(a)),s.textBaseline="middle",s.strokeStyle=n.color,s.fillStyle=n.color,s.font=r.string,Cc(s,n.text,h,u,r)}_computeTitleHeight(){const t=this.options.title,n=qn(t.font),r=vr(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,o,i;if(Xs(t,this.left,this.right)&&Xs(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(o=i[r],Xs(t,o.left,o.left+o.width)&&Xs(n,o.top,o.top+o.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!Aie(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=Rie(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 Pie(e,t,n,r,o){const i=Tie(r,e,t,n),s=kie(o,r,t.lineHeight);return{itemWidth:i,itemHeight:s}}function Tie(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 kie(e,t,n){let r=e;return typeof t.text!="string"&&(r=kF(t,n)),r}function kF(e,t){const n=e.text?e.text.length:0;return t*n}function Aie(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Oie={id:"legend",_element:uO,start(e,t,n){const r=e.legend=new uO({ctx:e.ctx,options:n,chart:e});Or.configure(e,r,n),Or.addBox(e,r)},stop(e){Or.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;Or.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=vr(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 uE=class extends xs{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=Sn(r.text)?r.text.length:1;this._padding=vr(r.padding);const i=o*qn(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=Tr(a,r,i),d=n+t,c=i-r):(s.position==="left"?(u=r+t,d=Tr(a,o,n),l=En*-.5):(u=i-t,d=Tr(a,n,o),l=En*.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=qn(n.font),i=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(i);Cc(t,n.text,0,0,r,{color:n.color,maxWidth:l,rotation:c,textAlign:eE(n.align),textBaseline:"middle",translation:[s,a]})}};function Mie(e,t){const n=new uE({ctx:e.ctx,options:t,chart:e});Or.configure(e,n,t),Or.addBox(e,n),e.titleBlock=n}var Iie={id:"title",_element:uE,start(e,t,n){Mie(e,n)},stop(e){const t=e.titleBlock;Or.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const r=e.titleBlock;Or.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 im=new WeakMap;var Die={id:"subtitle",start(e,t,n){const r=new uE({ctx:e.ctx,options:n,chart:e});Or.configure(e,r,n),Or.addBox(e,r),im.set(e,r)},stop(e){Or.removeBox(e,im.get(e)),im.delete(e)},beforeUpdate(e,t,n){const r=im.get(e);Or.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 Uf={average(e){if(!e.length)return!1;let t,n,r=new Set,o=0,i=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),o+=l.y,++i}}return i===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,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=nS(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 Hi(e,t){return t&&(Sn(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function zs(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
314
|
+
`)>-1?e.split(`
|
|
315
|
+
`):e}function Nie(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 dO(e,t){const n=e.chart.ctx,{body:r,footer:o,title:i}=e,{boxWidth:s,boxHeight:a}=t,l=qn(t.bodyFont),c=qn(t.titleFont),u=qn(t.footerFont),d=i.length,p=o.length,h=r.length,m=vr(t.padding);let b=m.height,v=0,x=r.reduce((R,C)=>R+C.before.length+C.lines.length+C.after.length,0);if(x+=e.beforeBody.length+e.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),x){const R=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=h*R+(x-h)*l.lineHeight+(x-1)*t.bodySpacing}p&&(b+=t.footerMarginTop+p*u.lineHeight+(p-1)*t.footerSpacing);let w=0;const _=function(R){v=Math.max(v,n.measureText(R).width+w)};return n.save(),n.font=c.string,en(e.title,_),n.font=l.string,en(e.beforeBody.concat(e.afterBody),_),w=t.displayColors?s+2+t.boxPadding:0,en(r,R=>{en(R.before,_),en(R.lines,_),en(R.after,_)}),w=0,n.font=u.string,en(e.footer,_),n.restore(),v+=m.width,{width:v,height:b}}function Lie(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function Fie(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 jie(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"),Fie(c,e,t,n)&&(c="center"),c}function fO(e,t,n){const r=n.yAlign||t.yAlign||Lie(e,n);return{xAlign:n.xAlign||t.xAlign||jie(e,t,n,r),yAlign:r}}function $ie(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function zie(e,t,n){let{y:r,height:o}=e;return t==="top"?r+=n:t==="bottom"?r-=o+n:r-=o/2,r}function hO(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:p,bottomRight:h}=ac(s);let m=$ie(t,a);const b=zie(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(u,p)+o:a==="right"&&(m+=Math.max(d,h)+o),{x:ur(m,0,r.width-t.width),y:ur(b,0,r.height-t.height)}}function sm(e,t,n){const r=vr(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function pO(e){return Hi([],zs(e))}function Bie(e,t,n){return il(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function gO(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const AF={beforeTitle:Ns,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:Ns,beforeBody:Ns,beforeLabel:Ns,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 ht(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:Ns,afterBody:Ns,beforeFooter:Ns,footer:Ns,afterFooter:Ns};function ao(e,t,n,r){const o=e[t].call(n,r);return typeof o>"u"?AF[t].call(n,r):o}var d1;let mO=(d1=class extends xs{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 cF(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=Bie(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,o=ao(r,"beforeTitle",this,t),i=ao(r,"title",this,t),s=ao(r,"afterTitle",this,t);let a=[];return a=Hi(a,zs(o)),a=Hi(a,zs(i)),a=Hi(a,zs(s)),a}getBeforeBody(t,n){return pO(ao(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,o=[];return en(t,i=>{const s={before:[],lines:[],after:[]},a=gO(r,i);Hi(s.before,zs(ao(a,"beforeLabel",this,i))),Hi(s.lines,ao(a,"label",this,i)),Hi(s.after,zs(ao(a,"afterLabel",this,i))),o.push(s)}),o}getAfterBody(t,n){return pO(ao(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,o=ao(r,"beforeFooter",this,t),i=ao(r,"footer",this,t),s=ao(r,"afterFooter",this,t);let a=[];return a=Hi(a,zs(o)),a=Hi(a,zs(i)),a=Hi(a,zs(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(Nie(this.chart,n[l]));return t.filter&&(a=a.filter((u,d,p)=>t.filter(u,d,p,r))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,r))),en(a,u=>{const d=gO(t.callbacks,u);o.push(ao(d,"labelColor",this,u)),i.push(ao(d,"labelPointStyle",this,u)),s.push(ao(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=Uf[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=dO(this,r),c=Object.assign({},a,l),u=fO(this.chart,r,c),d=hO(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}=ac(a),{x:p,y:h}=t,{width:m,height:b}=n;let v,x,w,_,R,C;return i==="center"?(R=h+b/2,o==="left"?(v=p,x=v-s,_=R+s,C=R-s):(v=p+m,x=v+s,_=R-s,C=R+s),w=v):(o==="left"?x=p+Math.max(l,u)+s:o==="right"?x=p+m-Math.max(c,d)-s:x=this.caretX,i==="top"?(_=h,R=_-s,v=x-s,w=x+s):(_=h+b,R=_+s,v=x+s,w=x-s),C=_),{x1:v,x2:x,x3:w,y1:_,y2:R,y3:C}}drawTitle(t,n,r){const o=this.title,i=o.length;let s,a,l;if(i){const c=Nu(r.rtl,this.x,this.width);for(t.x=sm(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",s=qn(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=qn(i.bodyFont),d=sm(this,"left",i),p=o.x(d),h=l<u.lineHeight?(u.lineHeight-l)/2:0,m=n.y+h;if(i.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},v=o.leftForLtr(p,c)+c/2,x=m+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,Pb(t,b,v,x),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Pb(t,b,v,x)}else{t.lineWidth=Mt(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 b=o.leftForLtr(p,c),v=o.leftForLtr(o.xPlus(p,1),c-2),x=ac(s.borderRadius);Object.values(x).some(w=>w!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,Oh(t,{x:b,y:m,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),Oh(t,{x:v,y:m+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(b,m,c,l),t.strokeRect(b,m,c,l),t.fillStyle=s.backgroundColor,t.fillRect(v,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=qn(r.bodyFont);let p=d.lineHeight,h=0;const m=Nu(r.rtl,this.x,this.width),b=function(M){n.fillText(M,m.x(t.x+h),t.y+p/2),t.y+=p+i},v=m.textAlign(s);let x,w,_,R,C,E,A;for(n.textAlign=s,n.textBaseline="middle",n.font=d.string,t.x=sm(this,v,r),n.fillStyle=r.bodyColor,en(this.beforeBody,b),h=a&&v!=="right"?s==="center"?c/2+u:c+2+u:0,R=0,E=o.length;R<E;++R){for(x=o[R],w=this.labelTextColors[R],n.fillStyle=w,en(x.before,b),_=x.lines,a&&_.length&&(this._drawColorBox(n,t,R,m,r),p=Math.max(d.lineHeight,l)),C=0,A=_.length;C<A;++C)b(_[C]),p=d.lineHeight;en(x.after,b)}h=0,p=d.lineHeight,en(this.afterBody,b),t.y-=i}drawFooter(t,n,r){const o=this.footer,i=o.length;let s,a;if(i){const l=Nu(r.rtl,this.x,this.width);for(t.x=sm(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",s=qn(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:p,bottomLeft:h,bottomRight:m}=ac(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-p,l),n.quadraticCurveTo(a+c,l,a+c,l+p),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+h,l+u),n.quadraticCurveTo(a,l+u,a,l+u-h),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=Uf[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=dO(this,t),l=Object.assign({},s,this._size),c=fO(n,t,l),u=hO(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=vr(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),oF(t,n.textDirection),i.y+=s.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),iF(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=!_b(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||!_b(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=Uf[i.position].call(this,t,n);return s!==!1&&(r!==s.x||o!==s.y)}},Oe(d1,"positioners",Uf),d1);var OF={id:"tooltip",_element:mO,positioners:Uf,afterInit(e,t,n){n&&(e.tooltip=new mO({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:AF},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"]},Hie=Object.freeze({__proto__:null,Colors:tie,Decimation:iie,Filler:Eie,Legend:Oie,SubTitle:Die,Title:Iie,Tooltip:OF});const Vie=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Wie(e,t,n,r){const o=e.indexOf(t);if(o===-1)return Vie(e,t,n,r);const i=e.lastIndexOf(t);return o!==i?n:o}const Uie=(e,t)=>e===null?null:ur(Math.round(e),0,t);function bO(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Ob extends sl{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(ht(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:Wie(r,t,it(n,t),this._addedLabels),Uie(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 bO.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}}Oe(Ob,"id","category"),Oe(Ob,"defaults",{ticks:{callback:bO}});function Gie(e,t){const n=[],{bounds:o,step:i,min:s,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:p}=e,h=i||1,m=u-1,{min:b,max:v}=t,x=!ht(s),w=!ht(a),_=!ht(c),R=(v-b)/(d+1);let C=dA((v-b)/m/h)*h,E,A,M,D;if(C<1e-14&&!x&&!w)return[{value:b},{value:v}];D=Math.ceil(v/C)-Math.floor(b/C),D>m&&(C=dA(D*C/m/h)*h),ht(l)||(E=Math.pow(10,l),C=Math.ceil(C*E)/E),o==="ticks"?(A=Math.floor(b/C)*C,M=Math.ceil(v/C)*C):(A=b,M=v),x&&w&&i&&zte((a-s)/i,C/1e3)?(D=Math.round(Math.min((a-s)/C,u)),C=(a-s)/D,A=s,M=a):_?(A=x?s:A,M=w?a:M,D=c-1,C=(M-A)/D):(D=(M-A)/C,oh(D,Math.round(D),C/1e3)?D=Math.round(D):D=Math.ceil(D));const L=Math.max(fA(C),fA(A));E=Math.pow(10,ht(l)?L:l),A=Math.round(A*E)/E,M=Math.round(M*E)/E;let j=0;for(x&&(p&&A!==s?(n.push({value:s}),A<s&&j++,oh(Math.round((A+j*C)*E)/E,s,yO(s,R,e))&&j++):A<s&&j++);j<D;++j){const z=Math.round((A+j*C)*E)/E;if(w&&z>a)break;n.push({value:z})}return w&&p&&M!==a?n.length&&oh(n[n.length-1].value,a,yO(a,R,e))?n[n.length-1].value=a:n.push({value:a}):(!w||M===a)&&n.push({value:M}),n}function yO(e,t,{horizontal:n,minRotation:r}){const o=Ti(r),i=(n?Math.sin(o):Math.cos(o))||.001,s=.75*t*(""+e).length;return Math.min(t/i,s)}class Mb extends sl{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 ht(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=os(o),c=os(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=Gie(o,i);return t.bounds==="ticks"&&BL(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 vp(t,this.chart.options.locale,this.options.ticks.format)}}class gd extends Mb{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Nn(t)?t:0,this.max=Nn(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=Ti(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}}Oe(gd,"id","linear"),Oe(gd,"defaults",{ticks:{callback:K0.formatters.numeric}});const Ih=e=>Math.floor(La(e)),Tl=(e,t)=>Math.pow(10,Ih(e)+t);function vO(e){return e/Math.pow(10,Ih(e))===1}function xO(e,t,n){const r=Math.pow(10,n),o=Math.floor(e/r);return Math.ceil(t/r)-o}function qie(e,t){const n=t-e;let r=Ih(n);for(;xO(e,t,r)>10;)r++;for(;xO(e,t,r)<10;)r--;return Math.min(r,Ih(e))}function Yie(e,{min:t,max:n}){t=No(e.min,t);const r=[],o=Ih(t);let i=qie(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)),p=No(e.min,Math.round((l+u+d*Math.pow(10,i))*s)/s);for(;p<n;)r.push({value:p,major:vO(p),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(i++,d=2,s=i>=0?1:s),p=Math.round((l+u+d*Math.pow(10,i))*s)/s;const h=No(e.max,p);return r.push({value:h,major:vO(h),significand:d}),r}class md extends sl{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const r=Mb.prototype.parse.apply(this,[t,n]);if(r===0){this._zero=!0;return}return Nn(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=Nn(t)?Math.max(0,t):null,this.max=Nn(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Nn(this._userMin)&&(this.min=t===Tl(this.min,0)?Tl(this.min,-1):Tl(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(Tl(r,-1)),s(Tl(o,1)))),r<=0&&i(Tl(o,-1)),o<=0&&s(Tl(r,1)),this.min=r,this.max=o}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},r=Yie(n,this);return t.bounds==="ticks"&&BL(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":vp(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=La(t),this._valueRange=La(this.max)-La(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(La(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}Oe(md,"id","logarithmic"),Oe(md,"defaults",{ticks:{callback:K0.formatters.logarithmic,major:{enabled:!0}}});function uS(e){const t=e.ticks;if(t.display&&e.display){const n=vr(t.backdropPadding);return it(t.font&&t.font.size,Cn.font.size)+n.height}return 0}function Kie(e,t,n){return n=Sn(n)?n:[n],{w:rne(e,t.string,n),h:n.length*t.lineHeight}}function wO(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 Xie(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],o=[],i=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?En/i:0;for(let l=0;l<i;l++){const c=s.setContext(e.getPointLabelContext(l));o[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+o[l],a),d=qn(c.font),p=Kie(e.ctx,d,e._pointLabels[l]);r[l]=p;const h=Fo(e.getIndexAngle(l)+a),m=Math.round(ZC(h)),b=wO(m,u.x,p.w,0,180),v=wO(m,u.y,p.h,90,270);Qie(n,t,h,b,v)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=ese(e,r,o)}function Qie(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 Zie(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(ZC(Fo(l.angle+Bn))),u=rse(l.y,a.h,c),d=tse(c),p=nse(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:p,top:u,right:p+a.w,bottom:u+a.h}}function Jie(e,t){if(!t)return!0;const{left:n,top:r,right:o,bottom:i}=e;return!(Zs({x:n,y:r},t)||Zs({x:n,y:i},t)||Zs({x:o,y:r},t)||Zs({x:o,y:i},t))}function ese(e,t,n){const r=[],o=e._pointLabels.length,i=e.options,{centerPointLabels:s,display:a}=i.pointLabels,l={extra:uS(i)/2,additionalAngle:s?En/o:0};let c;for(let u=0;u<o;u++){l.padding=n[u],l.size=t[u];const d=Zie(e,u,l);r.push(d),a==="auto"&&(d.visible=Jie(d,c),d.visible&&(c=d))}return r}function tse(e){return e===0||e===180?"center":e<180?"left":"right"}function nse(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function rse(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function ose(e,t,n){const{left:r,top:o,right:i,bottom:s}=n,{backdropColor:a}=t;if(!ht(a)){const l=ac(t.borderRadius),c=vr(t.backdropPadding);e.fillStyle=a;const u=r-c.left,d=o-c.top,p=i-r+c.width,h=s-o+c.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),Oh(e,{x:u,y:d,w:p,h,radius:l}),e.fill()):e.fillRect(u,d,p,h)}}function ise(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));ose(n,s,i);const a=qn(s.font),{x:l,y:c,textAlign:u}=i;Cc(n,e._pointLabels[o],l,c+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function MF(e,t,n,r){const{ctx:o}=e;if(n)o.arc(e.xCenter,e.yCenter,t,0,_n);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 sse(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(),MF(e,n,s,r),i.closePath(),i.stroke(),i.restore())}function ase(e,t,n){return il(e,{label:n,index:t,type:"pointLabel"})}class Gf extends Mb{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=vr(uS(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=Nn(t)&&!isNaN(t)?t:0,this.max=Nn(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/uS(this.options))}generateTickLabels(t){Mb.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?Xie(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=_n/(this._pointLabels.length||1),r=this.options.startAngle||0;return Fo(t*n+Ti(r))}getDistanceFromCenterForValue(t){if(ht(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(ht(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 ase(this.getContext(),t,r)}}getPointPosition(t,n,r=0){const o=this.getIndexAngle(t)-Bn+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(),MF(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&&ise(this,s),o.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const p=this.getContext(d),h=o.setContext(p),m=i.setContext(p);sse(this,h,l,s,m)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:p}=u;!p||!d||(t.lineWidth=p,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.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&&this.min>=0&&!n.reverse)return;const c=r.setContext(this.getContext(l)),u=qn(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=vr(c.backdropPadding);t.fillRect(-s/2-d.left,-i-u.size/2-d.top,s+d.width,u.size+d.height)}Cc(t,a.label,0,-i,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}Oe(Gf,"id","radialLinear"),Oe(Gf,"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}}),Oe(Gf,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),Oe(Gf,"descriptors",{angleLines:{_fallback:"grid"}});const Z0={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}},yo=Object.keys(Z0);function SO(e,t){return e-t}function _O(e,t){if(ht(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)),Nn(s)||(s=typeof r=="string"?n.parse(s,r):n.parse(s)),s===null?null:(o&&(s=o==="week"&&(fd(i)||i===!0)?n.startOf(s,"isoWeek",i):n.startOf(s,o)),+s)}function CO(e,t,n,r){const o=yo.length;for(let i=yo.indexOf(e);i<o-1;++i){const s=Z0[yo[i]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((n-t)/(a*s.size))<=r)return yo[i]}return yo[o-1]}function lse(e,t,n,r,o){for(let i=yo.length-1;i>=yo.indexOf(n);i--){const s=yo[i];if(Z0[s].common&&e._adapter.diff(o,r,s)>=t-1)return s}return yo[n?yo.indexOf(n):0]}function cse(e){for(let t=yo.indexOf(e)+1,n=yo.length;t<n;++t)if(Z0[yo[t]].common)return yo[t]}function EO(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:o}=JC(n,t),i=n[r]>=t?n[r]:n[o];e[i]=!0}}function use(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 RO(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:use(e,r,o,n)}class Dh extends sl{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 vre._date(t.adapters.date);o.init(n),rh(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:_O(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=Nn(o)&&!isNaN(o)?o:+n.startOf(Date.now(),r),i=Nn(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=Wte(o,i,s);return this._unit=n.unit||(r.autoSkip?CO(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):lse(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:cse(this._unit),this.initOffsets(o),t.reverse&&a.reverse(),RO(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=ur(n,0,s),r=ur(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||CO(i.minUnit,n,r,this._getLabelCapacity(n)),a=it(o.ticks.stepSize,1),l=s==="week"?i.isoWeekday:!1,c=fd(l)||l===!0,u={};let d=n,p,h;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(p=d,h=0;p<r;p=+t.add(p,a,s),h++)EO(u,p,m);return(p===r||o.bounds==="ticks"||h===1)&&EO(u,p,m),Object.keys(u).sort(SO).map(b=>+b)}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],p=r[n],h=c&&d&&p&&p.major;return this._adapter.format(t,o||(h?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=Ti(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,RO(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(_O(this,o[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return WL(t.sort(SO))}}Oe(Dh,"id","time"),Oe(Dh,"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 am(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}=Qs(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}=Qs(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 dS extends Dh{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=am(n,this.min),this._tableRange=am(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(am(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return am(this._table,r*this._tableRange+this._minPos,!0)}}Oe(dS,"id","timeseries"),Oe(dS,"defaults",Dh.defaults);var dse=Object.freeze({__proto__:null,CategoryScale:Ob,LinearScale:gd,LogarithmicScale:md,RadialLinearScale:Gf,TimeScale:Dh,TimeSeriesScale:dS});const fse=[yre,Yoe,Hie,dse];class Ka{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*hse(e){for(const t of e)yield*t}function IF(e){return Array.from(hse(e))}function Eu(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 Ze=1e-6,DF=1e-12,Pt=Math.PI,Dn=Pt/2,PO=Pt/4,Wo=Pt*2,Ur=180/Pt,ln=Pt/180,Wt=Math.abs,Dd=Math.atan,us=Math.atan2,ft=Math.cos,lm=Math.ceil,NF=Math.exp,Ib=Math.log,Yx=Math.pow,lt=Math.sin,ui=Math.sign||function(e){return e>0?1:e<0?-1:0},Xr=Math.sqrt,dE=Math.tan;function LF(e){return e>1?0:e<-1?Pt:Math.acos(e)}function hi(e){return e>1?Dn:e<-1?-Dn:Math.asin(e)}function cr(){}function Db(e,t){e&&kO.hasOwnProperty(e.type)&&kO[e.type](e,t)}var TO={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)}},kO={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){fS(e.coordinates,t,0)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)fS(n[r],t,0)},Polygon:function(e,t){AO(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)AO(n[r],t)},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)Db(n[r],t)}};function fS(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 AO(e,t){var n=-1,r=e.length;for(t.polygonStart();++n<r;)fS(e[n],t,1);t.polygonEnd()}function Ll(e,t){e&&TO.hasOwnProperty(e.type)?TO[e.type](e,t):Db(e,t)}function hS(e){return[us(e[1],e[0]),hi(e[2])]}function bd(e){var t=e[0],n=e[1],r=ft(n);return[r*ft(t),r*lt(t),lt(n)]}function cm(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Nb(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 Kx(e,t){e[0]+=t[0],e[1]+=t[1],e[2]+=t[2]}function um(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function pS(e){var t=Xr(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]);e[0]/=t,e[1]/=t,e[2]/=t}function gS(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 mS(e,t){return Wt(e)>Pt&&(e-=Math.round(e/Wo)*Wo),[e,t]}mS.invert=mS;function FF(e,t,n){return(e%=Wo)?t||n?gS(MO(e),IO(t,n)):MO(e):t||n?IO(t,n):mS}function OO(e){return function(t,n){return t+=e,Wt(t)>Pt&&(t-=Math.round(t/Wo)*Wo),[t,n]}}function MO(e){var t=OO(e);return t.invert=OO(-e),t}function IO(e,t){var n=ft(e),r=lt(e),o=ft(t),i=lt(t);function s(a,l){var c=ft(l),u=ft(a)*c,d=lt(a)*c,p=lt(l),h=p*n+u*r;return[us(d*o-h*i,u*n-p*r),hi(h*o+d*i)]}return s.invert=function(a,l){var c=ft(l),u=ft(a)*c,d=lt(a)*c,p=lt(l),h=p*o-d*i;return[us(d*o+p*i,u*n+h*r),hi(h*n-u*r)]},s}function pse(e){e=FF(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]*=Ur,n[1]*=Ur,n}return t.invert=function(n){return n=e.invert(n[0]*ln,n[1]*ln),n[0]*=Ur,n[1]*=Ur,n},t}function gse(e,t,n,r,o,i){if(n){var s=ft(t),a=lt(t),l=r*n;o==null?(o=t+r*Wo,i=t-l/2):(o=DO(s,o),i=DO(s,i),(r>0?o<i:o>i)&&(o+=r*Wo));for(var c,u=o;r>0?u>i:u<i;u-=l)c=hS([s,-a*ft(u),-a*lt(u)]),e.point(c[0],c[1])}}function DO(e,t){t=bd(t),t[0]-=e,pS(t);var n=LF(-t[1]);return((-t[2]<0?-n:n)+Wo-Ze)%Wo}function jF(){var e=[],t;return{point:function(n,r,o){t.push([n,r,o])},lineStart:function(){e.push(t=[])},lineEnd:cr,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}}function tb(e,t){return Wt(e[0]-t[0])<Ze&&Wt(e[1]-t[1])<Ze}function dm(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 $F(e,t,n,r,o){var i=[],s=[],a,l;if(e.forEach(function(m){if(!((b=m.length-1)<=0)){var b,v=m[0],x=m[b],w;if(tb(v,x)){if(!v[2]&&!x[2]){for(o.lineStart(),a=0;a<b;++a)o.point((v=m[a])[0],v[1]);o.lineEnd();return}x[0]+=2*Ze}i.push(w=new dm(v,m,null,!0)),s.push(w.o=new dm(v,null,w,!1)),i.push(w=new dm(x,m,null,!1)),s.push(w.o=new dm(x,null,w,!0))}}),!!i.length){for(s.sort(t),NO(i),NO(s),a=0,l=s.length;a<l;++a)s[a].e=n=!n;for(var c=i[0],u,d;;){for(var p=c,h=!0;p.v;)if((p=p.n)===c)return;u=p.z,o.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(a=0,l=u.length;a<l;++a)o.point((d=u[a])[0],d[1]);else r(p.x,p.n.x,1,o);p=p.n}else{if(h)for(u=p.p.z,a=u.length-1;a>=0;--a)o.point((d=u[a])[0],d[1]);else r(p.x,p.p.x,-1,o);p=p.p}p=p.o,u=p.z,h=!h}while(!p.v);o.lineEnd()}}}function NO(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 Xx(e){return Wt(e[0])<=Pt?e[0]:ui(e[0])*((Wt(e[0])+Pt)%Wo-Pt)}function zF(e,t){var n=Xx(t),r=t[1],o=lt(r),i=[lt(n),-ft(n),0],s=0,a=0,l=new Ka;o===1?r=Dn+Ze:o===-1&&(r=-Dn-Ze);for(var c=0,u=e.length;c<u;++c)if(p=(d=e[c]).length)for(var d,p,h=d[p-1],m=Xx(h),b=h[1]/2+PO,v=lt(b),x=ft(b),w=0;w<p;++w,m=R,v=E,x=A,h=_){var _=d[w],R=Xx(_),C=_[1]/2+PO,E=lt(C),A=ft(C),M=R-m,D=M>=0?1:-1,L=D*M,j=L>Pt,z=v*E;if(l.add(us(z*D*lt(L),x*A+z*ft(L))),s+=j?M+D*Wo:M,j^m>=n^R>=n){var Q=Nb(bd(h),bd(_));pS(Q);var G=Nb(i,Q);pS(G);var F=(j^M>=0?-1:1)*hi(G[2]);(r>F||r===F&&(Q[0]||Q[1]))&&(a+=j^M>=0?1:-1)}}return(s<-1e-6||s<Ze&&l<-1e-12)^a&1}function BF(e,t,n,r){return function(o){var i=t(o),s=jF(),a=t(s),l=!1,c,u,d,p={point:h,lineStart:b,lineEnd:v,polygonStart:function(){p.point=x,p.lineStart=w,p.lineEnd=_,u=[],c=[]},polygonEnd:function(){p.point=h,p.lineStart=b,p.lineEnd=v,u=IF(u);var R=zF(c,r);u.length?(l||(o.polygonStart(),l=!0),$F(u,bse,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 h(R,C){e(R,C)&&o.point(R,C)}function m(R,C){i.point(R,C)}function b(){p.point=m,i.lineStart()}function v(){p.point=h,i.lineEnd()}function x(R,C){d.push([R,C]),a.point(R,C)}function w(){a.lineStart(),d=[]}function _(){x(d[0][0],d[0][1]),a.lineEnd();var R=a.clean(),C=s.result(),E,A=C.length,M,D,L;if(d.pop(),c.push(d),d=null,!!A){if(R&1){if(D=C[0],(M=D.length-1)>0){for(l||(o.polygonStart(),l=!0),o.lineStart(),E=0;E<M;++E)o.point((L=D[E])[0],L[1]);o.lineEnd()}return}A>1&&R&2&&C.push(C.pop().concat(C.shift())),u.push(C.filter(mse))}}return p}}function mse(e){return e.length>1}function bse(e,t){return((e=e.x)[0]<0?e[1]-Dn-Ze:Dn-e[1])-((t=t.x)[0]<0?t[1]-Dn-Ze:Dn-t[1])}const LO=BF(function(){return!0},yse,xse,[-Pt,-Dn]);function yse(e){var t=NaN,n=NaN,r=NaN,o;return{lineStart:function(){e.lineStart(),o=1},point:function(i,s){var a=i>0?Pt:-Pt,l=Wt(i-t);Wt(l-Pt)<Ze?(e.point(t,n=(n+s)/2>0?Dn:-Dn),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(a,n),e.point(i,n),o=0):r!==a&&l>=Pt&&(Wt(t-r)<Ze&&(t-=r*Ze),Wt(i-a)<Ze&&(i-=a*Ze),n=vse(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 vse(e,t,n,r){var o,i,s=lt(e-n);return Wt(s)>Ze?Dd((lt(t)*(i=ft(r))*lt(n)-lt(r)*(o=ft(t))*lt(e))/(o*i*s)):(t+r)/2}function xse(e,t,n,r){var o;if(e==null)o=n*Dn,r.point(-Pt,o),r.point(0,o),r.point(Pt,o),r.point(Pt,0),r.point(Pt,-o),r.point(0,-o),r.point(-Pt,-o),r.point(-Pt,0),r.point(-Pt,o);else if(Wt(e[0]-t[0])>Ze){var i=e[0]<t[0]?Pt:-Pt;o=n*i/2,r.point(-i,o),r.point(0,o),r.point(i,o)}else r.point(t[0],t[1])}function wse(e){var t=ft(e),n=2*ln,r=t>0,o=Wt(t)>Ze;function i(u,d,p,h){gse(h,e,n,p,u,d)}function s(u,d){return ft(u)*ft(d)>t}function a(u){var d,p,h,m,b;return{lineStart:function(){m=h=!1,b=1},point:function(v,x){var w=[v,x],_,R=s(v,x),C=r?R?0:c(v,x):R?c(v+(v<0?Pt:-Pt),x):0;if(!d&&(m=h=R)&&u.lineStart(),R!==h&&(_=l(d,w),(!_||tb(d,_)||tb(w,_))&&(w[2]=1)),R!==h)b=0,R?(u.lineStart(),_=l(w,d),u.point(_[0],_[1])):(_=l(d,w),u.point(_[0],_[1],2),u.lineEnd()),d=_;else if(o&&d&&r^R){var E;!(C&p)&&(E=l(w,d,!0))&&(b=0,r?(u.lineStart(),u.point(E[0][0],E[0][1]),u.point(E[1][0],E[1][1]),u.lineEnd()):(u.point(E[1][0],E[1][1]),u.lineEnd(),u.lineStart(),u.point(E[0][0],E[0][1],3)))}R&&(!d||!tb(d,w))&&u.point(w[0],w[1]),d=w,h=R,p=C},lineEnd:function(){h&&u.lineEnd(),d=null},clean:function(){return b|(m&&h)<<1}}}function l(u,d,p){var h=bd(u),m=bd(d),b=[1,0,0],v=Nb(h,m),x=cm(v,v),w=v[0],_=x-w*w;if(!_)return!p&&u;var R=t*x/_,C=-t*w/_,E=Nb(b,v),A=um(b,R),M=um(v,C);Kx(A,M);var D=E,L=cm(A,D),j=cm(D,D),z=L*L-j*(cm(A,A)-1);if(!(z<0)){var Q=Xr(z),G=um(D,(-L-Q)/j);if(Kx(G,A),G=hS(G),!p)return G;var F=u[0],H=d[0],$=u[1],V=d[1],X;H<F&&(X=F,F=H,H=X);var I=H-F,q=Wt(I-Pt)<Ze,U=q||I<Ze;if(!q&&V<$&&(X=$,$=V,V=X),U?q?$+V>0^G[1]<(Wt(G[0]-F)<Ze?$:V):$<=G[1]&&G[1]<=V:I>Pt^(F<=G[0]&&G[0]<=H)){var O=um(D,(-L+Q)/j);return Kx(O,A),[G,hS(O)]}}}function c(u,d){var p=r?e:Pt-e,h=0;return u<-p?h|=1:u>p&&(h|=2),d<-p?h|=4:d>p&&(h|=8),h}return BF(s,a,i,r?[0,-e]:[-Pt,e-Pt])}function Sse(e,t,n,r,o,i){var s=e[0],a=e[1],l=t[0],c=t[1],u=0,d=1,p=l-s,h=c-a,m;if(m=n-s,!(!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=o-s,!(!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)}if(m=r-a,!(!h&&m>0)){if(m/=h,h<0){if(m<u)return;m<d&&(d=m)}else if(h>0){if(m>d)return;m>u&&(u=m)}if(m=i-a,!(!h&&m<0)){if(m/=h,h<0){if(m>d)return;m>u&&(u=m)}else if(h>0){if(m<u)return;m<d&&(d=m)}return u>0&&(e[0]=s+u*p,e[1]=a+u*h),d<1&&(t[0]=s+d*p,t[1]=a+d*h),!0}}}}}var fm=1e9,hm=-1e9;function _se(e,t,n,r){function o(c,u){return e<=c&&c<=n&&t<=u&&u<=r}function i(c,u,d,p){var h=0,m=0;if(c==null||(h=s(c,d))!==(m=s(u,d))||l(c,u)<0^d>0)do p.point(h===0||h===3?e:n,h>1?r:t);while((h=(h+d+4)%4)!==m);else p.point(u[0],u[1])}function s(c,u){return Wt(c[0]-e)<Ze?u>0?0:3:Wt(c[0]-n)<Ze?u>0?2:1:Wt(c[1]-t)<Ze?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),p=s(u,1);return d!==p?d-p: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=jF(),p,h,m,b,v,x,w,_,R,C,E,A={point:M,lineStart:z,lineEnd:Q,polygonStart:L,polygonEnd:j};function M(F,H){o(F,H)&&u.point(F,H)}function D(){for(var F=0,H=0,$=h.length;H<$;++H)for(var V=h[H],X=1,I=V.length,q=V[0],U,O,ee=q[0],K=q[1];X<I;++X)U=ee,O=K,q=V[X],ee=q[0],K=q[1],O<=r?K>r&&(ee-U)*(r-O)>(K-O)*(e-U)&&++F:K<=r&&(ee-U)*(r-O)<(K-O)*(e-U)&&--F;return F}function L(){u=d,p=[],h=[],E=!0}function j(){var F=D(),H=E&&F,$=(p=IF(p)).length;(H||$)&&(c.polygonStart(),H&&(c.lineStart(),i(null,null,1,c),c.lineEnd()),$&&$F(p,a,F,i,c),c.polygonEnd()),u=c,p=h=m=null}function z(){A.point=G,h&&h.push(m=[]),C=!0,R=!1,w=_=NaN}function Q(){p&&(G(b,v),x&&R&&d.rejoin(),p.push(d.result())),A.point=M,R&&u.lineEnd()}function G(F,H){var $=o(F,H);if(h&&m.push([F,H]),C)b=F,v=H,x=$,C=!1,$&&(u.lineStart(),u.point(F,H));else if($&&R)u.point(F,H);else{var V=[w=Math.max(hm,Math.min(fm,w)),_=Math.max(hm,Math.min(fm,_))],X=[F=Math.max(hm,Math.min(fm,F)),H=Math.max(hm,Math.min(fm,H))];Sse(V,X,e,t,n,r)?(R||(u.lineStart(),u.point(V[0],V[1])),u.point(X[0],X[1]),$||u.lineEnd(),E=!1):$&&(u.lineStart(),u.point(F,H),E=!1)}w=F,_=H,R=$}return A}}var bS,yS,nb,rb,yd={sphere:cr,point:cr,lineStart:Cse,lineEnd:cr,polygonStart:cr,polygonEnd:cr};function Cse(){yd.point=Rse,yd.lineEnd=Ese}function Ese(){yd.point=yd.lineEnd=cr}function Rse(e,t){e*=ln,t*=ln,yS=e,nb=lt(t),rb=ft(t),yd.point=Pse}function Pse(e,t){e*=ln,t*=ln;var n=lt(t),r=ft(t),o=Wt(e-yS),i=ft(o),s=lt(o),a=r*s,l=rb*n-nb*r*i,c=nb*n+rb*r*i;bS.add(us(Xr(a*a+l*l),c)),yS=e,nb=n,rb=r}function Tse(e){return bS=new Ka,Ll(e,yd),+bS}var vS=[null,null],kse={type:"LineString",coordinates:vS};function xS(e,t){return vS[0]=e,vS[1]=t,Tse(kse)}var FO={Feature:function(e,t){return Lb(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,o=n.length;++r<o;)if(Lb(n[r].geometry,t))return!0;return!1}},jO={Sphere:function(){return!0},Point:function(e,t){return $O(e.coordinates,t)},MultiPoint:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if($O(n[r],t))return!0;return!1},LineString:function(e,t){return zO(e.coordinates,t)},MultiLineString:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(zO(n[r],t))return!0;return!1},Polygon:function(e,t){return BO(e.coordinates,t)},MultiPolygon:function(e,t){for(var n=e.coordinates,r=-1,o=n.length;++r<o;)if(BO(n[r],t))return!0;return!1},GeometryCollection:function(e,t){for(var n=e.geometries,r=-1,o=n.length;++r<o;)if(Lb(n[r],t))return!0;return!1}};function Lb(e,t){return e&&jO.hasOwnProperty(e.type)?jO[e.type](e,t):!1}function $O(e,t){return xS(e,t)===0}function zO(e,t){for(var n,r,o,i=0,s=e.length;i<s;i++){if(r=xS(e[i],t),r===0||i>0&&(o=xS(e[i],e[i-1]),o>0&&n<=o&&r<=o&&(n+r-o)*(1-Math.pow((n-r)/o,2))<DF*o))return!0;n=r}return!1}function BO(e,t){return!!zF(e.map(Ase),HF(t))}function Ase(e){return e=e.map(HF),e.pop(),e}function HF(e){return[e[0]*ln,e[1]*ln]}function Ose(e,t){return(e&&FO.hasOwnProperty(e.type)?FO[e.type]:Lb)(e,t)}function HO(e,t,n){var r=Eu(e,t-Ze,n).concat(t);return function(o){return r.map(function(i){return[o,i]})}}function VO(e,t,n){var r=Eu(e,t-Ze,n).concat(t);return function(o){return r.map(function(i){return[i,o]})}}function VF(){var e,t,n,r,o,i,s,a,l=10,c=l,u=90,d=360,p,h,m,b,v=2.5;function x(){return{type:"MultiLineString",coordinates:w()}}function w(){return Eu(lm(r/u)*u,n,u).map(m).concat(Eu(lm(a/d)*d,s,d).map(b)).concat(Eu(lm(t/l)*l,e,l).filter(function(_){return Wt(_%u)>Ze}).map(p)).concat(Eu(lm(i/c)*c,o,c).filter(function(_){return Wt(_%d)>Ze}).map(h))}return x.lines=function(){return w().map(function(_){return{type:"LineString",coordinates:_}})},x.outline=function(){return{type:"Polygon",coordinates:[m(r).concat(b(s).slice(1),m(n).reverse().slice(1),b(a).reverse().slice(1))]}},x.extent=function(_){return arguments.length?x.extentMajor(_).extentMinor(_):x.extentMinor()},x.extentMajor=function(_){return arguments.length?(r=+_[0][0],n=+_[1][0],a=+_[0][1],s=+_[1][1],r>n&&(_=r,r=n,n=_),a>s&&(_=a,a=s,s=_),x.precision(v)):[[r,a],[n,s]]},x.extentMinor=function(_){return arguments.length?(t=+_[0][0],e=+_[1][0],i=+_[0][1],o=+_[1][1],t>e&&(_=t,t=e,e=_),i>o&&(_=i,i=o,o=_),x.precision(v)):[[t,i],[e,o]]},x.step=function(_){return arguments.length?x.stepMajor(_).stepMinor(_):x.stepMinor()},x.stepMajor=function(_){return arguments.length?(u=+_[0],d=+_[1],x):[u,d]},x.stepMinor=function(_){return arguments.length?(l=+_[0],c=+_[1],x):[l,c]},x.precision=function(_){return arguments.length?(v=+_,p=HO(i,o,90),h=VO(t,e,v),m=HO(a,s,90),b=VO(r,n,v),x):v},x.extentMajor([[-180,-90+Ze],[180,90-Ze]]).extentMinor([[-180,-80-Ze],[180,80+Ze]])}function Mse(){return VF()()}const wS=e=>e;var Qx=new Ka,SS=new Ka,WF,UF,_S,CS,Gs={point:cr,lineStart:cr,lineEnd:cr,polygonStart:function(){Gs.lineStart=Ise,Gs.lineEnd=Nse},polygonEnd:function(){Gs.lineStart=Gs.lineEnd=Gs.point=cr,Qx.add(Wt(SS)),SS=new Ka},result:function(){var e=Qx/2;return Qx=new Ka,e}};function Ise(){Gs.point=Dse}function Dse(e,t){Gs.point=GF,WF=_S=e,UF=CS=t}function GF(e,t){SS.add(CS*e-_S*t),_S=e,CS=t}function Nse(){GF(WF,UF)}var vd=1/0,Fb=vd,Nh=-vd,jb=Nh,$b={point:Lse,lineStart:cr,lineEnd:cr,polygonStart:cr,polygonEnd:cr,result:function(){var e=[[vd,Fb],[Nh,jb]];return Nh=jb=-(Fb=vd=1/0),e}};function Lse(e,t){e<vd&&(vd=e),e>Nh&&(Nh=e),t<Fb&&(Fb=t),t>jb&&(jb=t)}var ES=0,RS=0,qf=0,zb=0,Bb=0,Ru=0,PS=0,TS=0,Yf=0,qF,YF,Zi,Ji,li={point:Ec,lineStart:WO,lineEnd:UO,polygonStart:function(){li.lineStart=$se,li.lineEnd=zse},polygonEnd:function(){li.point=Ec,li.lineStart=WO,li.lineEnd=UO},result:function(){var e=Yf?[PS/Yf,TS/Yf]:Ru?[zb/Ru,Bb/Ru]:qf?[ES/qf,RS/qf]:[NaN,NaN];return ES=RS=qf=zb=Bb=Ru=PS=TS=Yf=0,e}};function Ec(e,t){ES+=e,RS+=t,++qf}function WO(){li.point=Fse}function Fse(e,t){li.point=jse,Ec(Zi=e,Ji=t)}function jse(e,t){var n=e-Zi,r=t-Ji,o=Xr(n*n+r*r);zb+=o*(Zi+e)/2,Bb+=o*(Ji+t)/2,Ru+=o,Ec(Zi=e,Ji=t)}function UO(){li.point=Ec}function $se(){li.point=Bse}function zse(){KF(qF,YF)}function Bse(e,t){li.point=KF,Ec(qF=Zi=e,YF=Ji=t)}function KF(e,t){var n=e-Zi,r=t-Ji,o=Xr(n*n+r*r);zb+=o*(Zi+e)/2,Bb+=o*(Ji+t)/2,Ru+=o,o=Ji*e-Zi*t,PS+=o*(Zi+e),TS+=o*(Ji+t),Yf+=o*3,Ec(Zi=e,Ji=t)}function XF(e){this._context=e}XF.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,Wo);break}}},result:cr};var kS=new Ka,Zx,QF,ZF,Kf,Xf,Lh={point:cr,lineStart:function(){Lh.point=Hse},lineEnd:function(){Zx&&JF(QF,ZF),Lh.point=cr},polygonStart:function(){Zx=!0},polygonEnd:function(){Zx=null},result:function(){var e=+kS;return kS=new Ka,e}};function Hse(e,t){Lh.point=JF,QF=Kf=e,ZF=Xf=t}function JF(e,t){Kf-=e,Xf-=t,kS.add(Xr(Kf*Kf+Xf*Xf)),Kf=e,Xf=t}let GO,Hb,qO,YO;class KO{constructor(t){this._append=t==null?e4:Vse(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!==qO||this._append!==Hb){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`,qO=r,Hb=this._append,YO=this._,this._=o}this._+=YO;break}}}result(){const t=this._;return this._="",t.length?t:null}}function e4(e){let t=1;this._+=e[0];for(const n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function Vse(e){const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);if(t>15)return e4;if(t!==GO){const n=10**t;GO=t,Hb=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 Hb}function XO(e,t){let n=3,r=4.5,o,i;function s(a){return a&&(typeof r=="function"&&i.pointRadius(+r.apply(this,arguments)),Ll(a,o(i))),i.result()}return s.area=function(a){return Ll(a,o(Gs)),Gs.result()},s.measure=function(a){return Ll(a,o(Lh)),Lh.result()},s.bounds=function(a){return Ll(a,o($b)),$b.result()},s.centroid=function(a){return Ll(a,o(li)),li.result()},s.projection=function(a){return arguments.length?(o=a==null?(e=null,wS):(e=a).stream,s):e},s.context=function(a){return arguments.length?(i=a==null?(t=null,new KO(n)):new XF(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 KO(n)),s},s.projection(e).digits(n).context(t)}function fE(e){return function(t){var n=new AS;for(var r in e)n[r]=e[r];return n.stream=t,n}}function AS(){}AS.prototype={constructor:AS,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 hE(e,t,n){var r=e.clipExtent&&e.clipExtent();return e.scale(150).translate([0,0]),r!=null&&e.clipExtent(null),Ll(n,e.stream($b)),t($b.result()),r!=null&&e.clipExtent(r),e}function pE(e,t,n){return hE(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 t4(e,t,n){return pE(e,[[0,0],t],n)}function n4(e,t,n){return hE(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 r4(e,t,n){return hE(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 QO=16,Wse=ft(30*ln);function ZO(e,t){return+t?Gse(e,t):Use(e)}function Use(e){return fE({point:function(t,n){t=e(t,n),this.stream.point(t[0],t[1])}})}function Gse(e,t){function n(r,o,i,s,a,l,c,u,d,p,h,m,b,v){var x=c-r,w=u-o,_=x*x+w*w;if(_>4*t&&b--){var R=s+p,C=a+h,E=l+m,A=Xr(R*R+C*C+E*E),M=hi(E/=A),D=Wt(Wt(E)-1)<Ze||Wt(i-d)<Ze?(i+d)/2:us(C,R),L=e(D,M),j=L[0],z=L[1],Q=j-r,G=z-o,F=w*Q-x*G;(F*F/_>t||Wt((x*Q+w*G)/_-.5)>.3||s*p+a*h+l*m<Wse)&&(n(r,o,i,s,a,l,j,z,D,R/=A,C/=A,E,b,v),v.point(j,z),n(j,z,D,R,C,E,c,u,d,p,h,m,b,v))}}return function(r){var o,i,s,a,l,c,u,d,p,h,m,b,v={point:x,lineStart:w,lineEnd:R,polygonStart:function(){r.polygonStart(),v.lineStart=C},polygonEnd:function(){r.polygonEnd(),v.lineStart=w}};function x(M,D){M=e(M,D),r.point(M[0],M[1])}function w(){d=NaN,v.point=_,r.lineStart()}function _(M,D){var L=bd([M,D]),j=e(M,D);n(d,p,u,h,m,b,d=j[0],p=j[1],u=M,h=L[0],m=L[1],b=L[2],QO,r),r.point(d,p)}function R(){v.point=x,r.lineEnd()}function C(){w(),v.point=E,v.lineEnd=A}function E(M,D){_(o=M,D),i=d,s=p,a=h,l=m,c=b,v.point=_}function A(){n(d,p,u,h,m,b,i,s,o,a,l,c,QO,r),v.lineEnd=R,R()}return v}}var qse=fE({point:function(e,t){this.stream.point(e*ln,t*ln)}});function Yse(e){return fE({point:function(t,n){var r=e(t,n);return this.stream.point(r[0],r[1])}})}function Kse(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 JO(e,t,n,r,o,i){if(!i)return Kse(e,t,n,r,o);var s=ft(i),a=lt(i),l=s*e,c=a*e,u=s/e,d=a/e,p=(a*n-s*t)/e,h=(a*t+s*n)/e;function m(b,v){return b*=r,v*=o,[l*b-c*v+t,n-c*b-l*v]}return m.invert=function(b,v){return[r*(u*b-d*v+p),o*(h-d*b-u*v)]},m}function ia(e){return o4(function(){return e})()}function o4(e){var t,n=150,r=480,o=250,i=0,s=0,a=0,l=0,c=0,u,d=0,p=1,h=1,m=null,b=LO,v=null,x,w,_,R=wS,C=.5,E,A,M,D,L;function j(F){return M(F[0]*ln,F[1]*ln)}function z(F){return F=M.invert(F[0],F[1]),F&&[F[0]*Ur,F[1]*Ur]}j.stream=function(F){return D&&L===F?D:D=qse(Yse(u)(b(E(R(L=F)))))},j.preclip=function(F){return arguments.length?(b=F,m=void 0,G()):b},j.postclip=function(F){return arguments.length?(R=F,v=x=w=_=null,G()):R},j.clipAngle=function(F){return arguments.length?(b=+F?wse(m=F*ln):(m=null,LO),G()):m*Ur},j.clipExtent=function(F){return arguments.length?(R=F==null?(v=x=w=_=null,wS):_se(v=+F[0][0],x=+F[0][1],w=+F[1][0],_=+F[1][1]),G()):v==null?null:[[v,x],[w,_]]},j.scale=function(F){return arguments.length?(n=+F,Q()):n},j.translate=function(F){return arguments.length?(r=+F[0],o=+F[1],Q()):[r,o]},j.center=function(F){return arguments.length?(i=F[0]%360*ln,s=F[1]%360*ln,Q()):[i*Ur,s*Ur]},j.rotate=function(F){return arguments.length?(a=F[0]%360*ln,l=F[1]%360*ln,c=F.length>2?F[2]%360*ln:0,Q()):[a*Ur,l*Ur,c*Ur]},j.angle=function(F){return arguments.length?(d=F%360*ln,Q()):d*Ur},j.reflectX=function(F){return arguments.length?(p=F?-1:1,Q()):p<0},j.reflectY=function(F){return arguments.length?(h=F?-1:1,Q()):h<0},j.precision=function(F){return arguments.length?(E=ZO(A,C=F*F),G()):Xr(C)},j.fitExtent=function(F,H){return pE(j,F,H)},j.fitSize=function(F,H){return t4(j,F,H)},j.fitWidth=function(F,H){return n4(j,F,H)},j.fitHeight=function(F,H){return r4(j,F,H)};function Q(){var F=JO(n,0,0,p,h,d).apply(null,t(i,s)),H=JO(n,r-F[0],o-F[1],p,h,d);return u=FF(a,l,c),A=gS(t,H),M=gS(u,A),E=ZO(A,C),G()}function G(){return D=L=null,j}return function(){return t=e.apply(this,arguments),j.invert=t.invert&&z,Q()}}function gE(e){var t=0,n=Pt/3,r=o4(e),o=r(t,n);return o.parallels=function(i){return arguments.length?r(t=i[0]*ln,n=i[1]*ln):[t*Ur,n*Ur]},o}function Xse(e){var t=ft(e);function n(r,o){return[r*t,lt(o)/t]}return n.invert=function(r,o){return[r/t,hi(o*t)]},n}function Qse(e,t){var n=lt(e),r=(n+lt(t))/2;if(Wt(r)<Ze)return Xse(e);var o=1+n*(2*r-n),i=Xr(o)/r;function s(a,l){var c=Xr(o-2*r*lt(l))/r;return[c*lt(a*=r),i-c*ft(a)]}return s.invert=function(a,l){var c=i-l,u=us(a,Wt(c))*ui(c);return c*r<0&&(u-=Pt*ui(a)*ui(c)),[u/r,hi((o-(a*a+c*c)*r*r)/(2*r))]},s}function Vb(){return gE(Qse).scale(155.424).center([0,33.6442])}function i4(){return Vb().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])}function Zse(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 Jse(){var e,t,n=i4(),r,o=Vb().rotate([154,0]).center([-2,58.5]).parallels([55,65]),i,s=Vb().rotate([157,0]).center([-3,19.9]).parallels([8,18]),a,l,c={point:function(p,h){l=[p,h]}};function u(p){var h=p[0],m=p[1];return l=null,r.point(h,m),l||(i.point(h,m),l)||(a.point(h,m),l)}u.invert=function(p){var h=n.scale(),m=n.translate(),b=(p[0]-m[0])/h,v=(p[1]-m[1])/h;return(v>=.12&&v<.234&&b>=-.425&&b<-.214?o:v>=.166&&v<.234&&b>=-.214&&b<-.115?s:n).invert(p)},u.stream=function(p){return e&&t===p?e:e=Zse([n.stream(t=p),o.stream(p),s.stream(p)])},u.precision=function(p){return arguments.length?(n.precision(p),o.precision(p),s.precision(p),d()):n.precision()},u.scale=function(p){return arguments.length?(n.scale(p),o.scale(p*.35),s.scale(p),u.translate(n.translate())):n.scale()},u.translate=function(p){if(!arguments.length)return n.translate();var h=n.scale(),m=+p[0],b=+p[1];return r=n.translate(p).clipExtent([[m-.455*h,b-.238*h],[m+.455*h,b+.238*h]]).stream(c),i=o.translate([m-.307*h,b+.201*h]).clipExtent([[m-.425*h+Ze,b+.12*h+Ze],[m-.214*h-Ze,b+.234*h-Ze]]).stream(c),a=s.translate([m-.205*h,b+.212*h]).clipExtent([[m-.214*h+Ze,b+.166*h+Ze],[m-.115*h-Ze,b+.234*h-Ze]]).stream(c),d()},u.fitExtent=function(p,h){return pE(u,p,h)},u.fitSize=function(p,h){return t4(u,p,h)},u.fitWidth=function(p,h){return n4(u,p,h)},u.fitHeight=function(p,h){return r4(u,p,h)};function d(){return e=t=null,u}return u.scale(1070)}function s4(e){return function(t,n){var r=ft(t),o=ft(n),i=e(r*o);return i===1/0?[2,0]:[i*o*lt(t),i*lt(n)]}}function xp(e){return function(t,n){var r=Xr(t*t+n*n),o=e(r),i=lt(o),s=ft(o);return[us(t*i,r*s),hi(r&&n*i/r)]}}var a4=s4(function(e){return Xr(2/(1+e))});a4.invert=xp(function(e){return 2*hi(e/2)});function eae(){return ia(a4).scale(124.75).clipAngle(180-.001)}var l4=s4(function(e){return(e=LF(e))&&e/lt(e)});l4.invert=xp(function(e){return e});function tae(){return ia(l4).scale(79.4188).clipAngle(180-.001)}function J0(e,t){return[e,Ib(dE((Dn+t)/2))]}J0.invert=function(e,t){return[e,2*Dd(NF(t))-Dn]};function nae(){return c4(J0).scale(961/Wo)}function c4(e){var t=ia(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=Pt*r(),p=t(pse(t.rotate()).invert([0,0]));return i(s==null?[[p[0]-d,p[1]-d],[p[0]+d,p[1]+d]]:e===J0?[[Math.max(p[0]-d,s),a],[Math.min(p[0]+d,l),c]]:[[s,Math.max(p[1]-d,a)],[l,Math.min(p[1]+d,c)]])}return u()}function pm(e){return dE((Dn+e)/2)}function rae(e,t){var n=ft(e),r=e===t?lt(e):Ib(n/ft(t))/Ib(pm(t)/pm(e)),o=n*Yx(pm(e),r)/r;if(!r)return J0;function i(s,a){o>0?a<-Dn+Ze&&(a=-Dn+Ze):a>Dn-Ze&&(a=Dn-Ze);var l=o/Yx(pm(a),r);return[l*lt(r*s),o-l*ft(r*s)]}return i.invert=function(s,a){var l=o-a,c=ui(r)*Xr(s*s+l*l),u=us(s,Wt(l))*ui(l);return l*r<0&&(u-=Pt*ui(s)*ui(l)),[u/r,2*Dd(Yx(o/c,1/r))-Dn]},i}function oae(){return gE(rae).scale(109.5).parallels([30,30])}function Wb(e,t){return[e,t]}Wb.invert=Wb;function iae(){return ia(Wb).scale(152.63)}function sae(e,t){var n=ft(e),r=e===t?lt(e):(n-ft(t))/(t-e),o=n/r+e;if(Wt(r)<Ze)return Wb;function i(s,a){var l=o-a,c=r*s;return[l*lt(c),o-l*ft(c)]}return i.invert=function(s,a){var l=o-a,c=us(s,Wt(l))*ui(l);return l*r<0&&(c-=Pt*ui(s)*ui(l)),[c/r,o-ui(r)*Xr(s*s+l*l)]},i}function aae(){return gE(sae).scale(131.154).center([0,13.9389])}var lh=1.340264,ch=-.081106,uh=893e-6,dh=.003796,Ub=Xr(3)/2,lae=12;function u4(e,t){var n=hi(Ub*lt(t)),r=n*n,o=r*r*r;return[e*ft(n)/(Ub*(lh+3*ch*r+o*(7*uh+9*dh*r))),n*(lh+ch*r+o*(uh+dh*r))]}u4.invert=function(e,t){for(var n=t,r=n*n,o=r*r*r,i=0,s,a,l;i<lae&&(a=n*(lh+ch*r+o*(uh+dh*r))-t,l=lh+3*ch*r+o*(7*uh+9*dh*r),n-=s=a/l,r=n*n,o=r*r*r,!(Wt(s)<DF));++i);return[Ub*e*(lh+3*ch*r+o*(7*uh+9*dh*r))/ft(n),hi(lt(n)/Ub)]};function cae(){return ia(u4).scale(177.158)}function d4(e,t){var n=ft(t),r=ft(e)*n;return[n*lt(e)/r,lt(t)/r]}d4.invert=xp(Dd);function uae(){return ia(d4).scale(144.049).clipAngle(60)}function f4(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)))]}f4.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(Wt(o)>Ze&&--r>0);return[e/(.8707+(i=n*n)*(-.131979+i*(-.013791+i*i*i*(.003971-.001529*i)))),n]};function dae(){return ia(f4).scale(175.295)}function h4(e,t){return[ft(t)*lt(e),lt(t)]}h4.invert=xp(hi);function fae(){return ia(h4).scale(249.5).clipAngle(90+Ze)}function p4(e,t){var n=ft(t),r=1+ft(e)*n;return[n*lt(e)/r,lt(t)/r]}p4.invert=xp(function(e){return 2*Dd(e)});function hae(){return ia(p4).scale(250).clipAngle(142)}function g4(e,t){return[Ib(dE((Dn+t)/2)),-e]}g4.invert=function(e,t){return[-t,2*Dd(NF(e))-Dn]};function pae(){var e=c4(g4),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 Kt(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 ey(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function mE(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Nd(){}var Rc=.7,xd=1/Rc,Lu="\\s*([+-]?\\d+)\\s*",Fh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",is="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",gae=/^#([0-9a-f]{3,8})$/,mae=new RegExp(`^rgb\\(${Lu},${Lu},${Lu}\\)$`),bae=new RegExp(`^rgb\\(${is},${is},${is}\\)$`),yae=new RegExp(`^rgba\\(${Lu},${Lu},${Lu},${Fh}\\)$`),vae=new RegExp(`^rgba\\(${is},${is},${is},${Fh}\\)$`),xae=new RegExp(`^hsl\\(${Fh},${is},${is}\\)$`),wae=new RegExp(`^hsla\\(${Fh},${is},${is},${Fh}\\)$`),eM={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};ey(Nd,bE,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tM,formatHex:tM,formatHex8:Sae,formatHsl:_ae,formatRgb:nM,toString:nM});function tM(){return this.rgb().formatHex()}function Sae(){return this.rgb().formatHex8()}function _ae(){return b4(this).formatHsl()}function nM(){return this.rgb().formatRgb()}function bE(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=gae.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?rM(t):n===3?new Mr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?gm(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?gm(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=mae.exec(e))?new Mr(t[1],t[2],t[3],1):(t=bae.exec(e))?new Mr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=yae.exec(e))?gm(t[1],t[2],t[3],t[4]):(t=vae.exec(e))?gm(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=xae.exec(e))?sM(t[1],t[2]/100,t[3]/100,1):(t=wae.exec(e))?sM(t[1],t[2]/100,t[3]/100,t[4]):eM.hasOwnProperty(e)?rM(eM[e]):e==="transparent"?new Mr(NaN,NaN,NaN,0):null}function rM(e){return new Mr(e>>16&255,e>>8&255,e&255,1)}function gm(e,t,n,r){return r<=0&&(e=t=n=NaN),new Mr(e,t,n,r)}function m4(e){return e instanceof Nd||(e=bE(e)),e?(e=e.rgb(),new Mr(e.r,e.g,e.b,e.opacity)):new Mr}function jh(e,t,n,r){return arguments.length===1?m4(e):new Mr(e,t,n,r??1)}function Mr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ey(Mr,jh,mE(Nd,{brighter(e){return e=e==null?xd:Math.pow(xd,e),new Mr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Rc:Math.pow(Rc,e),new Mr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Mr(dc(this.r),dc(this.g),dc(this.b),Gb(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:oM,formatHex:oM,formatHex8:Cae,formatRgb:iM,toString:iM}));function oM(){return`#${Wl(this.r)}${Wl(this.g)}${Wl(this.b)}`}function Cae(){return`#${Wl(this.r)}${Wl(this.g)}${Wl(this.b)}${Wl((isNaN(this.opacity)?1:this.opacity)*255)}`}function iM(){const e=Gb(this.opacity);return`${e===1?"rgb(":"rgba("}${dc(this.r)}, ${dc(this.g)}, ${dc(this.b)}${e===1?")":`, ${e})`}`}function Gb(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function dc(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Wl(e){return e=dc(e),(e<16?"0":"")+e.toString(16)}function sM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Pi(e,t,n,r)}function b4(e){if(e instanceof Pi)return new Pi(e.h,e.s,e.l,e.opacity);if(e instanceof Nd||(e=bE(e)),!e)return new Pi;if(e instanceof Pi)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 Pi(s,a,l,e.opacity)}function Eae(e,t,n,r){return arguments.length===1?b4(e):new Pi(e,t,n,r??1)}function Pi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ey(Pi,Eae,mE(Nd,{brighter(e){return e=e==null?xd:Math.pow(xd,e),new Pi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Rc:Math.pow(Rc,e),new Pi(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 Mr(Jx(e>=240?e-240:e+120,o,r),Jx(e,o,r),Jx(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Pi(aM(this.h),mm(this.s),mm(this.l),Gb(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=Gb(this.opacity);return`${e===1?"hsl(":"hsla("}${aM(this.h)}, ${mm(this.s)*100}%, ${mm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function aM(e){return e=(e||0)%360,e<0?e+360:e}function mm(e){return Math.max(0,Math.min(1,e||0))}function Jx(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 Rae=Math.PI/180,Pae=180/Math.PI;var y4=-.14861,yE=1.78277,vE=-.29227,ty=-.90649,$h=1.97294,lM=$h*ty,cM=$h*yE,uM=yE*vE-ty*y4;function Tae(e){if(e instanceof fc)return new fc(e.h,e.s,e.l,e.opacity);e instanceof Mr||(e=m4(e));var t=e.r/255,n=e.g/255,r=e.b/255,o=(uM*r+lM*t-cM*n)/(uM+lM-cM),i=r-o,s=($h*(n-o)-vE*i)/ty,a=Math.sqrt(s*s+i*i)/($h*o*(1-o)),l=a?Math.atan2(s,i)*Pae-120:NaN;return new fc(l<0?l+360:l,a,o,e.opacity)}function ds(e,t,n,r){return arguments.length===1?Tae(e):new fc(e,t,n,r??1)}function fc(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ey(fc,ds,mE(Nd,{brighter(e){return e=e==null?xd:Math.pow(xd,e),new fc(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Rc:Math.pow(Rc,e),new fc(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Rae,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),o=Math.sin(e);return new Mr(255*(t+n*(y4*r+yE*o)),255*(t+n*(vE*r+ty*o)),255*(t+n*($h*r)),this.opacity)}}));function kae(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 Aae(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 kae((n-r/t)*t,s,o,i,a)}}const xE=e=>()=>e;function v4(e,t){return function(n){return e+n*t}}function Oae(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 Mae(e,t){var n=t-e;return n?v4(e,n>180||n<-180?n-360*Math.round(n/360):n):xE(isNaN(e)?t:e)}function Iae(e){return(e=+e)==1?Fu:function(t,n){return n-t?Oae(t,n,e):xE(isNaN(t)?n:t)}}function Fu(e,t){var n=t-e;return n?v4(e,n):xE(isNaN(e)?t:e)}(function e(t){var n=Iae(t);function r(o,i){var s=n((o=jh(o)).r,(i=jh(i)).r),a=n(o.g,i.g),l=n(o.b,i.b),c=Fu(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 Dae(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=jh(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 Nae=Dae(Aae);function x4(e){return function t(n){n=+n;function r(o,i){var s=e((o=ds(o)).h,(i=ds(i)).h),a=Fu(o.s,i.s),l=Fu(o.l,i.l),c=Fu(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)}x4(Mae);var wE=x4(Fu);const dn=e=>Nae(e[e.length-1]);var Lae=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Kt);const Fae=dn(Lae);var jae=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Kt);const $ae=dn(jae);var zae=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Kt);const Bae=dn(zae);var Hae=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Kt);const Vae=dn(Hae);var Wae=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Kt);const Uae=dn(Wae);var Gae=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Kt);const qae=dn(Gae);var Yae=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Kt);const Kae=dn(Yae);var Xae=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Kt);const Qae=dn(Xae);var Zae=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Kt);const Jae=dn(Zae);var ele=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Kt);const tle=dn(ele);var nle=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Kt);const rle=dn(nle);var ole=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Kt);const ile=dn(ole);var sle=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Kt);const ale=dn(sle);var lle=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Kt);const cle=dn(lle);var ule=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Kt);const dle=dn(ule);var fle=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Kt);const hle=dn(fle);var ple=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Kt);const gle=dn(ple);var mle=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Kt);const ble=dn(mle);var yle=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Kt);const vle=dn(yle);var xle=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Kt);const wle=dn(xle);var Sle=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Kt);const _le=dn(Sle);var Cle=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Kt);const Ele=dn(Cle);var Rle=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Kt);const Ple=dn(Rle);var Tle=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Kt);const kle=dn(Tle);var Ale=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Kt);const Ole=dn(Ale);var Mle=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Kt);const Ile=dn(Mle);var Dle=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Kt);const Nle=dn(Dle);function Lle(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 Fle=wE(ds(300,.5,0),ds(-240,.5,1));var jle=wE(ds(-100,.75,.35),ds(80,1.5,.8)),$le=wE(ds(260,.75,.35),ds(80,1.5,.8)),bm=ds();function zle(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return bm.h=360*e-100,bm.s=1.5-1.5*t,bm.l=.8-.9*t,bm+""}var ym=jh(),Ble=Math.PI/3,Hle=Math.PI*2/3;function Vle(e){var t;return e=(.5-e)*Math.PI,ym.r=255*(t=Math.sin(e))*t,ym.g=255*(t=Math.sin(e+Ble))*t,ym.b=255*(t=Math.sin(e+Hle))*t,ym+""}function Wle(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 ny(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const Ule=ny(Kt("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var Gle=ny(Kt("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),qle=ny(Kt("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),Yle=ny(Kt("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));function Kle(e){return e}function Xle(e){if(e==null)return Kle;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 Qle(e,t){for(var n,r=e.length,o=r-t;o<--r;)n=e[o],e[o++]=e[r],e[r]=n}function Zle(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return dM(e,n)})}:dM(e,t)}function dM(e,t){var n=t.id,r=t.bbox,o=t.properties==null?{}:t.properties,i=Jle(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 Jle(e,t){var n=Xle(e.transform),r=e.arcs;function o(u,d){d.length&&d.pop();for(var p=r[u<0?~u:u],h=0,m=p.length;h<m;++h)d.push(n(p[h],h));u<0&&Qle(d,m)}function i(u){return n(u)}function s(u){for(var d=[],p=0,h=u.length;p<h;++p)o(u[p],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,p;switch(d){case"GeometryCollection":return{type:d,geometries:u.geometries.map(c)};case"Point":p=i(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(i);break;case"LineString":p=s(u.arcs);break;case"MultiLineString":p=u.arcs.map(s);break;case"Polygon":p=l(u.arcs);break;case"MultiPolygon":p=u.arcs.map(l);break;default:return null}return{type:d,coordinates:p}}return c(t)}const fh={geoAzimuthalEqualArea:eae,geoAzimuthalEquidistant:tae,geoGnomonic:uae,geoOrthographic:fae,geoStereographic:hae,geoEqualEarth:cae,geoAlbers:i4,geoAlbersUsa:Jse,geoConicConformal:oae,geoConicEqualArea:Vb,geoConicEquidistant:aae,geoEquirectangular:iae,geoMercator:nae,geoTransverseMercator:pae,geoNaturalEarth1:dae};Object.keys(fh).forEach(e=>{fh[`${e.charAt(3).toLowerCase()}${e.slice(4)}`]=fh[e]});class zc extends sl{constructor(t){super(t),this.outlineBounds=null,this.oldChartBounds=null,this.geoPath=XO()}init(t){t.position="chartArea",super.init(t),typeof t.projection=="function"?this.projection=t.projection:this.projection=(fh[t.projection]||fh.albersUsa)(),this.geoPath.projection(this.projection),this.outlineBounds=null,this.oldChartBounds=null}computeBounds(t){const n=XO(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),p=n.width*d,h=n.height*d,m=(l-p)*.5+t.left+i,b=(c-h)*.5+t.top+o,v=this.options;return this.projection.scale(n.refScale*d*v.projectionScale).translate([d*n.refX+m+v.projectionOffset[0],d*n.refY+b+v.projectionOffset[1]]),!u||u.chartWidth!==this.oldChartBounds.chartWidth||u.chartHeight!==this.oldChartBounds.chartHeight}}zc.id="projection";zc.defaults={projection:"albersUsa",projectionScale:1,projectionOffset:[0,0],padding:0};zc.descriptors={_scriptable:e=>e!=="projection",_indexable:e=>e!=="projectionOffset"};const ry={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 ece(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 tce(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=ece(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 Pu extends gd{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=(h,m)=>h<1?m*h:h,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 p=super.update(c,u,r);return this.options.position=d,this.height=Math.min(u,this.height),this.width=Math.min(c,this.width),p}_computeLabelArea(){}draw(t){if(!this._isVisible())return;const n=tce(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 w4 extends md{constructor(){super(...arguments),this.legendSize={w:0,h:0}}init(t){Pu.prototype.init.call(this,t)}parse(t,n){return Pu.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 Pu.prototype.update.call(this,t,n,r)}_computeLabelArea(){}draw(t){return Pu.prototype.draw.call(this,t)}_drawIndicator(){}}const qs={interpolateBlues:Ele,interpolateBrBG:Fae,interpolateBuGn:tle,interpolateBuPu:rle,interpolateCividis:Lle,interpolateCool:$le,interpolateCubehelixDefault:Fle,interpolateGnBu:ile,interpolateGreens:Ple,interpolateGreys:kle,interpolateInferno:qle,interpolateMagma:Gle,interpolateOrRd:ale,interpolateOranges:Nle,interpolatePRGn:$ae,interpolatePiYG:Bae,interpolatePlasma:Yle,interpolatePuBu:dle,interpolatePuBuGn:cle,interpolatePuOr:Vae,interpolatePuRd:hle,interpolatePurples:Ole,interpolateRainbow:zle,interpolateRdBu:Uae,interpolateRdGy:qae,interpolateRdPu:gle,interpolateRdYlBu:Kae,interpolateRdYlGn:Qae,interpolateReds:Ile,interpolateSinebow:Vle,interpolateSpectral:Jae,interpolateTurbo:Wle,interpolateViridis:Ule,interpolateWarm:jle,interpolateYlGn:vle,interpolateYlGnBu:ble,interpolateYlOrBr:wle,interpolateYlOrRd:_le};Object.keys(qs).forEach(e=>{qs[`${e.charAt(11).toLowerCase()}${e.slice(12)}`]=qs[e],qs[e.slice(11)]=qs[e]});function S4(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 _4={interpolate:"blues",missing:"transparent",quantize:0};class Xa extends Pu{get interpolate(){const t=this.options;return t?typeof t.interpolate=="function"?t.interpolate:qs[t.interpolate]||qs.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=S4(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)}}}}Xa.id="color";Xa.defaults=dr({},[gd.defaults,ry,_4]);Xa.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};class SE extends w4{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=qs[t.interpolate]||qs.blues}getColorForValue(t){return Xa.prototype.getColorForValue.call(this,t)}getColor(t){let n=t;return this.options.quantize>0&&(n=S4(n,this.options.quantize)),this.interpolate(n)}_drawIndicator(){return Xa.prototype._drawIndicator.call(this)}}SE.id="colorLogarithmic";SE.defaults=dr({},[md.defaults,ry,_4]);SE.descriptors={_scriptable:e=>e!=="interpolate",_indexable:!1};const C4={missing:1,mode:"area",range:[2,20],legend:{align:"bottom",length:90,width:70,indicatorWidth:42}};class Qa extends Pu{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,p=r?n:c.y,h={pointStyle:"circle",borderWidth:0,...this._model||{},radius:u};Pb(t,h,d,p)})}}Qa.id="size";Qa.defaults=dr({},[gd.defaults,ry,C4]);Qa.descriptors={_scriptable:!0,_indexable:e=>e!=="range"};class E4 extends w4{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 Qa.prototype.getSizeImpl.call(this,t)}_drawIndicator(){Qa.prototype._drawIndicator.call(this)}}E4.id="sizeLogarithmic";E4.defaults=dr({},[md.defaults,ry,C4]);function nce(e,t){return[[e[0][0]-t,e[0][1]-t],[e[1][0]+t,e[1][1]+t]]}class na extends xs{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&&Ose(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=nce(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())}}na.id="geoFeature";na.defaults={...uc.defaults,outlineBackgroundColor:null,outlineBorderWidth:0,graticuleBorderColor:"#CCCCCC",graticuleBorderWidth:0};na.defaultRoutes={outlineBorderColor:"borderColor",...uc.defaultRoutes||{}};const R4={showOutline:!1,showGraticule:!1,clipMap:!0},P4={scales:{projection:{axis:"x",type:zc.id,position:"chartArea",display:!1}}};function fM(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 T4 extends di{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 it(this.getGeoDataset().showOutline,this.getGeoOptions().showOutline)}clipMap(){return it(this.getGeoDataset().clipMap,this.getGeoOptions().clipMap)}getGraticule(){return it(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=fM(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=fM(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(Mse());else{const s=VF();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,ic(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||ic(t.ctx,t.chartArea):r&&(r=!1,sc(t.ctx)),this.showGraticule(),n===!0||n==="items"?r||ic(t.ctx,t.chartArea):r&&(r=!1,sc(t.ctx)),this.getMeta().data.forEach(o=>o.draw.call(o,t.ctx,t.chartArea)),r&&(r=!1,sc(t.ctx))}}function k4(e,t,n,r=[],o=[]){qr.addControllers(n),Array.isArray(r)?qr.addElements(...r):qr.addElements(r),Array.isArray(o)?qr.addScales(...o):qr.addScales(o);const i=t;return i.type=e,i}class Ld extends T4{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(),p={x:d.x,y:d.y};a&&(p.options=s||this.resolveDataElementOptions(c,o)),this.updateElement(u,c,p,o)}}indexToColor(t){const n=this.getMeta().rScale;return n.getColorForValue(this.getParsed(t)[n.axis])}}Ld.id="choropleth";Ld.defaults=dr({},[R4,{datasetElementType:na.id,dataElementType:na.id}]);Ld.overrides=dr({},[P4,{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:Xa.id,axis:"x"}},elements:{geoFeature:{backgroundColor(e){return e.dataIndex==null?null:e.chart.getDatasetMeta(e.datasetIndex).controller.indexToColor(e.dataIndex)}}}}]);class rce extends kn{constructor(t,n){super(t,k4("choropleth",n,Ld,na,[Xa,zc]))}}rce.id=Ld.id;class Fd extends T4{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],p=this.getParsed(u),h=c.projection([p.x,p.y]),m={x:h?h[0]:0,y:h?h[1]:0,skip:Number.isNaN(p.x)||Number.isNaN(p.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])}}Fd.id="bubbleMap";Fd.defaults=dr({},[R4,{dataElementType:cc.id,datasetElementType:na.id,showOutline:!0,clipMap:"outline+graticule"}]);Fd.overrides=dr({},[P4,{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:Qa.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 oce extends kn{constructor(t,n){super(t,k4("bubbleMap",n,Fd,na,[Qa,zc]))}}oce.id=Fd.id;function ice(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 sce(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 ace(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 lce(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 cce(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 uce(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 dce(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 fce(e){var r,o;const t=ye.getState().theme;let n={...e,type:"radar",options:{...e==null?void 0:e.options,scales:{x:{display:!1},y:{display:!1},r:{grid:{display:!0},angleLines:{},ticks:{}}},plugins:{...(r=e==null?void 0:e.options)==null?void 0:r.plugins,legend:{position:"bottom",align:"center"}}}};return t==="dark"&&(n={...n,options:{...n.options,scales:{...(o=n==null?void 0:n.options)==null?void 0:o.scales,r:{grid:{color:$t.slate[800]},angleLines:{color:$t.slate[800]},ticks:{color:$t.slate[800],showLabelBackdrop:!1}}}}}),n}function _E({data:e,cardType:t="bar",cfg:n,customCfg:r,provider:o="chartjs",userSettings:i,preferences:s,topoJson:a}){var l,c,u,d,p,h,m,b,v,x;if(t==="map"){if(!a)return null;const w=(l=s==null?void 0:s.mapVisualOptions)==null?void 0:l.objectKey;if(!w)return null;const _=Zle(a,(c=a==null?void 0:a.objects)==null?void 0:c[w]).features;if(!_)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:((p=s==null?void 0:s.mapVisualOptions)==null?void 0:p.projectionOffset)||[0,0]},color:{axis:"x",interpolate:((h=s==null?void 0:s.mapVisualOptions)==null?void 0:h.colorScale)||"blues",quantize:5,legend:{position:"bottom-right",align:"right"}}}},{keys:C}=lr(e),E=_.map(z=>{var H;const Q=C==null?void 0:C[0],G=C==null?void 0:C[1],F=(H=e.find($=>($==null?void 0:$[Q])===z.properties.NAME||($==null?void 0:$[Q])===z.properties.name))==null?void 0:H[G];return{feature:z,value:F}}),M=Hf([{label:w,data:E,borderColor:"lightgray"}],r),D={type:"choropleth",data:{labels:_.map(z=>z.properties.NAME||z.properties.name),datasets:M},options:R},{options:L}=DL({cfg:D,preferences:s,customCfg:r});return{...D,options:L}}if(t==="bar"){const w=ace(n);return Cl({data:e,cfg:w,customCfg:r,cardType:t,preferences:s})}if(t==="horizontalBar"){const w=ice(n);return Cl({data:e,cfg:w,customCfg:r,cardType:t,preferences:s})}if(t==="pyramid"){const w=sce(n),{dimensionKeys:_,metricKeys:R}=lr(e),C=Sb({dataArray:e,groupKey:_[0],pivotKey:_[1],valueKey:R[0]}),E=Cl({data:C,cfg:w,customCfg:r,cardType:t,preferences:s}),A="x2";return{...E,data:{...E.data,datasets:E.data.datasets.map((D,L)=>L===1?{...D,xAxisID:A}:D)},options:{...E.options,scales:{...(m=E==null?void 0:E.options)==null?void 0:m.scales,[A]:{beginAtZero:!0,stack:1}}}}}if(t==="stackedBar"||t==="stackedLine"){const w=cce(n,t),{dimensionKeys:_,metricKeys:R}=lr(e),C=Sb({dataArray:e,groupKey:_[0],pivotKey:_[1],valueKey:R[0],sortChart:s==null?void 0:s.sortChart});return Cl({data:C,cfg:w,customCfg:r,cardType:t,preferences:s})}if(t==="line"){const w=uce(n);return Cl({data:e,cfg:w,customCfg:r,cardType:t,preferences:s})}if(t==="range"){const w=lce(n),_=$ee(e),R=Hf(_,r),{plugins:C,options:E}=J1((s==null?void 0:s.customVisualCode)||""),A=ho((w==null?void 0:w.options)||{},(n==null?void 0:n.options)||{}),M=ho(A,(s==null?void 0:s.chartOptions)||{}),D=ho(M,(r==null?void 0:r.options)||{}),L=ho(D,E),j=IL(n,s),z=ho(L,j),Q={...z,plugins:{...z==null?void 0:z.plugins,datalabels:{...(b=z==null?void 0:z.plugins)==null?void 0:b.datalabels,formatter:(V,X)=>V.map(q=>{var U,O,ee,K;return ci({number:Number(q),decimalPlaces:((U=s==null?void 0:s.numberAxisFormat)==null?void 0:U.decimalPlaces)||0,useSuffix:!!((O=s==null?void 0:s.numberAxisFormat)!=null&&O.suffix),customSuffix:"",locale:((ee=s==null?void 0:s.numberAxisFormat)==null?void 0:ee.locale)||"",currency:((K=s==null?void 0:s.numberAxisFormat)==null?void 0:K.currency)||""})}).slice(0,2).join(" - ")}}},{dimensionKeys:G}=lr(e),F=G[0];return{type:"bar",data:{labels:[...new Set(Z1(e,F))],datasets:R},options:Q,plugins:[...C]}}if(t==="pie"||t==="doughnut"||t==="polarArea"){const w=dce(t,n),{dimensionKeys:_,metricKeys:R}=lr(e),C=zee(R,e),E=Hf(C,r),{plugins:A,options:M}=J1((s==null?void 0:s.customVisualCode)||""),D=_[0],L=Z1(e,D),j=ho((w==null?void 0:w.options)||{},(r==null?void 0:r.options)||{}),z=ho(j,(s==null?void 0:s.chartOptions)||{}),Q={...z,plugins:{...z.plugins,datalabels:{...(v=z.plugins)==null?void 0:v.datalabels,formatter:(V,X)=>{var I,q,U,O;return ci({number:Number(V),decimalPlaces:((I=s==null?void 0:s.numberAxisFormat)==null?void 0:I.decimalPlaces)||0,useSuffix:!!((q=s==null?void 0:s.numberAxisFormat)!=null&&q.suffix),customSuffix:"",locale:((U=s==null?void 0:s.numberAxisFormat)==null?void 0:U.locale)||"",currency:((O=s==null?void 0:s.numberAxisFormat)==null?void 0:O.currency)||""})}},tooltip:{...(x=z.plugins)==null?void 0:x.tooltip,callbacks:{label:function(V){var ee,K,oe,Y;V.dataset.label;const I=V.dataset.data.reduce((J,ie)=>J+ie,0),q=V.parsed,U=ci({number:Number(q),decimalPlaces:((ee=s==null?void 0:s.numberAxisFormat)==null?void 0:ee.decimalPlaces)||0,useSuffix:!!((K=s==null?void 0:s.numberAxisFormat)!=null&&K.suffix),customSuffix:"",locale:((oe=s==null?void 0:s.numberAxisFormat)==null?void 0:oe.locale)||"",currency:((Y=s==null?void 0:s.numberAxisFormat)==null?void 0:Y.currency)||""}),O=(q/I*100).toFixed(2);return U+` (${O}%)`}}}}},G=ho(z,Q),F=ho(G,M);return{type:t,data:{labels:L,datasets:E},options:F,plugins:[t==="doughnut"?{id:"doughnutLabel",beforeDatasetsDraw:function(V,X,I){var ie,de,he,ae;const{ctx:q,data:U}=V;q.save();const O=V.getDatasetMeta(0).data[0].x,ee=V.getDatasetMeta(0).data[0].y,K=ad(Rh()),oe=window.getComputedStyle(q.canvas).fontFamily;q.font=`1em ${oe}`,q.fontWeight="bolder",q.fillStyle=K,q.textAlign="center",q.textBaseline="middle";const Y=U.datasets[0].data.reduce((ge,ue)=>ge+ue,0),J=ci({number:Number(Y),decimalPlaces:((ie=s==null?void 0:s.numberAxisFormat)==null?void 0:ie.decimalPlaces)||0,useSuffix:!!((de=s==null?void 0:s.numberAxisFormat)!=null&&de.suffix),customSuffix:"",locale:((he=s==null?void 0:s.numberAxisFormat)==null?void 0:he.locale)||"",currency:((ae=s==null?void 0:s.numberAxisFormat)==null?void 0:ae.currency)||""});q.fillText(J,O,ee)}}:"",...A]}}if(t==="radar"){const w=fce(n);return Cl({data:e,cfg:w,customCfg:r,cardType:t,preferences:s})}if(t==="bubble"||t==="scatter"){const{metricKeys:w}=lr(e);if(w.length<3){console.log("Bubble charts require 3 numeric columns");return}const _=jee(e),R=Hf(_,r),C={plugins:{datalabels:{display:!0}},scales:{x:{title:{display:!0,text:w[0]},beginAtZero:!0,ticks:{precision:0}},y:{title:{display:!0,text:w[1]},beginAtZero:!0,ticks:{precision:0}}}},E=ho(C,(r==null?void 0:r.options)||{});return{type:t,data:{datasets:R},options:E}}return Cl({data:e,cfg:n,customCfg:r,cardType:t,preferences:s})}function hce({chart:e,elementIndex:t,datasetIndex:n,cardType:r,cfg:o,apply:i}){const s=ye.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)&&gce(e,t,o,i,a),["pie","doughnut","polarArea"].includes(r)&&mce(e,t,o,i,a),["stackedBar","pyramid"].includes(r)&&pce({chart:e,elementIndex:t,datasetIndex:n,cfg:o,apply:i,blurColor:a})}function pce(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,p)=>{var h,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=(h=d==null?void 0:d.backgroundColor)==null?void 0:h.map((b,v)=>v===n&&p===r?b:s),d.borderColor=(m=d==null?void 0:d.borderColor)==null?void 0:m.map((b,v)=>v===n&&p===r?b:s)}):(u=(c=t==null?void 0:t.data)==null?void 0:c.datasets)==null||u.forEach((d,p)=>{var h,m,b,v,x,w;d.backgroundColor=new Array(d.data.length).fill((b=(m=(h=o==null?void 0:o.data)==null?void 0:h.datasets)==null?void 0:m[p])==null?void 0:b.backgroundColor),d.borderColor=new Array(d.data.length).fill((w=(x=(v=o==null?void 0:o.data)==null?void 0:v.datasets)==null?void 0:x[p])==null?void 0:w.borderColor)}),t==null||t.update()}function gce(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((p,h)=>h===t?p:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((p,h)=>h===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var d,p,h,m,b,v;c.backgroundColor=new Array(c.data.length).fill((h=(p=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:p[u])==null?void 0:h.backgroundColor),c.borderColor=new Array(c.data.length).fill((v=(b=(m=n==null?void 0:n.data)==null?void 0:m.datasets)==null?void 0:b[u])==null?void 0:v.borderColor)}),e==null||e.update()}function mce(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((p,h)=>h===t?p:o),c.borderColor=(d=c==null?void 0:c.borderColor)==null?void 0:d.map((p,h)=>h===t?p:o)}):(l=(a=e==null?void 0:e.data)==null?void 0:a.datasets)==null||l.forEach((c,u)=>{var d,p,h,m,b,v,x,w;typeof c.backgroundColor=="string"&&(c.backgroundColor=(h=(p=(d=n==null?void 0:n.data)==null?void 0:d.datasets)==null?void 0:p[u])==null?void 0:h.backgroundColor,c.borderColor=(v=(b=(m=n==null?void 0:n.data)==null?void 0:m.datasets)==null?void 0:b[u])==null?void 0:v.borderColor),c.backgroundColor=(x=c==null?void 0:c.backgroundColor)==null?void 0:x.map((_,R)=>{var C;return(C=n.data.datasets[u].backgroundColor)==null?void 0:C[R]}),c.borderColor=(w=c==null?void 0:c.borderColor)==null?void 0:w.map((_,R)=>{var C;return(C=n.data.datasets[u].borderColor)==null?void 0:C[R]})}),e==null||e.update()}function bce({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:p,metricKeys:h}=lr(t);if(e.type==="map"){const m=d[0],b=((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:b}]}if(["bar","horizontalBar","line","pie","doughnut","radar","polarArea"].includes(e.type)){const m=p[0],b=(c=t[r])==null?void 0:c[m];return[{columnName:m,columnValue:b,metric:h[n],value:o}]}if(["stackedBar","pyramid"].includes(e.type)){const m=Sb({dataArray:t,groupKey:p[0],pivotKey:p[1],valueKey:h[0]}),b=p[0],v=(u=m[r])==null?void 0:u[b],x=p[1],{metricKeys:w}=lr(m),_=w[n];return[{columnName:b,columnValue:v,metric:h[0],value:o},{columnName:x,columnValue:_,metric:h[0],value:o}]}if(e.type==="bubble"||e.type==="scatter"){const m=p[0],b=o.label;return[{columnName:m,columnValue:b,metric1:h[0],value1:o.x,metric2:h[1],value2:o.y,metric3:h==null?void 0:h[2],value3:o==null?void 0:o.r}]}}catch(d){console.error("Error in getAdhocFilter",d)}}function yce(e,t){var r,o;if((((r=e.data.datasets)==null?void 0:r.filter(i=>!!i.fill))||[]).length>0){const i=(o=e==null?void 0:e.data.datasets)==null?void 0:o.map(a=>({...a,backgroundColor:[a.backgroundColor].map(l=>{const c=t.createLinearGradient(0,0,0,400);return c.addColorStop(0,l),c.addColorStop(.7,ste("--semaphor-background")),c})}));return{...e,data:{...e.data,datasets:i}}}return e}function A4(e){var a,l,c,u,d,p;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:(p=(d=e.preferences)==null?void 0:d.mapVisualOptions)==null?void 0:p.topoJsonUrl)||"",n=!!t&&e.type==="map",{data:r,isLoading:o,isFetching:i,isError:s}=fp({queryKey:["topojson",t],queryFn:()=>fetch(t).then(h=>h.json()),enabled:n,staleTime:1/0});return{data:r,isLoading:o,isFetching:i,isError:s}}function vce(e){var s,a;const[t]=T.useState({id:"",title:"",type:"bar"}),{getCard:n}=Hn(),r=n(e),o=O4(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 O4(e){var Q,G,F,H;const{onChartElementClicked:t}=Go(),[n,r]=T.useState(0);((Q=e==null?void 0:e.preferences)==null?void 0:Q.filterOnClickColumnIndex)===void 0||(G=e.preferences)==null||G.filterOnClickColumnIndex;const o=ye($=>$.isVisualEditing),i=ye($=>$.filteringCards),s=ye($=>$.selectedSheetId),a=ye($=>$.selectedLensId);ye($=>$.selectedCardId),ye($=>$.dashboard),ye($=>$.isDashboardEditing),ye($=>$.themeStyle);const l=ye($=>$.filterValues),c=T.useRef(l),u=(F=e==null?void 0:e.preferences)==null?void 0:F.onClickFilter,{addFilteringCard:d,getCardFrame:p,addOrUpdateFilterValues:h,removeFilterValues:m,removeFilteringCard:b}=Hn(),{data:v,isLoading:x,isFetching:w,isError:_,queryKey:R}=Ga(e),{data:C}=A4(e),E=i==null?void 0:i.find($=>$.id===e.id),A=p(e.id),M=(A==null?void 0:A.cards)||[],D=(M==null?void 0:M.length)==1;let L;v&&v.records&&((H=v.records)==null?void 0:H.length)>0&&e.type!=="custom"&&(L=_E({data:v==null?void 0:v.records,cardType:e.type,cfg:e.cfg,customCfg:e.customCfg,preferences:e.preferences,topoJson:C}));const j=T.useRef({filteringCards:i});T.useEffect(()=>{!(v!=null&&v.records)||x||w||E&&D||o||r($=>$+1)},[v==null?void 0:v.records,x,w,E,D,o]),T.useEffect(()=>{e.connectionId&&!E&&(c.current=l)},[l,a,e.connectionId,E]),T.useEffect(()=>{var V;E&&(j.current.filteringCards=[...i||[]]),!E&&((V=j.current.filteringCards)==null?void 0:V.find(X=>X.id===e.id))&&D&&r(X=>X+1)},[E,D,e.id,i]);function z($,V,X,I){var O;let q=!1;if(!(v!=null&&v.records))return;const U=bce({card:e,data:v==null?void 0:v.records,datasetIndex:V,clickIndex:X,value:I});if(console.log("fieldValues",U),t==null||t(e,U),!!(((O=e==null?void 0:e.preferences)==null?void 0:O.onClickFilter)??[]).length){if(E){const ee=e.id;m(ee),b(e)}else{if(q=!0,!U)return;const ee=[];U.forEach((K,oe)=>{const Y=u==null?void 0:u.find(ie=>ie.columnIndex===oe);if(!Y)return;const J={filterId:e.id+"-"+K.columnName+"-"+s,connectionId:e==null?void 0:e.connectionId,tableName:e.lastSelectedTable,name:K.columnName,expression:Y.expression,valueType:E0(U[Y.columnIndex].columnValue),operation:"=",values:[U[Y.columnIndex].columnValue]};ee.push(J)}),h(ee),d(e)}hce({chart:$,elementIndex:X,datasetIndex:V,cardType:e.type,cfg:L,apply:q})}}return{isError:_,isLoading:x,isFetching:w,data:v,visualKey:n,handleDatapointClick:z,cfg:L,queryKey:R}}function ss({children:e,containerClassName:t,className:n,text:r,onSave:o,type:i="input"}){const[s,a]=T.useState(!1),[l,c]=T.useState(r),u=ye(h=>h.isDashboardEditing),d=h=>{h.stopPropagation(),u&&a(!0)};function p(){return i==="textarea"?y.jsx("textarea",{className:me("grow rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:h=>c(h.target.value),value:l,autoFocus:!0,onBlur:()=>a(!1),onKeyDown:h=>{h.stopPropagation(),!(h.key==="Enter"&&h.shiftKey)&&(h.key==="Enter"||h.key==="Tab")&&(a(!1),o(l))}}):y.jsx("input",{onMouseDown:h=>h.stopPropagation(),type:"text",className:me("rounded-sm bg-background px-2 py-1 text-sm outline-dashed outline-[0.5px] outline-primary/50",n),onChange:h=>c(h.target.value),value:l,autoFocus:!0,onBlur:()=>a(!1),onKeyDown:h=>{h.stopPropagation(),(h.key==="Enter"||h.key==="Tab")&&(a(!1),o(l))}})}return y.jsx("div",{className:me("flex",t),role:"editable",onDoubleClick:d,children:s?p():e})}function M4(e){const{authToken:t}=Go(),n=yX(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 qb({card:e,data:t}){var w,_,R,C,E,A,M,D,L,j,z,Q,G,F,H,$;const n=ye(V=>V.actions.setCardTitle),r=ye(V=>V.actions.setCardDescription),o=ye(V=>V.isVisualEditing),i=go(V=>V.card),s=go(V=>V.actions.setCard);go(V=>V.actions.setNumberFormat);const{getCurrency:a,getLocale:l}=M4(e),c=ye(V=>V.selectedSheetId),u=(_=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:_.colorRanges,{metricKeys:d}=lr(t),p=(R=t==null?void 0:t[0])==null?void 0:R[d==null?void 0:d[0]],h=(C=t==null?void 0:t[0])==null?void 0:C[d==null?void 0:d[1]],m=t&&t.length>0;function b(V){o?s({...i,title:V}):n(c,e.id,V)}function v(V){o?s({...i,description:V}):r(c,e.id,V)}const x=h&&h-p!==0?(p-h)/h:null;return y.jsxs("div",{className:"kpi-card flex grow flex-col overflow-auto",children:[y.jsxs(P0,{className:"grow pb-3",children:[y.jsx(ss,{text:o?i.title:e.title,onSave:b,children:y.jsx("div",{className:"flex items-center gap-2",children:y.jsx(Od,{className:"text-base font-medium text-muted-foreground",children:e.title})})}),m&&y.jsxs("div",{className:"flex flex-wrap items-end gap-3 text-foreground",children:[y.jsx("p",{style:{color:GC(p,u)},className:"text-3xl font-semibold",children:ci({number:p,decimalPlaces:((A=(E=e.preferences)==null?void 0:E.formatNumber)==null?void 0:A.decimalPlaces)||0,useSuffix:!!((D=(M=e.preferences)==null?void 0:M.formatNumber)!=null&&D.suffix),customSuffix:((j=(L=e.preferences)==null?void 0:L.formatNumber)==null?void 0:j.suffix)||"",locale:l()||"",currency:a()||""})}),h&&y.jsxs("span",{className:"min-w-fit text-base font-normal text-muted-foreground",children:["from ",ci({number:h,decimalPlaces:((Q=(z=e.preferences)==null?void 0:z.formatNumber)==null?void 0:Q.decimalPlaces)||0,useSuffix:!!((F=(G=e.preferences)==null?void 0:G.formatNumber)!=null&&F.suffix),customSuffix:(($=(H=e.preferences)==null?void 0:H.formatNumber)==null?void 0:$.suffix)||"",locale:l()||"",currency:a()||""})]})]})]}),x&&y.jsxs(T0,{className:"grow items-start gap-1 pb-4 text-sm",children:[y.jsx(I4,{children:x}),y.jsxs("div",{className:"flex gap-1 text-muted-foreground",children:[x>0?"up ":"down ",y.jsx(ss,{text:e.description||"",onSave:v,children:e.description})]})]})]})}function I4({children:e,className:t}){var i,s;const n=ye(a=>a.themeStyle),r=e>0?y.jsx("span",{children:"+"}):y.jsx("span",{children:"-"}),o=`${Math.abs(e*100).toFixed(0)}%`;return y.jsxs("div",{style:{borderRadius:(s=(i=n==null?void 0:n.chart)==null?void 0:i.options)==null?void 0:s.borderRadius},className:me("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,y.jsx("span",{className:"ml-[1px]",children:o})]})}const xce=["top","right","bottom","left"],ra=Math.min,kr=Math.max,zh=Math.round,vm=Math.floor,as=e=>({x:e,y:e}),wce={left:"right",right:"left",bottom:"top",top:"bottom"},Sce={start:"end",end:"start"};function OS(e,t,n){return kr(e,ra(t,n))}function fs(e,t){return typeof e=="function"?e(t):e}function oa(e){return e.split("-")[0]}function jd(e){return e.split("-")[1]}function CE(e){return e==="x"?"y":"x"}function EE(e){return e==="y"?"height":"width"}function Za(e){return["top","bottom"].includes(oa(e))?"y":"x"}function RE(e){return CE(Za(e))}function _ce(e,t,n){n===void 0&&(n=!1);const r=jd(e),o=RE(e),i=EE(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Yb(s)),[s,Yb(s)]}function Cce(e){const t=Yb(e);return[MS(e),t,MS(t)]}function MS(e){return e.replace(/start|end/g,t=>Sce[t])}function Ece(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 Rce(e,t,n,r){const o=jd(e);let i=Ece(oa(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(MS)))),i}function Yb(e){return e.replace(/left|right|bottom|top/g,t=>wce[t])}function Pce(e){return{top:0,right:0,bottom:0,left:0,...e}}function D4(e){return typeof e!="number"?Pce(e):{top:e,right:e,bottom:e,left:e}}function Kb(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function hM(e,t,n){let{reference:r,floating:o}=e;const i=Za(t),s=RE(t),a=EE(s),l=oa(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(jd(t)){case"start":h[s]-=p*(n&&c?-1:1);break;case"end":h[s]+=p*(n&&c?-1:1);break}return h}const Tce=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}=hM(c,r,l),p=r,h={},m=0;for(let b=0;b<a.length;b++){const{name:v,fn:x}=a[b],{x:w,y:_,data:R,reset:C}=await x({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:c,platform:s,elements:{reference:e,floating:t}});u=w??u,d=_??d,h={...h,[v]:{...h[v],...R}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(c=C.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:d}=hM(c,p,l)),b=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}};async function wd(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:p=!1,padding:h=0}=fs(t,e),m=D4(h),v=a[p?d==="floating"?"reference":"floating":d],x=Kb(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(v)))==null||n?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),w=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),R=await(i.isElement==null?void 0:i.isElement(_))?await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1}:{x:1,y:1},C=Kb(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:_,strategy:l}):w);return{top:(x.top-C.top+m.top)/R.y,bottom:(C.bottom-x.bottom+m.bottom)/R.y,left:(x.left-C.left+m.left)/R.x,right:(C.right-x.right+m.right)/R.x}}const kce=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}=fs(e,t)||{};if(c==null)return{};const d=D4(u),p={x:n,y:r},h=RE(o),m=EE(h),b=await s.getDimensions(c),v=h==="y",x=v?"top":"left",w=v?"bottom":"right",_=v?"clientHeight":"clientWidth",R=i.reference[m]+i.reference[h]-p[h]-i.floating[m],C=p[h]-i.reference[h],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let A=E?E[_]:0;(!A||!await(s.isElement==null?void 0:s.isElement(E)))&&(A=a.floating[_]||i.floating[m]);const M=R/2-C/2,D=A/2-b[m]/2-1,L=ra(d[x],D),j=ra(d[w],D),z=L,Q=A-b[m]-j,G=A/2-b[m]/2+M,F=OS(z,G,Q),H=!l.arrow&&jd(o)!=null&&G!==F&&i.reference[m]/2-(G<z?L:j)-b[m]/2<0,$=H?G<z?G-z:G-Q:0;return{[h]:p[h]+$,data:{[h]:F,centerOffset:G-F-$,...H&&{alignmentOffset:$}},reset:H}}}),Ace=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:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:b=!0,...v}=fs(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=oa(o),w=Za(a),_=oa(a)===a,R=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=p||(_||!b?[Yb(a)]:Cce(a)),E=m!=="none";!p&&E&&C.push(...Rce(a,b,m,R));const A=[a,...C],M=await wd(t,v),D=[];let L=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&D.push(M[x]),d){const G=_ce(o,s,R);D.push(M[G[0]],M[G[1]])}if(L=[...L,{placement:o,overflows:D}],!D.every(G=>G<=0)){var j,z;const G=(((j=i.flip)==null?void 0:j.index)||0)+1,F=A[G];if(F)return{data:{index:G,overflows:L},reset:{placement:F}};let H=(z=L.filter($=>$.overflows[0]<=0).sort(($,V)=>$.overflows[1]-V.overflows[1])[0])==null?void 0:z.placement;if(!H)switch(h){case"bestFit":{var Q;const $=(Q=L.filter(V=>{if(E){const X=Za(V.placement);return X===w||X==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(X=>X>0).reduce((X,I)=>X+I,0)]).sort((V,X)=>V[1]-X[1])[0])==null?void 0:Q[0];$&&(H=$);break}case"initialPlacement":H=a;break}if(o!==H)return{reset:{placement:H}}}return{}}}};function pM(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function gM(e){return xce.some(t=>e[t]>=0)}const Oce=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=fs(e,t);switch(r){case"referenceHidden":{const i=await wd(t,{...o,elementContext:"reference"}),s=pM(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:gM(s)}}}case"escaped":{const i=await wd(t,{...o,altBoundary:!0}),s=pM(i,n.floating);return{data:{escapedOffsets:s,escaped:gM(s)}}}default:return{}}}}};async function Mce(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=oa(n),a=jd(n),l=Za(n)==="y",c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=fs(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof m=="number"&&(h=a==="end"?m*-1:m),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}const Ice=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 Mce(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}}}}},Dce=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:v=>{let{x,y:w}=v;return{x,y:w}}},...l}=fs(e,t),c={x:n,y:r},u=await wd(t,l),d=Za(oa(o)),p=CE(d);let h=c[p],m=c[d];if(i){const v=p==="y"?"top":"left",x=p==="y"?"bottom":"right",w=h+u[v],_=h-u[x];h=OS(w,h,_)}if(s){const v=d==="y"?"top":"left",x=d==="y"?"bottom":"right",w=m+u[v],_=m-u[x];m=OS(w,m,_)}const b=a.fn({...t,[p]:h,[d]:m});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[p]:i,[d]:s}}}}}},Nce=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}=fs(e,t),u={x:n,y:r},d=Za(o),p=CE(d);let h=u[p],m=u[d];const b=fs(a,t),v=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const _=p==="y"?"height":"width",R=i.reference[p]-i.floating[_]+v.mainAxis,C=i.reference[p]+i.reference[_]-v.mainAxis;h<R?h=R:h>C&&(h=C)}if(c){var x,w;const _=p==="y"?"width":"height",R=["top","left"].includes(oa(o)),C=i.reference[d]-i.floating[_]+(R&&((x=s.offset)==null?void 0:x[d])||0)+(R?0:v.crossAxis),E=i.reference[d]+i.reference[_]+(R?0:((w=s.offset)==null?void 0:w[d])||0)-(R?v.crossAxis:0);m<C?m=C:m>E&&(m=E)}return{[p]:h,[d]:m}}}},Lce=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...c}=fs(e,t),u=await wd(t,c),d=oa(o),p=jd(o),h=Za(o)==="y",{width:m,height:b}=i.floating;let v,x;d==="top"||d==="bottom"?(v=d,x=p===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(x=d,v=p==="end"?"top":"bottom");const w=b-u.top-u.bottom,_=m-u.left-u.right,R=ra(b-u[v],w),C=ra(m-u[x],_),E=!t.middlewareData.shift;let A=R,M=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=w),E&&!p){const L=kr(u.left,0),j=kr(u.right,0),z=kr(u.top,0),Q=kr(u.bottom,0);h?M=m-2*(L!==0||j!==0?L+j:kr(u.left,u.right)):A=b-2*(z!==0||Q!==0?z+Q:kr(u.top,u.bottom))}await l({...t,availableWidth:M,availableHeight:A});const D=await s.getDimensions(a.floating);return m!==D.width||b!==D.height?{reset:{rects:!0}}:{}}}};function oy(){return typeof window<"u"}function $d(e){return N4(e)?(e.nodeName||"").toLowerCase():"#document"}function Bo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ws(e){var t;return(t=(N4(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function N4(e){return oy()?e instanceof Node||e instanceof Bo(e).Node:!1}function Ir(e){return oy()?e instanceof Element||e instanceof Bo(e).Element:!1}function hs(e){return oy()?e instanceof HTMLElement||e instanceof Bo(e).HTMLElement:!1}function mM(e){return!oy()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Bo(e).ShadowRoot}function wp(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Ii(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Fce(e){return["table","td","th"].includes($d(e))}function iy(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function PE(e){const t=TE(),n=Ir(e)?Ii(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function jce(e){let t=Ja(e);for(;hs(t)&&!Sd(t);){if(PE(t))return t;if(iy(t))return null;t=Ja(t)}return null}function TE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Sd(e){return["html","body","#document"].includes($d(e))}function Ii(e){return Bo(e).getComputedStyle(e)}function sy(e){return Ir(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ja(e){if($d(e)==="html")return e;const t=e.assignedSlot||e.parentNode||mM(e)&&e.host||ws(e);return mM(t)?t.host:t}function L4(e){const t=Ja(e);return Sd(t)?e.ownerDocument?e.ownerDocument.body:e.body:hs(t)&&wp(t)?t:L4(t)}function Bh(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=L4(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Bo(o);if(i){const a=IS(s);return t.concat(s,s.visualViewport||[],wp(o)?o:[],a&&n?Bh(a):[])}return t.concat(o,Bh(o,[],n))}function IS(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function F4(e){const t=Ii(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=hs(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=zh(n)!==i||zh(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function kE(e){return Ir(e)?e:e.contextElement}function ju(e){const t=kE(e);if(!hs(t))return as(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=F4(t);let s=(i?zh(n.width):n.width)/r,a=(i?zh(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const $ce=as(0);function j4(e){const t=Bo(e);return!TE()||!t.visualViewport?$ce:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zce(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Bo(e)?!1:t}function Pc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=kE(e);let s=as(1);t&&(r?Ir(r)&&(s=ju(r)):s=ju(e));const a=zce(i,n,r)?j4(i):as(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 p=Bo(i),h=r&&Ir(r)?Bo(r):r;let m=p,b=IS(m);for(;b&&r&&h!==m;){const v=ju(b),x=b.getBoundingClientRect(),w=Ii(b),_=x.left+(b.clientLeft+parseFloat(w.paddingLeft))*v.x,R=x.top+(b.clientTop+parseFloat(w.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,d*=v.y,l+=_,c+=R,m=Bo(b),b=IS(m)}}return Kb({width:u,height:d,x:l,y:c})}function AE(e,t){const n=sy(e).scrollLeft;return t?t.left+n:Pc(ws(e)).left+n}function $4(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:AE(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Bce(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=ws(r),a=t?iy(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=as(1);const u=as(0),d=hs(r);if((d||!d&&!i)&&(($d(r)!=="body"||wp(s))&&(l=sy(r)),hs(r))){const h=Pc(r);c=ju(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const p=s&&!d&&!i?$4(s,l,!0):as(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}}function Hce(e){return Array.from(e.getClientRects())}function Vce(e){const t=ws(e),n=sy(e),r=e.ownerDocument.body,o=kr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=kr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+AE(e);const a=-n.scrollTop;return Ii(r).direction==="rtl"&&(s+=kr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function Wce(e,t){const n=Bo(e),r=ws(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=TE();(!c||c&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function Uce(e,t){const n=Pc(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=hs(e)?ju(e):as(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 bM(e,t,n){let r;if(t==="viewport")r=Wce(e,n);else if(t==="document")r=Vce(ws(e));else if(Ir(t))r=Uce(t,n);else{const o=j4(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Kb(r)}function z4(e,t){const n=Ja(e);return n===t||!Ir(n)||Sd(n)?!1:Ii(n).position==="fixed"||z4(n,t)}function Gce(e,t){const n=t.get(e);if(n)return n;let r=Bh(e,[],!1).filter(a=>Ir(a)&&$d(a)!=="body"),o=null;const i=Ii(e).position==="fixed";let s=i?Ja(e):e;for(;Ir(s)&&!Sd(s);){const a=Ii(s),l=PE(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||wp(s)&&!l&&z4(e,s))?r=r.filter(u=>u!==s):o=a,s=Ja(s)}return t.set(e,r),r}function qce(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?iy(t)?[]:Gce(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=bM(t,u,o);return c.top=kr(d.top,c.top),c.right=ra(d.right,c.right),c.bottom=ra(d.bottom,c.bottom),c.left=kr(d.left,c.left),c},bM(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Yce(e){const{width:t,height:n}=F4(e);return{width:t,height:n}}function Kce(e,t,n){const r=hs(t),o=ws(t),i=n==="fixed",s=Pc(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=as(0);if(r||!r&&!i)if(($d(t)!=="body"||wp(o))&&(a=sy(t)),r){const p=Pc(t,!0,i,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&(l.x=AE(o));const c=o&&!r&&!i?$4(o,a):as(0),u=s.left+a.scrollLeft-l.x-c.x,d=s.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:s.width,height:s.height}}function ew(e){return Ii(e).position==="static"}function yM(e,t){if(!hs(e)||Ii(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ws(e)===n&&(n=n.ownerDocument.body),n}function B4(e,t){const n=Bo(e);if(iy(e))return n;if(!hs(e)){let o=Ja(e);for(;o&&!Sd(o);){if(Ir(o)&&!ew(o))return o;o=Ja(o)}return n}let r=yM(e,t);for(;r&&Fce(r)&&ew(r);)r=yM(r,t);return r&&Sd(r)&&ew(r)&&!PE(r)?n:r||jce(e)||n}const Xce=async function(e){const t=this.getOffsetParent||B4,n=this.getDimensions,r=await n(e.floating);return{reference:Kce(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Qce(e){return Ii(e).direction==="rtl"}const Zce={convertOffsetParentRelativeRectToViewportRelativeRect:Bce,getDocumentElement:ws,getClippingRect:qce,getOffsetParent:B4,getElementRects:Xce,getClientRects:Hce,getDimensions:Yce,getScale:ju,isElement:Ir,isRTL:Qce};function H4(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Jce(e,t){let n=null,r;const o=ws(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(a||t(),!p||!h)return;const m=vm(d),b=vm(o.clientWidth-(u+p)),v=vm(o.clientHeight-(d+h)),x=vm(u),_={rootMargin:-m+"px "+-b+"px "+-v+"px "+-x+"px",threshold:kr(0,ra(1,l))||1};let R=!0;function C(E){const A=E[0].intersectionRatio;if(A!==l){if(!R)return s();A?s(!1,A):r=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!H4(c,e.getBoundingClientRect())&&s(),R=!1}try{n=new IntersectionObserver(C,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,_)}n.observe(e)}return s(!0),i}function V4(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=kE(e),u=o||i?[...c?Bh(c):[],...Bh(t)]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const d=c&&a?Jce(c,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(x=>{let[w]=x;w&&w.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var _;(_=h)==null||_.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m,b=l?Pc(e):null;l&&v();function v(){const x=Pc(e);b&&!H4(b,x)&&n(),b=x,m=requestAnimationFrame(v)}return n(),()=>{var x;u.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d==null||d(),(x=h)==null||x.disconnect(),h=null,l&&cancelAnimationFrame(m)}}const tw=wd,eue=Ice,tue=Dce,nue=Ace,rue=Lce,oue=Oce,vM=kce,iue=Nce,sue=(e,t,n)=>{const r=new Map,o={platform:Zce,...n},i={...o.platform,_c:r};return Tce(e,t,{...o,platform:i})};var ob=typeof document<"u"?T.useLayoutEffect:T.useEffect;function Xb(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(!Xb(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)&&!Xb(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function W4(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xM(e,t){const n=W4(e);return Math.round(t*n)/n}function nw(e){const t=P.useRef(e);return ob(()=>{t.current=e}),t}function U4(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]=P.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=P.useState(r);Xb(p,r)||h(r);const[m,b]=P.useState(null),[v,x]=P.useState(null),w=P.useCallback(V=>{V!==E.current&&(E.current=V,b(V))},[]),_=P.useCallback(V=>{V!==A.current&&(A.current=V,x(V))},[]),R=i||m,C=s||v,E=P.useRef(null),A=P.useRef(null),M=P.useRef(u),D=l!=null,L=nw(l),j=nw(o),z=nw(c),Q=P.useCallback(()=>{if(!E.current||!A.current)return;const V={placement:t,strategy:n,middleware:p};j.current&&(V.platform=j.current),sue(E.current,A.current,V).then(X=>{const I={...X,isPositioned:z.current!==!1};G.current&&!Xb(M.current,I)&&(M.current=I,yc.flushSync(()=>{d(I)}))})},[p,t,n,j,z]);ob(()=>{c===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,d(V=>({...V,isPositioned:!1})))},[c]);const G=P.useRef(!1);ob(()=>(G.current=!0,()=>{G.current=!1}),[]),ob(()=>{if(R&&(E.current=R),C&&(A.current=C),R&&C){if(L.current)return L.current(R,C,Q);Q()}},[R,C,Q,L,D]);const F=P.useMemo(()=>({reference:E,floating:A,setReference:w,setFloating:_}),[w,_]),H=P.useMemo(()=>({reference:R,floating:C}),[R,C]),$=P.useMemo(()=>{const V={position:n,left:0,top:0};if(!H.floating)return V;const X=xM(H.floating,u.x),I=xM(H.floating,u.y);return a?{...V,transform:"translate("+X+"px, "+I+"px)",...W4(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:X,top:I}},[n,a,H.floating,u.x,u.y]);return P.useMemo(()=>({...u,update:Q,refs:F,elements:H,floatingStyles:$}),[u,Q,F,H,$])}const aue=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?vM({element:r.current,padding:o}).fn(n):{}:r?vM({element:r,padding:o}).fn(n):{}}}},OE=(e,t)=>({...eue(e),options:[e,t]}),G4=(e,t)=>({...tue(e),options:[e,t]}),lue=(e,t)=>({...iue(e),options:[e,t]}),q4=(e,t)=>({...nue(e),options:[e,t]}),Y4=(e,t)=>({...rue(e),options:[e,t]}),cue=(e,t)=>({...oue(e),options:[e,t]}),uue=(e,t)=>({...aue(e),options:[e,t]});var due="Arrow",K4=P.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return y.jsx(je.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});K4.displayName=due;var fue=K4;function ay(e){const[t,n]=P.useState(void 0);return yr(()=>{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 ME="Popper",[X4,Ss]=rr(ME),[hue,Q4]=X4(ME),Z4=e=>{const{__scopePopper:t,children:n}=e,[r,o]=P.useState(null);return y.jsx(hue,{scope:t,anchor:r,onAnchorChange:o,children:n})};Z4.displayName=ME;var J4="PopperAnchor",e3=P.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Q4(J4,n),s=P.useRef(null),a=st(t,s);return P.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:y.jsx(je.div,{...o,ref:a})});e3.displayName=J4;var IE="PopperContent",[pue,gue]=X4(IE),t3=P.forwardRef((e,t)=>{var Y,J,ie,de,he,ae;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:p=!1,updatePositionStrategy:h="optimized",onPlaced:m,...b}=e,v=Q4(IE,n),[x,w]=P.useState(null),_=st(t,ge=>w(ge)),[R,C]=P.useState(null),E=ay(R),A=(E==null?void 0:E.width)??0,M=(E==null?void 0:E.height)??0,D=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,Q={padding:L,boundary:j.filter(bue),altBoundary:z},{refs:G,floatingStyles:F,placement:H,isPositioned:$,middlewareData:V}=U4({strategy:"fixed",placement:D,whileElementsMounted:(...ge)=>V4(...ge,{animationFrame:h==="always"}),elements:{reference:v.anchor},middleware:[OE({mainAxis:o+M,alignmentAxis:s}),l&&G4({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?lue():void 0,...Q}),l&&q4({...Q}),Y4({...Q,apply:({elements:ge,rects:ue,availableWidth:Ee,availableHeight:Te})=>{const{width:Le,height:Ae}=ue.reference,Fe=ge.floating.style;Fe.setProperty("--radix-popper-available-width",`${Ee}px`),Fe.setProperty("--radix-popper-available-height",`${Te}px`),Fe.setProperty("--radix-popper-anchor-width",`${Le}px`),Fe.setProperty("--radix-popper-anchor-height",`${Ae}px`)}}),R&&uue({element:R,padding:a}),yue({arrowWidth:A,arrowHeight:M}),p&&cue({strategy:"referenceHidden",...Q})]}),[X,I]=o3(H),q=tr(m);yr(()=>{$&&(q==null||q())},[$,q]);const U=(Y=V.arrow)==null?void 0:Y.x,O=(J=V.arrow)==null?void 0:J.y,ee=((ie=V.arrow)==null?void 0:ie.centerOffset)!==0,[K,oe]=P.useState();return yr(()=>{x&&oe(window.getComputedStyle(x).zIndex)},[x]),y.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...F,transform:$?F.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(de=V.transformOrigin)==null?void 0:de.x,(he=V.transformOrigin)==null?void 0:he.y].join(" "),...((ae=V.hide)==null?void 0:ae.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:y.jsx(pue,{scope:n,placedSide:X,onArrowChange:C,arrowX:U,arrowY:O,shouldHideArrow:ee,children:y.jsx(je.div,{"data-side":X,"data-align":I,...b,ref:_,style:{...b.style,animation:$?void 0:"none"}})})})});t3.displayName=IE;var n3="PopperArrow",mue={top:"bottom",right:"left",bottom:"top",left:"right"},r3=P.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=gue(n3,r),s=mue[i.placedSide];return y.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:y.jsx(fue,{...o,ref:n,style:{...o.style,display:"block"}})})});r3.displayName=n3;function bue(e){return e!==null}var yue=e=>({name:"transformOrigin",options:e,fn(t){var v,x,w;const{placement:n,rects:r,middlewareData:o}=t,s=((v=o.arrow)==null?void 0:v.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=o3(n),d={start:"0%",center:"50%",end:"100%"}[u],p=(((x=o.arrow)==null?void 0:x.x)??0)+a/2,h=(((w=o.arrow)==null?void 0:w.y)??0)+l/2;let m="",b="";return c==="bottom"?(m=s?d:`${p}px`,b=`${-l}px`):c==="top"?(m=s?d:`${p}px`,b=`${r.floating.height+l}px`):c==="right"?(m=`${-l}px`,b=s?d:`${h}px`):c==="left"&&(m=`${r.floating.width+l}px`,b=s?d:`${h}px`),{data:{x:m,y:b}}}});function o3(e){const[t,n="center"]=e.split("-");return[t,n]}var Sp=Z4,zd=e3,_p=t3,Cp=r3,vue="Portal",Ep=P.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=P.useState(!1);yr(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Ar.createPortal(y.jsx(je.div,{...r,ref:t}),s):null});Ep.displayName=vue;function xue(e,t=globalThis==null?void 0:globalThis.document){const n=tr(e);P.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 wue="DismissableLayer",DS="dismissableLayer.update",Sue="dismissableLayer.pointerDownOutside",_ue="dismissableLayer.focusOutside",wM,i3=P.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Bc=P.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,c=P.useContext(i3),[u,d]=P.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=P.useState({}),m=st(t,A=>d(A)),b=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),x=b.indexOf(v),w=u?b.indexOf(u):-1,_=c.layersWithOutsidePointerEventsDisabled.size>0,R=w>=x,C=Rue(A=>{const M=A.target,D=[...c.branches].some(L=>L.contains(M));!R||D||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},p),E=Pue(A=>{const M=A.target;[...c.branches].some(L=>L.contains(M))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},p);return xue(A=>{w===c.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},p),P.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(wM=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),SM(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=wM)}},[u,p,n,c]),P.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),SM())},[u,c]),P.useEffect(()=>{const A=()=>h({});return document.addEventListener(DS,A),()=>document.removeEventListener(DS,A)},[]),y.jsx(je.div,{...l,ref:m,style:{pointerEvents:_?R?"auto":"none":void 0,...e.style},onFocusCapture:Pe(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Pe(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Pe(e.onPointerDownCapture,C.onPointerDownCapture)})});Bc.displayName=wue;var Cue="DismissableLayerBranch",Eue=P.forwardRef((e,t)=>{const n=P.useContext(i3),r=P.useRef(null),o=st(t,r);return P.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),y.jsx(je.div,{...e,ref:o})});Eue.displayName=Cue;function Rue(e,t=globalThis==null?void 0:globalThis.document){const n=tr(e),r=P.useRef(!1),o=P.useRef(()=>{});return P.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){s3(Sue,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 Pue(e,t=globalThis==null?void 0:globalThis.document){const n=tr(e),r=P.useRef(!1);return P.useEffect(()=>{const o=i=>{i.target&&!r.current&&s3(_ue,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 SM(){const e=new CustomEvent(DS);document.dispatchEvent(e)}function s3(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?KN(o,i):o.dispatchEvent(i)}var rw,DE="HoverCard",[a3,uOe]=rr(DE,[Ss]),ly=Ss(),[Tue,NE]=a3(DE),l3=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:i,openDelay:s=700,closeDelay:a=300}=e,l=ly(t),c=P.useRef(0),u=P.useRef(0),d=P.useRef(!1),p=P.useRef(!1),[h=!1,m]=Dr({prop:r,defaultProp:o,onChange:i}),b=P.useCallback(()=>{clearTimeout(u.current),c.current=window.setTimeout(()=>m(!0),s)},[s,m]),v=P.useCallback(()=>{clearTimeout(c.current),!d.current&&!p.current&&(u.current=window.setTimeout(()=>m(!1),a))},[a,m]),x=P.useCallback(()=>m(!1),[m]);return P.useEffect(()=>()=>{clearTimeout(c.current),clearTimeout(u.current)},[]),y.jsx(Tue,{scope:t,open:h,onOpenChange:m,onOpen:b,onClose:v,onDismiss:x,hasSelectionRef:d,isPointerDownOnContentRef:p,children:y.jsx(Sp,{...l,children:n})})};l3.displayName=DE;var c3="HoverCardTrigger",u3=P.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=NE(c3,n),i=ly(n);return y.jsx(zd,{asChild:!0,...i,children:y.jsx(je.a,{"data-state":o.open?"open":"closed",...r,ref:t,onPointerEnter:Pe(e.onPointerEnter,Zb(o.onOpen)),onPointerLeave:Pe(e.onPointerLeave,Zb(o.onClose)),onFocus:Pe(e.onFocus,o.onOpen),onBlur:Pe(e.onBlur,o.onClose),onTouchStart:Pe(e.onTouchStart,s=>s.preventDefault())})})});u3.displayName=c3;var kue="HoverCardPortal",[dOe,Aue]=a3(kue,{forceMount:void 0}),Qb="HoverCardContent",d3=P.forwardRef((e,t)=>{const n=Aue(Qb,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,i=NE(Qb,e.__scopeHoverCard);return y.jsx(Kn,{present:r||i.open,children:y.jsx(Oue,{"data-state":i.open?"open":"closed",...o,onPointerEnter:Pe(e.onPointerEnter,Zb(i.onOpen)),onPointerLeave:Pe(e.onPointerLeave,Zb(i.onClose)),ref:t})})});d3.displayName=Qb;var Oue=P.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,...a}=e,l=NE(Qb,n),c=ly(n),u=P.useRef(null),d=st(t,u),[p,h]=P.useState(!1);return P.useEffect(()=>{if(p){const m=document.body;return rw=m.style.userSelect||m.style.webkitUserSelect,m.style.userSelect="none",m.style.webkitUserSelect="none",()=>{m.style.userSelect=rw,m.style.webkitUserSelect=rw}}},[p]),P.useEffect(()=>{if(u.current){const m=()=>{h(!1),l.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var v;((v=document.getSelection())==null?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]),P.useEffect(()=>{u.current&&Due(u.current).forEach(b=>b.setAttribute("tabindex","-1"))}),y.jsx(Bc,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:s,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Pe(i,m=>{m.preventDefault()}),onDismiss:l.onDismiss,children:y.jsx(_p,{...c,...a,onPointerDown:Pe(a.onPointerDown,m=>{m.currentTarget.contains(m.target)&&h(!0),l.hasSelectionRef.current=!1,l.isPointerDownOnContentRef.current=!0}),ref:d,style:{...a.style,userSelect:p?"text":void 0,WebkitUserSelect:p?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Mue="HoverCardArrow",Iue=P.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=ly(n);return y.jsx(Cp,{...o,...r,ref:t})});Iue.displayName=Mue;function Zb(e){return t=>t.pointerType==="touch"?void 0:e()}function Due(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}var Nue=l3,Lue=u3,f3=d3;const Rp=Nue,Pp=Lue,Bd=P.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>y.jsx(f3,{ref:o,align:t,sideOffset:n,className:me("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}));Bd.displayName=f3.displayName;function h3({card:e}){const{setCardInfo:t}=Hn();return y.jsxs(Rp,{openDelay:0,children:[y.jsx(Pp,{children:y.jsx(pL,{className:"size-4 text-muted-foreground/40"})}),y.jsx(Bd,{align:"start",className:"w-[300px]",onMouseDown:n=>n.stopPropagation(),children:y.jsx(ss,{type:"textarea",text:e.info||"",onSave:n=>t(e.id,n),children:y.jsx("p",{className:"text-sm text-muted-foreground",children:e.info||"Double-click to add info"})})})]})}function Fue({card:e,renderFilterInfo:t}){var m,b,v,x,w,_,R,C,E,A,M,D,L,j,z,Q;ye(G=>G.themeStyle);const{data:n,isLoading:r}=Ga(e),o=(n==null?void 0:n.records)||[],i=ye(G=>G.isDashboardEditing),{getCurrency:s,getLocale:a}=M4(e),l=(b=(m=e.preferences)==null?void 0:m.formatNumber)==null?void 0:b.colorRanges,{metricKeys:c}=lr(o||[]),u=(v=o==null?void 0:o[0])==null?void 0:v[c==null?void 0:c[0]],d=(x=o==null?void 0:o[0])==null?void 0:x[c==null?void 0:c[1]],p=(o==null?void 0:o.length)>0,h=d&&d-u!==0?(u-d)/d:null;return y.jsx("div",{className:"flex min-w-fit grow flex-col overflow-auto",children:y.jsxs("div",{className:"grow",children:[p?y.jsx("div",{className:"",children:y.jsxs("div",{className:me("flex items-end gap-1.5",{"animate-pulse":r}),children:[y.jsx("p",{style:{color:GC(u,l)},className:"text-3xl font-semibold",children:ci({number:u,decimalPlaces:((_=(w=e.preferences)==null?void 0:w.formatNumber)==null?void 0:_.decimalPlaces)||0,useSuffix:!!((C=(R=e.preferences)==null?void 0:R.formatNumber)!=null&&C.suffix),customSuffix:((A=(E=e.preferences)==null?void 0:E.formatNumber)==null?void 0:A.suffix)||"",locale:a()||"",currency:s()||""})}),h&&y.jsxs("div",{className:"flex items-end gap-1",children:[y.jsx(I4,{className:"",children:h}),d&&y.jsx("div",{className:"ml-0.5 mr-1 min-w-fit text-sm font-normal text-muted-foreground",children:`from ${ci({number:d,decimalPlaces:((D=(M=e.preferences)==null?void 0:M.formatNumber)==null?void 0:D.decimalPlaces)||0,useSuffix:!!((j=(L=e.preferences)==null?void 0:L.formatNumber)!=null&&j.suffix),customSuffix:((Q=(z=e.preferences)==null?void 0:z.formatNumber)==null?void 0:Q.suffix)||"",locale:a()||"",currency:s()||""})}`})]})]})}):y.jsx("div",{className:"flex h-9 items-center justify-center"}),y.jsxs("div",{className:"flex items-center gap-3",children:[y.jsxs(Od,{className:"flex items-center gap-2 text-base font-medium text-muted-foreground",children:[e.title,(i||e.info)&&y.jsx(h3,{card:e})]}),t==null?void 0:t()]})]})})}var jue="VisuallyHidden",LE=P.forwardRef((e,t)=>y.jsx(je.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}}));LE.displayName=jue;var $ue=LE,[cy,fOe]=rr("Tooltip",[Ss]),uy=Ss(),p3="TooltipProvider",zue=700,NS="tooltip.open",[Bue,FE]=cy(p3),g3=e=>{const{__scopeTooltip:t,delayDuration:n=zue,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=P.useState(!0),l=P.useRef(!1),c=P.useRef(0);return P.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),y.jsx(Bue,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:P.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:P.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:P.useCallback(u=>{l.current=u},[]),disableHoverableContent:o,children:i})};g3.displayName=p3;var dy="Tooltip",[Hue,fy]=cy(dy),m3=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=FE(dy,e.__scopeTooltip),c=uy(t),[u,d]=P.useState(null),p=Yn(),h=P.useRef(0),m=s??l.disableHoverableContent,b=a??l.delayDuration,v=P.useRef(!1),[x=!1,w]=Dr({prop:r,defaultProp:o,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(NS))):l.onClose(),i==null||i(A)}}),_=P.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),R=P.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,w(!0)},[w]),C=P.useCallback(()=>{window.clearTimeout(h.current),h.current=0,w(!1)},[w]),E=P.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,w(!0),h.current=0},b)},[b,w]);return P.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),y.jsx(Sp,{...c,children:y.jsx(Hue,{scope:t,contentId:p,open:x,stateAttribute:_,trigger:u,onTriggerChange:d,onTriggerEnter:P.useCallback(()=>{l.isOpenDelayed?E():R()},[l.isOpenDelayed,E,R]),onTriggerLeave:P.useCallback(()=>{m?C():(window.clearTimeout(h.current),h.current=0)},[C,m]),onOpen:R,onClose:C,disableHoverableContent:m,children:n})})};m3.displayName=dy;var LS="TooltipTrigger",jE=P.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=fy(LS,n),i=FE(LS,n),s=uy(n),a=P.useRef(null),l=st(t,a,o.onTriggerChange),c=P.useRef(!1),u=P.useRef(!1),d=P.useCallback(()=>c.current=!1,[]);return P.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),y.jsx(zd,{asChild:!0,...s,children:y.jsx(je.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:Pe(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:Pe(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:Pe(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Pe(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:Pe(e.onBlur,o.onClose),onClick:Pe(e.onClick,o.onClose)})})});jE.displayName=LS;var Vue="TooltipPortal",[hOe,Wue]=cy(Vue,{forceMount:void 0}),_d="TooltipContent",b3=P.forwardRef((e,t)=>{const n=Wue(_d,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=fy(_d,e.__scopeTooltip);return y.jsx(Kn,{present:r||s.open,children:s.disableHoverableContent?y.jsx(y3,{side:o,...i,ref:t}):y.jsx(Uue,{side:o,...i,ref:t})})}),Uue=P.forwardRef((e,t)=>{const n=fy(_d,e.__scopeTooltip),r=FE(_d,e.__scopeTooltip),o=P.useRef(null),i=st(t,o),[s,a]=P.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:d}=r,p=P.useCallback(()=>{a(null),d(!1)},[d]),h=P.useCallback((m,b)=>{const v=m.currentTarget,x={x:m.clientX,y:m.clientY},w=Kue(x,v.getBoundingClientRect()),_=Xue(x,w),R=Que(b.getBoundingClientRect()),C=Jue([..._,...R]);a(C),d(!0)},[d]);return P.useEffect(()=>()=>p(),[p]),P.useEffect(()=>{if(l&&u){const m=v=>h(v,u),b=v=>h(v,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",b),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",b)}}},[l,u,h,p]),P.useEffect(()=>{if(s){const m=b=>{const v=b.target,x={x:b.clientX,y:b.clientY},w=(l==null?void 0:l.contains(v))||(u==null?void 0:u.contains(v)),_=!Zue(x,s);w?p():_&&(p(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,s,c,p]),y.jsx(y3,{...e,ref:i})}),[Gue,que]=cy(dy,{isInside:!1}),y3=P.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=fy(_d,n),c=uy(n),{onClose:u}=l;return P.useEffect(()=>(document.addEventListener(NS,u),()=>document.removeEventListener(NS,u)),[u]),P.useEffect(()=>{if(l.trigger){const d=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),y.jsx(Bc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:y.jsxs(_p,{"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)"},children:[y.jsx(cC,{children:r}),y.jsx(Gue,{scope:n,isInside:!0,children:y.jsx($ue,{id:l.contentId,role:"tooltip",children:o||r})})]})})});b3.displayName=_d;var v3="TooltipArrow",Yue=P.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=uy(n);return que(v3,n).isInside?null:y.jsx(Cp,{...o,...r,ref:t})});Yue.displayName=v3;function Kue(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 Xue(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 Que(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 Zue(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 Jue(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),ede(t)}function ede(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)}var tde=g3,nde=m3,rde=jE,x3=b3;const ode=tde,w3=nde,S3=rde,$E=P.forwardRef(({className:e,sideOffset:t=4,...n},r)=>y.jsx(x3,{ref:r,sideOffset:t,className:me("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}));$E.displayName=x3.displayName;/*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */const{entries:_3,setPrototypeOf:_M,isFrozen:ide,getPrototypeOf:sde,getOwnPropertyDescriptor:ade}=Object;let{freeze:Qr,seal:pi,create:C3}=Object,{apply:FS,construct:jS}=typeof Reflect<"u"&&Reflect;Qr||(Qr=function(t){return t});pi||(pi=function(t){return t});FS||(FS=function(t,n,r){return t.apply(n,r)});jS||(jS=function(t,n){return new t(...n)});const xm=Zr(Array.prototype.forEach),lde=Zr(Array.prototype.lastIndexOf),CM=Zr(Array.prototype.pop),_f=Zr(Array.prototype.push),cde=Zr(Array.prototype.splice),ib=Zr(String.prototype.toLowerCase),ow=Zr(String.prototype.toString),EM=Zr(String.prototype.match),Cf=Zr(String.prototype.replace),ude=Zr(String.prototype.indexOf),dde=Zr(String.prototype.trim),Si=Zr(Object.prototype.hasOwnProperty),Br=Zr(RegExp.prototype.test),Ef=fde(TypeError);function Zr(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 FS(e,t,r)}}function fde(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return jS(e,n)}}function Ot(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ib;_M&&_M(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){const i=n(o);i!==o&&(ide(t)||(t[r]=i),o=i)}e[o]=!0}return e}function hde(e){for(let t=0;t<e.length;t++)Si(e,t)||(e[t]=null);return e}function Dl(e){const t=C3(null);for(const[n,r]of _3(e))Si(e,n)&&(Array.isArray(r)?t[n]=hde(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Dl(r):t[n]=r);return t}function Rf(e,t){for(;e!==null;){const r=ade(e,t);if(r){if(r.get)return Zr(r.get);if(typeof r.value=="function")return Zr(r.value)}e=sde(e)}function n(){return null}return n}const RM=Qr(["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"]),iw=Qr(["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"]),sw=Qr(["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"]),pde=Qr(["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"]),aw=Qr(["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"]),gde=Qr(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),PM=Qr(["#text"]),TM=Qr(["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"]),lw=Qr(["accent-height","accumulate","additive","alignment-baseline","amplitude","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","exponent","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","intercept","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","slope","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","tablevalues","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"]),kM=Qr(["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"]),wm=Qr(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),mde=pi(/\{\{[\w\W]*|[\w\W]*\}\}/gm),bde=pi(/<%[\w\W]*|[\w\W]*%>/gm),yde=pi(/\$\{[\w\W]*/gm),vde=pi(/^data-[\-\w.\u00B7-\uFFFF]+$/),xde=pi(/^aria-[\-\w]+$/),E3=pi(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),wde=pi(/^(?:\w+script|data):/i),Sde=pi(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),R3=pi(/^html$/i),_de=pi(/^[a-z][.\w]*(-[.\w]+)+$/i);var AM=Object.freeze({__proto__:null,ARIA_ATTR:xde,ATTR_WHITESPACE:Sde,CUSTOM_ELEMENT:_de,DATA_ATTR:vde,DOCTYPE_NAME:R3,ERB_EXPR:bde,IS_ALLOWED_URI:E3,IS_SCRIPT_OR_DATA:wde,MUSTACHE_EXPR:mde,TMPLIT_EXPR:yde});const Pf={element:1,text:3,progressingInstruction:7,comment:8,document:9},Cde=function(){return typeof window>"u"?null:window},Ede=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}},OM=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function P3(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Cde();const t=Ne=>P3(Ne);if(t.version="3.2.4",t.removed=[],!e||!e.document||e.document.nodeType!==Pf.document||!e.Element)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:p,trustedTypes:h}=e,m=l.prototype,b=Rf(m,"cloneNode"),v=Rf(m,"remove"),x=Rf(m,"nextSibling"),w=Rf(m,"childNodes"),_=Rf(m,"parentNode");if(typeof s=="function"){const Ne=n.createElement("template");Ne.content&&Ne.content.ownerDocument&&(n=Ne.content.ownerDocument)}let R,C="";const{implementation:E,createNodeIterator:A,createDocumentFragment:M,getElementsByTagName:D}=n,{importNode:L}=r;let j=OM();t.isSupported=typeof _3=="function"&&typeof _=="function"&&E&&E.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:z,ERB_EXPR:Q,TMPLIT_EXPR:G,DATA_ATTR:F,ARIA_ATTR:H,IS_SCRIPT_OR_DATA:$,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:X}=AM;let{IS_ALLOWED_URI:I}=AM,q=null;const U=Ot({},[...RM,...iw,...sw,...aw,...PM]);let O=null;const ee=Ot({},[...TM,...lw,...kM,...wm]);let K=Object.seal(C3(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}})),oe=null,Y=null,J=!0,ie=!0,de=!1,he=!0,ae=!1,ge=!0,ue=!1,Ee=!1,Te=!1,Le=!1,Ae=!1,Fe=!1,tt=!0,at=!1;const cn="user-content-";let St=!0,Vn=!1,Rt={},fe=null;const _e=Ot({},["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 He=null;const We=Ot({},["audio","video","img","source","image","track"]);let rt=null;const An=Ot({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Fn="http://www.w3.org/1998/Math/MathML",Rn="http://www.w3.org/2000/svg",sn="http://www.w3.org/1999/xhtml";let jn=sn,Xt=!1,or=null;const Xn=Ot({},[Fn,Rn,sn],ow);let Yo=Ot({},["mi","mo","mn","ms","mtext"]),xr=Ot({},["annotation-xml"]);const ji=Ot({},["title","style","font","a","script"]);let wr=null;const Lr=["application/xhtml+xml","text/html"],fl="text/html";let $e=null,_t=null;const Ut=n.createElement("form"),Qn=function(ne){return ne instanceof RegExp||ne instanceof Function},Zn=function(){let ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(_t&&_t===ne)){if((!ne||typeof ne!="object")&&(ne={}),ne=Dl(ne),wr=Lr.indexOf(ne.PARSER_MEDIA_TYPE)===-1?fl:ne.PARSER_MEDIA_TYPE,$e=wr==="application/xhtml+xml"?ow:ib,q=Si(ne,"ALLOWED_TAGS")?Ot({},ne.ALLOWED_TAGS,$e):U,O=Si(ne,"ALLOWED_ATTR")?Ot({},ne.ALLOWED_ATTR,$e):ee,or=Si(ne,"ALLOWED_NAMESPACES")?Ot({},ne.ALLOWED_NAMESPACES,ow):Xn,rt=Si(ne,"ADD_URI_SAFE_ATTR")?Ot(Dl(An),ne.ADD_URI_SAFE_ATTR,$e):An,He=Si(ne,"ADD_DATA_URI_TAGS")?Ot(Dl(We),ne.ADD_DATA_URI_TAGS,$e):We,fe=Si(ne,"FORBID_CONTENTS")?Ot({},ne.FORBID_CONTENTS,$e):_e,oe=Si(ne,"FORBID_TAGS")?Ot({},ne.FORBID_TAGS,$e):{},Y=Si(ne,"FORBID_ATTR")?Ot({},ne.FORBID_ATTR,$e):{},Rt=Si(ne,"USE_PROFILES")?ne.USE_PROFILES:!1,J=ne.ALLOW_ARIA_ATTR!==!1,ie=ne.ALLOW_DATA_ATTR!==!1,de=ne.ALLOW_UNKNOWN_PROTOCOLS||!1,he=ne.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ae=ne.SAFE_FOR_TEMPLATES||!1,ge=ne.SAFE_FOR_XML!==!1,ue=ne.WHOLE_DOCUMENT||!1,Le=ne.RETURN_DOM||!1,Ae=ne.RETURN_DOM_FRAGMENT||!1,Fe=ne.RETURN_TRUSTED_TYPE||!1,Te=ne.FORCE_BODY||!1,tt=ne.SANITIZE_DOM!==!1,at=ne.SANITIZE_NAMED_PROPS||!1,St=ne.KEEP_CONTENT!==!1,Vn=ne.IN_PLACE||!1,I=ne.ALLOWED_URI_REGEXP||E3,jn=ne.NAMESPACE||sn,Yo=ne.MATHML_TEXT_INTEGRATION_POINTS||Yo,xr=ne.HTML_INTEGRATION_POINTS||xr,K=ne.CUSTOM_ELEMENT_HANDLING||{},ne.CUSTOM_ELEMENT_HANDLING&&Qn(ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(K.tagNameCheck=ne.CUSTOM_ELEMENT_HANDLING.tagNameCheck),ne.CUSTOM_ELEMENT_HANDLING&&Qn(ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(K.attributeNameCheck=ne.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),ne.CUSTOM_ELEMENT_HANDLING&&typeof ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(K.allowCustomizedBuiltInElements=ne.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ae&&(ie=!1),Ae&&(Le=!0),Rt&&(q=Ot({},PM),O=[],Rt.html===!0&&(Ot(q,RM),Ot(O,TM)),Rt.svg===!0&&(Ot(q,iw),Ot(O,lw),Ot(O,wm)),Rt.svgFilters===!0&&(Ot(q,sw),Ot(O,lw),Ot(O,wm)),Rt.mathMl===!0&&(Ot(q,aw),Ot(O,kM),Ot(O,wm))),ne.ADD_TAGS&&(q===U&&(q=Dl(q)),Ot(q,ne.ADD_TAGS,$e)),ne.ADD_ATTR&&(O===ee&&(O=Dl(O)),Ot(O,ne.ADD_ATTR,$e)),ne.ADD_URI_SAFE_ATTR&&Ot(rt,ne.ADD_URI_SAFE_ATTR,$e),ne.FORBID_CONTENTS&&(fe===_e&&(fe=Dl(fe)),Ot(fe,ne.FORBID_CONTENTS,$e)),St&&(q["#text"]=!0),ue&&Ot(q,["html","head","body"]),q.table&&(Ot(q,["tbody"]),delete oe.tbody),ne.TRUSTED_TYPES_POLICY){if(typeof ne.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ef('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ne.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ef('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');R=ne.TRUSTED_TYPES_POLICY,C=R.createHTML("")}else R===void 0&&(R=Ede(h,o)),R!==null&&typeof C=="string"&&(C=R.createHTML(""));Qr&&Qr(ne),_t=ne}},Fr=Ot({},[...iw,...sw,...pde]),fr=Ot({},[...aw,...gde]),ir=function(ne){let Se=_(ne);(!Se||!Se.tagName)&&(Se={namespaceURI:jn,tagName:"template"});const Ie=ib(ne.tagName),It=ib(Se.tagName);return or[ne.namespaceURI]?ne.namespaceURI===Rn?Se.namespaceURI===sn?Ie==="svg":Se.namespaceURI===Fn?Ie==="svg"&&(It==="annotation-xml"||Yo[It]):!!Fr[Ie]:ne.namespaceURI===Fn?Se.namespaceURI===sn?Ie==="math":Se.namespaceURI===Rn?Ie==="math"&&xr[It]:!!fr[Ie]:ne.namespaceURI===sn?Se.namespaceURI===Rn&&!xr[It]||Se.namespaceURI===Fn&&!Yo[It]?!1:!fr[Ie]&&(ji[Ie]||!Fr[Ie]):!!(wr==="application/xhtml+xml"&&or[ne.namespaceURI]):!1},bn=function(ne){_f(t.removed,{element:ne});try{_(ne).removeChild(ne)}catch{v(ne)}},la=function(ne,Se){try{_f(t.removed,{attribute:Se.getAttributeNode(ne),from:Se})}catch{_f(t.removed,{attribute:null,from:Se})}if(Se.removeAttribute(ne),ne==="is")if(Le||Ae)try{bn(Se)}catch{}else try{Se.setAttribute(ne,"")}catch{}},Uc=function(ne){let Se=null,Ie=null;if(Te)ne="<remove></remove>"+ne;else{const kt=EM(ne,/^[\r\n\t ]+/);Ie=kt&&kt[0]}wr==="application/xhtml+xml"&&jn===sn&&(ne='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ne+"</body></html>");const It=R?R.createHTML(ne):ne;if(jn===sn)try{Se=new p().parseFromString(It,wr)}catch{}if(!Se||!Se.documentElement){Se=E.createDocument(jn,"template",null);try{Se.documentElement.innerHTML=Xt?C:It}catch{}}const fn=Se.body||Se.documentElement;return ne&&Ie&&fn.insertBefore(n.createTextNode(Ie),fn.childNodes[0]||null),jn===sn?D.call(Se,ue?"html":"body")[0]:ue?Se.documentElement:fn},Gc=function(ne){return A.call(ne.ownerDocument||ne,ne,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},te=function(ne){return ne instanceof d&&(typeof ne.nodeName!="string"||typeof ne.textContent!="string"||typeof ne.removeChild!="function"||!(ne.attributes instanceof u)||typeof ne.removeAttribute!="function"||typeof ne.setAttribute!="function"||typeof ne.namespaceURI!="string"||typeof ne.insertBefore!="function"||typeof ne.hasChildNodes!="function")},Re=function(ne){return typeof a=="function"&&ne instanceof a};function Me(Ne,ne,Se){xm(Ne,Ie=>{Ie.call(t,ne,Se,_t)})}const Ue=function(ne){let Se=null;if(Me(j.beforeSanitizeElements,ne,null),te(ne))return bn(ne),!0;const Ie=$e(ne.nodeName);if(Me(j.uponSanitizeElement,ne,{tagName:Ie,allowedTags:q}),ne.hasChildNodes()&&!Re(ne.firstElementChild)&&Br(/<[/\w]/g,ne.innerHTML)&&Br(/<[/\w]/g,ne.textContent)||ne.nodeType===Pf.progressingInstruction||ge&&ne.nodeType===Pf.comment&&Br(/<[/\w]/g,ne.data))return bn(ne),!0;if(!q[Ie]||oe[Ie]){if(!oe[Ie]&&Ht(Ie)&&(K.tagNameCheck instanceof RegExp&&Br(K.tagNameCheck,Ie)||K.tagNameCheck instanceof Function&&K.tagNameCheck(Ie)))return!1;if(St&&!fe[Ie]){const It=_(ne)||ne.parentNode,fn=w(ne)||ne.childNodes;if(fn&&It){const kt=fn.length;for(let Wn=kt-1;Wn>=0;--Wn){const eo=b(fn[Wn],!0);eo.__removalCount=(ne.__removalCount||0)+1,It.insertBefore(eo,x(ne))}}}return bn(ne),!0}return ne instanceof l&&!ir(ne)||(Ie==="noscript"||Ie==="noembed"||Ie==="noframes")&&Br(/<\/no(script|embed|frames)/i,ne.innerHTML)?(bn(ne),!0):(ae&&ne.nodeType===Pf.text&&(Se=ne.textContent,xm([z,Q,G],It=>{Se=Cf(Se,It," ")}),ne.textContent!==Se&&(_f(t.removed,{element:ne.cloneNode()}),ne.textContent=Se)),Me(j.afterSanitizeElements,ne,null),!1)},Nt=function(ne,Se,Ie){if(tt&&(Se==="id"||Se==="name")&&(Ie in n||Ie in Ut))return!1;if(!(ie&&!Y[Se]&&Br(F,Se))){if(!(J&&Br(H,Se))){if(!O[Se]||Y[Se]){if(!(Ht(ne)&&(K.tagNameCheck instanceof RegExp&&Br(K.tagNameCheck,ne)||K.tagNameCheck instanceof Function&&K.tagNameCheck(ne))&&(K.attributeNameCheck instanceof RegExp&&Br(K.attributeNameCheck,Se)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(Se))||Se==="is"&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&Br(K.tagNameCheck,Ie)||K.tagNameCheck instanceof Function&&K.tagNameCheck(Ie))))return!1}else if(!rt[Se]){if(!Br(I,Cf(Ie,V,""))){if(!((Se==="src"||Se==="xlink:href"||Se==="href")&&ne!=="script"&&ude(Ie,"data:")===0&&He[ne])){if(!(de&&!Br($,Cf(Ie,V,"")))){if(Ie)return!1}}}}}}return!0},Ht=function(ne){return ne!=="annotation-xml"&&EM(ne,X)},Ct=function(ne){Me(j.beforeSanitizeAttributes,ne,null);const{attributes:Se}=ne;if(!Se||te(ne))return;const Ie={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:O,forceKeepAttr:void 0};let It=Se.length;for(;It--;){const fn=Se[It],{name:kt,namespaceURI:Wn,value:eo}=fn,Cs=$e(kt);let sr=kt==="value"?eo:dde(eo);if(Ie.attrName=Cs,Ie.attrValue=sr,Ie.keepAttr=!0,Ie.forceKeepAttr=void 0,Me(j.uponSanitizeAttribute,ne,Ie),sr=Ie.attrValue,at&&(Cs==="id"||Cs==="name")&&(la(kt,ne),sr=cn+sr),ge&&Br(/((--!?|])>)|<\/(style|title)/i,sr)){la(kt,ne);continue}if(Ie.forceKeepAttr||(la(kt,ne),!Ie.keepAttr))continue;if(!he&&Br(/\/>/i,sr)){la(kt,ne);continue}ae&&xm([z,Q,G],Kd=>{sr=Cf(sr,Kd," ")});const Yd=$e(ne.nodeName);if(Nt(Yd,Cs,sr)){if(R&&typeof h=="object"&&typeof h.getAttributeType=="function"&&!Wn)switch(h.getAttributeType(Yd,Cs)){case"TrustedHTML":{sr=R.createHTML(sr);break}case"TrustedScriptURL":{sr=R.createScriptURL(sr);break}}try{Wn?ne.setAttributeNS(Wn,kt,sr):ne.setAttribute(kt,sr),te(ne)?bn(ne):CM(t.removed)}catch{}}}Me(j.afterSanitizeAttributes,ne,null)},yt=function Ne(ne){let Se=null;const Ie=Gc(ne);for(Me(j.beforeSanitizeShadowDOM,ne,null);Se=Ie.nextNode();)Me(j.uponSanitizeShadowNode,Se,null),Ue(Se),Ct(Se),Se.content instanceof i&&Ne(Se.content);Me(j.afterSanitizeShadowDOM,ne,null)};return t.sanitize=function(Ne){let ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Se=null,Ie=null,It=null,fn=null;if(Xt=!Ne,Xt&&(Ne="<!-->"),typeof Ne!="string"&&!Re(Ne))if(typeof Ne.toString=="function"){if(Ne=Ne.toString(),typeof Ne!="string")throw Ef("dirty is not a string, aborting")}else throw Ef("toString is not a function");if(!t.isSupported)return Ne;if(Ee||Zn(ne),t.removed=[],typeof Ne=="string"&&(Vn=!1),Vn){if(Ne.nodeName){const eo=$e(Ne.nodeName);if(!q[eo]||oe[eo])throw Ef("root node is forbidden and cannot be sanitized in-place")}}else if(Ne instanceof a)Se=Uc("<!---->"),Ie=Se.ownerDocument.importNode(Ne,!0),Ie.nodeType===Pf.element&&Ie.nodeName==="BODY"||Ie.nodeName==="HTML"?Se=Ie:Se.appendChild(Ie);else{if(!Le&&!ae&&!ue&&Ne.indexOf("<")===-1)return R&&Fe?R.createHTML(Ne):Ne;if(Se=Uc(Ne),!Se)return Le?null:Fe?C:""}Se&&Te&&bn(Se.firstChild);const kt=Gc(Vn?Ne:Se);for(;It=kt.nextNode();)Ue(It),Ct(It),It.content instanceof i&&yt(It.content);if(Vn)return Ne;if(Le){if(Ae)for(fn=M.call(Se.ownerDocument);Se.firstChild;)fn.appendChild(Se.firstChild);else fn=Se;return(O.shadowroot||O.shadowrootmode)&&(fn=L.call(r,fn,!0)),fn}let Wn=ue?Se.outerHTML:Se.innerHTML;return ue&&q["!doctype"]&&Se.ownerDocument&&Se.ownerDocument.doctype&&Se.ownerDocument.doctype.name&&Br(R3,Se.ownerDocument.doctype.name)&&(Wn="<!DOCTYPE "+Se.ownerDocument.doctype.name+`>
|
|
316
|
+
`+Wn),ae&&xm([z,Q,G],eo=>{Wn=Cf(Wn,eo," ")}),R&&Fe?R.createHTML(Wn):Wn},t.setConfig=function(){let Ne=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zn(Ne),Ee=!0},t.clearConfig=function(){_t=null,Ee=!1},t.isValidAttribute=function(Ne,ne,Se){_t||Zn({});const Ie=$e(Ne),It=$e(ne);return Nt(Ie,It,Se)},t.addHook=function(Ne,ne){typeof ne=="function"&&_f(j[Ne],ne)},t.removeHook=function(Ne,ne){if(ne!==void 0){const Se=lde(j[Ne],ne);return Se===-1?void 0:cde(j[Ne],Se,1)[0]}return CM(j[Ne])},t.removeHooks=function(Ne){j[Ne]=[]},t.removeAllHooks=function(){j=OM()},t}var $S=P3();function Jb({card:e,isLoading:t,data:n}){var p,h;const r=n||[],{keys:o}=lr(r),i=ye(m=>m.selectedSheetId),s=ye(m=>m.isVisualEditing),a=(h=(p=e==null?void 0:e.preferences)==null?void 0:p.textVisualOptions)==null?void 0:h.isDynamicText,{setCardDescription:l}=Hn(),{setCard:c}=mp();function u(){var x;if(t)return y.jsxs("div",{className:"space-y-2",children:[y.jsx(Iu,{className:"h-3 w-full animate-pulse bg-muted"}),y.jsx(Iu,{className:"h-3 w-3/4 animate-pulse bg-muted"}),y.jsx(Iu,{className:"h-3 w-1/2 animate-pulse bg-muted"})]});const m=(x=r==null?void 0:r[0])==null?void 0:x[o[0]],b=$S.sanitize(m),v=y.jsx("div",{dangerouslySetInnerHTML:{__html:b}});return y.jsx("div",{className:"text-sm text-foreground/80 hover:cursor-text",onMouseDown:w=>w.stopPropagation(),children:v})}function d(){return y.jsx("div",{onMouseDown:m=>m.stopPropagation(),children:y.jsx(ss,{type:"textarea",className:"w-full rounded-md bg-muted",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:y.jsx("div",{className:"text-sm text-foreground/70 hover:cursor-text",dangerouslySetInnerHTML:{__html:$S.sanitize((e==null?void 0:e.description)||(s?"Edit Description":"")||"")}})})})}return y.jsxs(y.Fragment,{children:[!a&&d(),a===!0&&u()]})}const MM=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,IM=od,zE=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return IM(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 p=MM(u)||MM(d);return o[c][p]}),a=n&&Object.entries(n).reduce((c,u)=>{let[d,p]=u;return p===void 0||(c[d]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:d,className:p,...h}=u;return Object.entries(h).every(m=>{let[b,v]=m;return Array.isArray(v)?v.includes({...i,...a}[b]):{...i,...a}[b]===v})?[...c,d,p]:c},[]);return IM(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)},Hh=zE("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"}}),nr=P.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?ta:"button";return y.jsx(s,{className:me(Hh({variant:t,size:n,className:e})),ref:i,...o})});nr.displayName="Button";var Rde="Separator",DM="horizontal",Pde=["horizontal","vertical"],T3=P.forwardRef((e,t)=>{const{decorative:n,orientation:r=DM,...o}=e,i=Tde(r)?r:DM,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return y.jsx(je.div,{"data-orientation":i,...a,...o,ref:t})});T3.displayName=Rde;function Tde(e){return Pde.includes(e)}var k3=T3;const hy=P.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>y.jsx(k3,{ref:o,decorative:n,orientation:t,className:me("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));hy.displayName=k3.displayName;function kde(){var b,v;const e=ye(x=>x.themeStyle),t=ye(x=>x.filterValues),n=ye(x=>x.dashboard.filters),r=ye(x=>x.filteringCards),o=ye(x=>x.selectedSheetId),{removeFilterValues:i,removeFilteringCard:s,setFilterValues:a,setFilteringCards:l}=Hn(),c=n==null?void 0:n.filter(x=>x.sheetId===o||!x.sheetId),u=t==null?void 0:t.filter(x=>(c==null?void 0:c.some(w=>w.id===x.filterId))||x.filterId.endsWith(o));if(!u||u.length===0)return null;const d=u.map(x=>{const w=n==null?void 0:n.find(_=>_.id===x.filterId);return{filterId:x.filterId,name:(w==null?void 0:w.title)||x.name,values:x.values}});function p(x){return x instanceof Date?x.toLocaleDateString():x}function h(x){const w=r==null?void 0:r.find(_=>x.filterId.startsWith(_.id));w&&s(w),i(x.filterId)}function m(x){var w,_;return y.jsxs("div",{className:"space-y-2",children:[y.jsxs("div",{style:{borderRadius:(_=(w=e==null?void 0:e.chart)==null?void 0:w.options)==null?void 0:_.borderRadius},className:"flex w-fit items-center gap-2 bg-muted-foreground px-2 py-1 font-semibold text-muted",children:[y.jsx("span",{className:"break-words",children:x.name}),y.jsx($c,{onClick:()=>h(x),className:"size-3 text-muted hover:cursor-pointer hover:text-background"})]}),y.jsx("div",{className:"flex flex-wrap gap-1",children:x.values.map(R=>{var C,E;return y.jsx("span",{style:{borderRadius:(E=(C=e==null?void 0:e.chart)==null?void 0:C.options)==null?void 0:E.borderRadius},className:"inline-block",children:p(R)},R==null?void 0:R.toString())})})]})}return y.jsxs(Rp,{openDelay:100,children:[y.jsx(Pp,{children:y.jsx(dL,{className:"z-100 size-3.5 text-muted-foreground/40"})}),y.jsxs(Bd,{style:{borderRadius:(v=(b=e==null?void 0:e.chart)==null?void 0:b.options)==null?void 0:v.borderRadius},className:"relative flex min-h-fit w-[300px] flex-col px-0 text-xs",align:"start",children:[y.jsx(WC,{onClick:()=>{l([]),a([])},className:"absolute right-4 size-3.5 text-muted-foreground/40 hover:cursor-pointer"}),y.jsx("div",{className:"h-fit max-h-[150px] min-h-0 grow overflow-auto",children:d==null?void 0:d.map(x=>y.jsxs("div",{className:"px-5",children:[m(x),y.jsx(hy,{className:"my-2"})]},x.name))})]})]})}const Ade=P.forwardRef(({className:e,containerClassName:t,containerStyle:n,...r},o)=>y.jsx("div",{style:n,className:me("relative w-full overflow-auto",t),children:y.jsx("table",{ref:o,className:me("w-full caption-bottom text-sm",e),...r})}));Ade.displayName="Table";const BE=P.forwardRef(({className:e,...t},n)=>y.jsx("thead",{ref:n,className:me("[&_tr]:border-b",e),...t}));BE.displayName="TableHeader";const HE=P.forwardRef(({className:e,...t},n)=>y.jsx("tbody",{ref:n,className:me("[&_tr:last-child]:border-0",e),...t}));HE.displayName="TableBody";const Ode=P.forwardRef(({className:e,...t},n)=>y.jsx("tfoot",{ref:n,className:me("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Ode.displayName="TableFooter";const hh=P.forwardRef(({className:e,...t},n)=>y.jsx("tr",{ref:n,className:me("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));hh.displayName="TableRow";const VE=P.forwardRef(({className:e,...t},n)=>y.jsx("th",{ref:n,className:me("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));VE.displayName="TableHead";const WE=P.forwardRef(({className:e,...t},n)=>y.jsx("td",{ref:n,className:me("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));WE.displayName="TableCell";const Mde=P.forwardRef(({className:e,...t},n)=>y.jsx("caption",{ref:n,className:me("mt-4 text-sm text-muted-foreground",e),...t}));Mde.displayName="TableCaption";/**
|
|
317
|
+
* table-core
|
|
318
|
+
*
|
|
319
|
+
* Copyright (c) TanStack
|
|
320
|
+
*
|
|
321
|
+
* This source code is licensed under the MIT license found in the
|
|
322
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
323
|
+
*
|
|
324
|
+
* @license MIT
|
|
325
|
+
*/function $a(e,t){return typeof e=="function"?e(t):e}function Uo(e,t){return n=>{t.setState(r=>({...r,[e]:$a(n,r[e])}))}}function py(e){return e instanceof Function}function Ide(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Dde(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 Xe(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((u,d)=>r[d]!==u)))return o;r=a;let c;if(n.key&&n.debug&&(c=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const u=Math.round((Date.now()-s)*100)/100,d=Math.round((Date.now()-c)*100)/100,p=d/16,h=(m,b)=>{for(m=String(m);m.length<b;)m=" "+m;return m};console.info(`%c⏱ ${h(d,5)} /${h(u,5)} ms`,`
|
|
326
|
+
font-size: .6rem;
|
|
327
|
+
font-weight: bold;
|
|
328
|
+
color: hsl(${Math.max(0,Math.min(120-120*p,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function Qe(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function Nde(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:Xe(()=>[e,n,t,i],(s,a,l,c)=>({table:s,column:a,row:l,cell:c,getValue:c.getValue,renderValue:c.renderValue}),Qe(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function Lde(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let c=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,u;if(a.accessorFn?u=a.accessorFn:l&&(l.includes(".")?u=p=>{let h=p;for(const b of l.split(".")){var m;h=(m=h)==null?void 0:m[b],process.env.NODE_ENV!=="production"&&h===void 0&&console.warn(`"${b}" in deeply nested key "${l}" returned undefined.`)}return h}:u=p=>p[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:Xe(()=>[!0],()=>{var p;return[d,...(p=d.columns)==null?void 0:p.flatMap(h=>h.getFlatColumns())]},Qe(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Xe(()=>[e._getOrderColumnsFn()],p=>{var h;if((h=d.columns)!=null&&h.length){let m=d.columns.flatMap(b=>b.getLeafColumns());return p(m)}return[d]},Qe(e.options,"debugColumns","column.getLeafColumns"))};for(const p of e._features)p.createColumn==null||p.createColumn(d,e);return d}const Er="debugHeaders";function NM(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 Fde={createTable:e=>{e.getHeaderGroups=Xe(()=>[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(p=>p.id===d)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(d=>n.find(p=>p.id===d)).filter(Boolean))!=null?s:[],c=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return Sm(t,[...a,...c,...l],e)},Qe(e.options,Er,"getHeaderGroups")),e.getCenterHeaderGroups=Xe(()=>[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))),Sm(t,n,e,"center")),Qe(e.options,Er,"getCenterHeaderGroups")),e.getLeftHeaderGroups=Xe(()=>[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 Sm(t,i,e,"left")},Qe(e.options,Er,"getLeftHeaderGroups")),e.getRightHeaderGroups=Xe(()=>[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 Sm(t,i,e,"right")},Qe(e.options,Er,"getRightHeaderGroups")),e.getFooterGroups=Xe(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Qe(e.options,Er,"getFooterGroups")),e.getLeftFooterGroups=Xe(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Qe(e.options,Er,"getLeftFooterGroups")),e.getCenterFooterGroups=Xe(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Qe(e.options,Er,"getCenterFooterGroups")),e.getRightFooterGroups=Xe(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Qe(e.options,Er,"getRightFooterGroups")),e.getFlatHeaders=Xe(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Qe(e.options,Er,"getFlatHeaders")),e.getLeftFlatHeaders=Xe(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Qe(e.options,Er,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Xe(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Qe(e.options,Er,"getCenterFlatHeaders")),e.getRightFlatHeaders=Xe(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Qe(e.options,Er,"getRightFlatHeaders")),e.getCenterLeafHeaders=Xe(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Qe(e.options,Er,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Xe(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Qe(e.options,Er,"getLeftLeafHeaders")),e.getRightLeafHeaders=Xe(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),Qe(e.options,Er,"getRightLeafHeaders")),e.getLeafHeaders=Xe(()=>[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()},Qe(e.options,Er,"getLeafHeaders"))}};function Sm(e,t,n,r){var o,i;let s=0;const a=function(p,h){h===void 0&&(h=1),s=Math.max(s,h),p.filter(m=>m.getIsVisible()).forEach(m=>{var b;(b=m.columns)!=null&&b.length&&a(m.columns,h+1)},0)};a(e);let l=[];const c=(p,h)=>{const m={depth:h,id:[r,`${h}`].filter(Boolean).join("_"),headers:[]},b=[];p.forEach(v=>{const x=[...b].reverse()[0],w=v.column.depth===m.depth;let _,R=!1;if(w&&v.column.parent?_=v.column.parent:(_=v.column,R=!0),x&&(x==null?void 0:x.column)===_)x.subHeaders.push(v);else{const C=NM(n,_,{id:[r,h,_.id,v==null?void 0:v.id].filter(Boolean).join("_"),isPlaceholder:R,placeholderId:R?`${b.filter(E=>E.column===_).length}`:void 0,depth:h,index:b.length});C.subHeaders.push(v),b.push(C)}m.headers.push(v),v.headerGroup=m}),l.push(m),h>0&&c(b,h-1)},u=t.map((p,h)=>NM(n,p,{depth:s,index:h}));c(u,s-1),l.reverse();const d=p=>p.filter(m=>m.column.getIsVisible()).map(m=>{let b=0,v=0,x=[0];m.subHeaders&&m.subHeaders.length?(x=[],d(m.subHeaders).forEach(_=>{let{colSpan:R,rowSpan:C}=_;b+=R,x.push(C)})):b=1;const w=Math.min(...x);return v=v+w,m.colSpan=b,m.rowSpan=v,{colSpan:b,rowSpan:v}});return d((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const jde=(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:[],getLeafRows:()=>Dde(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:Xe(()=>[e.getAllLeafColumns()],l=>l.map(c=>Nde(e,a,c,c.id)),Qe(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Xe(()=>[a.getAllCells()],l=>l.reduce((c,u)=>(c[u.column.id]=u,c),{}),Qe(e.options,"debugRows","getAllCellsByColumnId"))};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},$de={createColumn:(e,t)=>{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()}}},A3=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};A3.autoRemove=e=>Ai(e);const O3=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};O3.autoRemove=e=>Ai(e);const M3=(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())};M3.autoRemove=e=>Ai(e);const I3=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};I3.autoRemove=e=>Ai(e);const D3=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});D3.autoRemove=e=>Ai(e)||!(e!=null&&e.length);const N3=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});N3.autoRemove=e=>Ai(e)||!(e!=null&&e.length);const L3=(e,t,n)=>e.getValue(t)===n;L3.autoRemove=e=>Ai(e);const F3=(e,t,n)=>e.getValue(t)==n;F3.autoRemove=e=>Ai(e);const UE=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};UE.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]};UE.autoRemove=e=>Ai(e)||Ai(e[0])&&Ai(e[1]);const Bs={includesString:A3,includesStringSensitive:O3,equalsString:M3,arrIncludes:I3,arrIncludesAll:D3,arrIncludesSome:N3,equals:L3,weakEquals:F3,inNumberRange:UE};function Ai(e){return e==null||e===""}const zde={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Uo("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?Bs.includesString:typeof r=="number"?Bs.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Bs.equals:Array.isArray(r)?Bs.arrIncludes:Bs.weakEquals},e.getFilterFn=()=>{var n,r;return py(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:Bs[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.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=$a(n,i?i.value:void 0);if(LM(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]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=$a(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(LM(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},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())}};function LM(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const Bde=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),Hde=(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},Vde=(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},Wde=(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]},Ude=(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},Gde=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!Ide(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},qde=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Yde=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,Kde=(e,t)=>t.length,cw={sum:Bde,min:Hde,max:Vde,extent:Wde,mean:Ude,median:Gde,unique:qde,uniqueCount:Yde,count:Kde},Xde={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:Uo("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;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},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 cw.sum;if(Object.prototype.toString.call(r)==="[object Date]")return cw.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return py(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:cw[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 Qde(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 Zde={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Uo("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Xe(n=>[ph(t,n)],n=>n.findIndex(r=>r.id===e.id),Qe(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=ph(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=ph(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},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=Xe(()=>[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 Qde(i,n,r)},Qe(e.options,"debugTable","_getOrderColumnsFn"))}},uw=()=>({left:[],right:[]}),Jde={getInitialState:e=>({columnPinning:uw(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Uo("columnPinning",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.getCenterVisibleCells=Xe(()=>[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))},Qe(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=Xe(()=>[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"})),Qe(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=Xe(()=>[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"})),Qe(t.options,"debugRows","getRightVisibleCells"))},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?uw():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:uw())},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=Xe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Qe(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=Xe(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),Qe(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=Xe(()=>[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))},Qe(e.options,"debugColumns","getCenterLeafColumns"))}},_m={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},dw=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),efe={getDefaultColumnDef:()=>_m,getInitialState:e=>({columnSizing:{},columnSizingInfo:dw(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Uo("columnSizing",e),onColumnSizingInfoChange:Uo("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:_m.minSize,(r=i??e.columnDef.size)!=null?r:_m.size),(o=e.columnDef.maxSize)!=null?o:_m.maxSize)},e.getStart=Xe(n=>[n,ph(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),Qe(t.options,"debugColumns","getStart")),e.getAfter=Xe(n=>[n,ph(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),Qe(t.options,"debugColumns","getAfter")),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(),fw(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(x=>[x.column.id,x.column.getSize()]):[[r.id,r.getSize()]],l=fw(i)?Math.round(i.touches[0].clientX):i.clientX,c={},u=(x,w)=>{typeof w=="number"&&(t.setColumnSizingInfo(_=>{var R,C;const E=t.options.columnResizeDirection==="rtl"?-1:1,A=(w-((R=_==null?void 0:_.startOffset)!=null?R:0))*E,M=Math.max(A/((C=_==null?void 0:_.startSize)!=null?C:0),-.999999);return _.columnSizingStart.forEach(D=>{let[L,j]=D;c[L]=Math.round(Math.max(j+j*M,0)*100)/100}),{..._,deltaOffset:A,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||x==="end")&&t.setColumnSizing(_=>({..._,...c})))},d=x=>u("move",x),p=x=>{u("end",x),t.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},h=n||typeof document<"u"?document:null,m={moveHandler:x=>d(x.clientX),upHandler:x=>{h==null||h.removeEventListener("mousemove",m.moveHandler),h==null||h.removeEventListener("mouseup",m.upHandler),p(x.clientX)}},b={moveHandler:x=>(x.cancelable&&(x.preventDefault(),x.stopPropagation()),d(x.touches[0].clientX),!1),upHandler:x=>{var w;h==null||h.removeEventListener("touchmove",b.moveHandler),h==null||h.removeEventListener("touchend",b.upHandler),x.cancelable&&(x.preventDefault(),x.stopPropagation()),p((w=x.touches[0])==null?void 0:w.clientX)}},v=tfe()?{passive:!1}:!1;fw(i)?(h==null||h.addEventListener("touchmove",b.moveHandler,v),h==null||h.addEventListener("touchend",b.upHandler,v)):(h==null||h.addEventListener("mousemove",m.moveHandler,v),h==null||h.addEventListener("mouseup",m.upHandler,v)),t.setColumnSizingInfo(x=>({...x,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?dw():(n=e.initialState.columnSizingInfo)!=null?n:dw())},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 Cm=null;function tfe(){if(typeof Cm=="boolean")return Cm;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 Cm=e,Cm}function fw(e){return e.type==="touchstart"}const nfe={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Uo("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(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=Xe(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),Qe(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=Xe(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],Qe(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>Xe(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),Qe(e.options,"debugColumns",n));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)}}};function ph(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const rfe={createTable:e=>{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()}}},ofe={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Uo("globalFilter",e),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.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}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Bs.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return py(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Bs[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},ife={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Uo("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()}}}},zS=0,BS=10,hw=()=>({pageIndex:zS,pageSize:BS}),sfe={getInitialState:e=>({...e,pagination:{...hw(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Uo("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=>$a(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?hw():(o=e.initialState.pagination)!=null?o:hw())},e.setPageIndex=r=>{e.setPagination(o=>{let i=$a(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?zS:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:zS)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?BS:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:BS)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,$a(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=$a(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=Xe(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},Qe(e.options,"debugTable","getPageOptions")),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.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-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.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},pw=()=>({top:[],bottom:[]}),afe={getInitialState:e=>({rowPinning:pw(),...e}),getDefaultOptions:e=>({onRowPinningChange:Uo("rowPinning",e)}),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,p;return{top:((d=l==null?void 0:l.top)!=null?d:[]).filter(b=>!(a!=null&&a.has(b))),bottom:[...((p=l==null?void 0:l.bottom)!=null?p:[]).filter(b=>!(a!=null&&a.has(b))),...Array.from(a)]}}if(n==="top"){var h,m;return{top:[...((h=l==null?void 0:l.top)!=null?h:[]).filter(b=>!(a!=null&&a.has(b))),...Array.from(a)],bottom:((m=l==null?void 0:l.bottom)!=null?m:[]).filter(b=>!(a!=null&&a.has(b)))}}return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(b=>!(a!=null&&a.has(b))),bottom:((u=l==null?void 0:l.bottom)!=null?u:[]).filter(b=>!(a!=null&&a.has(b)))}})},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=o==="top"?t.getTopRows():t.getBottomRows())==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}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?pw():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:pw())},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,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=Xe(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Qe(e.options,"debugRows","getTopRows")),e.getBottomRows=Xe(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Qe(e.options,"debugRows","getBottomRows")),e.getCenterRows=Xe(()=>[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))},Qe(e.options,"debugRows","getCenterRows"))}},lfe={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Uo("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=>{HS(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Xe(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?gw(e,n):{rows:[],flatRows:[],rowsById:{}},Qe(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Xe(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?gw(e,n):{rows:[],flatRows:[],rowsById:{}},Qe(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Xe(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?gw(e,n):{rows:[],flatRows:[],rowsById:{}},Qe(e.options,"debugTable","getGroupedSelectedRowModel")),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 HS(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return GE(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return VS(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return VS(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)}}}},HS=(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=>HS(e,a.id,n,r,o))};function gw(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var c;const u=GE(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 GE(e,t){var n;return(n=t[e.id])!=null?n:!1}function VS(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()&&(GE(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=VS(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const WS=/([0-9]+)/gm,cfe=(e,t,n)=>j3(el(e.getValue(n)).toLowerCase(),el(t.getValue(n)).toLowerCase()),ufe=(e,t,n)=>j3(el(e.getValue(n)),el(t.getValue(n))),dfe=(e,t,n)=>qE(el(e.getValue(n)).toLowerCase(),el(t.getValue(n)).toLowerCase()),ffe=(e,t,n)=>qE(el(e.getValue(n)),el(t.getValue(n))),hfe=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},pfe=(e,t,n)=>qE(e.getValue(n),t.getValue(n));function qE(e,t){return e===t?0:e>t?1:-1}function el(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function j3(e,t){const n=e.split(WS).filter(Boolean),r=t.split(WS).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 Tf={alphanumeric:cfe,alphanumericCaseSensitive:ufe,text:dfe,textCaseSensitive:ffe,datetime:hfe,basic:pfe},gfe={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Uo("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 Tf.datetime;if(typeof i=="string"&&(r=!0,i.split(WS).length>1))return Tf.alphanumeric}return r?Tf.text:Tf.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 py(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:Tf[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(h=>h.id===e.id),l=s==null?void 0:s.findIndex(h=>h.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 p;c=[...s,{id:e.id,desc:d}],c.splice(0,c.length-((p=t.options.maxMultiSortColCount)!=null?p:Number.MAX_SAFE_INTEGER))}else u==="toggle"?c=s.map(h=>h.id===e.id?{...h,desc:d}:h):u==="remove"?c=s.filter(h=>h.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())}},mfe=[Fde,nfe,Zde,Jde,$de,zde,rfe,ofe,gfe,Xde,ife,sfe,afe,lfe,efe];function bfe(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...mfe,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((p,h)=>Object.assign(p,h.getDefaultOptions==null?void 0:h.getDefaultOptions(o)),{}),s=p=>o.options.mergeOptions?o.options.mergeOptions(i,p):{...i,...p};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(p=>{var h;l=(h=p.getInitialState==null?void 0:p.getInitialState(l))!=null?h:l});const c=[];let u=!1;const d={_features:r,options:{...i,...e},initialState:l,_queue:p=>{c.push(p),u||(u=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();u=!1}).catch(h=>setTimeout(()=>{throw h})))},reset:()=>{o.setState(o.initialState)},setOptions:p=>{const h=$a(p,o.options);o.options=s(h)},getState:()=>o.options.state,setState:p=>{o.options.onStateChange==null||o.options.onStateChange(p)},_getRowId:(p,h,m)=>{var b;return(b=o.options.getRowId==null?void 0:o.options.getRowId(p,h,m))!=null?b:`${m?[m.id,h].join("."):h}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(p,h)=>{let m=(h?o.getPrePaginationRowModel():o.getRowModel()).rowsById[p];if(!m&&(m=o.getCoreRowModel().rowsById[p],!m))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${p}`):new Error;return m},_getDefaultColumnDef:Xe(()=>[o.options.defaultColumn],p=>{var h;return p=(h=p)!=null?h:{},{header:m=>{const b=m.header.column.columnDef;return b.accessorKey?b.accessorKey:b.accessorFn?b.id:null},cell:m=>{var b,v;return(b=(v=m.renderValue())==null||v.toString==null?void 0:v.toString())!=null?b:null},...o._features.reduce((m,b)=>Object.assign(m,b.getDefaultColumnDef==null?void 0:b.getDefaultColumnDef()),{}),...p}},Qe(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:Xe(()=>[o._getColumnDefs()],p=>{const h=function(m,b,v){return v===void 0&&(v=0),m.map(x=>{const w=Lde(o,x,v,b),_=x;return w.columns=_.columns?h(_.columns,w,v+1):[],w})};return h(p)},Qe(e,"debugColumns","getAllColumns")),getAllFlatColumns:Xe(()=>[o.getAllColumns()],p=>p.flatMap(h=>h.getFlatColumns()),Qe(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Xe(()=>[o.getAllFlatColumns()],p=>p.reduce((h,m)=>(h[m.id]=m,h),{}),Qe(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Xe(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(p,h)=>{let m=p.flatMap(b=>b.getLeafColumns());return h(m)},Qe(e,"debugColumns","getAllLeafColumns")),getColumn:p=>{const h=o._getAllFlatColumnsById()[p];return process.env.NODE_ENV!=="production"&&!h&&console.error(`[Table] Column with id '${p}' does not exist.`),h}};Object.assign(o,d);for(let p=0;p<o._features.length;p++){const h=o._features[p];h==null||h.createTable==null||h.createTable(o)}return o}function $3(){return e=>Xe(()=>[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=jde(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},Qe(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function yfe(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 z3(e){return t=>Xe(()=>[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=yfe({rows:s,flatRows:a,rowsById:l}),d.flatRows=[];const p=h=>{d.flatRows.push(h),h.subRows.length&&h.subRows.forEach(p)};return d.rows.forEach(p),d},Qe(t.options,"debugTable","getPaginationRowModel"))}function B3(){return e=>Xe(()=>[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 h=0;h<i.length;h+=1){var p;const m=i[h],b=s[m.id],v=b.sortUndefined,x=(p=m==null?void 0:m.desc)!=null?p:!1;let w=0;if(v){const _=u.getValue(m.id),R=d.getValue(m.id),C=_===void 0,E=R===void 0;if(C||E){if(v==="first")return C?-1:1;if(v==="last")return C?1:-1;w=C&&E?0:C?v:-v}}if(w===0&&(w=b.sortingFn(u,d,m.id)),w!==0)return x&&(w*=-1),b.invertSorting&&(w*=-1),w}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}},Qe(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
329
|
+
* react-table
|
|
330
|
+
*
|
|
331
|
+
* Copyright (c) TanStack
|
|
332
|
+
*
|
|
333
|
+
* This source code is licensed under the MIT license found in the
|
|
334
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
335
|
+
*
|
|
336
|
+
* @license MIT
|
|
337
|
+
*/function US(e,t){return e?vfe(e)?P.createElement(e,t):e:null}function vfe(e){return xfe(e)||typeof e=="function"||wfe(e)}function xfe(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function wfe(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function H3(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=P.useState(()=>({current:bfe(t)})),[r,o]=P.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 GS(e,[t,n]){return Math.min(n,Math.max(t,e))}var mw=0;function gy(){P.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??FM()),document.body.insertAdjacentElement("beforeend",e[1]??FM()),mw++,()=>{mw===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),mw--}},[])}function FM(){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}var bw="focusScope.autoFocusOnMount",yw="focusScope.autoFocusOnUnmount",jM={bubbles:!1,cancelable:!0},Sfe="FocusScope",Tp=P.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=P.useState(null),c=tr(o),u=tr(i),d=P.useRef(null),p=st(t,b=>l(b)),h=P.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;P.useEffect(()=>{if(r){let b=function(_){if(h.paused||!a)return;const R=_.target;a.contains(R)?d.current=R:Ea(d.current,{select:!0})},v=function(_){if(h.paused||!a)return;const R=_.relatedTarget;R!==null&&(a.contains(R)||Ea(d.current,{select:!0}))},x=function(_){if(document.activeElement===document.body)for(const C of _)C.removedNodes.length>0&&Ea(a)};document.addEventListener("focusin",b),document.addEventListener("focusout",v);const w=new MutationObserver(x);return a&&w.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",v),w.disconnect()}}},[r,a,h.paused]),P.useEffect(()=>{if(a){zM.add(h);const b=document.activeElement;if(!a.contains(b)){const x=new CustomEvent(bw,jM);a.addEventListener(bw,c),a.dispatchEvent(x),x.defaultPrevented||(_fe(Tfe(V3(a)),{select:!0}),document.activeElement===b&&Ea(a))}return()=>{a.removeEventListener(bw,c),setTimeout(()=>{const x=new CustomEvent(yw,jM);a.addEventListener(yw,u),a.dispatchEvent(x),x.defaultPrevented||Ea(b??document.body,{select:!0}),a.removeEventListener(yw,u),zM.remove(h)},0)}}},[a,c,u,h]);const m=P.useCallback(b=>{if(!n&&!r||h.paused)return;const v=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,x=document.activeElement;if(v&&x){const w=b.currentTarget,[_,R]=Cfe(w);_&&R?!b.shiftKey&&x===R?(b.preventDefault(),n&&Ea(_,{select:!0})):b.shiftKey&&x===_&&(b.preventDefault(),n&&Ea(R,{select:!0})):x===w&&b.preventDefault()}},[n,r,h.paused]);return y.jsx(je.div,{tabIndex:-1,...s,ref:p,onKeyDown:m})});Tp.displayName=Sfe;function _fe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ea(r,{select:t}),document.activeElement!==n)return}function Cfe(e){const t=V3(e),n=$M(t,e),r=$M(t.reverse(),e);return[n,r]}function V3(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 $M(e,t){for(const n of e)if(!Efe(n,{upTo:t}))return n}function Efe(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 Rfe(e){return e instanceof HTMLInputElement&&"select"in e}function Ea(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Rfe(e)&&t&&e.select()}}var zM=Pfe();function Pfe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=BM(e,t),e.unshift(t)},remove(t){var n;e=BM(e,t),(n=e[0])==null||n.resume()}}}function BM(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Tfe(e){return e.filter(t=>t.tagName!=="A")}function my(e){const t=P.useRef({value:e,previous:e});return P.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var kfe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},fu=new WeakMap,Em=new WeakMap,Rm={},vw=0,W3=function(e){return e&&(e.host||W3(e.parentNode))},Afe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=W3(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})},Ofe=function(e,t,n,r){var o=Afe(t,Array.isArray(e)?e:[e]);Rm[n]||(Rm[n]=new WeakMap);var i=Rm[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(p){if(a.has(p))u(p);else try{var h=p.getAttribute(r),m=h!==null&&h!=="false",b=(fu.get(p)||0)+1,v=(i.get(p)||0)+1;fu.set(p,b),i.set(p,v),s.push(p),b===1&&m&&Em.set(p,!0),v===1&&p.setAttribute(n,"true"),m||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return u(t),a.clear(),vw++,function(){s.forEach(function(d){var p=fu.get(d)-1,h=i.get(d)-1;fu.set(d,p),i.set(d,h),p||(Em.has(d)||d.removeAttribute(r),Em.delete(d)),h||d.removeAttribute(n)}),vw--,vw||(fu=new WeakMap,fu=new WeakMap,Em=new WeakMap,Rm={})}},by=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=kfe(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),Ofe(r,o,n,"aria-hidden")):function(){return null}},es=function(){return es=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},es.apply(this,arguments)};function U3(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 Mfe(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 sb="right-scroll-bar-position",ab="width-before-scroll-bar",Ife="with-scroll-bars-hidden",Dfe="--removed-body-scroll-bar-size";function xw(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Nfe(e,t){var n=T.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 Lfe=typeof window<"u"?P.useLayoutEffect:P.useEffect,HM=new WeakMap;function Ffe(e,t){var n=Nfe(null,function(r){return e.forEach(function(o){return xw(o,r)})});return Lfe(function(){var r=HM.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(a){i.has(a)||xw(a,null)}),i.forEach(function(a){o.has(a)||xw(a,s)})}HM.set(n,e)},[e]),n}function jfe(e){return e}function $fe(e,t){t===void 0&&(t=jfe);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 zfe(e){e===void 0&&(e={});var t=$fe(null);return t.options=es({async:!0,ssr:!1},e),t}var G3=function(e){var t=e.sideCar,n=U3(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 P.createElement(r,es({},n))};G3.isSideCarExport=!0;function Bfe(e,t){return e.useMedium(t),G3}var q3=zfe(),ww=function(){},yy=P.forwardRef(function(e,t){var n=P.useRef(null),r=P.useState({onScrollCapture:ww,onWheelCapture:ww,onTouchMoveCapture:ww}),o=r[0],i=r[1],s=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,p=e.sideCar,h=e.noIsolation,m=e.inert,b=e.allowPinchZoom,v=e.as,x=v===void 0?"div":v,w=e.gapMode,_=U3(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=p,C=Ffe([n,t]),E=es(es({},_),o);return P.createElement(P.Fragment,null,u&&P.createElement(R,{sideCar:q3,removeScrollBar:c,shards:d,noIsolation:h,inert:m,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:w}),s?P.cloneElement(P.Children.only(a),es(es({},E),{ref:C})):P.createElement(x,es({},E,{className:l,ref:C}),a))});yy.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};yy.classNames={fullWidth:ab,zeroRight:sb};var Hfe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Vfe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Hfe();return t&&e.setAttribute("nonce",t),e}function Wfe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ufe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Gfe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Vfe())&&(Wfe(t,n),Ufe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},qfe=function(){var e=Gfe();return function(t,n){P.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Y3=function(){var e=qfe(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Yfe={left:0,top:0,right:0,gap:0},Sw=function(e){return parseInt(e||"",10)||0},Kfe=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[Sw(n),Sw(r),Sw(o)]},Xfe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Yfe;var t=Kfe(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])}},Qfe=Y3(),$u="data-scroll-locked",Zfe=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
338
|
+
.`.concat(Ife,` {
|
|
339
|
+
overflow: hidden `).concat(r,`;
|
|
340
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
|
341
|
+
}
|
|
342
|
+
body[`).concat($u,`] {
|
|
343
|
+
overflow: hidden `).concat(r,`;
|
|
344
|
+
overscroll-behavior: contain;
|
|
345
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
346
|
+
padding-left: `.concat(o,`px;
|
|
347
|
+
padding-top: `).concat(i,`px;
|
|
348
|
+
padding-right: `).concat(s,`px;
|
|
349
|
+
margin-left:0;
|
|
350
|
+
margin-top:0;
|
|
351
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
352
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.`).concat(sb,` {
|
|
356
|
+
right: `).concat(a,"px ").concat(r,`;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.`).concat(ab,` {
|
|
360
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.`).concat(sb," .").concat(sb,` {
|
|
364
|
+
right: 0 `).concat(r,`;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.`).concat(ab," .").concat(ab,` {
|
|
368
|
+
margin-right: 0 `).concat(r,`;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
body[`).concat($u,`] {
|
|
372
|
+
`).concat(Dfe,": ").concat(a,`px;
|
|
373
|
+
}
|
|
374
|
+
`)},VM=function(){var e=parseInt(document.body.getAttribute($u)||"0",10);return isFinite(e)?e:0},Jfe=function(){P.useEffect(function(){return document.body.setAttribute($u,(VM()+1).toString()),function(){var e=VM()-1;e<=0?document.body.removeAttribute($u):document.body.setAttribute($u,e.toString())}},[])},ehe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;Jfe();var i=P.useMemo(function(){return Xfe(o)},[o]);return P.createElement(Qfe,{styles:Zfe(i,!t,o,n?"":"!important")})},qS=!1;if(typeof window<"u")try{var Pm=Object.defineProperty({},"passive",{get:function(){return qS=!0,!0}});window.addEventListener("test",Pm,Pm),window.removeEventListener("test",Pm,Pm)}catch{qS=!1}var hu=qS?{passive:!1}:!1,the=function(e){return e.tagName==="TEXTAREA"},K3=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!the(e)&&n[t]==="visible")},nhe=function(e){return K3(e,"overflowY")},rhe=function(e){return K3(e,"overflowX")},WM=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=X3(e,r);if(o){var i=Q3(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ohe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ihe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},X3=function(e,t){return e==="v"?nhe(t):rhe(t)},Q3=function(e,t){return e==="v"?ohe(t):ihe(t)},she=function(e,t){return e==="h"&&t==="rtl"?-1:1},ahe=function(e,t,n,r,o){var i=she(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),c=!1,u=s>0,d=0,p=0;do{var h=Q3(e,a),m=h[0],b=h[1],v=h[2],x=b-v-i*m;(m||x)&&X3(e,a)&&(d+=x,p+=m),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(p)<1)&&(c=!0),c},Tm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},UM=function(e){return[e.deltaX,e.deltaY]},GM=function(e){return e&&"current"in e?e.current:e},lhe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},che=function(e){return`
|
|
375
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
376
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
377
|
+
`)},uhe=0,pu=[];function dhe(e){var t=P.useRef([]),n=P.useRef([0,0]),r=P.useRef(),o=P.useState(uhe++)[0],i=P.useState(Y3)[0],s=P.useRef(e);P.useEffect(function(){s.current=e},[e]),P.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var b=Mfe([e.lockRef.current],(e.shards||[]).map(GM),!0).filter(Boolean);return b.forEach(function(v){return v.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),b.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=P.useCallback(function(b,v){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!s.current.allowPinchZoom;var x=Tm(b),w=n.current,_="deltaX"in b?b.deltaX:w[0]-x[0],R="deltaY"in b?b.deltaY:w[1]-x[1],C,E=b.target,A=Math.abs(_)>Math.abs(R)?"h":"v";if("touches"in b&&A==="h"&&E.type==="range")return!1;var M=WM(A,E);if(!M)return!0;if(M?C=A:(C=A==="v"?"h":"v",M=WM(A,E)),!M)return!1;if(!r.current&&"changedTouches"in b&&(_||R)&&(r.current=C),!C)return!0;var D=r.current||C;return ahe(D,v,b,D==="h"?_:R)},[]),l=P.useCallback(function(b){var v=b;if(!(!pu.length||pu[pu.length-1]!==i)){var x="deltaY"in v?UM(v):Tm(v),w=t.current.filter(function(C){return C.name===v.type&&(C.target===v.target||v.target===C.shadowParent)&&lhe(C.delta,x)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var _=(s.current.shards||[]).map(GM).filter(Boolean).filter(function(C){return C.contains(v.target)}),R=_.length>0?a(v,_[0]):!s.current.noIsolation;R&&v.cancelable&&v.preventDefault()}}},[]),c=P.useCallback(function(b,v,x,w){var _={name:b,delta:v,target:x,should:w,shadowParent:fhe(x)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(R){return R!==_})},1)},[]),u=P.useCallback(function(b){n.current=Tm(b),r.current=void 0},[]),d=P.useCallback(function(b){c(b.type,UM(b),b.target,a(b,e.lockRef.current))},[]),p=P.useCallback(function(b){c(b.type,Tm(b),b.target,a(b,e.lockRef.current))},[]);P.useEffect(function(){return pu.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,hu),document.addEventListener("touchmove",l,hu),document.addEventListener("touchstart",u,hu),function(){pu=pu.filter(function(b){return b!==i}),document.removeEventListener("wheel",l,hu),document.removeEventListener("touchmove",l,hu),document.removeEventListener("touchstart",u,hu)}},[]);var h=e.removeScrollBar,m=e.inert;return P.createElement(P.Fragment,null,m?P.createElement(i,{styles:che(o)}):null,h?P.createElement(ehe,{gapMode:e.gapMode}):null)}function fhe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const hhe=Bfe(q3,dhe);var kp=P.forwardRef(function(e,t){return P.createElement(yy,es({},e,{ref:t,sideCar:hhe}))});kp.classNames=yy.classNames;var phe=[" ","Enter","ArrowUp","ArrowDown"],ghe=[" ","Enter"],Ap="Select",[vy,xy,mhe]=A0(Ap),[Hd,pOe]=rr(Ap,[mhe,Ss]),wy=Ss(),[bhe,al]=Hd(Ap),[yhe,vhe]=Hd(Ap),Z3=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:p,required:h,form:m}=e,b=wy(t),[v,x]=P.useState(null),[w,_]=P.useState(null),[R,C]=P.useState(!1),E=Lc(c),[A=!1,M]=Dr({prop:r,defaultProp:o,onChange:i}),[D,L]=Dr({prop:s,defaultProp:a,onChange:l}),j=P.useRef(null),z=v?m||!!v.closest("form"):!0,[Q,G]=P.useState(new Set),F=Array.from(Q).map(H=>H.props.value).join(";");return y.jsx(Sp,{...b,children:y.jsxs(bhe,{required:h,scope:t,trigger:v,onTriggerChange:x,valueNode:w,onValueNodeChange:_,valueNodeHasChildren:R,onValueNodeHasChildrenChange:C,contentId:Yn(),value:D,onValueChange:L,open:A,onOpenChange:M,dir:E,triggerPointerDownPosRef:j,disabled:p,children:[y.jsx(vy.Provider,{scope:t,children:y.jsx(yhe,{scope:e.__scopeSelect,onNativeOptionAdd:P.useCallback(H=>{G($=>new Set($).add(H))},[]),onNativeOptionRemove:P.useCallback(H=>{G($=>{const V=new Set($);return V.delete(H),V})},[]),children:n})}),z?y.jsxs(C6,{"aria-hidden":!0,required:h,tabIndex:-1,name:u,autoComplete:d,value:D,onChange:H=>L(H.target.value),disabled:p,form:m,children:[D===void 0?y.jsx("option",{value:""}):null,Array.from(Q)]},F):null]})})};Z3.displayName=Ap;var J3="SelectTrigger",e6=P.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,i=wy(n),s=al(J3,n),a=s.disabled||r,l=st(t,s.onTriggerChange),c=xy(n),u=P.useRef("touch"),[d,p,h]=E6(b=>{const v=c().filter(_=>!_.disabled),x=v.find(_=>_.value===s.value),w=R6(v,b,x);w!==void 0&&s.onValueChange(w.value)}),m=b=>{a||(s.onOpenChange(!0),h()),b&&(s.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return y.jsx(zd,{asChild:!0,...i,children:y.jsx(je.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":_6(s.value)?"":void 0,...o,ref:l,onClick:Pe(o.onClick,b=>{b.currentTarget.focus(),u.current!=="mouse"&&m(b)}),onPointerDown:Pe(o.onPointerDown,b=>{u.current=b.pointerType;const v=b.target;v.hasPointerCapture(b.pointerId)&&v.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(m(b),b.preventDefault())}),onKeyDown:Pe(o.onKeyDown,b=>{const v=d.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&p(b.key),!(v&&b.key===" ")&&phe.includes(b.key)&&(m(),b.preventDefault())})})})});e6.displayName=J3;var t6="SelectValue",n6=P.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:s="",...a}=e,l=al(t6,n),{onValueNodeHasChildrenChange:c}=l,u=i!==void 0,d=st(t,l.onValueNodeChange);return yr(()=>{c(u)},[c,u]),y.jsx(je.span,{...a,ref:d,style:{pointerEvents:"none"},children:_6(l.value)?y.jsx(y.Fragment,{children:s}):i})});n6.displayName=t6;var xhe="SelectIcon",r6=P.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return y.jsx(je.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});r6.displayName=xhe;var whe="SelectPortal",o6=e=>y.jsx(Ep,{asChild:!0,...e});o6.displayName=whe;var Tc="SelectContent",i6=P.forwardRef((e,t)=>{const n=al(Tc,e.__scopeSelect),[r,o]=P.useState();if(yr(()=>{o(new DocumentFragment)},[]),!n.open){const i=r;return i?yc.createPortal(y.jsx(s6,{scope:e.__scopeSelect,children:y.jsx(vy.Slot,{scope:e.__scopeSelect,children:y.jsx("div",{children:e.children})})}),i):null}return y.jsx(a6,{...e,ref:t})});i6.displayName=Tc;var _i=10,[s6,ll]=Hd(Tc),She="SelectContentImpl",a6=P.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:p,collisionPadding:h,sticky:m,hideWhenDetached:b,avoidCollisions:v,...x}=e,w=al(Tc,n),[_,R]=P.useState(null),[C,E]=P.useState(null),A=st(t,Y=>R(Y)),[M,D]=P.useState(null),[L,j]=P.useState(null),z=xy(n),[Q,G]=P.useState(!1),F=P.useRef(!1);P.useEffect(()=>{if(_)return by(_)},[_]),gy();const H=P.useCallback(Y=>{const[J,...ie]=z().map(ae=>ae.ref.current),[de]=ie.slice(-1),he=document.activeElement;for(const ae of Y)if(ae===he||(ae==null||ae.scrollIntoView({block:"nearest"}),ae===J&&C&&(C.scrollTop=0),ae===de&&C&&(C.scrollTop=C.scrollHeight),ae==null||ae.focus(),document.activeElement!==he))return},[z,C]),$=P.useCallback(()=>H([M,_]),[H,M,_]);P.useEffect(()=>{Q&&$()},[Q,$]);const{onOpenChange:V,triggerPointerDownPosRef:X}=w;P.useEffect(()=>{if(_){let Y={x:0,y:0};const J=de=>{var he,ae;Y={x:Math.abs(Math.round(de.pageX)-(((he=X.current)==null?void 0:he.x)??0)),y:Math.abs(Math.round(de.pageY)-(((ae=X.current)==null?void 0:ae.y)??0))}},ie=de=>{Y.x<=10&&Y.y<=10?de.preventDefault():_.contains(de.target)||V(!1),document.removeEventListener("pointermove",J),X.current=null};return X.current!==null&&(document.addEventListener("pointermove",J),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",J),document.removeEventListener("pointerup",ie,{capture:!0})}}},[_,V,X]),P.useEffect(()=>{const Y=()=>V(!1);return window.addEventListener("blur",Y),window.addEventListener("resize",Y),()=>{window.removeEventListener("blur",Y),window.removeEventListener("resize",Y)}},[V]);const[I,q]=E6(Y=>{const J=z().filter(he=>!he.disabled),ie=J.find(he=>he.ref.current===document.activeElement),de=R6(J,Y,ie);de&&setTimeout(()=>de.ref.current.focus())}),U=P.useCallback((Y,J,ie)=>{const de=!F.current&&!ie;(w.value!==void 0&&w.value===J||de)&&(D(Y),de&&(F.current=!0))},[w.value]),O=P.useCallback(()=>_==null?void 0:_.focus(),[_]),ee=P.useCallback((Y,J,ie)=>{const de=!F.current&&!ie;(w.value!==void 0&&w.value===J||de)&&j(Y)},[w.value]),K=r==="popper"?YS:l6,oe=K===YS?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:h,sticky:m,hideWhenDetached:b,avoidCollisions:v}:{};return y.jsx(s6,{scope:n,content:_,viewport:C,onViewportChange:E,itemRefCallback:U,selectedItem:M,onItemLeave:O,itemTextRefCallback:ee,focusSelectedItem:$,selectedItemText:L,position:r,isPositioned:Q,searchRef:I,children:y.jsx(kp,{as:ta,allowPinchZoom:!0,children:y.jsx(Tp,{asChild:!0,trapped:w.open,onMountAutoFocus:Y=>{Y.preventDefault()},onUnmountAutoFocus:Pe(o,Y=>{var J;(J=w.trigger)==null||J.focus({preventScroll:!0}),Y.preventDefault()}),children:y.jsx(Bc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:Y=>Y.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:y.jsx(K,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:Y=>Y.preventDefault(),...x,...oe,onPlaced:()=>G(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:Pe(x.onKeyDown,Y=>{const J=Y.ctrlKey||Y.altKey||Y.metaKey;if(Y.key==="Tab"&&Y.preventDefault(),!J&&Y.key.length===1&&q(Y.key),["ArrowUp","ArrowDown","Home","End"].includes(Y.key)){let de=z().filter(he=>!he.disabled).map(he=>he.ref.current);if(["ArrowUp","End"].includes(Y.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(Y.key)){const he=Y.target,ae=de.indexOf(he);de=de.slice(ae+1)}setTimeout(()=>H(de)),Y.preventDefault()}})})})})})})});a6.displayName=She;var _he="SelectItemAlignedPosition",l6=P.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,i=al(Tc,n),s=ll(Tc,n),[a,l]=P.useState(null),[c,u]=P.useState(null),d=st(t,A=>u(A)),p=xy(n),h=P.useRef(!1),m=P.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:x,focusSelectedItem:w}=s,_=P.useCallback(()=>{if(i.trigger&&i.valueNode&&a&&c&&b&&v&&x){const A=i.trigger.getBoundingClientRect(),M=c.getBoundingClientRect(),D=i.valueNode.getBoundingClientRect(),L=x.getBoundingClientRect();if(i.dir!=="rtl"){const he=L.left-M.left,ae=D.left-he,ge=A.left-ae,ue=A.width+ge,Ee=Math.max(ue,M.width),Te=window.innerWidth-_i,Le=GS(ae,[_i,Math.max(_i,Te-Ee)]);a.style.minWidth=ue+"px",a.style.left=Le+"px"}else{const he=M.right-L.right,ae=window.innerWidth-D.right-he,ge=window.innerWidth-A.right-ae,ue=A.width+ge,Ee=Math.max(ue,M.width),Te=window.innerWidth-_i,Le=GS(ae,[_i,Math.max(_i,Te-Ee)]);a.style.minWidth=ue+"px",a.style.right=Le+"px"}const j=p(),z=window.innerHeight-_i*2,Q=b.scrollHeight,G=window.getComputedStyle(c),F=parseInt(G.borderTopWidth,10),H=parseInt(G.paddingTop,10),$=parseInt(G.borderBottomWidth,10),V=parseInt(G.paddingBottom,10),X=F+H+Q+V+$,I=Math.min(v.offsetHeight*5,X),q=window.getComputedStyle(b),U=parseInt(q.paddingTop,10),O=parseInt(q.paddingBottom,10),ee=A.top+A.height/2-_i,K=z-ee,oe=v.offsetHeight/2,Y=v.offsetTop+oe,J=F+H+Y,ie=X-J;if(J<=ee){const he=j.length>0&&v===j[j.length-1].ref.current;a.style.bottom="0px";const ae=c.clientHeight-b.offsetTop-b.offsetHeight,ge=Math.max(K,oe+(he?O:0)+ae+$),ue=J+ge;a.style.height=ue+"px"}else{const he=j.length>0&&v===j[0].ref.current;a.style.top="0px";const ge=Math.max(ee,F+b.offsetTop+(he?U:0)+oe)+ie;a.style.height=ge+"px",b.scrollTop=J-ee+b.offsetTop}a.style.margin=`${_i}px 0`,a.style.minHeight=I+"px",a.style.maxHeight=z+"px",r==null||r(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,a,c,b,v,x,i.dir,r]);yr(()=>_(),[_]);const[R,C]=P.useState();yr(()=>{c&&C(window.getComputedStyle(c).zIndex)},[c]);const E=P.useCallback(A=>{A&&m.current===!0&&(_(),w==null||w(),m.current=!1)},[_,w]);return y.jsx(Ehe,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:h,onScrollButtonChange:E,children:y.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:R},children:y.jsx(je.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});l6.displayName=_he;var Che="SelectPopperPosition",YS=P.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=_i,...i}=e,s=wy(n);return y.jsx(_p,{...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)"}})});YS.displayName=Che;var[Ehe,YE]=Hd(Tc,{}),KS="SelectViewport",c6=P.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,i=ll(KS,n),s=YE(KS,n),a=st(t,i.onViewportChange),l=P.useRef(0);return y.jsxs(y.Fragment,{children:[y.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}),y.jsx(vy.Slot,{scope:n,children:y.jsx(je.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Pe(o.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:p}=s;if(p!=null&&p.current&&d){const h=Math.abs(l.current-u.scrollTop);if(h>0){const m=window.innerHeight-_i*2,b=parseFloat(d.style.minHeight),v=parseFloat(d.style.height),x=Math.max(b,v);if(x<m){const w=x+h,_=Math.min(m,w),R=w-_;d.style.height=_+"px",d.style.bottom==="0px"&&(u.scrollTop=R>0?R:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});c6.displayName=KS;var u6="SelectGroup",[Rhe,Phe]=Hd(u6),d6=P.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Yn();return y.jsx(Rhe,{scope:n,id:o,children:y.jsx(je.div,{role:"group","aria-labelledby":o,...r,ref:t})})});d6.displayName=u6;var f6="SelectLabel",h6=P.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Phe(f6,n);return y.jsx(je.div,{id:o.id,...r,ref:t})});h6.displayName=f6;var e0="SelectItem",[The,p6]=Hd(e0),g6=P.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...s}=e,a=al(e0,n),l=ll(e0,n),c=a.value===r,[u,d]=P.useState(i??""),[p,h]=P.useState(!1),m=st(t,w=>{var _;return(_=l.itemRefCallback)==null?void 0:_.call(l,w,r,o)}),b=Yn(),v=P.useRef("touch"),x=()=>{o||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return y.jsx(The,{scope:n,value:r,disabled:o,textId:b,isSelected:c,onItemTextChange:P.useCallback(w=>{d(_=>_||((w==null?void 0:w.textContent)??"").trim())},[]),children:y.jsx(vy.ItemSlot,{scope:n,value:r,disabled:o,textValue:u,children:y.jsx(je.div,{role:"option","aria-labelledby":b,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...s,ref:m,onFocus:Pe(s.onFocus,()=>h(!0)),onBlur:Pe(s.onBlur,()=>h(!1)),onClick:Pe(s.onClick,()=>{v.current!=="mouse"&&x()}),onPointerUp:Pe(s.onPointerUp,()=>{v.current==="mouse"&&x()}),onPointerDown:Pe(s.onPointerDown,w=>{v.current=w.pointerType}),onPointerMove:Pe(s.onPointerMove,w=>{var _;v.current=w.pointerType,o?(_=l.onItemLeave)==null||_.call(l):v.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Pe(s.onPointerLeave,w=>{var _;w.currentTarget===document.activeElement&&((_=l.onItemLeave)==null||_.call(l))}),onKeyDown:Pe(s.onKeyDown,w=>{var R;((R=l.searchRef)==null?void 0:R.current)!==""&&w.key===" "||(ghe.includes(w.key)&&x(),w.key===" "&&w.preventDefault())})})})})});g6.displayName=e0;var Qf="SelectItemText",m6=P.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...i}=e,s=al(Qf,n),a=ll(Qf,n),l=p6(Qf,n),c=vhe(Qf,n),[u,d]=P.useState(null),p=st(t,x=>d(x),l.onItemTextChange,x=>{var w;return(w=a.itemTextRefCallback)==null?void 0:w.call(a,x,l.value,l.disabled)}),h=u==null?void 0:u.textContent,m=P.useMemo(()=>y.jsx("option",{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:b,onNativeOptionRemove:v}=c;return yr(()=>(b(m),()=>v(m)),[b,v,m]),y.jsxs(y.Fragment,{children:[y.jsx(je.span,{id:l.textId,...i,ref:p}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?yc.createPortal(i.children,s.valueNode):null]})});m6.displayName=Qf;var b6="SelectItemIndicator",y6=P.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return p6(b6,n).isSelected?y.jsx(je.span,{"aria-hidden":!0,...r,ref:t}):null});y6.displayName=b6;var XS="SelectScrollUpButton",v6=P.forwardRef((e,t)=>{const n=ll(XS,e.__scopeSelect),r=YE(XS,e.__scopeSelect),[o,i]=P.useState(!1),s=st(t,r.onScrollButtonChange);return yr(()=>{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?y.jsx(w6,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});v6.displayName=XS;var QS="SelectScrollDownButton",x6=P.forwardRef((e,t)=>{const n=ll(QS,e.__scopeSelect),r=YE(QS,e.__scopeSelect),[o,i]=P.useState(!1),s=st(t,r.onScrollButtonChange);return yr(()=>{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?y.jsx(w6,{...e,ref:s,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});x6.displayName=QS;var w6=P.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,i=ll("SelectScrollButton",n),s=P.useRef(null),a=xy(n),l=P.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return P.useEffect(()=>()=>l(),[l]),yr(()=>{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]),y.jsx(je.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Pe(o.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(r,50))}),onPointerMove:Pe(o.onPointerMove,()=>{var c;(c=i.onItemLeave)==null||c.call(i),s.current===null&&(s.current=window.setInterval(r,50))}),onPointerLeave:Pe(o.onPointerLeave,()=>{l()})})}),khe="SelectSeparator",S6=P.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return y.jsx(je.div,{"aria-hidden":!0,...r,ref:t})});S6.displayName=khe;var ZS="SelectArrow",Ahe=P.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=wy(n),i=al(ZS,n),s=ll(ZS,n);return i.open&&s.position==="popper"?y.jsx(Cp,{...o,...r,ref:t}):null});Ahe.displayName=ZS;function _6(e){return e===""||e===void 0}var C6=P.forwardRef((e,t)=>{const{value:n,...r}=e,o=P.useRef(null),i=st(t,o),s=my(n);return P.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]),y.jsx(LE,{asChild:!0,children:y.jsx("select",{...r,ref:i,defaultValue:n})})});C6.displayName="BubbleSelect";function E6(e){const t=tr(e),n=P.useRef(""),r=P.useRef(0),o=P.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=P.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return P.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function R6(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=Ohe(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 Ohe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Mhe=Z3,P6=e6,Ihe=n6,Dhe=r6,Nhe=o6,T6=i6,Lhe=c6,Fhe=d6,k6=h6,A6=g6,jhe=m6,$he=y6,O6=v6,M6=x6,I6=S6;const Hs=Mhe,xu=Fhe,Vs=Ihe,Ui=P.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(P6,{ref:r,className:me("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,y.jsx(Dhe,{asChild:!0,children:y.jsx(bp,{className:"h-4 w-4 opacity-50"})})]}));Ui.displayName=P6.displayName;const D6=P.forwardRef(({className:e,...t},n)=>y.jsx(O6,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:y.jsx(aL,{className:"h-4 w-4"})}));D6.displayName=O6.displayName;const N6=P.forwardRef(({className:e,...t},n)=>y.jsx(M6,{ref:n,className:me("flex cursor-default items-center justify-center py-1",e),...t,children:y.jsx(bp,{className:"h-4 w-4"})}));N6.displayName=M6.displayName;const Gi=P.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>y.jsx(Nhe,{children:y.jsx(Nc,{children:y.jsxs(T6,{ref:o,className:me("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:[y.jsx(D6,{}),y.jsx(Lhe,{className:me("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),y.jsx(N6,{})]})})}));Gi.displayName=T6.displayName;const Fl=P.forwardRef(({className:e,...t},n)=>y.jsx(k6,{ref:n,className:me("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Fl.displayName=k6.displayName;const In=P.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(A6,{ref:r,className:me("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:[y.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:y.jsx($he,{children:y.jsx(Id,{className:"h-4 w-4"})})}),y.jsx(jhe,{children:t})]}));In.displayName=A6.displayName;const gh=P.forwardRef(({className:e,...t},n)=>y.jsx(I6,{ref:n,className:me("-mx-1 my-1 h-px bg-muted",e),...t}));gh.displayName=I6.displayName;const hc=P.forwardRef(({className:e,type:t,...n},r)=>y.jsx("input",{type:t,className:me("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}));hc.displayName="Input";var zhe="Label",L6=P.forwardRef((e,t)=>y.jsx(je.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));L6.displayName=zhe;var F6=L6;const Bhe=zE("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),wn=P.forwardRef(({className:e,...t},n)=>y.jsx(F6,{ref:n,className:me(Bhe(),e),...t}));wn.displayName=F6.displayName;var KE="Popover",[j6,gOe]=rr(KE,[Ss]),Op=Ss(),[Hhe,cl]=j6(KE),$6=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,a=Op(t),l=P.useRef(null),[c,u]=P.useState(!1),[d=!1,p]=Dr({prop:r,defaultProp:o,onChange:i});return y.jsx(Sp,{...a,children:y.jsx(Hhe,{scope:t,contentId:Yn(),triggerRef:l,open:d,onOpenChange:p,onOpenToggle:P.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:c,onCustomAnchorAdd:P.useCallback(()=>u(!0),[]),onCustomAnchorRemove:P.useCallback(()=>u(!1),[]),modal:s,children:n})})};$6.displayName=KE;var z6="PopoverAnchor",Vhe=P.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=cl(z6,n),i=Op(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:a}=o;return P.useEffect(()=>(s(),()=>a()),[s,a]),y.jsx(zd,{...i,...r,ref:t})});Vhe.displayName=z6;var B6="PopoverTrigger",H6=P.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=cl(B6,n),i=Op(n),s=st(t,o.triggerRef),a=y.jsx(je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":q6(o.open),...r,ref:s,onClick:Pe(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?a:y.jsx(zd,{asChild:!0,...i,children:a})});H6.displayName=B6;var XE="PopoverPortal",[Whe,Uhe]=j6(XE,{forceMount:void 0}),V6=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=cl(XE,t);return y.jsx(Whe,{scope:t,forceMount:n,children:y.jsx(Kn,{present:n||i.open,children:y.jsx(Ep,{asChild:!0,container:o,children:r})})})};V6.displayName=XE;var Cd="PopoverContent",W6=P.forwardRef((e,t)=>{const n=Uhe(Cd,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=cl(Cd,e.__scopePopover);return y.jsx(Kn,{present:r||i.open,children:i.modal?y.jsx(Ghe,{...o,ref:t}):y.jsx(qhe,{...o,ref:t})})});W6.displayName=Cd;var Ghe=P.forwardRef((e,t)=>{const n=cl(Cd,e.__scopePopover),r=P.useRef(null),o=st(t,r),i=P.useRef(!1);return P.useEffect(()=>{const s=r.current;if(s)return by(s)},[]),y.jsx(kp,{as:ta,allowPinchZoom:!0,children:y.jsx(U6,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),i.current||(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Pe(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:Pe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),qhe=P.forwardRef((e,t)=>{const n=cl(Cd,e.__scopePopover),r=P.useRef(!1),o=P.useRef(!1);return y.jsx(U6,{...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()}})}),U6=P.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...d}=e,p=cl(Cd,n),h=Op(n);return gy(),y.jsx(Tp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:y.jsx(Bc,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>p.onOpenChange(!1),children:y.jsx(_p,{"data-state":q6(p.open),role:"dialog",id:p.contentId,...h,...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)"}})})})}),G6="PopoverClose",Yhe=P.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=cl(G6,n);return y.jsx(je.button,{type:"button",...r,ref:t,onClick:Pe(e.onClick,()=>o.onOpenChange(!1))})});Yhe.displayName=G6;var Khe="PopoverArrow",Xhe=P.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Op(n);return y.jsx(Cp,{...o,...r,ref:t})});Xhe.displayName=Khe;function q6(e){return e?"open":"closed"}var Qhe=$6,Zhe=H6,Jhe=V6,Y6=W6;const Sy=Qhe,_y=Zhe,Mp=P.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>y.jsx(Jhe,{children:y.jsx(Nc,{children:y.jsx(Y6,{ref:o,align:t,sideOffset:n,className:me("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})})}));Mp.displayName=Y6.displayName;function epe(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 K6({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 y.jsxs("div",{className:"space-y-3",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx(wn,{children:"Color Range"}),y.jsx(nr,{onClick:i,variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:y.jsx(q0,{className:"size-3"})})]}),e.map((s,a)=>y.jsxs("div",{className:"flex items-center gap-2 px-2",children:[y.jsx(hc,{onChange:l=>r(a,"start",l.target.value),value:s.start,className:me(`h-7 ${nh}`)}),y.jsx("span",{children:"-"}),y.jsx(hc,{value:s.end,onChange:l=>r(a,"end",l.target.value),className:me(`h-7 ${nh}`)}),y.jsx(hc,{onChange:l=>r(a,"color",l.target.value),value:s.color,className:me(`h-7 min-w-14 p-0 ${nh}`),type:"color",list:"presetColors"}),y.jsxs("datalist",{id:"presetColors",children:[y.jsx("option",{children:$t.green[600]}),y.jsx("option",{children:$t.red[500]}),y.jsx("option",{children:$t.yellow[400]}),y.jsx("option",{children:$t.orange[500]})]}),y.jsx(nr,{onClick:()=>o(a),variant:"secondary",className:"h-5 p-1 text-muted-foreground",children:y.jsx($c,{className:"size-3"})})]},a))]})}var tpe="Toggle",X6=P.forwardRef((e,t)=>{const{pressed:n,defaultPressed:r=!1,onPressedChange:o,...i}=e,[s=!1,a]=Dr({prop:n,onChange:o,defaultProp:r});return y.jsx(je.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:Pe(e.onClick,()=>{e.disabled||a(!s)})})});X6.displayName=tpe;var Q6=X6;const npe=zE("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"}}),Cy=P.forwardRef(({className:e,variant:t,size:n,...r},o)=>y.jsx(Q6,{ref:o,className:me(npe({variant:t,size:n,className:e})),...r}));Cy.displayName=Q6.displayName;function rpe(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 ope(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 ipe(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 spe(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 ape(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 lpe(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 cpe(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 upe(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 dpe(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 fpe({columnIndex:e,columnName:t}){const[n,r]=T.useState(!1),o=go(H=>{var $;return($=H.card)==null?void 0:$.preferences}),[i,s]=T.useState(rpe(o,e)),[a,l]=T.useState(upe(o,e)),[c,u]=T.useState(dpe(o,e)),[d,p]=T.useState(lpe(o,e)),[h,m]=T.useState(ope(o,e)),[b,v]=T.useState(ipe(o,e)),[x,w]=T.useState(spe(o,e)),[_,R]=T.useState(ape(o,e).toString()),[C,E]=T.useState(cpe(o,e)),[A,M]=T.useState(""),D=go(H=>H.actions.setCardPreferences);function L(){return y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[y.jsx(wn,{className:"col-span-3",htmlFor:"format",children:"Text Align"}),y.jsxs(Hs,{value:a||"left",onValueChange:H=>l(H),children:[y.jsx(Ui,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Vs,{})}),y.jsxs(Gi,{children:[y.jsx(In,{value:"left",children:"Left"}),y.jsx(In,{value:"center",children:"Center"}),y.jsx(In,{value:"right",children:"Right"})]})]})]}),y.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[y.jsx(wn,{className:"col-span-3",htmlFor:"format",children:"Width (px)"}),y.jsx(hc,{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 j(){const H=[...new Set(S1.map($=>$.currency))];return y.jsx(y.Fragment,{children:y.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[y.jsx(wn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),y.jsxs(Hs,{value:h,onValueChange:$=>m($),children:[y.jsx(Ui,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Vs,{})}),y.jsx(Gi,{children:y.jsxs(xu,{children:[y.jsx(Fl,{children:"Locale"}),S1.map($=>y.jsx(In,{value:$.locale,children:$.locale},$.locale))]})})]}),y.jsx(wn,{className:"col-span-3",htmlFor:"format",children:"Currency"}),y.jsxs(Hs,{value:x||"none",onValueChange:$=>w($==="none"?void 0:$),children:[y.jsx(Ui,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Vs,{})}),y.jsx(Gi,{children:y.jsxs(xu,{children:[y.jsx(Fl,{children:"Currency"}),y.jsx(In,{value:"none",children:"None"}),H.map($=>y.jsx(In,{value:$,children:$},$))]})})]}),y.jsx(wn,{className:"col-span-3",htmlFor:"format",children:"Decimals"}),y.jsxs(Hs,{value:_,onValueChange:$=>R($),children:[y.jsx(Ui,{className:"col-span-3 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Vs,{})}),y.jsx(Gi,{children:["0","1","2","3","4"].map($=>y.jsx(In,{value:$,children:$},$))})]}),!x&&y.jsx(Cy,{onPressedChange:$=>E($),variant:"outline",size:"sm",className:"col-span-3 h-8","aria-label":"Toggle italic",children:y.jsx(vL,{className:"size-3"})})]})})}function z(){return y.jsx(y.Fragment,{children:y.jsxs("div",{className:"grid grid-cols-9 items-center gap-2",children:[y.jsx(wn,{className:"col-span-3",htmlFor:"format",children:"Locale"}),y.jsxs(Hs,{defaultValue:"en-US",value:h,onValueChange:H=>m(H),children:[y.jsx(Ui,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Vs,{})}),y.jsx(Gi,{children:nX.map(H=>y.jsxs(xu,{children:[y.jsx(Fl,{children:H.label}),H.locales.map($=>y.jsx(In,{value:$.code,children:$.name},$.code))]},H.label))})]}),y.jsx(wn,{className:"col-span-3",htmlFor:"format",children:"Format"}),y.jsxs(Hs,{defaultValue:"short-date-time",value:b,onValueChange:H=>{console.log("format",H),v(H)},children:[y.jsx(Ui,{className:"col-span-6 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Vs,{})}),y.jsx(Gi,{className:"",id:"type",children:y.jsxs(xu,{children:[y.jsx(Fl,{children:"Option"}),y.jsx(In,{value:"full-date-time",children:"Full Date-Time"}),y.jsx(In,{value:"short-date-time",children:"Short Date-Time"}),y.jsx(In,{value:"hours-date-time",children:"24-Hour Date-Time"}),y.jsx(In,{value:"short-date",children:"Short Date"}),y.jsx(In,{value:"long-date",children:"Long Date"})]})})]})]})})}function Q(){D({...o,columnSettings:[]})}function G(){var H;D({...o,columnSettings:[...((H=o==null?void 0:o.columnSettings)==null?void 0:H.filter($=>$.columnIdx!==e))||[]]})}function F(){var H,$,V,X;if(i==="date"){const I=epe(h,b),q={columnIdx:e,type:i,options:I};D({...o,columnSettings:[...((H=o==null?void 0:o.columnSettings)==null?void 0:H.filter(U=>U.columnIdx!==e))||[],q]})}else if(i==="number"){let I;x?I={locale:h,currency:x,options:{style:"currency",currency:x,minimumFractionDigits:Number(_)},colorRanges:d.length>0?d:void 0}:I={locale:h,currency:void 0,options:{style:C?"percent":"decimal",minimumFractionDigits:Number(_)},colorRanges:d.length>0?d:void 0};const q={columnIdx:e,type:i,textAlign:a,width:c,options:I};D({...o,columnSettings:[...(($=o==null?void 0:o.columnSettings)==null?void 0:$.filter(U=>U.columnIdx!==e))||[],q]})}else if(i==="html"){const I={columnIdx:e,type:i,options:{html:""}};D({...o,columnSettings:[...((V=o==null?void 0:o.columnSettings)==null?void 0:V.filter(q=>q.columnIdx!==e))||[],I]})}else{const I={columnIdx:e,type:"none",textAlign:a,width:c,options:{}};D({...o,columnSettings:[...((X=o==null?void 0:o.columnSettings)==null?void 0:X.filter(q=>q.columnIdx!==e))||[],I]})}}return y.jsxs(Sy,{onOpenChange:H=>r(H),children:[y.jsx(_y,{asChild:!0,children:y.jsx(yL,{className:"size-3 cursor-pointer text-muted"})}),y.jsx(Mp,{align:"center",className:"max-w-70 z-20",children:y.jsxs("div",{className:"grid gap-4",children:[y.jsxs("div",{className:"space-y-2",children:[y.jsx("h4",{className:"font-medium leading-none",children:"Display Settings"}),y.jsx("p",{className:"text-sm text-muted-foreground",children:`Display setting for '${t}'`})]}),y.jsxs("div",{className:"grid gap-2",children:[y.jsxs("div",{className:"grid grid-cols-3 items-center gap-2",children:[y.jsx(wn,{htmlFor:"scale",children:"Type"}),y.jsxs(Hs,{value:i||"none",onValueChange:H=>s(H),children:[y.jsx(Ui,{className:"col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0",children:y.jsx(Vs,{})}),y.jsx(Gi,{id:"type",children:y.jsxs(xu,{children:[y.jsx(Fl,{children:"Option"}),y.jsx(In,{value:"number",children:"Number"}),y.jsx(In,{value:"date",children:"Date"}),y.jsx(In,{value:"html",children:"HTML"}),y.jsx(In,{value:"none",children:"None"})]})})]})]}),L(),y.jsx(gh,{}),i==="number"&&j(),i==="date"&&z(),i==="number"&&y.jsxs(y.Fragment,{children:[y.jsx(gh,{}),y.jsx(K6,{colorRanges:d,setColorRanges:p})]}),y.jsx(gh,{}),y.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[y.jsx(nr,{onClick:Q,variant:"secondary",className:"col-span-1 col-start-1 h-8 w-full text-destructive",children:"Reset All"}),y.jsx(nr,{onClick:G,variant:"secondary",className:"col-span-1 col-start-2 h-8 w-full",children:"Reset"}),y.jsx(nr,{onClick:F,variant:"secondary",className:"col-span-1 col-start-3 h-8 w-full",children:"Apply"})]})]})]})})]})}function hpe(e){const t=new Date(e);return!isNaN(t.getTime())}function Z6({data:e,card:t}){var R,C,E,A;const[n,r]=T.useState([]),{keys:o}=lr(e),i=ye(M=>M.filteringCards),s=ye(M=>M.themeStyle),a=ye(M=>M.isVisualEditing),l=i==null?void 0:i.find(M=>M.id===t.id),c=(R=t==null?void 0:t.preferences)==null?void 0:R.onClickFilter,{addOrUpdateFilterValues:u,addFilteringCard:d,removeFilterValues:p,removeFilteringCard:h}=Hn(),m=t==null?void 0:t.preferences;function b(M,D){if((D==null?void 0:D.type)==="date"&&hpe(M)){const{locale:L,options:j}=D.options,z=new Date(M);return new Date(z.getTime()).toLocaleDateString(L,j)}if((D==null?void 0:D.type)==="number"){const{locale:L,currency:j,options:z}=D.options;return j?new Intl.NumberFormat(L,{style:"currency",currency:j,...z}).format(M):new Intl.NumberFormat(L,z).format(M)}if((D==null?void 0:D.type)==="html"){const L=$S.sanitize(M);return y.jsx("div",{className:"hover:underline",dangerouslySetInnerHTML:{__html:L}})}return M}const v=o.map((M,D)=>({accessorKey:M,header:({column:L})=>{var $;const j=L.getIsSorted(),z=D,Q=($=m==null?void 0:m.columnSettings)==null?void 0:$.find(V=>V.columnIdx===z),G=Q==null?void 0:Q.textAlign,F=Q==null?void 0:Q.width,H=F?{width:F}:{};return y.jsxs("div",{className:"flex w-full items-center justify-between gap-2",children:[y.jsxs("div",{className:me("flex grow cursor-pointer items-center",{"justify-center":G==="center","justify-end":G==="right","justify-start":G==="left"}),style:H,onClick:()=>L.toggleSorting(L.getIsSorted()==="asc"),children:[M,j==="asc"?y.jsx(rL,{className:"ml-2 h-5 w-5"}):j==="desc"?y.jsx(nL,{className:"ml-2 h-5 w-5"}):null]}),y.jsx("div",{className:"opacity-0 group-hover:opacity-100",children:a&&y.jsx(fpe,{columnName:L.id,columnIndex:D})})]})},cell:({cell:L})=>{var H,$;const j=L.getValue(),z=(H=m==null?void 0:m.columnSettings)==null?void 0:H.find(V=>V.columnIdx===D),Q=b(j,z),G=GC(j,($=z==null?void 0:z.options)==null?void 0:$.colorRanges),F=z==null?void 0:z.textAlign;return z!=null&&z.width&&z.width,y.jsx("p",{title:Q,className:me("overflow-auto px-2 py-1",{"text-center":F==="center","text-right":F==="right","text-left":F==="left"}),style:{backgroundColor:G},children:Q})}})),x=H3({data:e,columns:v,getCoreRowModel:$3(),getPaginationRowModel:z3(),onSortingChange:r,getSortedRowModel:B3(),manualPagination:!0,state:{sorting:n}}),w=x.getSelectedRowModel().rows;T.useEffect(()=>{if(w.length===0){if(l){const M=t.id;p(M),h(t)}return}if(c){const{dimensionKeys:M}=lr(e),D=c.map(L=>{const j=M==null?void 0:M[L.columnIndex],z=w.map(G=>G.getValue(j));return{filterId:t.id+"-"+j,connectionId:t==null?void 0:t.connectionId,tableName:t.lastSelectedTable,name:j,expression:L.expression,valueType:E0(z[0]===void 0?"":z[0]),operation:"in",values:z}});u(D),d(t)}},[d,u,t,e,l,c,p,h,w]);function _(M){M.toggleSelected()}return y.jsx("div",{className:"rounded-md text-sm text-foreground/80",style:{borderTopRightRadius:(C=s==null?void 0:s.chart)==null?void 0:C.options.borderRadius,borderTopLeftRadius:(E=s==null?void 0:s.chart)==null?void 0:E.options.borderRadius},children:y.jsxs("table",{className:"w-full",onMouseDown:M=>M.stopPropagation(),children:[y.jsx(BE,{className:"group",children:x.getHeaderGroups().map(M=>y.jsx(hh,{children:M.headers.map((D,L)=>{var j,z,Q,G,F,H,$;return y.jsx(VE,{style:{backgroundColor:(Q=(z=(j=s==null?void 0:s.chart)==null?void 0:j.dataset)==null?void 0:z.backgroundColor)==null?void 0:Q[0],color:ad((H=(F=(G=s==null?void 0:s.chart)==null?void 0:G.dataset)==null?void 0:F.backgroundColor)==null?void 0:H[0])},className:me("sticky -top-[1px] h-9 bg-muted-foreground px-2 text-background",{"border-x":L>0&&L<M.headers.length-1,"border-l":L===1&&M.headers.length==2},($=s==null?void 0:s.table)==null?void 0:$.tableHeaderColor),children:D.isPlaceholder?null:US(D.column.columnDef.header,D.getContext())},D.id)})},M.id))}),y.jsx(HE,{children:(A=x.getRowModel().rows)!=null&&A.length?x.getRowModel().rows.map((M,D)=>y.jsx(hh,{onClick:()=>_(M),className:me("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":M.getIsSelected()&&"selected",children:M.getVisibleCells().map((L,j)=>{var F,H;const z=(F=m==null?void 0:m.columnSettings)==null?void 0:F.find($=>$.columnIdx===j),Q=z==null?void 0:z.width,G=Q?{width:Q,maxWidth:Q}:{};return y.jsx("td",{style:G,onClick:$=>{var X;const V=((X=window==null?void 0:window.getSelection())==null?void 0:X.toString())||"";(V==null?void 0:V.length)>0&&$.stopPropagation()},className:me("",{"border-x":j>0&&j<v.length-1||j===1&&v.length==2,"border-l":j==0,"border-r":j===v.length-1,"border-b":D===((H=x.getRowModel().rows)==null?void 0:H.length)-1}),children:US(L.column.columnDef.cell,L.getContext())},L.id)})},M.id)):y.jsx(hh,{children:y.jsx(WE,{colSpan:v.length,className:"p-1 text-center",children:"No results."})})})]})})}async function ppe(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 gpe(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 J6(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 ej=e=>{const[t,n]=T.useState([]),[r,o]=T.useState(!1),[i,s]=T.useState(null);T.useEffect(()=>{window.React=T,window.ReactDOM=Ar,o(!0)},[]),T.useEffect(()=>{e&&r&&J6(e).then(c=>{n(c.visuals),s(c)}).catch(()=>{gpe(e).then(c=>{console.log("componentNames",c),n(c)}).catch(c=>{console.error("Error loading manifest:",c)})})},[e,r]);const a=T.useMemo(()=>(t==null?void 0:t.map(c=>{const{name:u,component:d,dataInputs:p}=c;return{name:u,componentName:d,Component:T.lazy(()=>ppe(e,d)),type:p&&p.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 tj({onLoadingStatus:e,onDataChange:t,card:n}){const{isFetching:r,isLoading:o,data:i,queryKey:s}=Ga(n),a=JSON.stringify(s);return T.useEffect(()=>{e==null||e(o)},[r,o,e]),T.useEffect(()=>{t(n.id,(i==null?void 0:i.records)||[])},[i==null?void 0:i.records,n.id,a,t]),y.jsx(y.Fragment,{})}function mpe({card:e,frame:t}){var w,_,R,C,E,A,M,D;const[n,r]=T.useState([]),{authToken:o}=Go(),i=kN(o==null?void 0:o.accessToken),s=ye(L=>L.themeStyle),a={colors:((_=(w=s==null?void 0:s.chart)==null?void 0:w.dataset)==null?void 0:_.backgroundColor)||[]},[l,c]=T.useState(!1),{getCard:u}=ej(((R=e.customCardPreferences)==null?void 0:R.url)||""),d=((C=e.customCardPreferences)==null?void 0:C.visualType)||"single",p=(E=e.customCardPreferences)==null?void 0:E.componentName,{data:h}=Ga(e),m=T.useCallback((L,j)=>{r(z=>({...z,[L]:j}))},[]);if(!p)return null;const b=u(p),v=Object.keys(((A=e.customCardPreferences)==null?void 0:A.dataInputCardIds)||{}).map(L=>{var Q,G,F;const j=(G=(Q=e.customCardPreferences)==null?void 0:Q.dataInputCardIds)==null?void 0:G[L].cardId,z=(F=t==null?void 0:t.cards)==null?void 0:F.find(H=>H.id===j);return z||null});function x(L){c(L)}return y.jsx("div",{className:"semaphor-custom mb-3 flex grow basis-0 flex-col space-y-2 overflow-y-auto",children:y.jsxs(T.Suspense,{fallback:y.jsx(y.Fragment,{}),children:[b&&d==="single"&&y.jsx(b,{params:i,theme:a,settings:(M=e.customCardPreferences)==null?void 0:M.settings,onDataChange:m,data:(h==null?void 0:h.records)||[]}),b&&d==="multiple"&&y.jsxs("div",{children:[Object.keys(((D=e.customCardPreferences)==null?void 0:D.dataInputCardIds)||{}).map(L=>{var Q,G,F;const j=(G=(Q=e.customCardPreferences)==null?void 0:Q.dataInputCardIds)==null?void 0:G[L].cardId,z=(F=t==null?void 0:t.cards)==null?void 0:F.find(H=>H.id===j);if(z)return y.jsx(tj,{onLoadingStatus:x,onDataChange:m,dataInputIndex:L,card:z},z.id+L)}),d==="multiple"&&y.jsx("div",{className:me("flex flex-col gap-2",{"opacity-50":l}),children:y.jsx(b,{params:i,theme:a,onDataChange:m,settings:v.map(L=>{var j;return(j=L==null?void 0:L.customCardPreferences)==null?void 0:j.settings}),data:v.map(L=>L!=null&&L.id?n==null?void 0:n[L.id]:[])})})]})]},e.id)})}/*!
|
|
378
|
+
* chartjs-plugin-datalabels v2.2.0
|
|
379
|
+
* https://chartjs-plugin-datalabels.netlify.app
|
|
380
|
+
* (c) 2017-2022 chartjs-plugin-datalabels contributors
|
|
381
|
+
* Released under the MIT license
|
|
382
|
+
*/var qM=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}(),mh={toTextLines:function(e){var t=[],n;for(e=[].concat(e);e.length;)n=e.pop(),typeof n=="string"?t.unshift.apply(t,n.split(`
|
|
383
|
+
`)):Array.isArray(n)?e.push.apply(e,n):ht(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*qM)/qM}};function _w(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 bpe(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 ype=0,nj=1,rj=2,oj=4,ij=8;function km(e,t,n){var r=ype;return e<n.left?r|=nj:e>n.right&&(r|=rj),t<n.top?r|=ij:t>n.bottom&&(r|=oj),r}function vpe(e,t){for(var n=e.x0,r=e.y0,o=e.x1,i=e.y1,s=km(n,r,t),a=km(o,i,t),l,c,u;!(!(s|a)||s&a);)l=s||a,l&ij?(c=n+(o-n)*(t.top-r)/(i-r),u=t.top):l&oj?(c=n+(o-n)*(t.bottom-r)/(i-r),u=t.bottom):l&rj?(u=r+(i-r)*(t.right-n)/(o-n),c=t.right):l&nj&&(u=r+(i-r)*(t.left-n)/(o-n),c=t.left),l===s?(n=c,r=u,s=km(n,r,t)):(o=c,i=u,a=km(o,i,t));return{x0:n,x1:o,y0:r,y1:i}}function Am(e,t){var n=t.anchor,r=e,o,i;return t.clamp&&(r=vpe(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),bpe(o,i,e.vx,e.vy,t.align)}var Om={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 Am({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=_w(e,t.origin),r=n.x*e.options.radius,o=n.y*e.options.radius;return Am({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=_w(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)),Am({x0:r,y0:o+s,x1:r+i,y1:o,vx:n.x,vy:n.y},t)},fallback:function(e,t){var n=_w(e,t.origin);return Am({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)}},Js=mh.rasterize;function xpe(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 wpe(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 Spe(e){return e instanceof Cu?Om.arc:e instanceof cc?Om.point:e instanceof uc?Om.bar:Om.fallback}function _pe(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 Cpe(e,t,n){var r=n.backgroundColor,o=n.borderColor,i=n.borderWidth;!r&&(!o||!i)||(e.beginPath(),_pe(e,Js(t.x)+i/2,Js(t.y)+i/2,Js(t.w)-i,Js(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 Epe(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 Rpe(e,t,n){var r=e.shadowBlur,o=n.stroked,i=Js(n.x),s=Js(n.y),a=Js(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 Ppe(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,p;if(!(!l||!s&&!d))for(n=Epe(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),p=0,l=t.length;p<l;++p)Rpe(e,t[p],{stroked:d,filled:s,w:n.w,x:n.x,y:n.y+n.h*p})}var sj=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};dr(sj.prototype,{_modelize:function(e,t,n,r){var o=this,i=o._index,s=qn(xn([n.font,{}],r,i)),a=xn([n.color,Cn.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:wpe(o._el,r),padding:vr(xn([n.padding,4],r,i)),positioner:Spe(o._el),rotation:xn([n.rotation,0],r,i)*(Math.PI/180),size:mh.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=it(an(i.formatter,[s,e]),s),l=ht(a)?[]:mh.toTextLines(a),l.length&&(n=t._modelize(c,l,i,e),r=xpe(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=mh.bound(0,o.opacity,1),r.translate(Js(t.x),Js(t.y)),r.rotate(o.rotation),Cpe(r,i.frame,o),Ppe(r,o.lines,i.text,o),r.restore())}});var Tpe=Number.MIN_SAFE_INTEGER||-9007199254740991,kpe=Number.MAX_SAFE_INTEGER||9007199254740991;function kf(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 YM(e,t){var n=kpe,r=Tpe,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 Mm(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 aj=function(){this._rotation=0,this._rect={x:0,y:0,w:0,h:0}};dr(aj.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=kf(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=[Mm(t[0],t[1]),Mm(t[0],t[3])],o,i,s;for(this._rotation!==e._rotation&&r.push(Mm(n[0],n[1]),Mm(n[0],n[3])),o=0;o<r.length;++o)if(i=YM(t,r[o]),s=YM(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[kf({x:t.x,y:t.y},r,n),kf({x:t.x+t.w,y:t.y},r,n),kf({x:t.x+t.w,y:t.y+t.h},r,n),kf({x:t.x,y:t.y+t.h},r,n)]}});function lj(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 Ape(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 Ope(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=lj(a,r.model(),i),o._box.update(s,i,r.rotation()));return Ape(e,function(l,c){var u=l._hidable,d=c._hidable;u&&d||d?c._visible=!1:u&&(l._visible=!1)})}var bh={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 aj,_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&&Ope(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=lj(o._el,o.model(),s),i._box.update(a,s,o.rotation()),o.draw(e,a))}},Mpe=function(e){if(ht(e))return null;var t=e,n,r,o;if(Mt(e))if(!ht(e.label))t=e.label;else if(!ht(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},Ipe={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:Mpe,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},uo="$datalabels",cj="$default";function Dpe(e,t){var n=e.datalabels,r={},o=[],i,s;return n===!1?null:(n===!0&&(n={}),t=dr({},[t,n]),i=t.labels||{},s=Object.keys(i),delete t.labels,s.length?s.forEach(function(a){i[a]&&o.push(dr({},[t,i[a],{_key:a}]))}):o.push(t),r=o.reduce(function(a,l){return en(l.listeners||{},function(c,u){a[u]=a[u]||{},a[u][l._key||cj]=c}),delete l.listeners,a},{}),{labels:o,listeners:r})}function JS(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[uo]._dirty=!0,n.update(o)))}}function Npe(e,t,n,r,o){var i,s;!n&&!r||(n?r?n!==r&&(s=i=!0):s=!0:i=!0,s&&JS(e,t.leave,n,o),i&&JS(e,t.enter,r,o))}function Lpe(e,t){var n=e[uo],r=n._listeners,o,i;if(!(!r.enter&&!r.leave)){if(t.type==="mousemove")i=bh.lookup(n._labels,t);else if(t.type!=="mouseout")return;o=n._hovered,n._hovered=i,Npe(e,r,o,i,t)}}function Fpe(e,t){var n=e[uo],r=n._listeners.click,o=r&&bh.lookup(n._labels,t);o&&JS(e,r,o,t)}var jpe={id:"datalabels",defaults:Ipe,beforeInit:function(e){e[uo]={_actives:[]}},beforeUpdate:function(e){var t=e[uo];t._listened=!1,t._listeners={},t._datasets=[],t._labels=[]},afterDatasetUpdate:function(e,t,n){var r=t.index,o=e[uo],i=o._datasets[r]=[],s=e.isDatasetVisible(r),a=e.data.datasets[r],l=Dpe(a,n),c=t.meta.data||[],u=e.ctx,d,p,h,m,b,v,x,w;for(u.save(),d=0,h=c.length;d<h;++d)if(x=c[d],x[uo]=[],s&&x&&e.getDataVisibility(d)&&!x.skip)for(p=0,m=l.labels.length;p<m;++p)b=l.labels[p],v=b._key,w=new sj(b,u,x,d),w.$groups={_set:r,_key:v||cj},w.$context={active:!1,chart:e,dataIndex:d,dataset:a,datasetIndex:r},w.update(w.$context),x[uo].push(w),i.push(w);u.restore(),dr(o._listeners,l.listeners,{merger:function(_,R,C){R[_]=R[_]||{},R[_][t.index]=C[_],o._listened=!0}})},afterUpdate:function(e){e[uo]._labels=bh.prepare(e[uo]._datasets)},afterDatasetsDraw:function(e){bh.draw(e,e[uo]._labels)},beforeEvent:function(e,t){if(e[uo]._listened){var n=t.event;switch(n.type){case"mousemove":case"mouseout":Lpe(e,n);break;case"click":Fpe(e,n);break}}},afterEvent:function(e){var t=e[uo],n=t._actives,r=t._actives=e.getActiveElements(),o=mh.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[uo]||[],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)&&(bh.update(t._labels),e.render()),delete t._dirty}};kn.register(...fse);kn.register(jpe);kn.register(cc);kn.register(Ld);kn.register(Fd);kn.register(na);kn.register(zc);kn.register(Xa);kn.register(Qa);kn.register(Ob);kn.register(OF);function QE({cfg:e,onDatapointClick:t}){var d;const[n,r]=T.useState(""),o=ye(p=>p.selectedLensId),i=T.useRef(null),[s,a]=T.useState(),l=ye(p=>p.themeStyle);T.useEffect(()=>{if(i.current){const p=window.getComputedStyle(i.current);r(p.fontFamily)}},[]),T.useEffect(()=>{var b,v,x,w;if(!n)return;(v=(b=l==null?void 0:l.chart)==null?void 0:b.font)!=null&&v.family&&(kn.defaults.font={...kn.defaults.font,...(x=l==null?void 0:l.chart)==null?void 0:x.font,family:n});const p={...e,options:{...e.options,responsive:!0,maintainAspectRatio:!1}},h=(w=i==null?void 0:i.current)==null?void 0:w.getContext("2d");if(!h)return;let m;try{const _=yce(p,h);m=new kn(h,_),a(m)}catch(_){console.log("error creating chart",_)}return()=>{m&&m.destroy()}},[(d=l==null?void 0:l.chart)==null?void 0:d.font,o,n]);function c(p){var m,b;if(!s)return;const h=s==null?void 0:s.getElementsAtEventForMode(p,"nearest",{intersect:!0},!0);if(h&&h.length>0){const v=h[0].datasetIndex,x=h[0].index,w=(b=(m=h[0].element)==null?void 0:m.$context)==null?void 0:b.raw;t==null||t(s,v,x,w)}}const u=e.type==="doughnut"||e.type==="pie";return y.jsx("div",{onClick:c,className:me("relative h-[99%]",{"mx-14":u}),children:y.jsx("canvas",{ref:i})})}function $pe(e,t){return P.useReducer((n,r)=>t[n][r]??n,e)}var ZE="ScrollArea",[uj,mOe]=rr(ZE),[zpe,gi]=uj(ZE),dj=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[a,l]=P.useState(null),[c,u]=P.useState(null),[d,p]=P.useState(null),[h,m]=P.useState(null),[b,v]=P.useState(null),[x,w]=P.useState(0),[_,R]=P.useState(0),[C,E]=P.useState(!1),[A,M]=P.useState(!1),D=st(t,j=>l(j)),L=Lc(o);return y.jsx(zpe,{scope:n,type:r,dir:L,scrollHideDelay:i,scrollArea:a,viewport:c,onViewportChange:u,content:d,onContentChange:p,scrollbarX:h,onScrollbarXChange:m,scrollbarXEnabled:C,onScrollbarXEnabledChange:E,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:A,onScrollbarYEnabledChange:M,onCornerWidthChange:w,onCornerHeightChange:R,children:y.jsx(je.div,{dir:L,...s,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":_+"px",...e.style}})})});dj.displayName=ZE;var fj="ScrollAreaViewport",hj=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=gi(fj,n),a=P.useRef(null),l=st(t,a,s.onViewportChange);return y.jsxs(y.Fragment,{children:[y.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}),y.jsx(je.div,{"data-radix-scroll-area-viewport":"",...i,ref:l,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:y.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});hj.displayName=fj;var _s="ScrollAreaScrollbar",JE=P.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=gi(_s,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,a=e.orientation==="horizontal";return P.useEffect(()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)}),[a,i,s]),o.type==="hover"?y.jsx(Bpe,{...r,ref:t,forceMount:n}):o.type==="scroll"?y.jsx(Hpe,{...r,ref:t,forceMount:n}):o.type==="auto"?y.jsx(pj,{...r,ref:t,forceMount:n}):o.type==="always"?y.jsx(eR,{...r,ref:t}):null});JE.displayName=_s;var Bpe=P.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=gi(_s,e.__scopeScrollArea),[i,s]=P.useState(!1);return P.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]),y.jsx(Kn,{present:n||i,children:y.jsx(pj,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Hpe=P.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=gi(_s,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Ry(()=>l("SCROLL_END"),100),[a,l]=$pe("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 P.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,o.scrollHideDelay,l]),P.useEffect(()=>{const c=o.viewport,u=i?"scrollLeft":"scrollTop";if(c){let d=c[u];const p=()=>{const h=c[u];d!==h&&(l("SCROLL"),s()),d=h};return c.addEventListener("scroll",p),()=>c.removeEventListener("scroll",p)}},[o.viewport,i,l,s]),y.jsx(Kn,{present:n||a!=="hidden",children:y.jsx(eR,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Pe(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:Pe(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),pj=P.forwardRef((e,t)=>{const n=gi(_s,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=P.useState(!1),a=e.orientation==="horizontal",l=Ry(()=>{if(n.viewport){const c=n.viewport.offsetWidth<n.viewport.scrollWidth,u=n.viewport.offsetHeight<n.viewport.scrollHeight;s(a?c:u)}},10);return Ed(n.viewport,l),Ed(n.content,l),y.jsx(Kn,{present:r||i,children:y.jsx(eR,{"data-state":i?"visible":"hidden",...o,ref:t})})}),eR=P.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=gi(_s,e.__scopeScrollArea),i=P.useRef(null),s=P.useRef(0),[a,l]=P.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=vj(a.viewport,a.content),u={...r,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function d(p,h){return Ype(p,s.current,a,h)}return n==="horizontal"?y.jsx(Vpe,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,h=KM(p,a,o.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=d(p,o.dir))}}):n==="vertical"?y.jsx(Wpe,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,h=KM(p,a);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=d(p))}}):null}),Vpe=P.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=gi(_s,e.__scopeScrollArea),[s,a]=P.useState(),l=P.useRef(null),c=st(t,l,i.onScrollbarXChange);return P.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),y.jsx(mj,{"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":Ey(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,d)=>{if(i.viewport){const p=i.viewport.scrollLeft+u.deltaX;e.onWheelScroll(p),wj(p,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:n0(s.paddingLeft),paddingEnd:n0(s.paddingRight)}})}})}),Wpe=P.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=gi(_s,e.__scopeScrollArea),[s,a]=P.useState(),l=P.useRef(null),c=st(t,l,i.onScrollbarYChange);return P.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),y.jsx(mj,{"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":Ey(n)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,d)=>{if(i.viewport){const p=i.viewport.scrollTop+u.deltaY;e.onWheelScroll(p),wj(p,d)&&u.preventDefault()}},onResize:()=>{l.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:n0(s.paddingTop),paddingEnd:n0(s.paddingBottom)}})}})}),[Upe,gj]=uj(_s),mj=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...p}=e,h=gi(_s,n),[m,b]=P.useState(null),v=st(t,D=>b(D)),x=P.useRef(null),w=P.useRef(""),_=h.viewport,R=r.content-r.viewport,C=tr(u),E=tr(l),A=Ry(d,10);function M(D){if(x.current){const L=D.clientX-x.current.left,j=D.clientY-x.current.top;c({x:L,y:j})}}return P.useEffect(()=>{const D=L=>{const j=L.target;(m==null?void 0:m.contains(j))&&C(L,R)};return document.addEventListener("wheel",D,{passive:!1}),()=>document.removeEventListener("wheel",D,{passive:!1})},[_,m,R,C]),P.useEffect(E,[r,E]),Ed(m,A),Ed(h.content,A),y.jsx(Upe,{scope:n,scrollbar:m,hasThumb:o,onThumbChange:tr(i),onThumbPointerUp:tr(s),onThumbPositionChange:E,onThumbPointerDown:tr(a),children:y.jsx(je.div,{...p,ref:v,style:{position:"absolute",...p.style},onPointerDown:Pe(e.onPointerDown,D=>{D.button===0&&(D.target.setPointerCapture(D.pointerId),x.current=m.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),M(D))}),onPointerMove:Pe(e.onPointerMove,M),onPointerUp:Pe(e.onPointerUp,D=>{const L=D.target;L.hasPointerCapture(D.pointerId)&&L.releasePointerCapture(D.pointerId),document.body.style.webkitUserSelect=w.current,h.viewport&&(h.viewport.style.scrollBehavior=""),x.current=null})})})}),t0="ScrollAreaThumb",bj=P.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=gj(t0,e.__scopeScrollArea);return y.jsx(Kn,{present:n||o.hasThumb,children:y.jsx(Gpe,{ref:t,...r})})}),Gpe=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=gi(t0,n),s=gj(t0,n),{onThumbPositionChange:a}=s,l=st(t,d=>s.onThumbChange(d)),c=P.useRef(void 0),u=Ry(()=>{c.current&&(c.current(),c.current=void 0)},100);return P.useEffect(()=>{const d=i.viewport;if(d){const p=()=>{if(u(),!c.current){const h=Kpe(d,a);c.current=h,a()}};return a(),d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[i.viewport,u,a]),y.jsx(je.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:Pe(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),m=d.clientX-h.left,b=d.clientY-h.top;s.onThumbPointerDown({x:m,y:b})}),onPointerUp:Pe(e.onPointerUp,s.onThumbPointerUp)})});bj.displayName=t0;var tR="ScrollAreaCorner",yj=P.forwardRef((e,t)=>{const n=gi(tR,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?y.jsx(qpe,{...e,ref:t}):null});yj.displayName=tR;var qpe=P.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=gi(tR,n),[i,s]=P.useState(0),[a,l]=P.useState(0),c=!!(i&&a);return Ed(o.scrollbarX,()=>{var d;const u=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(u),l(u)}),Ed(o.scrollbarY,()=>{var d;const u=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(u),s(u)}),c?y.jsx(je.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 n0(e){return e?parseInt(e,10):0}function vj(e,t){const n=e/t;return isNaN(n)?0:n}function Ey(e){const t=vj(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Ype(e,t,n,r="ltr"){const o=Ey(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 xj([l,c],d)(e)}function KM(e,t,n="ltr"){const r=Ey(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=GS(e,l);return xj([0,s],[0,a])(c)}function xj(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 wj(e,t){return e>0&&e<t}var Kpe=(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 Ry(e,t){const n=tr(e),r=P.useRef(0);return P.useEffect(()=>()=>window.clearTimeout(r.current),[]),P.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Ed(e,t){const n=tr(t);yr(()=>{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 Sj=dj,Xpe=hj,Qpe=yj;const pc=P.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(Sj,{ref:r,className:me("relative overflow-hidden",e),...n,children:[y.jsx(Xpe,{className:"h-full w-full rounded-[inherit]",children:t}),y.jsx(Ip,{}),y.jsx(Qpe,{})]}));pc.displayName=Sj.displayName;const Ip=P.forwardRef(({className:e,orientation:t="vertical",...n},r)=>y.jsx(JE,{ref:r,orientation:t,className:me("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:y.jsx(bj,{className:"relative flex-1 rounded-full bg-border"})}));Ip.displayName=JE.displayName;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 So(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function Yr(e,t){const n=zt(e);return isNaN(t)?So(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Di(e,t){const n=zt(e);if(isNaN(t))return So(e,NaN);if(!t)return n;const r=n.getDate(),o=So(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)}function Zpe(e,t){const n=+zt(e);return So(e,n+t)}const nR=6048e5,Jpe=864e5,ege=36e5;function XM(e,t){return Zpe(e,t*ege)}let tge={};function Dp(){return tge}function ps(e,t){var a,l,c,u;const n=Dp(),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 kc(e){return ps(e,{weekStartsOn:1})}function _j(e){const t=zt(e),n=t.getFullYear(),r=So(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const o=kc(r),i=So(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const s=kc(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function Rd(e){const t=zt(e);return t.setHours(0,0,0,0),t}function r0(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 rs(e,t){const n=Rd(e),r=Rd(t),o=+n-r0(n),i=+r-r0(r);return Math.round((o-i)/Jpe)}function nge(e){const t=_j(e),n=So(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),kc(n)}function e_(e,t){const n=t*7;return Yr(e,n)}function rge(e,t){return Di(e,t*12)}function oge(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 ige(e){let t;return e.forEach(n=>{const r=zt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function vo(e,t){const n=Rd(e),r=Rd(t);return+n==+r}function rR(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function sge(e){if(!rR(e)&&typeof e!="number")return!1;const t=zt(e);return!isNaN(Number(t))}function Vh(e,t){const n=zt(e),r=zt(t),o=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return o*12+i}function age(e,t,n){const r=ps(e,n),o=ps(t,n),i=+r-r0(r),s=+o-r0(o);return Math.round((i-s)/nR)}function oR(e){const t=zt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function xo(e){const t=zt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function Cj(e){const t=zt(e),n=So(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function iR(e,t){var a,l,c,u;const n=Dp(),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 Ej(e){return iR(e,{weekStartsOn:1})}const lge={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"}},cge=(e,t,n)=>{let r;const o=lge[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 uge={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},dge={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fge={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},hge={date:Cw({formats:uge,defaultWidth:"full"}),time:Cw({formats:dge,defaultWidth:"full"}),dateTime:Cw({formats:fge,defaultWidth:"full"})},pge={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},gge=(e,t,n,r)=>pge[e];function Af(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 mge={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},bge={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},yge={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"]},vge={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"]},xge={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"}},wge={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"}},Sge=(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"},_ge={ordinalNumber:Sge,era:Af({values:mge,defaultWidth:"wide"}),quarter:Af({values:bge,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Af({values:yge,defaultWidth:"wide"}),day:Af({values:vge,defaultWidth:"wide"}),dayPeriod:Af({values:xge,defaultWidth:"wide",formattingValues:wge,defaultFormattingWidth:"wide"})};function Of(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)?Ege(a,d=>d.test(s)):Cge(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 Cge(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Ege(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Rge(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 Pge=/^(\d+)(th|st|nd|rd)?/i,Tge=/\d+/i,kge={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},Age={any:[/^b/i,/^(a|c)/i]},Oge={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Mge={any:[/1/i,/2/i,/3/i,/4/i]},Ige={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},Dge={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]},Nge={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},Lge={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]},Fge={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},jge={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}},$ge={ordinalNumber:Rge({matchPattern:Pge,parsePattern:Tge,valueCallback:e=>parseInt(e,10)}),era:Of({matchPatterns:kge,defaultMatchWidth:"wide",parsePatterns:Age,defaultParseWidth:"any"}),quarter:Of({matchPatterns:Oge,defaultMatchWidth:"wide",parsePatterns:Mge,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Of({matchPatterns:Ige,defaultMatchWidth:"wide",parsePatterns:Dge,defaultParseWidth:"any"}),day:Of({matchPatterns:Nge,defaultMatchWidth:"wide",parsePatterns:Lge,defaultParseWidth:"any"}),dayPeriod:Of({matchPatterns:Fge,defaultMatchWidth:"any",parsePatterns:jge,defaultParseWidth:"any"})},Rj={code:"en-US",formatDistance:cge,formatLong:hge,formatRelative:gge,localize:_ge,match:$ge,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zge(e){const t=zt(e);return rs(t,Cj(t))+1}function Pj(e){const t=zt(e),n=+kc(t)-+nge(t);return Math.round(n/nR)+1}function Tj(e,t){var u,d,p,h;const n=zt(e),r=n.getFullYear(),o=Dp(),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??((h=(p=o.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,s=So(e,0);s.setFullYear(r+1,0,i),s.setHours(0,0,0,0);const a=ps(s,t),l=So(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=ps(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function Bge(e,t){var a,l,c,u;const n=Dp(),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=Tj(e,t),i=So(e,0);return i.setFullYear(o,0,r),i.setHours(0,0,0,0),ps(i,t)}function kj(e,t){const n=zt(e),r=+ps(n,t)-+Bge(n,t);return Math.round(r/nR)+1}function rn(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Sa={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return rn(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):rn(n+1,2)},d(e,t){return rn(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 rn(e.getHours()%12||12,t.length)},H(e,t){return rn(e.getHours(),t.length)},m(e,t){return rn(e.getMinutes(),t.length)},s(e,t){return rn(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),o=Math.trunc(r*Math.pow(10,n-3));return rn(o,t.length)}},gu={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},QM={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 Sa.y(e,t)},Y:function(e,t,n,r){const o=Tj(e,r),i=o>0?o:1-o;if(t==="YY"){const s=i%100;return rn(s,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):rn(i,t.length)},R:function(e,t){const n=_j(e);return rn(n,t.length)},u:function(e,t){const n=e.getFullYear();return rn(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 rn(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 rn(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 Sa.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 rn(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=kj(e,r);return t==="wo"?n.ordinalNumber(o,{unit:"week"}):rn(o,t.length)},I:function(e,t,n){const r=Pj(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):rn(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Sa.d(e,t)},D:function(e,t,n){const r=zge(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):rn(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 rn(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 rn(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 rn(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=gu.noon:r===0?o=gu.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=gu.evening:r>=12?o=gu.afternoon:r>=4?o=gu.morning:o=gu.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 Sa.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Sa.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):rn(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):rn(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Sa.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Sa.s(e,t)},S:function(e,t){return Sa.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return JM(r);case"XXXX":case"XX":return Nl(r);case"XXXXX":case"XXX":default:return Nl(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return JM(r);case"xxxx":case"xx":return Nl(r);case"xxxxx":case"xxx":default:return Nl(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ZM(r,":");case"OOOO":default:return"GMT"+Nl(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ZM(r,":");case"zzzz":default:return"GMT"+Nl(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return rn(r,t.length)},T:function(e,t,n){const r=e.getTime();return rn(r,t.length)}};function ZM(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+rn(i,2)}function JM(e,t){return e%60===0?(e>0?"-":"+")+rn(Math.abs(e)/60,2):Nl(e,t)}function Nl(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),o=rn(Math.trunc(r/60),2),i=rn(r%60,2);return n+o+t+i}const eI=(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"})}},Aj=(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"})}},Hge=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],o=n[2];if(!o)return eI(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}}",eI(r,t)).replace("{{time}}",Aj(o,t))},Vge={p:Aj,P:Hge},Wge=/^D+$/,Uge=/^Y+$/,Gge=["D","DD","YY","YYYY"];function qge(e){return Wge.test(e)}function Yge(e){return Uge.test(e)}function Kge(e,t,n){const r=Xge(e,t,n);if(console.warn(r),Gge.includes(e))throw new RangeError(r)}function Xge(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 Qge=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Zge=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Jge=/^'([^]*?)'?$/,eme=/''/g,tme=/[a-zA-Z]/;function ls(e,t,n){var u,d,p,h,m,b,v,x;const r=Dp(),o=(n==null?void 0:n.locale)??r.locale??Rj,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??((h=(p=r.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,s=(n==null?void 0:n.weekStartsOn)??((b=(m=n==null?void 0:n.locale)==null?void 0:m.options)==null?void 0:b.weekStartsOn)??r.weekStartsOn??((x=(v=r.locale)==null?void 0:v.options)==null?void 0:x.weekStartsOn)??0,a=zt(e);if(!sge(a))throw new RangeError("Invalid time value");let l=t.match(Zge).map(w=>{const _=w[0];if(_==="p"||_==="P"){const R=Vge[_];return R(w,o.formatLong)}return w}).join("").match(Qge).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const _=w[0];if(_==="'")return{isToken:!1,value:nme(w)};if(QM[_])return{isToken:!0,value:w};if(_.match(tme))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:w}});o.localize.preprocessor&&(l=o.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return l.map(w=>{if(!w.isToken)return w.value;const _=w.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&Yge(_)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&qge(_))&&Kge(_,t,String(e));const R=QM[_[0]];return R(a,_,o.localize,c)}).join("")}function nme(e){const t=e.match(Jge);return t?t[1].replace(eme,"'"):e}function rme(e){const t=zt(e),n=t.getFullYear(),r=t.getMonth(),o=So(e,0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}function ome(e){return Math.trunc(+zt(e)/1e3)}function ime(e){const t=zt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function sme(e,t){return age(ime(e),xo(e),t)+1}function t_(e,t){const n=zt(e),r=zt(t);return n.getTime()>r.getTime()}function Oj(e,t){const n=zt(e),r=zt(t);return+n<+r}function sR(e,t){const n=zt(e),r=zt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function ame(e,t){const n=zt(e),r=zt(t);return n.getFullYear()===r.getFullYear()}function Ew(e,t){return Yr(e,-t)}function Rw(e,t){const n=zt(e),r=n.getFullYear(),o=n.getDate(),i=So(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const s=rme(i);return n.setMonth(t,Math.min(o,s)),n}function tI(e,t){const n=zt(e);return isNaN(+n)?So(e,NaN):(n.setFullYear(t),n)}var et=function(){return et=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},et.apply(this,arguments)};function lme(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 Mj(e,t,n){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))}function Np(e){return e.mode==="multiple"}function Lp(e){return e.mode==="range"}function Py(e){return e.mode==="single"}var cme={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 ume(e,t){return ls(e,"LLLL y",t)}function dme(e,t){return ls(e,"d",t)}function fme(e,t){return ls(e,"LLLL",t)}function hme(e){return"".concat(e)}function pme(e,t){return ls(e,"cccccc",t)}function gme(e,t){return ls(e,"yyyy",t)}var mme=Object.freeze({__proto__:null,formatCaption:ume,formatDay:dme,formatMonthCaption:fme,formatWeekNumber:hme,formatWeekdayName:pme,formatYearCaption:gme}),bme=function(e,t,n){return ls(e,"do MMMM (EEEE)",n)},yme=function(){return"Month: "},vme=function(){return"Go to next month"},xme=function(){return"Go to previous month"},wme=function(e,t){return ls(e,"cccc",t)},Sme=function(e){return"Week n. ".concat(e)},_me=function(){return"Year: "},Cme=Object.freeze({__proto__:null,labelDay:bme,labelMonthDropdown:yme,labelNext:vme,labelPrevious:xme,labelWeekNumber:Sme,labelWeekday:wme,labelYearDropdown:_me});function Eme(){var e="buttons",t=cme,n=Rj,r={},o={},i=1,s={},a=new Date;return{captionLayout:e,classNames:t,formatters:mme,labels:Cme,locale:n,modifiersClassNames:r,modifiers:o,numberOfMonths:i,styles:s,today:a,mode:"default"}}function Rme(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=xo(r):t&&(i=new Date(t,0,1)),o?s=oR(o):n&&(s=new Date(n,11,31)),{fromDate:i?Rd(i):void 0,toDate:s?Rd(s):void 0}}var Ij=T.createContext(void 0);function Pme(e){var t,n=e.initialProps,r=Eme(),o=Rme(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;(Py(n)||Np(n)||Lp(n))&&(l=n.onSelect);var c=et(et(et({},r),n),{captionLayout:a,classNames:et(et({},r.classNames),n.classNames),components:et({},n.components),formatters:et(et({},r.formatters),n.formatters),fromDate:i,labels:et(et({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:et(et({},r.modifiers),n.modifiers),modifiersClassNames:et(et({},r.modifiersClassNames),n.modifiersClassNames),onSelect:l,styles:et(et({},r.styles),n.styles),toDate:s});return y.jsx(Ij.Provider,{value:c,children:e.children})}function mn(){var e=T.useContext(Ij);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function Dj(e){var t=mn(),n=t.locale,r=t.classNames,o=t.styles,i=t.formatters.formatCaption;return y.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 Tme(e){return y.jsx("svg",et({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:y.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 Nj(e){var t,n,r=e.onChange,o=e.value,i=e.children,s=e.caption,a=e.className,l=e.style,c=mn(),u=(n=(t=c.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:Tme;return y.jsxs("div",{className:a,style:l,children:[y.jsx("span",{className:c.classNames.vhidden,children:e["aria-label"]}),y.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:c.classNames.dropdown,style:c.styles.dropdown,value:o,onChange:r,children:i}),y.jsxs("div",{className:c.classNames.caption_label,style:c.styles.caption_label,"aria-hidden":"true",children:[s,y.jsx(u,{className:c.classNames.dropdown_icon,style:c.styles.dropdown_icon})]})]})}function kme(e){var t,n=mn(),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 y.jsx(y.Fragment,{});if(!o)return y.jsx(y.Fragment,{});var d=[];if(ame(r,o))for(var p=xo(r),h=r.getMonth();h<=o.getMonth();h++)d.push(Rw(p,h));else for(var p=xo(new Date),h=0;h<=11;h++)d.push(Rw(p,h));var m=function(v){var x=Number(v.target.value),w=Rw(xo(e.displayMonth),x);e.onChange(w)},b=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:Nj;return y.jsx(b,{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(v){return y.jsx("option",{value:v.getMonth(),children:a(v,{locale:s})},v.getMonth())})})}function Ame(e){var t,n=e.displayMonth,r=mn(),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,p=[];if(!o)return y.jsx(y.Fragment,{});if(!i)return y.jsx(y.Fragment,{});for(var h=o.getFullYear(),m=i.getFullYear(),b=h;b<=m;b++)p.push(tI(Cj(new Date),b));var v=function(w){var _=tI(xo(n),Number(w.target.value));e.onChange(_)},x=(t=c==null?void 0:c.Dropdown)!==null&&t!==void 0?t:Nj;return y.jsx(x,{name:"years","aria-label":d(),className:l.dropdown_year,style:a.dropdown_year,onChange:v,value:n.getFullYear(),caption:u(n,{locale:s}),children:p.map(function(w){return y.jsx("option",{value:w.getFullYear(),children:u(w,{locale:s})},w.getFullYear())})})}function Ome(e,t){var n=T.useState(e),r=n[0],o=n[1],i=t===void 0?r:t;return[i,o]}function Mme(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&&Vh(i,o)<0){var c=-1*(l-1);o=Di(i,c)}return s&&Vh(o,s)<0&&(o=s),xo(o)}function Ime(){var e=mn(),t=Mme(e),n=Ome(t,e.month),r=n[0],o=n[1],i=function(s){var a;if(!e.disableNavigation){var l=xo(s);o(l),(a=e.onMonthChange)===null||a===void 0||a.call(e,l)}};return[r,i]}function Dme(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=xo(e),i=xo(Di(o,r)),s=Vh(i,o),a=[],l=0;l<s;l++){var c=Di(o,l);a.push(c)}return n&&(a=a.reverse()),a}function Nme(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=xo(e);if(!n)return Di(a,s);var l=Vh(n,e);if(!(l<i))return Di(a,s)}}function Lme(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=xo(e);if(!n)return Di(a,-s);var l=Vh(a,n);if(!(l<=0))return Di(a,-s)}}var Lj=T.createContext(void 0);function Fme(e){var t=mn(),n=Ime(),r=n[0],o=n[1],i=Dme(r,t),s=Nme(r,t),a=Lme(r,t),l=function(d){return i.some(function(p){return sR(d,p)})},c=function(d,p){l(d)||(p&&Oj(d,p)?o(Di(d,1+t.numberOfMonths*-1)):o(d))},u={currentMonth:r,displayMonths:i,goToMonth:o,goToDate:c,previousMonth:a,nextMonth:s,isDateDisplayed:l};return y.jsx(Lj.Provider,{value:u,children:e.children})}function Fp(){var e=T.useContext(Lj);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function nI(e){var t,n=mn(),r=n.classNames,o=n.styles,i=n.components,s=Fp().goToMonth,a=function(u){s(Di(u,e.displayIndex?-e.displayIndex:0))},l=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:Dj,c=y.jsx(l,{id:e.id,displayMonth:e.displayMonth});return y.jsxs("div",{className:r.caption_dropdowns,style:o.caption_dropdowns,children:[y.jsx("div",{className:r.vhidden,children:c}),y.jsx(kme,{onChange:a,displayMonth:e.displayMonth}),y.jsx(Ame,{onChange:a,displayMonth:e.displayMonth})]})}function jme(e){return y.jsx("svg",et({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:y.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 $me(e){return y.jsx("svg",et({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:y.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 o0=T.forwardRef(function(e,t){var n=mn(),r=n.classNames,o=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var s=i.join(" "),a=et(et({},o.button_reset),o.button);return e.style&&Object.assign(a,e.style),y.jsx("button",et({},e,{ref:t,type:"button",className:s,style:a}))});function zme(e){var t,n,r=mn(),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 y.jsx(y.Fragment,{});var p=c(e.previousMonth,{locale:i}),h=[s.nav_button,s.nav_button_previous].join(" "),m=u(e.nextMonth,{locale:i}),b=[s.nav_button,s.nav_button_next].join(" "),v=(t=d==null?void 0:d.IconRight)!==null&&t!==void 0?t:$me,x=(n=d==null?void 0:d.IconLeft)!==null&&n!==void 0?n:jme;return y.jsxs("div",{className:s.nav,style:a.nav,children:[!e.hidePrevious&&y.jsx(o0,{name:"previous-month","aria-label":p,className:h,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:o==="rtl"?y.jsx(v,{className:s.nav_icon,style:a.nav_icon}):y.jsx(x,{className:s.nav_icon,style:a.nav_icon})}),!e.hideNext&&y.jsx(o0,{name:"next-month","aria-label":m,className:b,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:o==="rtl"?y.jsx(x,{className:s.nav_icon,style:a.nav_icon}):y.jsx(v,{className:s.nav_icon,style:a.nav_icon})})]})}function rI(e){var t=mn().numberOfMonths,n=Fp(),r=n.previousMonth,o=n.nextMonth,i=n.goToMonth,s=n.displayMonths,a=s.findIndex(function(m){return sR(e.displayMonth,m)}),l=a===0,c=a===s.length-1,u=t>1&&(l||!c),d=t>1&&(c||!l),p=function(){r&&i(r)},h=function(){o&&i(o)};return y.jsx(zme,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:o,previousMonth:r,onPreviousClick:p,onNextClick:h})}function Bme(e){var t,n=mn(),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:Dj,c;return o?c=y.jsx(l,{id:e.id,displayMonth:e.displayMonth}):s==="dropdown"?c=y.jsx(nI,{displayMonth:e.displayMonth,id:e.id}):s==="dropdown-buttons"?c=y.jsxs(y.Fragment,{children:[y.jsx(nI,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),y.jsx(rI,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):c=y.jsxs(y.Fragment,{children:[y.jsx(l,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),y.jsx(rI,{displayMonth:e.displayMonth,id:e.id})]}),y.jsx("div",{className:r.caption,style:i.caption,children:c})}function Hme(e){var t=mn(),n=t.footer,r=t.styles,o=t.classNames.tfoot;return n?y.jsx("tfoot",{className:o,style:r.tfoot,children:y.jsx("tr",{children:y.jsx("td",{colSpan:8,children:n})})}):y.jsx(y.Fragment,{})}function Vme(e,t,n){for(var r=n?kc(new Date):ps(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=Yr(r,i);o.push(s)}return o}function Wme(){var e=mn(),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=Vme(o,i,s);return y.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&y.jsx("td",{style:n.head_cell,className:t.head_cell}),c.map(function(u,d){return y.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 Ume(){var e,t=mn(),n=t.classNames,r=t.styles,o=t.components,i=(e=o==null?void 0:o.HeadRow)!==null&&e!==void 0?e:Wme;return y.jsx("thead",{style:r.head,className:n.head,children:y.jsx(i,{})})}function Gme(e){var t=mn(),n=t.locale,r=t.formatters.formatDay;return y.jsx(y.Fragment,{children:r(e.date,{locale:n})})}var aR=T.createContext(void 0);function qme(e){if(!Np(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return y.jsx(aR.Provider,{value:t,children:e.children})}return y.jsx(Yme,{initialProps:e.initialProps,children:e.children})}function Yme(e){var t=e.initialProps,n=e.children,r=t.selected,o=t.min,i=t.max,s=function(c,u,d){var p,h;(p=t.onDayClick)===null||p===void 0||p.call(t,c,u,d);var m=!!(u.selected&&o&&(r==null?void 0:r.length)===o);if(!m){var b=!!(!u.selected&&i&&(r==null?void 0:r.length)===i);if(!b){var v=r?Mj([],r):[];if(u.selected){var x=v.findIndex(function(w){return vo(c,w)});v.splice(x,1)}else v.push(c);(h=t.onSelect)===null||h===void 0||h.call(t,v,c,u,d)}}},a={disabled:[]};r&&a.disabled.push(function(c){var u=i&&r.length>i-1,d=r.some(function(p){return vo(p,c)});return!!(u&&!d)});var l={selected:r,onDayClick:s,modifiers:a};return y.jsx(aR.Provider,{value:l,children:n})}function lR(){var e=T.useContext(aR);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function Kme(e,t){var n=t||{},r=n.from,o=n.to;return r&&o?vo(o,e)&&vo(r,e)?void 0:vo(o,e)?{from:o,to:void 0}:vo(r,e)?void 0:t_(r,e)?{from:e,to:o}:{from:r,to:e}:o?t_(e,o)?{from:o,to:e}:{from:e,to:o}:r?Oj(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var cR=T.createContext(void 0);function Xme(e){if(!Lp(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return y.jsx(cR.Provider,{value:t,children:e.children})}return y.jsx(Qme,{initialProps:e.initialProps,children:e.children})}function Qme(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(h,m,b){var v,x;(v=t.onDayClick)===null||v===void 0||v.call(t,h,m,b);var w=Kme(h,r);(x=t.onSelect)===null||x===void 0||x.call(t,w,h,m,b)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],s?(u.range_end=[s],vo(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:Ew(i,a-1),before:Yr(i,a-1)}),i&&s&&u.disabled.push({after:i,before:Yr(i,a-1)}),!i&&s&&u.disabled.push({after:Ew(s,a-1),before:Yr(s,a-1)})),l){if(i&&!s&&(u.disabled.push({before:Yr(i,-l+1)}),u.disabled.push({after:Yr(i,l-1)})),i&&s){var d=rs(s,i)+1,p=l-d;u.disabled.push({before:Ew(i,p)}),u.disabled.push({after:Yr(s,p)})}!i&&s&&(u.disabled.push({before:Yr(s,-l+1)}),u.disabled.push({after:Yr(s,l-1)}))}return y.jsx(cR.Provider,{value:{selected:r,onDayClick:c,modifiers:u},children:n})}function uR(){var e=T.useContext(cR);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function lb(e){return Array.isArray(e)?Mj([],e):e!==void 0?[e]:[]}function Zme(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],o=n[1];t[r]=lb(o)}),t}var Ni;(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"})(Ni||(Ni={}));var Jme=Ni.Selected,Ls=Ni.Disabled,ebe=Ni.Hidden,tbe=Ni.Today,Pw=Ni.RangeEnd,Tw=Ni.RangeMiddle,kw=Ni.RangeStart,nbe=Ni.Outside;function rbe(e,t,n){var r,o=(r={},r[Jme]=lb(e.selected),r[Ls]=lb(e.disabled),r[ebe]=lb(e.hidden),r[tbe]=[e.today],r[Pw]=[],r[Tw]=[],r[kw]=[],r[nbe]=[],r);return e.fromDate&&o[Ls].push({before:e.fromDate}),e.toDate&&o[Ls].push({after:e.toDate}),Np(e)?o[Ls]=o[Ls].concat(t.modifiers[Ls]):Lp(e)&&(o[Ls]=o[Ls].concat(n.modifiers[Ls]),o[kw]=n.modifiers[kw],o[Tw]=n.modifiers[Tw],o[Pw]=n.modifiers[Pw]),o}var Fj=T.createContext(void 0);function obe(e){var t=mn(),n=lR(),r=uR(),o=rbe(t,n,r),i=Zme(t.modifiers),s=et(et({},o),i);return y.jsx(Fj.Provider,{value:s,children:e.children})}function jj(){var e=T.useContext(Fj);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function ibe(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function sbe(e){return!!(e&&typeof e=="object"&&"from"in e)}function abe(e){return!!(e&&typeof e=="object"&&"after"in e)}function lbe(e){return!!(e&&typeof e=="object"&&"before"in e)}function cbe(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function ube(e,t){var n,r=t.from,o=t.to;if(r&&o){var i=rs(o,r)<0;i&&(n=[o,r],r=n[0],o=n[1]);var s=rs(e,r)>=0&&rs(o,e)>=0;return s}return o?vo(o,e):r?vo(r,e):!1}function dbe(e){return rR(e)}function fbe(e){return Array.isArray(e)&&e.every(rR)}function hbe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(dbe(n))return vo(e,n);if(fbe(n))return n.includes(e);if(sbe(n))return ube(e,n);if(cbe(n))return n.dayOfWeek.includes(e.getDay());if(ibe(n)){var r=rs(n.before,e),o=rs(n.after,e),i=r>0,s=o<0,a=t_(n.before,n.after);return a?s&&i:i||s}return abe(n)?rs(e,n.after)>0:lbe(n)?rs(n.before,e)>0:typeof n=="function"?n(e):!1})}function dR(e,t,n){var r=Object.keys(t).reduce(function(i,s){var a=t[s];return hbe(e,a)&&i.push(s),i},[]),o={};return r.forEach(function(i){return o[i]=!0}),n&&!sR(e,n)&&(o.outside=!0),o}function pbe(e,t){for(var n=xo(e[0]),r=oR(e[e.length-1]),o,i,s=n;s<=r;){var a=dR(s,t),l=!a.disabled&&!a.hidden;if(!l){s=Yr(s,1);continue}if(a.selected)return s;a.today&&!i&&(i=s),o||(o=s),s=Yr(s,1)}return i||o}var gbe=365;function $j(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,p={day:Yr,week:e_,month:Di,year:rge,startOfWeek:function(v){return o.ISOWeek?kc(v):ps(v,{locale:d,weekStartsOn:l})},endOfWeek:function(v){return o.ISOWeek?Ej(v):iR(v,{locale:d,weekStartsOn:l})}},h=p[n](e,r==="after"?1:-1);r==="before"&&c?h=oge([c,h]):r==="after"&&u&&(h=ige([u,h]));var m=!0;if(i){var b=dR(h,i);m=!b.disabled&&!b.hidden}return m?h:a.count>gbe?a.lastFocused:$j(h,{moveBy:n,direction:r,context:o,modifiers:i,retry:et(et({},a),{count:a.count+1})})}var zj=T.createContext(void 0);function mbe(e){var t=Fp(),n=jj(),r=T.useState(),o=r[0],i=r[1],s=T.useState(),a=s[0],l=s[1],c=pbe(t.displayMonths,n),u=o??(a&&t.isDateDisplayed(a))?a:c,d=function(){l(o),i(void 0)},p=function(v){i(v)},h=mn(),m=function(v,x){if(o){var w=$j(o,{moveBy:v,direction:x,context:h,modifiers:n});vo(o,w)||(t.goToDate(w,o),p(w))}},b={focusedDay:o,focusTarget:u,blur:d,focus:p,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 y.jsx(zj.Provider,{value:b,children:e.children})}function fR(){var e=T.useContext(zj);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function bbe(e,t){var n=jj(),r=dR(e,n,t);return r}var hR=T.createContext(void 0);function ybe(e){if(!Py(e.initialProps)){var t={selected:void 0};return y.jsx(hR.Provider,{value:t,children:e.children})}return y.jsx(vbe,{initialProps:e.initialProps,children:e.children})}function vbe(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 y.jsx(hR.Provider,{value:o,children:n})}function Bj(){var e=T.useContext(hR);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function xbe(e,t){var n=mn(),r=Bj(),o=lR(),i=uR(),s=fR(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,d=s.blur,p=s.focus,h=s.focusMonthBefore,m=s.focusMonthAfter,b=s.focusYearBefore,v=s.focusYearAfter,x=s.focusStartOfWeek,w=s.focusEndOfWeek,_=function($){var V,X,I,q;Py(n)?(V=r.onDayClick)===null||V===void 0||V.call(r,e,t,$):Np(n)?(X=o.onDayClick)===null||X===void 0||X.call(o,e,t,$):Lp(n)?(I=i.onDayClick)===null||I===void 0||I.call(i,e,t,$):(q=n.onDayClick)===null||q===void 0||q.call(n,e,t,$)},R=function($){var V;p(e),(V=n.onDayFocus)===null||V===void 0||V.call(n,e,t,$)},C=function($){var V;d(),(V=n.onDayBlur)===null||V===void 0||V.call(n,e,t,$)},E=function($){var V;(V=n.onDayMouseEnter)===null||V===void 0||V.call(n,e,t,$)},A=function($){var V;(V=n.onDayMouseLeave)===null||V===void 0||V.call(n,e,t,$)},M=function($){var V;(V=n.onDayPointerEnter)===null||V===void 0||V.call(n,e,t,$)},D=function($){var V;(V=n.onDayPointerLeave)===null||V===void 0||V.call(n,e,t,$)},L=function($){var V;(V=n.onDayTouchCancel)===null||V===void 0||V.call(n,e,t,$)},j=function($){var V;(V=n.onDayTouchEnd)===null||V===void 0||V.call(n,e,t,$)},z=function($){var V;(V=n.onDayTouchMove)===null||V===void 0||V.call(n,e,t,$)},Q=function($){var V;(V=n.onDayTouchStart)===null||V===void 0||V.call(n,e,t,$)},G=function($){var V;(V=n.onDayKeyUp)===null||V===void 0||V.call(n,e,t,$)},F=function($){var V;switch($.key){case"ArrowLeft":$.preventDefault(),$.stopPropagation(),n.dir==="rtl"?a():l();break;case"ArrowRight":$.preventDefault(),$.stopPropagation(),n.dir==="rtl"?l():a();break;case"ArrowDown":$.preventDefault(),$.stopPropagation(),c();break;case"ArrowUp":$.preventDefault(),$.stopPropagation(),u();break;case"PageUp":$.preventDefault(),$.stopPropagation(),$.shiftKey?b():h();break;case"PageDown":$.preventDefault(),$.stopPropagation(),$.shiftKey?v():m();break;case"Home":$.preventDefault(),$.stopPropagation(),x();break;case"End":$.preventDefault(),$.stopPropagation(),w();break}(V=n.onDayKeyDown)===null||V===void 0||V.call(n,e,t,$)},H={onClick:_,onFocus:R,onBlur:C,onKeyDown:F,onKeyUp:G,onMouseEnter:E,onMouseLeave:A,onPointerEnter:M,onPointerLeave:D,onTouchCancel:L,onTouchEnd:j,onTouchMove:z,onTouchStart:Q};return H}function wbe(){var e=mn(),t=Bj(),n=lR(),r=uR(),o=Py(e)?t.selected:Np(e)?n.selected:Lp(e)?r.selected:void 0;return o}function Sbe(e){return Object.values(Ni).includes(e)}function _be(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(Sbe(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function Cbe(e,t){var n=et({},e.styles.day);return Object.keys(t).forEach(function(r){var o;n=et(et({},n),(o=e.modifiersStyles)===null||o===void 0?void 0:o[r])}),n}function Ebe(e,t,n){var r,o,i,s=mn(),a=fR(),l=bbe(e,t),c=xbe(e,l),u=wbe(),d=!!(s.onDayClick||s.mode!=="default");T.useEffect(function(){var E;l.outside||a.focusedDay&&d&&vo(a.focusedDay,e)&&((E=n.current)===null||E===void 0||E.focus())},[a.focusedDay,e,n,d,l.outside]);var p=_be(s,l).join(" "),h=Cbe(s,l),m=!!(l.outside&&!s.showOutsideDays||l.hidden),b=(i=(o=s.components)===null||o===void 0?void 0:o.DayContent)!==null&&i!==void 0?i:Gme,v=y.jsx(b,{date:e,displayMonth:t,activeModifiers:l}),x={style:h,className:p,children:v,role:"gridcell"},w=a.focusTarget&&vo(a.focusTarget,e)&&!l.outside,_=a.focusedDay&&vo(a.focusedDay,e),R=et(et(et({},x),(r={disabled:l.disabled,role:"gridcell"},r["aria-selected"]=l.selected,r.tabIndex=_||w?0:-1,r)),c),C={isButton:d,isHidden:m,activeModifiers:l,selectedDays:u,buttonProps:R,divProps:x};return C}function Rbe(e){var t=T.useRef(null),n=Ebe(e.date,e.displayMonth,t);return n.isHidden?y.jsx("div",{role:"gridcell"}):n.isButton?y.jsx(o0,et({name:"day",ref:t},n.buttonProps)):y.jsx("div",et({},n.divProps))}function Pbe(e){var t=e.number,n=e.dates,r=mn(),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 y.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:u});var d=l(Number(t),{locale:a}),p=function(h){o(t,n,h)};return y.jsx(o0,{name:"week-number","aria-label":d,className:s.weeknumber,style:i.weeknumber,onClick:p,children:u})}function Tbe(e){var t,n,r=mn(),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:Rbe,c=(n=a==null?void 0:a.WeekNumber)!==null&&n!==void 0?n:Pbe,u;return s&&(u=y.jsx("td",{className:i.cell,style:o.cell,children:y.jsx(c,{number:e.weekNumber,dates:e.dates})})),y.jsxs("tr",{className:i.row,style:o.row,children:[u,e.dates.map(function(d){return y.jsx("td",{className:i.cell,style:o.cell,role:"presentation",children:y.jsx(l,{displayMonth:e.displayMonth,date:d})},ome(d))})]})}function oI(e,t,n){for(var r=n!=null&&n.ISOWeek?Ej(t):iR(t,n),o=n!=null&&n.ISOWeek?kc(e):ps(e,n),i=rs(r,o),s=[],a=0;a<=i;a++)s.push(Yr(o,a));var l=s.reduce(function(c,u){var d=n!=null&&n.ISOWeek?Pj(u):kj(u,n),p=c.find(function(h){return h.weekNumber===d});return p?(p.dates.push(u),c):(c.push({weekNumber:d,dates:[u]}),c)},[]);return l}function kbe(e,t){var n=oI(xo(e),oR(e),t);if(t!=null&&t.useFixedWeeks){var r=sme(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=e_(i,6-r),a=oI(e_(i,1),s,t);n.push.apply(n,a)}}return n}function Abe(e){var t,n,r,o=mn(),i=o.locale,s=o.classNames,a=o.styles,l=o.hideHead,c=o.fixedWeeks,u=o.components,d=o.weekStartsOn,p=o.firstWeekContainsDate,h=o.ISOWeek,m=kbe(e.displayMonth,{useFixedWeeks:!!c,ISOWeek:h,locale:i,weekStartsOn:d,firstWeekContainsDate:p}),b=(t=u==null?void 0:u.Head)!==null&&t!==void 0?t:Ume,v=(n=u==null?void 0:u.Row)!==null&&n!==void 0?n:Tbe,x=(r=u==null?void 0:u.Footer)!==null&&r!==void 0?r:Hme;return y.jsxs("table",{id:e.id,className:s.table,style:a.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!l&&y.jsx(b,{}),y.jsx("tbody",{className:s.tbody,style:a.tbody,children:m.map(function(w){return y.jsx(v,{displayMonth:e.displayMonth,dates:w.dates,weekNumber:w.weekNumber},w.weekNumber)})}),y.jsx(x,{displayMonth:e.displayMonth})]})}function Obe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Mbe=Obe()?T.useLayoutEffect:T.useEffect,Aw=!1,Ibe=0;function iI(){return"react-day-picker-".concat(++Ibe)}function Dbe(e){var t,n=e??(Aw?iI():null),r=T.useState(n),o=r[0],i=r[1];return Mbe(function(){o===null&&i(iI())},[]),T.useEffect(function(){Aw===!1&&(Aw=!0)},[]),(t=e??o)!==null&&t!==void 0?t:void 0}function Nbe(e){var t,n,r=mn(),o=r.dir,i=r.classNames,s=r.styles,a=r.components,l=Fp().displayMonths,c=Dbe(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],p=s.month,h=e.displayIndex===0,m=e.displayIndex===l.length-1,b=!h&&!m;o==="rtl"&&(t=[h,m],m=t[0],h=t[1]),h&&(d.push(i.caption_start),p=et(et({},p),s.caption_start)),m&&(d.push(i.caption_end),p=et(et({},p),s.caption_end)),b&&(d.push(i.caption_between),p=et(et({},p),s.caption_between));var v=(n=a==null?void 0:a.Caption)!==null&&n!==void 0?n:Bme;return y.jsxs("div",{className:d.join(" "),style:p,children:[y.jsx(v,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),y.jsx(Abe,{id:u,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function Lbe(e){var t=mn(),n=t.classNames,r=t.styles;return y.jsx("div",{className:n.months,style:r.months,children:e.children})}function Fbe(e){var t,n,r=e.initialProps,o=mn(),i=fR(),s=Fp(),a=T.useState(!1),l=a[0],c=a[1];T.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=et(et({},o.styles.root),o.style),p=Object.keys(r).filter(function(m){return m.startsWith("data-")}).reduce(function(m,b){var v;return et(et({},m),(v={},v[b]=r[b],v))},{}),h=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:Lbe;return y.jsx("div",et({className:u.join(" "),style:d,dir:o.dir,id:o.id,nonce:r.nonce,title:r.title,lang:r.lang},p,{children:y.jsx(h,{children:s.displayMonths.map(function(m,b){return y.jsx(Nbe,{displayIndex:b,displayMonth:m},b)})})}))}function jbe(e){var t=e.children,n=lme(e,["children"]);return y.jsx(Pme,{initialProps:n,children:y.jsx(Fme,{children:y.jsx(ybe,{initialProps:n,children:y.jsx(qme,{initialProps:n,children:y.jsx(Xme,{initialProps:n,children:y.jsx(obe,{children:y.jsx(mbe,{children:t})})})})})})})}function $be(e){return y.jsx(jbe,et({},e,{children:y.jsx(Fbe,{initialProps:e})}))}function Hj({className:e,classNames:t,showOutsideDays:n=!0,...r}){return y.jsx($be,{showOutsideDays:n,className:me("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:me(Hh({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:me(Hh({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})=>y.jsx(BC,{...o,className:"h-4 w-4"}),IconRight:({...o})=>y.jsx(G0,{...o,className:"h-4 w-4"})},...r})}Hj.displayName="Calendar";function Vj(e){const{authToken:t}=Go(),n=ye(R=>R.authToken),r=t||n,o=ye(R=>R.dashboard.filters),i=ye(R=>R.selectedSheetId),s=ye(R=>R.filterValues),[a,l]=T.useState(!0),c=o==null?void 0:o.filter(R=>R.sheetId===i||!R.sheetId),u=s==null?void 0:s.filter(R=>(c==null?void 0:c.some(C=>C.id===R.filterId))||R.filterId.endsWith(i));function d(R){return a?{allowQuery:!0,filterValues:R.filter(A=>A.filterId!==e.id)}:(R==null?void 0:R.find(E=>E.filterId===e.id))?{allowQuery:!1,filterValues:R}:{allowQuery:!0,filterValues:R}}const{allowQuery:p,filterValues:h}=d(u||[]),{data:m,isLoading:b,isFetching:v,isError:x,refetch:w,isSuccess:_}=fp({queryKey:["filter",e.id,e.sql,JSON.stringify(h)],queryFn:()=>R0("https://semaphor.cloud/api/v1/query",(r==null?void 0:r.accessToken)||"",{connection_id:e.connectionId,sql:e.sql,active_filters:h,cache_config:nC({filter:e})}),enabled:!!e.sql&&!!e.connectionId&&p&&!!(r!=null&&r.accessToken),placeholderData:R=>R});return T.useEffect(()=>{_&&a&&l(!1)},[_,a]),{data:m,isLoading:b,isFetching:v,isError:x,refetch:w}}function zbe(e){const t=ye(o=>{var i,s;return(s=(i=o.dashboard)==null?void 0:i.filters)==null?void 0:s.find(a=>a.id===e)}),{setDateRange:n,...r}=Wj(t||{});return r}function Wj(e){const[t,n]=T.useState(),[r,o]=T.useState(),i=ye(m=>m.filterValues),s=ye(m=>m.actions.addOrUpdateFilterValue),{removeFilterValues:a}=Hn(),{data:l,isLoading:c,isFetching:u,isError:d}=Vj(e);T.useEffect(()=>{var m;if(((m=l==null?void 0:l.records)==null?void 0:m.length)>0){const b=l.records[0];if(!b.min||!b.max)return;n({from:new Date(b.min),to:new Date(b.max)}),o({from:new Date(b.min),to:new Date(b.max)})}},[l]),T.useEffect(()=>{var m;if(i){const b=i.find(v=>v.filterId===e.id);if(!b)n(r);else if(((m=b.values)==null?void 0:m.length)===2){const[v,x]=b.values;n({from:v?new Date(v):void 0,to:x?new Date(x):void 0})}}},[i,e.id,r]);function p(){a(e.id),n(r)}function h(m){if(!m)return;let b=[m==null?void 0:m.from,m==null?void 0:m.to];m.from&&m.to===void 0?b=[m.from,XM(m.from,24)]:m.from&&m.to&&m.from.getTime()===m.to.getTime()?b=[m.from,XM(m.to,24)]:b=[m.from,m.to],n({from:b[0],to:b[1]});const v={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Ou(e),name:e.column,operation:"between",values:b};s(v)}return{records:l==null?void 0:l.records,isLoading:c,isFetching:u,isError:d,initialDateRange:r,dateRange:t,setDateRange:n,handleClear:p,handleChange:h}}function Bbe({filter:e,className:t}){var h,m,b,v,x,w,_,R;const n=ye(C=>C.themeStyle),[r,o]=T.useState(!1),{records:i,dateRange:s,isLoading:a,isFetching:l,isError:c,setDateRange:u,handleClear:d,handleChange:p}=Wj(e);return a||l?y.jsx("div",{children:y.jsx(Iu,{className:"h-8 w-full bg-foreground/10"})}):c?y.jsx("div",{className:"h-8 w-full bg-muted px-2",children:"Error"}):i?y.jsx("div",{className:me("grid gap-2",t),children:y.jsxs(Sy,{open:r,onOpenChange:o,children:[y.jsx(_y,{style:{borderRadius:(m=(h=n==null?void 0:n.chart)==null?void 0:h.options)==null?void 0:m.borderRadius},asChild:!0,children:y.jsxs(nr,{size:"sm",id:"date",variant:"outline",className:me("h-[34px] w-full justify-start rounded-sm text-left font-normal",!s&&"text-muted-foreground"),children:[y.jsx(sL,{className:"mr-2 h-4 w-4"}),s!=null&&s.from?s.to?y.jsxs(y.Fragment,{children:[ls(s.from,"LLL dd, y")," -"," ",ls(s.to,"LLL dd, y")]}):ls(s.from,"LLL dd, y"):y.jsx("span",{children:"Pick a date"})]})}),y.jsxs(Mp,{style:{borderRadius:(v=(b=n==null?void 0:n.chart)==null?void 0:b.options)==null?void 0:v.borderRadius},className:"w-auto p-0",align:"start",children:[y.jsx("div",{className:"px-4 pt-3",children:y.jsx(wn,{children:e.title})}),y.jsx(Hj,{initialFocus:!0,mode:"range",defaultMonth:s==null?void 0:s.from,selected:s,onSelect:u,numberOfMonths:2}),y.jsxs("div",{className:"flex justify-end gap-2 px-4 py-3",children:[y.jsx(nr,{style:{borderRadius:(w=(x=n==null?void 0:n.chart)==null?void 0:x.options)==null?void 0:w.borderRadius},size:"sm",variant:"outline",onClick:()=>{p(s),o(!1)},children:"Apply"}),y.jsx(nr,{style:{borderRadius:(R=(_=n==null?void 0:n.chart)==null?void 0:_.options)==null?void 0:R.borderRadius},size:"sm",variant:"outline",onClick:d,children:"Clear"})]})]})]})}):y.jsxs(wn,{className:"w-fulll flex h-8 items-center bg-muted px-2",children:[" ","No Data"]})}const Uj=typeof document<"u"?T.useLayoutEffect:()=>{};function Hbe(e){const t=T.useRef(null);return Uj(()=>{t.current=e},[e]),T.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const jp=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Ul=e=>e&&"window"in e&&e.window===e?e:jp(e).defaultView||window;function Vbe(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 Wbe(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 Gj(e){let t=null;return()=>(t==null&&(t=e()),t)}const Ube=Gj(function(){return Wbe(/^Mac/i)}),Gbe=Gj(function(){return Vbe(/Android/i)});function qbe(e){return e.mozInputSource===0&&e.isTrusted?!0:Gbe()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class Ybe{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 qj(e){let t=T.useRef({isFocused:!1,observer:null});Uj(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Hbe(r=>{e==null||e(r)});return T.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 Ybe("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 Kbe(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=T.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),o&&o(!1),!0},[r,o]),s=qj(i),a=T.useCallback(l=>{const c=jp(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 $p=null,n_=new Set,yh=new Map,Ac=!1,r_=!1;const Xbe={Tab:!0,Escape:!0};function pR(e,t){for(let n of n_)n(e,t)}function Qbe(e){return!(e.metaKey||!Ube()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function i0(e){Ac=!0,Qbe(e)&&($p="keyboard",pR("keyboard",e))}function si(e){$p="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Ac=!0,pR("pointer",e))}function Yj(e){qbe(e)&&(Ac=!0,$p="virtual")}function Kj(e){e.target===window||e.target===document||(!Ac&&!r_&&($p="virtual",pR("virtual",e)),Ac=!1,r_=!1)}function Xj(){Ac=!1,r_=!0}function o_(e){if(typeof window>"u"||yh.get(Ul(e)))return;const t=Ul(e),n=jp(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Ac=!0,r.apply(this,arguments)},n.addEventListener("keydown",i0,!0),n.addEventListener("keyup",i0,!0),n.addEventListener("click",Yj,!0),t.addEventListener("focus",Kj,!0),t.addEventListener("blur",Xj,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",si,!0),n.addEventListener("pointermove",si,!0),n.addEventListener("pointerup",si,!0)):(n.addEventListener("mousedown",si,!0),n.addEventListener("mousemove",si,!0),n.addEventListener("mouseup",si,!0)),t.addEventListener("beforeunload",()=>{Qj(e)},{once:!0}),yh.set(t,{focus:r})}const Qj=(e,t)=>{const n=Ul(e),r=jp(e);t&&r.removeEventListener("DOMContentLoaded",t),yh.has(n)&&(n.HTMLElement.prototype.focus=yh.get(n).focus,r.removeEventListener("keydown",i0,!0),r.removeEventListener("keyup",i0,!0),r.removeEventListener("click",Yj,!0),n.removeEventListener("focus",Kj,!0),n.removeEventListener("blur",Xj,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",si,!0),r.removeEventListener("pointermove",si,!0),r.removeEventListener("pointerup",si,!0)):(r.removeEventListener("mousedown",si,!0),r.removeEventListener("mousemove",si,!0),r.removeEventListener("mouseup",si,!0)),yh.delete(n))};function Zbe(e){const t=jp(e);let n;return t.readyState!=="loading"?o_(e):(n=()=>{o_(e)},t.addEventListener("DOMContentLoaded",n)),()=>Qj(e,n)}typeof document<"u"&&Zbe();function Zj(){return $p!=="pointer"}const Jbe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function e0e(e,t,n){var r;const o=typeof window<"u"?Ul(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?Ul(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?Ul(n==null?void 0:n.target).HTMLElement:HTMLElement,a=typeof window<"u"?Ul(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||(n==null?void 0:n.target)instanceof o&&!Jbe.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&&!Xbe[n.key])}function t0e(e,t,n){o_(),T.useEffect(()=>{let r=(o,i)=>{e0e(!!(n!=null&&n.isTextInput),o,i)&&e(Zj())};return n_.add(r),()=>{n_.delete(r)}},t)}function n0e(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=T.useRef({isFocusWithin:!1}),s=T.useCallback(c=>{i.current.isFocusWithin&&!c.currentTarget.contains(c.relatedTarget)&&(i.current.isFocusWithin=!1,n&&n(c),o&&o(!1))},[n,o,i]),a=qj(s),l=T.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 s0=!1,Ow=0;function i_(){s0=!0,setTimeout(()=>{s0=!1},50)}function sI(e){e.pointerType==="touch"&&i_()}function r0e(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",sI):document.addEventListener("touchend",i_),Ow++,()=>{Ow--,!(Ow>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",sI):document.removeEventListener("touchend",i_))}}function Jj(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,s]=T.useState(!1),a=T.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;T.useEffect(r0e,[]);let{hoverProps:l,triggerHoverEnd:c}=T.useMemo(()=>{let u=(h,m)=>{if(a.pointerType=m,o||m==="touch"||a.isHovered||!h.currentTarget.contains(h.target))return;a.isHovered=!0;let b=h.currentTarget;a.target=b,t&&t({type:"hoverstart",target:b,pointerType:m}),n&&n(!0),s(!0)},d=(h,m)=>{if(a.pointerType="",a.target=null,m==="touch"||!a.isHovered)return;a.isHovered=!1;let b=h.currentTarget;r&&r({type:"hoverend",target:b,pointerType:m}),n&&n(!1),s(!1)},p={};return typeof PointerEvent<"u"?(p.onPointerEnter=h=>{s0&&h.pointerType==="mouse"||u(h,h.pointerType)},p.onPointerLeave=h=>{!o&&h.currentTarget.contains(h.target)&&d(h,h.pointerType)}):(p.onTouchStart=()=>{a.ignoreEmulatedMouseEvents=!0},p.onMouseEnter=h=>{!a.ignoreEmulatedMouseEvents&&!s0&&u(h,"mouse"),a.ignoreEmulatedMouseEvents=!1},p.onMouseLeave=h=>{!o&&h.currentTarget.contains(h.target)&&d(h,"mouse")}),{hoverProps:p,triggerHoverEnd:d}},[t,n,r,o,a]);return T.useEffect(()=>{o&&c({currentTarget:a.target},a.pointerType)},[o]),{hoverProps:l,isHovered:i}}function e8(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=T.useRef({isFocused:!1,isFocusVisible:t||Zj()}),[i,s]=T.useState(!1),[a,l]=T.useState(()=>o.current.isFocused&&o.current.isFocusVisible),c=T.useCallback(()=>l(o.current.isFocused&&o.current.isFocusVisible),[]),u=T.useCallback(h=>{o.current.isFocused=h,s(h),c()},[c]);t0e(h=>{o.current.isFocusVisible=h,c()},[],{isTextInput:n});let{focusProps:d}=Kbe({isDisabled:r,onFocusChange:u}),{focusWithinProps:p}=n0e({isDisabled:!r,onFocusWithinChange:u});return{isFocused:i,isFocusVisible:a,focusProps:r?p:d}}var o0e=Object.defineProperty,i0e=(e,t,n)=>t in e?o0e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mw=(e,t,n)=>(i0e(e,typeof t!="symbol"?t+"":t,n),n);let s0e=class{constructor(){Mw(this,"current",this.detect()),Mw(this,"handoffState","pending"),Mw(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"}},gc=new s0e;function zp(e){return gc.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function t8(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function gs(){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 t8(()=>{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=gs();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 Vd(){let[e]=T.useState(gs);return T.useEffect(()=>()=>e.dispose(),[e]),e}let on=(e,t)=>{gc.isServer?T.useEffect(e,t):T.useLayoutEffect(e,t)};function ul(e){let t=T.useRef(e);return on(()=>{t.current=e},[e]),t}let Ke=function(e){let t=ul(e);return T.useCallback((...n)=>t.current(...n),[t])};function a0e(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 l0e(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function c0e({disabled:e=!1}={}){let t=T.useRef(null),[n,r]=T.useState(!1),o=Vd(),i=Ke(()=>{t.current=null,r(!1),o.dispose()}),s=Ke(a=>{if(o.dispose(),t.current===null){t.current=a.currentTarget,r(!0);{let l=zp(a.currentTarget);o.addEventListener(l,"pointerup",i,!1),o.addEventListener(l,"pointermove",c=>{if(t.current){let u=a0e(c);r(l0e(u,t.current.getBoundingClientRect()))}},!1),o.addEventListener(l,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:s,onPointerUp:i,onClick:i}}}let u0e=T.createContext(void 0);function gR(){return T.useContext(u0e)}function s_(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Oi(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,Oi),r}var a0=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(a0||{}),za=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(za||{});function qo(){let e=f0e();return T.useCallback(t=>d0e({mergeRefs:e,...t}),[e])}function d0e({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:s,mergeRefs:a}){a=a??h0e;let l=n8(t,e);if(i)return Im(l,n,r,s,a);let c=o??0;if(c&2){let{static:u=!1,...d}=l;if(u)return Im(d,n,r,s,a)}if(c&1){let{unmount:u=!0,...d}=l;return Oi(u?0:1,{0(){return null},1(){return Im({...d,hidden:!0,style:{display:"none"}},n,r,s,a)}})}return Im(l,n,r,s,a)}function Im(e,t={},n,r,o){let{as:i=n,children:s,refName:a="ref",...l}=Iw(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 p=!1,h=[];for(let[m,b]of Object.entries(t))typeof b=="boolean"&&(p=!0),b===!0&&h.push(m.replace(/([A-Z])/g,v=>`-${v.toLowerCase()}`));if(p){d["data-headlessui-state"]=h.join(" ");for(let m of h)d[`data-${m}`]=""}}if(i===T.Fragment&&(Object.keys(Ra(l)).length>0||Object.keys(Ra(d)).length>0))if(!T.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(p=>` - ${p}`).join(`
|
|
384
|
+
`),"","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(p=>` - ${p}`).join(`
|
|
385
|
+
`)].join(`
|
|
386
|
+
`))}else{let p=u.props,h=p==null?void 0:p.className,m=typeof h=="function"?(...x)=>s_(h(...x),l.className):s_(h,l.className),b=m?{className:m}:{},v=n8(u.props,Ra(Iw(l,["ref"])));for(let x in d)x in v&&delete d[x];return T.cloneElement(u,Object.assign({},v,d,c,{ref:o(p0e(u),c.ref)},b))}return T.createElement(i,Object.assign({},Iw(l,["ref"]),i!==T.Fragment&&c,i!==T.Fragment&&d),u)}function f0e(){let e=T.useRef([]),t=T.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 h0e(...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 n8(...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 mR(...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 _o(e){var t;return Object.assign(T.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 Iw(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function p0e(e){return T.version.split(".")[0]>="19"?e.props.ref:e.ref}function g0e(e,t,n){let[r,o]=T.useState(n),i=e!==void 0,s=T.useRef(i),a=T.useRef(!1),l=T.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,Ke(c=>(i||o(c),t==null?void 0:t(c)))]}function m0e(e){let[t]=T.useState(e);return t}function r8(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))i8(n,o8(t,r),o);return n}function o8(e,t){return e?e+"["+t+"]":t}function i8(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())i8(e,o8(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,""]):r8(n,t,e)}let b0e="span";var bR=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(bR||{});function y0e(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 qo()({ourProps:i,theirProps:o,slot:{},defaultTag:b0e,name:"Hidden"})}let s8=_o(y0e),v0e=T.createContext(null);function x0e({children:e}){let t=T.useContext(v0e);if(!t)return T.createElement(T.Fragment,null,e);let{target:n}=t;return n?Ar.createPortal(T.createElement(T.Fragment,null,e),n):null}function w0e({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,s]=T.useState(null),a=Vd();return T.useEffect(()=>{if(r&&i)return a.addEventListener(i,"reset",r)},[i,t,r]),T.createElement(x0e,null,T.createElement(S0e,{setForm:s,formId:t}),r8(e).map(([l,c])=>T.createElement(s8,{features:bR.Hidden,...Ra({key:l,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:l,value:c,...o})})))}function S0e({setForm:e,formId:t}){return T.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:T.createElement(s8,{features:bR.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let _0e=T.createContext(void 0);function a8(){return T.useContext(_0e)}function C0e(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&&E0e(n)?!1:r}function E0e(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let l8=Symbol();function R0e(e,t=!0){return Object.assign(e,{[l8]:t})}function Li(...e){let t=T.useRef(e);T.useEffect(()=>{t.current=e},[e]);let n=Ke(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[l8]))?void 0:n}let yR=T.createContext(null);yR.displayName="DescriptionContext";function c8(){let e=T.useContext(yR);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,c8),t}return e}function P0e(){var e,t;return(t=(e=T.useContext(yR))==null?void 0:e.value)!=null?t:void 0}let T0e="p";function k0e(e,t){let n=T.useId(),r=gR(),{id:o=`headlessui-description-${n}`,...i}=e,s=c8(),a=Li(t);on(()=>s.register(o),[o,s.register]);let l=r||!1,c=T.useMemo(()=>({...s.slot,disabled:l}),[s.slot,l]),u={ref:a,...s.props,id:o};return qo()({ourProps:u,theirProps:i,slot:c,defaultTag:T0e,name:s.name||"Description"})}let A0e=_o(k0e);Object.assign(A0e,{});var Gr=(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))(Gr||{});let Ty=T.createContext(null);Ty.displayName="LabelContext";function u8(){let e=T.useContext(Ty);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,u8),t}return e}function ky(e){var t,n,r;let o=(n=(t=T.useContext(Ty))==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 O0e({inherit:e=!1}={}){let t=ky(),[n,r]=T.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,T.useMemo(()=>function(i){let s=Ke(l=>(r(c=>[...c,l]),()=>r(c=>{let u=c.slice(),d=u.indexOf(l);return d!==-1&&u.splice(d,1),u}))),a=T.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 T.createElement(Ty.Provider,{value:a},i.children)},[r])]}let M0e="label";function I0e(e,t){var n;let r=T.useId(),o=u8(),i=a8(),s=gR(),{id:a=`headlessui-label-${r}`,htmlFor:l=i??((n=o.props)==null?void 0:n.htmlFor),passive:c=!1,...u}=e,d=Li(t);on(()=>o.register(a),[a,o.register]);let p=Ke(v=>{let x=v.currentTarget;if(x instanceof HTMLLabelElement&&v.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(v),x instanceof HTMLLabelElement){let w=document.getElementById(x.htmlFor);if(w){let _=w.getAttribute("disabled");if(_==="true"||_==="")return;let R=w.getAttribute("aria-disabled");if(R==="true"||R==="")return;(w instanceof HTMLInputElement&&(w.type==="radio"||w.type==="checkbox")||w.role==="radio"||w.role==="checkbox"||w.role==="switch")&&w.click(),w.focus({preventScroll:!0})}}}),h=s||!1,m=T.useMemo(()=>({...o.slot,disabled:h}),[o.slot,h]),b={ref:d,...o.props,id:a,htmlFor:l,onClick:p};return c&&("onClick"in b&&(delete b.htmlFor,delete b.onClick),"onClick"in u&&delete u.onClick),qo()({ourProps:b,theirProps:u,slot:m,defaultTag:l?M0e:"div",name:o.name||"Label"})}let D0e=_o(I0e),N0e=Object.assign(D0e,{});function mu(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((h,m)=>r[m]!==h)))return o;r=u;let p;if(n.key&&((s=n.debug)!=null&&s.call(n))&&(p=Date.now()),o=t(...u),n.key&&((a=n.debug)!=null&&a.call(n))){const h=Math.round((Date.now()-c)*100)/100,m=Math.round((Date.now()-p)*100)/100,b=m/16,v=(x,w)=>{for(x=String(x);x.length<w;)x=" "+x;return x};console.info(`%c⏱ ${v(m,5)} /${v(h,5)} ms`,`
|
|
387
|
+
font-size: .6rem;
|
|
388
|
+
font-weight: bold;
|
|
389
|
+
color: hsl(${Math.max(0,Math.min(120-120*b,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 Dw(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const L0e=(e,t)=>Math.abs(e-t)<1,F0e=(e,t,n)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)}},j0e=e=>e,$0e=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},z0e=(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=()=>{const l=s[0];if(l!=null&&l.borderBoxSize){const c=l.borderBoxSize[0];if(c){o({width:c.inlineSize,height:c.blockSize});return}}o(n.getBoundingClientRect())};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return i.observe(n,{box:"border-box"}),()=>{i.unobserve(n)}},aI={passive:!0},lI=typeof window>"u"?!0:"onscrollend"in window,B0e=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let o=0;const i=e.options.useScrollendEvent&&lI?()=>{}:F0e(r,()=>{t(o,!1)},e.options.isScrollingResetDelay),s=u=>()=>{const{horizontal:d,isRtl:p}=e.options;o=d?n.scrollLeft*(p&&-1||1):n.scrollTop,i(),t(o,u)},a=s(!0),l=s(!1);l(),n.addEventListener("scroll",a,aI);const c=e.options.useScrollendEvent&&lI;return c&&n.addEventListener("scrollend",l,aI),()=>{n.removeEventListener("scroll",a),c&&n.removeEventListener("scrollend",l)}},H0e=(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"])},V0e=(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 W0e{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=>{const s=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()})}));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:j0e,rangeExtractor:$0e,onChange:()=>{},measureElement:H0e,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=mu(()=>(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=mu(()=>[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=mu(()=>[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),p=this.options.lanes===1?c[u-1]:this.getFurthestMeasurement(c,u),h=p?p.end+this.options.gap:r+o,m=a.get(d),b=typeof m=="number"?m:this.options.estimateSize(u),v=h+b,x=p?p.lane:u%this.options.lanes;c[u]={index:u,start:h,size:b,end:v,key:d,lane:x}}return this.measurementsCache=c,c},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=mu(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,i)=>this.range=n.length>0&&r>0?U0e({measurements:n,outerSize:r,scrollOffset:o,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=mu(()=>{let n=null,r=null;const o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,i,s)=>i===null||s===null?[]:n({startIndex:i,endIndex:s,overscan:r,count:o}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",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=mu(()=>[this.getVirtualIndexes(),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 Dw(r[d8(0,r.length-1,o=>Dw(r[o]).start,n)])},this.getOffsetForAlignment=(n,r,o=0)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&(r=n>=s+i?"end":"start"),r==="center"?n+=(o-i)/2:r==="end"&&(n-=i);const a=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[a]:this.scrollElement[a]:0)-i;return Math.max(Math.min(c,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=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,o.size),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]=Dw(this.getOffsetForIndex(n,a));L0e(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 d8=(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 U0e({measurements:e,outerSize:t,scrollOffset:n,lanes:r}){const o=e.length-1;let s=d8(0,o,l=>e[l].start,n),a=s;for(;a<o&&e[a].end<n+t;)a++;return r>1&&(s=Math.max(0,s-s%r),a=Math.min(o,a+(r-1-a%r))),{startIndex:s,endIndex:a}}const cI=typeof document<"u"?P.useLayoutEffect:P.useEffect;function G0e(e){const t=P.useReducer(()=>({}),{})[1],n={...e,onChange:(o,i)=>{var s;i?Ar.flushSync(t):t(),(s=e.onChange)==null||s.call(e,o,i)}},[r]=P.useState(()=>new W0e(n));return r.setOptions(n),cI(()=>r._didMount(),[]),cI(()=>r._willUpdate()),r}function q0e(e){return G0e({observeElementRect:z0e,observeElementOffset:B0e,scrollToFn:V0e,...e})}function Y0e(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 K0e(e=Y0e){return T.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 X0e(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function uI(e,t=!1){let[n,r]=T.useReducer(()=>({}),{}),o=T.useMemo(()=>X0e(e),[e,n]);return on(()=>{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 Q0e=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 f8(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 h8(e){return T.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Z0e=new Q0e(()=>f8(()=>[],{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 vR(e,t){let n=Z0e.get(t),r=T.useId(),o=h8(n);if(on(()=>{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 a_=new Map,vh=new Map;function dI(e){var t;let n=(t=vh.get(e))!=null?t:0;return vh.set(e,n+1),n!==0?()=>fI(e):(a_.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>fI(e))}function fI(e){var t;let n=(t=vh.get(e))!=null?t:1;if(n===1?vh.delete(e):vh.set(e,n-1),n!==1)return;let r=a_.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,a_.delete(e))}function J0e(e,{allowed:t,disallowed:n}={}){let r=vR(e,"inert-others");on(()=>{var o,i;if(!r)return;let s=gs();for(let l of(o=n==null?void 0:n())!=null?o:[])l&&s.add(dI(l));let a=(i=t==null?void 0:t())!=null?i:[];for(let l of a){if(!l)continue;let c=zp(l);if(!c)continue;let u=l.parentElement;for(;u&&u!==c.body;){for(let d of u.children)a.some(p=>d.contains(p))||s.add(dI(d));u=u.parentElement}}return s.dispose},[r,t,n])}function eye(e,t,n){let r=ul(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});T.useEffect(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let i=gs();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 l_=["[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 tye=(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))(tye||{}),nye=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(nye||{}),rye=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(rye||{}),p8=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(p8||{});function oye(e,t=0){var n;return e===((n=zp(e))==null?void 0:n.body)?!1:Oi(t,{0(){return e.matches(l_)},1(){let r=e;for(;r!==null;){if(r.matches(l_))return!0;r=r.parentElement}return!1}})}var iye=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(iye||{});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 sye(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 g8(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function aye(){return/Android/gi.test(window.navigator.userAgent)}function m8(){return g8()||aye()}function Mf(e,t,n,r){let o=ul(n);T.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 lye(e,t,n,r){let o=ul(n);T.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 hI=30;function cye(e,t,n){let r=vR(e,"outside-click"),o=ul(n),i=T.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 p(h){return typeof h=="function"?p(h()):Array.isArray(h)||h instanceof Set?h:[h]}(t);for(let p of d)if(p!==null&&(p.contains(u)||l.composed&&l.composedPath().includes(p)))return;return!oye(u,p8.Loose)&&u.tabIndex!==-1&&l.preventDefault(),o.current(l,u)},[o,t]),s=T.useRef(null);Mf(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),Mf(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),Mf(r,"click",l=>{m8()||s.current&&(i(l,()=>s.current),s.current=null)},!0);let a=T.useRef({x:0,y:0});Mf(r,"touchstart",l=>{a.current.x=l.touches[0].clientX,a.current.y=l.touches[0].clientY},!0),Mf(r,"touchend",l=>{let c={x:l.changedTouches[0].clientX,y:l.changedTouches[0].clientY};if(!(Math.abs(c.x-a.current.x)>=hI||Math.abs(c.y-a.current.y)>=hI))return i(l,()=>l.target instanceof HTMLElement?l.target:null)},!0),lye(r,"blur",l=>i(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Ay(...e){return T.useMemo(()=>zp(...e),[...e])}function uye(e,t,n,r){let o=ul(n);T.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 b8(e){let t=T.useRef({value:"",selectionStart:null,selectionEnd:null});return uye(e,"blur",n=>{let r=n.target;r instanceof HTMLInputElement&&(t.current={value:r.value,selectionStart:r.selectionStart,selectionEnd:r.selectionEnd})}),Ke(()=>{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 dye(e,t){return T.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 fye(){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 hye(){return g8()?{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=gs();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 pye(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function gye(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Gl=f8(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:gs(),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:gye(n)},o=[hye(),fye(),pye()];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)}});Gl.subscribe(()=>{let e=Gl.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)&&Gl.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Gl.dispatch("TEARDOWN",n)}});function mye(e,t,n=()=>({containers:[]})){let r=h8(Gl),o=t?r.get(t):void 0,i=o?o.count>0:!1;return on(()=>{if(!(!t||!e))return Gl.dispatch("PUSH",t,n),()=>Gl.dispatch("POP",t,n)},[e,t]),i}function bye(e,t,n=()=>[document.body]){let r=vR(e,"scroll-lock");mye(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function pI(e){return[e.screenX,e.screenY]}function yye(){let e=T.useRef([-1,-1]);return{wasMoved(t){let n=pI(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=pI(t)}}}function vye(e=0){let[t,n]=T.useState(e),r=T.useCallback(l=>n(l),[t]),o=T.useCallback(l=>n(c=>c|l),[t]),i=T.useCallback(l=>(t&l)===l,[t]),s=T.useCallback(l=>n(c=>c&~l),[n]),a=T.useCallback(l=>n(c=>c^l),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:s,toggleFlag:a}}var gI,mI;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((gI=process==null?void 0:process.env)==null?void 0:gI.NODE_ENV)==="test"&&typeof((mI=Element==null?void 0:Element.prototype)==null?void 0:mI.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(`
|
|
390
|
+
`)),[]});var xye=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(xye||{});function y8(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function v8(e,t,n,r){let[o,i]=T.useState(n),{hasFlag:s,addFlag:a,removeFlag:l}=vye(e&&o?3:0),c=T.useRef(!1),u=T.useRef(!1),d=Vd();return on(()=>{var p;if(e){if(n&&i(!0),!t){n&&a(3);return}return(p=r==null?void 0:r.start)==null||p.call(r,n),wye(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 h;u.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(c.current=!1,l(7),n||i(!1),(h=r==null?void 0:r.end)==null||h.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 wye(e,{prepare:t,run:n,done:r,inFlight:o}){let i=gs();return _ye(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(Sye(e,r))})}),i.dispose}function Sye(e,t){var n,r;let o=gs();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 _ye(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 Cye(e,{container:t,accept:n,walk:r}){let o=T.useRef(n),i=T.useRef(r);T.useEffect(()=>{o.current=n,i.current=r},[n,r]),on(()=>{if(!t||!e)return;let s=zp(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 bI(e,t){let n=T.useRef([]),r=Ke(e);T.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 Eye(){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 x8={...P},Rye=x8.useInsertionEffect,Pye=Rye||(e=>e());function w8(e){const t=P.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Pye(()=>{t.current=e}),P.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 c_=typeof document<"u"?T.useLayoutEffect:T.useEffect;let yI=!1,Tye=0;const vI=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Tye++;function kye(){const[e,t]=P.useState(()=>yI?vI():void 0);return c_(()=>{e==null&&t(vI())},[]),P.useEffect(()=>{yI=!0},[]),e}const Aye=x8.useId,Oye=Aye||kye;let Wh;process.env.NODE_ENV!=="production"&&(Wh=new Set);function Mye(){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=Wh)!=null&&e.has(o))){var i;(i=Wh)==null||i.add(o),console.warn(o)}}function Iye(){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=Wh)!=null&&e.has(o))){var i;(i=Wh)==null||i.add(o),console.error(o)}}function Dye(){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 Nye=P.createContext(null),Lye=P.createContext(null),Fye=()=>{var e;return((e=P.useContext(Nye))==null?void 0:e.id)||null},jye=()=>P.useContext(Lye),$ye="data-floating-ui-focusable";function zye(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Oye(),i=P.useRef({}),[s]=P.useState(()=>Dye()),a=Fye()!=null;if(process.env.NODE_ENV!=="production"){const h=r.reference;h&&!Ir(h)&&Iye("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]=P.useState(r.reference),u=w8((h,m,b)=>{i.current.openEvent=h?m:void 0,s.emit("openchange",{open:h,event:m,reason:b,nested:a}),n==null||n(h,m,b)}),d=P.useMemo(()=>({setPositionReference:c}),[]),p=P.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return P.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:p,events:s,floatingId:o,refs:d}),[t,u,p,s,o,d])}function Bye(e){e===void 0&&(e={});const{nodeId:t}=e,n=zye({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,s]=P.useState(null),[a,l]=P.useState(null),u=(o==null?void 0:o.domReference)||i,d=P.useRef(null),p=jye();c_(()=>{u&&(d.current=u)},[u]);const h=U4({...e,elements:{...o,...a&&{reference:a}}}),m=P.useCallback(_=>{const R=Ir(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),contextElement:_}:_;l(R),h.refs.setReference(R)},[h.refs]),b=P.useCallback(_=>{(Ir(_)||_===null)&&(d.current=_,s(_)),(Ir(h.refs.reference.current)||h.refs.reference.current===null||_!==null&&!Ir(_))&&h.refs.setReference(_)},[h.refs]),v=P.useMemo(()=>({...h.refs,setReference:b,setPositionReference:m,domReference:d}),[h.refs,b,m]),x=P.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),w=P.useMemo(()=>({...h,...r,refs:v,elements:x,nodeId:t}),[h,v,x,t,r]);return c_(()=>{r.dataRef.current.floatingContext=w;const _=p==null?void 0:p.nodesRef.current.find(R=>R.id===t);_&&(_.context=w)}),P.useMemo(()=>({...h,context:w,refs:v,elements:x}),[h,v,x,w])}const xI="active",wI="selected";function Nw(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[xI]:s,[wI]:a,...l}=e;i=l}return{...n==="floating"&&{tabIndex:-1,[$ye]:""},...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&&[xI,wI].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 p,h=arguments.length,m=new Array(h),b=0;b<h;b++)m[b]=arguments[b];return(p=r.get(c))==null?void 0:p.map(v=>v(...m)).find(v=>v!==void 0)}}}else s[c]=u}),s),{})}}function Hye(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=P.useCallback(a=>Nw(a,e,"reference"),t),i=P.useCallback(a=>Nw(a,e,"floating"),n),s=P.useCallback(a=>Nw(a,e,"item"),r);return P.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}function SI(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Vye=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}=fs(e,t),{rects:d,elements:{floating:p}}=t,h=n.current[s],m=(c==null?void 0:c.current)||p,b=p.clientTop||m.clientTop,v=p.clientTop!==0,x=m.clientTop!==0,w=p===m;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Mye('`placement` side must be "bottom" when using the `inner`',"middleware.")),!h)return{};const _={...t,...await OE(-h.offsetTop-p.clientTop-d.reference.height/2-h.offsetHeight/2-i).fn(t)},R=await tw(SI(_,m.scrollHeight+b+p.clientTop),u),C=await tw(_,{...u,elementContext:"reference"}),E=kr(0,R.top),A=_.y+E,L=(m.scrollHeight>m.clientHeight?j=>j:zh)(kr(0,m.scrollHeight+(v&&w||x?b*2:0)-E-kr(0,R.bottom)));if(m.style.maxHeight=L+"px",m.scrollTop=E,o){const j=m.offsetHeight<h.offsetHeight*ra(a,n.current.length)-1||C.top>=-l||C.bottom>=-l;yc.flushSync(()=>o(j))}return r&&(r.current=await tw(SI({..._,y:A},m.offsetHeight+b+p.clientTop),u)),{y:A}}});function Wye(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:s,onChange:a}=t,l=w8(a),c=P.useRef(!1),u=P.useRef(null),d=P.useRef(null);P.useEffect(()=>{if(!o)return;function h(b){if(b.ctrlKey||!m||i.current==null)return;const v=b.deltaY,x=i.current.top>=-.5,w=i.current.bottom>=-.5,_=m.scrollHeight-m.clientHeight,R=v<0?-1:1,C=v<0?"max":"min";m.scrollHeight<=m.clientHeight||(!x&&v>0||!w&&v<0?(b.preventDefault(),yc.flushSync(()=>{l(E=>E+Math[C](v,_*R))})):/firefox/i.test(Eye())&&(m.scrollTop+=v))}const m=(s==null?void 0:s.current)||r.floating;if(n&&m)return m.addEventListener("wheel",h),requestAnimationFrame(()=>{u.current=m.scrollTop,i.current!=null&&(d.current={...i.current})}),()=>{u.current=null,d.current=null,m.removeEventListener("wheel",h)}},[o,n,r.floating,i,s,l]);const p=P.useMemo(()=>({onKeyDown(){c.current=!0},onWheel(){c.current=!1},onPointerMove(){c.current=!1},onScroll(){const h=(s==null?void 0:s.current)||r.floating;if(!(!i.current||!h||!c.current)){if(u.current!==null){const m=h.scrollTop-u.current;(i.current.bottom<-.5&&m<-1||i.current.top<-.5&&m>1)&&yc.flushSync(()=>l(b=>b+m))}requestAnimationFrame(()=>{u.current=h.scrollTop})}}}),[r.floating,l,i,s]);return P.useMemo(()=>o?{floating:p}:{},[o,p])}let Bp=T.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});Bp.displayName="FloatingContext";let xR=T.createContext(null);xR.displayName="PlacementContext";function Uye(e){return T.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function Gye(){return T.useContext(Bp).setReference}function qye(){let{getFloatingProps:e,slot:t}=T.useContext(Bp);return T.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function Yye(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=T.useContext(xR),n=T.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var s;return(s=i==null?void 0:i.outerHTML)!=null?s:i})]);on(()=>{t==null||t(n??null)},[t,n]);let r=T.useContext(Bp);return T.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let _I=4;function Kye({children:e,enabled:t=!0}){let[n,r]=T.useState(null),[o,i]=T.useState(0),s=T.useRef(null),[a,l]=T.useState(null);Xye(a);let c=t&&n!==null&&a!==null,{to:u="bottom",gap:d=0,offset:p=0,padding:h=0,inner:m}=Qye(n,a),[b,v="center"]=u.split(" ");on(()=>{c&&i(0)},[c]);let{refs:x,floatingStyles:w,context:_}=Bye({open:c,placement:b==="selection"?v==="center"?"bottom":`bottom-${v}`:v==="center"?`${b}`:`${b}-${v}`,strategy:"absolute",transform:!1,middleware:[OE({mainAxis:b==="selection"?0:d,crossAxis:p}),G4({padding:h}),b!=="selection"&&q4({padding:h}),b==="selection"&&m?Vye({...m,padding:h,overflowRef:s,offset:o,minItemsVisible:_I,referenceOverflowThreshold:h,onFallbackChange(j){var z,Q;if(!j)return;let G=_.elements.floating;if(!G)return;let F=parseFloat(getComputedStyle(G).scrollPaddingBottom)||0,H=Math.min(_I,G.childElementCount),$=0,V=0;for(let X of(Q=(z=_.elements.floating)==null?void 0:z.childNodes)!=null?Q:[])if(X instanceof HTMLElement){let I=X.offsetTop,q=I+X.clientHeight+F,U=G.scrollTop,O=U+G.clientHeight;if(I>=U&&q<=O)H--;else{V=Math.max(0,Math.min(q,O)-Math.max(I,U)),$=X.clientHeight;break}}H>=1&&i(X=>{let I=$*H-V+F;return X>=I?X:I})}}):null,Y4({padding:h,apply({availableWidth:j,availableHeight:z,elements:Q}){Object.assign(Q.floating.style,{overflow:"auto",maxWidth:`${j}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${z}px)`})}})].filter(Boolean),whileElementsMounted:V4}),[R=b,C=v]=_.placement.split("-");b==="selection"&&(R="selection");let E=T.useMemo(()=>({anchor:[R,C].filter(Boolean).join(" ")}),[R,C]),A=Wye(_,{overflowRef:s,onChange:i}),{getReferenceProps:M,getFloatingProps:D}=Hye([A]),L=Ke(j=>{l(j),x.setFloating(j)});return P.createElement(xR.Provider,{value:r},P.createElement(Bp.Provider,{value:{setFloating:L,setReference:x.setReference,styles:w,getReferenceProps:M,getFloatingProps:D,slot:E}},e))}function Xye(e){on(()=>{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 Qye(e,t){var n,r,o;let i=Lw((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),s=Lw((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),a=Lw((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:s,padding:a}}function Lw(e,t,n=void 0){let r=Vd(),o=Ke((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=CI(l,c);return[u,d=>{let p=S8(l);{let h=p.map(m=>window.getComputedStyle(c).getPropertyValue(m));r.requestAnimationFrame(function m(){r.nextFrame(m);let b=!1;for(let[x,w]of p.entries()){let _=window.getComputedStyle(c).getPropertyValue(w);if(h[x]!==_){h[x]=_,b=!0;break}}if(!b)return;let v=CI(l,c);u!==v&&(d(v),u=v)})}return r.dispose}]}return[n,null]}),i=T.useMemo(()=>o(e,t)[0],[e,t]),[s=i,a]=T.useState();return on(()=>{let[l,c]=o(e,t);if(a(l),!!c)return c(a)},[e,t]),s}function S8(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,...S8(o)]:[r]}return[]}function CI(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 Zye({children:e,freeze:t}){let n=u_(t,e);return T.createElement(T.Fragment,null,n)}function u_(e,t){let[n,r]=T.useState(t);return!e&&n!==t&&r(t),e?n:t}let wR=T.createContext(null);wR.displayName="OpenClosedContext";var ki=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(ki||{});function SR(){return T.useContext(wR)}function _8({value:e,children:t}){return T.createElement(wR.Provider,{value:e},t)}function Jye(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let jl=[];Jye(()=>{function e(t){if(!(t.target instanceof HTMLElement)||t.target===document.body||jl[0]===t.target)return;let n=t.target;n=n.closest(l_),jl.unshift(n??t.target),jl=jl.filter(r=>r!=null&&r.isConnected),jl.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 eve(e){throw new Error("Unexpected object: "+e)}var Gn=(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))(Gn||{});function EI(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:eve(e)}}var _R=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(_R||{});function tve(e){let t=Ke(e),n=T.useRef(!1);T.useEffect(()=>(n.current=!1,()=>{n.current=!0,t8(()=>{n.current&&t()})}),[t])}function nve(){let e=typeof document>"u";return"useSyncExternalStore"in P?(t=>t.useSyncExternalStore)(P)(()=>()=>{},()=>!1,()=>!e):!1}function CR(){let e=nve(),[t,n]=P.useState(gc.isHandoffComplete);return t&&gc.isHandoffComplete===!1&&n(!1),P.useEffect(()=>{t!==!0&&n(!0)},[t]),P.useEffect(()=>gc.handoff(),[]),e?!1:t}let rve=T.createContext(!1);function ove(){return T.useContext(rve)}function ive(e){let t=ove(),n=T.useContext(E8),r=Ay(e),[o,i]=T.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(gc.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 T.useEffect(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),T.useEffect(()=>{t||n!==null&&i(n.current)},[n,i,t]),o}let C8=T.Fragment,sve=_o(function(e,t){let n=e,r=T.useRef(null),o=Li(R0e(d=>{r.current=d}),t),i=Ay(r),s=ive(r),[a]=T.useState(()=>{var d;return gc.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),l=T.useContext(uve),c=CR();on(()=>{!s||!a||s.contains(a)||(a.setAttribute("data-headlessui-portal",""),s.appendChild(a))},[s,a]),on(()=>{if(a&&l)return l.register(a)},[l,a]),tve(()=>{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=qo();return c?!s||!a?null:Ar.createPortal(u({ourProps:{ref:o},theirProps:n,slot:{},defaultTag:C8,name:"Portal"}),a):null});function ave(e,t){let n=Li(t),{enabled:r=!0,...o}=e,i=qo();return r?T.createElement(sve,{...o,ref:n}):i({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:C8,name:"Portal"})}let lve=T.Fragment,E8=T.createContext(null);function cve(e,t){let{target:n,...r}=e,o={ref:Li(t)},i=qo();return T.createElement(E8.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:lve,name:"Popover.Group"}))}let uve=T.createContext(null),dve=_o(ave),fve=_o(cve),hve=Object.assign(dve,{Group:fve});var pve=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(pve||{}),gve=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(gve||{}),mve=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(mve||{}),bve=(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))(bve||{});function Fw(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):sye(r,s=>s.dataRef.current.domRef.current),i=n?o.indexOf(n):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let yve={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===Gn.Specific?t.idx:EI(t,{resolveItems:()=>c,resolveActiveIndex:()=>{var h,m;return(m=(h=e.activeOptionIndex)!=null?h:c.findIndex(b=>!u(b)))!=null?m:null},resolveDisabled:u,resolveId(){throw new Error("Function not implemented.")}}),p=(o=t.trigger)!=null?o:2;return e.activeOptionIndex===d&&e.activationTrigger===p?e:{...e,activeOptionIndex:d,activationTrigger:p,isTyping:!1,__demoMode:!1}}let s=Fw(e);if(s.activeOptionIndex===null){let c=s.options.findIndex(u=>!u.dataRef.current.disabled);c!==-1&&(s.activeOptionIndex=c)}let a=t.focus===Gn.Specific?t.idx:EI(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=Fw(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=Fw(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}},ER=T.createContext(null);ER.displayName="ComboboxActionsContext";function Hp(e){let t=T.useContext(ER);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Hp),n}return t}let R8=T.createContext(null);function vve(e){let t=Wd("VirtualProvider"),{options:n}=t.virtual,[r,o]=T.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=q0e({enabled:n.length!==0,scrollPaddingStart:r,scrollPaddingEnd:o,count:n.length,estimateSize(){return 40},getScrollElement(){return t.optionsElement},overscan:12}),[s,a]=T.useState(0);on(()=>{a(c=>c+1)},[n]);let l=i.getVirtualItems();return l.length===0?null:T.createElement(R8.Provider,{value:i},T.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 T.createElement(T.Fragment,{key:c.key},T.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 Uh=T.createContext(null);Uh.displayName="ComboboxDataContext";function Wd(e){let t=T.useContext(Uh);if(t===null){let n=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Wd),n}return t}function xve(e,t){return Oi(t.type,yve,e,t)}let wve=T.Fragment;function Sve(e,t){var n,r;let o=gR(),{value:i,defaultValue:s,onChange:a,form:l,name:c,by:u,disabled:d=o||!1,onClose:p,__demoMode:h=!1,multiple:m=!1,immediate:b=!1,virtual:v=null,nullable:x,...w}=e,_=m0e(s),[R=m?[]:void 0,C]=g0e(i,a,_),[E,A]=T.useReducer(xve,{dataRef:T.createRef(),comboboxState:h?0:1,isTyping:!1,options:[],virtual:v?{options:v.options,disabled:(n=v.disabled)!=null?n:()=>!1}:null,activeOptionIndex:null,activationTrigger:2,inputElement:null,buttonElement:null,optionsElement:null,__demoMode:h}),M=T.useRef(!1),D=T.useRef({static:!1,hold:!1}),L=K0e(u),j=Ke(ue=>v?u===null?v.options.indexOf(ue):v.options.findIndex(Ee=>L(Ee,ue)):E.options.findIndex(Ee=>L(Ee.dataRef.current.value,ue))),z=T.useCallback(ue=>Oi(G.mode,{1:()=>R.some(Ee=>L(Ee,ue)),0:()=>L(R,ue)}),[R]),Q=Ke(ue=>E.activeOptionIndex===j(ue)),G=T.useMemo(()=>({...E,immediate:b,optionsPropsRef:D,value:R,defaultValue:_,disabled:d,mode:m?1:0,virtual:v?E.virtual:null,get activeOptionIndex(){if(M.current&&E.activeOptionIndex===null&&(v?v.options.length>0:E.options.length>0)){if(v){let Ee=v.options.findIndex(Te=>{var Le,Ae;return!((Ae=(Le=v.disabled)==null?void 0:Le.call(v,Te))!=null&&Ae)});if(Ee!==-1)return Ee}let ue=E.options.findIndex(Ee=>!Ee.dataRef.current.disabled);if(ue!==-1)return ue}return E.activeOptionIndex},calculateIndex:j,compare:L,isSelected:z,isActive:Q}),[R,_,d,m,h,E,v]);on(()=>{var ue;v&&A({type:7,options:v.options,disabled:(ue=v.disabled)!=null?ue:null})},[v,v==null?void 0:v.options,v==null?void 0:v.disabled]),on(()=>{E.dataRef.current=G},[G]);let F=G.comboboxState===0;cye(F,[G.buttonElement,G.inputElement,G.optionsElement],()=>J.closeCombobox());let H=T.useMemo(()=>{var ue,Ee,Te;return{open:G.comboboxState===0,disabled:d,activeIndex:G.activeOptionIndex,activeOption:G.activeOptionIndex===null?null:G.virtual?G.virtual.options[(ue=G.activeOptionIndex)!=null?ue:0]:(Te=(Ee=G.options[G.activeOptionIndex])==null?void 0:Ee.dataRef.current.value)!=null?Te:null,value:R}},[G,d,R]),$=Ke(()=>{if(G.activeOptionIndex!==null){if(J.setIsTyping(!1),G.virtual)O(G.virtual.options[G.activeOptionIndex]);else{let{dataRef:ue}=G.options[G.activeOptionIndex];O(ue.current.value)}J.goToOption(Gn.Specific,G.activeOptionIndex)}}),V=Ke(()=>{A({type:0}),M.current=!0}),X=Ke(()=>{A({type:1}),M.current=!1,p==null||p()}),I=Ke(ue=>{A({type:3,isTyping:ue})}),q=Ke((ue,Ee,Te)=>(M.current=!1,ue===Gn.Specific?A({type:2,focus:Gn.Specific,idx:Ee,trigger:Te}):A({type:2,focus:ue,trigger:Te}))),U=Ke((ue,Ee)=>(A({type:4,payload:{id:ue,dataRef:Ee}}),()=>{G.isActive(Ee.current.value)&&(M.current=!0),A({type:5,id:ue})})),O=Ke(ue=>Oi(G.mode,{0(){return C==null?void 0:C(ue)},1(){let Ee=G.value.slice(),Te=Ee.findIndex(Le=>L(Le,ue));return Te===-1?Ee.push(ue):Ee.splice(Te,1),C==null?void 0:C(Ee)}})),ee=Ke(ue=>{A({type:6,trigger:ue})}),K=Ke(ue=>{A({type:8,element:ue})}),oe=Ke(ue=>{A({type:9,element:ue})}),Y=Ke(ue=>{A({type:10,element:ue})}),J=T.useMemo(()=>({onChange:O,registerOption:U,goToOption:q,setIsTyping:I,closeCombobox:X,openCombobox:V,setActivationTrigger:ee,selectActiveOption:$,setInputElement:K,setButtonElement:oe,setOptionsElement:Y}),[]),[ie,de]=O0e(),he=t===null?{}:{ref:t},ae=T.useCallback(()=>{if(_!==void 0)return C==null?void 0:C(_)},[C,_]),ge=qo();return T.createElement(de,{value:ie,props:{htmlFor:(r=G.inputElement)==null?void 0:r.id},slot:{open:G.comboboxState===0,disabled:d}},T.createElement(Kye,null,T.createElement(ER.Provider,{value:J},T.createElement(Uh.Provider,{value:G},T.createElement(_8,{value:Oi(G.comboboxState,{0:ki.Open,1:ki.Closed})},c!=null&&T.createElement(w0e,{disabled:d,data:R!=null?{[c]:R}:{},form:l,onReset:ae}),ge({ourProps:he,theirProps:w,slot:H,defaultTag:wve,name:"Combobox"}))))))}let _ve="input";function Cve(e,t){var n,r,o,i,s;let a=Wd("Combobox.Input"),l=Hp("Combobox.Input"),c=T.useId(),u=a8(),{id:d=u||`headlessui-combobox-input-${c}`,onChange:p,displayValue:h,disabled:m=a.disabled||!1,autoFocus:b=!1,type:v="text",...x}=e,w=T.useRef(null),_=Li(w,t,Gye(),l.setInputElement),R=Ay(a.inputElement),C=Vd(),E=Ke(()=>{l.onChange(null),a.optionsElement&&(a.optionsElement.scrollTop=0),l.goToOption(Gn.Nothing)}),A=T.useMemo(()=>{var O;return typeof h=="function"&&a.value!==void 0?(O=h(a.value))!=null?O:"":typeof a.value=="string"?a.value:""},[a.value,h]);bI(([O,ee],[K,oe])=>{if(a.isTyping)return;let Y=w.current;Y&&((oe===0&&ee===1||O!==K)&&(Y.value=O),requestAnimationFrame(()=>{if(a.isTyping||!Y||(R==null?void 0:R.activeElement)!==Y)return;let{selectionStart:J,selectionEnd:ie}=Y;Math.abs((ie??0)-(J??0))===0&&J===0&&Y.setSelectionRange(Y.value.length,Y.value.length)}))},[A,a.comboboxState,R,a.isTyping]),bI(([O],[ee])=>{if(O===0&&ee===1){if(a.isTyping)return;let K=w.current;if(!K)return;let oe=K.value,{selectionStart:Y,selectionEnd:J,selectionDirection:ie}=K;K.value="",K.value=oe,ie!==null?K.setSelectionRange(Y,J,ie):K.setSelectionRange(Y,J)}},[a.comboboxState]);let M=T.useRef(!1),D=Ke(()=>{M.current=!0}),L=Ke(()=>{C.nextFrame(()=>{M.current=!1})}),j=Ke(O=>{switch(l.setIsTyping(!0),O.key){case Gr.Enter:if(a.comboboxState!==0||M.current)return;if(O.preventDefault(),O.stopPropagation(),a.activeOptionIndex===null){l.closeCombobox();return}l.selectActiveOption(),a.mode===0&&l.closeCombobox();break;case Gr.ArrowDown:return O.preventDefault(),O.stopPropagation(),Oi(a.comboboxState,{0:()=>l.goToOption(Gn.Next),1:()=>l.openCombobox()});case Gr.ArrowUp:return O.preventDefault(),O.stopPropagation(),Oi(a.comboboxState,{0:()=>l.goToOption(Gn.Previous),1:()=>{Ar.flushSync(()=>l.openCombobox()),a.value||l.goToOption(Gn.Last)}});case Gr.Home:if(O.shiftKey)break;return O.preventDefault(),O.stopPropagation(),l.goToOption(Gn.First);case Gr.PageUp:return O.preventDefault(),O.stopPropagation(),l.goToOption(Gn.First);case Gr.End:if(O.shiftKey)break;return O.preventDefault(),O.stopPropagation(),l.goToOption(Gn.Last);case Gr.PageDown:return O.preventDefault(),O.stopPropagation(),l.goToOption(Gn.Last);case Gr.Escape:return a.comboboxState!==0?void 0:(O.preventDefault(),a.optionsElement&&!a.optionsPropsRef.current.static&&O.stopPropagation(),a.mode===0&&a.value===null&&E(),l.closeCombobox());case Gr.Tab:if(a.comboboxState!==0)return;a.mode===0&&a.activationTrigger!==1&&l.selectActiveOption(),l.closeCombobox();break}}),z=Ke(O=>{p==null||p(O),a.mode===0&&O.target.value===""&&E(),l.openCombobox()}),Q=Ke(O=>{var ee,K,oe;let Y=(ee=O.relatedTarget)!=null?ee:jl.find(J=>J!==O.currentTarget);if(!((K=a.optionsElement)!=null&&K.contains(Y))&&!((oe=a.buttonElement)!=null&&oe.contains(Y))&&a.comboboxState===0)return O.preventDefault(),a.mode===0&&a.value===null&&E(),l.closeCombobox()}),G=Ke(O=>{var ee,K,oe;let Y=(ee=O.relatedTarget)!=null?ee:jl.find(J=>J!==O.currentTarget);(K=a.buttonElement)!=null&&K.contains(Y)||(oe=a.optionsElement)!=null&&oe.contains(Y)||a.disabled||a.immediate&&a.comboboxState!==0&&C.microTask(()=>{Ar.flushSync(()=>l.openCombobox()),l.setActivationTrigger(1)})}),F=ky(),H=P0e(),{isFocused:$,focusProps:V}=e8({autoFocus:b}),{isHovered:X,hoverProps:I}=Jj({isDisabled:m}),q=T.useMemo(()=>({open:a.comboboxState===0,disabled:m,hover:X,focus:$,autofocus:b}),[a,X,$,b,m]),U=mR({ref:_,id:d,role:"combobox",type:v,"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(O=>!O.dataRef.current.disabled&&a.compare(O.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":F,"aria-describedby":H,"aria-autocomplete":"list",defaultValue:(s=(i=e.defaultValue)!=null?i:a.defaultValue!==void 0?h==null?void 0:h(a.defaultValue):null)!=null?s:a.defaultValue,disabled:m||void 0,autoFocus:b,onCompositionStart:D,onCompositionEnd:L,onKeyDown:j,onChange:z,onFocus:G,onBlur:Q},V,I);return qo()({ourProps:U,theirProps:x,slot:q,defaultTag:_ve,name:"Combobox.Input"})}let Eve="button";function Rve(e,t){var n;let r=Wd("Combobox.Button"),o=Hp("Combobox.Button"),i=Li(t,o.setButtonElement),s=T.useId(),{id:a=`headlessui-combobox-button-${s}`,disabled:l=r.disabled||!1,autoFocus:c=!1,...u}=e,d=b8(r.inputElement),p=Ke(A=>{switch(A.key){case Gr.Space:case Gr.Enter:A.preventDefault(),A.stopPropagation(),r.comboboxState===1&&Ar.flushSync(()=>o.openCombobox()),d();return;case Gr.ArrowDown:A.preventDefault(),A.stopPropagation(),r.comboboxState===1&&(Ar.flushSync(()=>o.openCombobox()),r.value||o.goToOption(Gn.First)),d();return;case Gr.ArrowUp:A.preventDefault(),A.stopPropagation(),r.comboboxState===1&&(Ar.flushSync(()=>o.openCombobox()),r.value||o.goToOption(Gn.Last)),d();return;case Gr.Escape:if(r.comboboxState!==0)return;A.preventDefault(),r.optionsElement&&!r.optionsPropsRef.current.static&&A.stopPropagation(),Ar.flushSync(()=>o.closeCombobox()),d();return;default:return}}),h=Ke(A=>{A.preventDefault(),!C0e(A.currentTarget)&&(A.button===_R.Left&&(r.comboboxState===0?o.closeCombobox():o.openCombobox()),d())}),m=ky([a]),{isFocusVisible:b,focusProps:v}=e8({autoFocus:c}),{isHovered:x,hoverProps:w}=Jj({isDisabled:l}),{pressed:_,pressProps:R}=c0e({disabled:l}),C=T.useMemo(()=>({open:r.comboboxState===0,active:_||r.comboboxState===0,disabled:l,value:r.value,hover:x,focus:b}),[r,x,b,_,l]),E=mR({ref:i,id:a,type:dye(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:h,onKeyDown:p},v,w,R);return qo()({ourProps:E,theirProps:u,slot:C,defaultTag:Eve,name:"Combobox.Button"})}let Pve="div",Tve=a0.RenderStrategy|a0.Static;function kve(e,t){var n,r,o;let i=T.useId(),{id:s=`headlessui-combobox-options-${i}`,hold:a=!1,anchor:l,portal:c=!1,modal:u=!0,transition:d=!1,...p}=e,h=Wd("Combobox.Options"),m=Hp("Combobox.Options"),b=Uye(l);b&&(c=!0);let[v,x]=Yye(b),[w,_]=T.useState(null),R=qye(),C=Li(t,b?v:null,m.setOptionsElement,_),E=Ay(h.optionsElement),A=SR(),[M,D]=v8(d,w,A!==null?(A&ki.Open)===ki.Open:h.comboboxState===0);eye(M,h.inputElement,m.closeCombobox);let L=h.__demoMode?!1:u&&h.comboboxState===0;bye(L,E);let j=h.__demoMode?!1:u&&h.comboboxState===0;J0e(j,{allowed:T.useCallback(()=>[h.inputElement,h.buttonElement,h.optionsElement],[h.inputElement,h.buttonElement,h.optionsElement])}),on(()=>{var U;h.optionsPropsRef.current.static=(U=e.static)!=null?U:!1},[h.optionsPropsRef,e.static]),on(()=>{h.optionsPropsRef.current.hold=a},[h.optionsPropsRef,a]),Cye(h.comboboxState===0,{container:h.optionsElement,accept(U){return U.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:U.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(U){U.setAttribute("role","none")}});let z=ky([(n=h.buttonElement)==null?void 0:n.id]),Q=T.useMemo(()=>({open:h.comboboxState===0,option:void 0}),[h.comboboxState]),G=Ke(()=>{m.setActivationTrigger(0)}),F=Ke(U=>{U.preventDefault(),m.setActivationTrigger(0)}),H=mR(b?R():{},{"aria-labelledby":z,role:"listbox","aria-multiselectable":h.mode===1?!0:void 0,id:s,ref:C,style:{...p.style,...x,"--input-width":uI(h.inputElement,!0).width,"--button-width":uI(h.buttonElement,!0).width},onWheel:h.activationTrigger===0?void 0:G,onMouseDown:F,...y8(D)}),$=M&&h.comboboxState===1,V=u_($,(r=h.virtual)==null?void 0:r.options),X=u_($,h.value),I=Ke(U=>h.compare(X,U));if(h.virtual){if(V===void 0)throw new Error("Missing `options` in virtual mode");Object.assign(p,{children:T.createElement(Uh.Provider,{value:V!==h.virtual.options?{...h,virtual:{...h.virtual,options:V}}:h},T.createElement(vve,{slot:Q},p.children))})}let q=qo();return T.createElement(hve,{enabled:c?e.static||M:!1},T.createElement(Uh.Provider,{value:h.mode===1?h:{...h,isSelected:I}},q({ourProps:H,theirProps:{...p,children:T.createElement(Zye,{freeze:$},typeof p.children=="function"?(o=p.children)==null?void 0:o.call(p,Q):p.children)},slot:Q,defaultTag:Pve,features:Tve,visible:M,name:"Combobox.Options"})))}let Ave="div";function Ove(e,t){var n,r,o,i;let s=Wd("Combobox.Option"),a=Hp("Combobox.Option"),l=T.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:p=null,...h}=e,m=b8(s.inputElement),b=s.virtual?s.activeOptionIndex===s.calculateIndex(u):s.activeOptionIndex===null?!1:((i=s.options[s.activeOptionIndex])==null?void 0:i.id)===c,v=s.isSelected(u),x=T.useRef(null),w=ul({disabled:d,value:u,domRef:x,order:p}),_=T.useContext(R8),R=Li(t,x,_?_.measureElement:null),C=Ke(()=>{a.setIsTyping(!1),a.onChange(u)});on(()=>a.registerOption(c,w),[w,c]);let E=T.useRef(!(s.virtual||s.__demoMode));on(()=>{if(!s.virtual&&!s.__demoMode)return gs().requestAnimationFrame(()=>{E.current=!0})},[s.virtual,s.__demoMode]),on(()=>{if(E.current&&s.comboboxState===0&&b&&s.activationTrigger!==0)return gs().requestAnimationFrame(()=>{var F,H;(H=(F=x.current)==null?void 0:F.scrollIntoView)==null||H.call(F,{block:"nearest"})})},[x,b,s.comboboxState,s.activationTrigger,s.activeOptionIndex]);let A=Ke(F=>{F.preventDefault(),F.button===_R.Left&&(d||(C(),m8()||requestAnimationFrame(()=>m()),s.mode===0&&a.closeCombobox()))}),M=Ke(()=>{if(d)return a.goToOption(Gn.Nothing);let F=s.calculateIndex(u);a.goToOption(Gn.Specific,F)}),D=yye(),L=Ke(F=>D.update(F)),j=Ke(F=>{if(!D.wasMoved(F)||d||b)return;let H=s.calculateIndex(u);a.goToOption(Gn.Specific,H,0)}),z=Ke(F=>{D.wasMoved(F)&&(d||b&&(s.optionsPropsRef.current.hold||a.goToOption(Gn.Nothing)))}),Q=T.useMemo(()=>({active:b,focus:b,selected:v,disabled:d}),[b,v,d]),G={id:c,ref:R,role:"option",tabIndex:d===!0?void 0:-1,"aria-disabled":d===!0?!0:void 0,"aria-selected":v,disabled:void 0,onMouseDown:A,onFocus:M,onPointerEnter:L,onMouseEnter:L,onPointerMove:j,onMouseMove:j,onPointerLeave:z,onMouseLeave:z};return qo()({ourProps:G,theirProps:h,slot:Q,defaultTag:Ave,name:"Combobox.Option"})}let Mve=_o(Sve),P8=_o(Rve),T8=_o(Cve),Ive=N0e,k8=_o(kve),A8=_o(Ove),Dve=Object.assign(Mve,{Input:T8,Button:P8,Label:Ive,Options:k8,Option:A8});function Nve(){let e=T.useRef(!1);return on(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function O8(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:I8)!==T.Fragment||T.Children.count(e.children)===1}let Oy=T.createContext(null);Oy.displayName="TransitionContext";var Lve=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Lve||{});function Fve(){let e=T.useContext(Oy);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function jve(){let e=T.useContext(My);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let My=T.createContext(null);My.displayName="NestingContext";function Iy(e){return"children"in e?Iy(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function M8(e,t){let n=ul(e),r=T.useRef([]),o=Nve(),i=Vd(),s=Ke((h,m=za.Hidden)=>{let b=r.current.findIndex(({el:v})=>v===h);b!==-1&&(Oi(m,{[za.Unmount](){r.current.splice(b,1)},[za.Hidden](){r.current[b].state="hidden"}}),i.microTask(()=>{var v;!Iy(r)&&o.current&&((v=n.current)==null||v.call(n))}))}),a=Ke(h=>{let m=r.current.find(({el:b})=>b===h);return m?m.state!=="visible"&&(m.state="visible"):r.current.push({el:h,state:"visible"}),()=>s(h,za.Unmount)}),l=T.useRef([]),c=T.useRef(Promise.resolve()),u=T.useRef({enter:[],leave:[]}),d=Ke((h,m,b)=>{l.current.splice(0),t&&(t.chains.current[m]=t.chains.current[m].filter(([v])=>v!==h)),t==null||t.chains.current[m].push([h,new Promise(v=>{l.current.push(v)})]),t==null||t.chains.current[m].push([h,new Promise(v=>{Promise.all(u.current[m].map(([x,w])=>w)).then(()=>v())})]),m==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>b(m)):b(m)}),p=Ke((h,m,b)=>{Promise.all(u.current[m].splice(0).map(([v,x])=>x)).then(()=>{var v;(v=l.current.shift())==null||v()}).then(()=>b(m))});return T.useMemo(()=>({children:r,register:a,unregister:s,onStart:d,onStop:p,wait:c,chains:u}),[a,s,r,d,p,u,c])}let I8=T.Fragment,D8=a0.RenderStrategy;function $ve(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:s,beforeLeave:a,afterLeave:l,enter:c,enterFrom:u,enterTo:d,entered:p,leave:h,leaveFrom:m,leaveTo:b,...v}=e,[x,w]=T.useState(null),_=T.useRef(null),R=O8(e),C=Li(...R?[_,t,w]:t===null?[]:[t]),E=(n=v.unmount)==null||n?za.Unmount:za.Hidden,{show:A,appear:M,initial:D}=Fve(),[L,j]=T.useState(A?"visible":"hidden"),z=jve(),{register:Q,unregister:G}=z;on(()=>Q(_),[Q,_]),on(()=>{if(E===za.Hidden&&_.current){if(A&&L!=="visible"){j("visible");return}return Oi(L,{hidden:()=>G(_),visible:()=>Q(_)})}},[L,_,Q,G,A,E]);let F=CR();on(()=>{if(R&&F&&L==="visible"&&_.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[_,L,F,R]);let H=D&&!M,$=M&&A&&D,V=T.useRef(!1),X=M8(()=>{V.current||(j("hidden"),G(_))},z),I=Ke(Y=>{V.current=!0;let J=Y?"enter":"leave";X.onStart(_,J,ie=>{ie==="enter"?i==null||i():ie==="leave"&&(a==null||a())})}),q=Ke(Y=>{let J=Y?"enter":"leave";V.current=!1,X.onStop(_,J,ie=>{ie==="enter"?s==null||s():ie==="leave"&&(l==null||l())}),J==="leave"&&!Iy(X)&&(j("hidden"),G(_))});T.useEffect(()=>{R&&o||(I(A),q(A))},[A,R,o]);let U=!(!o||!R||!F||H),[,O]=v8(U,x,A,{start:I,end:q}),ee=Ra({ref:C,className:((r=s_(v.className,$&&c,$&&u,O.enter&&c,O.enter&&O.closed&&u,O.enter&&!O.closed&&d,O.leave&&h,O.leave&&!O.closed&&m,O.leave&&O.closed&&b,!O.transition&&A&&p))==null?void 0:r.trim())||void 0,...y8(O)}),K=0;L==="visible"&&(K|=ki.Open),L==="hidden"&&(K|=ki.Closed),O.enter&&(K|=ki.Opening),O.leave&&(K|=ki.Closing);let oe=qo();return T.createElement(My.Provider,{value:X},T.createElement(_8,{value:K},oe({ourProps:ee,theirProps:v,defaultTag:I8,features:D8,visible:L==="visible",name:"Transition.Child"})))}function zve(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,s=T.useRef(null),a=O8(e),l=Li(...a?[s,t]:t===null?[]:[t]);CR();let c=SR();if(n===void 0&&c!==null&&(n=(c&ki.Open)===ki.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=T.useState(n?"visible":"hidden"),p=M8(()=>{n||d("hidden")}),[h,m]=T.useState(!0),b=T.useRef([n]);on(()=>{h!==!1&&b.current[b.current.length-1]!==n&&(b.current.push(n),m(!1))},[b,n]);let v=T.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);on(()=>{n?d("visible"):!Iy(p)&&s.current!==null&&d("hidden")},[n,p]);let x={unmount:o},w=Ke(()=>{var C;h&&m(!1),(C=e.beforeEnter)==null||C.call(e)}),_=Ke(()=>{var C;h&&m(!1),(C=e.beforeLeave)==null||C.call(e)}),R=qo();return T.createElement(My.Provider,{value:p},T.createElement(Oy.Provider,{value:v},R({ourProps:{...x,as:T.Fragment,children:T.createElement(N8,{ref:l,...x,...i,beforeEnter:w,beforeLeave:_})},theirProps:{},defaultTag:T.Fragment,features:D8,visible:u==="visible",name:"Transition"})))}function Bve(e,t){let n=T.useContext(Oy)!==null,r=SR()!==null;return T.createElement(T.Fragment,null,!n&&r?T.createElement(d_,{ref:t,...e}):T.createElement(N8,{ref:t,...e}))}let d_=_o(zve),N8=_o($ve),Hve=_o(Bve),Vve=Object.assign(d_,{Child:Hve,Root:d_});var RR="Checkbox",[Wve,vOe]=rr(RR),[Uve,Gve]=Wve(RR),L8=P.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[p,h]=P.useState(null),m=st(t,R=>h(R)),b=P.useRef(!1),v=p?u||!!p.closest("form"):!0,[x=!1,w]=Dr({prop:o,defaultProp:i,onChange:c}),_=P.useRef(x);return P.useEffect(()=>{const R=p==null?void 0:p.form;if(R){const C=()=>w(_.current);return R.addEventListener("reset",C),()=>R.removeEventListener("reset",C)}},[p,w]),y.jsxs(Uve,{scope:n,state:x,disabled:a,children:[y.jsx(je.button,{type:"button",role:"checkbox","aria-checked":Va(x)?"mixed":x,"aria-required":s,"data-state":$8(x),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onKeyDown:Pe(e.onKeyDown,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Pe(e.onClick,R=>{w(C=>Va(C)?!0:!C),v&&(b.current=R.isPropagationStopped(),b.current||R.stopPropagation())})}),v&&y.jsx(qve,{control:p,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"},defaultChecked:Va(i)?!1:i})]})});L8.displayName=RR;var F8="CheckboxIndicator",j8=P.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=Gve(F8,n);return y.jsx(Kn,{present:r||Va(i.state)||i.state===!0,children:y.jsx(je.span,{"data-state":$8(i.state),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});j8.displayName=F8;var qve=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:o,...i}=e,s=P.useRef(null),a=my(n),l=ay(t);P.useEffect(()=>{const u=s.current,d=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==n&&h){const m=new Event("click",{bubbles:r});u.indeterminate=Va(n),h.call(u,Va(n)?!1:n),u.dispatchEvent(m)}},[a,n,r]);const c=P.useRef(Va(n)?!1:n);return y.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:o??c.current,...i,tabIndex:-1,ref:s,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Va(e){return e==="indeterminate"}function $8(e){return Va(e)?"indeterminate":e?"checked":"unchecked"}var z8=L8,Yve=j8;const Dy=P.forwardRef(({className:e,...t},n)=>y.jsx(z8,{ref:n,className:me("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:y.jsx(Yve,{className:me("flex items-center justify-center text-current"),children:y.jsx(Id,{className:"h-4 w-4"})})}));Dy.displayName=z8.displayName;function Kve(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 Xve(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 Ad(e)?o:r}function Qve(e){const t=ye(i=>{var s,a;return(a=(s=i==null?void 0:i.dashboard)==null?void 0:s.filters)==null?void 0:a.find(l=>l.id===e)}),{query:n,setQuery:r,...o}=PR(t||{});return o}function PR(e){const[t,n]=T.useState([]),[r,o]=T.useState(""),i=ye(E=>E.filterValues),s=ye(E=>E.selectedSheetId),{addOrUpdateFilterValue:a,removeFilterValues:l}=Hn(),{data:c,isLoading:u,isFetching:d,isError:p}=Vj(e),h=T.useMemo(()=>{var A;return e.column?(A=c==null?void 0:c.records)==null?void 0:A.map(M=>{let D=e.column.split(".").slice(-1)[0].replace(/"/g,"");return M[D]===void 0&&(D=D.toLowerCase()),{id:M[D],value:M[D]}}):[]},[c,e.column]);T.useEffect(()=>{if(i){const E=i.find(A=>A.filterId===e.id);if(!E){n([]);return}if(E.operation==="in"){const A=h==null?void 0:h.filter(M=>E.values.includes(M.value));A&&n(A)}}},[c,s,i,e.id,h]),T.useEffect(()=>{if(i&&!i.find(A=>A.filterId===e.id)){n([]);return}},[i,e.id]);function m(E){const A=Kve(E[0].toString());if(!(A!=null&&A.value)||!(A!=null&&A.operation))return;const M={filterId:e.id,connectionType:e.database==="NA"?"api":"database",valueType:Ou(e),name:e.column,operation:A.operation,values:[Number(A.value)]};a(M)}function b(E){if(Array.isArray(E)||(E=[E]),E.length===1&&h.find(M=>M.value===E[0].value)===void 0){m(E);return}if(n(E),E.length===0){l(e.id);return}const A={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Ou(e),operation:e.operation,values:E.map(M=>M.value)};a(A)}function v(){n([]),l(e.id)}function x(E){if(E){n(h);const A={filterId:e.id,connectionType:e.database==="NA"?"api":"database",name:e.column,valueType:Ou(e),operation:e.operation,values:h.map(M=>M.value)};a(A)}else v()}function w(){if(up(e.dataType))return h;const E=r.toLowerCase().replace(/\s+/g,"");return r===""?h:h.filter(A=>A.value.toLowerCase().replace(/\s+/g,"").includes(E))}const _=w(),R=e.type==="single",C=t.length===(h==null?void 0:h.length);return{isLoading:u,isFetching:d,isError:p,records:h,selectedRecords:t,handleChange:b,handleClear:v,handleSelectAll:x,query:r,setQuery:o,filteredRecords:_,isSingleSelect:R,allSelected:C}}function Zve({filter:e}){var h,m,b,v,x,w;const t=ye(_=>_.themeStyle),{filteredRecords:n,isSingleSelect:r,allSelected:o,handleChange:i,handleSelectAll:s,query:a,setQuery:l,isLoading:c,isFetching:u,isError:d,selectedRecords:p}=PR(e);return c||u?y.jsx(Iu,{style:{borderRadius:(m=(h=t==null?void 0:t.chart)==null?void 0:h.options)==null?void 0:m.borderRadius},className:"h-8 w-full bg-foreground/10"}):d?y.jsx("div",{className:"flex h-8 w-full items-center bg-muted px-2 text-sm",children:"Error"}):y.jsx("div",{className:"w-full",children:y.jsx(Dve,{value:p,multiple:!r,onChange:i,children:y.jsxs("div",{className:"relative",children:[y.jsxs("div",{style:{borderRadius:(v=(b=t==null?void 0:t.chart)==null?void 0:b.options)==null?void 0:v.borderRadius},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:[y.jsx(T8,{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:_=>_.map(C=>C.value).join(", "),onChange:_=>{l(_.target.value)}}),y.jsx(P8,{className:"absolute inset-y-0 right-0 flex items-center bg-background pl-1 pr-2",children:y.jsx(bp,{className:"size-4 text-gray-400","aria-hidden":"true"})})]}),y.jsx(Vve,{as:T.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",afterLeave:()=>l(""),children:y.jsxs(k8,{style:{borderRadius:(w=(x=t==null?void 0:t.chart)==null?void 0:x.options)==null?void 0:w.borderRadius},className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-sm border bg-background py-1 text-base text-foreground/80 shadow-lg focus:outline-none sm:text-sm",children:[e.type==="multiple"||e.type===void 0&&y.jsxs("div",{className:"flex items-center justify-between gap-2 border-b border-b-muted px-4 py-2",children:[y.jsx("span",{children:"Select All"}),y.jsx(Dy,{className:"border-muted-foreground/50",checked:o,onCheckedChange:s})]}),(n==null?void 0:n.length)===0&&a!==""?y.jsx("div",{className:"relative cursor-default select-none px-4 py-2 text-gray-700",children:"Nothing found."}):n==null?void 0:n.map(_=>{var R,C;return y.jsx(A8,{style:{borderRadius:(C=(R=t==null?void 0:t.chart)==null?void 0:R.options)==null?void 0:C.borderRadius},className:({active:E})=>`relative m-1 cursor-default select-none py-2 pl-10 pr-4 ${E?"bg-muted":"text-foreground-900"}`,value:_,children:({selected:E,active:A})=>y.jsxs("div",{className:"",children:[y.jsx("span",{className:`block ${E?"font-medium":"font-normal"}`,children:typeof _.value=="boolean"?_.value?"True":"False":_.value}),E?y.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-3 text-foreground",children:y.jsx(zC,{className:"size-4","aria-hidden":"true"})}):null]})},_.value)})]})})]})})})}var TR="Radio",[Jve,B8]=rr(TR),[exe,txe]=Jve(TR),H8=P.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,p]=P.useState(null),h=st(t,v=>p(v)),m=P.useRef(!1),b=d?c||!!d.closest("form"):!0;return y.jsxs(exe,{scope:n,checked:o,disabled:s,children:[y.jsx(je.button,{type:"button",role:"radio","aria-checked":o,"data-state":U8(o),"data-disabled":s?"":void 0,disabled:s,value:a,...u,ref:h,onClick:Pe(e.onClick,v=>{o||l==null||l(),b&&(m.current=v.isPropagationStopped(),m.current||v.stopPropagation())})}),b&&y.jsx(nxe,{control:d,bubbles:!m.current,name:r,value:a,checked:o,required:i,disabled:s,form:c,style:{transform:"translateX(-100%)"}})]})});H8.displayName=TR;var V8="RadioIndicator",W8=P.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...o}=e,i=txe(V8,n);return y.jsx(Kn,{present:r||i.checked,children:y.jsx(je.span,{"data-state":U8(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t})})});W8.displayName=V8;var nxe=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=P.useRef(null),s=my(n),a=ay(t);return P.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const p=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(p)}},[s,n,r]),y.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 U8(e){return e?"checked":"unchecked"}var rxe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],kR="RadioGroup",[oxe,xOe]=rr(kR,[Md,B8]),G8=Md(),q8=B8(),[ixe,sxe]=oxe(kR),Y8=P.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,...p}=e,h=G8(n),m=Lc(c),[b,v]=Dr({prop:i,defaultProp:o,onChange:d});return y.jsx(ixe,{scope:n,name:r,required:s,disabled:a,value:b,onValueChange:v,children:y.jsx(uC,{asChild:!0,...h,orientation:l,dir:m,loop:u,children:y.jsx(je.div,{role:"radiogroup","aria-required":s,"aria-orientation":l,"data-disabled":a?"":void 0,dir:m,...p,ref:t})})})});Y8.displayName=kR;var K8="RadioGroupItem",X8=P.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...o}=e,i=sxe(K8,n),s=i.disabled||r,a=G8(n),l=q8(n),c=P.useRef(null),u=st(t,c),d=i.value===o.value,p=P.useRef(!1);return P.useEffect(()=>{const h=b=>{rxe.includes(b.key)&&(p.current=!0)},m=()=>p.current=!1;return document.addEventListener("keydown",h),document.addEventListener("keyup",m),()=>{document.removeEventListener("keydown",h),document.removeEventListener("keyup",m)}},[]),y.jsx(dC,{asChild:!0,...a,focusable:!s,active:d,children:y.jsx(H8,{disabled:s,required:i.required,checked:d,...l,...o,name:i.name,ref:u,onCheck:()=>i.onValueChange(o.value),onKeyDown:Pe(h=>{h.key==="Enter"&&h.preventDefault()}),onFocus:Pe(o.onFocus,()=>{var h;p.current&&((h=c.current)==null||h.click())})})})});X8.displayName=K8;var axe="RadioGroupIndicator",Q8=P.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,o=q8(n);return y.jsx(W8,{...o,...r,ref:t})});Q8.displayName=axe;var Z8=Y8,J8=X8,lxe=Q8;const Gh=P.forwardRef(({className:e,...t},n)=>y.jsx(Z8,{className:me("grid gap-2",e),...t,ref:n}));Gh.displayName=Z8.displayName;const ql=P.forwardRef(({className:e,...t},n)=>y.jsx(J8,{ref:n,className:me("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:y.jsx(lxe,{className:"flex items-center justify-center",children:y.jsx(HC,{className:"h-2.5 w-2.5 fill-current text-current"})})}));ql.displayName=J8.displayName;function cxe({filter:e}){var i;const{filteredRecords:t,handleChange:n,selectedRecords:r}=PR(e);function o(s){n([{value:s,id:s}])}return y.jsx(Gh,{onValueChange:o,value:((i=r==null?void 0:r[0])==null?void 0:i.value)||"",className:"mt-2 flex gap-3 overflow-x-auto",children:t==null?void 0:t.map(s=>y.jsxs("div",{className:"flex gap-2",children:[y.jsx(ql,{value:s.value,id:"r1"}),y.jsx(wn,{className:"text-muted-foreground",htmlFor:"r1",children:s.value})]},s.value))})}function AR({filter:e}){return Ad(e.dataType)?y.jsx(Bbe,{filter:e}):e.uiType==="radio"&&e.type==="single"?y.jsx(cxe,{filter:e}):y.jsx(Zve,{filter:e})}function uxe({frame:e}){const[t,n]=T.useState(!1),r=e==null?void 0:e.cards[0],{data:o}=Ga(r),i=e==null?void 0:e.cards[1],{data:s,isLoading:a,isFetching:l}=Ga(i);return(i==null?void 0:i.type)!=="text"?y.jsx(qb,{card:r,data:(o==null?void 0:o.records)||[]}):y.jsxs(pc,{className:me("group relative overflow-y-auto",t?"m-4":"mx-0"),children:[t?y.jsx("div",{className:"overflow-y-auto break-words p-1",children:y.jsx(Jb,{card:i,data:(s==null?void 0:s.records)||[],isLoading:!1})}):y.jsx(qb,{card:r,data:(o==null?void 0:o.records)||[]}),y.jsx("div",{className:me("fixed z-10",{"invisible bottom-4 right-4 group-hover:visible":t,"right-6 top-6":!t}),children:y.jsx(Cy,{disabled:a||l,className:me("h-7 p-1"),pressed:t,onPressedChange:n,"aria-label":"Toggle bold",children:t?y.jsx(gL,{className:"size-4 text-muted-foreground/70"}):y.jsx(mL,{className:"size-4 text-muted-foreground/70"})})})]})}function dxe({card:e,frame:t}){var G,F,H;const{customCards:n,placeholders:r}=Go(),o=ye($=>$.themeStyle),i=ye($=>$.selectedSheetId),s=ye($=>$.isDashboardEditing),a=ye($=>$.selectedLensId),l=ye($=>$.dashboard.filters),c=l==null?void 0:l.find($=>$.id===t.filterId&&!$.hide),{setCardTitle:u,setCardDescription:d,setSelectedFrameId:p,updateFilter:h}=Hn(),{updateFrame:m}=Hn(),b=((G=e.customCardPreferences)==null?void 0:G.showCardHeader)??!0,{isError:v,isLoading:x,isFetching:w,cfg:_,visualKey:R,data:C,handleDatapointClick:E}=O4(e);function A(){var $,V,X;if(n&&n.length>0){const I=n.find(q=>q.cardId===e.id);if(I&&I.replaceDefault){const q=I.content;if(q)return y.jsx(q,{card:e})}}if(e.type==="kpi"){if((($=t==null?void 0:t.cards)==null?void 0:$.length)===1)return y.jsx(qb,{card:e,data:(C==null?void 0:C.records)||[]});if(((V=t==null?void 0:t.cards)==null?void 0:V.length)>1)return y.jsx(uxe,{frame:t})}return e.type==="text"&&((X=t==null?void 0:t.cards)==null?void 0:X.length)===1?y.jsx(pc,{className:"mx-3 my-6 overflow-y-auto break-words px-3",children:y.jsx(Jb,{isLoading:x||w,card:e,data:(C==null?void 0:C.records)||[]})}):Q}function M(){return["{{ filters | where }}","{{ filters | and }}"].some(V=>{var X;return(X=e.sql)==null?void 0:X.includes(V)})?y.jsx(kde,{}):null}function D(){if(v)return y.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[y.jsx(wL,{className:"size-8 text-destructive"}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"Error fetching data. Check your card settings."})]});if(C!=null&&C.records&&(C==null?void 0:C.records.length)===0)return r!=null&&r.NoRecords?y.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:r.NoRecords}):y.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[y.jsx(PL,{className:"size-8 text-muted-foreground"}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"No records to display"})]});if(e.type==="table"&&(C!=null&&C.records)&&(C==null?void 0:C.records.length)>0)return y.jsxs(pc,{className:"relative flex h-full min-h-0 w-full flex-1 grow basis-0",children:[y.jsx(Z6,{card:e,data:(C==null?void 0:C.records)||[]}),y.jsx(Ip,{orientation:"horizontal"})]});if(e.type==="text")return y.jsx(pc,{className:"overflow-y-auto break-words pr-2",children:y.jsx(Jb,{isLoading:x||w,card:e,data:(C==null?void 0:C.records)||[]})});if(e.type==="custom")return y.jsx(mpe,{frame:t,card:e});if(n&&n.length>0){const $=n.find(V=>V.cardId===e.id);if($&&$.content){const V=$.content;return y.jsx(V,{card:e})}}if(_)return y.jsx(QE,{cfg:_,onDatapointClick:E},`${R}-${a}`)}function L(){if(n&&n.length>0){const $=n.find(V=>V.cardId===e.id);if($&&$.footer){const V=$.footer;if(V)return y.jsx(V,{card:e})}}return null}function j(){var $,V,X;return y.jsx(pC,{value:t.activeCardId,className:"flex items-center justify-end gap-3",onValueChange:I=>{const q={...t,activeCardId:I};m(i,q)},children:y.jsx(M0,{style:{borderRadius:(V=($=o==null?void 0:o.chart)==null?void 0:$.options)==null?void 0:V.borderRadius},className:"flex-end flex-wrap items-center",children:(X=t.cards.filter(I=>{var q;return!((q=I.tabTitle)!=null&&q.endsWith("__Header"))&&(I.displayTab===!0||I.displayTab===void 0)}))==null?void 0:X.map(I=>{var q,U;return y.jsx(I0,{style:{borderRadius:(U=(q=o==null?void 0:o.chart)==null?void 0:q.options)==null?void 0:U.borderRadius},value:I.id,children:I.tabTitle||I.title},I.id)})})})}function z(){let $=t.cards.find(V=>V.type==="kpi"&&V.tabTitle===`${e.tabTitle}__Header`);return $||($=t.cards.find(V=>V.type==="kpi"&&V.tabTitle==="All__Header")),$?y.jsx("div",{className:"flex items-end gap-2",children:y.jsx(Fue,{renderFilterInfo:M,card:$})}):y.jsxs(y.Fragment,{children:[y.jsxs("div",{role:"card-title-container",className:"flex items-center gap-2",children:[y.jsx(ss,{text:e.title,onSave:V=>u(i,e.id,V),children:y.jsx(Od,{className:me("text-base",{}),children:e.title})}),(s||e.info)&&y.jsx(h3,{card:e}),e.refreshInterval&&y.jsxs(w3,{children:[y.jsx(S3,{className:"pr-1",children:y.jsx("div",{className:me("h-2 w-2 rounded-full bg-green-500 transition-opacity",{"opacity-10":x||w})})}),y.jsx($E,{side:"right",align:"center",children:y.jsx("p",{className:"text-xs",children:`Realtime (${e==null?void 0:e.refreshInterval})`})})]}),M()]}),y.jsx("div",{role:"card-description-container",children:y.jsx(ss,{text:(e==null?void 0:e.description)||"",onSave:V=>d(i,e.id,V),children:y.jsxs(lC,{className:me("",{}),children:[" ",e.description]})})})]})}if(!e.id)return null;const Q=y.jsxs(y.Fragment,{children:[b?y.jsx(P0,{children:y.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[y.jsx("div",{className:"grow",role:"header-container",children:z()}),y.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.cards.length>1&&j(),y.jsx("div",{children:c&&y.jsxs("div",{style:{borderRadius:(H=(F=o==null?void 0:o.chart)==null?void 0:F.options)==null?void 0:H.borderRadius},role:"frame-filter-container",className:"flex h-10 shrink-0 items-center bg-muted p-1",children:[!Ad(c.dataType)&&y.jsx(ss,{className:"my-1",containerClassName:"shrink-0",text:c.title||c.column,onSave:$=>h({...c,title:$}),children:y.jsx(wn,{className:"px-3",children:c.title})}),y.jsx(AR,{filter:c})]})})]})]})}):y.jsx("div",{className:"h-8"}),y.jsx(T0,{className:"relative flex min-h-0 grow flex-col",children:D()}),y.jsx(qN,{children:L()})]});return y.jsx("div",{className:me("flex h-full flex-col",{"animate-pulse":x||w}),children:A()})}function fxe({frame:e,footer:t,className:n,...r}){var b,v;const o=T.useRef(null),i=ye(x=>x.themeStyle),s=ye(x=>x.selectedFrameId),a=ye(x=>x.isDashboardEditing),{setSelectedFrameId:l}=Hn(),{setSelectedConnectionId:c,setSelectedDatabaseName:u,setSelectedSchemaName:d,setSelectedTableName:p}=mp(),h=e.cards.find(x=>x.id===e.activeCardId);tte(e,o);function m(x){x.stopPropagation(),l(e.id),h!=null&&h.connectionId&&c(h==null?void 0:h.connectionId),h!=null&&h.lastSelectedDatabase&&u(h==null?void 0:h.lastSelectedDatabase),h!=null&&h.lastSelectedSchema&&d(h==null?void 0:h.lastSelectedSchema),h!=null&&h.lastSelectedTable&&p(h==null?void 0:h.lastSelectedTable)}return y.jsx(Y0,{FallbackComponent:UC,children:y.jsxs("div",{tabIndex:-1,ref:o,role:"card-frame",onClick:m,style:{borderRadius:(v=(b=i==null?void 0:i.chart)==null?void 0:b.options)==null?void 0:v.borderRadius},className:me("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:[y.jsx(AL,{frame:e}),y.jsx(dxe,{card:h,frame:e},h.id)]})})}const OR=P.forwardRef(({className:e,...t},n)=>y.jsx("textarea",{className:me("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}));OR.displayName="Textarea";function hxe({label:e,onCheckedChange:t,checked:n}){return y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(Dy,{onCheckedChange:t,id:"terms",checked:n}),y.jsx("label",{htmlFor:"terms",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:e})]})}function e9({text:e,className:t}){const[n,r]=T.useState(!1);return y.jsx(nr,{className:me("h-7 w-fit px-1 font-mono text-xs text-muted-foreground/70",t),variant:"ghost",size:"icon",onClick:()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>{r(!1)},1e3)},children:n?y.jsx(zC,{className:"size-3.5"}):y.jsx(VC,{className:"size-3.5"})})}function pxe({filter:e}){const[t,n]=T.useState(e.sql),[r,o]=T.useState(!1),i=ye(h=>h.selectedSheetId),{updateFilter:s,updateFilterId:a}=Hn();function l(){const h={...e,sql:t};s(h),o(!1)}function c(h){console.log("operation",h);const m={...e,operation:h};s(m)}function u(h){const m={...e,type:h};s(m)}function d(h){const m={...e,uiType:h};s(m)}function p(h){if(!i)return;const m={...e,sheetId:h?i:void 0};s(m)}return y.jsxs(Sy,{open:r,onOpenChange:o,children:[y.jsx(_y,{children:y.jsx(CL,{className:"invisible h-3 w-3 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"})}),y.jsxs(Mp,{onMouseDown:h=>h.stopPropagation(),onDoubleClick:h=>h.stopPropagation(),className:"z-50 m-2 w-full min-w-[350px] space-y-4",children:[y.jsxs("div",{className:"space-y-2",children:[y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("p",{className:"font-semibold text-foreground",children:e.column}),y.jsx("div",{className:"flex items-center gap-2",children:y.jsxs(Rp,{children:[y.jsx(Pp,{children:y.jsx(hL,{className:"size-5 cursor-pointer text-muted-foreground hover:text-foreground/80"})}),y.jsxs(Bd,{align:"start",className:"flex w-auto items-center gap-2 px-3 py-2",children:[y.jsx("p",{className:"font-mono text-xs text-muted-foreground",children:e.id}),y.jsx(e9,{text:e.id})]})]})})]}),y.jsx("p",{className:"text-sm text-muted-foreground",children:"Customize filter operation and SQL"})]}),y.jsx(hy,{}),y.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[y.jsxs("div",{className:"space-y-2",children:[y.jsx(wn,{children:"Type"}),y.jsxs(Gh,{onValueChange:u,value:e.type||"multiple",className:"flex gap-3",defaultValue:"x",children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(ql,{value:"multiple",id:"r1"}),y.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Multiple"})]}),y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(ql,{value:"single",id:"r2"}),y.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Single"})]})]})]}),e.type==="single"&&y.jsxs("div",{className:"space-y-2",children:[y.jsx(wn,{children:"Filter Element"}),y.jsxs(Gh,{onValueChange:d,value:e.uiType||"dropdown",className:"flex gap-3",defaultValue:"x",children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(ql,{value:"dropdown",id:"r2"}),y.jsx("label",{className:"text-sm",htmlFor:"r2",children:"Dropdown"})]}),y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(ql,{value:"radio",id:"r1"}),y.jsx("label",{className:"text-sm",htmlFor:"r1",children:"Radio"})]})]})]})]}),y.jsxs("div",{className:"grid grid-cols-6 gap-4 text-sm",children:[y.jsxs("div",{className:"col-span-2 space-y-1",children:[y.jsx(wn,{children:"Table Column"}),y.jsx(wn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.column})]}),y.jsxs("div",{className:"col-span-2 space-y-1",children:[y.jsx(wn,{children:"Data Type"}),y.jsx(wn,{className:"block rounded-md bg-muted p-2 font-mono text-xs",children:e.dataType})]}),y.jsxs("div",{className:"col-span-2 space-y-1",children:[y.jsx(wn,{className:"text-sm",children:"Filter Operation"}),y.jsx(gxe,{updateFilterOperation:c,value:e.operation})]})]}),y.jsxs("div",{className:"flex grow flex-col space-y-1",role:"container",children:[y.jsx(wn,{className:"text-sm",children:"Values SQL"}),y.jsx(OR,{onKeyDown:h=>{h.stopPropagation()},value:t,onChange:h=>n(h.target.value),className:`min-w-full grow resize font-mono text-xs ${nh}`})]}),y.jsx("div",{children:y.jsx(hxe,{label:"Local to sheet",onCheckedChange:p,checked:!!e.sheetId})}),y.jsx("div",{className:"flex justify-end gap-2",children:y.jsxs(nr,{onClick:l,size:"sm",variant:"outline",children:[y.jsx(Id,{className:"mr-2 size-4"}),"Accept"]})})]})]})}function gxe({value:e,updateFilterOperation:t}){return y.jsxs(Hs,{defaultValue:"in",value:e,onValueChange:n=>t(n),children:[y.jsx(Ui,{className:"h-8 w-[180px] focus:ring-0 focus:ring-offset-0",children:y.jsx(Vs,{placeholder:"Operation"})}),y.jsxs(Gi,{children:[y.jsx(In,{value:"=",children:"Equals"}),y.jsx(In,{value:"in",children:"Contains"}),y.jsx(In,{value:"like",children:"Like"})]})]})}function t9({filter:e}){const t=ye(a=>a.isDashboardEditing),n=ye(a=>a.filterValues),r=n==null?void 0:n.some(a=>a.filterId===e.id),{removeFilterValues:o,removeFilter:i,updateFilter:s}=Hn();return y.jsx(ss,{className:"my-1",text:e.title||e.column,onSave:a=>s({...e,title:a}),children:y.jsxs("div",{className:"group mb-1 flex grow items-center justify-between",children:[y.jsxs("div",{className:"flex grow items-center gap-2",children:[y.jsx(wn,{className:"inline-block text-sm",children:e.title}),r&&y.jsx("button",{onClick:()=>o(e.id),className:"text-foreground/30 hover:text-foreground/50",children:y.jsx(WC,{className:"size-3.5"})}),t&&y.jsx("button",{className:"invisible group-hover:visible",onClick:()=>{s({...e,hide:!e.hide})},children:e.hide?y.jsx(uL,{className:"size-3.5 text-foreground/50 hover:text-foreground/70"}):y.jsx(cL,{className:"size-3.5 text-foreground/50 hover:text-foreground/70"})}),t&&y.jsx(pxe,{filter:e})]}),y.jsx("div",{className:"flex items-center gap-2",children:t&&y.jsx($c,{onClick:()=>{o(e.id),i(e.id)},className:"size-3.5 cursor-pointer text-foreground/30 hover:cursor-pointer hover:text-foreground/50"})})]})})}var mxe=e=>{switch(e){case"success":return vxe;case"info":return wxe;case"warning":return xxe;case"error":return Sxe;default:return null}},bxe=Array(12).fill(0),yxe=({visible:e,className:t})=>T.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},T.createElement("div",{className:"sonner-spinner"},bxe.map((n,r)=>T.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),vxe=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),xxe=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},T.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"})),wxe=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),Sxe=T.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},T.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"})),_xe=T.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"},T.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),T.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Cxe=()=>{let[e,t]=T.useState(document.hidden);return T.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},f_=1,Exe=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 this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),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=>(this.dismissedToasts.add(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,i,s=r.then(async l=>{if(i=["resolve",l],T.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(Pxe(l)&&!l.ok){o=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:c,description:u})}else if(t.success!==void 0){o=!1;let c=typeof t.success=="function"?await t.success(l):t.success,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:c,description:u})}}).catch(async l=>{if(i=["reject",l],t.error!==void 0){o=!1;let c=typeof t.error=="function"?await t.error(l):t.error,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:c,description:u})}}).finally(()=>{var l;o&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,c)=>s.then(()=>i[0]==="reject"?c(i[1]):l(i[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||f_++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},po=new Exe,Rxe=(e,t)=>{let n=(t==null?void 0:t.id)||f_++;return po.addToast({title:e,...t,id:n}),n},Pxe=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Txe=Rxe,kxe=()=>po.toasts,Axe=()=>po.getActiveToasts(),n9=Object.assign(Txe,{success:po.success,info:po.info,warning:po.warning,error:po.error,custom:po.custom,message:po.message,promise:po.promise,dismiss:po.dismiss,loading:po.loading},{getHistory:kxe,getToasts:Axe});function Oxe(e,{insertAt:t}={}){if(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))}Oxe(`: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;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-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;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}[data-sonner-toast] [data-close-button]{background:var(--gray1)}: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:-50%;right:-50%;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-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);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-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--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-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[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%)}
|
|
391
|
+
`);function Dm(e){return e.label!==void 0}var Mxe=3,Ixe="32px",Dxe="16px",RI=4e3,Nxe=356,Lxe=14,Fxe=20,jxe=200;function xi(...e){return e.filter(Boolean).join(" ")}function $xe(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var zxe=e=>{var t,n,r,o,i,s,a,l,c,u,d;let{invert:p,toast:h,unstyled:m,interacting:b,setHeights:v,visibleToasts:x,heights:w,index:_,toasts:R,expanded:C,removeToast:E,defaultRichColors:A,closeButton:M,style:D,cancelButtonStyle:L,actionButtonStyle:j,className:z="",descriptionClassName:Q="",duration:G,position:F,gap:H,loadingIcon:$,expandByDefault:V,classNames:X,icons:I,closeButtonAriaLabel:q="Close toast",pauseWhenPageIsHidden:U}=e,[O,ee]=T.useState(null),[K,oe]=T.useState(null),[Y,J]=T.useState(!1),[ie,de]=T.useState(!1),[he,ae]=T.useState(!1),[ge,ue]=T.useState(!1),[Ee,Te]=T.useState(!1),[Le,Ae]=T.useState(0),[Fe,tt]=T.useState(0),at=T.useRef(h.duration||G||RI),cn=T.useRef(null),St=T.useRef(null),Vn=_===0,Rt=_+1<=x,fe=h.type,_e=h.dismissible!==!1,He=h.className||"",We=h.descriptionClassName||"",rt=T.useMemo(()=>w.findIndex($e=>$e.toastId===h.id)||0,[w,h.id]),An=T.useMemo(()=>{var $e;return($e=h.closeButton)!=null?$e:M},[h.closeButton,M]),Fn=T.useMemo(()=>h.duration||G||RI,[h.duration,G]),Rn=T.useRef(0),sn=T.useRef(0),jn=T.useRef(0),Xt=T.useRef(null),[or,Xn]=F.split("-"),Yo=T.useMemo(()=>w.reduce(($e,_t,Ut)=>Ut>=rt?$e:$e+_t.height,0),[w,rt]),xr=Cxe(),ji=h.invert||p,wr=fe==="loading";sn.current=T.useMemo(()=>rt*H+Yo,[rt,Yo]),T.useEffect(()=>{at.current=Fn},[Fn]),T.useEffect(()=>{J(!0)},[]),T.useEffect(()=>{let $e=St.current;if($e){let _t=$e.getBoundingClientRect().height;return tt(_t),v(Ut=>[{toastId:h.id,height:_t,position:h.position},...Ut]),()=>v(Ut=>Ut.filter(Qn=>Qn.toastId!==h.id))}},[v,h.id]),T.useLayoutEffect(()=>{if(!Y)return;let $e=St.current,_t=$e.style.height;$e.style.height="auto";let Ut=$e.getBoundingClientRect().height;$e.style.height=_t,tt(Ut),v(Qn=>Qn.find(Zn=>Zn.toastId===h.id)?Qn.map(Zn=>Zn.toastId===h.id?{...Zn,height:Ut}:Zn):[{toastId:h.id,height:Ut,position:h.position},...Qn])},[Y,h.title,h.description,v,h.id]);let Lr=T.useCallback(()=>{de(!0),Ae(sn.current),v($e=>$e.filter(_t=>_t.toastId!==h.id)),setTimeout(()=>{E(h)},jxe)},[h,E,v,sn]);T.useEffect(()=>{if(h.promise&&fe==="loading"||h.duration===1/0||h.type==="loading")return;let $e;return C||b||U&&xr?(()=>{if(jn.current<Rn.current){let _t=new Date().getTime()-Rn.current;at.current=at.current-_t}jn.current=new Date().getTime()})():at.current!==1/0&&(Rn.current=new Date().getTime(),$e=setTimeout(()=>{var _t;(_t=h.onAutoClose)==null||_t.call(h,h),Lr()},at.current)),()=>clearTimeout($e)},[C,b,h,fe,U,xr,Lr]),T.useEffect(()=>{h.delete&&Lr()},[Lr,h.delete]);function fl(){var $e,_t,Ut;return I!=null&&I.loading?T.createElement("div",{className:xi(X==null?void 0:X.loader,($e=h==null?void 0:h.classNames)==null?void 0:$e.loader,"sonner-loader"),"data-visible":fe==="loading"},I.loading):$?T.createElement("div",{className:xi(X==null?void 0:X.loader,(_t=h==null?void 0:h.classNames)==null?void 0:_t.loader,"sonner-loader"),"data-visible":fe==="loading"},$):T.createElement(yxe,{className:xi(X==null?void 0:X.loader,(Ut=h==null?void 0:h.classNames)==null?void 0:Ut.loader),visible:fe==="loading"})}return T.createElement("li",{tabIndex:0,ref:St,className:xi(z,He,X==null?void 0:X.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,X==null?void 0:X.default,X==null?void 0:X[fe],(n=h==null?void 0:h.classNames)==null?void 0:n[fe]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:A,"data-styled":!(h.jsx||h.unstyled||m),"data-mounted":Y,"data-promise":!!h.promise,"data-swiped":Ee,"data-removed":ie,"data-visible":Rt,"data-y-position":or,"data-x-position":Xn,"data-index":_,"data-front":Vn,"data-swiping":he,"data-dismissible":_e,"data-type":fe,"data-invert":ji,"data-swipe-out":ge,"data-swipe-direction":K,"data-expanded":!!(C||V&&Y),style:{"--index":_,"--toasts-before":_,"--z-index":R.length-_,"--offset":`${ie?Le:sn.current}px`,"--initial-height":V?"auto":`${Fe}px`,...D,...h.style},onDragEnd:()=>{ae(!1),ee(null),Xt.current=null},onPointerDown:$e=>{wr||!_e||(cn.current=new Date,Ae(sn.current),$e.target.setPointerCapture($e.pointerId),$e.target.tagName!=="BUTTON"&&(ae(!0),Xt.current={x:$e.clientX,y:$e.clientY}))},onPointerUp:()=>{var $e,_t,Ut,Qn;if(ge||!_e)return;Xt.current=null;let Zn=Number((($e=St.current)==null?void 0:$e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Fr=Number(((_t=St.current)==null?void 0:_t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),fr=new Date().getTime()-((Ut=cn.current)==null?void 0:Ut.getTime()),ir=O==="x"?Zn:Fr,bn=Math.abs(ir)/fr;if(Math.abs(ir)>=Fxe||bn>.11){Ae(sn.current),(Qn=h.onDismiss)==null||Qn.call(h,h),oe(O==="x"?Zn>0?"right":"left":Fr>0?"down":"up"),Lr(),ue(!0),Te(!1);return}ae(!1),ee(null)},onPointerMove:$e=>{var _t,Ut,Qn,Zn;if(!Xt.current||!_e||((_t=window.getSelection())==null?void 0:_t.toString().length)>0)return;let Fr=$e.clientY-Xt.current.y,fr=$e.clientX-Xt.current.x,ir=(Ut=e.swipeDirections)!=null?Ut:$xe(F);!O&&(Math.abs(fr)>1||Math.abs(Fr)>1)&&ee(Math.abs(fr)>Math.abs(Fr)?"x":"y");let bn={x:0,y:0};O==="y"?(ir.includes("top")||ir.includes("bottom"))&&(ir.includes("top")&&Fr<0||ir.includes("bottom")&&Fr>0)&&(bn.y=Fr):O==="x"&&(ir.includes("left")||ir.includes("right"))&&(ir.includes("left")&&fr<0||ir.includes("right")&&fr>0)&&(bn.x=fr),(Math.abs(bn.x)>0||Math.abs(bn.y)>0)&&Te(!0),(Qn=St.current)==null||Qn.style.setProperty("--swipe-amount-x",`${bn.x}px`),(Zn=St.current)==null||Zn.style.setProperty("--swipe-amount-y",`${bn.y}px`)}},An&&!h.jsx?T.createElement("button",{"aria-label":q,"data-disabled":wr,"data-close-button":!0,onClick:wr||!_e?()=>{}:()=>{var $e;Lr(),($e=h.onDismiss)==null||$e.call(h,h)},className:xi(X==null?void 0:X.closeButton,(o=h==null?void 0:h.classNames)==null?void 0:o.closeButton)},(i=I==null?void 0:I.close)!=null?i:_xe):null,h.jsx||T.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:T.createElement(T.Fragment,null,fe||h.icon||h.promise?T.createElement("div",{"data-icon":"",className:xi(X==null?void 0:X.icon,(s=h==null?void 0:h.classNames)==null?void 0:s.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||fl():null,h.type!=="loading"?h.icon||(I==null?void 0:I[fe])||mxe(fe):null):null,T.createElement("div",{"data-content":"",className:xi(X==null?void 0:X.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},T.createElement("div",{"data-title":"",className:xi(X==null?void 0:X.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?T.createElement("div",{"data-description":"",className:xi(Q,We,X==null?void 0:X.description,(c=h==null?void 0:h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),T.isValidElement(h.cancel)?h.cancel:h.cancel&&Dm(h.cancel)?T.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||L,onClick:$e=>{var _t,Ut;Dm(h.cancel)&&_e&&((Ut=(_t=h.cancel).onClick)==null||Ut.call(_t,$e),Lr())},className:xi(X==null?void 0:X.cancelButton,(u=h==null?void 0:h.classNames)==null?void 0:u.cancelButton)},h.cancel.label):null,T.isValidElement(h.action)?h.action:h.action&&Dm(h.action)?T.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||j,onClick:$e=>{var _t,Ut;Dm(h.action)&&((Ut=(_t=h.action).onClick)==null||Ut.call(_t,$e),!$e.defaultPrevented&&Lr())},className:xi(X==null?void 0:X.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function PI(){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}function Bxe(e,t){let n={};return[e,t].forEach((r,o)=>{let i=o===1,s=i?"--mobile-offset":"--offset",a=i?Dxe:Ixe;function l(c){["top","right","bottom","left"].forEach(u=>{n[`${s}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${s}-${c}`]=a:n[`${s}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}var Hxe=T.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:o=["altKey","KeyT"],expand:i,closeButton:s,className:a,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:p,style:h,visibleToasts:m=Mxe,toastOptions:b,dir:v=PI(),gap:x=Lxe,loadingIcon:w,icons:_,containerAriaLabel:R="Notifications",pauseWhenPageIsHidden:C}=e,[E,A]=T.useState([]),M=T.useMemo(()=>Array.from(new Set([r].concat(E.filter(U=>U.position).map(U=>U.position)))),[E,r]),[D,L]=T.useState([]),[j,z]=T.useState(!1),[Q,G]=T.useState(!1),[F,H]=T.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=T.useRef(null),V=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),X=T.useRef(null),I=T.useRef(!1),q=T.useCallback(U=>{A(O=>{var ee;return(ee=O.find(K=>K.id===U.id))!=null&&ee.delete||po.dismiss(U.id),O.filter(({id:K})=>K!==U.id)})},[]);return T.useEffect(()=>po.subscribe(U=>{if(U.dismiss){A(O=>O.map(ee=>ee.id===U.id?{...ee,delete:!0}:ee));return}setTimeout(()=>{Ar.flushSync(()=>{A(O=>{let ee=O.findIndex(K=>K.id===U.id);return ee!==-1?[...O.slice(0,ee),{...O[ee],...U},...O.slice(ee+1)]:[U,...O]})})})}),[]),T.useEffect(()=>{if(u!=="system"){H(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?H("dark"):H("light")),typeof window>"u")return;let U=window.matchMedia("(prefers-color-scheme: dark)");try{U.addEventListener("change",({matches:O})=>{H(O?"dark":"light")})}catch{U.addListener(({matches:ee})=>{try{H(ee?"dark":"light")}catch(K){console.error(K)}})}},[u]),T.useEffect(()=>{E.length<=1&&z(!1)},[E]),T.useEffect(()=>{let U=O=>{var ee,K;o.every(oe=>O[oe]||O.code===oe)&&(z(!0),(ee=$.current)==null||ee.focus()),O.code==="Escape"&&(document.activeElement===$.current||(K=$.current)!=null&&K.contains(document.activeElement))&&z(!1)};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[o]),T.useEffect(()=>{if($.current)return()=>{X.current&&(X.current.focus({preventScroll:!0}),X.current=null,I.current=!1)}},[$.current]),T.createElement("section",{ref:t,"aria-label":`${R} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},M.map((U,O)=>{var ee;let[K,oe]=U.split("-");return E.length?T.createElement("ol",{key:U,dir:v==="auto"?PI():v,tabIndex:-1,ref:$,className:a,"data-sonner-toaster":!0,"data-theme":F,"data-y-position":K,"data-lifted":j&&E.length>1&&!i,"data-x-position":oe,style:{"--front-toast-height":`${((ee=D[0])==null?void 0:ee.height)||0}px`,"--width":`${Nxe}px`,"--gap":`${x}px`,...h,...Bxe(l,c)},onBlur:Y=>{I.current&&!Y.currentTarget.contains(Y.relatedTarget)&&(I.current=!1,X.current&&(X.current.focus({preventScroll:!0}),X.current=null))},onFocus:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||I.current||(I.current=!0,X.current=Y.relatedTarget)},onMouseEnter:()=>z(!0),onMouseMove:()=>z(!0),onMouseLeave:()=>{Q||z(!1)},onDragEnd:()=>z(!1),onPointerDown:Y=>{Y.target instanceof HTMLElement&&Y.target.dataset.dismissible==="false"||G(!0)},onPointerUp:()=>G(!1)},E.filter(Y=>!Y.position&&O===0||Y.position===U).map((Y,J)=>{var ie,de;return T.createElement(zxe,{key:Y.id,icons:_,index:J,toast:Y,defaultRichColors:d,duration:(ie=b==null?void 0:b.duration)!=null?ie:p,className:b==null?void 0:b.className,descriptionClassName:b==null?void 0:b.descriptionClassName,invert:n,visibleToasts:m,closeButton:(de=b==null?void 0:b.closeButton)!=null?de:s,interacting:Q,position:U,style:b==null?void 0:b.style,unstyled:b==null?void 0:b.unstyled,classNames:b==null?void 0:b.classNames,cancelButtonStyle:b==null?void 0:b.cancelButtonStyle,actionButtonStyle:b==null?void 0:b.actionButtonStyle,removeToast:q,toasts:E.filter(he=>he.position==Y.position),heights:D.filter(he=>he.position==Y.position),setHeights:L,expandByDefault:i,gap:x,loadingIcon:w,expanded:j,pauseWhenPageIsHidden:C,swipeDirections:e.swipeDirections})})):null}))});function Vxe(){const{getSelectedFrame:e,addFrame:t,setSelectedFrameId:n}=Hn(),r=ye(l=>l.dashboard.sheets),i=ye(l=>l.selectedSheetId)??(r==null?void 0:r[0].id),s=ye(l=>l.isDashboardEditing),a=ye(l=>l.isVisualEditing);T.useEffect(()=>{if(!s||a)return;async function l(d){const p=d.ctrlKey||d.metaKey;p&&d.key==="c"?(await c(),n9.success("Card copied to clipboard"),d.preventDefault()):p&&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 p=JSON.parse(d);if(p&&p.id){p.id=Ua();const h=p.activeCardId;p.cards.forEach(m=>{const b=m.id;m.id=Ua(),b===h&&(p.activeCardId=m.id,m.title=`${m.title} (Copy)`)}),t(i,p),n(p.id)}}catch(p){console.error("Failed to parse clipboard contents: ",p)}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 Wxe=nA.WidthProvider(nA.Responsive);function Uxe({sheet:e}){var w,_,R;const t=ye(C=>C.isDashboardEditing),n=ye(C=>C.currentBreakpoint),r=ye(C=>C.themeStyle),[o,i]=T.useState([]),s=ye(C=>C.selectedSheetId);ye(C=>C.selectedLensId);const a=e.layouts,l=ye(C=>C.dashboard.filters),c=e.frames,{setSheetLayouts:u,setCurrentBreakpoint:d}=ye(C=>C.actions);T.useEffect(()=>{var C,E;document.documentElement.style.setProperty("--placeholder-border-radius",`${(E=(C=r==null?void 0:r.chart)==null?void 0:C.options)==null?void 0:E.borderRadius}px`)},[(_=(w=r==null?void 0:r.chart)==null?void 0:w.options)==null?void 0:_.borderRadius]),Vxe();function p(C){d(C)}function h(C,E){s===e.id&&u(s,E)}if(!s)return null;const m=(C,E)=>y.jsx(r9,{className:"after:content-none",ref:E,handleAxis:C}),b=C=>C&&(C==null?void 0:C.h)===1&&(C==null?void 0:C.w)===1?{...C,h:8,minH:7,w:7}:null;function v(){const C=l==null?void 0:l.filter(E=>(E.sheetId===s||!E.sheetId)&&!E.hide);return C==null?void 0:C.map(E=>{var D,L,j;const A=(D=a==null?void 0:a[n])==null?void 0:D.find(z=>z.i===E.id);if(E.location==="frame")return null;const M=b(A);return y.jsxs("div",{style:{borderRadius:(j=(L=r==null?void 0:r.chart)==null?void 0:L.options)==null?void 0:j.borderRadius},className:me("z-50 flex flex-col rounded-md border bg-background px-3 py-2"),...M?{"data-grid":M}:{},children:[y.jsx(t9,{filter:E}),y.jsx(AR,{filter:E})]},E.id)})}function x(){return c==null?void 0:c.map(C=>y.jsx("div",{role:"dashboard-frame-container",className:me("group isolate overflow-hidden",r==null?void 0:r.dashboardCardContainer),children:y.jsx(Y0,{FallbackComponent:({error:E,resetErrorBoundary:A})=>y.jsx(ote,{error:E,resetErrorBoundary:A,frame:C}),children:y.jsx(fxe,{frame:C})})},C.id))}return y.jsx(y.Fragment,{children:y.jsxs(Wxe,{margin:[10,10],isDraggable:t,resizeHandles:t?["sw","nw","ne","se","e","w"]:[],className:me((R=r==null?void 0:r.gridLayout)==null?void 0:R.className),layouts:a,cols:{lg:48,md:36,sm:24,xs:12,xxs:6},rowHeight:1,onBreakpointChange:p,onLayoutChange:h,resizeHandle:m,children:[v(),x()]})})}const r9=T.forwardRef(({className:e,handleAxis:t,...n},r)=>{var s,a;const o=ye(l=>l.themeStyle),i=(a=(s=o==null?void 0:o.chart)==null?void 0:s.options)==null?void 0:a.borderRadius;return y.jsx("div",{ref:r,className:me(`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"&&i<11,"border-foreground/40 group-hover:border-2 group-hover:border-b-0 group-hover:border-l-0":t==="ne"&&i<11,"border-foreground/40 group-hover:border-2 group-hover:border-r-0 group-hover:border-t-0":t==="sw"&&i<11,"border-foreground/40 group-hover:border-2 group-hover:border-l-0 group-hover:border-t-0":t==="se"&&i<11,"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})});r9.displayName="ResizeHandle";var o9="vercel.ai.error",Gxe=Symbol.for(o9),i9,qxe=class s9 extends Error{constructor({name:t,message:n,cause:r}){super(n),this[i9]=!0,this.name=t,this.cause=r}static isInstance(t){return s9.hasMarker(t,o9)}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}};i9=Gxe;var Pd=qxe;function a9(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var l9="AI_InvalidArgumentError",c9=`vercel.ai.error.${l9}`,Yxe=Symbol.for(c9),u9,Kxe=class extends Pd{constructor({message:e,cause:t,argument:n}){super({name:l9,message:e,cause:t}),this[u9]=!0,this.argument=n}static isInstance(e){return Pd.hasMarker(e,c9)}};u9=Yxe;var d9="AI_JSONParseError",f9=`vercel.ai.error.${d9}`,Xxe=Symbol.for(f9),h9,TI=class extends Pd{constructor({text:e,cause:t}){super({name:d9,message:`JSON parsing failed: Text: ${e}.
|
|
392
|
+
Error message: ${a9(t)}`,cause:t}),this[h9]=!0,this.text=e}static isInstance(e){return Pd.hasMarker(e,f9)}};h9=Xxe;var p9="AI_TypeValidationError",g9=`vercel.ai.error.${p9}`,Qxe=Symbol.for(g9),m9,Zxe=class h_ extends Pd{constructor({value:t,cause:n}){super({name:p9,message:`Type validation failed: Value: ${JSON.stringify(t)}.
|
|
393
|
+
Error message: ${a9(n)}`,cause:n}),this[m9]=!0,this.value=t}static isInstance(t){return Pd.hasMarker(t,g9)}static wrap({value:t,cause:n}){return h_.isInstance(n)&&n.value===t?n:new h_({value:t,cause:n})}};m9=Qxe;var kI=Zxe;let Jxe=(e,t=21)=>(n=t)=>{let r="",o=n|0;for(;o--;)r+=e[Math.random()*e.length|0];return r};var Ud={exports:{}};const ewe=typeof Buffer<"u",AI=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,OI=/"(?: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 b9(e,t,n){n==null&&t!==null&&typeof t=="object"&&(n=t,t=void 0),ewe&&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(AI.test(e)===!1&&OI.test(e)===!1)return r}else if(o!=="ignore"&&i==="ignore"){if(AI.test(e)===!1)return r}else if(OI.test(e)===!1)return r;return y9(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function y9(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 MR(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return b9(e,t,n)}finally{Error.stackTraceLimit=r}}function twe(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return b9(e,t,{safe:!0})}catch{return null}finally{Error.stackTraceLimit=n}}Ud.exports=MR;Ud.exports.default=MR;Ud.exports.parse=MR;Ud.exports.safeParse=twe;Ud.exports.scan=y9;var nwe=Ud.exports;const rwe=nl(nwe);var owe=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const o=Jxe(n,t);if(e==null)return o;if(n.includes(r))throw new Kxe({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return i=>`${e}${r}${o(i)}`},IR=owe(),p_=Symbol.for("vercel.ai.validator");function iwe(e){return{[p_]:!0,validate:e}}function swe(e){return typeof e=="object"&&e!==null&&p_ in e&&e[p_]===!0&&"validate"in e}function awe(e){return swe(e)?e:lwe(e)}function lwe(e){return iwe(t=>{const n=e.safeParse(t);return n.success?{success:!0,value:n.data}:{success:!1,error:n.error}})}function cwe({value:e,schema:t}){const n=awe(t);try{if(n.validate==null)return{success:!0,value:e};const r=n.validate(e);return r.success?r:{success:!1,error:kI.wrap({value:e,cause:r.error})}}catch(r){return{success:!1,error:kI.wrap({value:e,cause:r})}}}function MI({text:e,schema:t}){try{const n=rwe.parse(e);if(t==null)return{success:!0,value:n,rawValue:n};const r=cwe({value:n,schema:t});return r.success?{...r,rawValue:n}:r}catch(n){return{success:!1,error:TI.isInstance(n)?n:new TI({text:e,cause:n})}}}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var qh={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},Yh={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},Kh={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}}},Xh={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}}}},Qh={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}}},uwe=[qh,Yh,Kh,Xh,Qh];qh.code+"",Yh.code+"",Kh.code+"",Xh.code+"",Qh.code+"";qh.name+"",qh.code,Yh.name+"",Yh.code,Kh.name+"",Kh.code,Xh.name+"",Xh.code,Qh.name+"",Qh.code;uwe.map(e=>e.code);function dwe({promptTokens:e,completionTokens:t}){return{promptTokens:e,completionTokens:t,totalTokens:e+t}}function fwe(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 hwe(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=MI({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=MI({text:fwe(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var pwe={code:"0",name:"text",parse:e=>{if(typeof e!="string")throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},gwe={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},mwe={code:"3",name:"error",parse:e=>{if(typeof e!="string")throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},bwe={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}}},ywe={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}}},vwe={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}}},xwe={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}}},wwe={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}}},Swe={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}}},_we={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}}},Cwe={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}}}},Ewe={code:"g",name:"reasoning",parse:e=>{if(typeof e!="string")throw new Error('"reasoning" parts expect a string value.');return{type:"reasoning",value:e}}},Rwe={code:"h",name:"source",parse:e=>{if(e==null||typeof e!="object")throw new Error('"source" parts expect a Source object.');return{type:"source",value:e}}},Pwe={code:"i",name:"redacted_reasoning",parse:e=>{if(e==null||typeof e!="object"||!("data"in e)||typeof e.data!="string")throw new Error('"redacted_reasoning" parts expect an object with a "data" property.');return{type:"redacted_reasoning",value:{data:e.data}}}},Twe={code:"j",name:"reasoning_signature",parse:e=>{if(e==null||typeof e!="object"||!("signature"in e)||typeof e.signature!="string")throw new Error('"reasoning_signature" parts expect an object with a "signature" property.');return{type:"reasoning_signature",value:{signature:e.signature}}}},DR=[pwe,gwe,mwe,bwe,ywe,vwe,xwe,wwe,Swe,_we,Cwe,Ewe,Rwe,Pwe,Twe],kwe=Object.fromEntries(DR.map(e=>[e.code,e]));Object.fromEntries(DR.map(e=>[e.name,e.code]));var Awe=DR.map(e=>e.code),Owe=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(!Awe.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 kwe[r].parse(i)},Mwe=10;function Iwe(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 Dwe({stream:e,onTextPart:t,onReasoningPart:n,onReasoningSignaturePart:r,onRedactedReasoningPart:o,onSourcePart:i,onDataPart:s,onErrorPart:a,onToolCallStreamingStartPart:l,onToolCallDeltaPart:c,onToolCallPart:u,onToolResultPart:d,onMessageAnnotationsPart:p,onFinishMessagePart:h,onFinishStepPart:m,onStartStepPart:b}){const v=e.getReader(),x=new TextDecoder,w=[];let _=0;for(;;){const{value:R}=await v.read();if(R&&(w.push(R),_+=R.length,R[R.length-1]!==Mwe))continue;if(w.length===0)break;const C=Iwe(w,_);_=0;const E=x.decode(C,{stream:!0}).split(`
|
|
394
|
+
`).filter(A=>A!=="").map(Owe);for(const{type:A,value:M}of E)switch(A){case"text":await(t==null?void 0:t(M));break;case"reasoning":await(n==null?void 0:n(M));break;case"reasoning_signature":await(r==null?void 0:r(M));break;case"redacted_reasoning":await(o==null?void 0:o(M));break;case"source":await(i==null?void 0:i(M));break;case"data":await(s==null?void 0:s(M));break;case"error":await(a==null?void 0:a(M));break;case"message_annotations":await(p==null?void 0:p(M));break;case"tool_call_streaming_start":await(l==null?void 0:l(M));break;case"tool_call_delta":await(c==null?void 0:c(M));break;case"tool_call":await(u==null?void 0:u(M));break;case"tool_result":await(d==null?void 0:d(M));break;case"finish_message":await(h==null?void 0:h(M));break;case"finish_step":await(m==null?void 0:m(M));break;case"start_step":await(b==null?void 0:b(M));break;default:{const D=A;throw new Error(`Unknown stream part type: ${D}`)}}}}async function Nwe({stream:e,update:t,onToolCall:n,onFinish:r,generateId:o=IR,getCurrentDate:i=()=>new Date,lastMessage:s}){var a,l;const c=(s==null?void 0:s.role)==="assistant";let u=c?1+((l=(a=s.toolInvocations)==null?void 0:a.reduce((E,A)=>{var M;return Math.max(E,(M=A.step)!=null?M:0)},0))!=null?l:0):0;const d=c?structuredClone(s):{id:o(),createdAt:i(),role:"assistant",content:"",parts:[]};let p,h,m;function b(E,A){const M=d.parts.find(D=>D.type==="tool-invocation"&&D.toolInvocation.toolCallId===E);M!=null?M.toolInvocation=A:d.parts.push({type:"tool-invocation",toolInvocation:A})}const v=[];let x=c?s==null?void 0:s.annotations:void 0;const w={};let _={completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},R="unknown";function C(){const E=[...v];x!=null&&x.length&&(d.annotations=x);const A={...structuredClone(d),revisionId:o()};t({message:A,data:E,replaceLastMessage:c})}await Dwe({stream:e,onTextPart(E){p==null?(p={type:"text",text:E},d.parts.push(p)):p.text+=E,d.content+=E,C()},onReasoningPart(E){var A;m==null?(m={type:"text",text:E},h!=null&&h.details.push(m)):m.text+=E,h==null?(h={type:"reasoning",reasoning:E,details:[m]},d.parts.push(h)):h.reasoning+=E,d.reasoning=((A=d.reasoning)!=null?A:"")+E,C()},onReasoningSignaturePart(E){m!=null&&(m.signature=E.signature)},onRedactedReasoningPart(E){h==null&&(h={type:"reasoning",reasoning:"",details:[]},d.parts.push(h)),h.details.push({type:"redacted",data:E.data}),m=void 0,C()},onSourcePart(E){d.parts.push({type:"source",source:E}),C()},onToolCallStreamingStartPart(E){d.toolInvocations==null&&(d.toolInvocations=[]),w[E.toolCallId]={text:"",step:u,toolName:E.toolName,index:d.toolInvocations.length};const A={state:"partial-call",step:u,toolCallId:E.toolCallId,toolName:E.toolName,args:void 0};d.toolInvocations.push(A),b(E.toolCallId,A),C()},onToolCallDeltaPart(E){const A=w[E.toolCallId];A.text+=E.argsTextDelta;const{value:M}=hwe(A.text),D={state:"partial-call",step:A.step,toolCallId:E.toolCallId,toolName:A.toolName,args:M};d.toolInvocations[A.index]=D,b(E.toolCallId,D),C()},async onToolCallPart(E){const A={state:"call",step:u,...E};if(w[E.toolCallId]!=null?d.toolInvocations[w[E.toolCallId].index]=A:(d.toolInvocations==null&&(d.toolInvocations=[]),d.toolInvocations.push(A)),b(E.toolCallId,A),C(),n){const M=await n({toolCall:E});if(M!=null){const D={state:"result",step:u,...E,result:M};d.toolInvocations[d.toolInvocations.length-1]=D,b(E.toolCallId,D),C()}}},onToolResultPart(E){const A=d.toolInvocations;if(A==null)throw new Error("tool_result must be preceded by a tool_call");const M=A.findIndex(L=>L.toolCallId===E.toolCallId);if(M===-1)throw new Error("tool_result must be preceded by a tool_call with the same toolCallId");const D={...A[M],state:"result",...E};A[M]=D,b(E.toolCallId,D),C()},onDataPart(E){v.push(...E),C()},onMessageAnnotationsPart(E){x==null?x=[...E]:x.push(...E),C()},onFinishStepPart(E){u+=1,p=E.isContinued?p:void 0,h=void 0,m=void 0},onStartStepPart(E){c||(d.id=E.messageId)},onFinishMessagePart(E){R=E.finishReason,E.usage!=null&&(_=dwe(E.usage))},onErrorPart(E){throw new Error(E)}}),r==null||r({message:d,finishReason:R,usage:_})}async function Lwe({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)}}async function Fwe({stream:e,update:t,onFinish:n,getCurrentDate:r=()=>new Date,generateId:o=IR}){const i={type:"text",text:""},s={id:o(),createdAt:r(),role:"assistant",content:"",parts:[i]};await Lwe({stream:e,onTextPart:a=>{s.content+=a,i.text+=a,t({message:{...s},data:[],replaceLastMessage:!1})}}),n==null||n(s,{usage:{completionTokens:NaN,promptTokens:NaN,totalTokens:NaN},finishReason:"unknown"})}var jwe=()=>fetch;async function $we({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:p=jwe(),lastMessage:h}){var m,b;const v=await p(e,{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json",...o},signal:(m=i==null?void 0:i())==null?void 0:m.signal,credentials:r}).catch(x=>{throw s(),x});if(a)try{await a(v)}catch(x){throw x}if(!v.ok)throw s(),new Error((b=await v.text())!=null?b:"Failed to fetch the chat response.");if(!v.body)throw new Error("The response body is empty.");switch(n){case"text":{await Fwe({stream:v.body,update:l,onFinish:c,generateId:d});return}case"data":{await Nwe({stream:v.body,update:l,lastMessage:h,onToolCall:u,onFinish({message:x,finishReason:w,usage:_}){c&&x!=null&&c(x,{usage:_,finishReason:w})},generateId:d});return}default:{const x=n;throw new Error(`Unknown stream protocol: ${x}`)}}}function g_(e){return e==null?void 0:e.reduce((t,n)=>{var r;return Math.max(t,(r=n.step)!=null?r:0)},0)}function v9(e){var t;return(t=e.parts)!=null?t:[...e.toolInvocations?e.toolInvocations.map(n=>({type:"tool-invocation",toolInvocation:n})):[],...e.reasoning?[{type:"reasoning",reasoning:e.reasoning,details:[{type:"text",text:e.reasoning}]}]:[],...e.content?[{type:"text",text:e.content}]:[]]}function jw(e){return e.map(t=>({...t,parts:v9(t)}))}function m_(e,t){if(e===t)return!0;if(e==null||t==null)return!1;if(typeof e!="object"&&typeof t!="object")return e===t;if(e.constructor!==t.constructor)return!1;if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if(Array.isArray(e)){if(e.length!==t.length)return!1;for(let o=0;o<e.length;o++)if(!m_(e[o],t[o]))return!1;return!0}const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n)if(!r.includes(o)||!m_(e[o],t[o]))return!1;return!0}async function II(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")}function zwe({originalMaxToolInvocationStep:e,originalMessageCount:t,maxSteps:n,messages:r}){var o;const i=r[r.length-1];return n>1&&i!=null&&(r.length>t||g_(i.toolInvocations)!==e)&&x9(i)&&!Bwe(i)&&((o=g_(i.toolInvocations))!=null?o:0)<n}function Bwe(e){let t=!1;return e.parts.forEach(n=>{n.type==="text"&&(t=!0),n.type==="tool-invocation"&&(t=!1)}),t}function x9(e){return e.role==="assistant"&&e.parts.filter(t=>t.type==="tool-invocation").every(t=>"result"in t.toolInvocation)}function Hwe({messages:e,toolCallId:t,toolResult:n}){var r;const o=e[e.length-1],i=o.parts.find(a=>a.type==="tool-invocation"&&a.toolInvocation.toolCallId===t);if(i==null)return;const s={...i.toolInvocation,state:"result",result:n};i.toolInvocation=s,o.toolInvocations=(r=o.toolInvocations)==null?void 0:r.map(a=>a.toolCallId===t?s:a)}var w9=G_();const S9=0,_9=1,C9=2,DI=3;var NI=Object.prototype.hasOwnProperty;function b_(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&b_(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(NI.call(e,n)&&++r&&!NI.call(t,n)||!(n in t)||!b_(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Ys=new WeakMap,Ba=()=>{},Kr=Ba(),y_=Object,Vt=e=>e===Kr,ts=e=>typeof e=="function",tl=(e,t)=>({...e,...t}),E9=e=>ts(e.then),$w={},Nm={},NR="undefined",Vp=typeof window!=NR,v_=typeof document!=NR,Vwe=Vp&&"Deno"in window,Wwe=()=>Vp&&typeof window.requestAnimationFrame!=NR,R9=(e,t)=>{const n=Ys.get(e);return[()=>!Vt(t)&&e.get(t)||$w,r=>{if(!Vt(t)){const o=e.get(t);t in Nm||(Nm[t]=o),n[5](t,tl(o,r),o||$w)}},n[6],()=>!Vt(t)&&t in Nm?Nm[t]:!Vt(t)&&e.get(t)||$w]};let x_=!0;const Uwe=()=>x_,[w_,S_]=Vp&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Ba,Ba],Gwe=()=>{const e=v_&&document.visibilityState;return Vt(e)||e!=="hidden"},qwe=e=>(v_&&document.addEventListener("visibilitychange",e),w_("focus",e),()=>{v_&&document.removeEventListener("visibilitychange",e),S_("focus",e)}),Ywe=e=>{const t=()=>{x_=!0,e()},n=()=>{x_=!1};return w_("online",t),w_("offline",n),()=>{S_("online",t),S_("offline",n)}},Kwe={isOnline:Uwe,isVisible:Gwe},Xwe={initFocus:qwe,initReconnect:Ywe},LI=!T.useId,Zh=!Vp||Vwe,Qwe=e=>Wwe()?window.requestAnimationFrame(e):setTimeout(e,1),zw=Zh?T.useEffect:T.useLayoutEffect,Bw=typeof navigator<"u"&&navigator.connection,FI=!Zh&&Bw&&(["slow-2g","2g"].includes(Bw.effectiveType)||Bw.saveData),Lm=new WeakMap,Hw=(e,t)=>y_.prototype.toString.call(e)===`[object ${t}]`;let Zwe=0;const __=e=>{const t=typeof e,n=Hw(e,"Date"),r=Hw(e,"RegExp"),o=Hw(e,"Object");let i,s;if(y_(e)===e&&!n&&!r){if(i=Lm.get(e),i)return i;if(i=++Zwe+"~",Lm.set(e,i),Array.isArray(e)){for(i="@",s=0;s<e.length;s++)i+=__(e[s])+",";Lm.set(e,i)}if(o){i="#";const a=y_.keys(e).sort();for(;!Vt(s=a.pop());)Vt(e[s])||(i+=s+":"+__(e[s])+",");Lm.set(e,i)}}else i=n?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},LR=e=>{if(ts(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?__(e):"",[e,t]};let Jwe=0;const C_=()=>++Jwe;async function P9(...e){const[t,n,r,o]=e,i=tl({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let s=i.populateCache;const a=i.rollbackOnError;let l=i.optimisticData;const c=p=>typeof a=="function"?a(p):a!==!1,u=i.throwOnError;if(ts(n)){const p=n,h=[],m=t.keys();for(const b of m)!/^\$(inf|sub)\$/.test(b)&&p(t.get(b)._k)&&h.push(b);return Promise.all(h.map(d))}return d(n);async function d(p){const[h]=LR(p);if(!h)return;const[m,b]=R9(t,h),[v,x,w,_]=Ys.get(t),R=()=>{const Q=v[h];return(ts(i.revalidate)?i.revalidate(m().data,p):i.revalidate!==!1)&&(delete w[h],delete _[h],Q&&Q[0])?Q[0](C9).then(()=>m().data):m().data};if(e.length<3)return R();let C=r,E;const A=C_();x[h]=[A,0];const M=!Vt(l),D=m(),L=D.data,j=D._c,z=Vt(j)?L:j;if(M&&(l=ts(l)?l(z,L):l,b({data:l,_c:z})),ts(C))try{C=C(z)}catch(Q){E=Q}if(C&&E9(C))if(C=await C.catch(Q=>{E=Q}),A!==x[h][0]){if(E)throw E;return C}else E&&M&&c(E)&&(s=!0,b({data:z,_c:Kr}));if(s&&!E)if(ts(s)){const Q=s(C,z);b({data:Q,error:Kr,_c:Kr})}else b({data:C,error:Kr,_c:Kr});if(x[h][1]=C_(),Promise.resolve(R()).then(()=>{b({_c:Kr})}),E){if(u)throw E;return}return C}}const jI=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},e1e=(e,t)=>{if(!Ys.has(e)){const n=tl(Xwe,t),r={},o=P9.bind(Kr,e);let i=Ba;const s={},a=(u,d)=>{const p=s[u]||[];return s[u]=p,p.push(d),()=>p.splice(p.indexOf(d),1)},l=(u,d,p)=>{e.set(u,d);const h=s[u];if(h)for(const m of h)m(d,p)},c=()=>{if(!Ys.has(e)&&(Ys.set(e,[r,{},{},{},o,l,a]),!Zh)){const u=n.initFocus(setTimeout.bind(Kr,jI.bind(Kr,r,S9))),d=n.initReconnect(setTimeout.bind(Kr,jI.bind(Kr,r,_9)));i=()=>{u&&u(),d&&d(),Ys.delete(e)}}};return c(),[e,o,c,i]}return[e,Ys.get(e)[4]]},t1e=(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)},n1e=b_,[T9,r1e]=e1e(new Map),o1e=tl({onLoadingSlow:Ba,onSuccess:Ba,onError:Ba,onErrorRetry:t1e,onDiscarded:Ba,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:FI?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:FI?5e3:3e3,compare:n1e,isPaused:()=>!1,cache:T9,mutate:r1e,fallback:{}},Kwe),i1e=(e,t)=>{const n=tl(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=tl(o,s))}return n},s1e=T.createContext({}),a1e="$inf$",k9=Vp&&window.__SWR_DEVTOOLS_USE__,l1e=k9?window.__SWR_DEVTOOLS_USE__:[],c1e=()=>{k9&&(window.__SWR_DEVTOOLS_REACT__=T)},u1e=e=>ts(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],d1e=()=>tl(o1e,T.useContext(s1e)),f1e=e=>(t,n,r)=>e(t,n&&((...i)=>{const[s]=LR(t),[,,,a]=Ys.get(T9);if(s.startsWith(a1e))return n(...i);const l=a[s];return Vt(l)?n(...i):(delete a[s],l)}),r),h1e=l1e.concat(f1e),p1e=e=>function(...n){const r=d1e(),[o,i,s]=u1e(n),a=i1e(r,s);let l=e;const{use:c}=a,u=(c||[]).concat(h1e);for(let d=u.length;d--;)l=u[d](l);return l(o,i||a.fetcher||null,a)},g1e=(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())}};c1e();const Vw=T.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Ww={dedupe:!0},m1e=(e,t,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:u,refreshWhenOffline:d,keepPreviousData:p}=n,[h,m,b,v]=Ys.get(r),[x,w]=LR(e),_=T.useRef(!1),R=T.useRef(!1),C=T.useRef(x),E=T.useRef(t),A=T.useRef(n),M=()=>A.current,D=()=>M().isVisible()&&M().isOnline(),[L,j,z,Q]=R9(r,x),G=T.useRef({}).current,F=Vt(s)?Vt(n.fallback)?Kr:n.fallback[x]:s,H=(ge,ue)=>{for(const Ee in G){const Te=Ee;if(Te==="data"){if(!o(ge[Te],ue[Te])&&(!Vt(ge[Te])||!o(K,ue[Te])))return!1}else if(ue[Te]!==ge[Te])return!1}return!0},$=T.useMemo(()=>{const ge=!x||!t?!1:Vt(a)?M().isPaused()||i?!1:l!==!1:a,ue=tt=>{const at=tl(tt);return delete at._k,ge?{isValidating:!0,isLoading:!0,...at}:at},Ee=L(),Te=Q(),Le=ue(Ee),Ae=Ee===Te?Le:ue(Te);let Fe=Le;return[()=>{const tt=ue(L());return H(tt,Fe)?(Fe.data=tt.data,Fe.isLoading=tt.isLoading,Fe.isValidating=tt.isValidating,Fe.error=tt.error,Fe):(Fe=tt,tt)},()=>Ae]},[r,x]),V=w9.useSyncExternalStore(T.useCallback(ge=>z(x,(ue,Ee)=>{H(Ee,ue)||ge()}),[r,x]),$[0],$[1]),X=!_.current,I=h[x]&&h[x].length>0,q=V.data,U=Vt(q)?F&&E9(F)?Vw(F):F:q,O=V.error,ee=T.useRef(U),K=p?Vt(q)?Vt(ee.current)?U:ee.current:q:U,oe=I&&!Vt(O)?!1:X&&!Vt(a)?a:M().isPaused()?!1:i?Vt(U)?!1:l:Vt(U)||l,Y=!!(x&&t&&X&&oe),J=Vt(V.isValidating)?Y:V.isValidating,ie=Vt(V.isLoading)?Y:V.isLoading,de=T.useCallback(async ge=>{const ue=E.current;if(!x||!ue||R.current||M().isPaused())return!1;let Ee,Te,Le=!0;const Ae=ge||{},Fe=!b[x]||!Ae.dedupe,tt=()=>LI?!R.current&&x===C.current&&_.current:x===C.current,at={isValidating:!1,isLoading:!1},cn=()=>{j(at)},St=()=>{const Rt=b[x];Rt&&Rt[1]===Te&&delete b[x]},Vn={isValidating:!0};Vt(L().data)&&(Vn.isLoading=!0);try{if(Fe&&(j(Vn),n.loadingTimeout&&Vt(L().data)&&setTimeout(()=>{Le&&tt()&&M().onLoadingSlow(x,n)},n.loadingTimeout),b[x]=[ue(w),C_()]),[Ee,Te]=b[x],Ee=await Ee,Fe&&setTimeout(St,n.dedupingInterval),!b[x]||b[x][1]!==Te)return Fe&&tt()&&M().onDiscarded(x),!1;at.error=Kr;const Rt=m[x];if(!Vt(Rt)&&(Te<=Rt[0]||Te<=Rt[1]||Rt[1]===0))return cn(),Fe&&tt()&&M().onDiscarded(x),!1;const fe=L().data;at.data=o(fe,Ee)?fe:Ee,Fe&&tt()&&M().onSuccess(Ee,x,n)}catch(Rt){St();const fe=M(),{shouldRetryOnError:_e}=fe;fe.isPaused()||(at.error=Rt,Fe&&tt()&&(fe.onError(Rt,x,fe),(_e===!0||ts(_e)&&_e(Rt))&&(!M().revalidateOnFocus||!M().revalidateOnReconnect||D())&&fe.onErrorRetry(Rt,x,fe,He=>{const We=h[x];We&&We[0]&&We[0](DI,He)},{retryCount:(Ae.retryCount||0)+1,dedupe:!0})))}return Le=!1,cn(),!0},[x,r]),he=T.useCallback((...ge)=>P9(r,C.current,...ge),[]);if(zw(()=>{E.current=t,A.current=n,Vt(q)||(ee.current=q)}),zw(()=>{if(!x)return;const ge=de.bind(Kr,Ww);let ue=0;const Te=g1e(x,h,(Le,Ae={})=>{if(Le==S9){const Fe=Date.now();M().revalidateOnFocus&&Fe>ue&&D()&&(ue=Fe+M().focusThrottleInterval,ge())}else if(Le==_9)M().revalidateOnReconnect&&D()&&ge();else{if(Le==C9)return de();if(Le==DI)return de(Ae)}});return R.current=!1,C.current=x,_.current=!0,j({_k:w}),oe&&(Vt(U)||Zh?ge():Qwe(ge)),()=>{R.current=!0,Te()}},[x]),zw(()=>{let ge;function ue(){const Te=ts(c)?c(L().data):c;Te&&ge!==-1&&(ge=setTimeout(Ee,Te))}function Ee(){!L().error&&(u||M().isVisible())&&(d||M().isOnline())?de(Ww).then(ue):ue()}return ue(),()=>{ge&&(clearTimeout(ge),ge=-1)}},[c,u,d,x]),T.useDebugValue(K),i&&Vt(U)&&x){if(!LI&&Zh)throw new Error("Fallback data is required when using Suspense in SSR.");E.current=t,A.current=n,R.current=!1;const ge=v[x];if(!Vt(ge)){const ue=he(ge);Vw(ue)}if(Vt(O)){const ue=de(Ww);Vt(K)||(ue.status="fulfilled",ue.value=!0),Vw(ue)}else throw O}return{mutate:he,get data(){return G.data=!0,K},get error(){return G.error=!0,O},get isValidating(){return G.isValidating=!0,J},get isLoading(){return G.isLoading=!0,ie}}},Fm=p1e(m1e);function b1e(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 y1e=b1e;const v1e=nl(y1e);function $I(e,t){return t!=null?v1e(e,t):e}function x1e(e){const[t,n]=T.useState(e);return T.useEffect(()=>{m_(e,t)||n(e)},[e,t]),t}function A9({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:p,headers:h,body:m,generateId:b=IR,fetch:v,keepLastMessageOnError:x=!0,experimental_throttle:w}={}){const[_]=T.useState(b),R=t??_,C=typeof e=="string"?[e,R]:R,E=x1e(n??[]),A=T.useMemo(()=>jw(E),[E]),{data:M,mutate:D}=Fm([C,"messages"],null,{fallbackData:A}),L=T.useRef(M||[]);T.useEffect(()=>{L.current=M||[]},[M]);const{data:j,mutate:z}=Fm([C,"streamData"],null),Q=T.useRef(j);T.useEffect(()=>{Q.current=j},[j]);const{data:G="ready",mutate:F}=Fm([C,"status"],null),{data:H=void 0,mutate:$}=Fm([C,"error"],null),V=T.useRef(null),X=T.useRef({credentials:p,headers:h,body:m});T.useEffect(()=>{X.current={credentials:p,headers:h,body:m}},[p,h,m]);const I=T.useCallback(async he=>{var ae,ge;F("submitted"),$(void 0);const ue=jw(he.messages),Ee=ue.length,Te=g_((ae=ue[ue.length-1])==null?void 0:ae.toolInvocations);try{const Ae=new AbortController;V.current=Ae;const Fe=$I(D,w),tt=$I(z,w),at=L.current;Fe(ue,!1);const cn=o?ue:ue.map(({role:Vn,content:Rt,experimental_attachments:fe,data:_e,annotations:He,toolInvocations:We,parts:rt})=>({role:Vn,content:Rt,...fe!==void 0&&{experimental_attachments:fe},..._e!==void 0&&{data:_e},...He!==void 0&&{annotations:He},...We!==void 0&&{toolInvocations:We},...rt!==void 0&&{parts:rt}})),St=Q.current;await $we({api:e,body:(ge=s==null?void 0:s({id:R,messages:ue,requestData:he.data,requestBody:he.body}))!=null?ge:{id:R,messages:cn,data:he.data,...X.current.body,...he.body},streamProtocol:l,credentials:X.current.credentials,headers:{...X.current.headers,...he.headers},abortController:()=>V.current,restoreMessagesOnFailure(){x||Fe(at,!1)},onResponse:c,onUpdate({message:Vn,data:Rt,replaceLastMessage:fe}){F("streaming"),Fe([...fe?ue.slice(0,ue.length-1):ue,Vn],!1),Rt!=null&&Rt.length&&tt([...St??[],...Rt],!1)},onToolCall:i,onFinish:u,generateId:b,fetch:v,lastMessage:ue[ue.length-1]}),V.current=null,F("ready")}catch(Ae){if(Ae.name==="AbortError")return V.current=null,F("ready"),null;d&&Ae instanceof Error&&d(Ae),$(Ae),F("error")}const Le=L.current;zwe({originalMaxToolInvocationStep:Te,originalMessageCount:Ee,maxSteps:a,messages:Le})&&await I({messages:Le})},[D,F,e,X,c,u,d,$,z,Q,l,o,s,i,a,L,V,b,v,x,w,R]),q=T.useCallback(async(he,{data:ae,headers:ge,body:ue,experimental_attachments:Ee}={})=>{var Te,Le;const Ae=await II(Ee),Fe=L.current.concat({...he,id:(Te=he.id)!=null?Te:b(),createdAt:(Le=he.createdAt)!=null?Le:new Date,experimental_attachments:Ae.length>0?Ae:void 0,parts:v9(he)});return I({messages:Fe,headers:ge,body:ue,data:ae})},[I,b]),U=T.useCallback(async({data:he,headers:ae,body:ge}={})=>{const ue=L.current;if(ue.length===0)return null;const Ee=ue[ue.length-1];return I({messages:Ee.role==="assistant"?ue.slice(0,-1):ue,headers:ae,body:ge,data:he})},[I]),O=T.useCallback(()=>{V.current&&(V.current.abort(),V.current=null)},[]),ee=T.useCallback(he=>{typeof he=="function"&&(he=he(L.current));const ae=jw(he);D(ae,!1),L.current=ae},[D]),K=T.useCallback(he=>{typeof he=="function"&&(he=he(Q.current)),z(he,!1),Q.current=he},[z]),[oe,Y]=T.useState(r),J=T.useCallback(async(he,ae={},ge)=>{var ue;if((ue=he==null?void 0:he.preventDefault)==null||ue.call(he),!oe&&!ae.allowEmptySubmit)return;ge&&(X.current={...X.current,...ge});const Ee=await II(ae.experimental_attachments),Le={messages:L.current.concat({id:b(),createdAt:new Date,role:"user",content:oe,experimental_attachments:Ee.length>0?Ee:void 0,parts:[{type:"text",text:oe}]}),headers:ae.headers,body:ae.body,data:ae.data};I(Le),Y("")},[oe,b,I]),ie=he=>{Y(he.target.value)},de=T.useCallback(({toolCallId:he,result:ae})=>{const ge=L.current;Hwe({messages:ge,toolCallId:he,toolResult:ae}),D(ge,!1);const ue=ge[ge.length-1];x9(ue)&&I({messages:ge})},[D,I]);return{messages:M??[],id:R,setMessages:ee,data:j,setData:K,error:H,append:q,reload:U,stop:O,input:oe,setInput:Y,handleInputChange:ie,handleSubmit:J,isLoading:G==="submitted"||G==="streaming",status:G,addToolResult:de}}var FR="Collapsible",[w1e,O9]=rr(FR),[S1e,jR]=w1e(FR),M9=P.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,c]=Dr({prop:r,defaultProp:o,onChange:s});return y.jsx(S1e,{scope:n,disabled:i,contentId:Yn(),open:l,onOpenToggle:P.useCallback(()=>c(u=>!u),[c]),children:y.jsx(je.div,{"data-state":HR(l),"data-disabled":i?"":void 0,...a,ref:t})})});M9.displayName=FR;var I9="CollapsibleTrigger",$R=P.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=jR(I9,n);return y.jsx(je.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":HR(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:Pe(e.onClick,o.onOpenToggle)})});$R.displayName=I9;var zR="CollapsibleContent",BR=P.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=jR(zR,e.__scopeCollapsible);return y.jsx(Kn,{present:n||o.open,children:({present:i})=>y.jsx(_1e,{...r,ref:t,present:i})})});BR.displayName=zR;var _1e=P.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=jR(zR,n),[a,l]=P.useState(r),c=P.useRef(null),u=st(t,c),d=P.useRef(0),p=d.current,h=P.useRef(0),m=h.current,b=s.open||a,v=P.useRef(b),x=P.useRef(void 0);return P.useEffect(()=>{const w=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(w)},[]),yr(()=>{const w=c.current;if(w){x.current=x.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const _=w.getBoundingClientRect();d.current=_.height,h.current=_.width,v.current||(w.style.transitionDuration=x.current.transitionDuration,w.style.animationName=x.current.animationName),l(r)}},[s.open,r]),y.jsx(je.div,{"data-state":HR(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!b,...i,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:b&&o})});function HR(e){return e?"open":"closed"}var D9=M9,C1e=$R,E1e=BR;const R1e=D9,P1e=$R,T1e=BR;function k1e(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const A1e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,O1e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,M1e={};function zI(e,t){return(M1e.jsx?O1e:A1e).test(e)}const I1e=/[ \t\n\f\r]/g;function D1e(e){return typeof e=="object"?e.type==="text"?BI(e.value):!1:BI(e)}function BI(e){return e.replace(I1e,"")===""}class Wp{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Wp.prototype.normal={};Wp.prototype.property={};Wp.prototype.space=void 0;function N9(e,t){const n={},r={};for(const o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Wp(n,r,t)}function E_(e){return e.toLowerCase()}class Co{constructor(t,n){this.attribute=n,this.property=t}}Co.prototype.attribute="";Co.prototype.booleanish=!1;Co.prototype.boolean=!1;Co.prototype.commaOrSpaceSeparated=!1;Co.prototype.commaSeparated=!1;Co.prototype.defined=!1;Co.prototype.mustUseProperty=!1;Co.prototype.number=!1;Co.prototype.overloadedBoolean=!1;Co.prototype.property="";Co.prototype.spaceSeparated=!1;Co.prototype.space=void 0;let N1e=0;const dt=Hc(),Un=Hc(),L9=Hc(),ke=Hc(),pn=Hc(),zu=Hc(),Do=Hc();function Hc(){return 2**++N1e}const R_=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:Un,commaOrSpaceSeparated:Do,commaSeparated:zu,number:ke,overloadedBoolean:L9,spaceSeparated:pn},Symbol.toStringTag,{value:"Module"})),Uw=Object.keys(R_);class VR extends Co{constructor(t,n,r,o){let i=-1;if(super(t,n),HI(this,"space",o),typeof r=="number")for(;++i<Uw.length;){const s=Uw[i];HI(this,Uw[i],(r&R_[s])===R_[s])}}}VR.prototype.defined=!0;function HI(e,t,n){n&&(e[t]=n)}function Gd(e){const t={},n={};for(const[r,o]of Object.entries(e.properties)){const i=new VR(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[E_(r)]=r,n[E_(i.attribute)]=r}return new Wp(t,n,e.space)}const F9=Gd({properties:{ariaActiveDescendant:null,ariaAtomic:Un,ariaAutoComplete:null,ariaBusy:Un,ariaChecked:Un,ariaColCount:ke,ariaColIndex:ke,ariaColSpan:ke,ariaControls:pn,ariaCurrent:null,ariaDescribedBy:pn,ariaDetails:null,ariaDisabled:Un,ariaDropEffect:pn,ariaErrorMessage:null,ariaExpanded:Un,ariaFlowTo:pn,ariaGrabbed:Un,ariaHasPopup:null,ariaHidden:Un,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:pn,ariaLevel:ke,ariaLive:null,ariaModal:Un,ariaMultiLine:Un,ariaMultiSelectable:Un,ariaOrientation:null,ariaOwns:pn,ariaPlaceholder:null,ariaPosInSet:ke,ariaPressed:Un,ariaReadOnly:Un,ariaRelevant:null,ariaRequired:Un,ariaRoleDescription:pn,ariaRowCount:ke,ariaRowIndex:ke,ariaRowSpan:ke,ariaSelected:Un,ariaSetSize:ke,ariaSort:null,ariaValueMax:ke,ariaValueMin:ke,ariaValueNow:ke,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function j9(e,t){return t in e?e[t]:t}function $9(e,t){return j9(e,t.toLowerCase())}const L1e=Gd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:zu,acceptCharset:pn,accessKey:pn,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:pn,autoFocus:dt,autoPlay:dt,blocking:pn,capture:null,charSet:null,checked:dt,cite:null,className:pn,cols:ke,colSpan:null,content:null,contentEditable:Un,controls:dt,controlsList:pn,coords:ke|zu,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:L9,draggable:Un,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:pn,height:ke,hidden:dt,high:ke,href:null,hrefLang:null,htmlFor:pn,httpEquiv:pn,id:null,imageSizes:null,imageSrcSet:null,inert:dt,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:pn,itemRef:pn,itemScope:dt,itemType:pn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:ke,manifest:null,max:null,maxLength:ke,media:null,method:null,min:null,minLength:ke,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,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:dt,optimum:ke,pattern:null,ping:pn,placeholder:null,playsInline:dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:pn,required:dt,reversed:dt,rows:ke,rowSpan:ke,sandbox:pn,scope:null,scoped:dt,seamless:dt,selected:dt,shadowRootClonable:dt,shadowRootDelegatesFocus:dt,shadowRootMode:null,shape:null,size:ke,sizes:null,slot:null,span:ke,spellCheck:Un,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ke,step:null,style:null,tabIndex:ke,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:Un,width:ke,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:pn,axis:null,background:null,bgColor:null,border:ke,borderColor:null,bottomMargin:ke,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:ke,leftMargin:ke,link:null,longDesc:null,lowSrc:null,marginHeight:ke,marginWidth:ke,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:ke,rules:null,scheme:null,scrolling:Un,standby:null,summary:null,text:null,topMargin:ke,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ke,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:ke,security:null,unselectable:null},space:"html",transform:$9}),F1e=Gd({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"},properties:{about:Do,accentHeight:ke,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ke,amplitude:ke,arabicForm:null,ascent:ke,attributeName:null,attributeType:null,azimuth:ke,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ke,by:null,calcMode:null,capHeight:ke,className:pn,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:ke,diffuseConstant:ke,direction:null,display:null,dur:null,divisor:ke,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:ke,enableBackground:null,end:null,event:null,exponent:ke,externalResourcesRequired:null,fill:null,fillOpacity:ke,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:zu,g2:zu,glyphName:zu,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ke,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ke,horizOriginX:ke,horizOriginY:ke,id:null,ideographic:ke,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ke,k:ke,k1:ke,k2:ke,k3:ke,k4:ke,kernelMatrix:Do,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ke,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:ke,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:ke,overlineThickness:ke,paintOrder:null,panose1:null,path:null,pathLength:ke,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:pn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ke,pointsAtY:ke,pointsAtZ:ke,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Do,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Do,rev:Do,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Do,requiredFeatures:Do,requiredFonts:Do,requiredFormats:Do,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:ke,specularExponent:ke,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ke,strikethroughThickness:ke,string:null,stroke:null,strokeDashArray:Do,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ke,strokeOpacity:ke,strokeWidth:null,style:null,surfaceScale:ke,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Do,tabIndex:ke,tableValues:null,target:null,targetX:ke,targetY:ke,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Do,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ke,underlineThickness:ke,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ke,values:null,vAlphabetic:ke,vMathematical:ke,vectorEffect:null,vHanging:ke,vIdeographic:ke,version:null,vertAdvY:ke,vertOriginX:ke,vertOriginY:ke,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ke,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:j9}),z9=Gd({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),B9=Gd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:$9}),H9=Gd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),j1e={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"},$1e=/[A-Z]/g,VI=/-[a-z]/g,z1e=/^data[-\w.:]+$/i;function B1e(e,t){const n=E_(t);let r=t,o=Co;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&z1e.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(VI,V1e);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!VI.test(i)){let s=i.replace($1e,H1e);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}o=VR}return new o(r,t)}function H1e(e){return"-"+e.toLowerCase()}function V1e(e){return e.charAt(1).toUpperCase()}const W1e=N9([F9,L1e,z9,B9,H9],"html"),WR=N9([F9,F1e,z9,B9,H9],"svg");function U1e(e){return e.join(" ").trim()}var UR={},WI=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,G1e=/\n/g,q1e=/^\s*/,Y1e=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,K1e=/^:\s*/,X1e=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Q1e=/^[;\s]*/,Z1e=/^\s+|\s+$/g,J1e=`
|
|
395
|
+
`,UI="/",GI="*",$l="",eSe="comment",tSe="declaration",nSe=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 b=m.match(G1e);b&&(n+=b.length);var v=m.lastIndexOf(J1e);r=~v?m.length-v:r+m.length}function i(){var m={line:n,column:r};return function(b){return b.position=new s(m),c(),b}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var b=new Error(t.source+":"+n+":"+r+": "+m);if(b.reason=m,b.filename=t.source,b.line=n,b.column=r,b.source=e,!t.silent)throw b}function l(m){var b=m.exec(e);if(b){var v=b[0];return o(v),e=e.slice(v.length),b}}function c(){l(q1e)}function u(m){var b;for(m=m||[];b=d();)b!==!1&&m.push(b);return m}function d(){var m=i();if(!(UI!=e.charAt(0)||GI!=e.charAt(1))){for(var b=2;$l!=e.charAt(b)&&(GI!=e.charAt(b)||UI!=e.charAt(b+1));)++b;if(b+=2,$l===e.charAt(b-1))return a("End of comment missing");var v=e.slice(2,b-2);return r+=2,o(v),e=e.slice(b),r+=2,m({type:eSe,comment:v})}}function p(){var m=i(),b=l(Y1e);if(b){if(d(),!l(K1e))return a("property missing ':'");var v=l(X1e),x=m({type:tSe,property:qI(b[0].replace(WI,$l)),value:v?qI(v[0].replace(WI,$l)):$l});return l(Q1e),x}}function h(){var m=[];u(m);for(var b;b=p();)b!==!1&&(m.push(b),u(m));return m}return c(),h()};function qI(e){return e?e.replace(Z1e,$l):$l}var rSe=Qi&&Qi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(UR,"__esModule",{value:!0});UR.default=iSe;var oSe=rSe(nSe);function iSe(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,oSe.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 Ny={};Object.defineProperty(Ny,"__esModule",{value:!0});Ny.camelCase=void 0;var sSe=/^--[a-zA-Z0-9_-]+$/,aSe=/-([a-z])/g,lSe=/^[^-]+$/,cSe=/^-(webkit|moz|ms|o|khtml)-/,uSe=/^-(ms)-/,dSe=function(e){return!e||lSe.test(e)||sSe.test(e)},fSe=function(e,t){return t.toUpperCase()},YI=function(e,t){return"".concat(t,"-")},hSe=function(e,t){return t===void 0&&(t={}),dSe(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(uSe,YI):e=e.replace(cSe,YI),e.replace(aSe,fSe))};Ny.camelCase=hSe;var pSe=Qi&&Qi.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},gSe=pSe(UR),mSe=Ny;function P_(e,t){var n={};return!e||typeof e!="string"||(0,gSe.default)(e,function(r,o){r&&o&&(n[(0,mSe.camelCase)(r,t)]=o)}),n}P_.default=P_;var bSe=P_;const ySe=nl(bSe),V9=W9("end"),GR=W9("start");function W9(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 vSe(e){const t=GR(e),n=V9(e);if(t&&n)return{start:t,end:n}}function xh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?KI(e.position):"start"in e||"end"in e?KI(e):"line"in e||"column"in e?T_(e):""}function T_(e){return XI(e&&e.line)+":"+XI(e&&e.column)}function KI(e){return T_(e&&e.start)+"-"+T_(e&&e.end)}function XI(e){return e&&typeof e=="number"?e:1}class Nr 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=xh(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}}Nr.prototype.file="";Nr.prototype.name="";Nr.prototype.reason="";Nr.prototype.message="";Nr.prototype.stack="";Nr.prototype.column=void 0;Nr.prototype.line=void 0;Nr.prototype.ancestors=void 0;Nr.prototype.cause=void 0;Nr.prototype.fatal=void 0;Nr.prototype.place=void 0;Nr.prototype.ruleId=void 0;Nr.prototype.source=void 0;const qR={}.hasOwnProperty,xSe=new Map,wSe=/[A-Z]/g,SSe=new Set(["table","tbody","thead","tfoot","tr"]),_Se=new Set(["td","th"]),U9="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function CSe(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=MSe(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=OSe(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"?WR:W1e,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=G9(o,e,void 0);return i&&typeof i!="string"?i:o.create(e,o.Fragment,{children:i||void 0},void 0)}function G9(e,t,n){if(t.type==="element")return ESe(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return RSe(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return TSe(e,t,n);if(t.type==="mdxjsEsm")return PSe(e,t);if(t.type==="root")return kSe(e,t,n);if(t.type==="text")return ASe(e,t)}function ESe(e,t,n){const r=e.schema;let o=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=WR,e.schema=o),e.ancestors.push(t);const i=Y9(e,t.tagName,!1),s=ISe(e,t);let a=KR(e,t);return SSe.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!D1e(l):!0})),q9(e,s,i,t),YR(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function RSe(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)}Jh(e,t.position)}function PSe(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Jh(e,t.position)}function TSe(e,t,n){const r=e.schema;let o=r;t.name==="svg"&&r.space==="html"&&(o=WR,e.schema=o),e.ancestors.push(t);const i=t.name===null?e.Fragment:Y9(e,t.name,!0),s=DSe(e,t),a=KR(e,t);return q9(e,s,i,t),YR(s,a),e.ancestors.pop(),e.schema=r,e.create(t,i,s,n)}function kSe(e,t,n){const r={};return YR(r,KR(e,t)),e.create(t,e.Fragment,r,n)}function ASe(e,t){return t.value}function q9(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function YR(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function OSe(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 MSe(e,t){return n;function n(r,o,i,s){const a=Array.isArray(i.children),l=GR(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 ISe(e,t){const n={};let r,o;for(o in t.properties)if(o!=="children"&&qR.call(t.properties,o)){const i=NSe(e,o,t.properties[o]);if(i){const[s,a]=i;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&_Se.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 DSe(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 Jh(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 Jh(e,t.position);else i=r.value===null?!0:r.value;n[o]=i}return n}function KR(e,t){const n=[];let r=-1;const o=e.passKeys?new Map:xSe;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=G9(e,i,s);a!==void 0&&n.push(a)}return n}function NSe(e,t,n){const r=B1e(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?k1e(n):U1e(n)),r.property==="style"){let o=typeof n=="object"?n:LSe(e,String(n));return e.stylePropertyNameCase==="css"&&(o=FSe(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?j1e[r.property]||r.property:r.attribute,n]}}function LSe(e,t){try{return ySe(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,o=new Nr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=U9+"#cannot-parse-style-attribute",o}}function Y9(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=zI(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=zI(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const o=r.value;return qR.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Jh(e)}function Jh(e,t){const n=new Nr("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=U9+"#cannot-handle-mdx-estrees-without-createevaluater",n}function FSe(e){const t={};let n;for(n in e)qR.call(e,n)&&(t[jSe(n)]=e[n]);return t}function jSe(e){let t=e.replace(wSe,$Se);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function $Se(e){return"-"+e.toLowerCase()}const Gw={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"]},zSe={};function BSe(e,t){const n=zSe,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return K9(e,r,o)}function K9(e,t,n){if(HSe(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 QI(e.children,t,n)}return Array.isArray(e)?QI(e,t,n):""}function QI(e,t,n){const r=[];let o=-1;for(;++o<e.length;)r[o]=K9(e[o],t,n);return r.join("")}function HSe(e){return!!(e&&typeof e=="object")}const ZI=document.createElement("i");function XR(e){const t="&"+e+";";ZI.innerHTML=t;const n=ZI.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ms(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 ai(e,t){return e.length>0?(ms(e,e.length,0,t),e):t}const JI={}.hasOwnProperty;function VSe(e){const t={};let n=-1;for(;++n<e.length;)WSe(t,e[n]);return t}function WSe(e,t){let n;for(n in t){const o=(JI.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n];let s;if(i)for(s in i){JI.call(o,s)||(o[s]=[]);const a=i[s];USe(o[s],Array.isArray(a)?a:a?[a]:[])}}}function USe(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ms(e,0,0,r)}function X9(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 Bu(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ns=dl(/[A-Za-z]/),$o=dl(/[\dA-Za-z]/),GSe=dl(/[#-'*+\--9=?A-Z^-~]/);function k_(e){return e!==null&&(e<32||e===127)}const A_=dl(/\d/),qSe=dl(/[\dA-Fa-f]/),YSe=dl(/[!-/:-@[-`{-~]/);function nt(e){return e!==null&&e<-2}function wo(e){return e!==null&&(e<0||e===32)}function Yt(e){return e===-2||e===-1||e===32}const KSe=dl(new RegExp("\\p{P}|\\p{S}","u")),XSe=dl(/\s/);function dl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function qd(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 gn(e,t,n,r){const o=r?r-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return Yt(l)?(e.enter(n),a(l)):t(l)}function a(l){return Yt(l)&&i++<o?(e.consume(l),a):(e.exit(n),t(l))}}const QSe={tokenize:ZSe};function ZSe(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"),gn(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 nt(a)?(e.consume(a),e.exit("chunkText"),i):(e.consume(a),s)}}const JSe={tokenize:e_e},eD={tokenize:t_e};function e_e(e){const t=this,n=[];let r=0,o,i,s;return a;function a(_){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,l,c)(_)}return c(_)}function l(_){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,o&&w();const R=t.events.length;let C=R,E;for(;C--;)if(t.events[C][0]==="exit"&&t.events[C][1].type==="chunkFlow"){E=t.events[C][1].end;break}x(r);let A=R;for(;A<t.events.length;)t.events[A][1].end={...E},A++;return ms(t.events,C+1,0,t.events.slice(R)),t.events.length=A,c(_)}return a(_)}function c(_){if(r===n.length){if(!o)return p(_);if(o.currentConstruct&&o.currentConstruct.concrete)return m(_);t.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(eD,u,d)(_)}function u(_){return o&&w(),x(r),p(_)}function d(_){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(_)}function p(_){return t.containerState={},e.attempt(eD,h,m)(_)}function h(_){return r++,n.push([t.currentConstruct,t.containerState]),p(_)}function m(_){if(_===null){o&&w(),x(0),e.consume(_);return}return o=o||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:i}),b(_)}function b(_){if(_===null){v(e.exit("chunkFlow"),!0),x(0),e.consume(_);return}return nt(_)?(e.consume(_),v(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(_),b)}function v(_,R){const C=t.sliceStream(_);if(R&&C.push(null),_.previous=i,i&&(i.next=_),i=_,o.defineSkip(_.start),o.write(C),t.parser.lazy[_.start.line]){let E=o.events.length;for(;E--;)if(o.events[E][1].start.offset<s&&(!o.events[E][1].end||o.events[E][1].end.offset>s))return;const A=t.events.length;let M=A,D,L;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){if(D){L=t.events[M][1].end;break}D=!0}for(x(r),E=A;E<t.events.length;)t.events[E][1].end={...L},E++;ms(t.events,M+1,0,t.events.slice(A)),t.events.length=E}}function x(_){let R=n.length;for(;R-- >_;){const C=n[R];t.containerState=C[1],C[0].exit.call(t,e)}n.length=_}function w(){o.write([null]),i=void 0,o=void 0,t.containerState._closeFlow=void 0}}function t_e(e,t,n){return gn(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function tD(e){if(e===null||wo(e)||XSe(e))return 1;if(KSe(e))return 2}function QR(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 O_={name:"attention",resolveAll:n_e,tokenize:r_e};function n_e(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={...e[r][1].end},p={...e[n][1].start};nD(d,-l),nD(p,l),s={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},i={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},o={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ai(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ai(c,[["enter",o,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=ai(c,QR(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ai(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=ai(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,ms(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 r_e(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,o=tD(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=tD(l),d=!u||u===2&&o||n.includes(l),p=!o||o===2&&u||n.includes(r);return c._open=!!(i===42?d:d&&(o||!p)),c._close=!!(i===42?p:p&&(u||!d)),t(l)}}function nD(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const o_e={name:"autolink",tokenize:i_e};function i_e(e,t,n){let r=0;return o;function o(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(h){return ns(h)?(e.consume(h),s):h===64?n(h):c(h)}function s(h){return h===43||h===45||h===46||$o(h)?(r=1,a(h)):c(h)}function a(h){return h===58?(e.consume(h),r=0,l):(h===43||h===45||h===46||$o(h))&&r++<32?(e.consume(h),a):(r=0,c(h))}function l(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||k_(h)?n(h):(e.consume(h),l)}function c(h){return h===64?(e.consume(h),u):GSe(h)?(e.consume(h),c):n(h)}function u(h){return $o(h)?d(h):n(h)}function d(h){return h===46?(e.consume(h),r=0,u):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||$o(h))&&r++<63){const m=h===45?p:d;return e.consume(h),m}return n(h)}}const Ly={partial:!0,tokenize:s_e};function s_e(e,t,n){return r;function r(i){return Yt(i)?gn(e,o,"linePrefix")(i):o(i)}function o(i){return i===null||nt(i)?t(i):n(i)}}const Q9={continuation:{tokenize:l_e},exit:c_e,name:"blockQuote",tokenize:a_e};function a_e(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 Yt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function l_e(e,t,n){const r=this;return o;function o(s){return Yt(s)?gn(e,i,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(Q9,t,n)(s)}}function c_e(e){e.exit("blockQuote")}const Z9={name:"characterEscape",tokenize:u_e};function u_e(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 YSe(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(i)}}const J9={name:"characterReference",tokenize:d_e};function d_e(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=qSe,u):(e.enter("characterReferenceValue"),i=7,s=A_,u(d))}function u(d){if(d===59&&o){const p=e.exit("characterReferenceValue");return s===$o&&!XR(r.sliceSerialize(p))?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 rD={partial:!0,tokenize:h_e},oD={concrete:!0,name:"codeFenced",tokenize:f_e};function f_e(e,t,n){const r=this,o={partial:!0,tokenize:C};let i=0,s=0,a;return l;function l(E){return c(E)}function c(E){const A=r.events[r.events.length-1];return i=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,a=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(E)}function u(E){return E===a?(s++,e.consume(E),u):s<3?n(E):(e.exit("codeFencedFenceSequence"),Yt(E)?gn(e,d,"whitespace")(E):d(E))}function d(E){return E===null||nt(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(rD,b,R)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(E))}function p(E){return E===null||nt(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(E)):Yt(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),gn(e,h,"whitespace")(E)):E===96&&E===a?n(E):(e.consume(E),p)}function h(E){return E===null||nt(E)?d(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===null||nt(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(E)):E===96&&E===a?n(E):(e.consume(E),m)}function b(E){return e.attempt(o,R,v)(E)}function v(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),x}function x(E){return i>0&&Yt(E)?gn(e,w,"linePrefix",i+1)(E):w(E)}function w(E){return E===null||nt(E)?e.check(rD,b,R)(E):(e.enter("codeFlowValue"),_(E))}function _(E){return E===null||nt(E)?(e.exit("codeFlowValue"),w(E)):(e.consume(E),_)}function R(E){return e.exit("codeFenced"),t(E)}function C(E,A,M){let D=0;return L;function L(F){return E.enter("lineEnding"),E.consume(F),E.exit("lineEnding"),j}function j(F){return E.enter("codeFencedFence"),Yt(F)?gn(E,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):z(F)}function z(F){return F===a?(E.enter("codeFencedFenceSequence"),Q(F)):M(F)}function Q(F){return F===a?(D++,E.consume(F),Q):D>=s?(E.exit("codeFencedFenceSequence"),Yt(F)?gn(E,G,"whitespace")(F):G(F)):M(F)}function G(F){return F===null||nt(F)?(E.exit("codeFencedFence"),A(F)):M(F)}}}function h_e(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 qw={name:"codeIndented",tokenize:g_e},p_e={partial:!0,tokenize:m_e};function g_e(e,t,n){const r=this;return o;function o(c){return e.enter("codeIndented"),gn(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):nt(c)?e.attempt(p_e,s,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||nt(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function m_e(e,t,n){const r=this;return o;function o(s){return r.parser.lazy[r.now().line]?n(s):nt(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):gn(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):nt(s)?o(s):n(s)}}const b_e={name:"codeText",previous:v_e,resolve:y_e,tokenize:x_e};function y_e(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 v_e(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function x_e(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)):nt(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||nt(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))}}class w_e{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const o=n||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&If(this.left,r),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),If(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),If(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);If(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);If(this.left,n.reverse())}}}function If(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function e$(e){const t={};let n=-1,r,o,i,s,a,l,c;const u=new w_e(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(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,S_e(u,n)),n=t[n],c=!0);else if(r[1]._container){for(i=n,o=void 0;i--;)if(s=u.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(o&&(u.get(o)[1].type="lineEndingBlank"),s[1].type="lineEnding",o=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;o&&(r[1].end={...u.get(o)[1].start},a=u.slice(o,n),a.unshift(r),u.splice(o,n-o+1,a))}}return ms(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function S_e(e,t){const n=e.get(t)[1],r=e.get(t)[2];let o=t-1;const i=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],c={};let u,d,p=-1,h=n,m=0,b=0;const v=[b];for(;h;){for(;e.get(++o)[1]!==h;);i.push(o),h._tokenizer||(u=r.sliceStream(h),h.next||u.push(null),d&&s.defineSkip(h.start),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(u),h._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=h,h=h.next}for(h=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(b=p+1,v.push(b),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(s.events=[],h?(h._tokenizer=void 0,h.previous=void 0):v.pop(),p=v.length;p--;){const x=a.slice(v[p],v[p+1]),w=i.pop();l.push([w,w+x.length-1]),e.splice(w,2,x)}for(l.reverse(),p=-1;++p<l.length;)c[m+l[p][0]]=m+l[p][1],m+=l[p][1]-l[p][0]-1;return c}const __e={resolve:E_e,tokenize:R_e},C_e={partial:!0,tokenize:P_e};function E_e(e){return e$(e),e}function R_e(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):nt(a)?e.check(C_e,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 P_e(e,t,n){const r=this;return o;function o(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),gn(e,i,"linePrefix")}function i(s){if(s===null||nt(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 t$(e,t,n,r,o,i,s,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(x){return x===60?(e.enter(r),e.enter(o),e.enter(i),e.consume(x),e.exit(i),p):x===null||x===32||x===41||k_(x)?n(x):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),b(x))}function p(x){return x===62?(e.enter(i),e.consume(x),e.exit(i),e.exit(o),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||nt(x)?n(x):(e.consume(x),x===92?m:h)}function m(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function b(x){return!u&&(x===null||x===41||wo(x))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(x)):u<c&&x===40?(e.consume(x),u++,b):x===41?(e.consume(x),u--,b):x===null||x===32||x===40||k_(x)?n(x):(e.consume(x),x===92?v:b)}function v(x){return x===40||x===41||x===92?(e.consume(x),b):b(x)}}function n$(e,t,n,r,o,i){const s=this;let a=0,l;return c;function c(h){return e.enter(r),e.enter(o),e.consume(h),e.exit(o),e.enter(i),u}function u(h){return a>999||h===null||h===91||h===93&&!l||h===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(h):h===93?(e.exit(i),e.enter(o),e.consume(h),e.exit(o),e.exit(r),t):nt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===null||h===91||h===93||nt(h)||a++>999?(e.exit("chunkString"),u(h)):(e.consume(h),l||(l=!Yt(h)),h===92?p:d)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,d):d(h)}}function r$(e,t,n,r,o,i){let s;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(o),e.consume(p),e.exit(o),s=p===40?41:p,l):n(p)}function l(p){return p===s?(e.enter(o),e.consume(p),e.exit(o),e.exit(r),t):(e.enter(i),c(p))}function c(p){return p===s?(e.exit(i),l(s)):p===null?n(p):nt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),gn(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(p))}function u(p){return p===s||p===null||nt(p)?(e.exit("chunkString"),c(p)):(e.consume(p),p===92?d:u)}function d(p){return p===s||p===92?(e.consume(p),u):u(p)}}function wh(e,t){let n;return r;function r(o){return nt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r):Yt(o)?gn(e,r,n?"linePrefix":"lineSuffix")(o):t(o)}}const T_e={name:"definition",tokenize:A_e},k_e={partial:!0,tokenize:O_e};function A_e(e,t,n){const r=this;let o;return i;function i(h){return e.enter("definition"),s(h)}function s(h){return n$.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return o=Bu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),l):n(h)}function l(h){return wo(h)?wh(e,c)(h):c(h)}function c(h){return t$(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function u(h){return e.attempt(k_e,d,d)(h)}function d(h){return Yt(h)?gn(e,p,"whitespace")(h):p(h)}function p(h){return h===null||nt(h)?(e.exit("definition"),r.parser.defined.push(o),t(h)):n(h)}}function O_e(e,t,n){return r;function r(a){return wo(a)?wh(e,o)(a):n(a)}function o(a){return r$(e,i,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function i(a){return Yt(a)?gn(e,s,"whitespace")(a):s(a)}function s(a){return a===null||nt(a)?t(a):n(a)}}const M_e={name:"hardBreakEscape",tokenize:I_e};function I_e(e,t,n){return r;function r(i){return e.enter("hardBreakEscape"),e.consume(i),o}function o(i){return nt(i)?(e.exit("hardBreakEscape"),t(i)):n(i)}}const D_e={name:"headingAtx",resolve:N_e,tokenize:L_e};function N_e(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"},ms(e,r,n-r+1,[["enter",o,t],["enter",i,t],["exit",i,t],["exit",o,t]])),e}function L_e(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||wo(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||nt(u)?(e.exit("atxHeading"),t(u)):Yt(u)?gn(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||wo(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const F_e=["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"],iD=["pre","script","style","textarea"],j_e={concrete:!0,name:"htmlFlow",resolveTo:B_e,tokenize:H_e},$_e={partial:!0,tokenize:W_e},z_e={partial:!0,tokenize:V_e};function B_e(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 H_e(e,t,n){const r=this;let o,i,s,a,l;return c;function c(O){return u(O)}function u(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),d}function d(O){return O===33?(e.consume(O),p):O===47?(e.consume(O),i=!0,b):O===63?(e.consume(O),o=3,r.interrupt?t:I):ns(O)?(e.consume(O),s=String.fromCharCode(O),v):n(O)}function p(O){return O===45?(e.consume(O),o=2,h):O===91?(e.consume(O),o=5,a=0,m):ns(O)?(e.consume(O),o=4,r.interrupt?t:I):n(O)}function h(O){return O===45?(e.consume(O),r.interrupt?t:I):n(O)}function m(O){const ee="CDATA[";return O===ee.charCodeAt(a++)?(e.consume(O),a===ee.length?r.interrupt?t:z:m):n(O)}function b(O){return ns(O)?(e.consume(O),s=String.fromCharCode(O),v):n(O)}function v(O){if(O===null||O===47||O===62||wo(O)){const ee=O===47,K=s.toLowerCase();return!ee&&!i&&iD.includes(K)?(o=1,r.interrupt?t(O):z(O)):F_e.includes(s.toLowerCase())?(o=6,ee?(e.consume(O),x):r.interrupt?t(O):z(O)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):i?w(O):_(O))}return O===45||$o(O)?(e.consume(O),s+=String.fromCharCode(O),v):n(O)}function x(O){return O===62?(e.consume(O),r.interrupt?t:z):n(O)}function w(O){return Yt(O)?(e.consume(O),w):L(O)}function _(O){return O===47?(e.consume(O),L):O===58||O===95||ns(O)?(e.consume(O),R):Yt(O)?(e.consume(O),_):L(O)}function R(O){return O===45||O===46||O===58||O===95||$o(O)?(e.consume(O),R):C(O)}function C(O){return O===61?(e.consume(O),E):Yt(O)?(e.consume(O),C):_(O)}function E(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),l=O,A):Yt(O)?(e.consume(O),E):M(O)}function A(O){return O===l?(e.consume(O),l=null,D):O===null||nt(O)?n(O):(e.consume(O),A)}function M(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||wo(O)?C(O):(e.consume(O),M)}function D(O){return O===47||O===62||Yt(O)?_(O):n(O)}function L(O){return O===62?(e.consume(O),j):n(O)}function j(O){return O===null||nt(O)?z(O):Yt(O)?(e.consume(O),j):n(O)}function z(O){return O===45&&o===2?(e.consume(O),H):O===60&&o===1?(e.consume(O),$):O===62&&o===4?(e.consume(O),q):O===63&&o===3?(e.consume(O),I):O===93&&o===5?(e.consume(O),X):nt(O)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check($_e,U,Q)(O)):O===null||nt(O)?(e.exit("htmlFlowData"),Q(O)):(e.consume(O),z)}function Q(O){return e.check(z_e,G,U)(O)}function G(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),F}function F(O){return O===null||nt(O)?Q(O):(e.enter("htmlFlowData"),z(O))}function H(O){return O===45?(e.consume(O),I):z(O)}function $(O){return O===47?(e.consume(O),s="",V):z(O)}function V(O){if(O===62){const ee=s.toLowerCase();return iD.includes(ee)?(e.consume(O),q):z(O)}return ns(O)&&s.length<8?(e.consume(O),s+=String.fromCharCode(O),V):z(O)}function X(O){return O===93?(e.consume(O),I):z(O)}function I(O){return O===62?(e.consume(O),q):O===45&&o===2?(e.consume(O),I):z(O)}function q(O){return O===null||nt(O)?(e.exit("htmlFlowData"),U(O)):(e.consume(O),q)}function U(O){return e.exit("htmlFlow"),t(O)}}function V_e(e,t,n){const r=this;return o;function o(s){return nt(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 W_e(e,t,n){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Ly,t,n)}}const U_e={name:"htmlText",tokenize:G_e};function G_e(e,t,n){const r=this;let o,i,s;return a;function a(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),l}function l(I){return I===33?(e.consume(I),c):I===47?(e.consume(I),C):I===63?(e.consume(I),_):ns(I)?(e.consume(I),M):n(I)}function c(I){return I===45?(e.consume(I),u):I===91?(e.consume(I),i=0,m):ns(I)?(e.consume(I),w):n(I)}function u(I){return I===45?(e.consume(I),h):n(I)}function d(I){return I===null?n(I):I===45?(e.consume(I),p):nt(I)?(s=d,$(I)):(e.consume(I),d)}function p(I){return I===45?(e.consume(I),h):d(I)}function h(I){return I===62?H(I):I===45?p(I):d(I)}function m(I){const q="CDATA[";return I===q.charCodeAt(i++)?(e.consume(I),i===q.length?b:m):n(I)}function b(I){return I===null?n(I):I===93?(e.consume(I),v):nt(I)?(s=b,$(I)):(e.consume(I),b)}function v(I){return I===93?(e.consume(I),x):b(I)}function x(I){return I===62?H(I):I===93?(e.consume(I),x):b(I)}function w(I){return I===null||I===62?H(I):nt(I)?(s=w,$(I)):(e.consume(I),w)}function _(I){return I===null?n(I):I===63?(e.consume(I),R):nt(I)?(s=_,$(I)):(e.consume(I),_)}function R(I){return I===62?H(I):_(I)}function C(I){return ns(I)?(e.consume(I),E):n(I)}function E(I){return I===45||$o(I)?(e.consume(I),E):A(I)}function A(I){return nt(I)?(s=A,$(I)):Yt(I)?(e.consume(I),A):H(I)}function M(I){return I===45||$o(I)?(e.consume(I),M):I===47||I===62||wo(I)?D(I):n(I)}function D(I){return I===47?(e.consume(I),H):I===58||I===95||ns(I)?(e.consume(I),L):nt(I)?(s=D,$(I)):Yt(I)?(e.consume(I),D):H(I)}function L(I){return I===45||I===46||I===58||I===95||$o(I)?(e.consume(I),L):j(I)}function j(I){return I===61?(e.consume(I),z):nt(I)?(s=j,$(I)):Yt(I)?(e.consume(I),j):D(I)}function z(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),o=I,Q):nt(I)?(s=z,$(I)):Yt(I)?(e.consume(I),z):(e.consume(I),G)}function Q(I){return I===o?(e.consume(I),o=void 0,F):I===null?n(I):nt(I)?(s=Q,$(I)):(e.consume(I),Q)}function G(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||wo(I)?D(I):(e.consume(I),G)}function F(I){return I===47||I===62||wo(I)?D(I):n(I)}function H(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function $(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),V}function V(I){return Yt(I)?gn(e,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):X(I)}function X(I){return e.enter("htmlTextData"),s(I)}}const ZR={name:"labelEnd",resolveAll:X_e,resolveTo:Q_e,tokenize:Z_e},q_e={tokenize:J_e},Y_e={tokenize:eCe},K_e={tokenize:tCe};function X_e(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",t+=o}}return e.length!==n.length&&ms(e,0,e.length,n),e}function Q_e(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:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},u={type:"labelText",start:{...e[i+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=ai(a,e.slice(i+1,i+r+3)),a=ai(a,[["enter",u,t]]),a=ai(a,QR(t.parser.constructs.insideSpan.null,e.slice(i+r+4,s-3),t)),a=ai(a,[["exit",u,t],e[s-2],e[s-1],["exit",c,t]]),a=ai(a,e.slice(s+1)),a=ai(a,[["exit",l,t]]),ms(e,i,e.length,a),e}function Z_e(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(p){return i?i._inactive?d(p):(s=r.parser.defined.includes(Bu(r.sliceSerialize({start:i.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(q_e,u,s?u:d)(p):p===91?e.attempt(Y_e,u,s?c:d)(p):s?u(p):d(p)}function c(p){return e.attempt(K_e,u,d)(p)}function u(p){return t(p)}function d(p){return i._balanced=!0,n(p)}}function J_e(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 wo(d)?wh(e,i)(d):i(d)}function i(d){return d===41?u(d):t$(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return wo(d)?wh(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?r$(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return wo(d)?wh(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 eCe(e,t,n){const r=this;return o;function o(a){return n$.call(r,e,i,s,"reference","referenceMarker","referenceString")(a)}function i(a){return r.parser.defined.includes(Bu(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function tCe(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 nCe={name:"labelStartImage",resolveAll:ZR.resolveAll,tokenize:rCe};function rCe(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 oCe={name:"labelStartLink",resolveAll:ZR.resolveAll,tokenize:iCe};function iCe(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 Yw={name:"lineEnding",tokenize:sCe};function sCe(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),gn(e,t,"linePrefix")}}const cb={name:"thematicBreak",tokenize:aCe};function aCe(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||nt(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===o?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),Yt(c)?gn(e,a,"whitespace")(c):a(c))}}const lo={continuation:{tokenize:dCe},exit:hCe,name:"list",tokenize:uCe},lCe={partial:!0,tokenize:pCe},cCe={partial:!0,tokenize:fCe};function uCe(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(h){const m=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:A_(h)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(cb,n,c)(h):c(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(h)}return n(h)}function l(h){return A_(h)&&++s<10?(e.consume(h),l):(!r.interrupt||s<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),c(h)):n(h)}function c(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Ly,r.interrupt?n:u,e.attempt(lCe,p,d))}function u(h){return r.containerState.initialBlankLine=!0,i++,p(h)}function d(h){return Yt(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=i+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function dCe(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ly,o,i);function o(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,gn(e,t,"listItemIndent",r.containerState.size+1)(a)}function i(a){return r.containerState.furtherBlankLines||!Yt(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(cCe,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,gn(e,e.attempt(lo,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function fCe(e,t,n){const r=this;return gn(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 hCe(e){e.exit(this.containerState.type)}function pCe(e,t,n){const r=this;return gn(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!Yt(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):n(i)}}const sD={name:"setextUnderline",resolveTo:gCe,tokenize:mCe};function gCe(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:{...e[r][1].start},end:{...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={...e[i][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function mCe(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"),Yt(c)?gn(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||nt(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const bCe={tokenize:yCe};function yCe(e){const t=this,n=e.attempt(Ly,r,e.attempt(this.parser.constructs.flowInitial,o,gn(e,e.attempt(this.parser.constructs.flow,o,e.attempt(__e,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 vCe={resolveAll:i$()},xCe=o$("string"),wCe=o$("text");function o$(e){return{resolveAll:i$(e==="text"?SCe:void 0),tokenize:t};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 p=-1;if(d)for(;++p<d.length;){const h=d[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function i$(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 SCe(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(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:r.start._bufferIndex+s,_index:r.start._index+i,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...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}const _Ce={42:lo,43:lo,45:lo,48:lo,49:lo,50:lo,51:lo,52:lo,53:lo,54:lo,55:lo,56:lo,57:lo,62:Q9},CCe={91:T_e},ECe={[-2]:qw,[-1]:qw,32:qw},RCe={35:D_e,42:cb,45:[sD,cb],60:j_e,61:sD,95:cb,96:oD,126:oD},PCe={38:J9,92:Z9},TCe={[-5]:Yw,[-4]:Yw,[-3]:Yw,33:nCe,38:J9,42:O_,60:[o_e,U_e],91:oCe,92:[M_e,Z9],93:ZR,95:O_,96:b_e},kCe={null:[O_,vCe]},ACe={null:[42,95]},OCe={null:[]},MCe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:ACe,contentInitial:CCe,disable:OCe,document:_Ce,flow:RCe,flowInitial:ECe,insideSpan:kCe,string:PCe,text:TCe},Symbol.toStringTag,{value:"Module"}));function ICe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const o={},i=[];let s=[],a=[];const l={attempt:A(C),check:A(E),consume:w,enter:_,exit:R,interrupt:A(E,{interrupt:!0})},c={code:null,containerState:{},defineSkip:b,events:[],now:m,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function d(j){return s=ai(s,j),v(),s[s.length-1]!==null?[]:(M(t,0),c.events=QR(i,c.events,c),c.events)}function p(j,z){return NCe(h(j),z)}function h(j){return DCe(s,j)}function m(){const{_bufferIndex:j,_index:z,line:Q,column:G,offset:F}=r;return{_bufferIndex:j,_index:z,line:Q,column:G,offset:F}}function b(j){o[j.line]=j.column,L()}function v(){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;)x(z.charCodeAt(r._bufferIndex));else x(z)}}function x(j){u=u(j)}function w(j){nt(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 _(j,z){const Q=z||{};return Q.type=j,Q.start=m(),c.events.push(["enter",Q,c]),a.push(Q),Q}function R(j){const z=a.pop();return z.end=m(),c.events.push(["exit",z,c]),z}function C(j,z){M(j,z.from)}function E(j,z){z.restore()}function A(j,z){return Q;function Q(G,F,H){let $,V,X,I;return Array.isArray(G)?U(G):"tokenize"in G?U([G]):q(G);function q(oe){return Y;function Y(J){const ie=J!==null&&oe[J],de=J!==null&&oe.null,he=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(de)?de:de?[de]:[]];return U(he)(J)}}function U(oe){return $=oe,V=0,oe.length===0?H:O(oe[V])}function O(oe){return Y;function Y(J){return I=D(),X=oe,oe.partial||(c.currentConstruct=oe),oe.name&&c.parser.constructs.disable.null.includes(oe.name)?K():oe.tokenize.call(z?Object.assign(Object.create(c),z):c,l,ee,K)(J)}}function ee(oe){return j(X,I),F}function K(oe){return I.restore(),++V<$.length?O($[V]):H}}}function M(j,z){j.resolveAll&&!i.includes(j)&&i.push(j),j.resolve&&ms(c.events,z,c.events.length-z,j.resolve(c.events.slice(z),c)),j.resolveTo&&(c.events=j.resolveTo(c.events,c))}function D(){const j=m(),z=c.previous,Q=c.currentConstruct,G=c.events.length,F=Array.from(a);return{from:G,restore:H};function H(){r=j,c.previous=z,c.currentConstruct=Q,c.events.length=G,a=F,L()}}function L(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function DCe(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 NCe(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=`
|
|
396
|
+
`;break}case-3:{s=`\r
|
|
397
|
+
`;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("")}function LCe(e){const r={constructs:VSe([MCe,...(e||{}).extensions||[]]),content:o(QSe),defined:[],document:o(JSe),flow:o(bCe),lazy:{},string:o(xCe),text:o(wCe)};return r;function o(i){return s;function s(a){return ICe(r,i,a)}}}function FCe(e){for(;!e$(e););return e}const aD=/[\0\t\n\r]/g;function jCe(){let e=1,t="",n=!0,r;return o;function o(i,s,a){const l=[];let c,u,d,p,h;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(aD.lastIndex=d,c=aD.exec(i),p=c&&c.index!==void 0?c.index:i.length,h=i.charCodeAt(p),!c){t=i.slice(d);break}if(h===10&&d===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<p&&(l.push(i.slice(d,p)),e+=p-d),h){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=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const $Ce=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function zCe(e){return e.replace($Ce,BCe)}function BCe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const o=n.charCodeAt(1),i=o===120||o===88;return X9(n.slice(i?2:1),i?16:10)}return XR(n)||e}const s$={}.hasOwnProperty;function HCe(e,t,n){return typeof t!="string"&&(n=t,t=void 0),VCe(n)(FCe(LCe(n).document().write(jCe()(e,t,!0))))}function VCe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Fe),autolinkProtocol:D,autolinkEmail:D,atxHeading:i(Ee),blockQuote:i(de),characterEscape:D,characterReference:D,codeFenced:i(he),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(he,s),codeText:i(ae,s),codeTextData:D,data:D,codeFlowValue:D,definition:i(ge),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(ue),hardBreakEscape:i(Te),hardBreakTrailing:i(Te),htmlFlow:i(Le,s),htmlFlowData:D,htmlText:i(Le,s),htmlTextData:D,image:i(Ae),label:s,link:i(Fe),listItem:i(at),listItemValue:p,listOrdered:i(tt,d),listUnordered:i(tt),paragraph:i(cn),reference:O,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(Ee),strong:i(St),thematicBreak:i(Rt)},exit:{atxHeading:l(),atxHeadingSequence:C,autolink:l(),autolinkEmail:ie,autolinkProtocol:J,blockQuote:l(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:K,characterReferenceMarkerNumeric:K,characterReferenceValue:oe,characterReference:Y,codeFenced:l(v),codeFencedFence:b,codeFencedFenceInfo:h,codeFencedFenceMeta:m,codeFlowValue:L,codeIndented:l(x),codeText:l(F),codeTextData:L,data:L,definition:l(),definitionDestinationString:R,definitionLabelString:w,definitionTitleString:_,emphasis:l(),hardBreakEscape:l(z),hardBreakTrailing:l(z),htmlFlow:l(Q),htmlFlowData:L,htmlText:l(G),htmlTextData:L,image:l($),label:X,labelText:V,lineEnding:j,link:l(H),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ee,resourceDestinationString:I,resourceTitleString:q,resource:U,setextHeading:l(M),setextHeadingLineSequence:A,setextHeadingText:E,strong:l(),thematicBreak:l()}};a$(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(fe){let _e={type:"root",children:[]};const He={stack:[_e],tokenStack:[],config:t,enter:a,exit:c,buffer:s,resume:u,data:n},We=[];let rt=-1;for(;++rt<fe.length;)if(fe[rt][1].type==="listOrdered"||fe[rt][1].type==="listUnordered")if(fe[rt][0]==="enter")We.push(rt);else{const An=We.pop();rt=o(fe,An,rt)}for(rt=-1;++rt<fe.length;){const An=t[fe[rt][0]];s$.call(An,fe[rt][1].type)&&An[fe[rt][1].type].call(Object.assign({sliceSerialize:fe[rt][2].sliceSerialize},He),fe[rt][1])}if(He.tokenStack.length>0){const An=He.tokenStack[He.tokenStack.length-1];(An[1]||lD).call(He,void 0,An[0])}for(_e.position={start:_a(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:_a(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},rt=-1;++rt<t.transforms.length;)_e=t.transforms[rt](_e)||_e;return _e}function o(fe,_e,He){let We=_e-1,rt=-1,An=!1,Fn,Rn,sn,jn;for(;++We<=He;){const Xt=fe[We];switch(Xt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Xt[0]==="enter"?rt++:rt--,jn=void 0;break}case"lineEndingBlank":{Xt[0]==="enter"&&(Fn&&!jn&&!rt&&!sn&&(sn=We),jn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:jn=void 0}if(!rt&&Xt[0]==="enter"&&Xt[1].type==="listItemPrefix"||rt===-1&&Xt[0]==="exit"&&(Xt[1].type==="listUnordered"||Xt[1].type==="listOrdered")){if(Fn){let or=We;for(Rn=void 0;or--;){const Xn=fe[or];if(Xn[1].type==="lineEnding"||Xn[1].type==="lineEndingBlank"){if(Xn[0]==="exit")continue;Rn&&(fe[Rn][1].type="lineEndingBlank",An=!0),Xn[1].type="lineEnding",Rn=or}else if(!(Xn[1].type==="linePrefix"||Xn[1].type==="blockQuotePrefix"||Xn[1].type==="blockQuotePrefixWhitespace"||Xn[1].type==="blockQuoteMarker"||Xn[1].type==="listItemIndent"))break}sn&&(!Rn||sn<Rn)&&(Fn._spread=!0),Fn.end=Object.assign({},Rn?fe[Rn][1].start:Xt[1].end),fe.splice(Rn||We,0,["exit",Fn,Xt[2]]),We++,He++}if(Xt[1].type==="listItemPrefix"){const or={type:"listItem",_spread:!1,start:Object.assign({},Xt[1].start),end:void 0};Fn=or,fe.splice(We,0,["enter",or,Xt[2]]),We++,He++,sn=void 0,jn=!0}}}return fe[_e][1]._spread=An,He}function i(fe,_e){return He;function He(We){a.call(this,fe(We),We),_e&&_e.call(this,We)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(fe,_e,He){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([_e,He||void 0]),fe.position={start:_a(_e.start),end:void 0}}function l(fe){return _e;function _e(He){fe&&fe.call(this,He),c.call(this,He)}}function c(fe,_e){const He=this.stack.pop(),We=this.tokenStack.pop();if(We)We[0].type!==fe.type&&(_e?_e.call(this,fe,We[0]):(We[1]||lD).call(this,fe,We[0]));else throw new Error("Cannot close `"+fe.type+"` ("+xh({start:fe.start,end:fe.end})+"): it’s not open");He.position.end=_a(fe.end)}function u(){return BSe(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(fe){if(this.data.expectingFirstListItemValue){const _e=this.stack[this.stack.length-2];_e.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function h(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.lang=fe}function m(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.meta=fe}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function v(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe.replace(/(\r?\n|\r)$/g,"")}function w(fe){const _e=this.resume(),He=this.stack[this.stack.length-1];He.label=_e,He.identifier=Bu(this.sliceSerialize(fe)).toLowerCase()}function _(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.title=fe}function R(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.url=fe}function C(fe){const _e=this.stack[this.stack.length-1];if(!_e.depth){const He=this.sliceSerialize(fe).length;_e.depth=He}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function A(fe){const _e=this.stack[this.stack.length-1];_e.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function M(){this.data.setextHeadingSlurpLineEnding=void 0}function D(fe){const He=this.stack[this.stack.length-1].children;let We=He[He.length-1];(!We||We.type!=="text")&&(We=Vn(),We.position={start:_a(fe.start),end:void 0},He.push(We)),this.stack.push(We)}function L(fe){const _e=this.stack.pop();_e.value+=this.sliceSerialize(fe),_e.position.end=_a(fe.end)}function j(fe){const _e=this.stack[this.stack.length-1];if(this.data.atHardBreak){const He=_e.children[_e.children.length-1];He.position.end=_a(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(_e.type)&&(D.call(this,fe),L.call(this,fe))}function z(){this.data.atHardBreak=!0}function Q(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}function G(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}function F(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.value=fe}function H(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=_e,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function $(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const _e=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=_e,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function V(fe){const _e=this.sliceSerialize(fe),He=this.stack[this.stack.length-2];He.label=zCe(_e),He.identifier=Bu(_e).toLowerCase()}function X(){const fe=this.stack[this.stack.length-1],_e=this.resume(),He=this.stack[this.stack.length-1];if(this.data.inReference=!0,He.type==="link"){const We=fe.children;He.children=We}else He.alt=_e}function I(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.url=fe}function q(){const fe=this.resume(),_e=this.stack[this.stack.length-1];_e.title=fe}function U(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function ee(fe){const _e=this.resume(),He=this.stack[this.stack.length-1];He.label=_e,He.identifier=Bu(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function K(fe){this.data.characterReferenceType=fe.type}function oe(fe){const _e=this.sliceSerialize(fe),He=this.data.characterReferenceType;let We;He?(We=X9(_e,He==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):We=XR(_e);const rt=this.stack[this.stack.length-1];rt.value+=We}function Y(fe){const _e=this.stack.pop();_e.position.end=_a(fe.end)}function J(fe){L.call(this,fe);const _e=this.stack[this.stack.length-1];_e.url=this.sliceSerialize(fe)}function ie(fe){L.call(this,fe);const _e=this.stack[this.stack.length-1];_e.url="mailto:"+this.sliceSerialize(fe)}function de(){return{type:"blockquote",children:[]}}function he(){return{type:"code",lang:null,meta:null,value:""}}function ae(){return{type:"inlineCode",value:""}}function ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ue(){return{type:"emphasis",children:[]}}function Ee(){return{type:"heading",depth:0,children:[]}}function Te(){return{type:"break"}}function Le(){return{type:"html",value:""}}function Ae(){return{type:"image",title:null,url:"",alt:null}}function Fe(){return{type:"link",title:null,url:"",children:[]}}function tt(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function at(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function cn(){return{type:"paragraph",children:[]}}function St(){return{type:"strong",children:[]}}function Vn(){return{type:"text",value:""}}function Rt(){return{type:"thematicBreak"}}}function _a(e){return{line:e.line,column:e.column,offset:e.offset}}function a$(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?a$(e,r):WCe(e,r)}}function WCe(e,t){let n;for(n in t)if(s$.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 lD(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+xh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+xh({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+xh({start:t.start,end:t.end})+") is still open")}function UCe(e){const t=this;t.parser=n;function n(r){return HCe(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function GCe(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 qCe(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
398
|
+
`}]}function YCe(e,t){const n=t.value?t.value+`
|
|
399
|
+
`:"",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 KCe(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function XCe(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function QCe(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),o=qd(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 ZCe(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 JCe(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function l$(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 eEe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return l$(e,t);const o={src:qd(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 tEe(e,t){const n={src:qd(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 nEe(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 rEe(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return l$(e,t);const o={href:qd(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 oEe(e,t){const n={href:qd(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 iEe(e,t,n){const r=e.all(t),o=n?sEe(n):c$(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:`
|
|
400
|
+
`}),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:`
|
|
401
|
+
`});const c={type:"element",tagName:"li",properties:i,children:s};return e.patch(t,c),e.applyData(t,c)}function sEe(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=c$(n[r])}return t}function c$(e){const t=e.spread;return t??e.children.length>1}function aEe(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 lEe(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cEe(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function uEe(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dEe(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=GR(t.children[1]),l=V9(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 fEe(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],p={},h=s?s[l]:void 0;h&&(p.align=h);let m={type:"element",tagName:i,properties:p,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 hEe(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const cD=9,uD=32;function pEe(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const i=[];for(;r;)i.push(dD(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return i.push(dD(t.slice(o),o>0,!1)),i.join("")}function dD(e,t,n){let r=0,o=e.length;if(t){let i=e.codePointAt(r);for(;i===cD||i===uD;)r++,i=e.codePointAt(r)}if(n){let i=e.codePointAt(o-1);for(;i===cD||i===uD;)o--,i=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function gEe(e,t){const n={type:"text",value:pEe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function mEe(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const bEe={blockquote:GCe,break:qCe,code:YCe,delete:KCe,emphasis:XCe,footnoteReference:QCe,heading:ZCe,html:JCe,imageReference:eEe,image:tEe,inlineCode:nEe,linkReference:rEe,link:oEe,listItem:iEe,list:aEe,paragraph:lEe,root:cEe,strong:uEe,table:dEe,tableCell:hEe,tableRow:fEe,text:gEe,thematicBreak:mEe,toml:jm,yaml:jm,definition:jm,footnoteDefinition:jm};function jm(){}const u$=-1,Fy=0,Sh=1,l0=2,JR=3,e2=4,t2=5,n2=6,d$=7,f$=8,fD=typeof self=="object"?self:globalThis,yEe=(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 Fy:case u$:return n(s,o);case Sh:{const a=n([],o);for(const l of s)a.push(r(l));return a}case l0:{const a=n({},o);for(const[l,c]of s)a[r(l)]=r(c);return a}case JR:return n(new Date(s),o);case e2:{const{source:a,flags:l}=s;return n(new RegExp(a,l),o)}case t2:{const a=n(new Map,o);for(const[l,c]of s)a.set(r(l),r(c));return a}case n2:{const a=n(new Set,o);for(const l of s)a.add(r(l));return a}case d$:{const{name:a,message:l}=s;return n(new fD[a](l),o)}case f$:return n(BigInt(s),o);case"BigInt":return n(Object(BigInt(s)),o);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new fD[i](s),o)};return r},hD=e=>yEe(new Map,e)(0),bu="",{toString:vEe}={},{keys:xEe}=Object,Df=e=>{const t=typeof e;if(t!=="object"||!e)return[Fy,t];const n=vEe.call(e).slice(8,-1);switch(n){case"Array":return[Sh,bu];case"Object":return[l0,bu];case"Date":return[JR,bu];case"RegExp":return[e2,bu];case"Map":return[t2,bu];case"Set":return[n2,bu];case"DataView":return[Sh,n]}return n.includes("Array")?[Sh,n]:n.includes("Error")?[d$,n]:[l0,n]},$m=([e,t])=>e===Fy&&(t==="function"||t==="symbol"),wEe=(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]=Df(s);switch(a){case Fy:{let u=s;switch(l){case"bigint":a=f$,u=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return o([u$],s)}return o([a,u],s)}case Sh:{if(l){let p=s;return l==="DataView"?p=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(s)),o([l,[...p]],s)}const u=[],d=o([a,u],s);for(const p of s)u.push(i(p));return d}case l0:{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 p of xEe(s))(e||!$m(Df(s[p])))&&u.push([i(p),i(s[p])]);return d}case JR:return o([a,s.toISOString()],s);case e2:{const{source:u,flags:d}=s;return o([a,{source:u,flags:d}],s)}case t2:{const u=[],d=o([a,u],s);for(const[p,h]of s)(e||!($m(Df(p))||$m(Df(h))))&&u.push([i(p),i(h)]);return d}case n2:{const u=[],d=o([a,u],s);for(const p of s)(e||!$m(Df(p)))&&u.push(i(p));return d}}const{message:c}=s;return o([a,{name:l,message:c}],s)};return i},pD=(e,{json:t,lossy:n}={})=>{const r=[];return wEe(!(t||n),!!t,new Map,r)(e),r},c0=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?hD(pD(e,t)):structuredClone(e):(e,t)=>hD(pD(e,t));function SEe(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 _Ee(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function CEe(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||SEe,r=e.options.footnoteBackLabel||_Ee,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(),p=qd(d.toLowerCase());let h=0;const m=[],b=e.footnoteCounts.get(d);for(;b!==void 0&&++h<=b;){m.length>0&&m.push({type:"text",value:" "});let w=typeof n=="string"?n:n(l,h);typeof w=="string"&&(w={type:"text",value:w}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(h>1?"-"+h:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,h),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const v=u[u.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const w=v.children[v.children.length-1];w&&w.type==="text"?w.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...m)}else u.push(...m);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(u,!0)};e.patch(c,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...c0(s),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
402
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
403
|
+
`}]}}const h$=function(e){if(e==null)return TEe;if(typeof e=="function")return jy(e);if(typeof e=="object")return Array.isArray(e)?EEe(e):REe(e);if(typeof e=="string")return PEe(e);throw new Error("Expected function, string, or object as test")};function EEe(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=h$(e[n]);return jy(r);function r(...o){let i=-1;for(;++i<t.length;)if(t[i].apply(this,o))return!0;return!1}}function REe(e){const t=e;return jy(n);function n(r){const o=r;let i;for(i in e)if(o[i]!==t[i])return!1;return!0}}function PEe(e){return jy(t);function t(n){return n&&n.type===e}}function jy(e){return t;function t(n,r,o){return!!(kEe(n)&&e.call(this,n,typeof r=="number"?r:void 0,o||void 0))}}function TEe(){return!0}function kEe(e){return e!==null&&typeof e=="object"&&"type"in e}const p$=[],AEe=!0,gD=!1,OEe="skip";function MEe(e,t,n,r){let o;typeof t=="function"&&typeof n!="function"?(r=n,n=t):o=t;const i=h$(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 h=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(h?"<"+h+">":""))+")"})}return p;function p(){let h=p$,m,b,v;if((!t||i(l,c,u[u.length-1]||void 0))&&(h=IEe(n(l,u)),h[0]===gD))return h;if("children"in l&&l.children){const x=l;if(x.children&&h[0]!==OEe)for(b=(r?x.children.length:-1)+s,v=u.concat(x);b>-1&&b<x.children.length;){const w=x.children[b];if(m=a(w,b,v)(),m[0]===gD)return m;b=typeof m[1]=="number"?m[1]:b+s}}return h}}}function IEe(e){return Array.isArray(e)?e:typeof e=="number"?[AEe,e]:e==null?p$:[e]}function g$(e,t,n,r){let o,i,s;typeof t=="function"?(i=void 0,s=t,o=n):(i=t,s=n,o=r),MEe(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 M_={}.hasOwnProperty,DEe={};function NEe(e,t){const n=t||DEe,r=new Map,o=new Map,i=new Map,s={...bEe,...n.handlers},a={all:c,applyData:FEe,definitionById:r,footnoteById:o,footnoteCounts:i,footnoteOrder:[],handlers:s,one:l,options:n,patch:LEe,wrap:$Ee};return g$(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:o,p=String(u.identifier).toUpperCase();d.has(p)||d.set(p,u)}}),a;function l(u,d){const p=u.type,h=a.handlers[p];if(M_.call(a.handlers,p)&&h)return h(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in u){const{children:b,...v}=u,x=c0(v);return x.children=a.all(u),x}return c0(u)}return(a.options.unknownHandler||jEe)(a,u,d)}function c(u){const d=[];if("children"in u){const p=u.children;let h=-1;for(;++h<p.length;){const m=a.one(p[h],u);if(m){if(h&&p[h-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=mD(m.value)),!Array.isArray(m)&&m.type==="element")){const b=m.children[0];b&&b.type==="text"&&(b.value=mD(b.value))}Array.isArray(m)?d.push(...m):d.push(m)}}}return d}}function LEe(e,t){e.position&&(t.position=vSe(e))}function FEe(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,c0(i)),"children"in n&&n.children&&o!==null&&o!==void 0&&(n.children=o)}return n}function jEe(e,t){const n=t.data||{},r="value"in t&&!(M_.call(n,"hProperties")||M_.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 $Ee(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
404
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
405
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
406
|
+
`}),n}function mD(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function bD(e,t){const n=NEe(e,t),r=n.one(e,void 0),o=CEe(n),i=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&i.children.push({type:"text",value:`
|
|
407
|
+
`},o),i}function zEe(e,t){return e&&"run"in e?async function(n,r){const o=bD(n,{file:r,...t});await e.run(o,r)}:function(n,r){return bD(n,{file:r,...e||t})}}function yD(e){if(e)throw e}var ub=Object.prototype.hasOwnProperty,m$=Object.prototype.toString,vD=Object.defineProperty,xD=Object.getOwnPropertyDescriptor,wD=function(t){return typeof Array.isArray=="function"?Array.isArray(t):m$.call(t)==="[object Array]"},SD=function(t){if(!t||m$.call(t)!=="[object Object]")return!1;var n=ub.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&ub.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||ub.call(t,o)},_D=function(t,n){vD&&n.name==="__proto__"?vD(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},CD=function(t,n){if(n==="__proto__")if(ub.call(t,n)){if(xD)return xD(t,n).value}else return;return t[n]},BEe=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=CD(a,n),o=CD(t,n),a!==o&&(u&&o&&(SD(o)||(i=wD(o)))?(i?(i=!1,s=r&&wD(r)?r:[]):s=r&&SD(r)?r:{},_D(a,{name:n,newValue:e(u,s,o)})):typeof o<"u"&&_D(a,{name:n,newValue:o}));return a};const Kw=nl(BEe);function I_(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 HEe(){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?VEe(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 VEe(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&&l.then&&typeof l.then=="function"?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 Wi={basename:WEe,dirname:UEe,extname:GEe,join:qEe,sep:"/"};function WEe(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Up(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 UEe(e){if(Up(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 GEe(e){Up(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 qEe(...e){let t=-1,n;for(;++t<e.length;)Up(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":YEe(n)}function YEe(e){Up(e);const t=e.codePointAt(0)===47;let n=KEe(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function KEe(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 Up(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const XEe={cwd:QEe};function QEe(){return"/"}function D_(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ZEe(e){if(typeof e=="string")e=new URL(e);else if(!D_(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 JEe(e)}function JEe(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 Xw=["history","path","basename","stem","extname","dirname"];class b${constructor(t){let n;t?D_(t)?n={path:t}:typeof t=="string"||eRe(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":XEe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Xw.length;){const i=Xw[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)Xw.includes(o)||(this[o]=n[o])}get basename(){return typeof this.path=="string"?Wi.basename(this.path):void 0}set basename(t){Zw(t,"basename"),Qw(t,"basename"),this.path=Wi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Wi.dirname(this.path):void 0}set dirname(t){ED(this.basename,"dirname"),this.path=Wi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Wi.extname(this.path):void 0}set extname(t){if(Qw(t,"extname"),ED(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=Wi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){D_(t)&&(t=ZEe(t)),Zw(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Wi.basename(this.path,this.extname):void 0}set stem(t){Zw(t,"stem"),Qw(t,"stem"),this.path=Wi.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 Nr(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 Qw(e,t){if(e&&e.includes(Wi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Wi.sep+"`")}function Zw(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ED(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function eRe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const tRe=function(e){const r=this.constructor.prototype,o=r[e],i=function(){return o.apply(i,arguments)};return Object.setPrototypeOf(i,r),i},nRe={}.hasOwnProperty;class r2 extends tRe{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=HEe()}copy(){const t=new r2;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Kw(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(t1("data",this.frozen),this.namespace[t]=n,this):nRe.call(this.namespace,t)&&this.namespace[t]||void 0:t?(t1("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=zm(t),r=this.parser||this.Parser;return Jw("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Jw("process",this.parser||this.Parser),e1("process",this.compiler||this.Compiler),n?o(void 0,n):new Promise(o);function o(i,s){const a=zm(t),l=r.parse(a);r.run(l,a,function(u,d,p){if(u||!d||!p)return c(u);const h=d,m=r.stringify(h,p);iRe(m)?p.value=m:p.result=m,c(u,p)});function c(u,d){u||!d?s(u):i?i(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),Jw("processSync",this.parser||this.Parser),e1("processSync",this.compiler||this.Compiler),this.process(t,o),PD("processSync","process",n),r;function o(i,s){n=!0,yD(i),r=s}}run(t,n,r){RD(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=zm(n);o.run(t,l,c);function c(u,d,p){const h=d||t;u?a(u):s?s(h):r(void 0,h,p)}}}runSync(t,n){let r=!1,o;return this.run(t,n,i),PD("runSync","run",r),o;function i(s,a){yD(s),o=a,r=!0}}stringify(t,n){this.freeze();const r=zm(n),o=this.compiler||this.Compiler;return e1("stringify",o),RD(t),o(t,r)}use(t,...n){const r=this.attachers,o=this.namespace;if(t1("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=Kw(!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,p=-1;for(;++d<r.length;)if(r[d][0]===c){p=d;break}if(p===-1)r.push([c,...u]);else if(u.length>0){let[h,...m]=u;const b=r[p][1];I_(b)&&I_(h)&&(h=Kw(!0,b,h)),r[p]=[c,h,...m]}}}}const rRe=new r2().freeze();function Jw(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function e1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function t1(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 RD(e){if(!I_(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function PD(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function zm(e){return oRe(e)?e:new b$(e)}function oRe(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function iRe(e){return typeof e=="string"||sRe(e)}function sRe(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const aRe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",TD=[],kD={allowDangerousHtml:!0},lRe=/^(https?|ircs?|mailto|xmpp)$/i,cRe=[{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 uRe(e){const t=dRe(e),n=fRe(e);return hRe(t.runSync(t.parse(n),n),e)}function dRe(e){const t=e.rehypePlugins||TD,n=e.remarkPlugins||TD,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...kD}:kD;return rRe().use(UCe).use(n).use(zEe,r).use(t)}function fRe(e){const t=e.children||"",n=new b$;return typeof t=="string"&&(n.value=t),n}function hRe(e,t){const n=t.allowedElements,r=t.allowElement,o=t.components,i=t.disallowedElements,s=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||pRe;for(const u of cRe)Object.hasOwn(t,u.from)&&(""+u.from+(u.to?"use `"+u.to+"` instead":"remove it")+aRe+u.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),g$(e,c),CSe(e,{Fragment:y.Fragment,components:o,ignoreInvalidStyle:!0,jsx:y.jsx,jsxs:y.jsxs,passKeys:!0,passNode:!0});function c(u,d,p){if(u.type==="raw"&&p&&typeof d=="number")return s?p.children.splice(d,1):p.children[d]={type:"text",value:u.value},d;if(u.type==="element"){let h;for(h in Gw)if(Object.hasOwn(Gw,h)&&Object.hasOwn(u.properties,h)){const m=u.properties[h],b=Gw[h];(b===null||b.includes(u.tagName))&&(u.properties[h]=l(String(m||""),h,u))}}if(u.type==="element"){let h=n?!n.includes(u.tagName):i?i.includes(u.tagName):!1;if(!h&&r&&typeof d=="number"&&(h=!r(u,d,p)),h&&p&&typeof d=="number")return a&&u.children?p.children.splice(d,1,...u.children):p.children.splice(d,1),d}}}function pRe(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return t===-1||o!==-1&&t>o||n!==-1&&t>n||r!==-1&&t>r||lRe.test(e.slice(0,t))?e:""}var gRe=Object.create,$y=Object.defineProperty,mRe=Object.defineProperties,bRe=Object.getOwnPropertyDescriptor,yRe=Object.getOwnPropertyDescriptors,y$=Object.getOwnPropertyNames,u0=Object.getOwnPropertySymbols,vRe=Object.getPrototypeOf,o2=Object.prototype.hasOwnProperty,v$=Object.prototype.propertyIsEnumerable,AD=(e,t,n)=>t in e?$y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cs=(e,t)=>{for(var n in t||(t={}))o2.call(t,n)&&AD(e,n,t[n]);if(u0)for(var n of u0(t))v$.call(t,n)&&AD(e,n,t[n]);return e},zy=(e,t)=>mRe(e,yRe(t)),x$=(e,t)=>{var n={};for(var r in e)o2.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&u0)for(var r of u0(e))t.indexOf(r)<0&&v$.call(e,r)&&(n[r]=e[r]);return n},xRe=(e,t)=>function(){return t||(0,e[y$(e)[0]])((t={exports:{}}).exports,t),t.exports},wRe=(e,t)=>{for(var n in t)$y(e,n,{get:t[n],enumerable:!0})},SRe=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of y$(t))!o2.call(e,o)&&o!==n&&$y(e,o,{get:()=>t[o],enumerable:!(r=bRe(t,o))||r.enumerable});return e},_Re=(e,t,n)=>(n=e!=null?gRe(vRe(e)):{},SRe(!e||!e.__esModule?$y(n,"default",{value:e,enumerable:!0}):n,e)),CRe=xRe({"../../node_modules/.pnpm/prismjs@1.29.0_patch_hash=vrxx3pzkik6jpmgpayxfjunetu/node_modules/prismjs/prism.js"(e,t){var n=function(){var r=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,o=0,i={},s={util:{encode:function m(b){return b instanceof a?new a(b.type,m(b.content),b.alias):Array.isArray(b)?b.map(m):b.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(m){return Object.prototype.toString.call(m).slice(8,-1)},objId:function(m){return m.__id||Object.defineProperty(m,"__id",{value:++o}),m.__id},clone:function m(b,v){v=v||{};var x,w;switch(s.util.type(b)){case"Object":if(w=s.util.objId(b),v[w])return v[w];x={},v[w]=x;for(var _ in b)b.hasOwnProperty(_)&&(x[_]=m(b[_],v));return x;case"Array":return w=s.util.objId(b),v[w]?v[w]:(x=[],v[w]=x,b.forEach(function(R,C){x[C]=m(R,v)}),x);default:return b}},getLanguage:function(m){for(;m;){var b=r.exec(m.className);if(b)return b[1].toLowerCase();m=m.parentElement}return"none"},setLanguage:function(m,b){m.className=m.className.replace(RegExp(r,"gi"),""),m.classList.add("language-"+b)},isActive:function(m,b,v){for(var x="no-"+b;m;){var w=m.classList;if(w.contains(b))return!0;if(w.contains(x))return!1;m=m.parentElement}return!!v}},languages:{plain:i,plaintext:i,text:i,txt:i,extend:function(m,b){var v=s.util.clone(s.languages[m]);for(var x in b)v[x]=b[x];return v},insertBefore:function(m,b,v,x){x=x||s.languages;var w=x[m],_={};for(var R in w)if(w.hasOwnProperty(R)){if(R==b)for(var C in v)v.hasOwnProperty(C)&&(_[C]=v[C]);v.hasOwnProperty(R)||(_[R]=w[R])}var E=x[m];return x[m]=_,s.languages.DFS(s.languages,function(A,M){M===E&&A!=m&&(this[A]=_)}),_},DFS:function m(b,v,x,w){w=w||{};var _=s.util.objId;for(var R in b)if(b.hasOwnProperty(R)){v.call(b,R,b[R],x||R);var C=b[R],E=s.util.type(C);E==="Object"&&!w[_(C)]?(w[_(C)]=!0,m(C,v,null,w)):E==="Array"&&!w[_(C)]&&(w[_(C)]=!0,m(C,v,R,w))}}},plugins:{},highlight:function(m,b,v){var x={code:m,grammar:b,language:v};if(s.hooks.run("before-tokenize",x),!x.grammar)throw new Error('The language "'+x.language+'" has no grammar.');return x.tokens=s.tokenize(x.code,x.grammar),s.hooks.run("after-tokenize",x),a.stringify(s.util.encode(x.tokens),x.language)},tokenize:function(m,b){var v=b.rest;if(v){for(var x in v)b[x]=v[x];delete b.rest}var w=new u;return d(w,w.head,m),c(m,w,b,w.head,0),h(w)},hooks:{all:{},add:function(m,b){var v=s.hooks.all;v[m]=v[m]||[],v[m].push(b)},run:function(m,b){var v=s.hooks.all[m];if(!(!v||!v.length))for(var x=0,w;w=v[x++];)w(b)}},Token:a};function a(m,b,v,x){this.type=m,this.content=b,this.alias=v,this.length=(x||"").length|0}a.stringify=function m(b,v){if(typeof b=="string")return b;if(Array.isArray(b)){var x="";return b.forEach(function(E){x+=m(E,v)}),x}var w={type:b.type,content:m(b.content,v),tag:"span",classes:["token",b.type],attributes:{},language:v},_=b.alias;_&&(Array.isArray(_)?Array.prototype.push.apply(w.classes,_):w.classes.push(_)),s.hooks.run("wrap",w);var R="";for(var C in w.attributes)R+=" "+C+'="'+(w.attributes[C]||"").replace(/"/g,""")+'"';return"<"+w.tag+' class="'+w.classes.join(" ")+'"'+R+">"+w.content+"</"+w.tag+">"};function l(m,b,v,x){m.lastIndex=b;var w=m.exec(v);if(w&&x&&w[1]){var _=w[1].length;w.index+=_,w[0]=w[0].slice(_)}return w}function c(m,b,v,x,w,_){for(var R in v)if(!(!v.hasOwnProperty(R)||!v[R])){var C=v[R];C=Array.isArray(C)?C:[C];for(var E=0;E<C.length;++E){if(_&&_.cause==R+","+E)return;var A=C[E],M=A.inside,D=!!A.lookbehind,L=!!A.greedy,j=A.alias;if(L&&!A.pattern.global){var z=A.pattern.toString().match(/[imsuy]*$/)[0];A.pattern=RegExp(A.pattern.source,z+"g")}for(var Q=A.pattern||A,G=x.next,F=w;G!==b.tail&&!(_&&F>=_.reach);F+=G.value.length,G=G.next){var H=G.value;if(b.length>m.length)return;if(!(H instanceof a)){var $=1,V;if(L){if(V=l(Q,F,m,D),!V||V.index>=m.length)break;var U=V.index,X=V.index+V[0].length,I=F;for(I+=G.value.length;U>=I;)G=G.next,I+=G.value.length;if(I-=G.value.length,F=I,G.value instanceof a)continue;for(var q=G;q!==b.tail&&(I<X||typeof q.value=="string");q=q.next)$++,I+=q.value.length;$--,H=m.slice(F,I),V.index-=F}else if(V=l(Q,0,H,D),!V)continue;var U=V.index,O=V[0],ee=H.slice(0,U),K=H.slice(U+O.length),oe=F+H.length;_&&oe>_.reach&&(_.reach=oe);var Y=G.prev;ee&&(Y=d(b,Y,ee),F+=ee.length),p(b,Y,$);var J=new a(R,M?s.tokenize(O,M):O,j,O);if(G=d(b,Y,J),K&&d(b,G,K),$>1){var ie={cause:R+","+E,reach:oe};c(m,b,v,G.prev,F,ie),_&&ie.reach>_.reach&&(_.reach=ie.reach)}}}}}}function u(){var m={value:null,prev:null,next:null},b={value:null,prev:m,next:null};m.next=b,this.head=m,this.tail=b,this.length=0}function d(m,b,v){var x=b.next,w={value:v,prev:b,next:x};return b.next=w,x.prev=w,m.length++,w}function p(m,b,v){for(var x=b.next,w=0;w<v&&x!==m.tail;w++)x=x.next;b.next=x,x.prev=b,m.length-=w}function h(m){for(var b=[],v=m.head.next;v!==m.tail;)b.push(v.value),v=v.next;return b}return s}();t.exports=n,n.default=n}}),xe=_Re(CRe());xe.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},xe.languages.markup.tag.inside["attr-value"].inside.entity=xe.languages.markup.entity,xe.languages.markup.doctype.inside["internal-subset"].inside=xe.languages.markup,xe.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(xe.languages.markup.tag,"addInlined",{value:function(e,r){var n={},n=(n["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:xe.languages[r]},n.cdata=/^<!\[CDATA\[|\]\]>$/i,{"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:n}}),r=(n["language-"+r]={pattern:/[\s\S]+/,inside:xe.languages[r]},{});r[e]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return e}),"i"),lookbehind:!0,greedy:!0,inside:n},xe.languages.insertBefore("markup","cdata",r)}}),Object.defineProperty(xe.languages.markup.tag,"addAttribute",{value:function(e,t){xe.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:xe.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),xe.languages.html=xe.languages.markup,xe.languages.mathml=xe.languages.markup,xe.languages.svg=xe.languages.markup,xe.languages.xml=xe.languages.extend("markup",{}),xe.languages.ssml=xe.languages.xml,xe.languages.atom=xe.languages.xml,xe.languages.rss=xe.languages.xml,function(e){var t={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,r="(?:[^\\\\-]|"+n.source+")",r=RegExp(r+"-"+r),o={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};e.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:r,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":t,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":t,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":o}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":o}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(xe),xe.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},xe.languages.javascript=xe.languages.extend("clike",{"class-name":[xe.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),xe.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,xe.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:xe.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:xe.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:xe.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:xe.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:xe.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),xe.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:xe.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),xe.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),xe.languages.markup&&(xe.languages.markup.tag.addInlined("script","javascript"),xe.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),xe.languages.js=xe.languages.javascript,xe.languages.actionscript=xe.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),xe.languages.actionscript["class-name"].alias="function",delete xe.languages.actionscript.parameter,delete xe.languages.actionscript["literal-property"],xe.languages.markup&&xe.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:xe.languages.markup}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(xe),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(n,r){(n=typeof n=="string"?[n]:n).forEach(function(o){var i=function(d){d.inside||(d.inside={}),d.inside.rest=r},s="doc-comment";if(a=e.languages[o]){var a,l=a[s];if((l=l||(a=e.languages.insertBefore(o,"comment",{"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"}}))[s])instanceof RegExp&&(l=a[s]={pattern:l}),Array.isArray(l))for(var c=0,u=l.length;c<u;c++)l[c]instanceof RegExp&&(l[c]={pattern:l[c]}),i(l[c]);else i(l)}})}}),t.addSupport(["java","javascript","php"],t)}(xe),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,t=(e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+t.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css,e.languages.markup);t&&(t.tag.addInlined("style","css"),t.tag.addAttribute("style","css"))}(xe),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,t=(e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+t.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[t,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}}),{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0}),n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,number:n})}(xe),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ ]+"+t.source+")?|"+t.source+"(?:[ ]+"+n.source+")?)",o=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),i=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function s(a,l){l=(l||"").replace(/m/g,"")+"m";var c=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<value>>/g,function(){return a});return RegExp(c,l)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return r})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return r}).replace(/<<key>>/g,function(){return"(?:"+o+"|"+i+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:s(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:s(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:s(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:s(i),lookbehind:!0,greedy:!0},number:{pattern:s(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(xe),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(c){return c=c.replace(/<inner>/g,function(){return t}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+c+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return r}),i=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source,s=(e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+i+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+i+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+i+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(c){["url","bold","italic","strike","code-snippet"].forEach(function(u){c!==u&&(e.languages.markdown[c].inside.content.inside[u]=e.languages.markdown[u])})}),e.hooks.add("after-tokenize",function(c){c.language!=="markdown"&&c.language!=="md"||function u(d){if(d&&typeof d!="string")for(var p=0,h=d.length;p<h;p++){var m,b=d[p];b.type!=="code"?u(b.content):(m=b.content[1],b=b.content[3],m&&b&&m.type==="code-language"&&b.type==="code-block"&&typeof m.content=="string"&&(m=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp"),m="language-"+(m=(/[a-z][\w-]*/i.exec(m)||[""])[0].toLowerCase()),b.alias?typeof b.alias=="string"?b.alias=[b.alias,m]:b.alias.push(m):b.alias=[m]))}}(c.tokens)}),e.hooks.add("wrap",function(c){if(c.type==="code-block"){for(var u="",d=0,p=c.classes.length;d<p;d++){var h=c.classes[d],h=/language-(.+)/.exec(h);if(h){u=h[1];break}}var m,b=e.languages[u];b?c.content=e.highlight(function(v){return v=v.replace(s,""),v=v.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi,function(x,w){var _;return(w=w.toLowerCase())[0]==="#"?(_=w[1]==="x"?parseInt(w.slice(2),16):Number(w.slice(1)),l(_)):a[w]||x})}(c.content),b,u):u&&u!=="none"&&e.plugins.autoloader&&(m="md-"+new Date().valueOf()+"-"+Math.floor(1e16*Math.random()),c.attributes.id=m,e.plugins.autoloader.loadLanguages(u,function(){var v=document.getElementById(m);v&&(v.innerHTML=e.highlight(v.textContent,e.languages[u],u))}))}}),RegExp(e.languages.markup.tag.pattern.source,"gi")),a={amp:"&",lt:"<",gt:">",quot:'"'},l=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(xe),xe.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:xe.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},xe.hooks.add("after-tokenize",function(e){if(e.language==="graphql")for(var t=e.tokens.filter(function(m){return typeof m!="string"&&m.type!=="comment"&&m.type!=="scalar"}),n=0;n<t.length;){var r=t[n++];if(r.type==="keyword"&&r.content==="mutation"){var o=[];if(d(["definition-mutation","punctuation"])&&u(1).content==="("){n+=2;var i=p(/^\($/,/^\)$/);if(i===-1)continue;for(;n<i;n++){var s=u(0);s.type==="variable"&&(h(s,"variable-input"),o.push(s.content))}n=i+1}if(d(["punctuation","property-query"])&&u(0).content==="{"&&(n++,h(u(0),"property-mutation"),0<o.length)){var a=p(/^\{$/,/^\}$/);if(a!==-1)for(var l=n;l<a;l++){var c=t[l];c.type==="variable"&&0<=o.indexOf(c.content)&&h(c,"variable-input")}}}}function u(m){return t[n+m]}function d(m,b){b=b||0;for(var v=0;v<m.length;v++){var x=u(v+b);if(!x||x.type!==m[v])return}return 1}function p(m,b){for(var v=1,x=n;x<t.length;x++){var w=t[x],_=w.content;if(w.type==="punctuation"&&typeof _=="string"){if(m.test(_))v++;else if(b.test(_)&&--v===0)return x}}return-1}function h(m,b){var v=m.alias;v?Array.isArray(v)||(m.alias=v=[v]):m.alias=v=[],v.push(b)}}),xe.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,o=r.inside["interpolation-punctuation"],i=r.pattern.source;function s(d,p){if(e.languages[d])return{pattern:RegExp("((?:"+p+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:d}}}}function a(d,p,h){return d={code:d,grammar:p,language:h},e.hooks.run("before-tokenize",d),d.tokens=e.tokenize(d.code,d.grammar),e.hooks.run("after-tokenize",d),d.tokens}function l(d,p,h){var v=e.tokenize(d,{interpolation:{pattern:RegExp(i),lookbehind:!0}}),m=0,b={},v=a(v.map(function(w){if(typeof w=="string")return w;for(var _,R,w=w.content;d.indexOf((R=m++,_="___"+h.toUpperCase()+"_"+R+"___"))!==-1;);return b[_]=w,_}).join(""),p,h),x=Object.keys(b);return m=0,function w(_){for(var R=0;R<_.length;R++){if(m>=x.length)return;var C,E,A,M,D,L,j,z=_[R];typeof z=="string"||typeof z.content=="string"?(C=x[m],(j=(L=typeof z=="string"?z:z.content).indexOf(C))!==-1&&(++m,E=L.substring(0,j),D=b[C],A=void 0,(M={})["interpolation-punctuation"]=o,(M=e.tokenize(D,M)).length===3&&((A=[1,1]).push.apply(A,a(M[1],e.languages.javascript,"javascript")),M.splice.apply(M,A)),A=new e.Token("interpolation",M,r.alias,D),M=L.substring(j+C.length),D=[],E&&D.push(E),D.push(A),M&&(w(L=[M]),D.push.apply(D,L)),typeof z=="string"?(_.splice.apply(_,[R,1].concat(D)),R+=D.length-1):z.content=D)):(j=z.content,Array.isArray(j)?w(j):w([j]))}}(v),new e.Token(h,v,"language-"+h,d)}e.languages.javascript["template-string"]=[s("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),s("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),s("svg",/\bsvg/.source),s("markdown",/\b(?:markdown|md)/.source),s("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),s("sql",/\bsql/.source),t].filter(Boolean);var c={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function u(d){return typeof d=="string"?d:Array.isArray(d)?d.map(u).join(""):u(d.content)}e.hooks.add("after-tokenize",function(d){d.language in c&&function p(h){for(var m=0,b=h.length;m<b;m++){var v,x,w,_=h[m];typeof _!="string"&&(v=_.content,Array.isArray(v)?_.type==="template-string"?(_=v[1],v.length===3&&typeof _!="string"&&_.type==="embedded-code"&&(x=u(_),_=_.alias,_=Array.isArray(_)?_[0]:_,w=e.languages[_])&&(v[1]=l(x,w,_))):p(v):typeof v!="string"&&p([v]))}}(d.tokens)})}(xe),function(e){e.languages.typescript=e.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(xe),function(e){var t=e.languages.javascript,n=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,r="(@(?:arg|argument|param|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return n})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{string:t.string,number:t.number,boolean:t.boolean,keyword:e.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(xe),function(e){e.languages.flow=e.languages.extend("javascript",{}),e.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),e.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})}(xe),xe.languages.n4js=xe.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),xe.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),xe.languages.n4jsd=xe.languages.n4js,function(e){function t(s,a){return RegExp(s.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),a)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r<n.length;r++){var i=n[r],o=e.languages.javascript[i],i=(o=e.util.type(o)==="RegExp"?e.languages.javascript[i]={pattern:o}:o).inside||{};(o.inside=i)["maybe-class-name"]=/^[A-Z][\s\S]*/}}(xe),function(e){var t=e.util.clone(e.languages.javascript),n=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,r=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,o=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function i(l,c){return l=l.replace(/<S>/g,function(){return n}).replace(/<BRACES>/g,function(){return r}).replace(/<SPREAD>/g,function(){return o}),RegExp(l,c)}o=i(o).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=i(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:i(/<SPREAD>/.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:i(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);function s(l){for(var c=[],u=0;u<l.length;u++){var d=l[u],p=!1;typeof d!="string"&&(d.type==="tag"&&d.content[0]&&d.content[0].type==="tag"?d.content[0].content[0].content==="</"?0<c.length&&c[c.length-1].tagName===a(d.content[0].content[1])&&c.pop():d.content[d.content.length-1].content!=="/>"&&c.push({tagName:a(d.content[0].content[1]),openedBraces:0}):0<c.length&&d.type==="punctuation"&&d.content==="{"?c[c.length-1].openedBraces++:0<c.length&&0<c[c.length-1].openedBraces&&d.type==="punctuation"&&d.content==="}"?c[c.length-1].openedBraces--:p=!0),(p||typeof d=="string")&&0<c.length&&c[c.length-1].openedBraces===0&&(p=a(d),u<l.length-1&&(typeof l[u+1]=="string"||l[u+1].type==="plain-text")&&(p+=a(l[u+1]),l.splice(u+1,1)),0<u&&(typeof l[u-1]=="string"||l[u-1].type==="plain-text")&&(p=a(l[u-1])+p,l.splice(u-1,1),u--),l[u]=new e.Token("plain-text",p,null,p)),d.content&&typeof d.content!="string"&&s(d.content)}}var a=function(l){return l?typeof l=="string"?l:typeof l.content=="string"?l.content:l.content.map(a).join(""):""};e.hooks.add("after-tokenize",function(l){l.language!=="jsx"&&l.language!=="tsx"||s(l.tokens)})}(xe),function(e){var t=e.util.clone(e.languages.typescript),t=(e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"],e.languages.tsx.tag);t.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+t.pattern.source+")",t.pattern.flags),t.lookbehind=!0}(xe),xe.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},xe.languages.swift["string-literal"].forEach(function(e){e.inside.interpolation.inside=xe.languages.swift}),function(e){e.languages.kotlin=e.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete e.languages.kotlin["class-name"];var t={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.kotlin}};e.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:t},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:t},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete e.languages.kotlin.string,e.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),e.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),e.languages.kt=e.languages.kotlin,e.languages.kts=e.languages.kotlin}(xe),xe.languages.c=xe.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),xe.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),xe.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},xe.languages.c.string],char:xe.languages.c.char,comment:xe.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:xe.languages.c}}}}),xe.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete xe.languages.c.boolean,xe.languages.objectivec=xe.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete xe.languages.objectivec["class-name"],xe.languages.objc=xe.languages.objectivec,xe.languages.reason=xe.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),xe.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete xe.languages.reason.function,function(e){for(var t=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,n=0;n<2;n++)t=t.replace(/<self>/g,function(){return t});t=t.replace(/<self>/g,function(){return/[^\s\S]/.source}),e.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+t),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},e.languages.rust["closure-params"].inside.rest=e.languages.rust,e.languages.rust.attribute.inside.string=e.languages.rust.string}(xe),xe.languages.go=xe.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),xe.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete xe.languages.go["class-name"],function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return t.source});e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return t.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return n})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(xe),xe.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},xe.languages.python["string-interpolation"].inside.interpolation.inside.rest=xe.languages.python,xe.languages.py=xe.languages.python,xe.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},xe.languages.webmanifest=xe.languages.json;var N_={};wRe(N_,{dracula:()=>RRe,duotoneDark:()=>TRe,duotoneLight:()=>ARe,github:()=>MRe,gruvboxMaterialDark:()=>a2e,gruvboxMaterialLight:()=>c2e,jettwaveDark:()=>JRe,jettwaveLight:()=>t2e,nightOwl:()=>DRe,nightOwlLight:()=>LRe,oceanicNext:()=>jRe,okaidia:()=>zRe,oneDark:()=>r2e,oneLight:()=>i2e,palenight:()=>HRe,shadesOfPurple:()=>WRe,synthwave84:()=>GRe,ultramin:()=>YRe,vsDark:()=>w$,vsLight:()=>QRe});var ERe={plain:{color:"#F8F8F2",backgroundColor:"#282A36"},styles:[{types:["prolog","constant","builtin"],style:{color:"rgb(189, 147, 249)"}},{types:["inserted","function"],style:{color:"rgb(80, 250, 123)"}},{types:["deleted"],style:{color:"rgb(255, 85, 85)"}},{types:["changed"],style:{color:"rgb(255, 184, 108)"}},{types:["punctuation","symbol"],style:{color:"rgb(248, 248, 242)"}},{types:["string","char","tag","selector"],style:{color:"rgb(255, 121, 198)"}},{types:["keyword","variable"],style:{color:"rgb(189, 147, 249)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(98, 114, 164)"}},{types:["attr-name"],style:{color:"rgb(241, 250, 140)"}}]},RRe=ERe,PRe={plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]},TRe=PRe,kRe={plain:{backgroundColor:"#faf8f5",color:"#728fcb"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#b6ad9a"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#063289"}},{types:["property","function"],style:{color:"#b29762"}},{types:["tag-id","selector","atrule-id"],style:{color:"#2d2006"}},{types:["attr-name"],style:{color:"#896724"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule"],style:{color:"#728fcb"}},{types:["placeholder","variable"],style:{color:"#93abdc"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#896724"}}]},ARe=kRe,ORe={plain:{color:"#393A34",backgroundColor:"#f6f8fa"},styles:[{types:["comment","prolog","doctype","cdata"],style:{color:"#999988",fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}},{types:["string","attr-value"],style:{color:"#e3116c"}},{types:["punctuation","operator"],style:{color:"#393A34"}},{types:["entity","url","symbol","number","boolean","variable","constant","property","regex","inserted"],style:{color:"#36acaa"}},{types:["atrule","keyword","attr-name","selector"],style:{color:"#00a4db"}},{types:["function","deleted","tag"],style:{color:"#d73a49"}},{types:["function-variable"],style:{color:"#6f42c1"}},{types:["tag","selector","keyword"],style:{color:"#00009f"}}]},MRe=ORe,IRe={plain:{color:"#d6deeb",backgroundColor:"#011627"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(99, 119, 119)",fontStyle:"italic"}},{types:["string","url"],style:{color:"rgb(173, 219, 103)"}},{types:["variable"],style:{color:"rgb(214, 222, 235)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation"],style:{color:"rgb(199, 146, 234)"}},{types:["selector","doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(255, 203, 139)"}},{types:["tag","operator","keyword"],style:{color:"rgb(127, 219, 202)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["property"],style:{color:"rgb(128, 203, 196)"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}}]},DRe=IRe,NRe={plain:{color:"#403f53",backgroundColor:"#FBFBFB"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)",fontStyle:"italic"}},{types:["inserted","attr-name"],style:{color:"rgb(72, 118, 214)",fontStyle:"italic"}},{types:["comment"],style:{color:"rgb(152, 159, 177)",fontStyle:"italic"}},{types:["string","builtin","char","constant","url"],style:{color:"rgb(72, 118, 214)"}},{types:["variable"],style:{color:"rgb(201, 103, 101)"}},{types:["number"],style:{color:"rgb(170, 9, 130)"}},{types:["punctuation"],style:{color:"rgb(153, 76, 195)"}},{types:["function","selector","doctype"],style:{color:"rgb(153, 76, 195)",fontStyle:"italic"}},{types:["class-name"],style:{color:"rgb(17, 17, 17)"}},{types:["tag"],style:{color:"rgb(153, 76, 195)"}},{types:["operator","property","keyword","namespace"],style:{color:"rgb(12, 150, 155)"}},{types:["boolean"],style:{color:"rgb(188, 84, 84)"}}]},LRe=NRe,Mo={char:"#D8DEE9",comment:"#999999",keyword:"#c5a5c5",primitive:"#5a9bcf",string:"#8dc891",variable:"#d7deea",boolean:"#ff8b50",tag:"#fc929e",function:"#79b6f2",className:"#FAC863"},FRe={plain:{backgroundColor:"#282c34",color:"#ffffff"},styles:[{types:["attr-name"],style:{color:Mo.keyword}},{types:["attr-value"],style:{color:Mo.string}},{types:["comment","block-comment","prolog","doctype","cdata","shebang"],style:{color:Mo.comment}},{types:["property","number","function-name","constant","symbol","deleted"],style:{color:Mo.primitive}},{types:["boolean"],style:{color:Mo.boolean}},{types:["tag"],style:{color:Mo.tag}},{types:["string"],style:{color:Mo.string}},{types:["punctuation"],style:{color:Mo.string}},{types:["selector","char","builtin","inserted"],style:{color:Mo.char}},{types:["function"],style:{color:Mo.function}},{types:["operator","entity","url","variable"],style:{color:Mo.variable}},{types:["keyword"],style:{color:Mo.keyword}},{types:["atrule","class-name"],style:{color:Mo.className}},{types:["important"],style:{fontWeight:"400"}},{types:["bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["namespace"],style:{opacity:.7}}]},jRe=FRe,$Re={plain:{color:"#f8f8f2",backgroundColor:"#272822"},styles:[{types:["changed"],style:{color:"rgb(162, 191, 252)",fontStyle:"italic"}},{types:["deleted"],style:{color:"#f92672",fontStyle:"italic"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)",fontStyle:"italic"}},{types:["comment"],style:{color:"#8292a2",fontStyle:"italic"}},{types:["string","url"],style:{color:"#a6e22e"}},{types:["variable"],style:{color:"#f8f8f2"}},{types:["number"],style:{color:"#ae81ff"}},{types:["builtin","char","constant","function","class-name"],style:{color:"#e6db74"}},{types:["punctuation"],style:{color:"#f8f8f2"}},{types:["selector","doctype"],style:{color:"#a6e22e",fontStyle:"italic"}},{types:["tag","operator","keyword"],style:{color:"#66d9ef"}},{types:["boolean"],style:{color:"#ae81ff"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)",opacity:.7}},{types:["tag","property"],style:{color:"#f92672"}},{types:["attr-name"],style:{color:"#a6e22e !important"}},{types:["doctype"],style:{color:"#8292a2"}},{types:["rule"],style:{color:"#e6db74"}}]},zRe=$Re,BRe={plain:{color:"#bfc7d5",backgroundColor:"#292d3e"},styles:[{types:["comment"],style:{color:"rgb(105, 112, 152)",fontStyle:"italic"}},{types:["string","inserted"],style:{color:"rgb(195, 232, 141)"}},{types:["number"],style:{color:"rgb(247, 140, 108)"}},{types:["builtin","char","constant","function"],style:{color:"rgb(130, 170, 255)"}},{types:["punctuation","selector"],style:{color:"rgb(199, 146, 234)"}},{types:["variable"],style:{color:"rgb(191, 199, 213)"}},{types:["class-name","attr-name"],style:{color:"rgb(255, 203, 107)"}},{types:["tag","deleted"],style:{color:"rgb(255, 85, 114)"}},{types:["operator"],style:{color:"rgb(137, 221, 255)"}},{types:["boolean"],style:{color:"rgb(255, 88, 116)"}},{types:["keyword"],style:{fontStyle:"italic"}},{types:["doctype"],style:{color:"rgb(199, 146, 234)",fontStyle:"italic"}},{types:["namespace"],style:{color:"rgb(178, 204, 214)"}},{types:["url"],style:{color:"rgb(221, 221, 221)"}}]},HRe=BRe,VRe={plain:{color:"#9EFEFF",backgroundColor:"#2D2A55"},styles:[{types:["changed"],style:{color:"rgb(255, 238, 128)"}},{types:["deleted"],style:{color:"rgba(239, 83, 80, 0.56)"}},{types:["inserted"],style:{color:"rgb(173, 219, 103)"}},{types:["comment"],style:{color:"rgb(179, 98, 255)",fontStyle:"italic"}},{types:["punctuation"],style:{color:"rgb(255, 255, 255)"}},{types:["constant"],style:{color:"rgb(255, 98, 140)"}},{types:["string","url"],style:{color:"rgb(165, 255, 144)"}},{types:["variable"],style:{color:"rgb(255, 238, 128)"}},{types:["number","boolean"],style:{color:"rgb(255, 98, 140)"}},{types:["attr-name"],style:{color:"rgb(255, 180, 84)"}},{types:["keyword","operator","property","namespace","tag","selector","doctype"],style:{color:"rgb(255, 157, 0)"}},{types:["builtin","char","constant","function","class-name"],style:{color:"rgb(250, 208, 0)"}}]},WRe=VRe,URe={plain:{backgroundColor:"linear-gradient(to bottom, #2a2139 75%, #34294f)",backgroundImage:"#34294f",color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"},styles:[{types:["comment","block-comment","prolog","doctype","cdata"],style:{color:"#495495",fontStyle:"italic"}},{types:["punctuation"],style:{color:"#ccc"}},{types:["tag","attr-name","namespace","number","unit","hexcode","deleted"],style:{color:"#e2777a"}},{types:["property","selector"],style:{color:"#72f1b8",textShadow:"0 0 2px #100c0f, 0 0 10px #257c5575, 0 0 35px #21272475"}},{types:["function-name"],style:{color:"#6196cc"}},{types:["boolean","selector-id","function"],style:{color:"#fdfdfd",textShadow:"0 0 2px #001716, 0 0 3px #03edf975, 0 0 5px #03edf975, 0 0 8px #03edf975"}},{types:["class-name","maybe-class-name","builtin"],style:{color:"#fff5f6",textShadow:"0 0 2px #000, 0 0 10px #fc1f2c75, 0 0 5px #fc1f2c75, 0 0 25px #fc1f2c75"}},{types:["constant","symbol"],style:{color:"#f92aad",textShadow:"0 0 2px #100c0f, 0 0 5px #dc078e33, 0 0 10px #fff3"}},{types:["important","atrule","keyword","selector-class"],style:{color:"#f4eee4",textShadow:"0 0 2px #393a33, 0 0 8px #f39f0575, 0 0 2px #f39f0575"}},{types:["string","char","attr-value","regex","variable"],style:{color:"#f87c32"}},{types:["parameter"],style:{fontStyle:"italic"}},{types:["entity","url"],style:{color:"#67cdcc"}},{types:["operator"],style:{color:"ffffffee"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["entity"],style:{cursor:"help"}},{types:["inserted"],style:{color:"green"}}]},GRe=URe,qRe={plain:{color:"#282a2e",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(197, 200, 198)"}},{types:["string","number","builtin","variable"],style:{color:"rgb(150, 152, 150)"}},{types:["class-name","function","tag","attr-name"],style:{color:"rgb(40, 42, 46)"}}]},YRe=qRe,KRe={plain:{color:"#9CDCFE",backgroundColor:"#1E1E1E"},styles:[{types:["prolog"],style:{color:"rgb(0, 0, 128)"}},{types:["comment"],style:{color:"rgb(106, 153, 85)"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"rgb(86, 156, 214)"}},{types:["number","inserted"],style:{color:"rgb(181, 206, 168)"}},{types:["constant"],style:{color:"rgb(100, 102, 149)"}},{types:["attr-name","variable"],style:{color:"rgb(156, 220, 254)"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"rgb(206, 145, 120)"}},{types:["selector"],style:{color:"rgb(215, 186, 125)"}},{types:["tag"],style:{color:"rgb(78, 201, 176)"}},{types:["tag"],languages:["markup"],style:{color:"rgb(86, 156, 214)"}},{types:["punctuation","operator"],style:{color:"rgb(212, 212, 212)"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"rgb(220, 220, 170)"}},{types:["class-name"],style:{color:"rgb(78, 201, 176)"}},{types:["char"],style:{color:"rgb(209, 105, 105)"}}]},w$=KRe,XRe={plain:{color:"#000000",backgroundColor:"#ffffff"},styles:[{types:["comment"],style:{color:"rgb(0, 128, 0)"}},{types:["builtin"],style:{color:"rgb(0, 112, 193)"}},{types:["number","variable","inserted"],style:{color:"rgb(9, 134, 88)"}},{types:["operator"],style:{color:"rgb(0, 0, 0)"}},{types:["constant","char"],style:{color:"rgb(129, 31, 63)"}},{types:["tag"],style:{color:"rgb(128, 0, 0)"}},{types:["attr-name"],style:{color:"rgb(255, 0, 0)"}},{types:["deleted","string"],style:{color:"rgb(163, 21, 21)"}},{types:["changed","punctuation"],style:{color:"rgb(4, 81, 165)"}},{types:["function","keyword"],style:{color:"rgb(0, 0, 255)"}},{types:["class-name"],style:{color:"rgb(38, 127, 153)"}}]},QRe=XRe,ZRe={plain:{color:"#f8fafc",backgroundColor:"#011627"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#569CD6"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#f8fafc"}},{types:["attr-name","variable"],style:{color:"#9CDCFE"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#cbd5e1"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#D4D4D4"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#7dd3fc"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},JRe=ZRe,e2e={plain:{color:"#0f172a",backgroundColor:"#f1f5f9"},styles:[{types:["prolog"],style:{color:"#000080"}},{types:["comment"],style:{color:"#6A9955"}},{types:["builtin","changed","keyword","interpolation-punctuation"],style:{color:"#0c4a6e"}},{types:["number","inserted"],style:{color:"#B5CEA8"}},{types:["constant"],style:{color:"#0f172a"}},{types:["attr-name","variable"],style:{color:"#0c4a6e"}},{types:["deleted","string","attr-value","template-punctuation"],style:{color:"#64748b"}},{types:["selector"],style:{color:"#D7BA7D"}},{types:["tag"],style:{color:"#0ea5e9"}},{types:["tag"],languages:["markup"],style:{color:"#0ea5e9"}},{types:["punctuation","operator"],style:{color:"#475569"}},{types:["punctuation"],languages:["markup"],style:{color:"#808080"}},{types:["function"],style:{color:"#0e7490"}},{types:["class-name"],style:{color:"#0ea5e9"}},{types:["char"],style:{color:"#D16969"}}]},t2e=e2e,n2e={plain:{backgroundColor:"hsl(220, 13%, 18%)",color:"hsl(220, 14%, 71%)",textShadow:"0 1px rgba(0, 0, 0, 0.3)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(220, 10%, 40%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(220, 14%, 71%)"}},{types:["attr-name","class-name","maybe-class-name","boolean","constant","number","atrule"],style:{color:"hsl(29, 54%, 61%)"}},{types:["keyword"],style:{color:"hsl(286, 60%, 67%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(355, 65%, 65%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value"],style:{color:"hsl(95, 38%, 62%)"}},{types:["variable","operator","function"],style:{color:"hsl(207, 82%, 66%)"}},{types:["url"],style:{color:"hsl(187, 47%, 55%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(220, 14%, 71%)"}}]},r2e=n2e,o2e={plain:{backgroundColor:"hsl(230, 1%, 98%)",color:"hsl(230, 8%, 24%)"},styles:[{types:["comment","prolog","cdata"],style:{color:"hsl(230, 4%, 64%)"}},{types:["doctype","punctuation","entity"],style:{color:"hsl(230, 8%, 24%)"}},{types:["attr-name","class-name","boolean","constant","number","atrule"],style:{color:"hsl(35, 99%, 36%)"}},{types:["keyword"],style:{color:"hsl(301, 63%, 40%)"}},{types:["property","tag","symbol","deleted","important"],style:{color:"hsl(5, 74%, 59%)"}},{types:["selector","string","char","builtin","inserted","regex","attr-value","punctuation"],style:{color:"hsl(119, 34%, 47%)"}},{types:["variable","operator","function"],style:{color:"hsl(221, 87%, 60%)"}},{types:["url"],style:{color:"hsl(198, 99%, 37%)"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"hsl(230, 8%, 24%)"}}]},i2e=o2e,s2e={plain:{color:"#ebdbb2",backgroundColor:"#292828"},styles:[{types:["imports","class-name","maybe-class-name","constant","doctype","builtin","function"],style:{color:"#d8a657"}},{types:["property-access"],style:{color:"#7daea3"}},{types:["tag"],style:{color:"#e78a4e"}},{types:["attr-name","char","url","regex"],style:{color:"#a9b665"}},{types:["attr-value","string"],style:{color:"#89b482"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#ea6962"}},{types:["entity","number","symbol"],style:{color:"#d3869b"}}]},a2e=s2e,l2e={plain:{color:"#654735",backgroundColor:"#f9f5d7"},styles:[{types:["delimiter","boolean","keyword","selector","important","atrule","property","variable","deleted"],style:{color:"#af2528"}},{types:["imports","class-name","maybe-class-name","constant","doctype","builtin"],style:{color:"#b4730e"}},{types:["string","attr-value"],style:{color:"#477a5b"}},{types:["property-access"],style:{color:"#266b79"}},{types:["function","attr-name","char","url"],style:{color:"#72761e"}},{types:["tag"],style:{color:"#b94c07"}},{types:["comment","prolog","cdata","operator","inserted"],style:{color:"#a89984"}},{types:["entity","number","symbol"],style:{color:"#924f79"}}]},c2e=l2e,u2e=e=>T.useCallback(t=>{var n=t,{className:r,style:o,line:i}=n,s=x$(n,["className","style","line"]);const a=zy(cs({},s),{className:od("token-line",r)});return typeof e=="object"&&"plain"in e&&(a.style=e.plain),typeof o=="object"&&(a.style=cs(cs({},a.style||{}),o)),a},[e]),d2e=e=>{const t=T.useCallback(({types:n,empty:r})=>{if(e!=null){{if(n.length===1&&n[0]==="plain")return r!=null?{display:"inline-block"}:void 0;if(n.length===1&&r!=null)return e[n[0]]}return Object.assign(r!=null?{display:"inline-block"}:{},...n.map(o=>e[o]))}},[e]);return T.useCallback(n=>{var r=n,{token:o,className:i,style:s}=r,a=x$(r,["token","className","style"]);const l=zy(cs({},a),{className:od("token",...o.types,i),children:o.content,style:t(o)});return s!=null&&(l.style=cs(cs({},l.style||{}),s)),l},[t])},f2e=/\r\n|\r|\n/,OD=e=>{e.length===0?e.push({types:["plain"],content:`
|
|
408
|
+
`,empty:!0}):e.length===1&&e[0].content===""&&(e[0].content=`
|
|
409
|
+
`,e[0].empty=!0)},MD=(e,t)=>{const n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},h2e=e=>{const t=[[]],n=[e],r=[0],o=[e.length];let i=0,s=0,a=[];const l=[a];for(;s>-1;){for(;(i=r[s]++)<o[s];){let c,u=t[s];const p=n[s][i];if(typeof p=="string"?(u=s>0?u:["plain"],c=p):(u=MD(u,p.type),p.alias&&(u=MD(u,p.alias)),c=p.content),typeof c!="string"){s++,t.push(u),n.push(c),r.push(0),o.push(c.length);continue}const h=c.split(f2e),m=h.length;a.push({types:u,content:h[0]});for(let b=1;b<m;b++)OD(a),l.push(a=[]),a.push({types:u,content:h[b]})}s--,t.pop(),n.pop(),r.pop(),o.pop()}return OD(a),l},ID=h2e,p2e=({prism:e,code:t,grammar:n,language:r})=>T.useMemo(()=>{if(n==null)return ID([t]);const o={code:t,grammar:n,language:r,tokens:[]};return e.hooks.run("before-tokenize",o),o.tokens=e.tokenize(t,n),e.hooks.run("after-tokenize",o),ID(o.tokens)},[t,n,r,e]),g2e=(e,t)=>{const{plain:n}=e,r=e.styles.reduce((o,i)=>{const{languages:s,style:a}=i;return s&&!s.includes(t)||i.types.forEach(l=>{const c=cs(cs({},o[l]),a);o[l]=c}),o},{});return r.root=n,r.plain=zy(cs({},n),{backgroundColor:void 0}),r},m2e=g2e,b2e=({children:e,language:t,code:n,theme:r,prism:o})=>{const i=t.toLowerCase(),s=m2e(r,i),a=u2e(s),l=d2e(s),c=o.languages[i],u=p2e({prism:o,language:i,code:n,grammar:c});return e({tokens:u,className:`prism-code language-${i}`,style:s!=null?s.root:{},getLineProps:a,getTokenProps:l})},y2e=e=>T.createElement(b2e,zy(cs({},e),{prism:e.prism||xe,theme:e.theme||w$,code:e.code,language:e.language}));/*! Bundled license information:
|
|
410
|
+
|
|
411
|
+
prismjs/prism.js:
|
|
412
|
+
(**
|
|
413
|
+
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
414
|
+
*
|
|
415
|
+
* @license MIT <https://opensource.org/licenses/MIT>
|
|
416
|
+
* @author Lea Verou <https://lea.verou.me>
|
|
417
|
+
* @namespace
|
|
418
|
+
* @public
|
|
419
|
+
*)
|
|
420
|
+
*/function v2e({message:e,onAddToDashboard:t}){var i;const n=(i=e==null?void 0:e.parts)==null?void 0:i.filter(s=>s.type==="tool-invocation"&&s.toolInvocation.toolName==="getData"&&s.toolInvocation.state==="result");if(!n)return null;const o=n.map(s=>s.toolInvocation).map(s=>{const a=s.result;if(a.status==="error")return null;const l=a.data.records;return{chartCfg:_E({cardType:s.args.chartType,data:l}),chartTitle:s.args.chartTitle,chartType:s.args.chartType,sql:s.args.sql,data:l,connectionId:s.args.connectionId}}).filter(s=>s!==null);return!o||o.length===0?null:y.jsx("div",{className:"",children:o.map((s,a)=>y.jsxs("div",{className:"group relative isolate flex h-[350px] w-[99%] grow flex-col",children:[y.jsxs(nr,{className:"invisible absolute right-0 top-0 z-10 h-8 p-2 group-hover:visible",onClick:()=>{t==null||t({sql:s.sql,data:s.data,cardCfg:s.chartCfg,cardTitle:s.chartTitle,connectionId:s.connectionId,cardType:s.chartType})},size:"sm",variant:"outline",children:[y.jsx(q0,{className:"mr-1 size-4"}),"Add"]}),y.jsx(QE,{cfg:s.chartCfg})]},a))})}function x2e({message:e,showTools:t}){var r;if(!t)return null;const n=(r=e==null?void 0:e.parts)==null?void 0:r.filter(o=>o.type==="tool-invocation");return y.jsx("div",{className:"space-y-3",children:n==null?void 0:n.map((o,i)=>{const s=o.toolInvocation;return y.jsxs(R1e,{children:[y.jsxs(P1e,{className:"rounded-md bg-green-200 p-1 px-2 font-mono text-xs text-black",children:[y.jsx("span",{className:"font-bold",children:"Tool:"})," ",s.toolName]}),y.jsx(T1e,{className:"mt-2 font-mono text-xs",children:y.jsxs("div",{className:"space-y-2 px-2",children:[y.jsxs("div",{className:"space-y-1",children:[y.jsx("span",{children:"Args:"}),y.jsx(d0,{language:"json",code:JSON.stringify(s.args,null,2)})]}),y.jsxs("div",{className:"space-y-1",children:[y.jsx("span",{children:"Result:"}),y.jsx(d0,{language:"json",code:JSON.stringify(s.result,null,2)})]})]})})]},i)})})}function w2e({message:e}){return e.role!=="user"?null:y.jsxs("div",{className:"rounded-md bg-muted/50 p-3 text-sm",children:[y.jsx(TL,{className:"float-left mr-2 size-4"}),y.jsx("div",{children:e.content})]})}function S2e({message:e}){if(e.role!=="system")return null;const t=e.content.split("|"),n=t[0],r=t[1]||"{}",o=JSON.parse(r);return y.jsxs("div",{className:"space-y-1",children:[y.jsxs("div",{children:[y.jsx("span",{className:"font-bold",children:"System Message:"})," ",n]}),y.jsxs("div",{className:"space-y-1",children:[y.jsx("span",{className:"font-mono text-xs",children:"Scope:"}),y.jsx(d0,{language:"json",code:JSON.stringify(o,null,2)})]})]})}function _2e({message:e,handleRun:t}){if(e.role!=="assistant")return null;const n={p:({node:r,...o})=>y.jsx("p",{className:"text-sm",...o}),code:({node:r,...o})=>{var s,a;const i=(a=(s=r==null?void 0:r.children)==null?void 0:s[0])==null?void 0:a.value;return i&&/^#([0-9a-fA-F]{6})$/.test(i)?y.jsx("code",{className:"rounded-md bg-muted px-2 py-1 text-xs",style:{backgroundColor:i},...o}):y.jsx("code",{className:"rounded-md bg-muted px-2 py-1 text-xs",...o})},pre:r=>y.jsx(C2e,{...r,handleRun:t}),li:({node:r,...o})=>y.jsx("li",{className:"my-2 list-outside pl-4 text-sm",...o})};return y.jsx(uRe,{components:n,children:e.content.replace(/DuckDB/gi,"Semaphor")})}function S$({status:e,isLoading:t}){return t?y.jsx("div",{className:"flex items-center text-xs text-muted-foreground",children:e}):null}function _$({messages:e,showTools:t=!1,showSystemMessage:n=!1,handleRun:r,onAddToDashboard:o}){return e==null?void 0:e.map(i=>y.jsxs("div",{className:me("relative my-4 space-y-4 text-sm text-foreground/80"),children:[y.jsx(w2e,{message:i}),n&&y.jsx(S2e,{message:i}),y.jsx(x2e,{message:i,showTools:t}),y.jsx(v2e,{onAddToDashboard:o,message:i}),y.jsx(_2e,{message:i,handleRun:r})]},i.id))}function C2e({children:e,handleRun:t}){const n=ye(a=>a.isVisualEditing),[r,o]=T.useState(!1);T.useRef(null);const i=()=>{navigator.clipboard.writeText(s).then(()=>{o(!0),setTimeout(()=>o(!1),2e3)})},s=L_(e);return y.jsxs("pre",{className:"relative my-2 space-y-2 rounded-md bg-muted/50",children:[y.jsxs("div",{className:"float-right m-1.5",children:[y.jsx(nr,{className:"h-8 p-2 text-xs text-muted-foreground hover:text-foreground",onClick:i,size:"sm",variant:"ghost",children:r?y.jsx(Id,{className:"size-3"}):y.jsx(VC,{className:"size-3"})}),n&&y.jsx(nr,{className:"h-8 p-2 text-muted-foreground hover:text-foreground",onClick:()=>t==null?void 0:t(s),size:"sm",variant:"ghost",children:y.jsx(xL,{className:"size-3"})})]}),y.jsx(d0,{code:s})]})}function L_(e){return typeof e=="string"?e:Array.isArray(e)?e.map(L_).join(""):T.isValidElement(e)?L_(e.props.children):""}const d0=({code:e,language:t="sql"})=>{const n=ye(r=>r.theme);return y.jsx(y2e,{code:e,language:t,theme:n==="dark"?N_.vsDark:N_.oneLight,children:({className:r,style:o,tokens:i,getLineProps:s,getTokenProps:a})=>y.jsx("pre",{className:`${r} border-1 whitespace-pre-wrap rounded-md border border-muted p-2 text-xs`,style:{...o},children:i.map((l,c)=>y.jsx("div",{...s({line:l}),children:l.map((u,d)=>y.jsx("span",{...a({token:u})},d))},c))})})};function C$(e,t){return t||(e==="ready"?"":e==="error"?"Error":e==="streaming"?"":"Thinking...")}function E2e(e,t){return e.some(n=>n.tableName&&n.tableName===t.tableName||n.datamodelName&&n.datamodelName===t.datamodelName)}function R2e(e){return e.filter((n,r,o)=>r===o.findIndex(i=>i.tableName===n.tableName&&i.datamodelName===n.datamodelName))}function P2e(e,t){return e.filter(n=>!(n.connectionId===t.connectionId&&n.tableName===t.tableName&&n.datamodelName===t.datamodelName))}const E$=T.forwardRef(({input:e,handleInputChange:t,handleSubmit:n,isLoading:r,stop:o},i)=>y.jsxs("form",{onSubmit:n,className:"flex w-full items-center rounded-md border",children:[y.jsx(hc,{autoFocus:!0,ref:i,placeholder:"Type your question...",className:me("max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"),disabled:r,value:e,onChange:t}),y.jsxs("div",{className:"mr-2 flex items-center gap-2",children:[r===!0&&y.jsx(nr,{size:"sm",className:"h-7 rounded-full p-[9px]",onClick:()=>o(),children:y.jsx(bL,{className:"size-2.5 bg-background"})}),r===!1&&e&&y.jsx("button",{disabled:!e,className:"mr-3",children:y.jsx(_L,{className:"size-4 text-muted-foreground hover:text-foreground"})})]})]}));function T2e({handleChatBox:e}){const t=T.useRef(null),[n,r]=T.useState(""),[o,i]=T.useState(!1),s=ye(D=>D.dashboard.aiScopeTables),{setSelectedConnectionId:a}=mp(),l=ye(D=>D.selectedSheetId),{addFrame:c,setSelectedFrameId:u,setIsDashboardEditing:d}=Hn(),{authToken:p}=Go(),h=aC(),{messages:m,setMessages:b,reload:v,input:x,status:w,handleInputChange:_,handleSubmit:R,stop:C}=A9({api:"https://semaphor.cloud/api/v1/chat",headers:{Authorization:`Bearer ${p==null?void 0:p.accessToken}`},maxSteps:10,async onToolCall({toolCall:D}){if(D.toolName==="getTables")return r("Initializing..."),{tables:s||[]};if(D.toolName==="getSchemas"&&r("Analyzing..."),D.toolName==="getData"){r("Fetching...");const L=D.args;if(!(L!=null&&L.sql)||!(L!=null&&L.connectionId))return"Please provide sql, connectionId and table";try{return{status:"success",data:await h.fetchQuery({queryKey:["chat",L.connectionId,L.sql],queryFn:()=>R0("https://semaphor.cloud/api/v1/query",(p==null?void 0:p.accessToken)||(p==null?void 0:p.accessToken)||"",{connection_id:L.connectionId,sql:L.sql,cache_config:nC({})})})}}catch(j){return console.log("error",j.message),r("Error fetching data"),{status:"error",message:j.message}}}},onFinish(D,L){r(D.content),L.finishReason==="stop"&&r("")}}),E=()=>{var D;(D=t.current)==null||D.scrollIntoView({behavior:"smooth"})};T.useEffect(()=>{E()},[m]);function A({sql:D,data:L,cardCfg:j,cardTitle:z,connectionId:Q,cardType:G}){if(!l)return;const F={id:Ua(),title:z||"Title",description:"Description",preferences:{onClickFilter:[{columnIndex:0,expression:""}],chartOptions:{indexAxis:G==="horizontalBar"?"y":"x"}},type:j.type,cfg:j,sql:D,data:L,connectionId:Q},H={id:Ua(),cards:[F],activeCardId:F.id};d(!0),c(l,H,"start"),u(H.id)}const M=!["ready","error"].includes(w);return y.jsxs("div",{role:"chat-box",className:"flex h-full grow flex-col justify-between break-words rounded-md",children:[y.jsxs("div",{className:"flex items-center justify-between gap-2 px-6 pb-3 pt-6",children:[y.jsxs("div",{className:"flex items-center gap-4",children:[y.jsx(wn,{className:"flex items-center gap-2 text-xl",children:"Assistant"}),y.jsxs(Rp,{openDelay:0,children:[y.jsx(Pp,{children:y.jsx(kL,{className:"size-4 text-muted-foreground"})}),y.jsx(Bd,{className:"w-70 p-2",children:y.jsx("div",{className:"flex justify-between space-x-2 text-muted-foreground",children:y.jsxs("div",{children:[(s==null?void 0:s.length)===0&&y.jsx("p",{className:"text-sm",children:"No tables in scope"}),y.jsx("div",{className:"space-y-2",children:s==null?void 0:s.map((D,L)=>y.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[y.jsx(RL,{className:"size-3 text-muted-foreground/70"}),y.jsx("span",{children:PN({schemaName:D.schemaName||"",tableName:D.tableName||"",modelName:D.datamodelName||"",connectionType:D.connectionType||""})})]},L))})]})})})]})]}),y.jsxs("div",{className:"flex items-center gap-1",children:[y.jsx(nr,{className:"h-7 p-2",size:"sm",variant:"ghost",onClick:()=>{b([]),v()},children:y.jsx(EL,{className:"size-4 text-muted-foreground"})}),y.jsx(nr,{className:"h-7 p-2",size:"sm",variant:"ghost",onClick:()=>e(!1),children:y.jsx($c,{className:"size-4 text-muted-foreground"})})]})]}),y.jsxs(pc,{className:"flex flex-1 basis-0 flex-col flex-wrap justify-end px-6 py-3",children:[y.jsxs("div",{className:"pb-4",children:[y.jsx(_$,{messages:m,onAddToDashboard:A}),y.jsx(S$,{status:C$(w,n),isLoading:M}),y.jsx("div",{ref:t})]}),y.jsx(Ip,{orientation:"vertical"})]}),y.jsx("div",{className:"px-6 pb-6",children:y.jsx(E$,{stop:C,input:x,handleInputChange:_,handleSubmit:R,isLoading:M})})]})}const{createElement:Td,createContext:k2e,forwardRef:R$,useCallback:co,useContext:P$,useEffect:mc,useImperativeHandle:T$,useLayoutEffect:A2e,useMemo:O2e,useRef:mo,useState:Hu}=P,DD=P[`useId${Math.random()}`.slice(0,5)],M2e=A2e,By=k2e(null);By.displayName="PanelGroupContext";const bc=M2e,I2e=typeof DD=="function"?DD:()=>null;let D2e=0;function i2(e=null){const t=I2e(),n=mo(e||t||null);return n.current===null&&(n.current=""+D2e++),e??n.current}function k$({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:p,style:h,tagName:m="div",...b}){const v=P$(By);if(v===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:w,getPanelSize:_,getPanelStyle:R,groupId:C,isPanelCollapsed:E,reevaluatePanelConstraints:A,registerPanel:M,resizePanel:D,unregisterPanel:L}=v,j=i2(s),z=mo({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:p});mo({didLogMissingDefaultSizeWarning:!1}),bc(()=>{const{callbacks:G,constraints:F}=z.current,H={...F};z.current.id=j,z.current.idIsFromProps=s!==void 0,z.current.order=p,G.onCollapse=c,G.onExpand=u,G.onResize=d,F.collapsedSize=n,F.collapsible=r,F.defaultSize=o,F.maxSize=a,F.minSize=l,(H.collapsedSize!==F.collapsedSize||H.collapsible!==F.collapsible||H.maxSize!==F.maxSize||H.minSize!==F.minSize)&&A(z.current,H)}),bc(()=>{const G=z.current;return M(G),()=>{L(G)}},[p,j,M,L]),T$(i,()=>({collapse:()=>{x(z.current)},expand:G=>{w(z.current,G)},getId(){return j},getSize(){return _(z.current)},isCollapsed(){return E(z.current)},isExpanded(){return!E(z.current)},resize:G=>{D(z.current,G)}}),[x,w,_,E,j,D]);const Q=R(z.current,o);return Td(m,{...b,children:e,className:t,id:s,style:{...Q,...h},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":C,"data-panel-id":j,"data-panel-size":parseFloat(""+Q.flexGrow).toFixed(1)})}const A$=R$((e,t)=>Td(k$,{...e,forwardedRef:t}));k$.displayName="Panel";A$.displayName="forwardRef(Panel)";let F_=null,Yl=null;function N2e(e,t){if(t){const n=(t&N$)!==0,r=(t&L$)!==0,o=(t&F$)!==0,i=(t&j$)!==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 L2e(){Yl!==null&&(document.head.removeChild(Yl),F_=null,Yl=null)}function n1(e,t){const n=N2e(e,t);F_!==n&&(F_=n,Yl===null&&(Yl=document.createElement("style"),document.head.appendChild(Yl)),Yl.innerHTML=`*{cursor: ${n}!important;}`)}function O$(e){return e.type==="keydown"}function M$(e){return e.type.startsWith("pointer")}function I$(e){return e.type.startsWith("mouse")}function Hy(e){if(M$(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(I$(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function F2e(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function j2e(e,t,n){return 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 $2e(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:FD(e),b:FD(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;wt(r,"Stacking order can only be calculated for elements with a common ancestor");const o={a:LD(ND(n.a)),b:LD(ND(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 z2e=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function B2e(e){var t;const n=getComputedStyle((t=D$(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function H2e(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||B2e(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"||z2e.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function ND(e){let t=e.length;for(;t--;){const n=e[t];if(wt(n,"Missing node"),H2e(n))return n}return null}function LD(e){return e&&Number(getComputedStyle(e).zIndex)||0}function FD(e){const t=[];for(;e;)t.push(e),e=D$(e);return t}function D$(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const N$=1,L$=2,F$=4,j$=8,V2e=F2e()==="coarse";let Mi=[],Vu=!1,Pa=new Map,Vy=new Map;const ep=new Set;function W2e(e,t,n,r,o){var i;const{ownerDocument:s}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:o},l=(i=Pa.get(s))!==null&&i!==void 0?i:0;return Pa.set(s,l+1),ep.add(a),f0(),function(){var u;Vy.delete(e),ep.delete(a);const d=(u=Pa.get(s))!==null&&u!==void 0?u:1;if(Pa.set(s,d-1),f0(),d===1&&Pa.delete(s),Mi.includes(a)){const p=Mi.indexOf(a);p>=0&&Mi.splice(p,1),a2(),o("up",!0,null)}}}function jD(e){const{target:t}=e,{x:n,y:r}=Hy(e);Vu=!0,s2({target:t,x:n,y:r}),f0(),Mi.length>0&&(h0("down",e),e.preventDefault(),e.stopPropagation())}function Nf(e){const{x:t,y:n}=Hy(e);if(Vu&&e.buttons===0&&(Vu=!1,h0("up",e)),!Vu){const{target:r}=e;s2({target:r,x:t,y:n})}h0("move",e),a2(),Mi.length>0&&e.preventDefault()}function yu(e){const{target:t}=e,{x:n,y:r}=Hy(e);Vy.clear(),Vu=!1,Mi.length>0&&e.preventDefault(),h0("up",e),s2({target:t,x:n,y:r}),a2(),f0()}function s2({target:e,x:t,y:n}){Mi.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),ep.forEach(o=>{const{element:i,hitAreaMargins:s}=o,a=i.getBoundingClientRect(),{bottom:l,left:c,right:u,top:d}=a,p=V2e?s.coarse:s.fine;if(t>=c-p&&t<=u+p&&n>=d-p&&n<=l+p){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&$2e(r,i)>0){let m=r,b=!1;for(;m&&!m.contains(i);){if(j2e(m.getBoundingClientRect(),a)){b=!0;break}m=m.parentElement}if(b)return}Mi.push(o)}})}function r1(e,t){Vy.set(e,t)}function a2(){let e=!1,t=!1;Mi.forEach(r=>{const{direction:o}=r;o==="horizontal"?e=!0:t=!0});let n=0;Vy.forEach(r=>{n|=r}),e&&t?n1("intersection",n):e?n1("horizontal",n):t?n1("vertical",n):L2e()}function f0(){Pa.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",yu),n.removeEventListener("pointerdown",jD),n.removeEventListener("pointerleave",Nf),n.removeEventListener("pointermove",Nf)}),window.removeEventListener("pointerup",yu),window.removeEventListener("pointercancel",yu),ep.size>0&&(Vu?(Mi.length>0&&Pa.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",yu),n.addEventListener("pointerleave",Nf),n.addEventListener("pointermove",Nf))}),window.addEventListener("pointerup",yu),window.addEventListener("pointercancel",yu)):Pa.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",jD,{capture:!0}),n.addEventListener("pointermove",Nf))}))}function h0(e,t){ep.forEach(n=>{const{setResizeHandlerState:r}=n,o=Mi.includes(n);r(e,o,t)})}function U2e(){const[e,t]=Hu(0);return co(()=>t(n=>n+1),[])}function wt(e,t){if(!e)throw console.error(t),Error(t)}const l2=10;function Oc(e,t,n=l2){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Ks(e,t,n=l2){return Oc(e,t,n)===0}function Lo(e,t,n){return Oc(e,t,n)===0}function G2e(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(!Lo(o,i,n))return!1}return!0}function Tu({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];wt(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:o=0,collapsible:i,maxSize:s=100,minSize:a=0}=r;if(Oc(n,a)<0)if(i){const l=(o+a)/2;Oc(n,l)<0?n=o:n=a}else n=a;return n=Math.min(s,n),n=parseFloat(n.toFixed(l2)),n}function Zf({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:o,trigger:i}){if(Lo(e,0))return t;const s=[...t],[a,l]=r;wt(a!=null,"Invalid first pivot index"),wt(l!=null,"Invalid second pivot index");let c=0;if(i==="keyboard"){{const d=e<0?l:a,p=n[d];wt(p,`Panel constraints not found for index ${d}`);const{collapsedSize:h=0,collapsible:m,minSize:b=0}=p;if(m){const v=t[d];if(wt(v!=null,`Previous layout not found for panel index ${d}`),Lo(v,h)){const x=b-v;Oc(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const d=e<0?a:l,p=n[d];wt(p,`No panel constraints found for index ${d}`);const{collapsedSize:h=0,collapsible:m,minSize:b=0}=p;if(m){const v=t[d];if(wt(v!=null,`Previous layout not found for panel index ${d}`),Lo(v,b)){const x=v-h;Oc(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}}{const d=e<0?1:-1;let p=e<0?l:a,h=0;for(;;){const b=t[p];wt(b!=null,`Previous layout not found for panel index ${p}`);const x=Tu({panelConstraints:n,panelIndex:p,size:100})-b;if(h+=x,p+=d,p<0||p>=n.length)break}const m=Math.min(Math.abs(e),Math.abs(h));e=e<0?0-m:m}{let p=e<0?a:l;for(;p>=0&&p<n.length;){const h=Math.abs(e)-Math.abs(c),m=t[p];wt(m!=null,`Previous layout not found for panel index ${p}`);const b=m-h,v=Tu({panelConstraints:n,panelIndex:p,size:b});if(!Lo(m,v)&&(c+=m-v,s[p]=v,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?p--:p++}}if(G2e(o,s))return o;{const d=e<0?l:a,p=t[d];wt(p!=null,`Previous layout not found for panel index ${d}`);const h=p+c,m=Tu({panelConstraints:n,panelIndex:d,size:h});if(s[d]=m,!Lo(m,h)){let b=h-m,x=e<0?l:a;for(;x>=0&&x<n.length;){const w=s[x];wt(w!=null,`Previous layout not found for panel index ${x}`);const _=w+b,R=Tu({panelConstraints:n,panelIndex:x,size:_});if(Lo(w,R)||(b-=R-w,s[x]=R),Lo(b,0))break;e>0?x--:x++}}}const u=s.reduce((d,p)=>p+d,0);return Lo(u,100)?s:o}function q2e({layout:e,panelsArray:t,pivotIndices:n}){let r=0,o=100,i=0,s=0;const a=n[0];wt(a!=null,"No pivot index found"),t.forEach((d,p)=>{const{constraints:h}=d,{maxSize:m=100,minSize:b=0}=h;p===a?(r=b,o=m):(i+=b,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 tp(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function $$(e,t,n=document){const o=tp(e,n).findIndex(i=>i.getAttribute("data-panel-resize-handle-id")===t);return o??null}function z$(e,t,n){const r=$$(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function B$(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 Y2e(e,t,n,r=document){var o,i,s,a;const l=Wy(t,r),c=tp(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,p=(s=(a=n[u+1])===null||a===void 0?void 0:a.id)!==null&&s!==void 0?s:null;return[d,p]}function K2e({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:o,panelGroupElement:i,setLayout:s}){mo({didWarnAboutMissingResizeHandle:!1}),bc(()=>{if(!i)return;const a=tp(n,i);for(let l=0;l<o.length-1;l++){const{valueMax:c,valueMin:u,valueNow:d}=q2e({layout:r,panelsArray:o,pivotIndices:[l,l+1]}),p=a[l];if(p!=null){const h=o[l];wt(h,`No panel data found for index "${l}"`),p.setAttribute("aria-controls",h.id),p.setAttribute("aria-valuemax",""+Math.round(c)),p.setAttribute("aria-valuemin",""+Math.round(u)),p.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]),mc(()=>{if(!i)return;const a=t.current;wt(a,"Eager values not found");const{panelDataArray:l}=a,c=B$(n,i);wt(c!=null,`No group found for id "${n}"`);const u=tp(n,i);wt(u,`No resize handles found for group id "${n}"`);const d=u.map(p=>{const h=p.getAttribute("data-panel-resize-handle-id");wt(h,"Resize handle element has no handle id attribute");const[m,b]=Y2e(n,h,l,i);if(m==null||b==null)return()=>{};const v=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const w=l.findIndex(_=>_.id===m);if(w>=0){const _=l[w];wt(_,`No panel data found for index ${w}`);const R=r[w],{collapsedSize:C=0,collapsible:E,minSize:A=0}=_.constraints;if(R!=null&&E){const M=Zf({delta:Lo(R,C)?A-C:C-R,initialLayout:r,panelConstraints:l.map(D=>D.constraints),pivotIndices:z$(n,h,i),prevLayout:r,trigger:"keyboard"});r!==M&&s(M)}}break}}};return p.addEventListener("keydown",v),()=>{p.removeEventListener("keydown",v)}});return()=>{d.forEach(p=>p())}},[i,e,t,n,r,o,s])}function $D(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 H$(e,t){const n=e==="horizontal",{x:r,y:o}=Hy(t);return n?r:o}function X2e(e,t,n,r,o){const i=n==="horizontal",s=Wy(t,o);wt(s,`No resize handle element found for id "${t}"`);const a=s.getAttribute("data-panel-group-id");wt(a,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const c=H$(n,e),u=B$(a,o);wt(u,`No group element found for id "${a}"`);const d=u.getBoundingClientRect(),p=i?d.width:d.height;return(c-l)/p*100}function Q2e(e,t,n,r,o,i){if(O$(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:X2e(e,t,n,r,i)}function Z2e({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];wt(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];wt(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 vu(e,t,n){t.forEach((r,o)=>{const i=e[o];wt(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:p,onExpand:h,onResize:m}=s;m&&m(r,d),u&&(p||h)&&(h&&(d==null||Ks(d,c))&&!Ks(r,c)&&h(),p&&(d==null||!Ks(d,c))&&Ks(r,c)&&p())}})}function Bm(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 J2e({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 ePe(e,t=10){let n=null;return(...o)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...o)},t)}}function zD(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 V$(e){return`react-resizable-panels:${e}`}function W$(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 U$(e,t){try{const n=V$(e),r=t.getItem(n);if(r){const o=JSON.parse(r);if(typeof o=="object"&&o!=null)return o}}catch{}return null}function tPe(e,t,n){var r,o;const i=(r=U$(e,n))!==null&&r!==void 0?r:{},s=W$(t);return(o=i[s])!==null&&o!==void 0?o:null}function nPe(e,t,n,r,o){var i;const s=V$(e),a=W$(t),l=(i=U$(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 BD({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(!Lo(r,100)&&n.length>0)for(let i=0;i<t.length;i++){const s=n[i];wt(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];wt(s!=null,`No layout data found for index ${i}`);const a=Tu({panelConstraints:t,panelIndex:i,size:s});s!=a&&(o+=s-a,n[i]=a)}if(!Lo(o,0))for(let i=0;i<t.length;i++){const s=n[i];wt(s!=null,`No layout data found for index ${i}`);const a=s+o,l=Tu({panelConstraints:t,panelIndex:i,size:a});if(s!==l&&(o-=l-s,n[i]=l,Lo(o,0)))break}return n}const rPe=100,Jf={getItem:e=>(zD(Jf),Jf.getItem(e)),setItem:(e,t)=>{zD(Jf),Jf.setItem(e,t)}},HD={};function G$({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:o,id:i=null,onLayout:s=null,keyboardResizeBy:a=null,storage:l=Jf,style:c,tagName:u="div",...d}){const p=i2(i),h=mo(null),[m,b]=Hu(null),[v,x]=Hu([]),w=U2e(),_=mo({}),R=mo(new Map),C=mo(0),E=mo({autoSaveId:e,direction:r,dragState:m,id:p,keyboardResizeBy:a,onLayout:s,storage:l}),A=mo({layout:v,panelDataArray:[],panelDataArrayChanged:!1});mo({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),T$(o,()=>({getId:()=>E.current.id,getLayout:()=>{const{layout:O}=A.current;return O},setLayout:O=>{const{onLayout:ee}=E.current,{layout:K,panelDataArray:oe}=A.current,Y=BD({layout:O,panelConstraints:oe.map(J=>J.constraints)});$D(K,Y)||(x(Y),A.current.layout=Y,ee&&ee(Y),vu(oe,Y,_.current))}}),[]),bc(()=>{E.current.autoSaveId=e,E.current.direction=r,E.current.dragState=m,E.current.id=p,E.current.onLayout=s,E.current.storage=l}),K2e({committedValuesRef:E,eagerValuesRef:A,groupId:p,layout:v,panelDataArray:A.current.panelDataArray,setLayout:x,panelGroupElement:h.current}),mc(()=>{const{panelDataArray:O}=A.current;if(e){if(v.length===0||v.length!==O.length)return;let ee=HD[e];ee==null&&(ee=ePe(nPe,rPe),HD[e]=ee);const K=[...O],oe=new Map(R.current);ee(e,K,oe,v,l)}},[e,v,l]),mc(()=>{});const M=co(O=>{const{onLayout:ee}=E.current,{layout:K,panelDataArray:oe}=A.current;if(O.constraints.collapsible){const Y=oe.map(he=>he.constraints),{collapsedSize:J=0,panelSize:ie,pivotIndices:de}=kl(oe,O,K);if(wt(ie!=null,`Panel size not found for panel "${O.id}"`),!Ks(ie,J)){R.current.set(O.id,ie);const ae=wu(oe,O)===oe.length-1?ie-J:J-ie,ge=Zf({delta:ae,initialLayout:K,panelConstraints:Y,pivotIndices:de,prevLayout:K,trigger:"imperative-api"});Bm(K,ge)||(x(ge),A.current.layout=ge,ee&&ee(ge),vu(oe,ge,_.current))}}},[]),D=co((O,ee)=>{const{onLayout:K}=E.current,{layout:oe,panelDataArray:Y}=A.current;if(O.constraints.collapsible){const J=Y.map(ue=>ue.constraints),{collapsedSize:ie=0,panelSize:de=0,minSize:he=0,pivotIndices:ae}=kl(Y,O,oe),ge=ee??he;if(Ks(de,ie)){const ue=R.current.get(O.id),Ee=ue!=null&&ue>=ge?ue:ge,Le=wu(Y,O)===Y.length-1?de-Ee:Ee-de,Ae=Zf({delta:Le,initialLayout:oe,panelConstraints:J,pivotIndices:ae,prevLayout:oe,trigger:"imperative-api"});Bm(oe,Ae)||(x(Ae),A.current.layout=Ae,K&&K(Ae),vu(Y,Ae,_.current))}}},[]),L=co(O=>{const{layout:ee,panelDataArray:K}=A.current,{panelSize:oe}=kl(K,O,ee);return wt(oe!=null,`Panel size not found for panel "${O.id}"`),oe},[]),j=co((O,ee)=>{const{panelDataArray:K}=A.current,oe=wu(K,O);return J2e({defaultSize:ee,dragState:m,layout:v,panelData:K,panelIndex:oe})},[m,v]),z=co(O=>{const{layout:ee,panelDataArray:K}=A.current,{collapsedSize:oe=0,collapsible:Y,panelSize:J}=kl(K,O,ee);return wt(J!=null,`Panel size not found for panel "${O.id}"`),Y===!0&&Ks(J,oe)},[]),Q=co(O=>{const{layout:ee,panelDataArray:K}=A.current,{collapsedSize:oe=0,collapsible:Y,panelSize:J}=kl(K,O,ee);return wt(J!=null,`Panel size not found for panel "${O.id}"`),!Y||Oc(J,oe)>0},[]),G=co(O=>{const{panelDataArray:ee}=A.current;ee.push(O),ee.sort((K,oe)=>{const Y=K.order,J=oe.order;return Y==null&&J==null?0:Y==null?-1:J==null?1:Y-J}),A.current.panelDataArrayChanged=!0,w()},[w]);bc(()=>{if(A.current.panelDataArrayChanged){A.current.panelDataArrayChanged=!1;const{autoSaveId:O,onLayout:ee,storage:K}=E.current,{layout:oe,panelDataArray:Y}=A.current;let J=null;if(O){const de=tPe(O,Y,K);de&&(R.current=new Map(Object.entries(de.expandToSizes)),J=de.layout)}J==null&&(J=Z2e({panelDataArray:Y}));const ie=BD({layout:J,panelConstraints:Y.map(de=>de.constraints)});$D(oe,ie)||(x(ie),A.current.layout=ie,ee&&ee(ie),vu(Y,ie,_.current))}}),bc(()=>{const O=A.current;return()=>{O.layout=[]}},[]);const F=co(O=>{let ee=!1;const K=h.current;return K&&window.getComputedStyle(K,null).getPropertyValue("direction")==="rtl"&&(ee=!0),function(Y){Y.preventDefault();const J=h.current;if(!J)return()=>null;const{direction:ie,dragState:de,id:he,keyboardResizeBy:ae,onLayout:ge}=E.current,{layout:ue,panelDataArray:Ee}=A.current,{initialLayout:Te}=de??{},Le=z$(he,O,J);let Ae=Q2e(Y,O,ie,de,ae,J);const Fe=ie==="horizontal";Fe&&ee&&(Ae=-Ae);const tt=Ee.map(St=>St.constraints),at=Zf({delta:Ae,initialLayout:Te??ue,panelConstraints:tt,pivotIndices:Le,prevLayout:ue,trigger:O$(Y)?"keyboard":"mouse-or-touch"}),cn=!Bm(ue,at);(M$(Y)||I$(Y))&&C.current!=Ae&&(C.current=Ae,!cn&&Ae!==0?Fe?r1(O,Ae<0?N$:L$):r1(O,Ae<0?F$:j$):r1(O,0)),cn&&(x(at),A.current.layout=at,ge&&ge(at),vu(Ee,at,_.current))}},[]),H=co((O,ee)=>{const{onLayout:K}=E.current,{layout:oe,panelDataArray:Y}=A.current,J=Y.map(ue=>ue.constraints),{panelSize:ie,pivotIndices:de}=kl(Y,O,oe);wt(ie!=null,`Panel size not found for panel "${O.id}"`);const ae=wu(Y,O)===Y.length-1?ie-ee:ee-ie,ge=Zf({delta:ae,initialLayout:oe,panelConstraints:J,pivotIndices:de,prevLayout:oe,trigger:"imperative-api"});Bm(oe,ge)||(x(ge),A.current.layout=ge,K&&K(ge),vu(Y,ge,_.current))},[]),$=co((O,ee)=>{const{layout:K,panelDataArray:oe}=A.current,{collapsedSize:Y=0,collapsible:J}=ee,{collapsedSize:ie=0,collapsible:de,maxSize:he=100,minSize:ae=0}=O.constraints,{panelSize:ge}=kl(oe,O,K);ge!=null&&(J&&de&&Ks(ge,Y)?Ks(Y,ie)||H(O,ie):ge<ae?H(O,ae):ge>he&&H(O,he))},[H]),V=co((O,ee)=>{const{direction:K}=E.current,{layout:oe}=A.current;if(!h.current)return;const Y=Wy(O,h.current);wt(Y,`Drag handle element not found for id "${O}"`);const J=H$(K,ee);b({dragHandleId:O,dragHandleRect:Y.getBoundingClientRect(),initialCursorPosition:J,initialLayout:oe})},[]),X=co(()=>{b(null)},[]),I=co(O=>{const{panelDataArray:ee}=A.current,K=wu(ee,O);K>=0&&(ee.splice(K,1),delete _.current[O.id],A.current.panelDataArrayChanged=!0,w())},[w]),q=O2e(()=>({collapsePanel:M,direction:r,dragState:m,expandPanel:D,getPanelSize:L,getPanelStyle:j,groupId:p,isPanelCollapsed:z,isPanelExpanded:Q,reevaluatePanelConstraints:$,registerPanel:G,registerResizeHandle:F,resizePanel:H,startDragging:V,stopDragging:X,unregisterPanel:I,panelGroupElement:h.current}),[M,m,r,D,L,j,p,z,Q,$,G,F,H,V,X,I]),U={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Td(By.Provider,{value:q},Td(u,{...d,children:t,className:n,id:i,ref:h,style:{...U,...c},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const q$=R$((e,t)=>Td(G$,{...e,forwardedRef:t}));G$.displayName="PanelGroup";q$.displayName="forwardRef(PanelGroup)";function wu(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function kl(e,t,n){const r=wu(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],s=n[r];return{...t.constraints,panelSize:s,pivotIndices:i}}function oPe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){mc(()=>{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");wt(a,`No group element found for id "${a}"`);const l=tp(a,r),c=$$(a,t,r);wt(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 c2({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 p,h;const m=mo(null),b=mo({onDragging:s});mc(()=>{b.current.onDragging=s});const v=P$(By);if(v===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:x,groupId:w,registerResizeHandle:_,startDragging:R,stopDragging:C,panelGroupElement:E}=v,A=i2(o),[M,D]=Hu("inactive"),[L,j]=Hu(!1),[z,Q]=Hu(null),G=mo({state:M});bc(()=>{G.current.state=M}),mc(()=>{if(n)Q(null);else{const V=_(A);Q(()=>V)}},[n,A,_]);const F=(p=r==null?void 0:r.coarse)!==null&&p!==void 0?p:15,H=(h=r==null?void 0:r.fine)!==null&&h!==void 0?h:5;return mc(()=>{if(n||z==null)return;const V=m.current;return wt(V,"Element ref not attached"),W2e(A,V,x,{coarse:F,fine:H},(I,q,U)=>{if(q)switch(I){case"down":{D("drag"),wt(U,'Expected event to be defined for "down" action'),R(A,U);const{onDragging:O}=b.current;O&&O(!0);break}case"move":{const{state:O}=G.current;O!=="drag"&&D("hover"),wt(U,'Expected event to be defined for "move" action'),z(U);break}case"up":{D("hover"),C();const{onDragging:O}=b.current;O&&O(!1);break}}else D("inactive")})},[F,x,n,H,_,A,z,R,C]),oPe({disabled:n,handleId:A,resizeHandler:z,panelGroupElement:E}),Td(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":x,"data-panel-group-id":w,"data-resize-handle":"","data-resize-handle-active":M==="drag"?"pointer":L?"keyboard":void 0,"data-resize-handle-state":M,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":A})}c2.displayName="PanelResizeHandle";const Y$=({className:e,...t})=>y.jsx(q$,{className:me("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",e),...t}),j_=A$,iPe=({withHandle:e,className:t,...n})=>y.jsx(c2,{className:me("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&&y.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:y.jsx(fL,{className:"h-2.5 w-2.5"})})}),sPe=({withHandle:e,className:t,onTabClick:n,open:r,...o})=>y.jsx(c2,{className:me("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&&!r&&y.jsx("div",{className:me("z-50 flex items-center justify-start",{"border-l":r}),children:y.jsx(nr,{variant:"secondary",className:me("h-7 p-0.5",{"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":r,"mt-0 rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":!r}),onClick:()=>n(!r),children:r?y.jsx(G0,{className:"size-4"}):y.jsx(BC,{className:"size-4"})})})});var u2="Dialog",[K$,X$]=rr(u2),[aPe,Fi]=K$(u2),Q$=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=P.useRef(null),l=P.useRef(null),[c=!1,u]=Dr({prop:r,defaultProp:o,onChange:i});return y.jsx(aPe,{scope:t,triggerRef:a,contentRef:l,contentId:Yn(),titleId:Yn(),descriptionId:Yn(),open:c,onOpenChange:u,onOpenToggle:P.useCallback(()=>u(d=>!d),[u]),modal:s,children:n})};Q$.displayName=u2;var Z$="DialogTrigger",J$=P.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fi(Z$,n),i=st(t,o.triggerRef);return y.jsx(je.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":h2(o.open),...r,ref:i,onClick:Pe(e.onClick,o.onOpenToggle)})});J$.displayName=Z$;var d2="DialogPortal",[lPe,e7]=K$(d2,{forceMount:void 0}),t7=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=Fi(d2,t);return y.jsx(lPe,{scope:t,forceMount:n,children:P.Children.map(r,s=>y.jsx(Kn,{present:n||i.open,children:y.jsx(Ep,{asChild:!0,container:o,children:s})}))})};t7.displayName=d2;var p0="DialogOverlay",n7=P.forwardRef((e,t)=>{const n=e7(p0,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Fi(p0,e.__scopeDialog);return i.modal?y.jsx(Kn,{present:r||i.open,children:y.jsx(cPe,{...o,ref:t})}):null});n7.displayName=p0;var cPe=P.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fi(p0,n);return y.jsx(kp,{as:ta,allowPinchZoom:!0,shards:[o.contentRef],children:y.jsx(je.div,{"data-state":h2(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Mc="DialogContent",r7=P.forwardRef((e,t)=>{const n=e7(Mc,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=Fi(Mc,e.__scopeDialog);return y.jsx(Kn,{present:r||i.open,children:i.modal?y.jsx(uPe,{...o,ref:t}):y.jsx(dPe,{...o,ref:t})})});r7.displayName=Mc;var uPe=P.forwardRef((e,t)=>{const n=Fi(Mc,e.__scopeDialog),r=P.useRef(null),o=st(t,n.contentRef,r);return P.useEffect(()=>{const i=r.current;if(i)return by(i)},[]),y.jsx(o7,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pe(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Pe(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:Pe(e.onFocusOutside,i=>i.preventDefault())})}),dPe=P.forwardRef((e,t)=>{const n=Fi(Mc,e.__scopeDialog),r=P.useRef(!1),o=P.useRef(!1);return y.jsx(o7,{...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()}})}),o7=P.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=Fi(Mc,n),l=P.useRef(null),c=st(t,l);return gy(),y.jsxs(y.Fragment,{children:[y.jsx(Tp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:y.jsx(Bc,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":h2(a.open),...s,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),y.jsxs(y.Fragment,{children:[y.jsx(hPe,{titleId:a.titleId}),y.jsx(gPe,{contentRef:l,descriptionId:a.descriptionId})]})]})}),f2="DialogTitle",i7=P.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fi(f2,n);return y.jsx(je.h2,{id:o.titleId,...r,ref:t})});i7.displayName=f2;var s7="DialogDescription",a7=P.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fi(s7,n);return y.jsx(je.p,{id:o.descriptionId,...r,ref:t})});a7.displayName=s7;var l7="DialogClose",c7=P.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Fi(l7,n);return y.jsx(je.button,{type:"button",...r,ref:t,onClick:Pe(e.onClick,()=>o.onOpenChange(!1))})});c7.displayName=l7;function h2(e){return e?"open":"closed"}var u7="DialogTitleWarning",[fPe,d7]=lQ(u7,{contentName:Mc,titleName:f2,docsSlug:"dialog"}),hPe=({titleId:e})=>{const t=d7(u7),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
421
|
+
|
|
422
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
423
|
+
|
|
424
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return P.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},pPe="DialogDescriptionWarning",gPe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${d7(pPe).contentName}}.`;return P.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},p2=Q$,f7=J$,g2=t7,Uy=n7,Gy=r7,m2=i7,b2=a7,y2=c7,h7="AlertDialog",[mPe,wOe]=rr(h7,[X$]),sa=X$(),p7=e=>{const{__scopeAlertDialog:t,...n}=e,r=sa(t);return y.jsx(p2,{...r,...n,modal:!0})};p7.displayName=h7;var bPe="AlertDialogTrigger",yPe=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=sa(n);return y.jsx(f7,{...o,...r,ref:t})});yPe.displayName=bPe;var vPe="AlertDialogPortal",g7=e=>{const{__scopeAlertDialog:t,...n}=e,r=sa(t);return y.jsx(g2,{...r,...n})};g7.displayName=vPe;var xPe="AlertDialogOverlay",m7=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=sa(n);return y.jsx(Uy,{...o,...r,ref:t})});m7.displayName=xPe;var Wu="AlertDialogContent",[wPe,SPe]=mPe(Wu),b7=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=sa(n),s=P.useRef(null),a=st(t,s),l=P.useRef(null);return y.jsx(fPe,{contentName:Wu,titleName:y7,docsSlug:"alert-dialog",children:y.jsx(wPe,{scope:n,cancelRef:l,children:y.jsxs(Gy,{role:"alertdialog",...i,...o,ref:a,onOpenAutoFocus:Pe(o.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[y.jsx(cC,{children:r}),y.jsx(CPe,{contentRef:s})]})})})});b7.displayName=Wu;var y7="AlertDialogTitle",v7=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=sa(n);return y.jsx(m2,{...o,...r,ref:t})});v7.displayName=y7;var x7="AlertDialogDescription",w7=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=sa(n);return y.jsx(b2,{...o,...r,ref:t})});w7.displayName=x7;var _Pe="AlertDialogAction",S7=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=sa(n);return y.jsx(y2,{...o,...r,ref:t})});S7.displayName=_Pe;var _7="AlertDialogCancel",C7=P.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=SPe(_7,n),i=sa(n),s=st(t,o);return y.jsx(y2,{...i,...r,ref:s})});C7.displayName=_7;var CPe=({contentRef:e})=>{const t=`\`${Wu}\` requires a description for the component to be accessible for screen reader users.
|
|
425
|
+
|
|
426
|
+
You can add a description to the \`${Wu}\` by passing a \`${x7}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
427
|
+
|
|
428
|
+
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 \`${Wu}\`. 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.
|
|
429
|
+
|
|
430
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return P.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},EPe=p7,RPe=g7,E7=m7,R7=b7,P7=S7,T7=C7,k7=v7,A7=w7;const PPe=EPe,TPe=RPe,O7=P.forwardRef(({className:e,...t},n)=>y.jsx(E7,{className:me("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}));O7.displayName=E7.displayName;const M7=P.forwardRef(({className:e,...t},n)=>y.jsx(TPe,{children:y.jsxs(Nc,{children:[y.jsx(O7,{}),y.jsx(R7,{ref:n,className:me("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})]})}));M7.displayName=R7.displayName;const I7=({className:e,...t})=>y.jsx("div",{className:me("flex flex-col space-y-2 text-center sm:text-left",e),...t});I7.displayName="AlertDialogHeader";const D7=({className:e,...t})=>y.jsx("div",{className:me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});D7.displayName="AlertDialogFooter";const N7=P.forwardRef(({className:e,...t},n)=>y.jsx(k7,{ref:n,className:me("text-lg font-semibold",e),...t}));N7.displayName=k7.displayName;const L7=P.forwardRef(({className:e,...t},n)=>y.jsx(A7,{ref:n,className:me("text-sm text-muted-foreground",e),...t}));L7.displayName=A7.displayName;const F7=P.forwardRef(({className:e,...t},n)=>y.jsx(P7,{ref:n,className:me(Hh(),e),...t}));F7.displayName=P7.displayName;const j7=P.forwardRef(({className:e,...t},n)=>y.jsx(T7,{ref:n,className:me(Hh({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));j7.displayName=T7.displayName;function kPe({open:e,setOpen:t}){const n=ye(i=>i.selectedSheetId),{deleteSheet:r}=Hn();function o(){n&&(r(n),t(!1))}return y.jsx(PPe,{open:e,onOpenChange:t,children:y.jsxs(M7,{children:[y.jsxs(I7,{children:[y.jsx(N7,{children:"Delete Sheet"}),y.jsx(L7,{children:"Are you sure you want to delete this sheet along with all its cards? This action cannot be undone."})]}),y.jsxs(D7,{children:[y.jsx(j7,{children:"Cancel"}),y.jsx(F7,{onClick:o,children:"Delete"})]})]})})}function $7(){var v,x;const[e,t]=T.useState(!1),n=ye(w=>{var _;return(_=w.dashboard)==null?void 0:_.sheets}),{showAssistant:r}=Go(),o=T.useRef(null),[i,s]=T.useState(!1),a=ye(w=>w.isDashboardEditing),l=ye(w=>w.themeStyle),c=ye(w=>w.selectedSheetId),{setSelectedSheetId:u,setSheetTitle:d,addSheet:p}=Hn();if(!n)return null;function h(w){var _,R;w?((_=o.current)==null||_.resize(35),s(!0)):(s(!1),(R=o.current)==null||R.resize(0))}function m(){const w={id:Ua(),title:"New Sheet"};p(w)}function b(){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 y.jsxs(pC,{role:"dashboard-tabs-container",className:me("relative flex h-full flex-col",l==null?void 0:l.dashboardTabsContainer),onValueChange:w=>{u(w)},value:c||n[0].id,children:[y.jsx("div",{children:(n.length>1||a)&&y.jsxs(M0,{role:"tab-list",className:"flex h-11 items-center justify-start gap-2 rounded-none border-b border-b-muted bg-transparent px-2.5 py-3",children:[n==null?void 0:n.map(w=>{var _,R;return y.jsx(ss,{text:w.title,onSave:C=>d(w.id,C),children:y.jsxs(I0,{style:{borderRadius:(R=(_=l==null?void 0:l.chart)==null?void 0:_.options)==null?void 0:R.borderRadius},onClick:()=>u(w.id),className:"flex items-center gap-1 rounded-none border px-2 py-1",value:w.id,children:[w.title,a&&c===w.id&&n.length>1&&y.jsx($c,{className:"ml-1 size-3",onClick:()=>t(!0)})]})},w.id)}),a&&y.jsx("div",{style:{borderRadius:(x=(v=l==null?void 0:l.chart)==null?void 0:v.options)==null?void 0:x.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:y.jsx(q0,{className:"size-3"})})]})}),y.jsxs(Y$,{className:"grow",direction:"horizontal",children:[y.jsx(j_,{children:y.jsx("div",{style:{},className:"h-full overflow-y-auto",children:n==null?void 0:n.map(w=>y.jsx(gC,{style:{backgroundColor:b()},className:me("mt-0",{}),value:w.id,children:y.jsx(Uxe,{sheet:w})},w.id))})}),r===!0&&y.jsxs(y.Fragment,{children:[y.jsx(sPe,{open:i,onTabClick:h,withHandle:!0}),y.jsx(j_,{onResize:w=>{w<1?s(!1):i||s(!0)},defaultSize:0,ref:o,children:y.jsx(T2e,{handleChatBox:h})})]})]}),y.jsx(kPe,{open:e,setOpen:t})]})}function z7({children:e}){return y.jsx(CX,{defaultTheme:"system",storageKey:"vite-ui-theme",children:y.jsx(ode,{delayDuration:0,children:e})})}function B7(e){return y.jsx(Y0,{FallbackComponent:UC,children:y.jsx(WN,{dashboardProps:e,children:y.jsx(z7,{children:y.jsx(YN,{...e,children:y.jsx($7,{})})})})})}var $_=["Enter"," "],APe=["ArrowDown","PageUp","Home"],H7=["ArrowUp","PageDown","End"],OPe=[...APe,...H7],MPe={ltr:[...$_,"ArrowRight"],rtl:[...$_,"ArrowLeft"]},IPe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Gp="Menu",[np,DPe,NPe]=A0(Gp),[Vc,V7]=rr(Gp,[NPe,Ss,Md]),qy=Ss(),W7=Md(),[LPe,Wc]=Vc(Gp),[FPe,qp]=Vc(Gp),U7=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=qy(t),[l,c]=P.useState(null),u=P.useRef(!1),d=tr(i),p=Lc(o);return P.useEffect(()=>{const h=()=>{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",h,{capture:!0}),()=>{document.removeEventListener("keydown",h,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),y.jsx(Sp,{...a,children:y.jsx(LPe,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:y.jsx(FPe,{scope:t,onClose:P.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:p,modal:s,children:r})})})};U7.displayName=Gp;var jPe="MenuAnchor",v2=P.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=qy(n);return y.jsx(zd,{...o,...r,ref:t})});v2.displayName=jPe;var x2="MenuPortal",[$Pe,G7]=Vc(x2,{forceMount:void 0}),q7=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Wc(x2,t);return y.jsx($Pe,{scope:t,forceMount:n,children:y.jsx(Kn,{present:n||i.open,children:y.jsx(Ep,{asChild:!0,container:o,children:r})})})};q7.displayName=x2;var fi="MenuContent",[zPe,w2]=Vc(fi),Y7=P.forwardRef((e,t)=>{const n=G7(fi,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Wc(fi,e.__scopeMenu),s=qp(fi,e.__scopeMenu);return y.jsx(np.Provider,{scope:e.__scopeMenu,children:y.jsx(Kn,{present:r||i.open,children:y.jsx(np.Slot,{scope:e.__scopeMenu,children:s.modal?y.jsx(BPe,{...o,ref:t}):y.jsx(HPe,{...o,ref:t})})})})}),BPe=P.forwardRef((e,t)=>{const n=Wc(fi,e.__scopeMenu),r=P.useRef(null),o=st(t,r);return P.useEffect(()=>{const i=r.current;if(i)return by(i)},[]),y.jsx(S2,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Pe(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),HPe=P.forwardRef((e,t)=>{const n=Wc(fi,e.__scopeMenu);return y.jsx(S2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),S2=P.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:p,onDismiss:h,disableOutsideScroll:m,...b}=e,v=Wc(fi,n),x=qp(fi,n),w=qy(n),_=W7(n),R=DPe(n),[C,E]=P.useState(null),A=P.useRef(null),M=st(t,A,v.onContentChange),D=P.useRef(0),L=P.useRef(""),j=P.useRef(0),z=P.useRef(null),Q=P.useRef("right"),G=P.useRef(0),F=m?kp:P.Fragment,H=m?{as:ta,allowPinchZoom:!0}:void 0,$=X=>{var Y,J;const I=L.current+X,q=R().filter(ie=>!ie.disabled),U=document.activeElement,O=(Y=q.find(ie=>ie.ref.current===U))==null?void 0:Y.textValue,ee=q.map(ie=>ie.textValue),K=eTe(ee,I,O),oe=(J=q.find(ie=>ie.textValue===K))==null?void 0:J.ref.current;(function ie(de){L.current=de,window.clearTimeout(D.current),de!==""&&(D.current=window.setTimeout(()=>ie(""),1e3))})(I),oe&&setTimeout(()=>oe.focus())};P.useEffect(()=>()=>window.clearTimeout(D.current),[]),gy();const V=P.useCallback(X=>{var q,U;return Q.current===((q=z.current)==null?void 0:q.side)&&nTe(X,(U=z.current)==null?void 0:U.area)},[]);return y.jsx(zPe,{scope:n,searchRef:L,onItemEnter:P.useCallback(X=>{V(X)&&X.preventDefault()},[V]),onItemLeave:P.useCallback(X=>{var I;V(X)||((I=A.current)==null||I.focus(),E(null))},[V]),onTriggerLeave:P.useCallback(X=>{V(X)&&X.preventDefault()},[V]),pointerGraceTimerRef:j,onPointerGraceIntentChange:P.useCallback(X=>{z.current=X},[]),children:y.jsx(F,{...H,children:y.jsx(Tp,{asChild:!0,trapped:o,onMountAutoFocus:Pe(i,X=>{var I;X.preventDefault(),(I=A.current)==null||I.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:y.jsx(Bc,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:p,onDismiss:h,children:y.jsx(uC,{asChild:!0,..._,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:C,onCurrentTabStopIdChange:E,onEntryFocus:Pe(l,X=>{x.isUsingKeyboardRef.current||X.preventDefault()}),preventScrollOnEntryFocus:!0,children:y.jsx(_p,{role:"menu","aria-orientation":"vertical","data-state":uz(v.open),"data-radix-menu-content":"",dir:x.dir,...w,...b,ref:M,style:{outline:"none",...b.style},onKeyDown:Pe(b.onKeyDown,X=>{const q=X.target.closest("[data-radix-menu-content]")===X.currentTarget,U=X.ctrlKey||X.altKey||X.metaKey,O=X.key.length===1;q&&(X.key==="Tab"&&X.preventDefault(),!U&&O&&$(X.key));const ee=A.current;if(X.target!==ee||!OPe.includes(X.key))return;X.preventDefault();const oe=R().filter(Y=>!Y.disabled).map(Y=>Y.ref.current);H7.includes(X.key)&&oe.reverse(),ZPe(oe)}),onBlur:Pe(e.onBlur,X=>{X.currentTarget.contains(X.target)||(window.clearTimeout(D.current),L.current="")}),onPointerMove:Pe(e.onPointerMove,rp(X=>{const I=X.target,q=G.current!==X.clientX;if(X.currentTarget.contains(I)&&q){const U=X.clientX>G.current?"right":"left";Q.current=U,G.current=X.clientX}}))})})})})})})});Y7.displayName=fi;var VPe="MenuGroup",_2=P.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(je.div,{role:"group",...r,ref:t})});_2.displayName=VPe;var WPe="MenuLabel",K7=P.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(je.div,{...r,ref:t})});K7.displayName=WPe;var g0="MenuItem",VD="menu.itemSelect",Yy=P.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=P.useRef(null),s=qp(g0,e.__scopeMenu),a=w2(g0,e.__scopeMenu),l=st(t,i),c=P.useRef(!1),u=()=>{const d=i.current;if(!n&&d){const p=new CustomEvent(VD,{bubbles:!0,cancelable:!0});d.addEventListener(VD,h=>r==null?void 0:r(h),{once:!0}),KN(d,p),p.defaultPrevented?c.current=!1:s.onClose()}};return y.jsx(X7,{...o,ref:l,disabled:n,onClick:Pe(e.onClick,u),onPointerDown:d=>{var p;(p=e.onPointerDown)==null||p.call(e,d),c.current=!0},onPointerUp:Pe(e.onPointerUp,d=>{var p;c.current||(p=d.currentTarget)==null||p.click()}),onKeyDown:Pe(e.onKeyDown,d=>{const p=a.searchRef.current!=="";n||p&&d.key===" "||$_.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Yy.displayName=g0;var X7=P.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=w2(g0,n),a=W7(n),l=P.useRef(null),c=st(t,l),[u,d]=P.useState(!1),[p,h]=P.useState("");return P.useEffect(()=>{const m=l.current;m&&h((m.textContent??"").trim())},[i.children]),y.jsx(np.ItemSlot,{scope:n,disabled:r,textValue:o??p,children:y.jsx(dC,{asChild:!0,...a,focusable:!r,children:y.jsx(je.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:Pe(e.onPointerMove,rp(m=>{r?s.onItemLeave(m):(s.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Pe(e.onPointerLeave,rp(m=>s.onItemLeave(m))),onFocus:Pe(e.onFocus,()=>d(!0)),onBlur:Pe(e.onBlur,()=>d(!1))})})})}),UPe="MenuCheckboxItem",Q7=P.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return y.jsx(nz,{scope:e.__scopeMenu,checked:n,children:y.jsx(Yy,{role:"menuitemcheckbox","aria-checked":m0(n)?"mixed":n,...o,ref:t,"data-state":E2(n),onSelect:Pe(o.onSelect,()=>r==null?void 0:r(m0(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Q7.displayName=UPe;var Z7="MenuRadioGroup",[GPe,qPe]=Vc(Z7,{value:void 0,onValueChange:()=>{}}),J7=P.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=tr(r);return y.jsx(GPe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:y.jsx(_2,{...o,ref:t})})});J7.displayName=Z7;var ez="MenuRadioItem",tz=P.forwardRef((e,t)=>{const{value:n,...r}=e,o=qPe(ez,e.__scopeMenu),i=n===o.value;return y.jsx(nz,{scope:e.__scopeMenu,checked:i,children:y.jsx(Yy,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":E2(i),onSelect:Pe(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});tz.displayName=ez;var C2="MenuItemIndicator",[nz,YPe]=Vc(C2,{checked:!1}),rz=P.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=YPe(C2,n);return y.jsx(Kn,{present:r||m0(i.checked)||i.checked===!0,children:y.jsx(je.span,{...o,ref:t,"data-state":E2(i.checked)})})});rz.displayName=C2;var KPe="MenuSeparator",oz=P.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return y.jsx(je.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});oz.displayName=KPe;var XPe="MenuArrow",iz=P.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=qy(n);return y.jsx(Cp,{...o,...r,ref:t})});iz.displayName=XPe;var QPe="MenuSub",[SOe,sz]=Vc(QPe),eh="MenuSubTrigger",az=P.forwardRef((e,t)=>{const n=Wc(eh,e.__scopeMenu),r=qp(eh,e.__scopeMenu),o=sz(eh,e.__scopeMenu),i=w2(eh,e.__scopeMenu),s=P.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},u=P.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return P.useEffect(()=>u,[u]),P.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),y.jsx(v2,{asChild:!0,...c,children:y.jsx(X7,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":uz(n.open),...e,ref:k0(t,o.onTriggerChange),onClick:d=>{var p;(p=e.onClick)==null||p.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Pe(e.onPointerMove,rp(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:Pe(e.onPointerLeave,rp(d=>{var h,m;u();const p=(h=n.content)==null?void 0:h.getBoundingClientRect();if(p){const b=(m=n.content)==null?void 0:m.dataset.side,v=b==="right",x=v?-5:5,w=p[v?"left":"right"],_=p[v?"right":"left"];i.onPointerGraceIntentChange({area:[{x:d.clientX+x,y:d.clientY},{x:w,y:p.top},{x:_,y:p.top},{x:_,y:p.bottom},{x:w,y:p.bottom}],side:b}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(d),d.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:Pe(e.onKeyDown,d=>{var h;const p=i.searchRef.current!=="";e.disabled||p&&d.key===" "||MPe[r.dir].includes(d.key)&&(n.onOpenChange(!0),(h=n.content)==null||h.focus(),d.preventDefault())})})})});az.displayName=eh;var lz="MenuSubContent",cz=P.forwardRef((e,t)=>{const n=G7(fi,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Wc(fi,e.__scopeMenu),s=qp(fi,e.__scopeMenu),a=sz(lz,e.__scopeMenu),l=P.useRef(null),c=st(t,l);return y.jsx(np.Provider,{scope:e.__scopeMenu,children:y.jsx(Kn,{present:r||i.open,children:y.jsx(np.Slot,{scope:e.__scopeMenu,children:y.jsx(S2,{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:Pe(e.onFocusOutside,u=>{u.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:Pe(e.onEscapeKeyDown,u=>{s.onClose(),u.preventDefault()}),onKeyDown:Pe(e.onKeyDown,u=>{var h;const d=u.currentTarget.contains(u.target),p=IPe[s.dir].includes(u.key);d&&p&&(i.onOpenChange(!1),(h=a.trigger)==null||h.focus(),u.preventDefault())})})})})})});cz.displayName=lz;function uz(e){return e?"open":"closed"}function m0(e){return e==="indeterminate"}function E2(e){return m0(e)?"indeterminate":e?"checked":"unchecked"}function ZPe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function JPe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function eTe(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=JPe(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 tTe(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 nTe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return tTe(n,t)}function rp(e){return t=>t.pointerType==="mouse"?e(t):void 0}var rTe=U7,oTe=v2,iTe=q7,sTe=Y7,aTe=_2,lTe=K7,cTe=Yy,uTe=Q7,dTe=J7,fTe=tz,hTe=rz,pTe=oz,gTe=iz,mTe=az,bTe=cz,R2="DropdownMenu",[yTe,_Oe]=rr(R2,[V7]),Jr=V7(),[vTe,dz]=yTe(R2),fz=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=Jr(t),c=P.useRef(null),[u=!1,d]=Dr({prop:o,defaultProp:i,onChange:s});return y.jsx(vTe,{scope:t,triggerId:Yn(),triggerRef:c,contentId:Yn(),open:u,onOpenChange:d,onOpenToggle:P.useCallback(()=>d(p=>!p),[d]),modal:a,children:y.jsx(rTe,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};fz.displayName=R2;var hz="DropdownMenuTrigger",pz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=dz(hz,n),s=Jr(n);return y.jsx(oTe,{asChild:!0,...s,children:y.jsx(je.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:k0(t,i.triggerRef),onPointerDown:Pe(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:Pe(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});pz.displayName=hz;var xTe="DropdownMenuPortal",gz=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Jr(t);return y.jsx(iTe,{...r,...n})};gz.displayName=xTe;var mz="DropdownMenuContent",bz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=dz(mz,n),i=Jr(n),s=P.useRef(!1);return y.jsx(sTe,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:Pe(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:Pe(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)"}})});bz.displayName=mz;var wTe="DropdownMenuGroup",STe=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Jr(n);return y.jsx(aTe,{...o,...r,ref:t})});STe.displayName=wTe;var _Te="DropdownMenuLabel",yz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Jr(n);return y.jsx(lTe,{...o,...r,ref:t})});yz.displayName=_Te;var CTe="DropdownMenuItem",vz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Jr(n);return y.jsx(cTe,{...o,...r,ref:t})});vz.displayName=CTe;var ETe="DropdownMenuCheckboxItem",xz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Jr(n);return y.jsx(uTe,{...o,...r,ref:t})});xz.displayName=ETe;var RTe="DropdownMenuRadioGroup",wz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Jr(n);return y.jsx(dTe,{...o,...r,ref:t})});wz.displayName=RTe;var PTe="DropdownMenuRadioItem",Sz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Jr(n);return y.jsx(fTe,{...o,...r,ref:t})});Sz.displayName=PTe;var TTe="DropdownMenuItemIndicator",_z=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Jr(n);return y.jsx(hTe,{...o,...r,ref:t})});_z.displayName=TTe;var kTe="DropdownMenuSeparator",Cz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Jr(n);return y.jsx(pTe,{...o,...r,ref:t})});Cz.displayName=kTe;var ATe="DropdownMenuArrow",OTe=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Jr(n);return y.jsx(gTe,{...o,...r,ref:t})});OTe.displayName=ATe;var MTe="DropdownMenuSubTrigger",Ez=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Jr(n);return y.jsx(mTe,{...o,...r,ref:t})});Ez.displayName=MTe;var ITe="DropdownMenuSubContent",Rz=P.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Jr(n);return y.jsx(bTe,{...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)"}})});Rz.displayName=ITe;var DTe=fz,NTe=pz,LTe=gz,Pz=bz,Tz=yz,kz=vz,Az=xz,FTe=wz,Oz=Sz,Mz=_z,Iz=Cz,Dz=Ez,Nz=Rz;const jTe=DTe,$Te=NTe,zTe=FTe,BTe=P.forwardRef(({className:e,inset:t,children:n,...r},o)=>y.jsxs(Dz,{ref:o,className:me("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,y.jsx(G0,{className:"ml-auto h-4 w-4"})]}));BTe.displayName=Dz.displayName;const HTe=P.forwardRef(({className:e,...t},n)=>y.jsx(Nc,{children:y.jsx(Nz,{ref:n,className:me("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})}));HTe.displayName=Nz.displayName;const Lz=P.forwardRef(({className:e,sideOffset:t=4,...n},r)=>y.jsx(LTe,{children:y.jsx(Nc,{children:y.jsx(Pz,{ref:r,sideOffset:t,className:me("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})})}));Lz.displayName=Pz.displayName;const Fz=P.forwardRef(({className:e,inset:t,...n},r)=>y.jsx(kz,{ref:r,className:me("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}));Fz.displayName=kz.displayName;const jz=P.forwardRef(({className:e,children:t,checked:n,...r},o)=>y.jsxs(Az,{ref:o,className:me("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:[y.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:y.jsx(Mz,{children:y.jsx(Id,{className:"h-4 w-4"})})}),t]}));jz.displayName=Az.displayName;const $z=P.forwardRef(({className:e,children:t,...n},r)=>y.jsxs(Oz,{ref:r,className:me("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:[y.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:y.jsx(Mz,{children:y.jsx(HC,{className:"h-2 w-2 fill-current"})})}),t]}));$z.displayName=Oz.displayName;const zz=P.forwardRef(({className:e,inset:t,...n},r)=>y.jsx(Tz,{ref:r,className:me("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));zz.displayName=Tz.displayName;const Bz=P.forwardRef(({className:e,...t},n)=>y.jsx(Iz,{ref:n,className:me("-mx-1 my-1 h-px bg-muted",e),...t}));Bz.displayName=Iz.displayName;const VTe=p2,WTe=f7,UTe=g2,Hz=P.forwardRef(({className:e,...t},n)=>y.jsx(Uy,{ref:n,className:me("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}));Hz.displayName=Uy.displayName;const Vz=P.forwardRef(({className:e,children:t,...n},r)=>y.jsx(UTe,{children:y.jsxs(Nc,{children:[y.jsx(Hz,{}),y.jsxs(Gy,{ref:r,className:me("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,y.jsxs(y2,{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:[y.jsx($c,{className:"h-4 w-4"}),y.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));Vz.displayName=Gy.displayName;const Wz=({className:e,...t})=>y.jsx("div",{className:me("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Wz.displayName="DialogHeader";const Uz=({className:e,...t})=>y.jsx("div",{className:me("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Uz.displayName="DialogFooter";const Gz=P.forwardRef(({className:e,...t},n)=>y.jsx(m2,{ref:n,className:me("text-lg font-semibold leading-none tracking-tight",e),...t}));Gz.displayName=m2.displayName;const qz=P.forwardRef(({className:e,...t},n)=>y.jsx(b2,{ref:n,className:me("text-sm text-muted-foreground",e),...t}));qz.displayName=b2.displayName;const Yz=T.forwardRef(({className:e,...t},n)=>y.jsx("div",{role:"editor-panel",ref:n,className:me("flex h-full grow",e),...t}));Yz.displayName="EditorPanel";const Kz=T.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:me("flex w-[300px] flex-col space-y-2",e),...t}));Kz.displayName="EditorAside";const Xz=T.forwardRef(({className:e,...t},n)=>y.jsx("div",{ref:n,className:me("grow",e),...t}));Xz.displayName="EditorMain";function GTe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WD(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 UD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?WD(Object(n),!0).forEach(function(r){GTe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qTe(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 YTe(e,t){if(e==null)return{};var n=qTe(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 KTe(e,t){return XTe(e)||QTe(e,t)||ZTe(e,t)||JTe()}function XTe(e){if(Array.isArray(e))return e}function QTe(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 ZTe(e,t){if(e){if(typeof e=="string")return GD(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 GD(e,t)}}function GD(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 JTe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
431
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eke(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qD(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 YD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qD(Object(n),!0).forEach(function(r){eke(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tke(){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 th(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 nke(e){return!Object.keys(e).length}function op(e){return typeof e=="function"}function rke(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function oke(e,t){return b0(t)||Wa("changeType"),Object.keys(t).some(function(n){return!rke(e,n)})&&Wa("changeField"),t}function ike(e){op(e)||Wa("selectorType")}function ske(e){op(e)||b0(e)||Wa("handlerType"),b0(e)&&Object.values(e).some(function(t){return!op(t)})&&Wa("handlersType")}function ake(e){e||Wa("initialIsRequired"),b0(e)||Wa("initialType"),nke(e)&&Wa("initialContent")}function lke(e,t){throw new Error(e[t]||e.default)}var cke={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"},Wa=th(lke)(cke),Hm={changes:oke,selector:ike,handler:ske,initial:ake};function uke(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Hm.initial(e),Hm.handler(t);var n={current:e},r=th(hke)(n,t),o=th(fke)(n),i=th(Hm.changes)(e),s=th(dke)(n);function a(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(u){return u};return Hm.selector(c),c(n.current)}function l(c){tke(r,o,i,s)(c)}return[a,l]}function dke(e,t){return op(t)?t(e.current):t}function fke(e,t){return e.current=YD(YD({},e.current),t),t}function hke(e,t,n){return op(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 pke={create:uke},gke={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs"}};function mke(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 bke(e){return{}.toString.call(e).includes("Object")}function yke(e){return e||KD("configIsRequired"),bke(e)||KD("configType"),e.urls?(vke(),{paths:{vs:e.urls.monacoBase}}):e}function vke(){console.warn(Qz.deprecation)}function xke(e,t){throw new Error(e[t]||e.default)}var Qz={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!
|
|
432
|
+
You are using deprecated way of configuration.
|
|
433
|
+
|
|
434
|
+
Instead of using
|
|
435
|
+
monaco.config({ urls: { monacoBase: '...' } })
|
|
436
|
+
use
|
|
437
|
+
monaco.config({ paths: { vs: '...' } })
|
|
438
|
+
|
|
439
|
+
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
440
|
+
`},KD=mke(xke)(Qz),wke={config:yke},Ske=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 Zz(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],Zz(e[n],t[n]))}),UD(UD({},e),t)}var _ke={type:"cancelation",msg:"operation is manually canceled"};function o1(e){var t=!1,n=new Promise(function(r,o){e.then(function(i){return t?o(_ke):r(i)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var Cke=pke.create({config:gke,isInitialized:!1,resolve:null,reject:null,monaco:null}),Jz=KTe(Cke,2),Yp=Jz[0],Ky=Jz[1];function Eke(e){var t=wke.config(e),n=t.monaco,r=YTe(t,["monaco"]);Ky(function(o){return{config:Zz(o.config,r),monaco:n}})}function Rke(){var e=Yp(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(Ky({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),o1(i1);if(window.monaco&&window.monaco.editor)return eB(window.monaco),e.resolve(window.monaco),o1(i1);Ske(Pke,kke)(Ake)}return o1(i1)}function Pke(e){return document.body.appendChild(e)}function Tke(e){var t=document.createElement("script");return e&&(t.src=e),t}function kke(e){var t=Yp(function(r){var o=r.config,i=r.reject;return{config:o,reject:i}}),n=Tke("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function Ake(){var e=Yp(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){eB(n),e.resolve(n)},function(n){e.reject(n)})}function eB(e){Yp().monaco||Ky({monaco:e})}function Oke(){return Yp(function(e){var t=e.monaco;return t})}var i1=new Promise(function(e,t){return Ky({resolve:e,reject:t})}),y0={config:Eke,init:Rke,__getMonacoInstance:Oke},Mke={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},s1=Mke,Ike={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Dke=Ike;function Nke({children:e}){return T.createElement("div",{style:Dke.container},e)}var Lke=Nke,Fke=Lke;function jke({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:i,wrapperProps:s}){return T.createElement("section",{style:{...s1.wrapper,width:e,height:t},...s},!n&&T.createElement(Fke,null,r),T.createElement("div",{ref:o,style:{...s1.fullWidth,...!n&&s1.hide},className:i}))}var $ke=jke,tB=T.memo($ke);function zke(e){T.useEffect(e,[])}var P2=zke;function Bke(e,t,n=!0){let r=T.useRef(!0);T.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var jo=Bke;function _h(){}function ku(e,t,n,r){return Hke(e,r)||Vke(e,t,n,r)}function Hke(e,t){return e.editor.getModel(nB(e,t))}function Vke(e,t,n,r){return e.editor.createModel(t,n,r?nB(e,r):void 0)}function nB(e,t){return e.Uri.parse(t)}function Wke({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:p="100%",width:h="100%",className:m,wrapperProps:b={},beforeMount:v=_h,onMount:x=_h}){let[w,_]=T.useState(!1),[R,C]=T.useState(!0),E=T.useRef(null),A=T.useRef(null),M=T.useRef(null),D=T.useRef(x),L=T.useRef(v),j=T.useRef(!1);P2(()=>{let F=y0.init();return F.then(H=>(A.current=H)&&C(!1)).catch(H=>(H==null?void 0:H.type)!=="cancelation"&&console.error("Monaco initialization: error:",H)),()=>E.current?G():F.cancel()}),jo(()=>{if(E.current&&A.current){let F=E.current.getOriginalEditor(),H=ku(A.current,e||"",r||n||"text",i||"");H!==F.getModel()&&F.setModel(H)}},[i],w),jo(()=>{if(E.current&&A.current){let F=E.current.getModifiedEditor(),H=ku(A.current,t||"",o||n||"text",s||"");H!==F.getModel()&&F.setModel(H)}},[s],w),jo(()=>{let F=E.current.getModifiedEditor();F.getOption(A.current.editor.EditorOption.readOnly)?F.setValue(t||""):t!==F.getValue()&&(F.executeEdits("",[{range:F.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),F.pushUndoStop())},[t],w),jo(()=>{var F,H;(H=(F=E.current)==null?void 0:F.getModel())==null||H.original.setValue(e||"")},[e],w),jo(()=>{let{original:F,modified:H}=E.current.getModel();A.current.editor.setModelLanguage(F,r||n||"text"),A.current.editor.setModelLanguage(H,o||n||"text")},[n,r,o],w),jo(()=>{var F;(F=A.current)==null||F.editor.setTheme(c)},[c],w),jo(()=>{var F;(F=E.current)==null||F.updateOptions(d)},[d],w);let z=T.useCallback(()=>{var $;if(!A.current)return;L.current(A.current);let F=ku(A.current,e||"",r||n||"text",i||""),H=ku(A.current,t||"",o||n||"text",s||"");($=E.current)==null||$.setModel({original:F,modified:H})},[n,t,o,e,r,i,s]),Q=T.useCallback(()=>{var F;!j.current&&M.current&&(E.current=A.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...d}),z(),(F=A.current)==null||F.editor.setTheme(c),_(!0),j.current=!0)},[d,c,z]);T.useEffect(()=>{w&&D.current(E.current,A.current)},[w]),T.useEffect(()=>{!R&&!w&&Q()},[R,w,Q]);function G(){var H,$,V,X;let F=(H=E.current)==null?void 0:H.getModel();a||(($=F==null?void 0:F.original)==null||$.dispose()),l||((V=F==null?void 0:F.modified)==null||V.dispose()),(X=E.current)==null||X.dispose()}return T.createElement(tB,{width:h,height:p,isEditorReady:w,loading:u,_ref:M,className:m,wrapperProps:b})}var Uke=Wke;T.memo(Uke);function Gke(){let[e,t]=T.useState(y0.__getMonacoInstance());return P2(()=>{let n;return e||(n=y0.init(),n.then(r=>{t(r)})),()=>n==null?void 0:n.cancel()}),e}var qke=Gke;function Yke(e){let t=T.useRef();return T.useEffect(()=>{t.current=e},[e]),t.current}var Kke=Yke,Vm=new Map;function Xke({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:p=!1,width:h="100%",height:m="100%",className:b,wrapperProps:v={},beforeMount:x=_h,onMount:w=_h,onChange:_,onValidate:R=_h}){let[C,E]=T.useState(!1),[A,M]=T.useState(!0),D=T.useRef(null),L=T.useRef(null),j=T.useRef(null),z=T.useRef(w),Q=T.useRef(x),G=T.useRef(),F=T.useRef(r),H=Kke(i),$=T.useRef(!1),V=T.useRef(!1);P2(()=>{let q=y0.init();return q.then(U=>(D.current=U)&&M(!1)).catch(U=>(U==null?void 0:U.type)!=="cancelation"&&console.error("Monaco initialization: error:",U)),()=>L.current?I():q.cancel()}),jo(()=>{var U,O,ee,K;let q=ku(D.current,e||r||"",t||o||"",i||n||"");q!==((U=L.current)==null?void 0:U.getModel())&&(d&&Vm.set(H,(O=L.current)==null?void 0:O.saveViewState()),(ee=L.current)==null||ee.setModel(q),d&&((K=L.current)==null||K.restoreViewState(Vm.get(i))))},[i],C),jo(()=>{var q;(q=L.current)==null||q.updateOptions(c)},[c],C),jo(()=>{!L.current||r===void 0||(L.current.getOption(D.current.editor.EditorOption.readOnly)?L.current.setValue(r):r!==L.current.getValue()&&(V.current=!0,L.current.executeEdits("",[{range:L.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),L.current.pushUndoStop(),V.current=!1))},[r],C),jo(()=>{var U,O;let q=(U=L.current)==null?void 0:U.getModel();q&&o&&((O=D.current)==null||O.editor.setModelLanguage(q,o))},[o],C),jo(()=>{var q;a!==void 0&&((q=L.current)==null||q.revealLine(a))},[a],C),jo(()=>{var q;(q=D.current)==null||q.editor.setTheme(s)},[s],C);let X=T.useCallback(()=>{var q;if(!(!j.current||!D.current)&&!$.current){Q.current(D.current);let U=i||n,O=ku(D.current,r||e||"",t||o||"",U||"");L.current=(q=D.current)==null?void 0:q.editor.create(j.current,{model:O,automaticLayout:!0,...c},u),d&&L.current.restoreViewState(Vm.get(U)),D.current.editor.setTheme(s),a!==void 0&&L.current.revealLine(a),E(!0),$.current=!0}},[e,t,n,r,o,i,c,u,d,s,a]);T.useEffect(()=>{C&&z.current(L.current,D.current)},[C]),T.useEffect(()=>{!A&&!C&&X()},[A,C,X]),F.current=r,T.useEffect(()=>{var q,U;C&&_&&((q=G.current)==null||q.dispose(),G.current=(U=L.current)==null?void 0:U.onDidChangeModelContent(O=>{V.current||_(L.current.getValue(),O)}))},[C,_]),T.useEffect(()=>{if(C){let q=D.current.editor.onDidChangeMarkers(U=>{var ee;let O=(ee=L.current.getModel())==null?void 0:ee.uri;if(O&&U.find(K=>K.path===O.path)){let K=D.current.editor.getModelMarkers({resource:O});R==null||R(K)}});return()=>{q==null||q.dispose()}}return()=>{}},[C,R]);function I(){var q,U;(q=G.current)==null||q.dispose(),p?d&&Vm.set(i,L.current.saveViewState()):(U=L.current.getModel())==null||U.dispose(),L.current.dispose()}return T.createElement(tB,{width:h,height:m,isEditorReady:C,loading:l,_ref:j,className:b,wrapperProps:v})}var Qke=Xke,rB=T.memo(Qke),Zke=rB,T2="Switch",[Jke,COe]=rr(T2),[eAe,tAe]=Jke(T2),oB=P.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:i,required:s,disabled:a,value:l="on",onCheckedChange:c,form:u,...d}=e,[p,h]=P.useState(null),m=st(t,_=>h(_)),b=P.useRef(!1),v=p?u||!!p.closest("form"):!0,[x=!1,w]=Dr({prop:o,defaultProp:i,onChange:c});return y.jsxs(eAe,{scope:n,checked:x,disabled:a,children:[y.jsx(je.button,{type:"button",role:"switch","aria-checked":x,"aria-required":s,"data-state":aB(x),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:m,onClick:Pe(e.onClick,_=>{w(R=>!R),v&&(b.current=_.isPropagationStopped(),b.current||_.stopPropagation())})}),v&&y.jsx(nAe,{control:p,bubbles:!b.current,name:r,value:l,checked:x,required:s,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});oB.displayName=T2;var iB="SwitchThumb",sB=P.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=tAe(iB,n);return y.jsx(je.span,{"data-state":aB(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});sB.displayName=iB;var nAe=e=>{const{control:t,checked:n,bubbles:r=!0,...o}=e,i=P.useRef(null),s=my(n),a=ay(t);return P.useEffect(()=>{const l=i.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(s!==n&&d){const p=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(p)}},[s,n,r]),y.jsx("input",{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 aB(e){return e?"checked":"unchecked"}var Xy=oB,lB=sB;const cB=P.forwardRef(({className:e,...t},n)=>y.jsx(Xy,{className:me("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:y.jsx(lB,{className:me("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")})}));cB.displayName=Xy.displayName;const rAe=P.forwardRef(({className:e,...t},n)=>y.jsx(Xy,{className:me("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:y.jsx(lB,{className:me("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")})}));rAe.displayName=Xy.displayName;var aa="Accordion",oAe=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[k2,iAe,sAe]=A0(aa),[Qy,EOe]=rr(aa,[sAe,O9]),A2=O9(),uB=T.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,i=r;return y.jsx(k2.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?y.jsx(uAe,{...i,ref:t}):y.jsx(cAe,{...o,ref:t})})});uB.displayName=aa;var[dB,aAe]=Qy(aa),[fB,lAe]=Qy(aa,{collapsible:!1}),cAe=T.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:i=!1,...s}=e,[a,l]=Dr({prop:n,defaultProp:r,onChange:o});return y.jsx(dB,{scope:e.__scopeAccordion,value:a?[a]:[],onItemOpen:l,onItemClose:T.useCallback(()=>i&&l(""),[i,l]),children:y.jsx(fB,{scope:e.__scopeAccordion,collapsible:i,children:y.jsx(hB,{...s,ref:t})})})}),uAe=T.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...i}=e,[s=[],a]=Dr({prop:n,defaultProp:r,onChange:o}),l=T.useCallback(u=>a((d=[])=>[...d,u]),[a]),c=T.useCallback(u=>a((d=[])=>d.filter(p=>p!==u)),[a]);return y.jsx(dB,{scope:e.__scopeAccordion,value:s,onItemOpen:l,onItemClose:c,children:y.jsx(fB,{scope:e.__scopeAccordion,collapsible:!0,children:y.jsx(hB,{...i,ref:t})})})}),[dAe,Zy]=Qy(aa),hB=T.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:i="vertical",...s}=e,a=T.useRef(null),l=st(a,t),c=iAe(n),d=Lc(o)==="ltr",p=Pe(e.onKeyDown,h=>{var M;if(!oAe.includes(h.key))return;const m=h.target,b=c().filter(D=>{var L;return!((L=D.ref.current)!=null&&L.disabled)}),v=b.findIndex(D=>D.ref.current===m),x=b.length;if(v===-1)return;h.preventDefault();let w=v;const _=0,R=x-1,C=()=>{w=v+1,w>R&&(w=_)},E=()=>{w=v-1,w<_&&(w=R)};switch(h.key){case"Home":w=_;break;case"End":w=R;break;case"ArrowRight":i==="horizontal"&&(d?C():E());break;case"ArrowDown":i==="vertical"&&C();break;case"ArrowLeft":i==="horizontal"&&(d?E():C());break;case"ArrowUp":i==="vertical"&&E();break}const A=w%x;(M=b[A].ref.current)==null||M.focus()});return y.jsx(dAe,{scope:n,disabled:r,direction:o,orientation:i,children:y.jsx(k2.Slot,{scope:n,children:y.jsx(je.div,{...s,"data-orientation":i,ref:l,onKeyDown:r?void 0:p})})})}),v0="AccordionItem",[fAe,O2]=Qy(v0),pB=T.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,i=Zy(v0,n),s=aAe(v0,n),a=A2(n),l=Yn(),c=r&&s.value.includes(r)||!1,u=i.disabled||e.disabled;return y.jsx(fAe,{scope:n,open:c,disabled:u,triggerId:l,children:y.jsx(D9,{"data-orientation":i.orientation,"data-state":xB(c),...a,...o,ref:t,disabled:u,open:c,onOpenChange:d=>{d?s.onItemOpen(r):s.onItemClose(r)}})})});pB.displayName=v0;var gB="AccordionHeader",mB=T.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Zy(aa,n),i=O2(gB,n);return y.jsx(je.h3,{"data-orientation":o.orientation,"data-state":xB(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});mB.displayName=gB;var z_="AccordionTrigger",bB=T.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Zy(aa,n),i=O2(z_,n),s=lAe(z_,n),a=A2(n);return y.jsx(k2.ItemSlot,{scope:n,children:y.jsx(C1e,{"aria-disabled":i.open&&!s.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...a,...r,ref:t})})});bB.displayName=z_;var yB="AccordionContent",vB=T.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Zy(aa,n),i=O2(yB,n),s=A2(n);return y.jsx(E1e,{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}})});vB.displayName=yB;function xB(e){return e?"open":"closed"}var hAe=uB,pAe=pB,gAe=mB,wB=bB,SB=vB;const mAe=hAe,_B=P.forwardRef(({className:e,...t},n)=>y.jsx(pAe,{ref:n,className:me("border-b",e),...t}));_B.displayName="AccordionItem";const CB=P.forwardRef(({className:e,children:t,...n},r)=>y.jsx(gAe,{className:"flex",children:y.jsxs(wB,{ref:r,className:me("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,y.jsx(bp,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));CB.displayName=wB.displayName;const EB=P.forwardRef(({className:e,children:t,...n},r)=>y.jsx(SB,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:y.jsx("div",{className:me("pb-4 pt-0",e),children:t})}));EB.displayName=SB.displayName;var XD=1,bAe=.9,yAe=.8,vAe=.17,a1=.1,l1=.999,xAe=.9999,wAe=.99,SAe=/[\\\/_+.#"@\[\(\{&]/,_Ae=/[\\\/_+.#"@\[\(\{&]/g,CAe=/[\s-]/,RB=/[\s-]/g;function B_(e,t,n,r,o,i,s){if(i===t.length)return o===e.length?XD:wAe;var a=`${o},${i}`;if(s[a]!==void 0)return s[a];for(var l=r.charAt(i),c=n.indexOf(l,o),u=0,d,p,h,m;c>=0;)d=B_(e,t,n,r,c+1,i+1,s),d>u&&(c===o?d*=XD:SAe.test(e.charAt(c-1))?(d*=yAe,h=e.slice(o,c-1).match(_Ae),h&&o>0&&(d*=Math.pow(l1,h.length))):CAe.test(e.charAt(c-1))?(d*=bAe,m=e.slice(o,c-1).match(RB),m&&o>0&&(d*=Math.pow(l1,m.length))):(d*=vAe,o>0&&(d*=Math.pow(l1,c-o))),e.charAt(c)!==t.charAt(i)&&(d*=xAe)),(d<a1&&n.charAt(c-1)===r.charAt(i+1)||r.charAt(i+1)===r.charAt(i)&&n.charAt(c-1)!==r.charAt(i))&&(p=B_(e,t,n,r,c+1,i+2,s),p*a1>d&&(d=p*a1)),d>u&&(u=d),c=n.indexOf(l,c+1);return s[a]=u,u}function QD(e){return e.toLowerCase().replace(RB," ")}function EAe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,B_(e,t,QD(e),QD(t),0,0,{})}var Lf='[cmdk-group=""]',c1='[cmdk-group-items=""]',RAe='[cmdk-group-heading=""]',M2='[cmdk-item=""]',ZD=`${M2}:not([aria-disabled="true"])`,H_="cmdk-item-select",zl="data-value",PAe=(e,t,n)=>EAe(e,t,n),PB=P.createContext(void 0),Kp=()=>P.useContext(PB),TB=P.createContext(void 0),I2=()=>P.useContext(TB),kB=P.createContext(void 0),AB=P.forwardRef((e,t)=>{let n=Su(()=>{var U,O;return{search:"",value:(O=(U=e.value)!=null?U:e.defaultValue)!=null?O:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=Su(()=>new Set),o=Su(()=>new Map),i=Su(()=>new Map),s=Su(()=>new Set),a=OB(e),{label:l,children:c,value:u,onValueChange:d,filter:p,shouldFilter:h,loop:m,disablePointerSelection:b=!1,vimBindings:v=!0,...x}=e,w=Yn(),_=Yn(),R=Yn(),C=P.useRef(null),E=jAe();Ic(()=>{if(u!==void 0){let U=u.trim();n.current.value=U,A.emit()}},[u]),Ic(()=>{E(6,Q)},[]);let A=P.useMemo(()=>({subscribe:U=>(s.current.add(U),()=>s.current.delete(U)),snapshot:()=>n.current,setState:(U,O,ee)=>{var K,oe,Y;if(!Object.is(n.current[U],O)){if(n.current[U]=O,U==="search")z(),L(),E(1,j);else if(U==="value"&&(ee||E(5,Q),((K=a.current)==null?void 0:K.value)!==void 0)){let J=O??"";(Y=(oe=a.current).onValueChange)==null||Y.call(oe,J);return}A.emit()}},emit:()=>{s.current.forEach(U=>U())}}),[]),M=P.useMemo(()=>({value:(U,O,ee)=>{var K;O!==((K=i.current.get(U))==null?void 0:K.value)&&(i.current.set(U,{value:O,keywords:ee}),n.current.filtered.items.set(U,D(O,ee)),E(2,()=>{L(),A.emit()}))},item:(U,O)=>(r.current.add(U),O&&(o.current.has(O)?o.current.get(O).add(U):o.current.set(O,new Set([U]))),E(3,()=>{z(),L(),n.current.value||j(),A.emit()}),()=>{i.current.delete(U),r.current.delete(U),n.current.filtered.items.delete(U);let ee=G();E(4,()=>{z(),(ee==null?void 0:ee.getAttribute("id"))===U&&j(),A.emit()})}),group:U=>(o.current.has(U)||o.current.set(U,new Set),()=>{i.current.delete(U),o.current.delete(U)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:w,inputId:R,labelId:_,listInnerRef:C}),[]);function D(U,O){var ee,K;let oe=(K=(ee=a.current)==null?void 0:ee.filter)!=null?K:PAe;return U?oe(U,n.current.search,O):0}function L(){if(!n.current.search||a.current.shouldFilter===!1)return;let U=n.current.filtered.items,O=[];n.current.filtered.groups.forEach(K=>{let oe=o.current.get(K),Y=0;oe.forEach(J=>{let ie=U.get(J);Y=Math.max(ie,Y)}),O.push([K,Y])});let ee=C.current;F().sort((K,oe)=>{var Y,J;let ie=K.getAttribute("id"),de=oe.getAttribute("id");return((Y=U.get(de))!=null?Y:0)-((J=U.get(ie))!=null?J:0)}).forEach(K=>{let oe=K.closest(c1);oe?oe.appendChild(K.parentElement===oe?K:K.closest(`${c1} > *`)):ee.appendChild(K.parentElement===ee?K:K.closest(`${c1} > *`))}),O.sort((K,oe)=>oe[1]-K[1]).forEach(K=>{var oe;let Y=(oe=C.current)==null?void 0:oe.querySelector(`${Lf}[${zl}="${encodeURIComponent(K[0])}"]`);Y==null||Y.parentElement.appendChild(Y)})}function j(){let U=F().find(ee=>ee.getAttribute("aria-disabled")!=="true"),O=U==null?void 0:U.getAttribute(zl);A.setState("value",O||void 0)}function z(){var U,O,ee,K;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let oe=0;for(let Y of r.current){let J=(O=(U=i.current.get(Y))==null?void 0:U.value)!=null?O:"",ie=(K=(ee=i.current.get(Y))==null?void 0:ee.keywords)!=null?K:[],de=D(J,ie);n.current.filtered.items.set(Y,de),de>0&&oe++}for(let[Y,J]of o.current)for(let ie of J)if(n.current.filtered.items.get(ie)>0){n.current.filtered.groups.add(Y);break}n.current.filtered.count=oe}function Q(){var U,O,ee;let K=G();K&&(((U=K.parentElement)==null?void 0:U.firstChild)===K&&((ee=(O=K.closest(Lf))==null?void 0:O.querySelector(RAe))==null||ee.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function G(){var U;return(U=C.current)==null?void 0:U.querySelector(`${M2}[aria-selected="true"]`)}function F(){var U;return Array.from(((U=C.current)==null?void 0:U.querySelectorAll(ZD))||[])}function H(U){let O=F()[U];O&&A.setState("value",O.getAttribute(zl))}function $(U){var O;let ee=G(),K=F(),oe=K.findIndex(J=>J===ee),Y=K[oe+U];(O=a.current)!=null&&O.loop&&(Y=oe+U<0?K[K.length-1]:oe+U===K.length?K[0]:K[oe+U]),Y&&A.setState("value",Y.getAttribute(zl))}function V(U){let O=G(),ee=O==null?void 0:O.closest(Lf),K;for(;ee&&!K;)ee=U>0?LAe(ee,Lf):FAe(ee,Lf),K=ee==null?void 0:ee.querySelector(ZD);K?A.setState("value",K.getAttribute(zl)):$(U)}let X=()=>H(F().length-1),I=U=>{U.preventDefault(),U.metaKey?X():U.altKey?V(1):$(1)},q=U=>{U.preventDefault(),U.metaKey?H(0):U.altKey?V(-1):$(-1)};return P.createElement(je.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:U=>{var O;if((O=x.onKeyDown)==null||O.call(x,U),!U.defaultPrevented)switch(U.key){case"n":case"j":{v&&U.ctrlKey&&I(U);break}case"ArrowDown":{I(U);break}case"p":case"k":{v&&U.ctrlKey&&q(U);break}case"ArrowUp":{q(U);break}case"Home":{U.preventDefault(),H(0);break}case"End":{U.preventDefault(),X();break}case"Enter":if(!U.nativeEvent.isComposing&&U.keyCode!==229){U.preventDefault();let ee=G();if(ee){let K=new Event(H_);ee.dispatchEvent(K)}}}}},P.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:zAe},l),Jy(e,U=>P.createElement(TB.Provider,{value:A},P.createElement(PB.Provider,{value:M},U))))}),TAe=P.forwardRef((e,t)=>{var n,r;let o=Yn(),i=P.useRef(null),s=P.useContext(kB),a=Kp(),l=OB(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:s==null?void 0:s.forceMount;Ic(()=>{if(!c)return a.item(o,s==null?void 0:s.id)},[c]);let u=MB(o,i,[e.value,e.children,i],e.keywords),d=I2(),p=Dc(E=>E.value&&E.value===u.current),h=Dc(E=>c||a.filter()===!1?!0:E.search?E.filtered.items.get(o)>0:!0);P.useEffect(()=>{let E=i.current;if(!(!E||e.disabled))return E.addEventListener(H_,m),()=>E.removeEventListener(H_,m)},[h,e.onSelect,e.disabled]);function m(){var E,A;b(),(A=(E=l.current).onSelect)==null||A.call(E,u.current)}function b(){d.setState("value",u.current,!0)}if(!h)return null;let{disabled:v,value:x,onSelect:w,forceMount:_,keywords:R,...C}=e;return P.createElement(je.div,{ref:ip([i,t]),...C,id:o,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!p,"data-disabled":!!v,"data-selected":!!p,onPointerMove:v||a.getDisablePointerSelection()?void 0:b,onClick:v?void 0:m},e.children)}),kAe=P.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...i}=e,s=Yn(),a=P.useRef(null),l=P.useRef(null),c=Yn(),u=Kp(),d=Dc(h=>o||u.filter()===!1?!0:h.search?h.filtered.groups.has(s):!0);Ic(()=>u.group(s),[]),MB(s,a,[e.value,e.heading,l]);let p=P.useMemo(()=>({id:s,forceMount:o}),[o]);return P.createElement(je.div,{ref:ip([a,t]),...i,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&P.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),Jy(e,h=>P.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},P.createElement(kB.Provider,{value:p},h))))}),AAe=P.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=P.useRef(null),i=Dc(s=>!s.search);return!n&&!i?null:P.createElement(je.div,{ref:ip([o,t]),...r,"cmdk-separator":"",role:"separator"})}),OAe=P.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,i=I2(),s=Dc(u=>u.search),a=Dc(u=>u.value),l=Kp(),c=P.useMemo(()=>{var u;let d=(u=l.listInnerRef.current)==null?void 0:u.querySelector(`${M2}[${zl}="${encodeURIComponent(a)}"]`);return d==null?void 0:d.getAttribute("id")},[]);return P.useEffect(()=>{e.value!=null&&i.setState("search",e.value)},[e.value]),P.createElement(je.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:o?e.value:s,onChange:u=>{o||i.setState("search",u.target.value),n==null||n(u.target.value)}})}),MAe=P.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,i=P.useRef(null),s=P.useRef(null),a=Kp();return P.useEffect(()=>{if(s.current&&i.current){let l=s.current,c=i.current,u,d=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let p=l.offsetHeight;c.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return d.observe(l),()=>{cancelAnimationFrame(u),d.unobserve(l)}}},[]),P.createElement(je.div,{ref:ip([i,t]),...o,"cmdk-list":"",role:"listbox","aria-label":r,id:a.listId},Jy(e,l=>P.createElement("div",{ref:ip([s,a.listInnerRef]),"cmdk-list-sizer":""},l)))}),IAe=P.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:i,container:s,...a}=e;return P.createElement(p2,{open:n,onOpenChange:r},P.createElement(g2,{container:s},P.createElement(Uy,{"cmdk-overlay":"",className:o}),P.createElement(Gy,{"aria-label":e.label,"cmdk-dialog":"",className:i},P.createElement(AB,{ref:t,...a}))))}),DAe=P.forwardRef((e,t)=>Dc(n=>n.filtered.count===0)?P.createElement(je.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),NAe=P.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...i}=e;return P.createElement(je.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Jy(e,s=>P.createElement("div",{"aria-hidden":!0},s)))}),Eo=Object.assign(AB,{List:MAe,Item:TAe,Input:OAe,Group:kAe,Separator:AAe,Dialog:IAe,Empty:DAe,Loading:NAe});function LAe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function FAe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function OB(e){let t=P.useRef(e);return Ic(()=>{t.current=e}),t}var Ic=typeof window>"u"?P.useEffect:P.useLayoutEffect;function Su(e){let t=P.useRef();return t.current===void 0&&(t.current=e()),t}function ip(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function Dc(e){let t=I2(),n=()=>e(t.snapshot());return w9.useSyncExternalStore(t.subscribe,n,n)}function MB(e,t,n,r=[]){let o=P.useRef(),i=Kp();return Ic(()=>{var s;let a=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():o.current}})(),l=r.map(c=>c.trim());i.value(e,a,l),(s=t.current)==null||s.setAttribute(zl,a),o.current=a}),o}var jAe=()=>{let[e,t]=P.useState(),n=Su(()=>new Map);return Ic(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function $Ae(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Jy({asChild:e,children:t},n){return e&&P.isValidElement(t)?P.cloneElement($Ae(t),{ref:t.ref},n(t.props.children)):n(t)}var zAe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const IB=P.forwardRef(({className:e,...t},n)=>y.jsx(Eo,{ref:n,className:me("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));IB.displayName=Eo.displayName;const DB=P.forwardRef(({className:e,...t},n)=>y.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[y.jsx(SL,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),y.jsx(Eo.Input,{ref:n,className:me("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})]}));DB.displayName=Eo.Input.displayName;const NB=P.forwardRef(({className:e,...t},n)=>y.jsx(Eo.List,{ref:n,className:me("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));NB.displayName=Eo.List.displayName;const LB=P.forwardRef((e,t)=>y.jsx(Eo.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));LB.displayName=Eo.Empty.displayName;const FB=P.forwardRef(({className:e,...t},n)=>y.jsx(Eo.Group,{ref:n,className:me("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}));FB.displayName=Eo.Group.displayName;const BAe=P.forwardRef(({className:e,...t},n)=>y.jsx(Eo.Separator,{ref:n,className:me("-mx-1 h-px bg-border",e),...t}));BAe.displayName=Eo.Separator.displayName;const jB=P.forwardRef(({className:e,...t},n)=>y.jsx(Eo.Item,{ref:n,className:me("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}));jB.displayName=Eo.Item.displayName;var HAe=Object.defineProperty,VAe=(e,t,n)=>t in e?HAe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wm=(e,t,n)=>VAe(e,typeof t!="symbol"?t+"":t,n);const WAe={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},UAe={stringify:e=>e.name,parse:(e,t,n)=>{const r=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof r=="function"?r.bind(n):void 0}},GAe={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)},qAe={stringify:e=>`${e}`,parse:e=>parseFloat(e)},YAe={stringify:e=>e,parse:e=>e},u1={string:YAe,number:qAe,boolean:WAe,function:UAe,json:GAe};function KAe(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,n,r)=>`${n}-${r.toLowerCase()}`)}const Um=Symbol.for("r2wc.render"),Gm=Symbol.for("r2wc.connected"),Al=Symbol.for("r2wc.context"),Fs=Symbol.for("r2wc.props");function XAe(e,t,n){var r,o,i;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]),t.events||(t.events=[]);const s=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),a=Array.isArray(t.events)?t.events.slice():Object.keys(t.events),l={},c={},u={},d={};for(const h of s){l[h]=Array.isArray(t.props)?"string":t.props[h];const m=KAe(h);u[h]=m,d[m]=h}for(const h of a)c[h]=Array.isArray(t.events)?{}:t.events[h];class p extends HTMLElement{constructor(){super(),Wm(this,i,!0),Wm(this,o),Wm(this,r,{}),Wm(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[Fs].container=this.container;for(const m of s){const b=u[m],v=this.getAttribute(b),x=l[m],w=x?u1[x]:null;w!=null&&w.parse&&v&&(this[Fs][m]=w.parse(v,b,this))}for(const m of a)this[Fs][m]=b=>{const v=m.replace(/^on/,"").toLowerCase();this.dispatchEvent(new CustomEvent(v,{detail:b,...c[m]}))}}static get observedAttributes(){return Object.keys(d)}connectedCallback(){this[Gm]=!0,this[Um]()}disconnectedCallback(){this[Gm]=!1,this[Al]&&n.unmount(this[Al]),delete this[Al]}attributeChangedCallback(m,b,v){const x=d[m],w=l[x],_=w?u1[w]:null;x in l&&_!=null&&_.parse&&v&&(this[Fs][x]=_.parse(v,m,this),this[Um]())}[(i=Gm,o=Al,r=Fs,Um)](){this[Gm]&&(this[Al]?n.update(this[Al],this[Fs]):this[Al]=n.mount(this.container,e,this[Fs]))}}for(const h of s){const m=u[h],b=l[h];Object.defineProperty(p.prototype,h,{enumerable:!0,configurable:!0,get(){return this[Fs][h]},set(v){this[Fs][h]=v;const x=b?u1[b]:null;if(x!=null&&x.stringify){const w=x.stringify(v,m,this);this.getAttribute(m)!==w&&this.setAttribute(m,w)}else this[Um]()}})}return p}function QAe(e,t,n){const r=w1(e),o=T.createElement(t,n);return r.render(o),{root:r,ReactComponent:t}}function ZAe({root:e,ReactComponent:t},n){const r=T.createElement(t,n);e.render(r)}function JAe({root:e}){e.unmount()}function eOe(e,t={}){return XAe(e,t,{mount:QAe,update:ZAe,unmount:JAe})}const tOe={id:"string",version:"string",authToken:"json",placeholders:"json",defaultFilterValues:"json",currentTheme:"string",customCards:"json",customStyle:"json",onChartElementClicked:"function",onFilterValuesChange:"function",onEvent:"function",onSave:"function",LoadingComponent:"function",ErrorComponent:"function",showAssistant:"boolean",selectedSheetId:"string"},nOe=eOe(B7,{props:tOe});exports.$e=Hxe;exports.Accordion=mAe;exports.AccordionContent=EB;exports.AccordionItem=_B;exports.AccordionTrigger=CB;exports.Button=nr;exports.Calendar=sL;exports.Card=GN;exports.CardContent=T0;exports.CardDescription=lC;exports.CardHeader=P0;exports.CardTitle=Od;exports.CaretSortIcon=vee;exports.ChartJsVisual=QE;exports.ChatInput=E$;exports.ChatStatus=S$;exports.Check=Id;exports.CheckIcon=zC;exports.Checkbox=Dy;exports.ChevronDown=bp;exports.ChevronLeft=BC;exports.ChevronRight=G0;exports.ChevronUp=aL;exports.Circle=HC;exports.ColorFormat=K6;exports.Command=IB;exports.CommandEmpty=LB;exports.CommandGroup=FB;exports.CommandInput=DB;exports.CommandItem=jB;exports.CommandList=NB;exports.Copy=VC;exports.CopyButton=e9;exports.Cross2Icon=tL;exports.DATAMODEL_NAMESPCACE=Q_;exports.Dashboard=B7;exports.DashboardPanel=YN;exports.DashboardTabs=$7;exports.DashboardWC=nOe;exports.Dialog=VTe;exports.DialogContent=Vz;exports.DialogDescription=qz;exports.DialogFooter=Uz;exports.DialogHeader=Wz;exports.DialogTitle=Gz;exports.DialogTrigger=WTe;exports.Download=lL;exports.DropdownMenu=jTe;exports.DropdownMenuCheckboxItem=jz;exports.DropdownMenuContent=Lz;exports.DropdownMenuItem=Fz;exports.DropdownMenuLabel=zz;exports.DropdownMenuRadioGroup=zTe;exports.DropdownMenuRadioItem=$z;exports.DropdownMenuSeparator=Bz;exports.DropdownMenuTrigger=$Te;exports.Editable=ss;exports.EditorAside=Kz;exports.EditorMain=Xz;exports.EditorPanel=Yz;exports.ErrorBoundary=Y0;exports.Eye=uL;exports.EyeOff=cL;exports.Fallback=UC;exports.FallbackEditorCard=ite;exports.Filter=dL;exports.FilterComponent=AR;exports.FilterHeader=t9;exports.FilterX=WC;exports.Ft=Zke;exports.GripVertical=fL;exports.HoverCard=Rp;exports.HoverCardContent=Bd;exports.HoverCardTrigger=Pp;exports.Icon=iL;exports.IdCard=hL;exports.Info=pL;exports.Input=hc;exports.KPICard=qb;exports.LOCALE_CURRENCY_PAIRS=S1;exports.Label=wn;exports.Le=qke;exports.Lightbulb=mL;exports.LightbulbOff=gL;exports.MultiInputEmptyRenderer=tj;exports.Octagon=bL;exports.PYTHON_DEFAULT_CODE=X_;exports.Pencil=yL;exports.Percent=vL;exports.Play=xL;exports.Plus=q0;exports.Popover=Sy;exports.PopoverContent=Mp;exports.PopoverTrigger=_y;exports.PrintMessages=_$;exports.RadioGroup=Gh;exports.RadioGroupItem=ql;exports.ResizableHandle=iPe;exports.ResizablePanel=j_;exports.ResizablePanelGroup=Y$;exports.ScrollArea=pc;exports.ScrollBar=Ip;exports.Search=SL;exports.SearchX=wL;exports.Select=Hs;exports.SelectContent=Gi;exports.SelectGroup=xu;exports.SelectItem=In;exports.SelectLabel=Fl;exports.SelectSeparator=gh;exports.SelectTrigger=Ui;exports.SelectValue=Vs;exports.SemaphorContextProvider=WN;exports.SemaphorQueryClient=HN;exports.SendHorizontal=_L;exports.Separator=hy;exports.Settings=CL;exports.SliderIcon=Pee;exports.SquarePen=EL;exports.Switch=cB;exports.Table2=RL;exports.TableBody=HE;exports.TableCell=WE;exports.TableHead=VE;exports.TableHeader=BE;exports.TableRow=hh;exports.TableVisual=Z6;exports.Tabs=pC;exports.TabsContent=gC;exports.TabsList=M0;exports.TabsTrigger=I0;exports.TextCard=Jb;exports.Textarea=OR;exports.Toggle=Cy;exports.Tooltip=w3;exports.TooltipContent=$E;exports.TooltipTrigger=S3;exports.TooltipTrigger$1=jE;exports.TreePalm=PL;exports.TriangleDownIcon=nL;exports.TriangleUpIcon=rL;exports.UXProvider=z7;exports.UserRound=TL;exports.UserSearch=kL;exports.X=$c;exports._=rc;exports.cn=me;exports.createChartConfig=_E;exports.createLucideIcon=Bt;exports.createSqlGenConfig=lX;exports.de=rB;exports.dedup=R2e;exports.flexRender=US;exports.fmt=J_;exports.getCanvasBackgroundColor=Rh;exports.getColumnDataType=cX;exports.getContrastColor=ad;exports.getCoreRowModel=$3;exports.getDefaultFilterSql=Xve;exports.getFilterValueType=Ou;exports.getFormattedTableNameForQuery=PN;exports.getKeys=lr;exports.getNumberAxis=qC;exports.getPaginationRowModel=z3;exports.getPlugins=SX;exports.getQualifiedTableName=tC;exports.getRequest=mX;exports.getSortedRowModel=B3;exports.getSql=aX;exports.getStatus=C$;exports.getTenantAndEndUserId=bX;exports.getTokenParams=kN;exports.hslStringToHex=OL;exports.invalidateToken=xX;exports.isBooleanDataType=eC;exports.isColumnInSqlGen=uX;exports.isDateDataType=Ad;exports.isInAiScopeArray=E2e;exports.isNumberDataType=up;exports.isObjectEmpty=gX;exports.isTextDataType=C0;exports.jsxRuntimeExports=y;exports.loadManifest=J6;exports.pivotData=Sb;exports.postRequest=R0;exports.removeFromScopeArray=P2e;exports.removeRing=nh;exports.resolveDataType=E0;exports.titleCase=vX;exports.ue=n9;exports.useCard=vce;exports.useChat=A9;exports.useCustomVisual=ej;exports.useDashboardActions=Hn;exports.useDashboardCardQuery=Ga;exports.useDashboardStore=ye;exports.useDateFilterHook=zbe;exports.useEditorActions=mp;exports.useEditorStore=go;exports.useQuery=fp;exports.useQueryClient=aC;exports.useReactTable=H3;exports.useSemaphorContext=Go;exports.useTextFilterHook=Qve;exports.useTheme=ON;exports.useTopoJson=A4;exports.v4=Ua;
|